[Snyk] Upgrade contentlayer from 0.3.0 to 0.3.4 #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Release notes
Package name: contentlayer
-
0.3.4 - 2023-06-29
- Added
- Added images example
- Support for esbuild 0.18 (closes #496)
- Upgraded various dependencies (incl.
- Added MIT license to all sub packages in the Contentlayer mono repo (closes #482)
- next-contentlayer should have contentlayer as peerDependency #447
- 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
import { makeSource } from '@ contentlayer/source-files'
-
0.3.3-dev.1 - 2023-05-31
-
0.3.3-dev.0 - 2023-05-31
-
0.3.2 - 2023-04-24
- 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:
-
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
// app/some-dynamic-page.tsx
// contentlayer.config.ts
- 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
from contentlayer GitHub release notesℹ️ [TLDR] Many smaller bug fixes, improvements and updated dependencies
Improvements
aspectRatioproperty toImageFieldDatafortype: imagefieldsyamlpackage - closes #488)Bug fixes
ℹ️ [TLDR] New onSuccess callback that runs after completing a build successfully
✨
onSuccessCallbackA 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.
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.
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
bodyfield in frontmatter. Now, both Markdown and MDX files behave in the same way, supporting abodyfield in the frontmatter. See #451 for details.Upgraded Dependencies
Dependencies have been upgraded to avoid warning messages. Fixes #360.
ℹ️ [TLDR] Bug fixes for
next dev, Support fornext export, bug fixes and updated dependenciesImproved
next-contentlayerintegrationAs part of
0.3.2we've overhauled thenext-contentlayerintegration 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
redirectsworkaround) Contentlayer now also works withnext export. (closes #426)Other Improvements
contentDirIncludedidn'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. 💜
ℹ️ [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/getStaticPathsapproach. 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)
fetchContentAPI for thecontentlayer/source-remote-filescontent source. (Closes #85).Here is a shortend example of how to use it (see full example for full details):
import { fetchContent } from 'contentlayer/generated'
export default function SomeDynamicPage({ }) {
const contentResult = await fetchContent('some-branch')
return <div>{content}</div>
}
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
Read more
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