diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fcacffab0..46d826245 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,7 +33,7 @@ jobs: - name: Upload artifacts uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: - path: './dist/apps/website' + path: './apps/website/dist' deploy: needs: build diff --git a/.gitignore b/.gitignore index 7442e52f9..40ec071f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist +dist /tmp -/out-tsc +out-tsc /packages/*/dist/bundle-size # TypeScript build info diff --git a/.syncpackrc.json b/.syncpackrc.json index 784eacb0a..9bfd85357 100644 --- a/.syncpackrc.json +++ b/.syncpackrc.json @@ -1,6 +1,14 @@ { "$schema": "./node_modules/syncpack/schema.json", "strict": true, + "semverGroups": [ + { + "label": "Internal @griffel/* deps must use a caret range when semver-pinned", + "dependencies": ["@griffel/*"], + "specifierTypes": ["exact", "range-major", "range-minor", "range"], + "range": "^" + } + ], "versionGroups": [ { "label": "Local @griffel/* cross-package deps must use the same caret range everywhere", diff --git a/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch b/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch deleted file mode 100644 index d4d9d04ed..000000000 --- a/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/lib/packageManager/packagePublish.js b/lib/packageManager/packagePublish.js -index 8d5ae6204d540df07ee9e019febbc2b04a825d81..f486f46991b732bc1af69a61587117a5b1703899 100644 ---- a/lib/packageManager/packagePublish.js -+++ b/lib/packageManager/packagePublish.js -@@ -15,11 +15,17 @@ async function packagePublish(packageInfo, options) { - const publishArgs = (0, npmArgs_1.getNpmPublishArgs)(packageInfo, options); - const authEnv = (0, npmArgs_1.getNpmAuthEnv)(options); - const packageRoot = path_1.default.dirname(packageInfo.packageJsonPath); -+ // Griffel: publish from the built artifact directory under the workspace-level -+ // `dist/`, mirroring the source-tree layout. The source package.json's -+ // `main`/`exports`/etc. paths assume the published package root is `dist/`, -+ // not the source package directory. -+ const packageDir = path_1.default.relative(options.path, packageRoot); -+ const publishCwd = path_1.default.resolve(options.path, 'dist', packageDir); - const publishTag = publishArgs[publishArgs.indexOf('--tag') + 1]; - const packageSpec = `${packageInfo.name}@${packageInfo.version}`; - console.log(`Publishing - ${packageSpec} with tag ${publishTag}`); - console.log(` publish command: ${publishArgs.join(' ')}`); -- console.log(` (cwd: ${packageRoot}${authEnv ? `, auth env var: ${Object.keys(authEnv)[0]}=****` : ''})\n`); -+ console.log(` (cwd: ${publishCwd}${authEnv ? `, auth env var: ${Object.keys(authEnv)[0]}=****` : ''})\n`); - let result; - // Unclear whether `options.retries` should be interpreted as "X attempts" or "initial attempt + X retries"... - // It was previously implemented as the latter, so keep that for now. -@@ -28,8 +34,8 @@ async function packagePublish(packageInfo, options) { - console.log(`Retrying... (${retries}/${options.retries})\n`); - } - result = await (0, npm_1.npm)(publishArgs, { -- // Run npm publish in the package directory -- cwd: packageRoot, -+ // Run npm publish in the built artifact directory (see Griffel comment above). -+ cwd: publishCwd, - timeout: options.timeout, - all: true, - preferLocal: false, diff --git a/apps/website/package.json b/apps/website/package.json index 2b22f2eab..1bfafd394 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -1,5 +1,6 @@ { "name": "@griffel/website", + "version": "0.0.0", "description": "Docusaurus has update notifier that checks presence of package.json file, if it's missing it throws", "private": true } diff --git a/apps/website/project.json b/apps/website/project.json index 900cb48da..2e31bceb1 100644 --- a/apps/website/project.json +++ b/apps/website/project.json @@ -8,23 +8,23 @@ "executor": "nx:run-commands", "options": { "cwd": "apps/website", - "commands": [{ "command": "docusaurus build --out-dir ../../dist/apps/website" }] + "commands": [ + { + "command": "docusaurus build --out-dir ./dist" + } + ] }, - "outputs": ["{workspaceRoot}/dist/apps/website"] + "outputs": ["{workspaceRoot}/apps/website/dist"] }, "serve": { "executor": "nx:run-commands", "options": { "cwd": "apps/website", - "commands": [{ "command": "docusaurus start" }] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "apps/website", - "commands": [{ "command": "tsc -b --pretty" }], - "outputPath": [] + "commands": [ + { + "command": "docusaurus start" + } + ] } } }, diff --git a/apps/website/tsconfig.json b/apps/website/tsconfig.json index 31be612bb..1e96c6bef 100644 --- a/apps/website/tsconfig.json +++ b/apps/website/tsconfig.json @@ -5,15 +5,21 @@ "allowSyntheticDefaultImports": true, "checkJs": true, "jsx": "react", - "noEmit": true, - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc", "types": [ "../../node_modules/@docusaurus/module-type-aliases", "../../node_modules/@docusaurus/theme-classic", "environment", "static-assets", "webpack-env" - ] + ], + "composite": true }, - "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"], + "exclude": ["./src/components/Playground/code/templates/**"], + "references": [ + { + "path": "../../packages/core" + } + ] } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b65763adf..900b45a19 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,6 +51,9 @@ extends: - script: yarn install --frozen-lockfile displayName: Install dependencies + - script: yarn nx run-many --target=build --all --parallel + displayName: Build all packages + - script: | git config user.name "Fluent UI Build" git config user.email "fluentui-internal@service.microsoft.com" diff --git a/beachball.hooks.js b/beachball.hooks.js index c5b5afa0c..91038d1c7 100644 --- a/beachball.hooks.js +++ b/beachball.hooks.js @@ -1,6 +1,8 @@ // @ts-check const childProcess = require('child_process'); +const fs = require('fs'); +const path = require('path'); /** * @param {String} command @@ -38,21 +40,34 @@ function sh(command) { }); } -let completedPrepublish = false; +const REPO_ROOT = __dirname; + +/** + * Make sure a workspace-rooted asset is present at the package root so `npm pack` + * picks it up via the `files` field. Falls back to copying the workspace-root copy + * when the package itself doesn't ship one (the LICENSE.md is shared across the + * monorepo; some packages also rely on the root README). + * + * @param {string} packagePath + * @param {string} asset + */ +function ensurePackageAsset(packagePath, asset) { + const target = path.join(packagePath, asset); + if (fs.existsSync(target)) return; + const source = path.join(REPO_ROOT, asset); + if (!fs.existsSync(source)) return; + fs.copyFileSync(source, target); +} /** * @type {import('beachball').BeachballConfig['hooks']} */ module.exports = { - // Executed after all package versions were bumped -> run build - // If we run build before `beachball publish`, artifacts would have - // old (without bump) versions. - async prepublish() { - // `beachball` runs this hook for every package, we want to run it only once. - if (!completedPrepublish) { - await sh('yarn nx run-many --target=build,build-cjs --all --parallel --max-parallel=3'); - completedPrepublish = true; - } + // Per-package: stage the workspace-root LICENSE/README into the package root so + // `npm pack` (which beachball runs from the package root) finds them via `files`. + async prepublish(packagePath) { + ensurePackageAsset(packagePath, 'LICENSE.md'); + ensurePackageAsset(packagePath, 'README.md'); }, // Runs once after all bumps, before committing — update lockfile so it stays in sync async precommit() { diff --git a/change/@griffel-babel-preset-5c7ca657-6f16-4831-add5-ec10fa461db1.json b/change/@griffel-babel-preset-5c7ca657-6f16-4831-add5-ec10fa461db1.json new file mode 100644 index 000000000..6c4e0d9eb --- /dev/null +++ b/change/@griffel-babel-preset-5c7ca657-6f16-4831-add5-ec10fa461db1.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/babel-preset", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-core-488ea0f9-cccb-4721-86a4-b2491be089ce.json b/change/@griffel-core-488ea0f9-cccb-4721-86a4-b2491be089ce.json new file mode 100644 index 000000000..b4e1d3ff1 --- /dev/null +++ b/change/@griffel-core-488ea0f9-cccb-4721-86a4-b2491be089ce.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/core", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-devtools-a0037621-c810-4227-b642-4dcad066cf08.json b/change/@griffel-devtools-a0037621-c810-4227-b642-4dcad066cf08.json new file mode 100644 index 000000000..912b88244 --- /dev/null +++ b/change/@griffel-devtools-a0037621-c810-4227-b642-4dcad066cf08.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/devtools", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-eslint-plugin-40aaef23-b998-4a26-a088-eb7c058b307b.json b/change/@griffel-eslint-plugin-40aaef23-b998-4a26-a088-eb7c058b307b.json new file mode 100644 index 000000000..99397391d --- /dev/null +++ b/change/@griffel-eslint-plugin-40aaef23-b998-4a26-a088-eb7c058b307b.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/eslint-plugin", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-jest-serializer-14b11c90-c293-4a16-9682-a278877a5ed6.json b/change/@griffel-jest-serializer-14b11c90-c293-4a16-9682-a278877a5ed6.json new file mode 100644 index 000000000..d45aef55b --- /dev/null +++ b/change/@griffel-jest-serializer-14b11c90-c293-4a16-9682-a278877a5ed6.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/jest-serializer", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-postcss-syntax-cf05402a-d49d-4061-9c0b-1942aad275f8.json b/change/@griffel-postcss-syntax-cf05402a-d49d-4061-9c0b-1942aad275f8.json new file mode 100644 index 000000000..5a5ccdcfc --- /dev/null +++ b/change/@griffel-postcss-syntax-cf05402a-d49d-4061-9c0b-1942aad275f8.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/postcss-syntax", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-react-bc97d453-9e78-491a-8956-522c5558ff31.json b/change/@griffel-react-bc97d453-9e78-491a-8956-522c5558ff31.json new file mode 100644 index 000000000..414d18f22 --- /dev/null +++ b/change/@griffel-react-bc97d453-9e78-491a-8956-522c5558ff31.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/react", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-shadow-dom-bdffa7d7-6265-4763-826e-0057fa91d215.json b/change/@griffel-shadow-dom-bdffa7d7-6265-4763-826e-0057fa91d215.json new file mode 100644 index 000000000..ca95a624e --- /dev/null +++ b/change/@griffel-shadow-dom-bdffa7d7-6265-4763-826e-0057fa91d215.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/shadow-dom", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-style-types-6312bb23-b468-4396-9648-72063566db45.json b/change/@griffel-style-types-6312bb23-b468-4396-9648-72063566db45.json new file mode 100644 index 000000000..852af0838 --- /dev/null +++ b/change/@griffel-style-types-6312bb23-b468-4396-9648-72063566db45.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/style-types", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-transform-87d14893-72a5-4b6e-8458-a4d4e5eb572e.json b/change/@griffel-transform-87d14893-72a5-4b6e-8458-a4d4e5eb572e.json new file mode 100644 index 000000000..99ae9642a --- /dev/null +++ b/change/@griffel-transform-87d14893-72a5-4b6e-8458-a4d4e5eb572e.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/transform", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-transform-shaker-0accdf23-15f3-4f87-bf5b-88581795b1e4.json b/change/@griffel-transform-shaker-0accdf23-15f3-4f87-bf5b-88581795b1e4.json new file mode 100644 index 000000000..503dbcf33 --- /dev/null +++ b/change/@griffel-transform-shaker-0accdf23-15f3-4f87-bf5b-88581795b1e4.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/transform-shaker", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-webpack-extraction-plugin-77ddbf00-8fb4-4a21-8093-48e6b5efc497.json b/change/@griffel-webpack-extraction-plugin-77ddbf00-8fb4-4a21-8093-48e6b5efc497.json new file mode 100644 index 000000000..36622c1d9 --- /dev/null +++ b/change/@griffel-webpack-extraction-plugin-77ddbf00-8fb4-4a21-8093-48e6b5efc497.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/webpack-extraction-plugin", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-webpack-loader-c5a41871-e1fe-49bd-915c-e24254eb6ede.json b/change/@griffel-webpack-loader-c5a41871-e1fe-49bd-915c-e24254eb6ede.json new file mode 100644 index 000000000..4d1236025 --- /dev/null +++ b/change/@griffel-webpack-loader-c5a41871-e1fe-49bd-915c-e24254eb6ede.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/webpack-loader", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@griffel-webpack-plugin-49de74bc-716f-43a5-a2b3-9892a585faba.json b/change/@griffel-webpack-plugin-49de74bc-716f-43a5-a2b3-9892a585faba.json new file mode 100644 index 000000000..88bd4433c --- /dev/null +++ b/change/@griffel-webpack-plugin-49de74bc-716f-43a5-a2b3-9892a585faba.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: migrate from TS path aliases to yarn workspaces + TS project references", + "packageName": "@griffel/webpack-plugin", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/e2e/eslint/package.json b/e2e/eslint/package.json index 4f3194f1e..7f938aa98 100644 --- a/e2e/eslint/package.json +++ b/e2e/eslint/package.json @@ -2,5 +2,10 @@ "name": "@griffel/e2e-eslint", "version": "0.0.0", "private": true, - "type": "module" + "type": "module", + "devDependencies": { + "@griffel/e2e-utils": "*", + "@griffel/eslint-plugin": "^3.0.2", + "@griffel/react": "^1.7.4" + } } diff --git a/e2e/eslint/project.json b/e2e/eslint/project.json index f8e12f007..28bc52550 100644 --- a/e2e/eslint/project.json +++ b/e2e/eslint/project.json @@ -7,20 +7,21 @@ "targets": { "test": { "executor": "nx:run-commands", - "dependsOn": [{ "target": "build", "dependencies": true }], + "dependsOn": [ + { + "target": "build", + "dependencies": true + } + ], "options": { "cwd": "e2e/eslint", - "commands": [{ "command": "node src/test.ts" }] + "commands": [ + { + "command": "node src/test.ts" + } + ] }, "outputs": [] - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "e2e/eslint", - "commands": [{ "command": "tsc -b --pretty" }], - "outputPath": [] - } } }, "tags": [] diff --git a/e2e/eslint/tsconfig.json b/e2e/eslint/tsconfig.json index 1f8121e7c..c23e61c80 100644 --- a/e2e/eslint/tsconfig.json +++ b/e2e/eslint/tsconfig.json @@ -1,13 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "module": "nodenext", - "moduleResolution": "nodenext", - "allowImportingTsExtensions": true, - "noEmit": true - }, "files": [], "include": [], "references": [ diff --git a/e2e/eslint/tsconfig.lib.json b/e2e/eslint/tsconfig.lib.json index a1a9a85ca..c926f8ca4 100644 --- a/e2e/eslint/tsconfig.lib.json +++ b/e2e/eslint/tsconfig.lib.json @@ -1,9 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "module": "nodenext", + "moduleResolution": "nodenext", + "emitDeclarationOnly": true, + "outDir": "./dist", "types": ["node", "environment"] }, - "include": ["**/*.ts", "**/*.js"], - "exclude": ["src/assets"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../../packages/react/tsconfig.lib.json" + }, + { + "path": "../../packages/eslint-plugin/tsconfig.lib.json" + }, + { + "path": "../utils/tsconfig.lib.json" + } + ] } diff --git a/e2e/rspack/project.json b/e2e/rspack/project.json index 9debfe8c6..fb485245c 100644 --- a/e2e/rspack/project.json +++ b/e2e/rspack/project.json @@ -7,23 +7,25 @@ "test": { "executor": "nx:run-commands", "dependsOn": [ - { "target": "build", "dependencies": true }, - { "target": "build-cjs", "dependencies": true } + { + "target": "build", + "dependencies": true + }, + { + "target": "build-cjs", + "dependencies": true + } ], "options": { "cwd": "e2e/rspack", - "commands": [{ "command": "node src/test.ts" }] + "commands": [ + { + "command": "node src/test.ts" + } + ] }, "outputs": [] }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "e2e/rspack", - "commands": [{ "command": "tsc -b --pretty" }], - "outputPath": [] - } - }, "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] diff --git a/e2e/rspack/tsconfig.json b/e2e/rspack/tsconfig.json index 9718d1d60..c23e61c80 100644 --- a/e2e/rspack/tsconfig.json +++ b/e2e/rspack/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "target": "es2020", - "module": "nodenext", - "moduleResolution": "nodenext", - "allowImportingTsExtensions": true, - "jsx": "react-jsx", - "noEmit": true - }, "files": [], "include": [], "references": [ diff --git a/e2e/rspack/tsconfig.lib.json b/e2e/rspack/tsconfig.lib.json index 62c8b285f..e8bb5417c 100644 --- a/e2e/rspack/tsconfig.lib.json +++ b/e2e/rspack/tsconfig.lib.json @@ -1,8 +1,28 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "module": "nodenext", + "moduleResolution": "nodenext", + "emitDeclarationOnly": true, + "outDir": "./dist", "types": ["node", "environment", "static-assets"] }, - "include": ["**/*.ts", "**/*.tsx", "**/*.js"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../../packages/webpack-plugin/tsconfig.lib.json" + }, + { + "path": "../../packages/webpack-loader/tsconfig.lib.json" + }, + { + "path": "../../packages/webpack-extraction-plugin/tsconfig.lib.json" + }, + { + "path": "../../packages/react/tsconfig.lib.json" + }, + { + "path": "../utils/tsconfig.lib.json" + } + ] } diff --git a/e2e/typescript/package.json b/e2e/typescript/package.json index 3946842ab..3a4027bd4 100644 --- a/e2e/typescript/package.json +++ b/e2e/typescript/package.json @@ -2,5 +2,9 @@ "name": "@griffel/e2e-typescript", "version": "0.0.0", "private": true, - "type": "module" + "type": "module", + "devDependencies": { + "@griffel/e2e-utils": "workspace:*", + "@griffel/style-types": "workspace:*" + } } diff --git a/e2e/typescript/project.json b/e2e/typescript/project.json index 4bab732f8..a490f6a9a 100644 --- a/e2e/typescript/project.json +++ b/e2e/typescript/project.json @@ -6,20 +6,21 @@ "targets": { "test": { "executor": "nx:run-commands", - "dependsOn": [{ "target": "build", "dependencies": true }], + "dependsOn": [ + { + "target": "build", + "dependencies": true + } + ], "options": { "cwd": "e2e/typescript", - "commands": [{ "command": "node src/test.ts" }] + "commands": [ + { + "command": "node src/test.ts" + } + ] }, "outputs": [] - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "e2e/typescript", - "commands": [{ "command": "tsc -b --pretty" }], - "outputPath": [] - } } }, "tags": [] diff --git a/e2e/typescript/tsconfig.json b/e2e/typescript/tsconfig.json index 1f8121e7c..c23e61c80 100644 --- a/e2e/typescript/tsconfig.json +++ b/e2e/typescript/tsconfig.json @@ -1,13 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "module": "nodenext", - "moduleResolution": "nodenext", - "allowImportingTsExtensions": true, - "noEmit": true - }, "files": [], "include": [], "references": [ diff --git a/e2e/typescript/tsconfig.lib.json b/e2e/typescript/tsconfig.lib.json index 0893e0a68..9683f4fbf 100644 --- a/e2e/typescript/tsconfig.lib.json +++ b/e2e/typescript/tsconfig.lib.json @@ -1,8 +1,19 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "module": "nodenext", + "moduleResolution": "nodenext", + "emitDeclarationOnly": true, + "outDir": "./dist", "types": ["node", "environment"] }, - "include": ["**/*.ts", "**/*.js"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../../packages/style-types/tsconfig.lib.json" + }, + { + "path": "../utils/tsconfig.lib.json" + } + ] } diff --git a/e2e/utils/project.json b/e2e/utils/project.json index efc02b00a..80cb74844 100644 --- a/e2e/utils/project.json +++ b/e2e/utils/project.json @@ -3,15 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/utils/src", "projectType": "library", - "targets": { - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "e2e/utils", - "commands": [{ "command": "tsc -b --pretty" }] - }, - "outputs": [] - } - }, + "targets": {}, "tags": [] } diff --git a/e2e/utils/src/packLocalPackage.ts b/e2e/utils/src/packLocalPackage.ts index 40d58fa37..474ea605e 100644 --- a/e2e/utils/src/packLocalPackage.ts +++ b/e2e/utils/src/packLocalPackage.ts @@ -4,11 +4,12 @@ import fs from 'fs'; import { sh } from './sh.ts'; export async function packLocalPackage(rootDir: string, tempDir: string, packageName: string) { - const packagePath = path.resolve(rootDir, 'dist', 'packages', packageName.split('/')[1]); - const packagePathExists = !!(await fs.promises.stat(packagePath).catch(() => false)); + const packagePath = path.resolve(rootDir, 'packages', packageName.split('/')[1]); + const distPath = path.resolve(packagePath, 'dist'); + const distExists = !!(await fs.promises.stat(distPath).catch(() => false)); - if (!packagePathExists) { - throw new Error(`A directory with artifacts (${packagePath}) does not exist`); + if (!distExists) { + throw new Error(`Build artifacts not found at "${distPath}" — run "nx run ${packageName}:build" first`); } // Use `npm pack` because `yarn pack` incorrectly calculates the included files when the diff --git a/e2e/utils/tsconfig.json b/e2e/utils/tsconfig.json index 1f8121e7c..c23e61c80 100644 --- a/e2e/utils/tsconfig.json +++ b/e2e/utils/tsconfig.json @@ -1,13 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "module": "nodenext", - "moduleResolution": "nodenext", - "allowImportingTsExtensions": true, - "noEmit": true - }, "files": [], "include": [], "references": [ diff --git a/e2e/utils/tsconfig.lib.json b/e2e/utils/tsconfig.lib.json index 2954c1047..63bcbcc17 100644 --- a/e2e/utils/tsconfig.lib.json +++ b/e2e/utils/tsconfig.lib.json @@ -1,8 +1,12 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "module": "nodenext", + "moduleResolution": "nodenext", + "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, + "outDir": "./dist", "types": ["node", "environment"] }, - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/monosize.config.mjs b/monosize.config.mjs index ead35cc79..092418793 100644 --- a/monosize.config.mjs +++ b/monosize.config.mjs @@ -1,21 +1,10 @@ -import path from 'node:path'; import upstashStorage from 'monosize-storage-upstash'; import webpackBundler from 'monosize-bundler-webpack'; -const dirname = new URL('.', import.meta.url).pathname; - export default { repository: 'https://github.com/microsoft/griffel', bundler: webpackBundler(config => ({ ...config, - resolve: { - ...config.resolve, - alias: { - '@griffel/core': path.resolve(dirname, './dist/packages/core/src/index.js'), - '@griffel/shadow-dom': path.resolve(dirname, './dist/packages/shadow-dom/src/index.js'), - '@griffel/react': path.resolve(dirname, './dist/packages/react/src/index.js'), - }, - }, externals: { ...config.externals, 'react/jsx-runtime': 'JSX', diff --git a/nx.json b/nx.json index a31352694..fb3529cb1 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "extends": "nx/presets/core.json", "targetDefaults": { "build": { - "dependsOn": ["^build"], + "dependsOn": ["^build", "^build-cjs"], "cache": true }, "test": { @@ -27,14 +27,35 @@ "@nx/vitest:test": { "cache": true, "inputs": ["default", "^default"] + }, + "build-cjs": { + "dependsOn": ["build", "^build-cjs"], + "cache": true } }, + "plugins": [ + { + "plugin": "@nx/js/typescript", + "options": { + "typecheck": { + "targetName": "type-check" + }, + "build": { + "targetName": "build", + "configName": "tsconfig.lib.json" + } + } + } + ], "pluginsConfig": { "@nx/js": { "analyzeSourceFiles": true } }, - "useInferencePlugins": false, + "useInferencePlugins": true, + "sync": { + "applyChanges": true + }, "defaultBase": "main", "tui": { "enabled": false diff --git a/package.json b/package.json index ac3a5f028..638e04dcf 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "url": "https://github.com/microsoft/griffel" }, "workspaces": [ + "apps/*", "e2e/*", "packages/*", "tools/*" @@ -43,7 +44,7 @@ "@emotion/hash": "^0.9.0", "@linaria/babel-preset": "^3.0.0-beta.24", "@linaria/shaker": "^3.0.0-beta.22", - "@typescript-eslint/utils": "^8.59.1", + "@typescript-eslint/utils": "^8.59.3", "ajv": "^8.20.0", "csstype": "^3.2.3", "debug": "^4.3.0", @@ -105,7 +106,7 @@ "@vitest/coverage-v8": "4.1.5", "@vitest/ui": "4.1.5", "babel-plugin-tester": "12.0.0", - "beachball": "patch:beachball@npm%3A2.65.4#~/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch", + "beachball": "2.65.4", "bestzip": "2.2.0", "css-loader": "^7.1.4", "dedent": "^1.7.2", @@ -150,6 +151,7 @@ "webpack-merge": "6.0.1" }, "resolutions": { - "source-map-js@npm:1.2.1": "patch:source-map-js@npm%3A1.2.1#~/.yarn/patches/source-map-js-npm-1.2.1-b9a47d7e1a.patch" + "source-map-js@npm:1.2.1": "patch:source-map-js@npm%3A1.2.1#~/.yarn/patches/source-map-js-npm-1.2.1-b9a47d7e1a.patch", + "@typescript-eslint/utils": "^8.59.3" } } diff --git a/packages/babel-preset/package.json b/packages/babel-preset/package.json index 8f4d6e216..f9f2a0516 100644 --- a/packages/babel-preset/package.json +++ b/packages/babel-preset/package.json @@ -19,5 +19,20 @@ "ajv": "^8.20.0", "stylis": "^4.4.0", "tslib": "^2.1.0" - } + }, + "types": "./dist/index.d.ts", + "main": "./dist/index.js", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/babel-preset/project.json b/packages/babel-preset/project.json index dfe0c2966..9e577b8cc 100644 --- a/packages/babel-preset/project.json +++ b/packages/babel-preset/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/babel-preset" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/babel-preset", - "tsConfig": "packages/babel-preset/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/babel-preset/package.json", - "main": "packages/babel-preset/src/index.ts", - "assets": [ - "packages/babel-preset/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/babel-preset", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/babel-preset/tsconfig.json b/packages/babel-preset/tsconfig.json index 915d41150..62ebbd946 100644 --- a/packages/babel-preset/tsconfig.json +++ b/packages/babel-preset/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true - }, "files": [], "include": [], "references": [ diff --git a/packages/babel-preset/tsconfig.lib.json b/packages/babel-preset/tsconfig.lib.json index 9121cf848..5818d020d 100644 --- a/packages/babel-preset/tsconfig.lib.json +++ b/packages/babel-preset/tsconfig.lib.json @@ -1,11 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", + "module": "node16", + "moduleResolution": "node16", + "customConditions": [], "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["__fixtures__/**/*", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../core/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/babel-preset/tsconfig.spec.json b/packages/babel-preset/tsconfig.spec.json index 16b4d408b..24817554a 100644 --- a/packages/babel-preset/tsconfig.spec.json +++ b/packages/babel-preset/tsconfig.spec.json @@ -1,23 +1,24 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment", "static-assets"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"], + "jsx": "react-jsx", + "allowJs": true }, "include": [ - "vitest.config.mts", - "__fixtures__/**/code.ts", - "__fixtures__/**/fixture.ts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "__fixtures__/**/*.js" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/babel-preset/vitest.config.mts b/packages/babel-preset/vitest.config.mts index 07f6c649b..302a066a9 100644 --- a/packages/babel-preset/vitest.config.mts +++ b/packages/babel-preset/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/babel-preset', - plugins: [nxViteTsPaths()], test: { watch: false, // babel-plugin-tester reads describe/it from globalThis at call time diff --git a/packages/core/package.json b/packages/core/package.json index c333659c3..b79306d61 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,14 +9,19 @@ }, "sideEffects": false, "type": "module", - "main": "./lib/index.cjs", - "module": "./src/index.js", - "types": "./src/index.d.ts", + "main": "./dist/cjs/index.cjs", + "module": "./dist/index.js", "exports": { ".": { - "types": "./src/index.d.ts", - "import": "./src/index.js", - "require": "./lib/index.cjs" + "@griffel/source": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -27,5 +32,10 @@ "rtl-css-js": "^1.16.1", "stylis": "^4.4.0", "tslib": "^2.1.0" - } + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/core/project.json b/packages/core/project.json index 879f63e06..378ecaaf7 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -5,33 +5,6 @@ "projectType": "library", "tags": [], "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/core", - "tsConfig": "packages/core/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/core/package.json", - "main": "packages/core/src/index.ts", - "assets": [ - "packages/core/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "build-cjs": { - "dependsOn": ["build"], - "executor": "nx:run-commands", - "outputs": ["{workspaceRoot}/dist/packages/core/lib"], - "options": { - "command": "node tools/build-cjs.mjs dist/packages/core/src dist/packages/core/lib" - } - }, "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] @@ -55,17 +28,20 @@ ] } }, - "type-check": { + "build-cjs": { + "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/core/dist/cjs"], + "options": { + "command": "node tools/build-cjs.ts packages/core/dist packages/core/dist/cjs" + } + }, + "build": { "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/core/dist"], "options": { "cwd": "packages/core", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] + "command": "tsc --build tsconfig.lib.json --pretty" + } } } } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index df5d3be6b..62ebbd946 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true - }, "files": [], "include": [], "references": [ diff --git a/packages/core/tsconfig.lib.json b/packages/core/tsconfig.lib.json index 95fa77096..f0c017270 100644 --- a/packages/core/tsconfig.lib.json +++ b/packages/core/tsconfig.lib.json @@ -1,24 +1,15 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "outDir": "../../dist/out-tsc", - "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": [ - "**/*.spec.ts", - "**/*.test.ts", - "**/*.spec.tsx", - "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", - "jest.config.ts", - "vitest.config.ts", - "bundle-size/**" - ], - "include": ["src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts", "bundle-size/**"], + "references": [ + { + "path": "../style-types/tsconfig.lib.json" + } + ] } diff --git a/packages/core/tsconfig.spec.json b/packages/core/tsconfig.spec.json index f7128fd9d..2da67144c 100644 --- a/packages/core/tsconfig.spec.json +++ b/packages/core/tsconfig.spec.json @@ -1,7 +1,7 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, @@ -11,11 +11,11 @@ "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index 0229c87f1..43482346a 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -1,12 +1,12 @@ import { defineConfig } from 'vitest/config'; import { playwright } from '@vitest/browser-playwright'; import { defineBrowserCommand } from '@vitest/browser-playwright'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/core', - plugins: [nxViteTsPaths()], test: { watch: false, reporters: ['default'], @@ -16,7 +16,7 @@ export default defineConfig({ }, projects: [ { - plugins: [nxViteTsPaths()], + plugins: [], test: { name: 'unit', environment: 'jsdom', @@ -25,7 +25,7 @@ export default defineConfig({ }, }, { - plugins: [nxViteTsPaths()], + plugins: [], test: { name: 'browser', include: ['{src,tests}/**/*.browser.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], diff --git a/packages/devtools/project.json b/packages/devtools/project.json index 1796ff83e..aedac0f8a 100644 --- a/packages/devtools/project.json +++ b/packages/devtools/project.json @@ -40,18 +40,6 @@ "reportsDirectory": "{projectRoot}/../../coverage/packages/devtools" } }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/devtools", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] - }, "watch": { "executor": "nx:run-commands", "options": { diff --git a/packages/devtools/tsconfig.lib.json b/packages/devtools/tsconfig.lib.json index ac89bd5f7..e4a82d01e 100644 --- a/packages/devtools/tsconfig.lib.json +++ b/packages/devtools/tsconfig.lib.json @@ -1,24 +1,29 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "jsx": "react-jsx", + "emitDeclarationOnly": true, + "outDir": "./out-tsc/lib", + "rootDir": "./src", "types": ["chrome", "node", "environment"] }, + "include": ["src/**/*.ts", "src/**/*.tsx"], "exclude": [ "**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", "**/*.stories.ts", - "**/*.stories.js", - "**/*.stories.jsx", "**/*.stories.tsx", "vite.config.ts", "vitest.setup.ts" ], - "include": ["**/*.ts", "**/*.tsx"] + "references": [ + { + "path": "../core/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/devtools/tsconfig.spec.json b/packages/devtools/tsconfig.spec.json index 0e6e6d0aa..1e1a72e59 100644 --- a/packages/devtools/tsconfig.spec.json +++ b/packages/devtools/tsconfig.spec.json @@ -1,8 +1,8 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "moduleResolution": "bundler", + "jsx": "react-jsx", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "chrome", "node", "vitest", "environment"] }, @@ -13,10 +13,11 @@ "src/**/*.spec.ts", "src/**/*.test.tsx", "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", "src/**/*.d.ts" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/devtools/tsconfig.storybook.json b/packages/devtools/tsconfig.storybook.json index 33a39097e..014a67a79 100644 --- a/packages/devtools/tsconfig.storybook.json +++ b/packages/devtools/tsconfig.storybook.json @@ -1,10 +1,8 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "emitDecoratorMetadata": true, "moduleResolution": "bundler", - "noEmit": true, - "outDir": "" + "outDir": "./out-tsc/storybook" }, "files": [ "../../node_modules/@nx/react/typings/styled-jsx.d.ts", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e4928a75e..25aa59dc5 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -8,8 +8,23 @@ "type": "git", "url": "https://github.com/microsoft/griffel" }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ], "dependencies": { - "@typescript-eslint/utils": "^8.59.1", + "@typescript-eslint/utils": "^8.59.3", "csstype": "^3.2.3", "tslib": "^2.1.0" }, diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json index c0c1493ac..d3d087b5c 100644 --- a/packages/eslint-plugin/project.json +++ b/packages/eslint-plugin/project.json @@ -12,37 +12,6 @@ "test": { "executor": "@nx/vitest:test", "outputs": ["{workspaceRoot}/coverage/packages/eslint-plugin"] - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/eslint-plugin", - "tsConfig": "packages/eslint-plugin/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/eslint-plugin/package.json", - "main": "packages/eslint-plugin/src/index.ts", - "assets": [ - "packages/eslint-plugin/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/babel-preset", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index 7eea1bc24..62ebbd946 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "module": "nodenext", - "moduleResolution": "nodenext" - }, "files": [], "include": [], "references": [ diff --git a/packages/eslint-plugin/tsconfig.lib.json b/packages/eslint-plugin/tsconfig.lib.json index 124ee9eda..afcb2d147 100644 --- a/packages/eslint-plugin/tsconfig.lib.json +++ b/packages/eslint-plugin/tsconfig.lib.json @@ -1,10 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"] } diff --git a/packages/eslint-plugin/tsconfig.spec.json b/packages/eslint-plugin/tsconfig.spec.json index 34c36bf98..2da67144c 100644 --- a/packages/eslint-plugin/tsconfig.spec.json +++ b/packages/eslint-plugin/tsconfig.spec.json @@ -1,19 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", + "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vitest.config.mts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/eslint-plugin/vitest.config.mts b/packages/eslint-plugin/vitest.config.mts index 62dfe805a..ffb78c8f9 100644 --- a/packages/eslint-plugin/vitest.config.mts +++ b/packages/eslint-plugin/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/eslint-plugin', - plugins: [nxViteTsPaths()], test: { watch: false, // @typescript-eslint/rule-tester reads describe/it from globalThis at call time diff --git a/packages/jest-serializer/package.json b/packages/jest-serializer/package.json index 1b4a415d0..9ca5aea56 100644 --- a/packages/jest-serializer/package.json +++ b/packages/jest-serializer/package.json @@ -10,5 +10,20 @@ "dependencies": { "@griffel/core": "^1.21.2", "tslib": "^2.1.0" - } + }, + "types": "./dist/index.d.ts", + "main": "./dist/index.js", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/jest-serializer/project.json b/packages/jest-serializer/project.json index 260c64d3c..f3304be2f 100644 --- a/packages/jest-serializer/project.json +++ b/packages/jest-serializer/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/jest-serializer" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/jest-serializer", - "tsConfig": "packages/jest-serializer/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/jest-serializer/package.json", - "main": "packages/jest-serializer/src/index.ts", - "assets": [ - "packages/jest-serializer/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/jest-serializer", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/jest-serializer/tsconfig.json b/packages/jest-serializer/tsconfig.json index 915d41150..62ebbd946 100644 --- a/packages/jest-serializer/tsconfig.json +++ b/packages/jest-serializer/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true - }, "files": [], "include": [], "references": [ diff --git a/packages/jest-serializer/tsconfig.lib.json b/packages/jest-serializer/tsconfig.lib.json index 0c32ed38a..edad876e0 100644 --- a/packages/jest-serializer/tsconfig.lib.json +++ b/packages/jest-serializer/tsconfig.lib.json @@ -1,11 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", + "module": "node16", + "moduleResolution": "node16", + "customConditions": [], "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts", "jest.setup.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../react/tsconfig.lib.json" + }, + { + "path": "../core/tsconfig.lib.json" + } + ] } diff --git a/packages/jest-serializer/tsconfig.spec.json b/packages/jest-serializer/tsconfig.spec.json index b44cb9f09..14c1b35f8 100644 --- a/packages/jest-serializer/tsconfig.spec.json +++ b/packages/jest-serializer/tsconfig.spec.json @@ -1,22 +1,23 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"], + "jsx": "react-jsx" }, "include": [ - "vitest.config.mts", "vitest.setup.ts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/jest-serializer/vitest.config.mts b/packages/jest-serializer/vitest.config.mts index fa5a41eef..188916696 100644 --- a/packages/jest-serializer/vitest.config.mts +++ b/packages/jest-serializer/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/jest-serializer', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'jsdom', diff --git a/packages/postcss-syntax/package.json b/packages/postcss-syntax/package.json index 01c08826f..66831a367 100644 --- a/packages/postcss-syntax/package.json +++ b/packages/postcss-syntax/package.json @@ -13,5 +13,19 @@ "@griffel/babel-preset": "^1.8.6", "postcss": "^8.5.14" }, - "main": "./src/index.js" + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/postcss-syntax/project.json b/packages/postcss-syntax/project.json index 8e29d2534..5d4de6bc5 100644 --- a/packages/postcss-syntax/project.json +++ b/packages/postcss-syntax/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/postcss-syntax" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/postcss-syntax", - "tsConfig": "packages/postcss-syntax/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/postcss-syntax/package.json", - "main": "packages/postcss-syntax/src/index.ts", - "assets": [ - "packages/postcss-syntax/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/babel-preset", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/postcss-syntax/tsconfig.json b/packages/postcss-syntax/tsconfig.json index 2bd6d6f0a..62ebbd946 100644 --- a/packages/postcss-syntax/tsconfig.json +++ b/packages/postcss-syntax/tsconfig.json @@ -1,8 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true - }, "files": [], "include": [], "references": [ diff --git a/packages/postcss-syntax/tsconfig.lib.json b/packages/postcss-syntax/tsconfig.lib.json index 0a5aff6ef..4f633a30a 100644 --- a/packages/postcss-syntax/tsconfig.lib.json +++ b/packages/postcss-syntax/tsconfig.lib.json @@ -1,11 +1,17 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", - "declaration": true, + "module": "node16", + "moduleResolution": "node16", + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../babel-preset/tsconfig.lib.json" + } + ] } diff --git a/packages/postcss-syntax/tsconfig.spec.json b/packages/postcss-syntax/tsconfig.spec.json index 4784313a6..2da67144c 100644 --- a/packages/postcss-syntax/tsconfig.spec.json +++ b/packages/postcss-syntax/tsconfig.spec.json @@ -1,20 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vitest.config.mts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/postcss-syntax/vitest.config.mts b/packages/postcss-syntax/vitest.config.mts index 68e5ff484..564e80a78 100644 --- a/packages/postcss-syntax/vitest.config.mts +++ b/packages/postcss-syntax/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/postcss-syntax', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'node', diff --git a/packages/react/package.json b/packages/react/package.json index b73c0bc5f..6cb74539f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -9,14 +9,19 @@ }, "sideEffects": false, "type": "module", - "main": "./lib/index.cjs", - "module": "./src/index.js", - "types": "./src/index.d.ts", + "main": "./dist/cjs/index.cjs", + "module": "./dist/index.js", "exports": { ".": { - "types": "./src/index.d.ts", - "import": "./src/index.js", - "require": "./lib/index.cjs" + "@griffel/source": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + } }, "./package.json": "./package.json" }, @@ -32,5 +37,10 @@ }, "peerDependencies": { "react": ">=16.14.0 <20.0.0" - } + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/react/project.json b/packages/react/project.json index 2d48dbac2..9708dc00b 100644 --- a/packages/react/project.json +++ b/packages/react/project.json @@ -5,33 +5,6 @@ "projectType": "library", "tags": [], "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/react", - "tsConfig": "packages/react/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/react/package.json", - "main": "packages/react/src/index.ts", - "assets": [ - "packages/react/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "build-cjs": { - "dependsOn": ["build"], - "executor": "nx:run-commands", - "outputs": ["{workspaceRoot}/dist/packages/react/lib"], - "options": { - "command": "node tools/build-cjs.mjs dist/packages/react/src dist/packages/react/lib" - } - }, "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] @@ -80,17 +53,20 @@ } } }, - "type-check": { + "build-cjs": { + "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/react/dist/cjs"], + "options": { + "command": "node tools/build-cjs.ts packages/react/dist packages/react/dist/cjs" + } + }, + "build": { "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/react/dist"], "options": { "cwd": "packages/react", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] + "command": "tsc --build tsconfig.lib.json --pretty" + } } } } diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index 71dbfe6cf..ed3e4588d 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "jsx": "react-jsx", - "allowJs": true - }, "files": [], "include": [], "references": [ diff --git a/packages/react/tsconfig.lib.json b/packages/react/tsconfig.lib.json index 9287e6039..f5292f2cf 100644 --- a/packages/react/tsconfig.lib.json +++ b/packages/react/tsconfig.lib.json @@ -1,28 +1,24 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "outDir": "../../dist/out-tsc", - "declaration": true, - "stripInternal": true, - "types": ["node", "environment"] + "outDir": "./dist", + "rootDir": "./src", + "types": ["node", "environment"], + "jsx": "react-jsx" }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], "exclude": [ "**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", + "vitest.config.ts", "**/*.stories.ts", - "**/*.stories.js", - "**/*.stories.jsx", - "**/*.stories.tsx", - "jest.config.ts", - "vitest.config.ts" + "**/*.stories.tsx" ], - "include": ["src/**/*.ts", "src/**/*.tsx"] + "references": [ + { + "path": "../core/tsconfig.lib.json" + } + ] } diff --git a/packages/react/tsconfig.spec.json b/packages/react/tsconfig.spec.json index 2be2b8559..87aeecf83 100644 --- a/packages/react/tsconfig.spec.json +++ b/packages/react/tsconfig.spec.json @@ -1,21 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "allowSyntheticDefaultImports": true, + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"], + "jsx": "react-jsx" }, "include": [ "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/react/tsconfig.storybook.json b/packages/react/tsconfig.storybook.json index c3076d8e3..ce5d40d0b 100644 --- a/packages/react/tsconfig.storybook.json +++ b/packages/react/tsconfig.storybook.json @@ -1,11 +1,10 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "emitDecoratorMetadata": true, + "jsx": "react-jsx", "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, - "noEmit": true, - "outDir": "" + "outDir": "./out-tsc/storybook" }, "exclude": ["src/**/*.spec.ts", "src/**/*.spec.js", "src/**/*.spec.tsx", "src/**/*.spec.jsx", "jest.config.ts"], "include": ["src/**/*", ".storybook/*.js"] diff --git a/packages/react/vitest.config.ts b/packages/react/vitest.config.ts index 3440e6e04..5b1c62ae4 100644 --- a/packages/react/vitest.config.ts +++ b/packages/react/vitest.config.ts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/react', - plugins: [nxViteTsPaths()], define: { IS_REACT_ACT_ENVIRONMENT: true, }, diff --git a/packages/shadow-dom/package.json b/packages/shadow-dom/package.json index 87602d408..c3eefaf15 100644 --- a/packages/shadow-dom/package.json +++ b/packages/shadow-dom/package.json @@ -9,19 +9,29 @@ }, "sideEffects": false, "type": "module", - "main": "./lib/index.cjs", - "module": "./src/index.js", - "types": "./src/index.d.ts", + "main": "./dist/cjs/index.cjs", + "module": "./dist/index.js", "exports": { ".": { - "types": "./src/index.d.ts", - "import": "./src/index.js", - "require": "./lib/index.cjs" + "@griffel/source": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + } }, "./package.json": "./package.json" }, "dependencies": { "@griffel/core": "^1.21.2", "tslib": "^2.1.0" - } + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/shadow-dom/project.json b/packages/shadow-dom/project.json index d1aa20a6f..e805239fd 100644 --- a/packages/shadow-dom/project.json +++ b/packages/shadow-dom/project.json @@ -5,33 +5,6 @@ "projectType": "library", "tags": [], "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/shadow-dom", - "tsConfig": "packages/shadow-dom/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/shadow-dom/package.json", - "main": "packages/shadow-dom/src/index.ts", - "assets": [ - "packages/shadow-dom/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "build-cjs": { - "dependsOn": ["build"], - "executor": "nx:run-commands", - "outputs": ["{workspaceRoot}/dist/packages/shadow-dom/lib"], - "options": { - "command": "node tools/build-cjs.mjs dist/packages/shadow-dom/src dist/packages/shadow-dom/lib" - } - }, "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] @@ -80,17 +53,20 @@ } } }, - "type-check": { + "build-cjs": { + "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/shadow-dom/dist/cjs"], + "options": { + "command": "node tools/build-cjs.ts packages/shadow-dom/dist packages/shadow-dom/dist/cjs" + } + }, + "build": { "executor": "nx:run-commands", + "outputs": ["{workspaceRoot}/packages/shadow-dom/dist"], "options": { "cwd": "packages/shadow-dom", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] + "command": "tsc --build tsconfig.lib.json --pretty" + } } } } diff --git a/packages/shadow-dom/tsconfig.json b/packages/shadow-dom/tsconfig.json index fb0d53b73..ed3e4588d 100644 --- a/packages/shadow-dom/tsconfig.json +++ b/packages/shadow-dom/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true - }, "files": [], "include": [], "references": [ diff --git a/packages/shadow-dom/tsconfig.lib.json b/packages/shadow-dom/tsconfig.lib.json index 4118563c3..93dd77084 100644 --- a/packages/shadow-dom/tsconfig.lib.json +++ b/packages/shadow-dom/tsconfig.lib.json @@ -1,27 +1,27 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "outDir": "../../dist/out-tsc", - "declaration": true, - "types": ["node", "environment"] + "outDir": "./dist", + "rootDir": "./src", + "types": ["node", "environment"], + "jsx": "react-jsx" }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], "exclude": [ "**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", + "vitest.config.ts", "**/*.stories.ts", - "**/*.stories.js", - "**/*.stories.jsx", - "**/*.stories.tsx", - "jest.config.ts", - "vitest.config.ts" + "**/*.stories.tsx" ], - "include": ["src/**/*.ts", "src/**/*.tsx"] + "references": [ + { + "path": "../react/tsconfig.lib.json" + }, + { + "path": "../core/tsconfig.lib.json" + } + ] } diff --git a/packages/shadow-dom/tsconfig.spec.json b/packages/shadow-dom/tsconfig.spec.json index 3227aa648..87aeecf83 100644 --- a/packages/shadow-dom/tsconfig.spec.json +++ b/packages/shadow-dom/tsconfig.spec.json @@ -1,20 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"], + "jsx": "react-jsx" }, "include": [ "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/shadow-dom/tsconfig.storybook.json b/packages/shadow-dom/tsconfig.storybook.json index da6c6b19f..21ca79fea 100644 --- a/packages/shadow-dom/tsconfig.storybook.json +++ b/packages/shadow-dom/tsconfig.storybook.json @@ -2,10 +2,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "jsx": "react-jsx", - "emitDecoratorMetadata": true, "noPropertyAccessFromIndexSignature": false, - "noEmit": true, - "outDir": "" + "outDir": "./out-tsc/storybook" }, "exclude": ["src/**/*.spec.ts", "src/**/*.spec.js", "src/**/*.spec.tsx", "src/**/*.spec.jsx", "jest.config.ts"], "include": ["src/**/*", ".storybook/*.js"] diff --git a/packages/shadow-dom/vitest.config.ts b/packages/shadow-dom/vitest.config.ts index ec013ca2a..697a9e312 100644 --- a/packages/shadow-dom/vitest.config.ts +++ b/packages/shadow-dom/vitest.config.ts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/shadow-dom', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'jsdom', diff --git a/packages/style-types/package.json b/packages/style-types/package.json index 01399a493..dd878a9a2 100644 --- a/packages/style-types/package.json +++ b/packages/style-types/package.json @@ -11,5 +11,19 @@ "dependencies": { "csstype": "^3.2.3" }, - "types": "src/index.d.ts" + "types": "./dist/index.d.ts", + "main": "./dist/index.js", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/style-types/project.json b/packages/style-types/project.json index 6b7bb3974..4ab68f63d 100644 --- a/packages/style-types/project.json +++ b/packages/style-types/project.json @@ -5,40 +5,9 @@ "projectType": "library", "tags": [], "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/style-types", - "tsConfig": "packages/style-types/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/style-types/package.json", - "main": "packages/style-types/src/index.ts", - "assets": [ - "packages/style-types/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, "lint": { "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/style-types", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/style-types/tsconfig.json b/packages/style-types/tsconfig.json index 15ee67174..62ebbd946 100644 --- a/packages/style-types/tsconfig.json +++ b/packages/style-types/tsconfig.json @@ -1,15 +1,13 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true - }, "files": [], "include": [], "references": [ { "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" } ] } diff --git a/packages/style-types/tsconfig.lib.json b/packages/style-types/tsconfig.lib.json index fb8516565..4bafdd34e 100644 --- a/packages/style-types/tsconfig.lib.json +++ b/packages/style-types/tsconfig.lib.json @@ -1,20 +1,12 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "declaration": true, + "module": "node16", + "moduleResolution": "node16", + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": [ - "**/*.spec.ts", - "**/*.test.ts", - "**/*.spec.tsx", - "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", - "jest.config.ts" - ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"] } diff --git a/packages/style-types/tsconfig.spec.json b/packages/style-types/tsconfig.spec.json new file mode 100644 index 000000000..2da67144c --- /dev/null +++ b/packages/style-types/tsconfig.spec.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] + }, + "include": [ + "vitest.config.ts", + "src/common/**/*.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/packages/transform-shaker/package.json b/packages/transform-shaker/package.json index 199c6b3f6..a55e740da 100644 --- a/packages/transform-shaker/package.json +++ b/packages/transform-shaker/package.json @@ -8,12 +8,13 @@ "url": "https://github.com/microsoft/griffel" }, "type": "module", - "main": "./src/index.js", - "types": "./src/index.d.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./src/index.d.ts", - "default": "./src/index.js" + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" }, "./package.json": "./package.json" }, @@ -22,5 +23,10 @@ "magic-string": "^0.30.19", "oxc-parser": "^0.132.0", "oxc-transform": "^0.132.0" - } + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/transform-shaker/project.json b/packages/transform-shaker/project.json index 2f68d8b88..6522b78f3 100644 --- a/packages/transform-shaker/project.json +++ b/packages/transform-shaker/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/transform-shaker" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/transform-shaker", - "tsConfig": "packages/transform-shaker/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/transform-shaker/package.json", - "main": "packages/transform-shaker/src/index.ts", - "assets": [ - "packages/transform-shaker/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/transform-shaker", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/transform-shaker/tsconfig.json b/packages/transform-shaker/tsconfig.json index 00433f885..62ebbd946 100644 --- a/packages/transform-shaker/tsconfig.json +++ b/packages/transform-shaker/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "ES2022" - }, "files": [], "include": [], "references": [ diff --git a/packages/transform-shaker/tsconfig.lib.json b/packages/transform-shaker/tsconfig.lib.json index e52065737..afcb2d147 100644 --- a/packages/transform-shaker/tsconfig.lib.json +++ b/packages/transform-shaker/tsconfig.lib.json @@ -1,29 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "ESNext", - "moduleResolution": "bundler", - "outDir": "../../dist/out-tsc", - "declaration": true, - "types": ["node"] + "outDir": "./dist", + "rootDir": "./src", + "types": ["node", "environment"] }, - "exclude": [ - "**/*.spec.ts", - "**/*.test.ts", - "jest.config.ts", - "vite.config.ts", - "vite.config.mts", - "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx" - ], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"] } diff --git a/packages/transform-shaker/tsconfig.spec.json b/packages/transform-shaker/tsconfig.spec.json index a4e266438..2da67144c 100644 --- a/packages/transform-shaker/tsconfig.spec.json +++ b/packages/transform-shaker/tsconfig.spec.json @@ -1,24 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vite.config.ts", - "vite.config.mts", "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/common/**/*.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/transform-shaker/vitest.config.mts b/packages/transform-shaker/vitest.config.mts index 00c9709f6..df1ef8359 100644 --- a/packages/transform-shaker/vitest.config.mts +++ b/packages/transform-shaker/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/transform-shaker', - plugins: [nxViteTsPaths()], test: { watch: false, passWithNoTests: true, diff --git a/packages/transform/package.json b/packages/transform/package.json index 18aaad238..a6392d0ff 100644 --- a/packages/transform/package.json +++ b/packages/transform/package.json @@ -8,12 +8,13 @@ "url": "https://github.com/microsoft/griffel" }, "type": "module", - "main": "./src/index.mjs", - "types": "./src/index.d.mts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./src/index.d.mts", - "default": "./src/index.mjs" + "@griffel/source": "./src/index.mts", + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "./package.json": "./package.json" }, @@ -24,5 +25,10 @@ "magic-string": "^0.30.19", "oxc-parser": "^0.132.0", "oxc-walker": "^1.0.0" - } + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ] } diff --git a/packages/transform/project.json b/packages/transform/project.json index d983b9e3a..61f190608 100644 --- a/packages/transform/project.json +++ b/packages/transform/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/transform" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/transform", - "tsConfig": "packages/transform/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/transform/package.json", - "main": "packages/transform/src/index.mts", - "assets": [ - "packages/transform/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/transform", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/transform/src/evaluation/module.test.mts b/packages/transform/src/evaluation/module.test.mts index 563fec244..8f42edad5 100644 --- a/packages/transform/src/evaluation/module.test.mts +++ b/packages/transform/src/evaluation/module.test.mts @@ -73,7 +73,7 @@ describe('Module', () => { at /child.js: at Script.runInContext (node:vm:) at Module.evaluate (/packages/transform/src/evaluation/module.mts:) - at require.Object.assign.ensure (/packages/transform/src/evaluation/module.mts:) + at Module.require.Object.assign.ensure (/packages/transform/src/evaluation/module.mts:) at /entry.js: at /entry.js: at Script.runInContext (node:vm:) diff --git a/packages/transform/tsconfig.json b/packages/transform/tsconfig.json index 00433f885..62ebbd946 100644 --- a/packages/transform/tsconfig.json +++ b/packages/transform/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "ES2022" - }, "files": [], "include": [], "references": [ diff --git a/packages/transform/tsconfig.lib.json b/packages/transform/tsconfig.lib.json index 6d2b82de4..60d8a91c0 100644 --- a/packages/transform/tsconfig.lib.json +++ b/packages/transform/tsconfig.lib.json @@ -1,30 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "ESNext", - "moduleResolution": "bundler", - "outDir": "../../dist/out-tsc", - "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": [ - "__fixtures__/**/*", - "**/*.spec.ts", - "**/*.test.ts", - "jest.config.ts", - "vite.config.ts", - "vite.config.mts", - "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx" - ], - "include": ["**/*.mts"] + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../transform-shaker/tsconfig.lib.json" + }, + { + "path": "../core/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/transform/tsconfig.spec.json b/packages/transform/tsconfig.spec.json index b37a60f5c..2da67144c 100644 --- a/packages/transform/tsconfig.spec.json +++ b/packages/transform/tsconfig.spec.json @@ -1,24 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vite.config.ts", - "vite.config.mts", "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/common/**/*.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/transform/vitest.config.mts b/packages/transform/vitest.config.mts index 89b69bdee..31851c11a 100644 --- a/packages/transform/vitest.config.mts +++ b/packages/transform/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/transform', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'node', diff --git a/packages/webpack-extraction-plugin/package.json b/packages/webpack-extraction-plugin/package.json index 8ce10c817..361012bc3 100644 --- a/packages/webpack-extraction-plugin/package.json +++ b/packages/webpack-extraction-plugin/package.json @@ -7,6 +7,22 @@ "type": "git", "url": "https://github.com/microsoft/griffel" }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "virtual-loader/", + "dist/", + "README.md", + "LICENSE.md" + ], "dependencies": { "@babel/core": "^7.29.0", "@babel/helper-module-imports": "^7.22.15", diff --git a/packages/webpack-extraction-plugin/project.json b/packages/webpack-extraction-plugin/project.json index 2395f022f..8abe05a3a 100644 --- a/packages/webpack-extraction-plugin/project.json +++ b/packages/webpack-extraction-plugin/project.json @@ -15,42 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/webpack-extraction-plugin" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/webpack-extraction-plugin", - "tsConfig": "packages/webpack-extraction-plugin/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/webpack-extraction-plugin/package.json", - "main": "packages/webpack-extraction-plugin/src/index.ts", - "assets": [ - "packages/webpack-extraction-plugin/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - }, - { - "glob": "*.(css|js)", - "input": "packages/webpack-extraction-plugin/virtual-loader", - "output": "./virtual-loader" - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/webpack-extraction-plugin", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/webpack-extraction-plugin/tsconfig.json b/packages/webpack-extraction-plugin/tsconfig.json index 4393873b8..62ebbd946 100644 --- a/packages/webpack-extraction-plugin/tsconfig.json +++ b/packages/webpack-extraction-plugin/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true, - "checkJs": true - }, "files": [], "include": [], "references": [ diff --git a/packages/webpack-extraction-plugin/tsconfig.lib.json b/packages/webpack-extraction-plugin/tsconfig.lib.json index ed62f0e15..5818d020d 100644 --- a/packages/webpack-extraction-plugin/tsconfig.lib.json +++ b/packages/webpack-extraction-plugin/tsconfig.lib.json @@ -1,11 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", + "module": "node16", + "moduleResolution": "node16", + "customConditions": [], "declaration": true, + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["__fixtures__/**/*/*.ts", "**/*.spec.ts", "**/*.test.ts", "src/common/**", "jest.config.ts"], - "include": ["**/*.ts", "virtual-loader/index.js"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../core/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/webpack-extraction-plugin/tsconfig.spec.json b/packages/webpack-extraction-plugin/tsconfig.spec.json index d66c6803c..2da67144c 100644 --- a/packages/webpack-extraction-plugin/tsconfig.spec.json +++ b/packages/webpack-extraction-plugin/tsconfig.spec.json @@ -1,22 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment", "static-assets"] + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vitest.config.mts", - "__fixtures__/**/*/code.ts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/webpack-extraction-plugin/virtual-loader/index.js b/packages/webpack-extraction-plugin/virtual-loader/index.js index e3574ad94..4b000a5e2 100644 --- a/packages/webpack-extraction-plugin/virtual-loader/index.js +++ b/packages/webpack-extraction-plugin/virtual-loader/index.js @@ -1,4 +1,4 @@ -const { GriffelCssLoaderContextKey } = require('../src/constants'); +const GriffelCssLoaderContextKey = Symbol.for(`GriffelExtractPlugin/GriffelCssLoaderContextKey`); /** * @this {import("../src/constants").SupplementedLoaderContext} diff --git a/packages/webpack-extraction-plugin/vitest.config.mts b/packages/webpack-extraction-plugin/vitest.config.mts index a8f30bf12..a6025a328 100644 --- a/packages/webpack-extraction-plugin/vitest.config.mts +++ b/packages/webpack-extraction-plugin/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/webpack-extraction-plugin', - plugins: [nxViteTsPaths()], test: { watch: false, // babel-plugin-tester reads describe/it from globalThis at call time diff --git a/packages/webpack-loader/package.json b/packages/webpack-loader/package.json index f5dfefaaa..39b978bdb 100644 --- a/packages/webpack-loader/package.json +++ b/packages/webpack-loader/package.json @@ -7,6 +7,21 @@ "type": "git", "url": "https://github.com/microsoft/griffel" }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "@griffel/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "README.md", + "LICENSE.md" + ], "dependencies": { "@babel/core": "^7.29.0", "@griffel/babel-preset": "^1.8.6", diff --git a/packages/webpack-loader/project.json b/packages/webpack-loader/project.json index ac4d21fcd..6db1b6bc4 100644 --- a/packages/webpack-loader/project.json +++ b/packages/webpack-loader/project.json @@ -15,37 +15,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/packages/webpack-loader" } - }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/webpack-loader", - "tsConfig": "packages/webpack-loader/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/webpack-loader/package.json", - "main": "packages/webpack-loader/src/index.ts", - "assets": [ - "packages/webpack-loader/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/webpack-loader", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/packages/webpack-loader/tsconfig.json b/packages/webpack-loader/tsconfig.json index 915d41150..62ebbd946 100644 --- a/packages/webpack-loader/tsconfig.json +++ b/packages/webpack-loader/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true - }, "files": [], "include": [], "references": [ diff --git a/packages/webpack-loader/tsconfig.lib.json b/packages/webpack-loader/tsconfig.lib.json index c5908aa5b..70bf795d0 100644 --- a/packages/webpack-loader/tsconfig.lib.json +++ b/packages/webpack-loader/tsconfig.lib.json @@ -1,11 +1,20 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "outDir": "../../dist/out-tsc", - "declaration": true, + "module": "node16", + "moduleResolution": "node16", + "outDir": "./dist", + "rootDir": "./src", "types": ["node", "environment"] }, - "exclude": ["__fixtures__/*/*.ts", "**/*.spec.ts", "**/*.test.ts", "src/common/**", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../babel-preset/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/webpack-loader/tsconfig.spec.json b/packages/webpack-loader/tsconfig.spec.json index c75ea2cf1..2da67144c 100644 --- a/packages/webpack-loader/tsconfig.spec.json +++ b/packages/webpack-loader/tsconfig.spec.json @@ -1,22 +1,21 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "outDir": "../../dist/out-tsc", + "outDir": "./out-tsc/spec", "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] }, "include": [ - "vitest.config.mts", - "__fixtures__/*/code.ts", + "vitest.config.ts", + "src/common/**/*.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/webpack-loader/vitest.config.mts b/packages/webpack-loader/vitest.config.mts index 13d3c63e6..ac04bb2ac 100644 --- a/packages/webpack-loader/vitest.config.mts +++ b/packages/webpack-loader/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/webpack-loader', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'node', diff --git a/packages/webpack-plugin/__fixtures__/assets-flip/output.ts b/packages/webpack-plugin/__fixtures__/assets-flip/output.ts index bffef3d7a..6eaa365e0 100644 --- a/packages/webpack-plugin/__fixtures__/assets-flip/output.ts +++ b/packages/webpack-plugin/__fixtures__/assets-flip/output.ts @@ -5,4 +5,4 @@ import _asset2 from './right.jpg'; export const useStyles = __css({ root: { Bcmaq0h: ['f___0', 'f___1'] } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/assets-multiple/output.ts b/packages/webpack-plugin/__fixtures__/assets-multiple/output.ts index 829e8899d..d0fb58dd3 100644 --- a/packages/webpack-plugin/__fixtures__/assets-multiple/output.ts +++ b/packages/webpack-plugin/__fixtures__/assets-multiple/output.ts @@ -4,4 +4,4 @@ import _asset2 from './empty.jpg'; export const useStyles = __css({ root: { Bcmaq0h: 'f___0' } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/assets/output.ts b/packages/webpack-plugin/__fixtures__/assets/output.ts index f11e8ecea..05325bd2b 100644 --- a/packages/webpack-plugin/__fixtures__/assets/output.ts +++ b/packages/webpack-plugin/__fixtures__/assets/output.ts @@ -3,4 +3,4 @@ import _asset from './blank.jpg'; export const useStyles = __css({ root: { Bcmaq0h: 'f___0' } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/basic-rules/output.ts b/packages/webpack-plugin/__fixtures__/basic-rules/output.ts index c1f4fe5ec..4e9a6782f 100644 --- a/packages/webpack-plugin/__fixtures__/basic-rules/output.ts +++ b/packages/webpack-plugin/__fixtures__/basic-rules/output.ts @@ -35,4 +35,4 @@ export const useStyles = __css({ icon: { De3pzq: 'fcnqdeg', mc9l5x: 'f22iagw' }, }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/config-classname-hash-salt/output.ts b/packages/webpack-plugin/__fixtures__/config-classname-hash-salt/output.ts index 535df6e3b..fc45ec41c 100644 --- a/packages/webpack-plugin/__fixtures__/config-classname-hash-salt/output.ts +++ b/packages/webpack-plugin/__fixtures__/config-classname-hash-salt/output.ts @@ -2,4 +2,4 @@ import { __css } from '@griffel/react'; export const useStyles = __css({ root: { sj55zd: 'feohi3x', uwmqm3: ['f1rwgqon', 'f1tyzn0d'] } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/mixed-vm/output.ts b/packages/webpack-plugin/__fixtures__/mixed-vm/output.ts index 1eb0be250..9532a7af9 100644 --- a/packages/webpack-plugin/__fixtures__/mixed-vm/output.ts +++ b/packages/webpack-plugin/__fixtures__/mixed-vm/output.ts @@ -13,4 +13,4 @@ export const useTextStyles = __css({ afterAlignToPrimary: { Br312pm: 'fwu52yu' }, }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/mixed/output.ts b/packages/webpack-plugin/__fixtures__/mixed/output.ts index 98c41fadf..dce708d7d 100644 --- a/packages/webpack-plugin/__fixtures__/mixed/output.ts +++ b/packages/webpack-plugin/__fixtures__/mixed/output.ts @@ -4,4 +4,4 @@ export const useClasses = __css({ root: { sj55zd: 'fe3e8s9' } }); export const useClassName = __resetCSS('rjefjbm', 'r7z97ji'); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/multiple/output.ts b/packages/webpack-plugin/__fixtures__/multiple/output.ts index dac931eb6..a080aecdf 100644 --- a/packages/webpack-plugin/__fixtures__/multiple/output.ts +++ b/packages/webpack-plugin/__fixtures__/multiple/output.ts @@ -36,4 +36,4 @@ export const useStylesB = __css({ }, }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/reset-assets/output.ts b/packages/webpack-plugin/__fixtures__/reset-assets/output.ts index 8cebb0403..a77b60b02 100644 --- a/packages/webpack-plugin/__fixtures__/reset-assets/output.ts +++ b/packages/webpack-plugin/__fixtures__/reset-assets/output.ts @@ -3,4 +3,4 @@ import _asset from './blank.jpg'; export const useClassName = __resetCSS('r___0', null); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/reset-media/output.ts b/packages/webpack-plugin/__fixtures__/reset-media/output.ts index 0c50b0266..e7f792057 100644 --- a/packages/webpack-plugin/__fixtures__/reset-media/output.ts +++ b/packages/webpack-plugin/__fixtures__/reset-media/output.ts @@ -2,4 +2,4 @@ import { __resetCSS } from '@griffel/react'; export const useClassName = __resetCSS('rjrhw4c', null); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/reset/output.ts b/packages/webpack-plugin/__fixtures__/reset/output.ts index aa514047f..2ec4d63c4 100644 --- a/packages/webpack-plugin/__fixtures__/reset/output.ts +++ b/packages/webpack-plugin/__fixtures__/reset/output.ts @@ -2,4 +2,4 @@ import { __resetCSS } from '@griffel/react'; export const useClassName = __resetCSS('rjefjbm', 'r7z97ji'); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/rules-deduplication/output.ts b/packages/webpack-plugin/__fixtures__/rules-deduplication/output.ts index df693579b..2f068cbf9 100644 --- a/packages/webpack-plugin/__fixtures__/rules-deduplication/output.ts +++ b/packages/webpack-plugin/__fixtures__/rules-deduplication/output.ts @@ -4,4 +4,4 @@ export const useStylesA = __css({ root: { sj55zd: 'fe3e8s9', De3pzq: 'fcnqdeg' } export const useStylesB = __css({ root: { sj55zd: 'fe3e8s9', De3pzq: 'fcnqdeg' } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/style-buckets-scope/output.ts b/packages/webpack-plugin/__fixtures__/style-buckets-scope/output.ts index 7d7189ea1..9ac768067 100644 --- a/packages/webpack-plugin/__fixtures__/style-buckets-scope/output.ts +++ b/packages/webpack-plugin/__fixtures__/style-buckets-scope/output.ts @@ -2,4 +2,4 @@ import { __css } from '@griffel/react'; export const useStyles = __css({ root: { sj55zd: 'fe3e8s9', J2wb9c: 'f1sje2gt', hth0cq: 'f7t33c5' } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/style-buckets/output.ts b/packages/webpack-plugin/__fixtures__/style-buckets/output.ts index f6de9b922..465873094 100644 --- a/packages/webpack-plugin/__fixtures__/style-buckets/output.ts +++ b/packages/webpack-plugin/__fixtures__/style-buckets/output.ts @@ -15,4 +15,4 @@ export const useStyles = __css({ atRules: { Bv12yb3: ['f1g6ul6r', 'f1fp4ujf'], C7niov: 'fraqsfm', B7iucu3: 'fqoinyl' }, }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/__fixtures__/unstable-attach-to-main/output.ts b/packages/webpack-plugin/__fixtures__/unstable-attach-to-main/output.ts index af36653e4..5dd140ce3 100644 --- a/packages/webpack-plugin/__fixtures__/unstable-attach-to-main/output.ts +++ b/packages/webpack-plugin/__fixtures__/unstable-attach-to-main/output.ts @@ -2,4 +2,4 @@ import { __css } from '@griffel/react'; export const useClasses = __css({ root: { sj55zd: 'fe3e8s9' } }); -import './code.griffel.css!=!../../src/virtual-loader/index.cjs!./code.ts'; +import './code.griffel.css!=!../../virtual-loader/index.cjs!./code.ts'; diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index 6ed095952..2c3bb02e6 100644 --- a/packages/webpack-plugin/package.json +++ b/packages/webpack-plugin/package.json @@ -8,19 +8,27 @@ "url": "https://github.com/microsoft/griffel" }, "type": "module", - "main": "./src/index.mjs", - "types": "./src/index.d.mts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "exports": { ".": { - "types": "./src/index.d.mts", - "default": "./src/index.mjs" + "@griffel/source": "./src/index.mts", + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "./loader": { - "types": "./src/webpackLoader.d.mts", - "default": "./src/webpackLoader.mjs" + "@griffel/source": "./src/webpackLoader.mts", + "types": "./dist/webpackLoader.d.mts", + "default": "./dist/webpackLoader.mjs" }, "./package.json": "./package.json" }, + "files": [ + "virtual-loader/", + "dist/", + "README.md", + "LICENSE.md" + ], "dependencies": { "@griffel/core": "^1.21.2", "@griffel/transform": "^3.0.6", diff --git a/packages/webpack-plugin/project.json b/packages/webpack-plugin/project.json index 596462dea..39321900d 100644 --- a/packages/webpack-plugin/project.json +++ b/packages/webpack-plugin/project.json @@ -9,42 +9,6 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] }, - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/webpack-plugin", - "tsConfig": "packages/webpack-plugin/tsconfig.lib.json", - "skipTypeField": true, - "packageJson": "packages/webpack-plugin/package.json", - "main": "packages/webpack-plugin/src/index.mts", - "assets": [ - "packages/webpack-plugin/README.md", - { - "glob": "LICENSE.md", - "input": ".", - "output": "." - }, - { - "glob": "*", - "input": "packages/webpack-plugin/src/virtual-loader", - "output": "src/virtual-loader" - } - ] - } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "packages/webpack-plugin", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] - }, "test": { "executor": "@nx/vitest:test", "outputs": ["{options.reportsDirectory}"], diff --git a/packages/webpack-plugin/src/GriffelPlugin.test.mts b/packages/webpack-plugin/src/GriffelPlugin.test.mts index 1631084ca..09fa53f47 100644 --- a/packages/webpack-plugin/src/GriffelPlugin.test.mts +++ b/packages/webpack-plugin/src/GriffelPlugin.test.mts @@ -473,7 +473,7 @@ describe('GriffelCSSExtractionPlugin', () => { at /packages/webpack-plugin/__fixtures__/vm-error-trace/broken.ts: at Script.runInContext (node:vm:) at Module.evaluate (/packages/transform/src/evaluation/module.mts:) - at require.Object.assign.ensure (/packages/transform/src/evaluation/module.mts:) + at Module.require.Object.assign.ensure (/packages/transform/src/evaluation/module.mts:) at /packages/webpack-plugin/__fixtures__/vm-error-trace/code.ts: at /packages/webpack-plugin/__fixtures__/vm-error-trace/code.ts: at Script.runInContext (node:vm:) diff --git a/packages/webpack-plugin/src/webpackLoader.mts b/packages/webpack-plugin/src/webpackLoader.mts index 1424b040e..6272293ea 100644 --- a/packages/webpack-plugin/src/webpackLoader.mts +++ b/packages/webpack-plugin/src/webpackLoader.mts @@ -12,8 +12,9 @@ export type WebpackLoaderOptions = Omit>; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -// TODO: do something better, define via exports? -const virtualLoaderPath = path.resolve(__dirname, 'virtual-loader', 'index.cjs'); +// virtual-loader/ sits one dir above the compiled .mjs (in dist/) at the package +// root, so `npm pack` ships it via the `files` field without a build-time copy. +const virtualLoaderPath = path.resolve(__dirname, '..', 'virtual-loader', 'index.cjs'); function webpackLoader( this: SupplementedLoaderContext, diff --git a/packages/webpack-plugin/tsconfig.json b/packages/webpack-plugin/tsconfig.json index d824d4bb0..62ebbd946 100644 --- a/packages/webpack-plugin/tsconfig.json +++ b/packages/webpack-plugin/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "ES2022" - }, "files": [], "include": [], "references": [ diff --git a/packages/webpack-plugin/tsconfig.lib.json b/packages/webpack-plugin/tsconfig.lib.json index 6d2b82de4..e51db2f8e 100644 --- a/packages/webpack-plugin/tsconfig.lib.json +++ b/packages/webpack-plugin/tsconfig.lib.json @@ -1,30 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "ESNext", - "moduleResolution": "bundler", - "outDir": "../../dist/out-tsc", - "declaration": true, + "outDir": "./dist", + "rootDir": "./src", + "target": "esnext", "types": ["node", "environment"] }, - "exclude": [ - "__fixtures__/**/*", - "**/*.spec.ts", - "**/*.test.ts", - "jest.config.ts", - "vite.config.ts", - "vite.config.mts", - "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx" - ], - "include": ["**/*.mts"] + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.mts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "vitest.config.ts"], + "references": [ + { + "path": "../transform/tsconfig.lib.json" + }, + { + "path": "../core/tsconfig.lib.json" + }, + { + "path": "../react/tsconfig.lib.json" + } + ] } diff --git a/packages/webpack-plugin/tsconfig.spec.json b/packages/webpack-plugin/tsconfig.spec.json index 499262f90..87aeecf83 100644 --- a/packages/webpack-plugin/tsconfig.spec.json +++ b/packages/webpack-plugin/tsconfig.spec.json @@ -1,23 +1,22 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["node", "environment"] + "outDir": "./out-tsc/spec", + "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], + "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"], + "jsx": "react-jsx" }, "include": [ - "vite.config.ts", - "vite.config.mts", "vitest.config.ts", - "vitest.config.mts", - "src/**/*.test.ts", - "src/**/*.test.mts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/common/**/*.ts", + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx" + ], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/packages/webpack-plugin/src/virtual-loader/index.cjs b/packages/webpack-plugin/virtual-loader/index.cjs similarity index 100% rename from packages/webpack-plugin/src/virtual-loader/index.cjs rename to packages/webpack-plugin/virtual-loader/index.cjs diff --git a/packages/webpack-plugin/vitest.config.mts b/packages/webpack-plugin/vitest.config.mts index 93f5bea6f..295c739d2 100644 --- a/packages/webpack-plugin/vitest.config.mts +++ b/packages/webpack-plugin/vitest.config.mts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/packages/webpack-plugin', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'node', diff --git a/tools/build-cjs.mjs b/tools/build-cjs.mjs deleted file mode 100644 index 355527d0a..000000000 --- a/tools/build-cjs.mjs +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Converts ESM .js files to CJS .cjs files using SWC. - * - * Usage: node tools/build-cjs.mjs - */ -import { transformFileSync } from '@swc/core'; -import { mkdirSync, readdirSync, writeFileSync } from 'node:fs'; -import { dirname, join, resolve, relative } from 'node:path'; - -const [esmDir, cjsDir] = process.argv.slice(2); - -if (!esmDir || !cjsDir) { - console.error('Usage: node tools/build-cjs.mjs '); - process.exit(1); -} - -const absEsmDir = resolve(esmDir); -const absCjsDir = resolve(cjsDir); - -function collectJsFiles(dir) { - const results = []; - for (const entry of readdirSync(dir, { withFileTypes: true })) { - const fullPath = join(dir, entry.name); - if (entry.isDirectory()) { - results.push(...collectJsFiles(fullPath)); - } else if (entry.name.endsWith('.js')) { - results.push(fullPath); - } - } - return results; -} - -const jsFiles = collectJsFiles(absEsmDir); - -for (const absInput of jsFiles) { - const rel = relative(absEsmDir, absInput); - const absOutput = join(absCjsDir, rel.replace(/\.js$/, '.cjs')); - - const result = transformFileSync(absInput, { - module: { type: 'commonjs' }, - jsc: { - parser: { syntax: 'ecmascript' }, - target: 'es2022', - }, - sourceMaps: false, - }); - - // Rewrite .js requires to .cjs - const cjsCode = result.code.replace(/(require\(["']\.\.?\/[^"']+)\.js(["']\))/g, '$1.cjs$2'); - - mkdirSync(dirname(absOutput), { recursive: true }); - writeFileSync(absOutput, cjsCode); -} - -console.log(`Converted ${jsFiles.length} ESM → CJS files into ${cjsDir}`); diff --git a/tools/build-cjs.ts b/tools/build-cjs.ts new file mode 100644 index 000000000..46ff1bb7d --- /dev/null +++ b/tools/build-cjs.ts @@ -0,0 +1,95 @@ +/** + * Converts a package's ESM build into a sibling CJS build: + * - /foo/bar.js → /foo/bar.cjs (transpiled by SWC) + * - /foo/bar.d.ts → /foo/bar.d.cts (text-renamed) + * + * Relative `.js` specifiers inside both .js and .d.ts files are rewritten + * to `.cjs` so the CJS package keeps an internally consistent graph. + * + * The .d.cts companions exist so consumers using the `require` exports + * condition under moduleResolution: node16/nodenext see CJS-context type + * declarations. + * + * Usage: node tools/build-cjs.ts + */ +import { transformFileSync, type Options } from '@swc/core'; +import { mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { dirname, join, relative, resolve } from 'node:path'; + +const SWC_OPTIONS: Options = { + module: { type: 'commonjs' }, + jsc: { parser: { syntax: 'ecmascript' }, target: 'es2022' }, + sourceMaps: false, +}; + +// `require("./foo.js")` → `require("./foo.cjs")` in compiled CJS sources +const REWRITE_REQUIRE = /(require\(["']\.\.?\/[^"']+)\.js(["']\))/g; +// `from "./foo.js"` → `from "./foo.cjs"` in .d.ts → .d.cts conversions +const REWRITE_IMPORT = /(from\s+["']\.\.?\/[^"']+)\.js(["'])/g; + +const OUTPUT_SUBDIR_TO_SKIP = 'cjs'; + +function* walkFiles(dir: string): Generator { + for (const entry of readdirSync(dir, { withFileTypes: true })) { + // Skip the output subdirectory if it lives under the input dir (re-runs). + if (entry.name === OUTPUT_SUBDIR_TO_SKIP) { + continue; + } + + const fullPath = join(dir, entry.name); + if (entry.isDirectory()) { + yield* walkFiles(fullPath); + continue; + } + + yield fullPath; + } +} + +function writeOutput(absPath: string, content: string): void { + mkdirSync(dirname(absPath), { recursive: true }); + writeFileSync(absPath, content); +} + +function transpileJsToCjs(absSource: string, absTarget: string): void { + const { code } = transformFileSync(absSource, SWC_OPTIONS); + + writeOutput(absTarget, code.replace(REWRITE_REQUIRE, '$1.cjs$2')); +} + +function copyDtsToDcts(absSource: string, absTarget: string): void { + const source = readFileSync(absSource, 'utf8'); + + writeOutput(absTarget, source.replace(REWRITE_IMPORT, '$1.cjs$2')); +} + +function main(): void { + const [esmDir, cjsDir] = process.argv.slice(2); + + if (!esmDir || !cjsDir) { + console.error('Usage: node tools/build-cjs.ts '); + process.exit(1); + } + + const absEsmDir = resolve(esmDir); + const absCjsDir = resolve(cjsDir); + + let jsCount = 0; + let dtsCount = 0; + + for (const absInput of walkFiles(absEsmDir)) { + const relativePath = relative(absEsmDir, absInput); + + if (absInput.endsWith('.d.ts')) { + copyDtsToDcts(absInput, join(absCjsDir, relativePath.replace(/\.d\.ts$/, '.d.cts'))); + dtsCount++; + } else if (absInput.endsWith('.js')) { + transpileJsToCjs(absInput, join(absCjsDir, relativePath.replace(/\.js$/, '.cjs'))); + jsCount++; + } + } + + console.log(`Converted ${jsCount} ESM → CJS files and ${dtsCount} .d.ts → .d.cts into ${cjsDir}`); +} + +main(); diff --git a/tools/update-shorthands/package.json b/tools/update-shorthands/package.json index 6c8cf8425..14d2dccbc 100644 --- a/tools/update-shorthands/package.json +++ b/tools/update-shorthands/package.json @@ -2,5 +2,9 @@ "name": "@griffel/update-shorthands", "version": "0.0.0", "private": true, - "type": "module" + "type": "module", + "devDependencies": { + "@griffel/core": "workspace:*", + "@griffel/style-types": "workspace:*" + } } diff --git a/tools/update-shorthands/project.json b/tools/update-shorthands/project.json index c27da15af..2ca7ece33 100644 --- a/tools/update-shorthands/project.json +++ b/tools/update-shorthands/project.json @@ -28,18 +28,6 @@ "options": { "reportsDirectory": "{projectRoot}/../../coverage/tools/update-shorthands" } - }, - "type-check": { - "executor": "nx:run-commands", - "options": { - "cwd": "tools/update-shorthands", - "commands": [ - { - "command": "tsc -b --pretty" - } - ] - }, - "outputs": [] } } } diff --git a/tools/update-shorthands/src/filterShorthandsProperties.ts b/tools/update-shorthands/src/filterShorthandsProperties.ts index e114be85a..95f4a7299 100644 --- a/tools/update-shorthands/src/filterShorthandsProperties.ts +++ b/tools/update-shorthands/src/filterShorthandsProperties.ts @@ -1,12 +1,4 @@ -// TODO: prefer `import { UNSUPPORTED_CSS_PROPERTIES } from '@griffel/core'`. Today the -// workspace symlink resolves to packages/core which only ships .ts sources, and Node -// can't resolve the package.json `import` field (./src/index.js). Options to revisit: -// 1. A custom Node loader hook that rewrites @griffel/core to the dist path. -// 2. Repoint the node_modules/@griffel/core symlink at dist/packages/core post-build. -// 3. Add a "source" export condition to packages/core/package.json and run with -// `node --conditions=source`. -// 4. Inline the constant or read it from the source TS file directly. -import { UNSUPPORTED_CSS_PROPERTIES } from '../../../dist/packages/core/src/index.js'; +import { UNSUPPORTED_CSS_PROPERTIES } from '@griffel/core'; import type { MdnData, MdnShorthandProperty } from './types.ts'; import { isShorthandProperty, isVendorProperty, toCamelCase } from './utils.ts'; diff --git a/tools/update-shorthands/tsconfig.json b/tools/update-shorthands/tsconfig.json index 2e00bfa0e..c23e61c80 100644 --- a/tools/update-shorthands/tsconfig.json +++ b/tools/update-shorthands/tsconfig.json @@ -1,19 +1,10 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "module": "nodenext", - "moduleResolution": "nodenext", - "allowImportingTsExtensions": true - }, "files": [], "include": [], "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" } ] } diff --git a/tools/update-shorthands/tsconfig.lib.json b/tools/update-shorthands/tsconfig.lib.json index 215af9f85..b7c68b095 100644 --- a/tools/update-shorthands/tsconfig.lib.json +++ b/tools/update-shorthands/tsconfig.lib.json @@ -1,9 +1,20 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "noEmit": true, + "module": "nodenext", + "moduleResolution": "nodenext", + "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, + "outDir": "./dist", "types": ["node", "environment"] }, - "exclude": ["__fixtures__/*/*.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../../packages/style-types/tsconfig.lib.json" + }, + { + "path": "../../packages/core/tsconfig.lib.json" + } + ] } diff --git a/tools/update-shorthands/tsconfig.spec.json b/tools/update-shorthands/tsconfig.spec.json index 7583c3782..25b22b6a8 100644 --- a/tools/update-shorthands/tsconfig.spec.json +++ b/tools/update-shorthands/tsconfig.spec.json @@ -1,24 +1,17 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "outDir": "../../dist/out-tsc", - "noEmit": true, "module": "nodenext", - "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"], - "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"] + "moduleResolution": "nodenext", + "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, + "outDir": "./out-tsc/spec", + "types": ["vitest/importMeta", "node", "vitest", "environment"] }, - "include": [ - "vitest.config.ts", - "__fixtures__/*/code.ts", - "**/*.test.ts", - "**/*.spec.ts", - "**/*.test.tsx", - "**/*.spec.tsx", - "**/*.test.js", - "**/*.spec.js", - "**/*.test.jsx", - "**/*.spec.jsx", - "**/*.d.ts" + "include": ["**/*.test.ts", "**/*.spec.ts"], + "references": [ + { + "path": "./tsconfig.lib.json" + } ] } diff --git a/tools/update-shorthands/vitest.config.ts b/tools/update-shorthands/vitest.config.ts index e9a7300e5..ec0599ac9 100644 --- a/tools/update-shorthands/vitest.config.ts +++ b/tools/update-shorthands/vitest.config.ts @@ -1,10 +1,10 @@ import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; export default defineConfig({ + resolve: { conditions: ['@griffel/source'] }, + ssr: { resolve: { conditions: ['@griffel/source'] } }, root: __dirname, cacheDir: '../../node_modules/.vite/tools/update-shorthands', - plugins: [nxViteTsPaths()], test: { watch: false, environment: 'node', diff --git a/tsconfig.base.json b/tsconfig.base.json index c9f65a370..3aa843259 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,12 +1,12 @@ { "compileOnSave": false, "compilerOptions": { - "rootDir": ".", + "composite": true, + "declarationMap": true, "sourceMap": true, - "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, + "moduleResolution": "bundler", + "customConditions": ["@griffel/source"], + "isolatedModules": true, "importHelpers": true, "target": "es2019", "module": "esnext", @@ -19,25 +19,7 @@ "forceConsistentCasingInFileNames": true, "skipLibCheck": true, "skipDefaultLibCheck": true, - "baseUrl": ".", - "paths": { - "@griffel/babel-preset": ["packages/babel-preset/src/index.ts"], - "@griffel/core": ["packages/core/src/index.ts"], - "@griffel/devtools": ["packages/devtools/src/index.ts"], - "@griffel/e2e-utils": ["e2e/utils/src/index.ts"], - "@griffel/eslint-plugin": ["packages/eslint-plugin/src/index.ts"], - "@griffel/jest-serializer": ["packages/jest-serializer/src/index.ts"], - "@griffel/postcss-syntax": ["packages/postcss-syntax/src/index.ts"], - "@griffel/react": ["packages/react/src/index.ts"], - "@griffel/style-types": ["packages/style-types/src/index.ts"], - "@griffel/transform": ["packages/transform/src/index.mts"], - "@griffel/transform-shaker": ["packages/transform-shaker/src/index.ts"], - "@griffel/update-shorthands": ["tools/update-shorthands/src/index.ts"], - "@griffel/webpack-extraction-plugin": ["packages/webpack-extraction-plugin/src/index.ts"], - "@griffel/webpack-loader": ["packages/webpack-loader/src/index.ts"], - "@griffel/webpack-plugin": ["packages/webpack-plugin/src/index.mts"] - }, - "typeRoots": ["node_modules/@types", "./typings"] + "typeRoots": ["./node_modules/@types", "./typings"] }, "exclude": ["node_modules", "tmp"] } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..50cfe075c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,66 @@ +{ + "extends": "./tsconfig.base.json", + "files": [], + "references": [ + { + "path": "./e2e/eslint" + }, + { + "path": "./e2e/rspack" + }, + { + "path": "./e2e/typescript" + }, + { + "path": "./e2e/utils" + }, + { + "path": "./packages/babel-preset" + }, + { + "path": "./packages/core" + }, + { + "path": "./packages/devtools" + }, + { + "path": "./packages/eslint-plugin" + }, + { + "path": "./packages/jest-serializer" + }, + { + "path": "./packages/postcss-syntax" + }, + { + "path": "./packages/react" + }, + { + "path": "./packages/shadow-dom" + }, + { + "path": "./packages/style-types" + }, + { + "path": "./packages/transform" + }, + { + "path": "./packages/transform-shaker" + }, + { + "path": "./packages/webpack-extraction-plugin" + }, + { + "path": "./packages/webpack-loader" + }, + { + "path": "./packages/webpack-plugin" + }, + { + "path": "./tools/update-shorthands" + }, + { + "path": "./apps/website" + } + ] +} diff --git a/yarn.lock b/yarn.lock index 471495011..424783e35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3747,7 +3747,7 @@ __metadata: languageName: unknown linkType: soft -"@griffel/core@npm:^1.21.2, @griffel/core@workspace:packages/core": +"@griffel/core@npm:^1.21.2, @griffel/core@workspace:*, @griffel/core@workspace:packages/core": version: 0.0.0-use.local resolution: "@griffel/core@workspace:packages/core" dependencies: @@ -3771,6 +3771,10 @@ __metadata: "@griffel/e2e-eslint@workspace:e2e/eslint": version: 0.0.0-use.local resolution: "@griffel/e2e-eslint@workspace:e2e/eslint" + dependencies: + "@griffel/e2e-utils": "npm:*" + "@griffel/eslint-plugin": "npm:^3.0.2" + "@griffel/react": "npm:^1.7.4" languageName: unknown linkType: soft @@ -3789,20 +3793,23 @@ __metadata: "@griffel/e2e-typescript@workspace:e2e/typescript": version: 0.0.0-use.local resolution: "@griffel/e2e-typescript@workspace:e2e/typescript" + dependencies: + "@griffel/e2e-utils": "workspace:*" + "@griffel/style-types": "workspace:*" languageName: unknown linkType: soft -"@griffel/e2e-utils@npm:*, @griffel/e2e-utils@workspace:e2e/utils": +"@griffel/e2e-utils@npm:*, @griffel/e2e-utils@workspace:*, @griffel/e2e-utils@workspace:e2e/utils": version: 0.0.0-use.local resolution: "@griffel/e2e-utils@workspace:e2e/utils" languageName: unknown linkType: soft -"@griffel/eslint-plugin@workspace:packages/eslint-plugin": +"@griffel/eslint-plugin@npm:^3.0.2, @griffel/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@griffel/eslint-plugin@workspace:packages/eslint-plugin" dependencies: - "@typescript-eslint/utils": "npm:^8.59.1" + "@typescript-eslint/utils": "npm:^8.59.3" csstype: "npm:^3.2.3" tslib: "npm:^2.1.0" peerDependencies: @@ -3850,7 +3857,7 @@ __metadata: languageName: unknown linkType: soft -"@griffel/style-types@npm:^1.4.2, @griffel/style-types@workspace:packages/style-types": +"@griffel/style-types@npm:^1.4.2, @griffel/style-types@workspace:*, @griffel/style-types@workspace:packages/style-types": version: 0.0.0-use.local resolution: "@griffel/style-types@workspace:packages/style-types" dependencies: @@ -3885,6 +3892,9 @@ __metadata: "@griffel/update-shorthands@workspace:tools/update-shorthands": version: 0.0.0-use.local resolution: "@griffel/update-shorthands@workspace:tools/update-shorthands" + dependencies: + "@griffel/core": "workspace:*" + "@griffel/style-types": "workspace:*" languageName: unknown linkType: soft @@ -3929,6 +3939,12 @@ __metadata: languageName: unknown linkType: soft +"@griffel/website@workspace:apps/website": + version: 0.0.0-use.local + resolution: "@griffel/website@workspace:apps/website" + languageName: unknown + linkType: soft + "@hapi/hoek@npm:^9.0.0": version: 9.3.0 resolution: "@hapi/hoek@npm:9.3.0" @@ -9484,22 +9500,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.59.2": - version: 8.59.2 - resolution: "@typescript-eslint/utils@npm:8.59.2" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.9.1" - "@typescript-eslint/scope-manager": "npm:8.59.2" - "@typescript-eslint/types": "npm:8.59.2" - "@typescript-eslint/typescript-estree": "npm:8.59.2" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10/4e157a18b28d656b13ae07583765cc871d992abad0ae0aeb2cde819dd632d62b89da9f9e468dfefead18b9440aa2b9040ca36841525dff4ea97479583114afe0 - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:8.59.4, @typescript-eslint/utils@npm:^8.0.0, @typescript-eslint/utils@npm:^8.48.0, @typescript-eslint/utils@npm:^8.59.1, @typescript-eslint/utils@npm:^8.59.3": +"@typescript-eslint/utils@npm:^8.59.3": version: 8.59.4 resolution: "@typescript-eslint/utils@npm:8.59.4" dependencies: @@ -10886,26 +10887,6 @@ __metadata: languageName: node linkType: hard -"beachball@patch:beachball@npm%3A2.65.4#~/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch": - version: 2.65.4 - resolution: "beachball@patch:beachball@npm%3A2.65.4#~/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch::version=2.65.4&hash=95942e" - dependencies: - "@vercel/detect-agent": "npm:^1.2.1" - cosmiconfig: "npm:^9.0.1" - execa: "npm:^5.1.1" - minimatch: "npm:^3.1.5" - p-graph: "npm:^1.3.0" - p-limit: "npm:^3.1.0" - prompts: "npm:^2.4.2" - semver: "npm:^7.7.4" - workspace-tools: "npm:^0.41.6" - yargs-parser: "npm:^21.1.1" - bin: - beachball: bin/beachball.js - checksum: 10/b7e0c08a5eaeed94df8369208bdbdad9ecbdf60e9100b960f1b2f0864f3ba295a9fc30ed274c9ab79a5f8e8ce8c72fe567d7fb5ce1861ce7549d39bebca0bcef - languageName: node - linkType: hard - "bestzip@npm:2.2.0": version: 2.2.0 resolution: "bestzip@npm:2.2.0" @@ -15271,7 +15252,7 @@ __metadata: "@types/stylis": "npm:4.2.7" "@types/webpack-env": "npm:1.18.4" "@typescript-eslint/rule-tester": "npm:^8.0.0" - "@typescript-eslint/utils": "npm:^8.59.1" + "@typescript-eslint/utils": "npm:^8.59.3" "@vitejs/plugin-react": "npm:^6.0.1" "@vitest/browser": "npm:4.1.5" "@vitest/browser-playwright": "npm:4.1.5" @@ -15279,7 +15260,7 @@ __metadata: "@vitest/ui": "npm:4.1.5" ajv: "npm:^8.20.0" babel-plugin-tester: "npm:12.0.0" - beachball: "patch:beachball@npm%3A2.65.4#~/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch" + beachball: "npm:2.65.4" bestzip: "npm:2.2.0" css-loader: "npm:^7.1.4" csstype: "npm:^3.2.3"