diff --git a/packages/pigment-css-nextjs-plugin/package.json b/packages/pigment-css-nextjs-plugin/package.json index 7ccd6f82..21252bcf 100644 --- a/packages/pigment-css-nextjs-plugin/package.json +++ b/packages/pigment-css-nextjs-plugin/package.json @@ -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:^" diff --git a/packages/pigment-css-nextjs-plugin/tsconfig.json b/packages/pigment-css-nextjs-plugin/tsconfig.json index ad4f42a8..a9b99264 100644 --- a/packages/pigment-css-nextjs-plugin/tsconfig.json +++ b/packages/pigment-css-nextjs-plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "resolveJsonModule": true, - "target": "ES2015" + "skipLibCheck": true }, "include": ["src/**/*.ts"], "exclude": ["./tsup.config.ts"] diff --git a/packages/pigment-css-theme/tsconfig.json b/packages/pigment-css-theme/tsconfig.json index d730c259..5682dcf5 100644 --- a/packages/pigment-css-theme/tsconfig.json +++ b/packages/pigment-css-theme/tsconfig.json @@ -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"] } diff --git a/packages/pigment-css-unplugin/package.json b/packages/pigment-css-unplugin/package.json index 846d08ec..11ffa663 100644 --- a/packages/pigment-css-unplugin/package.json +++ b/packages/pigment-css-unplugin/package.json @@ -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}'" }, diff --git a/packages/pigment-css-unplugin/tsconfig.json b/packages/pigment-css-unplugin/tsconfig.json index b11b8a61..d685f7cd 100644 --- a/packages/pigment-css-unplugin/tsconfig.json +++ b/packages/pigment-css-unplugin/tsconfig.json @@ -1,15 +1,10 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "resolveJsonModule": true, - "target": "ES2022", - "lib": ["ES2021", "DOM"], + "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/*"] - }, - "types": ["node", "mocha", "chai"] + "@babel/core": ["./node_modules/@babel/core"] + } }, "include": ["src/**/*.ts"], "exclude": ["./tsup.config.ts"] diff --git a/packages/pigment-css-utils/package.json b/packages/pigment-css-utils/package.json index 9337e141..3da095c1 100644 --- a/packages/pigment-css-utils/package.json +++ b/packages/pigment-css-utils/package.json @@ -91,14 +91,9 @@ "build": { "outputs": [ "{projectRoot}/build" - ] - }, - "typescript": { + ], "dependsOn": [ "^build" - ], - "outputs": [ - "{projectRoot}/build" ] } } diff --git a/packages/pigment-css-utils/tsconfig.build.json b/packages/pigment-css-utils/tsconfig.build.json index 58bde1b8..0754eed4 100644 --- a/packages/pigment-css-utils/tsconfig.build.json +++ b/packages/pigment-css-utils/tsconfig.build.json @@ -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" + } + ] } diff --git a/packages/pigment-css-utils/tsconfig.json b/packages/pigment-css-utils/tsconfig.json index a4af3bd6..00ad5535 100644 --- a/packages/pigment-css-utils/tsconfig.json +++ b/packages/pigment-css-utils/tsconfig.json @@ -1,21 +1,5 @@ { "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", @@ -23,10 +7,5 @@ "tests/**/*.spec.ts", "tests/**/*.spec.tsx" ], - "exclude": ["./tsup.config.ts"], - "references": [ - { - "path": "../pigment-css-theme" - } - ] + "exclude": ["./tsup.config.ts"] } diff --git a/packages/pigment-css-vite-plugin/package.json b/packages/pigment-css-vite-plugin/package.json index bbbde65f..f8b71f68 100644 --- a/packages/pigment-css-vite-plugin/package.json +++ b/packages/pigment-css-vite-plugin/package.json @@ -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", diff --git a/packages/pigment-css-vite-plugin/tsconfig.json b/packages/pigment-css-vite-plugin/tsconfig.json index b7872967..069cf630 100644 --- a/packages/pigment-css-vite-plugin/tsconfig.json +++ b/packages/pigment-css-vite-plugin/tsconfig.json @@ -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/**/*"], diff --git a/tsconfig.json b/tsconfig.json index 637610a7..566486f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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, @@ -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"], @@ -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"] }