-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from timlrx/update-contentlayer
Update contentlayer and other dependencies
- Loading branch information
Showing
8 changed files
with
2,075 additions
and
1,477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'pliny': patch | ||
--- | ||
|
||
Add liClassName prop for TOCInline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'pliny': minor | ||
--- | ||
|
||
update dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'pliny': patch | ||
--- | ||
|
||
Add microsoft clarity analytics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
import fs from 'fs' | ||
import globby from 'globby' | ||
|
||
// Append "use client" to all path chunks that contain "use" hooks | ||
// So these packages can be directly used in Next.js directly | ||
// This allows us to see support file splitting with easy next import | ||
;(async () => { | ||
console.log('Added use client directive to the following files:') | ||
const chunkPaths = await globby('chunk*') | ||
for (const path of chunkPaths) { | ||
const data = fs.readFileSync(path, 'utf8') | ||
if ( | ||
/useState|useEffect|useRef|useCallback|useContext|useMemo|useTheme|useRouter|useRegisterActions|useMatches|useKBar/.test( | ||
data | ||
) | ||
) { | ||
// Append "use client" to all path chunks that contain "use" hooks | ||
// So these packages can be directly used in Next.js directly | ||
// This allows us to see support file splitting with easy next import | ||
; (async () => { | ||
console.log('Added use client directive to the following files:') | ||
const chunkPaths = await globby('chunk*') | ||
for (const path of chunkPaths) { | ||
const data = fs.readFileSync(path, 'utf8') | ||
if ( | ||
/useState|useEffect|useRef|useCallback|useContext|useMemo|useTheme|useRouter|useRegisterActions|useMatches|useKBar/.test( | ||
data | ||
) | ||
) { | ||
console.log(path) | ||
const insert = Buffer.from('"use client"\n') | ||
fs.writeFileSync(path, insert + data) | ||
} | ||
} | ||
// Handle ui differently as they are not split | ||
const clientPaths = await globby([ | ||
'ui/NewsletterForm.js', | ||
'ui/BlogNewsletterForm.js', | ||
'ui/Pre.js', | ||
'search/KBarButton.js', | ||
'search/AlgoliaButton.js', | ||
]) | ||
for (const path of clientPaths) { | ||
console.log(path) | ||
const data = fs.readFileSync(path) | ||
const insert = Buffer.from('"use client"\n') | ||
fs.writeFileSync(path, insert + data) | ||
} | ||
} | ||
// Handle ui differently as they are not split | ||
const clientPaths = await globby([ | ||
'ui/NewsletterForm.js', | ||
'ui/BlogNewsletterForm.js', | ||
'ui/Pre.js', | ||
'search/KBarButton.js', | ||
'search/AlgoliaButton.js', | ||
]) | ||
for (const path of clientPaths) { | ||
console.log(path) | ||
const data = fs.readFileSync(path) | ||
const insert = Buffer.from('"use client"\n') | ||
fs.writeFileSync(path, insert + data) | ||
} | ||
})() | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.