Skip to content

Commit bdf8b55

Browse files
authored
Merge pull request #162 from timlrx/update-contentlayer
Update contentlayer and other dependencies
2 parents 4651f6d + f0a7c10 commit bdf8b55

8 files changed

+2075
-1477
lines changed

.changeset/fluffy-rats-knock.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': patch
3+
---
4+
5+
Add liClassName prop for TOCInline

.changeset/nervous-dryers-repair.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': minor
3+
---
4+
5+
update dependencies

.changeset/nervous-ghosts-confess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': patch
3+
---
4+
5+
Add microsoft clarity analytics

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"husky": "^8.0.0",
3737
"lint-staged": "^13.0.0",
3838
"prettier": "^3.0.0",
39-
"turbo": "1.10.7",
40-
"vitest": "0.33.0"
39+
"turbo": "1.13.0",
40+
"vitest": "1.4.0"
4141
},
4242
"workspaces": {
4343
"packages": [

packages/pliny/add-use-client.mjs

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
import fs from 'fs'
22
import globby from 'globby'
33

4-
// Append "use client" to all path chunks that contain "use" hooks
5-
// So these packages can be directly used in Next.js directly
6-
// This allows us to see support file splitting with easy next import
7-
;(async () => {
8-
console.log('Added use client directive to the following files:')
9-
const chunkPaths = await globby('chunk*')
10-
for (const path of chunkPaths) {
11-
const data = fs.readFileSync(path, 'utf8')
12-
if (
13-
/useState|useEffect|useRef|useCallback|useContext|useMemo|useTheme|useRouter|useRegisterActions|useMatches|useKBar/.test(
14-
data
15-
)
16-
) {
4+
// Append "use client" to all path chunks that contain "use" hooks
5+
// So these packages can be directly used in Next.js directly
6+
// This allows us to see support file splitting with easy next import
7+
; (async () => {
8+
console.log('Added use client directive to the following files:')
9+
const chunkPaths = await globby('chunk*')
10+
for (const path of chunkPaths) {
11+
const data = fs.readFileSync(path, 'utf8')
12+
if (
13+
/useState|useEffect|useRef|useCallback|useContext|useMemo|useTheme|useRouter|useRegisterActions|useMatches|useKBar/.test(
14+
data
15+
)
16+
) {
17+
console.log(path)
18+
const insert = Buffer.from('"use client"\n')
19+
fs.writeFileSync(path, insert + data)
20+
}
21+
}
22+
// Handle ui differently as they are not split
23+
const clientPaths = await globby([
24+
'ui/NewsletterForm.js',
25+
'ui/BlogNewsletterForm.js',
26+
'ui/Pre.js',
27+
'search/KBarButton.js',
28+
'search/AlgoliaButton.js',
29+
])
30+
for (const path of clientPaths) {
1731
console.log(path)
32+
const data = fs.readFileSync(path)
1833
const insert = Buffer.from('"use client"\n')
1934
fs.writeFileSync(path, insert + data)
2035
}
21-
}
22-
// Handle ui differently as they are not split
23-
const clientPaths = await globby([
24-
'ui/NewsletterForm.js',
25-
'ui/BlogNewsletterForm.js',
26-
'ui/Pre.js',
27-
'search/KBarButton.js',
28-
'search/AlgoliaButton.js',
29-
])
30-
for (const path of clientPaths) {
31-
console.log(path)
32-
const data = fs.readFileSync(path)
33-
const insert = Buffer.from('"use client"\n')
34-
fs.writeFileSync(path, insert + data)
35-
}
36-
})()
36+
})()

packages/pliny/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
"author": "Timothy Lin <[email protected]> (https://timlrx.com)",
2626
"dependencies": {
2727
"@docsearch/react": "^3.5.0",
28-
"@giscus/react": "^2.3.0",
28+
"@giscus/react": "^3.0.0",
2929
"@mailchimp/mailchimp_marketing": "^3.0.80",
30-
"contentlayer": "^0.3.4",
30+
"contentlayer2": "^0.4.4",
3131
"copyfiles": "^2.4.1",
3232
"github-slugger": "^2.0.0",
3333
"js-yaml": "4.1.0",
3434
"kbar": "0.1.0-beta.45",
35-
"next-contentlayer": "^0.3.4",
36-
"next-themes": "^0.2.1",
35+
"next-contentlayer2": "^0.4.4",
36+
"next-themes": "^0.3.0",
3737
"probe-image-size": "^7.2.3",
38-
"remark": "^14.0.2",
39-
"unist-util-visit": "^4.1.0"
38+
"remark": "^15.0.0",
39+
"unist-util-visit": "^5.0.0"
4040
},
4141
"peerDependencies": {
4242
"next": ">=13.0.0",
@@ -45,11 +45,11 @@
4545
},
4646
"devDependencies": {
4747
"@types/copyfiles": "^2",
48-
"next": "13.4.10",
48+
"next": "14.1.4",
4949
"react": "18.2.0",
5050
"react-dom": "18.2.0",
5151
"rimraf": "^3.0.2",
52-
"tsup": "7.1.0",
52+
"tsup": "8.0.2",
5353
"typescript": "^5.1.6"
5454
},
5555
"lint-staged": {

packages/pliny/src/utils/contentlayer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Document, MDX } from 'contentlayer/core'
1+
import type { Document, MDX } from 'contentlayer2/core'
22

33
const isProduction = process.env.NODE_ENV === 'production'
44

0 commit comments

Comments
 (0)