Skip to content

Conversation

@AIzooLab
Copy link

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade contentlayer from 0.3.0 to 0.3.4.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 17 versions ahead of your current version.
  • The recommended version was released 10 months ago, on 2023-06-29.
Release notes
Package name: contentlayer
  • 0.3.4 - 2023-06-29

    ℹ️ [TLDR] Many smaller bug fixes, improvements and updated dependencies

    Improvements

    • Added aspectRatio property to ImageFieldData for type: image fields
    • Added images example
    • Support for esbuild 0.18 (closes #496)
    • Upgraded various dependencies (incl. yaml package - closes #488)
    • Added MIT license to all sub packages in the Contentlayer mono repo (closes #482)
    • next-contentlayer should have contentlayer as peerDependency #447

    Bug fixes

    • Fix Bug in calculation of "_raw.flattenedPath" (closes #487)
  • 0.3.4-dev.1 - 2023-06-29
  • 0.3.4-dev.0 - 2023-06-29
  • 0.3.3 - 2023-05-31

    ℹ️ [TLDR] New onSuccess callback that runs after completing a build successfully

    onSuccess Callback

    A new callback will now be called when a successful build has completed.

    The callback function receives a single argument that is an asynchronous function from which you can access data objects processed and generated by Contentlayer.

    import { makeSource } from '@ contentlayer/source-files'

    export default makeSource({
    onSuccess: async (importData) => {
    const { allDocuments } = await importData()
    console.log('allDocuments', allDocuments.length)
    }
    })

    Running a build with the above configuration would yield something like the following on the console.

    allDocuments 3
    

    Closes #473

    Better Non-Latin Character Support

    Support has improved for characters in non-Latin languages. Fixes #337.

    🙌 Thanks to @ huanfe1 for help!

    Other Improvements

    Here are the other improvements shipped with this version.

    Fix Body Field Handling for MDX

    @ stefanprobst resolved the discrepancy in handling a body field in frontmatter. Now, both Markdown and MDX files behave in the same way, supporting a body field in the frontmatter. See #451 for details.

    Upgraded Dependencies

    Dependencies have been upgraded to avoid warning messages. Fixes #360.

  • 0.3.3-dev.1 - 2023-05-31
  • 0.3.3-dev.0 - 2023-05-31
  • 0.3.2 - 2023-04-24

    ℹ️ [TLDR] Bug fixes for next dev, Support for next export, bug fixes and updated dependencies

    Improved next-contentlayer integration

    As part of 0.3.2 we've overhauled the next-contentlayer integration with the goal of making it more stable and less dependent on implementation details of Next.js. This fixes #415 and #416 (thanks @ kamto7).

    As part of this effort (and by no longer relying on the redirects workaround) Contentlayer now also works with next export. (closes #426)

    Other Improvements

    • Fix: Opentelemetry version incompatibility with next 13.2 (closes #407 - thanks @ jgillich)
    • Fix: Type resolution when using modern TypeScript module resolution (closes #373 - thanks @ jrolfs)
    • Fix: Korean file names are not supported (closes #431 - thanks @ mi-reu)
    • Fix: contentDirInclude didn't work in some cases (closes #383 - thanks to @ teobler)

    Note about state of the project

    Please also take a look at #429 to read about the current state of the project. 💜

  • 0.3.2-dev.4 - 2023-04-24
  • 0.3.2-dev.3 - 2023-04-24
  • 0.3.2-dev.2 - 2023-04-24
  • 0.3.2-dev.1 - 2023-04-24
  • 0.3.2-dev.0 - 2023-04-24
  • 0.3.1 - 2023-03-28

    ℹ️ [TLDR] React Server Components support, Dynamic content fetching (experimental), updated dependencies, bug fixes

    React Server Components (RSC) support

    We're super excited to announce that Contentlayer now supports React Server Components (RSC) out of the box! 🎉

    We've updated our Next.js example to use RSC and it works like a charm. You can find the full example here. (Our docs will be updated shortly as well.)

    We now recommend using RSC over the old getStaticProps/getStaticPaths approach. RSC is much more flexible and even allows you to use Contentlayer's dynamic content fetching API (see below).

    Note: While it's theoretically also possible to use Contentlayer combined with the 'use client' approach, we don't recommend it as it massively increases page sizes and thus the page load time.

    Experimental: Dynamic content fetching (e.g. in React Server Components)

    Contentlayer is mostly used to build content-based static sites. However, in some cases it can be required/useful to fetch & process (remote) content dynamically at runtime (e.g. via React Server Components). This is now possible with the new (still experimental) fetchContent API for the contentlayer/source-remote-files content source. (Closes #85).

    Here is a shortend example of how to use it (see full example for full details):

    // app/some-dynamic-page.tsx
    import { fetchContent } from 'contentlayer/generated'

    export default function SomeDynamicPage({ }) {
    const contentResult = await fetchContent('some-branch')

    return <div>{content}</div>
    }

    // contentlayer.config.ts
    import { defineDocumentType } from 'contentlayer/source-files'
    import { makeSource } from 'contentlayer/source-remote-files'

    const Post = defineDocumentType(() => ({
    // ...
    }))

    const syncContentFromGit = async ({ contentDir, gitTag }: { contentDir: string; gitTag: string }) => {
    // See full example
    }

    export default makeSource((contentBranch = 'main') => ({
    syncFiles: (contentDir) => syncContentFromGit({ contentDir, gitTag: contentBranch }),
    contentDirPath: content/repo-<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">sourceKey</span><span class="pl-kos">}</span></span>,
    documentTypes: [Post],
    experimental: { enableDynamicBuild: true },
    // ^^^^^^^^^^^^^^^^^^ enable dynamic content fetching
    }))

    Other Improvements

    • Fix: Unable to install contentlayer in NextJs v13.2.1 (closes #386)
    • Fix: contentType data doesn't support empty files (closes #361)
    • Fix: Replace faker with alternative library (closes #217 - thanks @ feliskio)
    • Fix: Incorrect type inference from Stackbit config (closes #363)
  • 0.3.1-dev.3 - 2023-03-27
  • 0.3.1-dev.2 - 2023-02-19
  • 0.3.1-dev.1 - 2023-02-18
  • 0.3.1-dev.0 - 2023-02-17
  • 0.3.0 - 2023-01-18
    Read more
from contentlayer GitHub release notes
Commit messages
Package name: contentlayer

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants