Skip to content

Commit

Permalink
TS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijesh Bittu committed Dec 11, 2024
1 parent 4003aa6 commit ae4a65b
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 51 deletions.
2 changes: 1 addition & 1 deletion packages/pigment-css-nextjs-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"watch": "tsup --watch --tsconfig tsconfig.build.json",
"copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup --tsconfig tsconfig.build.json",
"typecheck": "tsc --noEmit -p ."
"typescript": "tsc --noEmit -p ."
},
"dependencies": {
"@pigment-css/unplugin": "workspace:^"
Expand Down
3 changes: 2 additions & 1 deletion packages/pigment-css-nextjs-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"resolveJsonModule": true,
"target": "ES2015"
"target": "ES2015",
"skipLibCheck": true
},
"include": ["src/**/*.ts"],
"exclude": ["./tsup.config.ts"]
Expand Down
10 changes: 0 additions & 10 deletions packages/pigment-css-theme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2015",
"allowJs": true,
"lib": ["ES2017", "ES2021.String", "DOM"],
"composite": true,
"noEmit": false,
"resolveJsonModule": true,
"types": ["node", "mocha"],
"jsx": "react-jsx"
},
"include": ["src/**/*.js", "src/**/*.ts", "tests/**/*.spec.ts"],
"exclude": ["./tsup.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/pigment-css-unplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"watch": "tsup --watch --tsconfig tsconfig.build.json",
"copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup --tsconfig tsconfig.build.json",
"typecheck": "tsc --noEmit -p .",
"typescript": "tsc --noEmit -p .",
"test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/pigment-css-unplugin/**/*.test.{js,ts,tsx}'",
"test:ci": "cd ../../ && cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov --report-dir=./coverage/pigment-css-unplugin mocha 'packages/pigment-css-unplugin/**/*.test.{js,ts,tsx}'"
},
Expand Down
1 change: 1 addition & 0 deletions packages/pigment-css-unplugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"resolveJsonModule": true,
"target": "ES2022",
"lib": ["ES2021", "DOM"],
"skipLibCheck": true,
"paths": {
"@babel/core": ["./node_modules/@babel/core"],
"@pigment-css/react": ["./packages/pigment-css-react/src"],
Expand Down
7 changes: 1 addition & 6 deletions packages/pigment-css-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,9 @@
"build": {
"outputs": [
"{projectRoot}/build"
]
},
"typescript": {
],
"dependsOn": [
"^build"
],
"outputs": [
"{projectRoot}/build"
]
}
}
Expand Down
8 changes: 7 additions & 1 deletion packages/pigment-css-utils/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"compilerOptions": {
"composite": false
},
"exclude": ["./tsup.config.ts", "src/**/*.d.ts", "tests"]
"exclude": ["./tsup.config.ts", "src/**/*.d.ts", "tests"],

"references": [
{
"path": "../pigment-css-theme/tsconfig.build.json"
}
]
}
26 changes: 3 additions & 23 deletions packages/pigment-css-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2015",
"allowJs": true,
"lib": ["ES2017", "ES2021.String"],
"composite": true,
"noEmit": false,
"resolveJsonModule": true,
"types": ["node", "mocha"],
"jsx": "react-jsx",
"skipLibCheck": true,
"paths": {
"@babel/parser": ["./node_modules/@babel/parser/typings/babel-parser.d.ts"],
"@pigment-css/theme": ["../pigment-css-theme/src"],
"@pigment-css/theme/*": ["../pigment-css-theme/src/*"]
}
},
"include": [
"src/**/*.tsx",
"src/**/*.js",
"src/**/*.ts",
"tests/**/*.spec.ts",
"tests/**/*.spec.tsx"
"tests/**/*.spec.tsx",
"../pigment-css-theme/src/**/*.ts"
],
"exclude": ["./tsup.config.ts"],
"references": [
{
"path": "../pigment-css-theme"
}
]
"exclude": ["./tsup.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/pigment-css-vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"watch": "tsup --watch",
"copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup",
"typecheck": "tsc --noEmit -p ."
"typescript": "tsc --noEmit -p ."
},
"dependencies": {
"@babel/core": "^7.26.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/pigment-css-vite-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"skipLibCheck": true,
"paths": {
"@babel/core": ["./node_modules/@babel/core"],
"@pigment-css/react": ["./packages/pigment-css-react/src"],
"@pigment-css/react/*": ["./packages/pigment-css-react/src/*"]
"@babel/core": ["./node_modules/@babel/core"]
}
},
"include": ["src/**/*"],
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"module": "esnext",
"target": "es5",
"lib": ["es2020", "dom"],
// aligning with Node18 recommendation: https://www.npmjs.com/package/@tsconfig/node18
"target": "es2022",
"lib": ["es2020", "dom", "ES2021.String"],
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
Expand All @@ -18,6 +19,7 @@
"@pigment-css/nextjs-plugin/*": ["./packages/pigment-css-nextjs-plugin/src/*"],
"@pigment-css/react": ["./packages/pigment-css-react/src"],
"@pigment-css/react/*": ["./packages/pigment-css-react/src/*"],
"@pigment-css/unplugin": ["./packages/pigment-css-unplugin/src"],
"@pigment-css/vite-plugin": ["./packages/pigment-css-vite-plugin/src"],
"@pigment-css/vite-plugin/*": ["./packages/pigment-css-vite-plugin/src/*"],
"@mui-internal/api-docs-builder": ["./node_modules/@mui/monorepo/packages/api-docs-builder"],
Expand All @@ -30,7 +32,7 @@
"@pigment-css/utils/*": ["./packages/pigment-css-utils/src/*"]
},
// Otherwise we get react-native typings which conflict with dom.lib.
"types": ["node", "react"]
"types": ["node", "react", "mocha"]
},
"exclude": ["**/.*/", "**/build", "**/node_modules", "docs/export"]
}

0 comments on commit ae4a65b

Please sign in to comment.