Skip to content

Commit c277202

Browse files
Migrated basics from yarn + lerna to turbo + pnpm
1 parent 6493adc commit c277202

File tree

18 files changed

+15410
-18070
lines changed

18 files changed

+15410
-18070
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules
66
# builds
77
build
88
dist
9+
types
910

1011
# misc
1112
.DS_Store
@@ -24,3 +25,4 @@ yarn-error.log*
2425

2526
.next/
2627
.vercel/
28+
.turbo/

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run pre-commit
4+
pnpm run pre-commit

examples/cra/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"notion-types": "^6.15.6",
1616
"react": "^17.0.2",
1717
"react-dom": "^17.0.2",
18-
"react-notion-x": "^6.16.0",
18+
"react-notion-x": "workspace:*",
1919
"react-scripts": "5.0.0",
2020
"typescript": "^4.6.3"
2121
},

examples/full/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"got": "^12.0.2",
1919
"lqip-modern": "^1.2.0",
2020
"next": "^12.1.0",
21-
"notion-client": "^6.16.0",
21+
"notion-client": "workspace:*",
2222
"notion-compat": "^6.16.0",
23-
"notion-utils": "^6.16.0",
23+
"notion-types": "workspace:*",
24+
"notion-utils": "workspace:*",
2425
"p-map": "^5.3.0",
2526
"p-memoize": "^6.0.1",
2627
"react": "^17.0.2",

examples/full/yarn.lock

Lines changed: 0 additions & 1934 deletions
This file was deleted.

examples/minimal/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
},
1212
"dependencies": {
1313
"next": "^12.1.0",
14-
"notion-client": "^6.16.0",
15-
"notion-utils": "^6.16.0",
14+
"notion-client": "workspace:*",
15+
"notion-types": "workspace:*",
16+
"notion-utils": "workspace:*",
1617
"react": "^17.0.2",
1718
"react-dom": "^17.0.2",
18-
"react-notion-x": "^6.16.0"
19+
"react-notion-x": "workspace:*"
1920
},
2021
"devDependencies": {
2122
"@types/node": "^16.11.2",

examples/minimal/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"incremental": true
1818
},
1919
"exclude": ["node_modules"],
20-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
20+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
2121
}

examples/minimal/yarn.lock

Lines changed: 0 additions & 1934 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,20 @@
1414
"examples/*"
1515
],
1616
"scripts": {
17-
"build": "run-s build:*",
17+
"build": "turbo run build",
1818
"build:tsc": "tsc --build",
19-
"build:tsup": "lerna run build --no-private",
2019
"watch": "run-p watch:* --continue-on-error",
2120
"watch:tsc": "tsc --build --watch --preserveWatchOutput",
22-
"watch:tsup": "lerna run watch --no-private --parallel",
23-
"link": "lerna exec \"yarn link\" --no-private",
24-
"dev": "run-s watch",
25-
"prebuild": "run-s clean",
26-
"prewatch": "run-s clean",
21+
"dev": "turbo run dev",
2722
"clean": "del packages/*/build",
2823
"pretest": "run-s build",
24+
"start": "turbo run start",
2925
"test": "run-p test:*",
30-
"test:unit": "lerna run test",
26+
"test:unit": "turbo run test",
3127
"test:eslint": "eslint '**/*.{ts,tsx}'",
3228
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check",
33-
"bootstrap": "lerna bootstrap",
29+
"types": "turbo run types",
3430
"predeploy": "run-s build",
35-
"deploy": "lerna publish",
36-
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') < 0) throw new Error('this package requires yarn for development')\"",
37-
"postinstall": "run-s bootstrap",
3831
"prepare": "husky install",
3932
"pre-commit": "lint-staged"
4033
},
@@ -56,7 +49,8 @@
5649
"prettier": "^2.7.1",
5750
"ts-node": "^10.9.1",
5851
"tsup": "^6.2.3",
59-
"typescript": "^4.8.4"
52+
"typescript": "^4.8.4",
53+
"turbo": "^1.4.6"
6054
},
6155
"lint-staged": {
6256
"*.{ts,tsx}": [

packages/notion-types/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
"repository": "NotionX/react-notion-x",
77
"author": "Travis Fischer <[email protected]>",
88
"license": "MIT",
9-
"types": "./build/index.d.ts",
9+
"types": "./types/index.d.ts",
1010
"sideEffects": false,
1111
"files": [
1212
"build"
1313
],
14+
"scripts": {
15+
"build": "tsc --emitDeclarationOnly --declaration",
16+
"watch": "tsup --watch --silent --onSuccess 'echo build successful'"
17+
},
1418
"engines": {
1519
"node": ">=12"
1620
}

0 commit comments

Comments
 (0)