diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94dc5a2bbcb..59f804f05fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,11 +84,11 @@ jobs: working-directory: repo-a/build-tests/rush-package-manager-integration-test - name: Ensure repo README is up-to-date - run: node repo-scripts/repo-toolbox/lib/start.js readme --verify + run: node repo-scripts/repo-toolbox/lib-commonjs/start.js readme --verify working-directory: repo-a - name: Collect JSON schemas - run: node repo-scripts/repo-toolbox/lib/start.js collect-json-schemas --output-path ${GITHUB_WORKSPACE}/artifacts/json-schemas + run: node repo-scripts/repo-toolbox/lib-commonjs/start.js collect-json-schemas --output-path ${GITHUB_WORKSPACE}/artifacts/json-schemas working-directory: repo-a - name: Clone another copy of the repo to test the build cache @@ -104,13 +104,13 @@ jobs: working-directory: repo-b - name: Rush update (rush-lib) - run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js update + run: node ${{ github.workspace }}/repo-a/apps/rush/lib-commonjs/start-dev.js update working-directory: repo-b - name: Rush test (rush-lib) - run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js test --verbose --production --timeline + run: node ${{ github.workspace }}/repo-a/apps/rush/lib-commonjs/start-dev.js test --verbose --production --timeline working-directory: repo-b - name: Rush test (rush-lib) again to verify build cache hits - run: node ${{ github.workspace }}/repo-a/apps/rush/lib/start-dev.js test --verbose --production --timeline + run: node ${{ github.workspace }}/repo-a/apps/rush/lib-commonjs/start-dev.js test --verbose --production --timeline working-directory: repo-b diff --git a/.gitignore b/.gitignore index 93d80cd12cf..6f360c85f74 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,4 @@ test-results/ # Claude Code local configuration .claude/*.local.json - +**/tmpclaude-*-cwd diff --git a/.prettierignore b/.prettierignore index 5f92ce14d67..45e09e79d75 100644 --- a/.prettierignore +++ b/.prettierignore @@ -114,6 +114,7 @@ temp/ lib/ lib-amd/ lib-es6/ +lib-esm/ lib-esnext/ lib-commonjs/ lib-shim/ diff --git a/.vscode/launch.json b/.vscode/launch.json index 08cf41ccf2b..265fd0e412d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Rush Debug", "type": "node", "request": "launch", - "program": "${workspaceRoot}/apps/rush/lib/start-dev.js", + "program": "${workspaceRoot}/apps/rush/lib-commonjs/start-dev.js", "stopOnEntry": true, "args": [ "start" @@ -36,7 +36,7 @@ "runtimeArgs": [ "--nolazy", "--inspect-brk", - "${workspaceFolder}/apps/heft/lib/start.js", + "${workspaceFolder}/apps/heft/lib-commonjs/start.js", "--debug", "test", "--test-path-pattern", @@ -56,7 +56,7 @@ "runtimeArgs": [ "--nolazy", "--inspect-brk", - "${workspaceFolder}/apps/heft/lib/start.js", + "${workspaceFolder}/apps/heft/lib-commonjs/start.js", "--debug", "build" ], @@ -74,7 +74,7 @@ "runtimeArgs": [ "--nolazy", "--inspect-brk", - "${workspaceFolder}/apps/heft/lib/start.js", + "${workspaceFolder}/apps/heft/lib-commonjs/start.js", "--debug", "build", "--clean" diff --git a/apps/api-documenter/bin/api-documenter b/apps/api-documenter/bin/api-documenter index aee68e80224..eef2fc27066 100755 --- a/apps/api-documenter/bin/api-documenter +++ b/apps/api-documenter/bin/api-documenter @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/api-documenter/config/api-extractor.json b/apps/api-documenter/config/api-extractor.json index aa9d8f810fd..05c675a8601 100644 --- a/apps/api-documenter/config/api-extractor.json +++ b/apps/api-documenter/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/apps/api-documenter/package.json b/apps/api-documenter/package.json index 8e853a57613..eb0f5457802 100644 --- a/apps/api-documenter/package.json +++ b/apps/api-documenter/package.json @@ -17,8 +17,30 @@ "bin": { "api-documenter": "./bin/api-documenter" }, - "main": "lib/index.js", - "typings": "dist/rollup.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rollup.d.ts", + "exports": { + ".": { + "types": "./dist/rollup.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "dependencies": { "@microsoft/api-extractor-model": "workspace:*", "@microsoft/tsdoc": "~0.16.0", @@ -34,5 +56,9 @@ "@types/resolve": "1.20.2", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/api-extractor/bin/api-extractor b/apps/api-extractor/bin/api-extractor index aee68e80224..eef2fc27066 100755 --- a/apps/api-extractor/bin/api-extractor +++ b/apps/api-extractor/bin/api-extractor @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/api-extractor/config/api-extractor.json b/apps/api-extractor/config/api-extractor.json index aa9d8f810fd..05c675a8601 100644 --- a/apps/api-extractor/config/api-extractor.json +++ b/apps/api-extractor/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/apps/api-extractor/config/heft.json b/apps/api-extractor/config/heft.json index a36ac2cf4c0..f3b430106df 100644 --- a/apps/api-extractor/config/heft.json +++ b/apps/api-extractor/config/heft.json @@ -23,7 +23,7 @@ "copyOperations": [ { "sourcePath": "src", - "destinationFolders": ["lib"], + "destinationFolders": ["lib-commonjs"], "includeGlobs": ["**/test/test-data/**/*"] } ] diff --git a/apps/api-extractor/package.json b/apps/api-extractor/package.json index 54dc663863f..3282d3e263e 100644 --- a/apps/api-extractor/package.json +++ b/apps/api-extractor/package.json @@ -25,8 +25,30 @@ "directory": "apps/api-extractor" }, "homepage": "https://api-extractor.com", - "main": "lib/index.js", - "typings": "dist/rollup.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rollup.d.ts", + "exports": { + ".": { + "types": "./dist/rollup.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "bin": { "api-extractor": "./bin/api-extractor" }, @@ -60,5 +82,9 @@ "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0", "local-eslint-config": "workspace:*" - } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json b/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/apps/cpu-profile-summarizer/bin/cpu-profile-aggregator b/apps/cpu-profile-summarizer/bin/cpu-profile-aggregator index aee68e80224..eef2fc27066 100644 --- a/apps/cpu-profile-summarizer/bin/cpu-profile-aggregator +++ b/apps/cpu-profile-summarizer/bin/cpu-profile-aggregator @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/cpu-profile-summarizer/package.json b/apps/cpu-profile-summarizer/package.json index 7d4e3bbfddb..ceaed40d355 100644 --- a/apps/cpu-profile-summarizer/package.json +++ b/apps/cpu-profile-summarizer/package.json @@ -25,5 +25,24 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/heft/.npmignore b/apps/heft/.npmignore index 3b7d5ed9526..52bcd7587a7 100644 --- a/apps/heft/.npmignore +++ b/apps/heft/.npmignore @@ -33,4 +33,4 @@ !/includes/** !UPGRADING.md - +lib-*/legacy-compatibility/** diff --git a/apps/heft/bin/heft b/apps/heft/bin/heft index ef67d5db050..eb51ae89e3e 100755 --- a/apps/heft/bin/heft +++ b/apps/heft/bin/heft @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/startWithVersionSelector.js'); +require('../lib-commonjs/startWithVersionSelector.js'); diff --git a/apps/heft/config/api-extractor.json b/apps/heft/config/api-extractor.json index 34fb7776c9d..1ddb4758d09 100644 --- a/apps/heft/config/api-extractor.json +++ b/apps/heft/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/apps/heft/config/heft.json b/apps/heft/config/heft.json index 8d1359f022f..76eac0e3d31 100644 --- a/apps/heft/config/heft.json +++ b/apps/heft/config/heft.json @@ -20,6 +20,23 @@ ] } } + }, + + "copy-legacy-compatibility-start-js": { + "taskDependencies": ["typescript"], + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + { + "sourcePath": "src/legacy-compatibility", + "destinationFolders": ["lib"], + "includeGlobs": ["*"] + } + ] + } + } } } } diff --git a/apps/heft/heft-plugin.json b/apps/heft/heft-plugin.json index d7c161a404f..417896dc263 100644 --- a/apps/heft/heft-plugin.json +++ b/apps/heft/heft-plugin.json @@ -6,17 +6,17 @@ "taskPlugins": [ { "pluginName": "copy-files-plugin", - "entryPoint": "./lib/plugins/CopyFilesPlugin", - "optionsSchema": "./lib/schemas/copy-files-options.schema.json" + "entryPoint": "./lib-commonjs/plugins/CopyFilesPlugin", + "optionsSchema": "./lib-commonjs/schemas/copy-files-options.schema.json" }, { "pluginName": "delete-files-plugin", - "entryPoint": "./lib/plugins/DeleteFilesPlugin", - "optionsSchema": "./lib/schemas/delete-files-options.schema.json" + "entryPoint": "./lib-commonjs/plugins/DeleteFilesPlugin", + "optionsSchema": "./lib-commonjs/schemas/delete-files-options.schema.json" }, { "pluginName": "node-service-plugin", - "entryPoint": "./lib/plugins/NodeServicePlugin", + "entryPoint": "./lib-commonjs/plugins/NodeServicePlugin", "parameterScope": "node-service", "parameters": [ { @@ -28,13 +28,13 @@ }, { "pluginName": "run-script-plugin", - "entryPoint": "./lib/plugins/RunScriptPlugin", - "optionsSchema": "./lib/schemas/run-script-options.schema.json" + "entryPoint": "./lib-commonjs/plugins/RunScriptPlugin", + "optionsSchema": "./lib-commonjs/schemas/run-script-options.schema.json" }, { - "entryPoint": "./lib/plugins/SetEnvironmentVariablesPlugin", + "entryPoint": "./lib-commonjs/plugins/SetEnvironmentVariablesPlugin", "pluginName": "set-environment-variables-plugin", - "optionsSchema": "./lib/schemas/set-environment-variables-plugin.schema.json" + "optionsSchema": "./lib-commonjs/schemas/set-environment-variables-plugin.schema.json" } ] } diff --git a/apps/heft/package.json b/apps/heft/package.json index 4dd3f5d24d1..73dc45725a7 100644 --- a/apps/heft/package.json +++ b/apps/heft/package.json @@ -21,8 +21,31 @@ "node": ">=10.13.0" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "dist/heft.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft.d.ts", + "exports": { + ".": { + "types": "./dist/heft.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "bin": { "heft": "./bin/heft" }, @@ -53,5 +76,11 @@ "@types/watchpack": "2.4.0", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-commonjs/startWithVersionSelector.js", + "lib-esm/start.js", + "lib-esm/startWithVersionSelector.js" + ] } diff --git a/apps/heft/src/legacy-compatibility/start.js b/apps/heft/src/legacy-compatibility/start.js new file mode 100644 index 00000000000..5a4723e7d2e --- /dev/null +++ b/apps/heft/src/legacy-compatibility/start.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +// This file is specifically included for compatibility with older global installations of Heft. +require('../lib-commonjs/start.js'); diff --git a/apps/heft/src/start.ts b/apps/heft/src/start.ts index b6c5f1e9391..0fa5a60c557 100644 --- a/apps/heft/src/start.ts +++ b/apps/heft/src/start.ts @@ -3,7 +3,7 @@ import { HeftCommandLineParser } from './cli/HeftCommandLineParser'; -// Launching via lib/start.js bypasses the version selector. Use that for debugging Heft. +// Launching via lib-commonjs/start.js bypasses the version selector. Use that for debugging Heft. const parser: HeftCommandLineParser = new HeftCommandLineParser(); diff --git a/apps/heft/src/startWithVersionSelector.ts b/apps/heft/src/startWithVersionSelector.ts index d4a3a3dc150..e9cc3b950f6 100644 --- a/apps/heft/src/startWithVersionSelector.ts +++ b/apps/heft/src/startWithVersionSelector.ts @@ -93,9 +93,19 @@ function tryStartLocalHeft(): boolean { // installed as "/node_modules/@rushstack/heft". const heftFolder: string = path.join(projectFolder, 'node_modules', Constants.heftPackageName); - heftEntryPoint = path.join(heftFolder, 'lib', 'start.js'); - if (!fs.existsSync(heftEntryPoint)) { - throw new Error('Unable to find Heft entry point: ' + heftEntryPoint); + // Try the new output layout first, then fall back to the legacy layout + const commonJsHeftEntryPoint: string = path.join(heftFolder, 'lib-commonjs', 'start.js'); + if (!fs.existsSync(commonJsHeftEntryPoint)) { + const legacyHeftEntryPoint: string = path.join(heftFolder, 'lib', 'start.js'); + if (!fs.existsSync(legacyHeftEntryPoint)) { + throw new Error( + `Unable to find Heft entry point: ${commonJsHeftEntryPoint} or ${legacyHeftEntryPoint}` + ); + } else { + heftEntryPoint = legacyHeftEntryPoint; + } + } else { + heftEntryPoint = commonJsHeftEntryPoint; } } catch (error) { throw new Error('Error probing for local Heft version: ' + (error as Error).message); diff --git a/apps/lockfile-explorer-web/package.json b/apps/lockfile-explorer-web/package.json index 7eeabe34cc8..bb22f5bd43f 100644 --- a/apps/lockfile-explorer-web/package.json +++ b/apps/lockfile-explorer-web/package.json @@ -28,5 +28,6 @@ "eslint": "~9.37.0", "local-web-rig": "workspace:*", "typescript": "5.8.2" - } + }, + "sideEffects": false } diff --git a/apps/lockfile-explorer-web/webpack.config.js b/apps/lockfile-explorer-web/webpack.config.js index 7b09bf573cd..45fec6530ca 100644 --- a/apps/lockfile-explorer-web/webpack.config.js +++ b/apps/lockfile-explorer-web/webpack.config.js @@ -10,6 +10,9 @@ module.exports = function createConfig(env, argv) { projectRoot: __dirname, // Documentation: https://webpack.js.org/configuration/ configOverride: { + entry: { + app: `${__dirname}/lib-esm/start.js` + }, resolve: { alias: { // Don't rebundle this large library diff --git a/apps/lockfile-explorer/bin/lockfile-explorer b/apps/lockfile-explorer/bin/lockfile-explorer index 55f974d6de8..9e8ae2e0313 100755 --- a/apps/lockfile-explorer/bin/lockfile-explorer +++ b/apps/lockfile-explorer/bin/lockfile-explorer @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start-explorer.js'); +require('../lib-commonjs/start-explorer.js'); diff --git a/apps/lockfile-explorer/bin/lockfile-lint b/apps/lockfile-explorer/bin/lockfile-lint index 44c9dbf8bdd..5f1750744d7 100644 --- a/apps/lockfile-explorer/bin/lockfile-lint +++ b/apps/lockfile-explorer/bin/lockfile-lint @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start-lint.js'); +require('../lib-commonjs/start-lint.js'); diff --git a/apps/lockfile-explorer/config/heft.json b/apps/lockfile-explorer/config/heft.json index ca7a8305599..d2f77885dc3 100644 --- a/apps/lockfile-explorer/config/heft.json +++ b/apps/lockfile-explorer/config/heft.json @@ -45,7 +45,7 @@ "options": { "copyOperations": [ { - "sourcePath": "node_modules/@rushstack/lockfile-explorer-web/lib/packlets/lfx-shared", + "sourcePath": "node_modules/@rushstack/lockfile-explorer-web/lib-dts/packlets/lfx-shared", "destinationFolders": ["build/lfx-shared"], "includeGlobs": ["*.d.ts"] }, diff --git a/apps/lockfile-explorer/package.json b/apps/lockfile-explorer/package.json index c869e61ea28..0965d08d176 100644 --- a/apps/lockfile-explorer/package.json +++ b/apps/lockfile-explorer/package.json @@ -33,7 +33,7 @@ "scripts": { "build": "heft build --clean", "start": "heft start", - "serve": "node ./lib/start-explorer.js --debug", + "serve": "node ./lib-commonjs/start-explorer.js --debug", "test": "heft test", "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean" @@ -73,5 +73,27 @@ "open": "~8.4.0", "semver": "~7.5.4", "update-notifier": "~5.1.0" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start-explorer.js", + "lib-commonjs/start-lint.js", + "lib-esm/start-explorer.js", + "lib-esm/start-lint.js" + ] } diff --git a/apps/lockfile-explorer/src/graph/test/PnpmfileRunner.test.ts b/apps/lockfile-explorer/src/graph/test/PnpmfileRunner.test.ts index 4e87d88cc0a..b56becb6208 100644 --- a/apps/lockfile-explorer/src/graph/test/PnpmfileRunner.test.ts +++ b/apps/lockfile-explorer/src/graph/test/PnpmfileRunner.test.ts @@ -14,12 +14,12 @@ jest.setTimeout(isDebuggerAttached ? 1e9 : 10000); describe(PnpmfileRunner.name, () => { it('transforms a package.json file', async () => { const dirname: string = Path.convertToSlashes(__dirname); - const libIndex: number = dirname.lastIndexOf('/lib/'); + const libIndex: number = dirname.lastIndexOf('/lib-commonjs/'); if (libIndex < 0) { throw new Error('Unexpected file path'); } const srcDirname: string = - dirname.substring(0, libIndex) + '/src/' + dirname.substring(libIndex + '/lib/'.length); + dirname.substring(0, libIndex) + '/src/' + dirname.substring(libIndex + '/lib-commonjs/'.length); const pnpmfilePath: string = srcDirname + '/fixtures/PnpmfileRunner/.pnpmfile.cjs'; const logMessages: string[] = []; diff --git a/apps/lockfile-explorer/src/test/help.test.ts b/apps/lockfile-explorer/src/test/help.test.ts index bbfd935f88b..3e4f52a0416 100644 --- a/apps/lockfile-explorer/src/test/help.test.ts +++ b/apps/lockfile-explorer/src/test/help.test.ts @@ -5,22 +5,22 @@ import { execSync } from 'node:child_process'; describe('CLI Tool Tests', () => { it('should display help for "lockfile-explorer --help"', () => { - const startOutput = execSync('node lib/start-explorer.js --help').toString(); + const startOutput = execSync('node lib-commonjs/start-explorer.js --help').toString(); expect(startOutput).toMatchSnapshot(); }); it('should display help for "lockfile-lint --help"', () => { - const lintOutput = execSync('node lib/start-lint.js --help').toString(); + const lintOutput = execSync('node lib-commonjs/start-lint.js --help').toString(); expect(lintOutput).toMatchSnapshot(); }); it('should display help for "lockfile-lint init --help"', () => { - const lintOutput = execSync('node lib/start-lint.js init --help').toString(); + const lintOutput = execSync('node lib-commonjs/start-lint.js init --help').toString(); expect(lintOutput).toMatchSnapshot(); }); it('should display help for "lockfile-lint check --help"', () => { - const lintOutput = execSync('node lib/start-lint.js check --help').toString(); + const lintOutput = execSync('node lib-commonjs/start-lint.js check --help').toString(); expect(lintOutput).toMatchSnapshot(); }); }); diff --git a/apps/playwright-browser-tunnel/config/api-extractor.json b/apps/playwright-browser-tunnel/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/apps/playwright-browser-tunnel/config/api-extractor.json +++ b/apps/playwright-browser-tunnel/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/apps/playwright-browser-tunnel/package.json b/apps/playwright-browser-tunnel/package.json index 62ddc1ddd36..c26f1c46f32 100644 --- a/apps/playwright-browser-tunnel/package.json +++ b/apps/playwright-browser-tunnel/package.json @@ -8,7 +8,29 @@ "url": "https://github.com/microsoft/rushstack.git", "directory": "apps/playwright-browser-tunnel" }, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "engines": { "node": ">=20.0.0" }, @@ -40,5 +62,6 @@ }, "peerDependencies": { "playwright-core": "~1.56.1" - } + }, + "sideEffects": false } diff --git a/apps/rundown/bin/rundown b/apps/rundown/bin/rundown index aee68e80224..eef2fc27066 100644 --- a/apps/rundown/bin/rundown +++ b/apps/rundown/bin/rundown @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/rundown/package.json b/apps/rundown/package.json index 40fded03438..d980190d382 100644 --- a/apps/rundown/package.json +++ b/apps/rundown/package.json @@ -29,5 +29,24 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/rush-mcp-server/bin/mcp-server b/apps/rush-mcp-server/bin/mcp-server index aee68e80224..eef2fc27066 100755 --- a/apps/rush-mcp-server/bin/mcp-server +++ b/apps/rush-mcp-server/bin/mcp-server @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/rush-mcp-server/config/api-extractor.json b/apps/rush-mcp-server/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/apps/rush-mcp-server/config/api-extractor.json +++ b/apps/rush-mcp-server/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/apps/rush-mcp-server/package.json b/apps/rush-mcp-server/package.json index 4ac7e2f125b..954c6eaa3bb 100644 --- a/apps/rush-mcp-server/package.json +++ b/apps/rush-mcp-server/package.json @@ -9,8 +9,30 @@ "monorepo", "server" ], - "main": "lib/index.js", - "typings": "dist/mcp-server.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/mcp-server.d.ts", + "exports": { + ".": { + "types": "./dist/mcp-server.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "repository": { "type": "git", "url": "https://github.com/microsoft/rushstack.git", @@ -43,5 +65,9 @@ "local-node-rig": "workspace:*", "typescript": "~5.8.2", "@types/node": "20.17.19" - } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/rush/.npmignore b/apps/rush/.npmignore index 0a36afe312c..ae494d9c693 100644 --- a/apps/rush/.npmignore +++ b/apps/rush/.npmignore @@ -30,6 +30,6 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- -/lib/start-dev.* -/lib/start-dev-docs.* +/lib-*/start-dev.* +/lib-*/start-dev-docs.* diff --git a/apps/rush/bin/rush b/apps/rush/bin/rush index aee68e80224..eef2fc27066 100755 --- a/apps/rush/bin/rush +++ b/apps/rush/bin/rush @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/rush/bin/rush-pnpm b/apps/rush/bin/rush-pnpm index aee68e80224..eef2fc27066 100755 --- a/apps/rush/bin/rush-pnpm +++ b/apps/rush/bin/rush-pnpm @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/rush/bin/rushx b/apps/rush/bin/rushx index aee68e80224..eef2fc27066 100755 --- a/apps/rush/bin/rushx +++ b/apps/rush/bin/rushx @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/rush/package.json b/apps/rush/package.json index e2320022745..e3189f62472 100644 --- a/apps/rush/package.json +++ b/apps/rush/package.json @@ -50,5 +50,24 @@ "@rushstack/rush-http-build-cache-plugin": "workspace:*", "@types/heft-jest": "1.0.1", "@types/semver": "7.5.0" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/rush/src/RushCommandSelector.ts b/apps/rush/src/RushCommandSelector.ts index 148d07e6d1e..3b30557bd97 100644 --- a/apps/rush/src/RushCommandSelector.ts +++ b/apps/rush/src/RushCommandSelector.ts @@ -3,7 +3,7 @@ import * as path from 'node:path'; -import type * as rushLib from '@microsoft/rush-lib'; +import type { ILaunchOptions } from '@microsoft/rush-lib/lib/index'; import { Colorize } from '@rushstack/terminal'; type CommandName = 'rush' | 'rush-pnpm' | 'rushx' | undefined; @@ -27,11 +27,10 @@ export class RushCommandSelector { public static execute( launcherVersion: string, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - selectedRushLib: any, - options: rushLib.ILaunchOptions + selectedRushLib: typeof import('@microsoft/rush-lib'), + options: ILaunchOptions ): void { - const Rush: typeof rushLib.Rush = selectedRushLib.Rush; + const { Rush } = selectedRushLib; if (!Rush) { // This should be impossible unless we somehow loaded an unexpected version diff --git a/apps/rush/src/RushVersionSelector.ts b/apps/rush/src/RushVersionSelector.ts index 1fc8a73b9ce..1b87e66e5fd 100644 --- a/apps/rush/src/RushVersionSelector.ts +++ b/apps/rush/src/RushVersionSelector.ts @@ -5,7 +5,7 @@ import * as path from 'node:path'; import * as semver from 'semver'; -import { LockFile } from '@rushstack/node-core-library'; +import { LockFile, Import } from '@rushstack/node-core-library'; import { Utilities } from '@microsoft/rush-lib/lib/utilities/Utilities'; import { _FlagFile, _RushGlobalFolder, type ILaunchOptions } from '@microsoft/rush-lib'; @@ -44,7 +44,7 @@ export class RushVersionSelector { console.log(`Trying to acquire lock for ${resourceName}`); - const lock: LockFile = await LockFile.acquire(expectedRushPath, resourceName); + const lock: LockFile = await LockFile.acquireAsync(expectedRushPath, resourceName); installIsValid = await installMarker.isValidAsync(); if (installIsValid) { console.log('Another process performed the installation.'); @@ -85,10 +85,15 @@ export class RushVersionSelector { RushCommandSelector.failIfNotInvokedAsRush(version); require(path.join(expectedRushPath, 'node_modules', '@microsoft', 'rush', 'lib', 'start')); } else { + // Explicitly resolve the entry point for rush-lib, rather than using a simple require, because + // newer versions of rush-lib use the package.json `exports` field, which maps + // `lib/index` to `lib-commonjs/index.js` + const rushLibEntrypoint: string = await Import.resolveModuleAsync({ + modulePath: '@microsoft/rush-lib/lib/index', + baseFolderPath: expectedRushPath + }); + const rushCliEntrypoint: typeof import('@microsoft/rush-lib') = require(rushLibEntrypoint); // For newer rush-lib, RushCommandSelector can test whether "rushx" is supported or not - const rushCliEntrypoint: {} = require( - path.join(expectedRushPath, 'node_modules', '@microsoft', 'rush-lib', 'lib', 'index') - ); RushCommandSelector.execute(this._currentPackageVersion, rushCliEntrypoint, executeOptions); } } diff --git a/apps/rush/src/start-dev.ts b/apps/rush/src/start-dev.ts index 1660da8628d..927fae7670f 100644 --- a/apps/rush/src/start-dev.ts +++ b/apps/rush/src/start-dev.ts @@ -4,7 +4,7 @@ // This file is used during development to load the built-in plugins and to bypass // some other checks -import * as rushLib from '@microsoft/rush-lib/lib/index'; +import * as rushLib from '@microsoft/rush-lib'; import { PackageJsonLookup, Import } from '@rushstack/node-core-library'; import { RushCommandSelector } from './RushCommandSelector'; diff --git a/apps/rush/src/start.ts b/apps/rush/src/start.ts index 14c0dbad96c..bf8d5927230 100644 --- a/apps/rush/src/start.ts +++ b/apps/rush/src/start.ts @@ -26,6 +26,7 @@ import * as semver from 'semver'; import { Text, PackageJsonLookup } from '@rushstack/node-core-library'; import { Colorize, ConsoleTerminalProvider, type ITerminalProvider } from '@rushstack/terminal'; import { EnvironmentVariableNames } from '@microsoft/rush-lib'; +import type { ILaunchOptions } from '@microsoft/rush-lib'; import * as rushLib from '@microsoft/rush-lib'; import { RushCommandSelector } from './RushCommandSelector'; @@ -87,7 +88,7 @@ const isManaged: boolean = !!configuration; const terminalProvider: ITerminalProvider = new ConsoleTerminalProvider(); -const launchOptions: rushLib.ILaunchOptions = { isManaged, alreadyReportedNodeTooNewError, terminalProvider }; +const launchOptions: ILaunchOptions = { isManaged, alreadyReportedNodeTooNewError, terminalProvider }; // If we're inside a repo folder, and it's requesting a different version, then use the RushVersionManager to // install it diff --git a/apps/trace-import/bin/trace-import b/apps/trace-import/bin/trace-import index aee68e80224..eef2fc27066 100644 --- a/apps/trace-import/bin/trace-import +++ b/apps/trace-import/bin/trace-import @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/trace-import/package.json b/apps/trace-import/package.json index 07c9c81f783..3a20b20c9cd 100644 --- a/apps/trace-import/package.json +++ b/apps/trace-import/package.json @@ -31,5 +31,24 @@ "@types/semver": "7.5.0", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/zipsync/bin/zipsync b/apps/zipsync/bin/zipsync index aee68e80224..eef2fc27066 100755 --- a/apps/zipsync/bin/zipsync +++ b/apps/zipsync/bin/zipsync @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/apps/zipsync/package.json b/apps/zipsync/package.json index 7a10e996b3a..54d1211586a 100644 --- a/apps/zipsync/package.json +++ b/apps/zipsync/package.json @@ -27,5 +27,32 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/apps/zipsync/src/cli/test/start.test.ts b/apps/zipsync/src/cli/test/start.test.ts index f57f26a3ce6..d9d9a090844 100644 --- a/apps/zipsync/src/cli/test/start.test.ts +++ b/apps/zipsync/src/cli/test/start.test.ts @@ -7,7 +7,10 @@ import { execSync } from 'node:child_process'; describe('CLI Tool Tests', () => { it('should display help for "zipsync --help"', () => { const packageFolder: string = path.resolve(__dirname, '../../..'); - const startOutput = execSync('node lib/start.js --help', { encoding: 'utf-8', cwd: packageFolder }); + const startOutput = execSync('node lib-commonjs/start.js --help', { + encoding: 'utf-8', + cwd: packageFolder + }); const normalized = startOutput.replace( /zipsync \d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)? - https:\/\/rushstack\.io/, 'zipsync {version} - https://rushstack.io' diff --git a/build-tests-samples/heft-node-basic-tutorial/config/jest.config.json b/build-tests-samples/heft-node-basic-tutorial/config/jest.config.json index 8ae16adcbda..1a044a08397 100644 --- a/build-tests-samples/heft-node-basic-tutorial/config/jest.config.json +++ b/build-tests-samples/heft-node-basic-tutorial/config/jest.config.json @@ -1,6 +1,9 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + // These additional properties exist for caching purposes in the rushstack repo // Enable code coverage for Jest diff --git a/build-tests-samples/heft-node-basic-tutorial/config/rush-project.json b/build-tests-samples/heft-node-basic-tutorial/config/rush-project.json index 9042450ba22..21fa5b8e2ea 100644 --- a/build-tests-samples/heft-node-basic-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-node-basic-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-commonjs", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-node-basic-tutorial/tsconfig.json b/build-tests-samples/heft-node-basic-tutorial/tsconfig.json index 36f4f4267dc..f00b374c300 100644 --- a/build-tests-samples/heft-node-basic-tutorial/tsconfig.json +++ b/build-tests-samples/heft-node-basic-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -24,6 +24,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-node-jest-tutorial/config/jest.config.json b/build-tests-samples/heft-node-jest-tutorial/config/jest.config.json index 09a743c117f..888a4ea4f6d 100644 --- a/build-tests-samples/heft-node-jest-tutorial/config/jest.config.json +++ b/build-tests-samples/heft-node-jest-tutorial/config/jest.config.json @@ -1,6 +1,9 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + "coverageThreshold": { "global": { "branches": 50, diff --git a/build-tests-samples/heft-node-jest-tutorial/config/rush-project.json b/build-tests-samples/heft-node-jest-tutorial/config/rush-project.json index 9042450ba22..21fa5b8e2ea 100644 --- a/build-tests-samples/heft-node-jest-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-node-jest-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-commonjs", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-node-jest-tutorial/tsconfig.json b/build-tests-samples/heft-node-jest-tutorial/tsconfig.json index 36f4f4267dc..f00b374c300 100644 --- a/build-tests-samples/heft-node-jest-tutorial/tsconfig.json +++ b/build-tests-samples/heft-node-jest-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -24,6 +24,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-serverless-stack-tutorial/config/jest.config.json b/build-tests-samples/heft-serverless-stack-tutorial/config/jest.config.json index 8ae16adcbda..bfc5ce0d9b7 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/config/jest.config.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/config/jest.config.json @@ -1,6 +1,19 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json", + "roots": ["/lib-commonjs"], + + "testMatch": ["/lib-commonjs/**/*.test.js"], + "collectCoverageFrom": [ + "lib-commonjs/**/*.js", + "!lib-commonjs/**/*.d.ts", + "!lib-commonjs/**/*.test.js", + "!lib-commonjs/**/test/**", + "!lib-commonjs/**/__tests__/**", + "!lib-commonjs/**/__fixtures__/**", + "!lib-commonjs/**/__mocks__/**" + ], + // These additional properties exist for caching purposes in the rushstack repo // Enable code coverage for Jest diff --git a/build-tests-samples/heft-serverless-stack-tutorial/config/rush-project.json b/build-tests-samples/heft-serverless-stack-tutorial/config/rush-project.json index 9042450ba22..21fa5b8e2ea 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-commonjs", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json b/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json index fabb41a31d0..fb86ba34edf 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -26,6 +26,5 @@ "target": "es2017", "lib": ["es2017", "DOM"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json index bc034dbafd0..5e3ab523a1f 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json @@ -3,9 +3,29 @@ "version": "0.0.0", "private": true, "description": "Storybook build dependencies for heft-storybook-v6-react-tutorial", - "main": "lib-commonjs/index.js", - "module": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*", + "import": "./lib-esm/*", + "require": "./lib-commonjs/*" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/.storybook/main.js b/build-tests-samples/heft-storybook-v6-react-tutorial/.storybook/main.js index d4d78a64362..14d42461c99 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/.storybook/main.js +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/.storybook/main.js @@ -1,4 +1,4 @@ module.exports = { - stories: ['../lib/**/*.stories.js'], + stories: ['../lib-esm/**/*.stories.js'], addons: ['@storybook/addon-links', '@storybook/addon-essentials'] }; diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/.vscode/launch.json b/build-tests-samples/heft-storybook-v6-react-tutorial/.vscode/launch.json index 32591233b77..90018262003 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/.vscode/launch.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/.vscode/launch.json @@ -8,7 +8,7 @@ "type": "node", "request": "launch", "name": "Debug \"heft start\"", - "program": "${workspaceFolder}/node_modules/@rushstack/heft/lib/start.js", + "program": "${workspaceFolder}/node_modules/@rushstack/heft/lib-commonjs/start.js", "cwd": "${workspaceFolder}", "args": ["--debug", "start", "--storybook"], "console": "integratedTerminal", diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/config/rush-project.json b/build-tests-samples/heft-storybook-v6-react-tutorial/config/rush-project.json index 9042450ba22..52ba509ef7b 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json b/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json index 4d703032a26..7c377b06b33 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -26,6 +26,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/webpack.config.js b/build-tests-samples/heft-storybook-v6-react-tutorial/webpack.config.js index e509592fe18..f74383cf630 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/webpack.config.js +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/webpack.config.js @@ -29,7 +29,7 @@ function createWebpackConfig({ production }) { ] }, entry: { - app: path.join(__dirname, 'lib', 'index.js'), + app: path.join(__dirname, 'lib-commonjs', 'index.js'), // Put these libraries in a separate vendor bundle vendor: ['react', 'react-dom'] diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json index 02d412fb0db..96491daca59 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json @@ -3,9 +3,29 @@ "version": "0.0.0", "private": true, "description": "Storybook build dependencies for heft-storybook-v9-react-tutorial", - "main": "lib-commonjs/index.js", - "module": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*", + "import": "./lib-esm/*", + "require": "./lib-commonjs/*" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/.storybook/main.js b/build-tests-samples/heft-storybook-v9-react-tutorial/.storybook/main.js index 0969e449d6e..2dd156ba39d 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/.storybook/main.js +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/.storybook/main.js @@ -1,7 +1,7 @@ const { Import } = require('@rushstack/node-core-library'); module.exports = { - stories: ['../lib/**/*.stories.js'], + stories: ['../lib-esm/**/*.stories.js'], framework: Import.resolvePackage({ packageName: '@storybook/react-webpack5', baseFolderPath: __dirname diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/.vscode/launch.json b/build-tests-samples/heft-storybook-v9-react-tutorial/.vscode/launch.json index 32591233b77..90018262003 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/.vscode/launch.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/.vscode/launch.json @@ -8,7 +8,7 @@ "type": "node", "request": "launch", "name": "Debug \"heft start\"", - "program": "${workspaceFolder}/node_modules/@rushstack/heft/lib/start.js", + "program": "${workspaceFolder}/node_modules/@rushstack/heft/lib-commonjs/start.js", "cwd": "${workspaceFolder}", "args": ["--debug", "start", "--storybook"], "console": "integratedTerminal", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/config/rush-project.json b/build-tests-samples/heft-storybook-v9-react-tutorial/config/rush-project.json index 9042450ba22..52ba509ef7b 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json b/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json index d9da69ce34c..f5e1932b4fe 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -27,6 +27,5 @@ "lib": ["es2020", "scripthost", "dom"], "skipLibCheck": true }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/webpack.config.js b/build-tests-samples/heft-storybook-v9-react-tutorial/webpack.config.js index 8787574a0bd..5c2abec2f3b 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/webpack.config.js +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/webpack.config.js @@ -30,7 +30,7 @@ function createWebpackConfig({ production }) { ] }, entry: { - app: path.join(__dirname, 'lib', 'index.js'), + app: path.join(__dirname, 'lib-commonjs', 'index.js'), // Put these libraries in a separate vendor bundle vendor: ['react', 'react-dom'] diff --git a/build-tests-samples/heft-webpack-basic-tutorial/config/rush-project.json b/build-tests-samples/heft-webpack-basic-tutorial/config/rush-project.json index 9042450ba22..52ba509ef7b 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/config/rush-project.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json index 4d703032a26..7c377b06b33 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -26,6 +26,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-samples/heft-webpack-basic-tutorial/webpack.config.js b/build-tests-samples/heft-webpack-basic-tutorial/webpack.config.js index 683afc0cc96..8df73cadf1a 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/webpack.config.js +++ b/build-tests-samples/heft-webpack-basic-tutorial/webpack.config.js @@ -28,7 +28,7 @@ function createWebpackConfig({ production }) { ] }, entry: { - app: path.join(__dirname, 'lib', 'index.js'), + app: path.join(__dirname, 'lib-esm', 'index.js'), // Put these libraries in a separate vendor bundle vendor: ['react', 'react-dom'] diff --git a/build-tests-samples/packlets-tutorial/config/rush-project.json b/build-tests-samples/packlets-tutorial/config/rush-project.json index 6183592308d..ad4743f873c 100644 --- a/build-tests-samples/packlets-tutorial/config/rush-project.json +++ b/build-tests-samples/packlets-tutorial/config/rush-project.json @@ -5,7 +5,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib", "dist"] + "outputFolderNames": [".heft", "lib-commonjs", "dist"] } ] } diff --git a/build-tests-samples/packlets-tutorial/tsconfig.json b/build-tests-samples/packlets-tutorial/tsconfig.json index 3a994cbd1c2..8968fb092bd 100644 --- a/build-tests-samples/packlets-tutorial/tsconfig.json +++ b/build-tests-samples/packlets-tutorial/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -24,6 +24,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests-subspace/rush-lib-test/package.json b/build-tests-subspace/rush-lib-test/package.json index b622838bef8..13104c9f069 100644 --- a/build-tests-subspace/rush-lib-test/package.json +++ b/build-tests-subspace/rush-lib-test/package.json @@ -32,5 +32,20 @@ "local-node-rig": { "injected": true } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests-subspace/rush-lib-test/src/start.ts b/build-tests-subspace/rush-lib-test/src/start.ts index 086a84b52d0..a389623e6e4 100644 --- a/build-tests-subspace/rush-lib-test/src/start.ts +++ b/build-tests-subspace/rush-lib-test/src/start.ts @@ -8,7 +8,7 @@ console.log('rush-lib-test loading Rush configuration...'); // Important: Since we're calling an internal API, we need to use the unbundled .d.ts files // instead of the normal .d.ts rollup // eslint-disable-next-line import/order -import { RushConfiguration } from '@microsoft/rush-lib/lib/'; +import { RushConfiguration } from '@microsoft/rush-lib/lib/index'; const config: RushConfiguration = RushConfiguration.loadFromDefaultLocation(); console.log(config.commonFolder); diff --git a/build-tests-subspace/rush-lib-test/tsconfig.json b/build-tests-subspace/rush-lib-test/tsconfig.json index a79b7380192..c053aa1cd89 100644 --- a/build-tests-subspace/rush-lib-test/tsconfig.json +++ b/build-tests-subspace/rush-lib-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "module": "commonjs", diff --git a/build-tests-subspace/rush-sdk-test/config/heft.json b/build-tests-subspace/rush-sdk-test/config/heft.json index f72878eb953..9160e07413f 100644 --- a/build-tests-subspace/rush-sdk-test/config/heft.json +++ b/build-tests-subspace/rush-sdk-test/config/heft.json @@ -12,7 +12,7 @@ "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib/run-start.js" + "scriptPath": "./lib-commonjs/run-start.js" } } } diff --git a/build-tests-subspace/rush-sdk-test/package.json b/build-tests-subspace/rush-sdk-test/package.json index cbddd0f8b80..1b1197952cc 100644 --- a/build-tests-subspace/rush-sdk-test/package.json +++ b/build-tests-subspace/rush-sdk-test/package.json @@ -32,5 +32,20 @@ "local-node-rig": { "injected": true } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests-subspace/rush-sdk-test/tsconfig.json b/build-tests-subspace/rush-sdk-test/tsconfig.json index a56f7ca4216..7c6800ed98c 100644 --- a/build-tests-subspace/rush-sdk-test/tsconfig.json +++ b/build-tests-subspace/rush-sdk-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "module": "commonjs", diff --git a/build-tests-subspace/typescript-newest-test/package.json b/build-tests-subspace/typescript-newest-test/package.json index bf9ef7a48f3..42455e7ed18 100644 --- a/build-tests-subspace/typescript-newest-test/package.json +++ b/build-tests-subspace/typescript-newest-test/package.json @@ -3,7 +3,29 @@ "description": "Building this project tests Heft with the newest supported TypeScript compiler version", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests-subspace/typescript-newest-test/tsconfig.json b/build-tests-subspace/typescript-newest-test/tsconfig.json index d16a11b11ea..8958c41ded6 100644 --- a/build-tests-subspace/typescript-newest-test/tsconfig.json +++ b/build-tests-subspace/typescript-newest-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "module": "commonjs", diff --git a/build-tests-subspace/typescript-v4-test/config/rush-project.json b/build-tests-subspace/typescript-v4-test/config/rush-project.json index 11f81b24412..d8e232986d3 100644 --- a/build-tests-subspace/typescript-v4-test/config/rush-project.json +++ b/build-tests-subspace/typescript-v4-test/config/rush-project.json @@ -2,7 +2,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-commonjs", "dist"] } ] } diff --git a/build-tests-subspace/typescript-v4-test/package.json b/build-tests-subspace/typescript-v4-test/package.json index f4b21f5caf8..0da7a11deb1 100644 --- a/build-tests-subspace/typescript-v4-test/package.json +++ b/build-tests-subspace/typescript-v4-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests Heft with TypeScript v4", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests-subspace/typescript-v4-test/tsconfig.json b/build-tests-subspace/typescript-v4-test/tsconfig.json index d16a11b11ea..b4a2bb819a1 100644 --- a/build-tests-subspace/typescript-v4-test/tsconfig.json +++ b/build-tests-subspace/typescript-v4-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "module": "commonjs", diff --git a/build-tests/api-documenter-scenarios/config/heft.json b/build-tests/api-documenter-scenarios/config/heft.json index 8a028a3304e..6aac1a2c858 100644 --- a/build-tests/api-documenter-scenarios/config/heft.json +++ b/build-tests/api-documenter-scenarios/config/heft.json @@ -12,7 +12,7 @@ "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib/runScenarios.js" + "scriptPath": "./lib-commonjs/runScenarios.js" } } } diff --git a/build-tests/api-documenter-scenarios/package.json b/build-tests/api-documenter-scenarios/package.json index 13a84a38856..413243f376b 100644 --- a/build-tests/api-documenter-scenarios/package.json +++ b/build-tests/api-documenter-scenarios/package.json @@ -3,7 +3,22 @@ "description": "Building this project is a regression test for api-documenter", "version": "1.0.0", "private": true, - "typings": "dist/internal/some-fake-file.d.ts", + "types": "./dist/internal/some-fake-file.d.ts", + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft build --clean" diff --git a/build-tests/api-documenter-scenarios/src/runScenarios.ts b/build-tests/api-documenter-scenarios/src/runScenarios.ts index ee0e89b8479..6dc753d8862 100644 --- a/build-tests/api-documenter-scenarios/src/runScenarios.ts +++ b/build-tests/api-documenter-scenarios/src/runScenarios.ts @@ -45,7 +45,7 @@ export async function runAsync(runScriptOptions: IRunScriptOptions): Promise/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "newlineKind": "crlf", diff --git a/build-tests/api-documenter-test/package.json b/build-tests/api-documenter-test/package.json index 934d4ad7302..59890f2be8e 100644 --- a/build-tests/api-documenter-test/package.json +++ b/build-tests/api-documenter-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-documenter", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "test": "heft test", diff --git a/build-tests/api-extractor-d-cts-test/config/api-extractor.json b/build-tests/api-extractor-d-cts-test/config/api-extractor.json index 10c1ae9abdc..570369b31a2 100644 --- a/build-tests/api-extractor-d-cts-test/config/api-extractor.json +++ b/build-tests/api-extractor-d-cts-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.cts", + "mainEntryPointFilePath": "/lib-dts/index.d.cts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-d-cts-test/package.json b/build-tests/api-extractor-d-cts-test/package.json index 079c283f9f6..16b197dd289 100644 --- a/build-tests/api-extractor-d-cts-test/package.json +++ b/build-tests/api-extractor-d-cts-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.cjs", - "types": "dist/api-extractor-d-cts-test.d.cts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-d-cts-test.d.cts", + "exports": { + ".": { + "types": "./dist/api-extractor-d-cts-test.d.cts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-d-mts-test/config/api-extractor.json b/build-tests/api-extractor-d-mts-test/config/api-extractor.json index 0d47ad78c14..c84f19c8801 100644 --- a/build-tests/api-extractor-d-mts-test/config/api-extractor.json +++ b/build-tests/api-extractor-d-mts-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.mts", + "mainEntryPointFilePath": "/lib-dts/index.d.mts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-d-mts-test/package.json b/build-tests/api-extractor-d-mts-test/package.json index 519d68ec8d3..9adb070d919 100644 --- a/build-tests/api-extractor-d-mts-test/package.json +++ b/build-tests/api-extractor-d-mts-test/package.json @@ -3,9 +3,23 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "module": "lib/index.mjs", "type": "module", - "types": "dist/api-extractor-d-mts-test.d.mts", + "types": "./dist/api-extractor-d-mts-test.d.mts", + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-lib1-test/config/api-extractor.json b/build-tests/api-extractor-lib1-test/config/api-extractor.json index 5b20206dabc..6f78a23add0 100644 --- a/build-tests/api-extractor-lib1-test/config/api-extractor.json +++ b/build-tests/api-extractor-lib1-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/build-tests/api-extractor-lib1-test/config/rush-project.json b/build-tests/api-extractor-lib1-test/config/rush-project.json index fd37eb27059..b4536921de9 100644 --- a/build-tests/api-extractor-lib1-test/config/rush-project.json +++ b/build-tests/api-extractor-lib1-test/config/rush-project.json @@ -5,7 +5,7 @@ { "operationName": "_phase:build", // dist is intentionally tracked - "outputFolderNames": ["lib"] + "outputFolderNames": ["lib-commonjs"] } ] } diff --git a/build-tests/api-extractor-lib1-test/package.json b/build-tests/api-extractor-lib1-test/package.json index 365b5a88296..058fda700bf 100644 --- a/build-tests/api-extractor-lib1-test/package.json +++ b/build-tests/api-extractor-lib1-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-lib1-test.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-lib1-test.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-lib1-test.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-lib1-test/tsconfig.json b/build-tests/api-extractor-lib1-test/tsconfig.json index d080f1b1613..b7e4568513a 100644 --- a/build-tests/api-extractor-lib1-test/tsconfig.json +++ b/build-tests/api-extractor-lib1-test/tsconfig.json @@ -9,7 +9,8 @@ "experimentalDecorators": true, "strictNullChecks": true, "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable"], - "outDir": "lib" + "outDir": "lib-commonjs", + "declarationDir": "lib-dts" }, "include": ["src/**/*.ts"] } diff --git a/build-tests/api-extractor-lib2-test/config/api-extractor.json b/build-tests/api-extractor-lib2-test/config/api-extractor.json index ee4ca44dae3..ccf32660858 100644 --- a/build-tests/api-extractor-lib2-test/config/api-extractor.json +++ b/build-tests/api-extractor-lib2-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/build-tests/api-extractor-lib2-test/package.json b/build-tests/api-extractor-lib2-test/package.json index 37b754bcdc4..1f7dda6b570 100644 --- a/build-tests/api-extractor-lib2-test/package.json +++ b/build-tests/api-extractor-lib2-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-lib2-test.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-lib2-test.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-lib2-test.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-lib3-test/config/api-extractor.json b/build-tests/api-extractor-lib3-test/config/api-extractor.json index 25114fb98e4..4507f009769 100644 --- a/build-tests/api-extractor-lib3-test/config/api-extractor.json +++ b/build-tests/api-extractor-lib3-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/build-tests/api-extractor-lib3-test/package.json b/build-tests/api-extractor-lib3-test/package.json index cbe9648a084..7bc339f0987 100644 --- a/build-tests/api-extractor-lib3-test/package.json +++ b/build-tests/api-extractor-lib3-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-lib3-test.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-lib3-test.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-lib3-test.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-lib4-test/config/api-extractor.json b/build-tests/api-extractor-lib4-test/config/api-extractor.json index 609b62dc032..6509703367b 100644 --- a/build-tests/api-extractor-lib4-test/config/api-extractor.json +++ b/build-tests/api-extractor-lib4-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-lib4-test/package.json b/build-tests/api-extractor-lib4-test/package.json index 7be152c199d..a55fa300d98 100644 --- a/build-tests/api-extractor-lib4-test/package.json +++ b/build-tests/api-extractor-lib4-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-lib3-test.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-lib3-test.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-lib3-test.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-lib5-test/config/api-extractor.json b/build-tests/api-extractor-lib5-test/config/api-extractor.json index 609b62dc032..6509703367b 100644 --- a/build-tests/api-extractor-lib5-test/config/api-extractor.json +++ b/build-tests/api-extractor-lib5-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-lib5-test/package.json b/build-tests/api-extractor-lib5-test/package.json index f6ae8df3aad..bf97ee6e501 100644 --- a/build-tests/api-extractor-lib5-test/package.json +++ b/build-tests/api-extractor-lib5-test/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-lib3-test.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-lib3-test.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-lib3-test.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-scenarios/config/heft.json b/build-tests/api-extractor-scenarios/config/heft.json index ed5856420ce..df9febe88cb 100644 --- a/build-tests/api-extractor-scenarios/config/heft.json +++ b/build-tests/api-extractor-scenarios/config/heft.json @@ -26,7 +26,7 @@ "copyOperations": [ { "sourcePath": "src", - "destinationFolders": ["lib"], + "destinationFolders": ["lib-dts"], "fileExtensions": [".d.ts"] } ] @@ -40,7 +40,7 @@ "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib/runScenarios.js" + "scriptPath": "./lib-commonjs/runScenarios.js" } } } diff --git a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json index 89ee7044200..752716990bc 100644 --- a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json @@ -304,7 +304,7 @@ "text": " " } ], - "fileUrlPath": "../api-extractor-lib1-test/lib/index.d.ts", + "fileUrlPath": "../api-extractor-lib1-test/lib-dts/index.d.ts", "releaseTag": "Public", "isAbstract": false, "name": "Lib1Class", diff --git a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json index 7a086bfd599..8a3cdb3b666 100644 --- a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json @@ -202,7 +202,7 @@ "text": "number" } ], - "fileUrlPath": "lib/excerptTokens/index.d.ts", + "fileUrlPath": "lib-dts/excerptTokens/index.d.ts", "isReadonly": false, "releaseTag": "Public", "name": "MY_CONSTANT", @@ -221,7 +221,7 @@ "text": "export class MyClass " } ], - "fileUrlPath": "lib/excerptTokens/index.d.ts", + "fileUrlPath": "lib-dts/excerptTokens/index.d.ts", "releaseTag": "Public", "isAbstract": false, "name": "MyClass", diff --git a/build-tests/api-extractor-scenarios/package.json b/build-tests/api-extractor-scenarios/package.json index 226b4e52408..a0cd1de6461 100644 --- a/build-tests/api-extractor-scenarios/package.json +++ b/build-tests/api-extractor-scenarios/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/internal/some-fake-file.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/internal/some-fake-file.d.ts", + "exports": { + ".": { + "types": "./dist/internal/some-fake-file.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft build --clean" diff --git a/build-tests/api-extractor-test-01/config/api-extractor.json b/build-tests/api-extractor-test-01/config/api-extractor.json index e4725c5edc7..7b0adce7331 100644 --- a/build-tests/api-extractor-test-01/config/api-extractor.json +++ b/build-tests/api-extractor-test-01/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-test-01/package.json b/build-tests/api-extractor-test-01/package.json index 8e165a159ae..ab06a74944d 100644 --- a/build-tests/api-extractor-test-01/package.json +++ b/build-tests/api-extractor-test-01/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-test-01.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-test-01.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-test-01.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-test-02/config/api-extractor.json b/build-tests/api-extractor-test-02/config/api-extractor.json index e4725c5edc7..7b0adce7331 100644 --- a/build-tests/api-extractor-test-02/config/api-extractor.json +++ b/build-tests/api-extractor-test-02/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-test-02/package.json b/build-tests/api-extractor-test-02/package.json index 5b606031094..79f1f3683ae 100644 --- a/build-tests/api-extractor-test-02/package.json +++ b/build-tests/api-extractor-test-02/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-test-02.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-test-02.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-test-02.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-test-03/package.json b/build-tests/api-extractor-test-03/package.json index 6583ecd3c83..5d5589b7c1a 100644 --- a/build-tests/api-extractor-test-03/package.json +++ b/build-tests/api-extractor-test-03/package.json @@ -13,5 +13,28 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "local-node-rig": "workspace:*" + }, + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/api-extractor-test-04/beta-consumer/tsconfig.json b/build-tests/api-extractor-test-04/beta-consumer/tsconfig.json index a2f349c815e..7f2efa812b8 100644 --- a/build-tests/api-extractor-test-04/beta-consumer/tsconfig.json +++ b/build-tests/api-extractor-test-04/beta-consumer/tsconfig.json @@ -9,7 +9,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable"], - "outDir": "lib" + "outDir": "lib-commonjs" }, "include": ["src/**/*.ts", "typings/tsd.d.ts"] } diff --git a/build-tests/api-extractor-test-04/config/api-extractor.json b/build-tests/api-extractor-test-04/config/api-extractor.json index e4725c5edc7..7b0adce7331 100644 --- a/build-tests/api-extractor-test-04/config/api-extractor.json +++ b/build-tests/api-extractor-test-04/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-test-04/package.json b/build-tests/api-extractor-test-04/package.json index 958a44833c9..130becfe2db 100644 --- a/build-tests/api-extractor-test-04/package.json +++ b/build-tests/api-extractor-test-04/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-test-04.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-test-04.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-test-04.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/api-extractor-test-05/config/api-extractor.json b/build-tests/api-extractor-test-05/config/api-extractor.json index 770ab0ff8a0..26e66af1b08 100644 --- a/build-tests/api-extractor-test-05/config/api-extractor.json +++ b/build-tests/api-extractor-test-05/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true diff --git a/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json b/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json index c017748cd67..1c07d607ee2 100644 --- a/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json +++ b/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json @@ -5,7 +5,7 @@ "toolPackages": [ { "packageName": "@microsoft/api-extractor", - "packageVersion": "7.55.5" + "packageVersion": "7.56.3" } ] } diff --git a/build-tests/api-extractor-test-05/package.json b/build-tests/api-extractor-test-05/package.json index 4d707186e5f..430eb5728f1 100644 --- a/build-tests/api-extractor-test-05/package.json +++ b/build-tests/api-extractor-test-05/package.json @@ -3,8 +3,29 @@ "description": "Building this project is a regression test for api-extractor", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-test-05.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/api-extractor-test-05.d.ts", + "exports": { + ".": { + "types": "./dist/api-extractor-test-05.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean" diff --git a/build-tests/eslint-7-11-test/package.json b/build-tests/eslint-7-11-test/package.json index b1e1cae39cc..236aaa2169d 100644 --- a/build-tests/eslint-7-11-test/package.json +++ b/build-tests/eslint-7-11-test/package.json @@ -3,7 +3,29 @@ "description": "This project contains a build test to validate ESLint 7.11.0 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/eslint-7-11-test/tsconfig.json b/build-tests/eslint-7-11-test/tsconfig.json index 8a46ac2445e..dac21d04081 100644 --- a/build-tests/eslint-7-11-test/tsconfig.json +++ b/build-tests/eslint-7-11-test/tsconfig.json @@ -1,24 +1,3 @@ { - "$schema": "http://json.schemastore.org/tsconfig", - - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", - - "forceConsistentCasingInFileNames": true, - "declaration": true, - "sourceMap": true, - "declarationMap": true, - "inlineSources": true, - "experimentalDecorators": true, - "strictNullChecks": true, - "noUnusedLocals": true, - - "module": "esnext", - "moduleResolution": "node", - "target": "es5", - "lib": ["es5"] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/build-tests/eslint-7-7-test/package.json b/build-tests/eslint-7-7-test/package.json index 8161d5edf79..33b4a44737c 100644 --- a/build-tests/eslint-7-7-test/package.json +++ b/build-tests/eslint-7-7-test/package.json @@ -3,7 +3,29 @@ "description": "This project contains a build test to validate ESLint 7.7.0 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/eslint-7-7-test/tsconfig.json b/build-tests/eslint-7-7-test/tsconfig.json index 8a46ac2445e..dac21d04081 100644 --- a/build-tests/eslint-7-7-test/tsconfig.json +++ b/build-tests/eslint-7-7-test/tsconfig.json @@ -1,24 +1,3 @@ { - "$schema": "http://json.schemastore.org/tsconfig", - - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", - - "forceConsistentCasingInFileNames": true, - "declaration": true, - "sourceMap": true, - "declarationMap": true, - "inlineSources": true, - "experimentalDecorators": true, - "strictNullChecks": true, - "noUnusedLocals": true, - - "module": "esnext", - "moduleResolution": "node", - "target": "es5", - "lib": ["es5"] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/build-tests/eslint-7-test/package.json b/build-tests/eslint-7-test/package.json index 4c84f0ed5a6..aebf9a26cac 100644 --- a/build-tests/eslint-7-test/package.json +++ b/build-tests/eslint-7-test/package.json @@ -3,7 +3,29 @@ "description": "This project contains a build test to validate ESLint 7 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/eslint-7-test/tsconfig.json b/build-tests/eslint-7-test/tsconfig.json index 8a46ac2445e..dac21d04081 100644 --- a/build-tests/eslint-7-test/tsconfig.json +++ b/build-tests/eslint-7-test/tsconfig.json @@ -1,24 +1,3 @@ { - "$schema": "http://json.schemastore.org/tsconfig", - - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", - - "forceConsistentCasingInFileNames": true, - "declaration": true, - "sourceMap": true, - "declarationMap": true, - "inlineSources": true, - "experimentalDecorators": true, - "strictNullChecks": true, - "noUnusedLocals": true, - - "module": "esnext", - "moduleResolution": "node", - "target": "es5", - "lib": ["es5"] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/build-tests/eslint-8-test/package.json b/build-tests/eslint-8-test/package.json index 650b4e7e595..431233b8090 100644 --- a/build-tests/eslint-8-test/package.json +++ b/build-tests/eslint-8-test/package.json @@ -3,7 +3,29 @@ "description": "This project contains a build test to validate ESLint 8 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/eslint-8-test/tsconfig.json b/build-tests/eslint-8-test/tsconfig.json index 8a46ac2445e..dac21d04081 100644 --- a/build-tests/eslint-8-test/tsconfig.json +++ b/build-tests/eslint-8-test/tsconfig.json @@ -1,24 +1,3 @@ { - "$schema": "http://json.schemastore.org/tsconfig", - - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", - - "forceConsistentCasingInFileNames": true, - "declaration": true, - "sourceMap": true, - "declarationMap": true, - "inlineSources": true, - "experimentalDecorators": true, - "strictNullChecks": true, - "noUnusedLocals": true, - - "module": "esnext", - "moduleResolution": "node", - "target": "es5", - "lib": ["es5"] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/build-tests/eslint-9-test/package.json b/build-tests/eslint-9-test/package.json index 3a6a4b66879..22bca4bed5f 100644 --- a/build-tests/eslint-9-test/package.json +++ b/build-tests/eslint-9-test/package.json @@ -3,7 +3,29 @@ "description": "This project contains a build test to validate ESLint 9 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/eslint-bulk-suppressions-test-flat/build.js b/build-tests/eslint-bulk-suppressions-test-flat/build.js index c1e9cd2dd92..39b6bc1ffa3 100644 --- a/build-tests/eslint-bulk-suppressions-test-flat/build.js +++ b/build-tests/eslint-bulk-suppressions-test-flat/build.js @@ -9,7 +9,7 @@ const { } = require('@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants'); const eslintBulkStartPath = Import.resolveModule({ - modulePath: '@rushstack/eslint-bulk/lib/start', + modulePath: '@rushstack/eslint-bulk/lib-commonjs/start', baseFolderPath: __dirname }); diff --git a/build-tests/eslint-bulk-suppressions-test-flat/config/typescript.json b/build-tests/eslint-bulk-suppressions-test-flat/config/typescript.json new file mode 100644 index 00000000000..77ac46fab28 --- /dev/null +++ b/build-tests/eslint-bulk-suppressions-test-flat/config/typescript.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", + + "additionalModuleKindsToEmit": [] +} diff --git a/build-tests/eslint-bulk-suppressions-test-flat/tsconfig.json b/build-tests/eslint-bulk-suppressions-test-flat/tsconfig.json index 174bda15d5c..cce25e95fc4 100644 --- a/build-tests/eslint-bulk-suppressions-test-flat/tsconfig.json +++ b/build-tests/eslint-bulk-suppressions-test-flat/tsconfig.json @@ -2,8 +2,10 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", - "rootDir": "src", + "outDir": "lib-esm", + "declarationDir": "lib-dts", + "rootDirs": ["client", "server"], + "forceConsistentCasingInFileNames": true, "declaration": true, "sourceMap": true, @@ -18,6 +20,6 @@ "target": "es5", "lib": ["es5"] }, - "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"], - "exclude": ["node_modules", "lib"] + + "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"] } diff --git a/build-tests/eslint-bulk-suppressions-test-legacy/build.js b/build-tests/eslint-bulk-suppressions-test-legacy/build.js index 00f8fba506c..d7137ab7a77 100644 --- a/build-tests/eslint-bulk-suppressions-test-legacy/build.js +++ b/build-tests/eslint-bulk-suppressions-test-legacy/build.js @@ -9,7 +9,7 @@ const { } = require('@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants'); const eslintBulkStartPath = Import.resolveModule({ - modulePath: '@rushstack/eslint-bulk/lib/start', + modulePath: '@rushstack/eslint-bulk/lib-commonjs/start', baseFolderPath: __dirname }); diff --git a/build-tests/eslint-bulk-suppressions-test-legacy/config/typescript.json b/build-tests/eslint-bulk-suppressions-test-legacy/config/typescript.json new file mode 100644 index 00000000000..77ac46fab28 --- /dev/null +++ b/build-tests/eslint-bulk-suppressions-test-legacy/config/typescript.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", + + "additionalModuleKindsToEmit": [] +} diff --git a/build-tests/eslint-bulk-suppressions-test-legacy/tsconfig.json b/build-tests/eslint-bulk-suppressions-test-legacy/tsconfig.json index 174bda15d5c..118ccfd8998 100644 --- a/build-tests/eslint-bulk-suppressions-test-legacy/tsconfig.json +++ b/build-tests/eslint-bulk-suppressions-test-legacy/tsconfig.json @@ -1,9 +1,10 @@ { "$schema": "http://json.schemastore.org/tsconfig", - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", + "outDir": "lib-esm", + "declarationDir": "lib-dts", + "rootDirs": ["client", "server"], + "forceConsistentCasingInFileNames": true, "declaration": true, "sourceMap": true, @@ -18,6 +19,6 @@ "target": "es5", "lib": ["es5"] }, - "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"], - "exclude": ["node_modules", "lib"] + + "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"] } diff --git a/build-tests/eslint-bulk-suppressions-test/build.js b/build-tests/eslint-bulk-suppressions-test/build.js index c1e9cd2dd92..39b6bc1ffa3 100644 --- a/build-tests/eslint-bulk-suppressions-test/build.js +++ b/build-tests/eslint-bulk-suppressions-test/build.js @@ -9,7 +9,7 @@ const { } = require('@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants'); const eslintBulkStartPath = Import.resolveModule({ - modulePath: '@rushstack/eslint-bulk/lib/start', + modulePath: '@rushstack/eslint-bulk/lib-commonjs/start', baseFolderPath: __dirname }); diff --git a/build-tests/eslint-bulk-suppressions-test/config/typescript.json b/build-tests/eslint-bulk-suppressions-test/config/typescript.json new file mode 100644 index 00000000000..77ac46fab28 --- /dev/null +++ b/build-tests/eslint-bulk-suppressions-test/config/typescript.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", + + "additionalModuleKindsToEmit": [] +} diff --git a/build-tests/eslint-bulk-suppressions-test/tsconfig.json b/build-tests/eslint-bulk-suppressions-test/tsconfig.json index 174bda15d5c..cce25e95fc4 100644 --- a/build-tests/eslint-bulk-suppressions-test/tsconfig.json +++ b/build-tests/eslint-bulk-suppressions-test/tsconfig.json @@ -2,8 +2,10 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", - "rootDir": "src", + "outDir": "lib-esm", + "declarationDir": "lib-dts", + "rootDirs": ["client", "server"], + "forceConsistentCasingInFileNames": true, "declaration": true, "sourceMap": true, @@ -18,6 +20,6 @@ "target": "es5", "lib": ["es5"] }, - "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"], - "exclude": ["node_modules", "lib"] + + "include": ["client/**/*.ts", "client/**/*.tsx", "server/**/*.ts", "server/**/*.tsx"] } diff --git a/build-tests/hashed-folder-copy-plugin-webpack5-test/config/rush-project.json b/build-tests/hashed-folder-copy-plugin-webpack5-test/config/rush-project.json index 543278bebd4..0dbbaa83178 100644 --- a/build-tests/hashed-folder-copy-plugin-webpack5-test/config/rush-project.json +++ b/build-tests/hashed-folder-copy-plugin-webpack5-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist-dev", "dist-prod"] + "outputFolderNames": ["lib-esm", "dist-dev", "dist-prod"] } ] } diff --git a/build-tests/hashed-folder-copy-plugin-webpack5-test/tsconfig.json b/build-tests/hashed-folder-copy-plugin-webpack5-test/tsconfig.json index 0c287924501..f75d74a5e8c 100644 --- a/build-tests/hashed-folder-copy-plugin-webpack5-test/tsconfig.json +++ b/build-tests/hashed-folder-copy-plugin-webpack5-test/tsconfig.json @@ -15,7 +15,7 @@ "target": "es5", "types": ["webpack-env", "@rushstack/hashed-folder-copy-plugin/ambientTypes"], - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "rootDirs": ["src", "temp/loc-json-ts"] }, diff --git a/build-tests/hashed-folder-copy-plugin-webpack5-test/webpack.config.js b/build-tests/hashed-folder-copy-plugin-webpack5-test/webpack.config.js index ebce51bfc9b..2fe982efd88 100644 --- a/build-tests/hashed-folder-copy-plugin-webpack5-test/webpack.config.js +++ b/build-tests/hashed-folder-copy-plugin-webpack5-test/webpack.config.js @@ -11,7 +11,7 @@ function generateConfiguration(mode, outputFolderName) { return { mode: mode, entry: { - test: path.join(__dirname, 'lib', 'index.js') + test: path.join(__dirname, 'lib-esm', 'index.js') }, output: { path: path.join(__dirname, outputFolderName), diff --git a/build-tests/heft-example-lifecycle-plugin/config/rush-project.json b/build-tests/heft-example-lifecycle-plugin/config/rush-project.json index 514e557d5eb..a015d9f1f5a 100644 --- a/build-tests/heft-example-lifecycle-plugin/config/rush-project.json +++ b/build-tests/heft-example-lifecycle-plugin/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-commonjs", "dist"] } ] } diff --git a/build-tests/heft-example-lifecycle-plugin/heft-plugin.json b/build-tests/heft-example-lifecycle-plugin/heft-plugin.json index d174b5b769b..7f81eb33b23 100644 --- a/build-tests/heft-example-lifecycle-plugin/heft-plugin.json +++ b/build-tests/heft-example-lifecycle-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "lifecyclePlugins": [ { "pluginName": "example-lifecycle-plugin", - "entryPoint": "./lib/index" + "entryPoint": "./lib-commonjs/index" } ] } diff --git a/build-tests/heft-example-lifecycle-plugin/package.json b/build-tests/heft-example-lifecycle-plugin/package.json index 996b1d27713..06fc79053ae 100644 --- a/build-tests/heft-example-lifecycle-plugin/package.json +++ b/build-tests/heft-example-lifecycle-plugin/package.json @@ -3,8 +3,8 @@ "description": "This is an example heft plugin for testing the lifecycle hooks", "version": "1.0.0", "private": true, - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "types": "./lib-commonjs/index.d.ts", "scripts": { "build": "heft build --clean", "start": "heft build-watch", diff --git a/build-tests/heft-example-lifecycle-plugin/tsconfig.json b/build-tests/heft-example-lifecycle-plugin/tsconfig.json index 2d179c7173f..e2f35108020 100644 --- a/build-tests/heft-example-lifecycle-plugin/tsconfig.json +++ b/build-tests/heft-example-lifecycle-plugin/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-example-plugin-01/config/rush-project.json b/build-tests/heft-example-plugin-01/config/rush-project.json index 514e557d5eb..a015d9f1f5a 100644 --- a/build-tests/heft-example-plugin-01/config/rush-project.json +++ b/build-tests/heft-example-plugin-01/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-commonjs", "dist"] } ] } diff --git a/build-tests/heft-example-plugin-01/heft-plugin.json b/build-tests/heft-example-plugin-01/heft-plugin.json index 09a64ae81ad..41b9b2195a9 100644 --- a/build-tests/heft-example-plugin-01/heft-plugin.json +++ b/build-tests/heft-example-plugin-01/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "example-plugin-01", - "entryPoint": "./lib/index" + "entryPoint": "./lib-commonjs/index" } ] } diff --git a/build-tests/heft-example-plugin-01/package.json b/build-tests/heft-example-plugin-01/package.json index a635fd41233..66e72848852 100644 --- a/build-tests/heft-example-plugin-01/package.json +++ b/build-tests/heft-example-plugin-01/package.json @@ -3,8 +3,8 @@ "description": "This is an example heft plugin that exposes hooks for other plugins", "version": "1.0.0", "private": true, - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "types": "./lib-commonjs/index.d.ts", "scripts": { "build": "heft build --clean", "start": "heft build-watch", diff --git a/build-tests/heft-example-plugin-01/tsconfig.json b/build-tests/heft-example-plugin-01/tsconfig.json index 2d179c7173f..e2f35108020 100644 --- a/build-tests/heft-example-plugin-01/tsconfig.json +++ b/build-tests/heft-example-plugin-01/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-example-plugin-02/config/rush-project.json b/build-tests/heft-example-plugin-02/config/rush-project.json index 514e557d5eb..a015d9f1f5a 100644 --- a/build-tests/heft-example-plugin-02/config/rush-project.json +++ b/build-tests/heft-example-plugin-02/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-commonjs", "dist"] } ] } diff --git a/build-tests/heft-example-plugin-02/heft-plugin.json b/build-tests/heft-example-plugin-02/heft-plugin.json index 28dfc61a402..92a56d2c5e1 100644 --- a/build-tests/heft-example-plugin-02/heft-plugin.json +++ b/build-tests/heft-example-plugin-02/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "example-plugin-02", - "entryPoint": "./lib/index" + "entryPoint": "./lib-commonjs/index" } ] } diff --git a/build-tests/heft-example-plugin-02/package.json b/build-tests/heft-example-plugin-02/package.json index 1d7f1b56bfa..9f8a6da74cc 100644 --- a/build-tests/heft-example-plugin-02/package.json +++ b/build-tests/heft-example-plugin-02/package.json @@ -3,8 +3,8 @@ "description": "This is an example heft plugin that taps the hooks exposed from heft-example-plugin-01", "version": "1.0.0", "private": true, - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "types": "./lib-commonjs/index.d.ts", "scripts": { "build": "heft build --clean", "start": "heft build-watch", diff --git a/build-tests/heft-example-plugin-02/tsconfig.json b/build-tests/heft-example-plugin-02/tsconfig.json index 2d179c7173f..e2f35108020 100644 --- a/build-tests/heft-example-plugin-02/tsconfig.json +++ b/build-tests/heft-example-plugin-02/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-fastify-test/config/rush-project.json b/build-tests/heft-fastify-test/config/rush-project.json index 11f81b24412..d8e232986d3 100644 --- a/build-tests/heft-fastify-test/config/rush-project.json +++ b/build-tests/heft-fastify-test/config/rush-project.json @@ -2,7 +2,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-commonjs", "dist"] } ] } diff --git a/build-tests/heft-fastify-test/package.json b/build-tests/heft-fastify-test/package.json index 3aaac5a4d2b..18d04edda9a 100644 --- a/build-tests/heft-fastify-test/package.json +++ b/build-tests/heft-fastify-test/package.json @@ -3,7 +3,7 @@ "description": "This project tests Heft support for the Fastify framework for Node.js services", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-fastify-test/tsconfig.json b/build-tests/heft-fastify-test/tsconfig.json index 845c0343e3c..b2ec41e1142 100644 --- a/build-tests/heft-fastify-test/tsconfig.json +++ b/build-tests/heft-fastify-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-jest-preset-test/config/jest.config.json b/build-tests/heft-jest-preset-test/config/jest.config.json index f74f91d4645..c333c603e99 100644 --- a/build-tests/heft-jest-preset-test/config/jest.config.json +++ b/build-tests/heft-jest-preset-test/config/jest.config.json @@ -55,9 +55,9 @@ // jest-string-mock-transform returns the filename, where Webpack would return a URL // When using the heft-jest-plugin, these will be replaced with the resolved module location "transform": { - "\\.(css|sass|scss)$": "../node_modules/@rushstack/heft-jest-plugin/lib/exports/jest-identity-mock-transform.js", + "\\.(css|sass|scss)$": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-identity-mock-transform.js", - "\\.(aac|eot|gif|jpeg|jpg|m4a|mp3|mp4|oga|otf|png|svg|ttf|wav|webm|webp|woff|woff2)$": "../node_modules/@rushstack/heft-jest-plugin/lib/exports/jest-string-mock-transform.js" + "\\.(aac|eot|gif|jpeg|jpg|m4a|mp3|mp4|oga|otf|png|svg|ttf|wav|webm|webp|woff|woff2)$": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-string-mock-transform.js" }, // The modulePathIgnorePatterns below accepts these sorts of paths: @@ -70,8 +70,8 @@ "moduleFileExtensions": ["cjs", "js", "json", "node"], // When using the heft-jest-plugin, these will be replaced with the resolved module location - "setupFiles": ["../node_modules/@rushstack/heft-jest-plugin/lib/exports/jest-global-setup.js"], + "setupFiles": ["@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-global-setup.js"], // When using the heft-jest-plugin, these will be replaced with the resolved module location - "resolver": "../node_modules/@rushstack/heft-jest-plugin/lib/exports/jest-improved-resolver.js" + "resolver": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-improved-resolver.js" } diff --git a/build-tests/heft-jest-preset-test/tsconfig.json b/build-tests/heft-jest-preset-test/tsconfig.json index 0ad08cab8f8..2df47fa5863 100644 --- a/build-tests/heft-jest-preset-test/tsconfig.json +++ b/build-tests/heft-jest-preset-test/tsconfig.json @@ -20,6 +20,5 @@ "target": "ES2015", "lib": ["ES2015"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-jest-reporters-test/config/heft.json b/build-tests/heft-jest-reporters-test/config/heft.json index 0394daa977b..304ccc96c03 100644 --- a/build-tests/heft-jest-reporters-test/config/heft.json +++ b/build-tests/heft-jest-reporters-test/config/heft.json @@ -4,7 +4,7 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-commonjs"] }], + "cleanFiles": [{ "includeGlobs": ["dist", "lib"] }], "tasksByName": { "typescript": { diff --git a/build-tests/heft-jest-reporters-test/tsconfig.json b/build-tests/heft-jest-reporters-test/tsconfig.json index ffed841a228..b84c9d89cbc 100644 --- a/build-tests/heft-jest-reporters-test/tsconfig.json +++ b/build-tests/heft-jest-reporters-test/tsconfig.json @@ -20,6 +20,5 @@ "target": "es2020", "lib": ["es2020"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-json-schema-typings-plugin-test/package.json b/build-tests/heft-json-schema-typings-plugin-test/package.json index a7ae645f19c..5b36aa15f14 100644 --- a/build-tests/heft-json-schema-typings-plugin-test/package.json +++ b/build-tests/heft-json-schema-typings-plugin-test/package.json @@ -15,5 +15,20 @@ "@rushstack/node-core-library": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/heft-node-everything-esm-module-test/config/api-extractor.json b/build-tests/heft-node-everything-esm-module-test/config/api-extractor.json index b3969a325c1..890e2190b40 100644 --- a/build-tests/heft-node-everything-esm-module-test/config/api-extractor.json +++ b/build-tests/heft-node-everything-esm-module-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "/etc" diff --git a/build-tests/heft-node-everything-esm-module-test/config/heft.json b/build-tests/heft-node-everything-esm-module-test/config/heft.json index a82a1fd0bb9..bfb4f25a904 100644 --- a/build-tests/heft-node-everything-esm-module-test/config/heft.json +++ b/build-tests/heft-node-everything-esm-module-test/config/heft.json @@ -6,7 +6,7 @@ "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-esnext", "lib-umd"] }], + "cleanFiles": [{ "includeGlobs": ["dist", "lib-commonjs", "lib", "lib-esm", "lib-esnext", "lib-umd"] }], "tasksByName": { "typescript": { diff --git a/build-tests/heft-node-everything-esm-module-test/config/rush-project.json b/build-tests/heft-node-everything-esm-module-test/config/rush-project.json index a93c6b2720f..95af43b193f 100644 --- a/build-tests/heft-node-everything-esm-module-test/config/rush-project.json +++ b/build-tests/heft-node-everything-esm-module-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"] + "outputFolderNames": ["dist", "lib-commonjs", "lib-esm", "lib-umd"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-node-everything-esm-module-test/config/typescript.json b/build-tests/heft-node-everything-esm-module-test/config/typescript.json index 7295774598d..d7616572a6c 100644 --- a/build-tests/heft-node-everything-esm-module-test/config/typescript.json +++ b/build-tests/heft-node-everything-esm-module-test/config/typescript.json @@ -11,7 +11,7 @@ "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-esm" }, { "moduleKind": "umd", diff --git a/build-tests/heft-node-everything-esm-module-test/package.json b/build-tests/heft-node-everything-esm-module-test/package.json index 7511a0b5745..0f4196f00ab 100644 --- a/build-tests/heft-node-everything-esm-module-test/package.json +++ b/build-tests/heft-node-everything-esm-module-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests every task and config file for Heft when targeting the Node.js runtime when configured to use ESM module support", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "type": "module", "license": "MIT", "scripts": { diff --git a/build-tests/heft-node-everything-esm-module-test/tsconfig.json b/build-tests/heft-node-everything-esm-module-test/tsconfig.json index 845c0343e3c..d08637a6a20 100644 --- a/build-tests/heft-node-everything-esm-module-test/tsconfig.json +++ b/build-tests/heft-node-everything-esm-module-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +21,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-node-everything-test/config/api-extractor.json b/build-tests/heft-node-everything-test/config/api-extractor.json index e451cf705d0..d12edb988a5 100644 --- a/build-tests/heft-node-everything-test/config/api-extractor.json +++ b/build-tests/heft-node-everything-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "/etc" diff --git a/build-tests/heft-node-everything-test/config/heft.json b/build-tests/heft-node-everything-test/config/heft.json index 08d9c72b92e..717d3c6576c 100644 --- a/build-tests/heft-node-everything-test/config/heft.json +++ b/build-tests/heft-node-everything-test/config/heft.json @@ -13,7 +13,7 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-esnext", "lib-umd"] }], + "cleanFiles": [{ "includeGlobs": ["dist", "lib-commonjs", "lib", "lib-esm", "lib-esnext", "lib-umd"] }], "tasksByName": { "typescript": { @@ -39,7 +39,7 @@ "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib/test-metadata.js" + "scriptPath": "./lib-commonjs/test-metadata.js" } } } diff --git a/build-tests/heft-node-everything-test/config/rush-project.json b/build-tests/heft-node-everything-test/config/rush-project.json index a93c6b2720f..95af43b193f 100644 --- a/build-tests/heft-node-everything-test/config/rush-project.json +++ b/build-tests/heft-node-everything-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"] + "outputFolderNames": ["dist", "lib-commonjs", "lib-esm", "lib-umd"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-node-everything-test/config/typescript.json b/build-tests/heft-node-everything-test/config/typescript.json index 7295774598d..d7616572a6c 100644 --- a/build-tests/heft-node-everything-test/config/typescript.json +++ b/build-tests/heft-node-everything-test/config/typescript.json @@ -11,7 +11,7 @@ "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-esm" }, { "moduleKind": "umd", diff --git a/build-tests/heft-node-everything-test/package.json b/build-tests/heft-node-everything-test/package.json index 7b2fa422c04..bd60e9a4a55 100644 --- a/build-tests/heft-node-everything-test/package.json +++ b/build-tests/heft-node-everything-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests every task and config file for Heft when targeting the Node.js runtime", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-node-everything-test/tsconfig.json b/build-tests/heft-node-everything-test/tsconfig.json index 845c0343e3c..d08637a6a20 100644 --- a/build-tests/heft-node-everything-test/tsconfig.json +++ b/build-tests/heft-node-everything-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +21,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-parameter-plugin-test/config/jest.config.json b/build-tests/heft-parameter-plugin-test/config/jest.config.json index c0687c6d488..8ece84202f7 100644 --- a/build-tests/heft-parameter-plugin-test/config/jest.config.json +++ b/build-tests/heft-parameter-plugin-test/config/jest.config.json @@ -1,6 +1,19 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json", + "roots": ["/lib-commonjs"], + + "testMatch": ["/lib-commonjs/**/*.test.js"], + "collectCoverageFrom": [ + "lib-commonjs/**/*.js", + "!lib-commonjs/**/*.d.ts", + "!lib-commonjs/**/*.test.js", + "!lib-commonjs/**/test/**", + "!lib-commonjs/**/__tests__/**", + "!lib-commonjs/**/__fixtures__/**", + "!lib-commonjs/**/__mocks__/**" + ], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", diff --git a/build-tests/heft-parameter-plugin-test/config/rush-project.json b/build-tests/heft-parameter-plugin-test/config/rush-project.json index 93089856e44..b3729624aed 100644 --- a/build-tests/heft-parameter-plugin-test/config/rush-project.json +++ b/build-tests/heft-parameter-plugin-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib"] + "outputFolderNames": ["lib-commonjs"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-parameter-plugin-test/tsconfig.json b/build-tests/heft-parameter-plugin-test/tsconfig.json index 98464e7dfed..f8d1ad8c88b 100644 --- a/build-tests/heft-parameter-plugin-test/tsconfig.json +++ b/build-tests/heft-parameter-plugin-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-parameter-plugin/config/rush-project.json b/build-tests/heft-parameter-plugin/config/rush-project.json index a3516b19e56..3437c4d7730 100644 --- a/build-tests/heft-parameter-plugin/config/rush-project.json +++ b/build-tests/heft-parameter-plugin/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib"] + "outputFolderNames": ["lib-commonjs"] } ] } diff --git a/build-tests/heft-parameter-plugin/heft-plugin.json b/build-tests/heft-parameter-plugin/heft-plugin.json index d7446db30e2..aedf5173751 100644 --- a/build-tests/heft-parameter-plugin/heft-plugin.json +++ b/build-tests/heft-parameter-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "heft-parameter-plugin", - "entryPoint": "./lib/index", + "entryPoint": "./lib-commonjs/index", "parameterScope": "heft-parameter-plugin", "parameters": [ { diff --git a/build-tests/heft-parameter-plugin/package.json b/build-tests/heft-parameter-plugin/package.json index 9e447a93ec2..a6f8ca86524 100644 --- a/build-tests/heft-parameter-plugin/package.json +++ b/build-tests/heft-parameter-plugin/package.json @@ -3,7 +3,7 @@ "description": "This project contains a Heft plugin that adds a custom parameter to built-in actions", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-parameter-plugin/tsconfig.json b/build-tests/heft-parameter-plugin/tsconfig.json index 2d179c7173f..e2f35108020 100644 --- a/build-tests/heft-parameter-plugin/tsconfig.json +++ b/build-tests/heft-parameter-plugin/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +20,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-rspack-everything-test/config/jest.config.json b/build-tests/heft-rspack-everything-test/config/jest.config.json index f22bb14d6d1..210c642e7a8 100644 --- a/build-tests/heft-rspack-everything-test/config/jest.config.json +++ b/build-tests/heft-rspack-everything-test/config/jest.config.json @@ -1,6 +1,9 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-web.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", @@ -8,5 +11,5 @@ // Use v8 coverage provider to avoid Babel "coverageProvider": "v8", - "resolver": "@rushstack/heft-jest-plugin/lib/exports/jest-node-modules-symlink-resolver" + "resolver": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-node-modules-symlink-resolver" } diff --git a/build-tests/heft-rspack-everything-test/config/rush-project.json b/build-tests/heft-rspack-everything-test/config/rush-project.json index 030d8d0ff0e..a87b21eb4a2 100644 --- a/build-tests/heft-rspack-everything-test/config/rush-project.json +++ b/build-tests/heft-rspack-everything-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-rspack-everything-test/rspack.config.mjs b/build-tests/heft-rspack-everything-test/rspack.config.mjs index fa68d03598f..4b82c88b2a2 100644 --- a/build-tests/heft-rspack-everything-test/rspack.config.mjs +++ b/build-tests/heft-rspack-everything-test/rspack.config.mjs @@ -31,8 +31,8 @@ const config = { extensions: ['.js', '.json'] }, entry: { - 'heft-test-A': resolve(__dirname, 'lib', 'indexA.js'), - 'heft-test-B': resolve(__dirname, 'lib', 'indexB.js') + 'heft-test-A': resolve(__dirname, 'lib-esm', 'indexA.js'), + 'heft-test-B': resolve(__dirname, 'lib-esm', 'indexB.js') }, output: { path: resolve(__dirname, 'dist'), diff --git a/build-tests/heft-rspack-everything-test/rspack.dev.config.mjs b/build-tests/heft-rspack-everything-test/rspack.dev.config.mjs index 3e0315a615d..36981719750 100644 --- a/build-tests/heft-rspack-everything-test/rspack.dev.config.mjs +++ b/build-tests/heft-rspack-everything-test/rspack.dev.config.mjs @@ -25,8 +25,8 @@ const config = { extensions: ['.js', '.json'] }, entry: { - 'heft-test-A': resolve(__dirname, 'lib', 'indexA.js'), - 'heft-test-B': resolve(__dirname, 'lib', 'indexB.js') + 'heft-test-A': resolve(__dirname, 'lib-commonjs', 'indexA.js'), + 'heft-test-B': resolve(__dirname, 'lib-commonjs', 'indexB.js') }, output: { path: resolve(__dirname, 'dist'), diff --git a/build-tests/heft-rspack-everything-test/src/test/__snapshots__/SourceMapTest.test.ts.snap b/build-tests/heft-rspack-everything-test/src/test/__snapshots__/SourceMapTest.test.ts.snap index 23c890d36c4..9f5515e37f9 100644 --- a/build-tests/heft-rspack-everything-test/src/test/__snapshots__/SourceMapTest.test.ts.snap +++ b/build-tests/heft-rspack-everything-test/src/test/__snapshots__/SourceMapTest.test.ts.snap @@ -2,7 +2,7 @@ exports[`Source Maps Chunk has a source that matches the sourceFileRegex 1`] = ` Array [ - "webpack://heft-rspack-everything-test/./lib/chunks/ChunkClass.js", + "webpack://heft-rspack-everything-test/./lib-esm/chunks/ChunkClass.js", ] `; @@ -18,7 +18,7 @@ Array [ "webpack://heft-rspack-everything-test/webpack/runtime/rspack_version", "webpack://heft-rspack-everything-test/webpack/runtime/auto_public_path", "webpack://heft-rspack-everything-test/webpack/runtime/rspack_unique_id", - "webpack://heft-rspack-everything-test/./lib/indexA.js", + "webpack://heft-rspack-everything-test/./lib-esm/indexA.js", ] `; @@ -26,6 +26,6 @@ exports[`Source Maps Test-B has a source that matches the sourceFileRegex 1`] = Array [ "webpack://heft-rspack-everything-test/webpack/runtime/rspack_version", "webpack://heft-rspack-everything-test/webpack/runtime/rspack_unique_id", - "webpack://heft-rspack-everything-test/./lib/indexB.js", + "webpack://heft-rspack-everything-test/./lib-esm/indexB.js", ] `; diff --git a/build-tests/heft-rspack-everything-test/tsconfig.json b/build-tests/heft-rspack-everything-test/tsconfig.json index 1838fa44b78..e36104a9897 100644 --- a/build-tests/heft-rspack-everything-test/tsconfig.json +++ b/build-tests/heft-rspack-everything-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "allowArbitraryExtensions": true, @@ -24,6 +24,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-sass-test/config/heft.json b/build-tests/heft-sass-test/config/heft.json index 9ebc1cf87e4..685ffd8236e 100644 --- a/build-tests/heft-sass-test/config/heft.json +++ b/build-tests/heft-sass-test/config/heft.json @@ -7,7 +7,7 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-commonjs", "lib-css", "temp"] }], + "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-commonjs", "lib-css", "lib-esm", "temp"] }], "tasksByName": { "set-browserslist-ignore-old-data-env-var": { diff --git a/build-tests/heft-sass-test/config/rush-project.json b/build-tests/heft-sass-test/config/rush-project.json index cd98f0644b5..8640b4ff7e0 100644 --- a/build-tests/heft-sass-test/config/rush-project.json +++ b/build-tests/heft-sass-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "lib-css", "dist", "temp/sass-ts"] + "outputFolderNames": ["lib-esm", "lib-css", "dist", "temp/sass-ts"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-sass-test/config/sass.json b/build-tests/heft-sass-test/config/sass.json index a4993854d2f..1b51ab5dcb3 100644 --- a/build-tests/heft-sass-test/config/sass.json +++ b/build-tests/heft-sass-test/config/sass.json @@ -2,11 +2,11 @@ "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft-sass-plugin.schema.json", "cssOutputFolders": [ - { "folder": "lib", "shimModuleFormat": "esnext" }, + { "folder": "lib-esm", "shimModuleFormat": "esnext" }, { "folder": "lib-commonjs", "shimModuleFormat": "commonjs" }, "lib-css" ], - "secondaryGeneratedTsFolders": ["lib"], + "secondaryGeneratedTsFolders": ["lib-esm"], "excludeFiles": ["./ignored1.scss", "ignored2.scss"], "fileExtensions": [".module.scss", ".module.sass", ".module.css"], diff --git a/build-tests/heft-sass-test/src/test/lib.test.ts b/build-tests/heft-sass-test/src/test/lib.test.ts index 1fb4a9746e6..55a32154653 100644 --- a/build-tests/heft-sass-test/src/test/lib.test.ts +++ b/build-tests/heft-sass-test/src/test/lib.test.ts @@ -5,7 +5,7 @@ import * as path from 'node:path'; import { validateSnapshots, getScssFiles } from './validateSnapshots'; describe('SASS ESM Shims', () => { - const libFolder: string = path.join(__dirname, '../../lib'); + const libFolder: string = path.join(__dirname, '../../lib-esm'); getScssFiles().forEach((fileName: string) => { it(fileName, () => { validateSnapshots(libFolder, fileName); diff --git a/build-tests/heft-sass-test/tsconfig.json b/build-tests/heft-sass-test/tsconfig.json index aab26ef92a8..2cba886d6d8 100644 --- a/build-tests/heft-sass-test/tsconfig.json +++ b/build-tests/heft-sass-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "rootDirs": ["src", "temp/sass-ts"], @@ -22,6 +22,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-sass-test/webpack.config.js b/build-tests/heft-sass-test/webpack.config.js index 2e5a69d9dbb..9441cfeea98 100644 --- a/build-tests/heft-sass-test/webpack.config.js +++ b/build-tests/heft-sass-test/webpack.config.js @@ -43,7 +43,7 @@ function createWebpackConfig({ production }) { ] }, entry: { - app: path.join(__dirname, 'lib', 'index.js'), + app: path.join(__dirname, 'lib-esm', 'index.js'), // Put these libraries in a separate vendor bundle vendor: ['react', 'react-dom'] diff --git a/build-tests/heft-swc-test/package.json b/build-tests/heft-swc-test/package.json index 1ca17518793..93bb8168329 100644 --- a/build-tests/heft-swc-test/package.json +++ b/build-tests/heft-swc-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests building with SWC", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-typescript-v2-test/config/api-extractor.json b/build-tests/heft-typescript-v2-test/config/api-extractor.json index e451cf705d0..d12edb988a5 100644 --- a/build-tests/heft-typescript-v2-test/config/api-extractor.json +++ b/build-tests/heft-typescript-v2-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "/etc" diff --git a/build-tests/heft-typescript-v2-test/config/rush-project.json b/build-tests/heft-typescript-v2-test/config/rush-project.json index a93c6b2720f..95af43b193f 100644 --- a/build-tests/heft-typescript-v2-test/config/rush-project.json +++ b/build-tests/heft-typescript-v2-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"] + "outputFolderNames": ["dist", "lib-commonjs", "lib-esm", "lib-umd"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-typescript-v2-test/config/typescript.json b/build-tests/heft-typescript-v2-test/config/typescript.json index 433bdbea198..85dc7d42b7a 100644 --- a/build-tests/heft-typescript-v2-test/config/typescript.json +++ b/build-tests/heft-typescript-v2-test/config/typescript.json @@ -11,7 +11,7 @@ "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-esm" }, { "moduleKind": "umd", diff --git a/build-tests/heft-typescript-v2-test/package.json b/build-tests/heft-typescript-v2-test/package.json index c00de02bb22..2f8e7b572e5 100644 --- a/build-tests/heft-typescript-v2-test/package.json +++ b/build-tests/heft-typescript-v2-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests building with TypeScript v2", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-typescript-v2-test/tsconfig.json b/build-tests/heft-typescript-v2-test/tsconfig.json index 4596d666047..819c8cda10f 100644 --- a/build-tests/heft-typescript-v2-test/tsconfig.json +++ b/build-tests/heft-typescript-v2-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -23,6 +24,5 @@ // TODO: REVERT THIS AFTER WE UPGRADE heft-typescript-v2-test TO A NEWER VERSION "skipLibCheck": true }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-typescript-v3-test/config/api-extractor.json b/build-tests/heft-typescript-v3-test/config/api-extractor.json index e451cf705d0..d12edb988a5 100644 --- a/build-tests/heft-typescript-v3-test/config/api-extractor.json +++ b/build-tests/heft-typescript-v3-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "/etc" diff --git a/build-tests/heft-typescript-v3-test/config/heft.json b/build-tests/heft-typescript-v3-test/config/heft.json index 7a5e5b56ad9..07fd7b53d05 100644 --- a/build-tests/heft-typescript-v3-test/config/heft.json +++ b/build-tests/heft-typescript-v3-test/config/heft.json @@ -4,7 +4,7 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-esnext", "lib-umd", "temp"] }], + "cleanFiles": [{ "includeGlobs": ["dist", "lib-commonjs", "lib", "lib-esnext", "lib-umd", "temp"] }], "tasksByName": { "typescript": { diff --git a/build-tests/heft-typescript-v3-test/config/rush-project.json b/build-tests/heft-typescript-v3-test/config/rush-project.json index a93c6b2720f..95af43b193f 100644 --- a/build-tests/heft-typescript-v3-test/config/rush-project.json +++ b/build-tests/heft-typescript-v3-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"] + "outputFolderNames": ["dist", "lib-commonjs", "lib-esm", "lib-umd"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-typescript-v3-test/config/typescript.json b/build-tests/heft-typescript-v3-test/config/typescript.json index 433bdbea198..85dc7d42b7a 100644 --- a/build-tests/heft-typescript-v3-test/config/typescript.json +++ b/build-tests/heft-typescript-v3-test/config/typescript.json @@ -11,7 +11,7 @@ "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-esm" }, { "moduleKind": "umd", diff --git a/build-tests/heft-typescript-v3-test/package.json b/build-tests/heft-typescript-v3-test/package.json index 18da26383ec..8f8fb7a56e1 100644 --- a/build-tests/heft-typescript-v3-test/package.json +++ b/build-tests/heft-typescript-v3-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests building with TypeScript v3", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-typescript-v3-test/tsconfig.json b/build-tests/heft-typescript-v3-test/tsconfig.json index a24c429ddf6..9bb1bff372e 100644 --- a/build-tests/heft-typescript-v3-test/tsconfig.json +++ b/build-tests/heft-typescript-v3-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +21,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-typescript-v4-test/config/api-extractor.json b/build-tests/heft-typescript-v4-test/config/api-extractor.json index e451cf705d0..d12edb988a5 100644 --- a/build-tests/heft-typescript-v4-test/config/api-extractor.json +++ b/build-tests/heft-typescript-v4-test/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "/etc" diff --git a/build-tests/heft-typescript-v4-test/config/heft.json b/build-tests/heft-typescript-v4-test/config/heft.json index 7a5e5b56ad9..460ff4c0c94 100644 --- a/build-tests/heft-typescript-v4-test/config/heft.json +++ b/build-tests/heft-typescript-v4-test/config/heft.json @@ -4,7 +4,9 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-esnext", "lib-umd", "temp"] }], + "cleanFiles": [ + { "includeGlobs": ["dist", "lib-commonjs", "lib", "lib-esm", "lib-esnext", "lib-umd", "temp"] } + ], "tasksByName": { "typescript": { diff --git a/build-tests/heft-typescript-v4-test/config/rush-project.json b/build-tests/heft-typescript-v4-test/config/rush-project.json index a93c6b2720f..95af43b193f 100644 --- a/build-tests/heft-typescript-v4-test/config/rush-project.json +++ b/build-tests/heft-typescript-v4-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"] + "outputFolderNames": ["dist", "lib-commonjs", "lib-esm", "lib-umd"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-typescript-v4-test/config/typescript.json b/build-tests/heft-typescript-v4-test/config/typescript.json index 433bdbea198..85dc7d42b7a 100644 --- a/build-tests/heft-typescript-v4-test/config/typescript.json +++ b/build-tests/heft-typescript-v4-test/config/typescript.json @@ -11,7 +11,7 @@ "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-esm" }, { "moduleKind": "umd", diff --git a/build-tests/heft-typescript-v4-test/package.json b/build-tests/heft-typescript-v4-test/package.json index 4975e4f904f..23f4dfbaa43 100644 --- a/build-tests/heft-typescript-v4-test/package.json +++ b/build-tests/heft-typescript-v4-test/package.json @@ -3,7 +3,7 @@ "description": "Building this project tests building with TypeScript v4", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-typescript-v4-test/tsconfig.json b/build-tests/heft-typescript-v4-test/tsconfig.json index a24c429ddf6..9bb1bff372e 100644 --- a/build-tests/heft-typescript-v4-test/tsconfig.json +++ b/build-tests/heft-typescript-v4-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +21,5 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-web-rig-library-test/package.json b/build-tests/heft-web-rig-library-test/package.json index 65a9734b44a..037696daccd 100644 --- a/build-tests/heft-web-rig-library-test/package.json +++ b/build-tests/heft-web-rig-library-test/package.json @@ -3,7 +3,7 @@ "description": "A test project for Heft that exercises the '@rushstack/heft-web-rig' package", "version": "1.0.0", "private": true, - "main": "lib/index.js", + "main": "./lib/index.js", "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/build-tests/heft-webpack4-everything-test/config/rush-project.json b/build-tests/heft-webpack4-everything-test/config/rush-project.json index 030d8d0ff0e..a87b21eb4a2 100644 --- a/build-tests/heft-webpack4-everything-test/config/rush-project.json +++ b/build-tests/heft-webpack4-everything-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-webpack4-everything-test/tsconfig.json b/build-tests/heft-webpack4-everything-test/tsconfig.json index eb547d1f50d..2b5b7ac9673 100644 --- a/build-tests/heft-webpack4-everything-test/tsconfig.json +++ b/build-tests/heft-webpack4-everything-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -23,6 +23,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-webpack4-everything-test/webpack.config.js b/build-tests/heft-webpack4-everything-test/webpack.config.js index c4be9e959c4..f4382840815 100644 --- a/build-tests/heft-webpack4-everything-test/webpack.config.js +++ b/build-tests/heft-webpack4-everything-test/webpack.config.js @@ -27,8 +27,8 @@ module.exports = { extensions: ['.js', '.json'] }, entry: { - 'heft-test-A': path.join(__dirname, 'lib', 'indexA.js'), - 'heft-test-B': path.join(__dirname, 'lib', 'indexB.js') + 'heft-test-A': path.join(__dirname, 'lib-esm', 'indexA.js'), + 'heft-test-B': path.join(__dirname, 'lib-esm', 'indexB.js') }, output: { path: path.join(__dirname, 'dist'), diff --git a/build-tests/heft-webpack5-everything-test/config/jest.config.json b/build-tests/heft-webpack5-everything-test/config/jest.config.json index f22bb14d6d1..210c642e7a8 100644 --- a/build-tests/heft-webpack5-everything-test/config/jest.config.json +++ b/build-tests/heft-webpack5-everything-test/config/jest.config.json @@ -1,6 +1,9 @@ { "extends": "@rushstack/heft-jest-plugin/includes/jest-web.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", @@ -8,5 +11,5 @@ // Use v8 coverage provider to avoid Babel "coverageProvider": "v8", - "resolver": "@rushstack/heft-jest-plugin/lib/exports/jest-node-modules-symlink-resolver" + "resolver": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-node-modules-symlink-resolver" } diff --git a/build-tests/heft-webpack5-everything-test/config/rush-project.json b/build-tests/heft-webpack5-everything-test/config/rush-project.json index 030d8d0ff0e..a87b21eb4a2 100644 --- a/build-tests/heft-webpack5-everything-test/config/rush-project.json +++ b/build-tests/heft-webpack5-everything-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib-esm", "dist"] }, { "operationName": "_phase:test", diff --git a/build-tests/heft-webpack5-everything-test/tsconfig.json b/build-tests/heft-webpack5-everything-test/tsconfig.json index a6ce628bed0..e3c0ce2496a 100644 --- a/build-tests/heft-webpack5-everything-test/tsconfig.json +++ b/build-tests/heft-webpack5-everything-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "allowArbitraryExtensions": true, @@ -24,6 +24,5 @@ "target": "es5", "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/heft-webpack5-everything-test/webpack.config.js b/build-tests/heft-webpack5-everything-test/webpack.config.js index a787b034d8e..b1208d56ad0 100644 --- a/build-tests/heft-webpack5-everything-test/webpack.config.js +++ b/build-tests/heft-webpack5-everything-test/webpack.config.js @@ -25,8 +25,8 @@ module.exports = { extensions: ['.js', '.json'] }, entry: { - 'heft-test-A': path.join(__dirname, 'lib', 'indexA.js'), - 'heft-test-B': path.join(__dirname, 'lib', 'indexB.js') + 'heft-test-A': path.join(__dirname, 'lib-esm', 'indexA.js'), + 'heft-test-B': path.join(__dirname, 'lib-esm', 'indexB.js') }, output: { path: path.join(__dirname, 'dist'), diff --git a/build-tests/localization-plugin-test-01/package.json b/build-tests/localization-plugin-test-01/package.json index 7702df1f1ab..0543b91625f 100644 --- a/build-tests/localization-plugin-test-01/package.json +++ b/build-tests/localization-plugin-test-01/package.json @@ -21,5 +21,20 @@ "webpack": "~4.47.0", "webpack-bundle-analyzer": "~4.5.0", "webpack-dev-server": "~4.9.3" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/localization-plugin-test-01/tsconfig.json b/build-tests/localization-plugin-test-01/tsconfig.json index 2bb989b8efe..27340e2d2e3 100644 --- a/build-tests/localization-plugin-test-01/tsconfig.json +++ b/build-tests/localization-plugin-test-01/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "module": "esnext", "moduleResolution": "node", "rootDirs": ["src", "temp/loc-json-ts"] } diff --git a/build-tests/localization-plugin-test-01/webpack.config.js b/build-tests/localization-plugin-test-01/webpack.config.js index e3fb41279fd..09db14220ae 100644 --- a/build-tests/localization-plugin-test-01/webpack.config.js +++ b/build-tests/localization-plugin-test-01/webpack.config.js @@ -10,8 +10,8 @@ function generateConfiguration(mode, outputFolderName, webpack) { return { mode, entry: { - 'localization-test-A': `${__dirname}/lib/indexA.js`, - 'localization-test-B': `${__dirname}/lib/indexB.js` + 'localization-test-A': `${__dirname}/lib-esm/indexA.js`, + 'localization-test-B': `${__dirname}/lib-esm/indexB.js` }, output: { path: `${__dirname}/${outputFolderName}`, diff --git a/build-tests/localization-plugin-test-02/config/typescript.json b/build-tests/localization-plugin-test-02/config/typescript.json index 95ea4894e69..a97ea7a3a75 100644 --- a/build-tests/localization-plugin-test-02/config/typescript.json +++ b/build-tests/localization-plugin-test-02/config/typescript.json @@ -4,6 +4,8 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", + "extends": "local-node-rig/profiles/default/config/typescript.json", + "staticAssetsToCopy": { "fileExtensions": [".resx", ".json", ".resjson"] } diff --git a/build-tests/localization-plugin-test-02/package.json b/build-tests/localization-plugin-test-02/package.json index 6e6d389e18e..2329ea28165 100644 --- a/build-tests/localization-plugin-test-02/package.json +++ b/build-tests/localization-plugin-test-02/package.json @@ -24,5 +24,20 @@ "webpack": "~4.47.0", "webpack-bundle-analyzer": "~4.5.0", "webpack-dev-server": "~4.9.3" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/localization-plugin-test-02/tsconfig.json b/build-tests/localization-plugin-test-02/tsconfig.json index 2bb989b8efe..27340e2d2e3 100644 --- a/build-tests/localization-plugin-test-02/tsconfig.json +++ b/build-tests/localization-plugin-test-02/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "module": "esnext", "moduleResolution": "node", "rootDirs": ["src", "temp/loc-json-ts"] } diff --git a/build-tests/localization-plugin-test-02/webpack.config.js b/build-tests/localization-plugin-test-02/webpack.config.js index 8e424812e6d..dc3c7a6cabb 100644 --- a/build-tests/localization-plugin-test-02/webpack.config.js +++ b/build-tests/localization-plugin-test-02/webpack.config.js @@ -10,9 +10,9 @@ function generateConfiguration(mode, outputFolderName, webpack) { return { mode: mode, entry: { - 'localization-test-A': `${__dirname}/lib/indexA.js`, - 'localization-test-B': `${__dirname}/lib/indexB.js`, - 'localization-test-C': `${__dirname}/lib/indexC.js` + 'localization-test-A': `${__dirname}/lib-esm/indexA.js`, + 'localization-test-B': `${__dirname}/lib-esm/indexB.js`, + 'localization-test-C': `${__dirname}/lib-esm/indexC.js` }, output: { path: `${__dirname}/${outputFolderName}`, diff --git a/build-tests/localization-plugin-test-03/config/typescript.json b/build-tests/localization-plugin-test-03/config/typescript.json new file mode 100644 index 00000000000..95215feff86 --- /dev/null +++ b/build-tests/localization-plugin-test-03/config/typescript.json @@ -0,0 +1,4 @@ +{ + // This project uses ts-loader + "additionalModuleKindsToEmit": [] +} diff --git a/build-tests/localization-plugin-test-03/package.json b/build-tests/localization-plugin-test-03/package.json index 3c72df77247..aee6c5bff74 100644 --- a/build-tests/localization-plugin-test-03/package.json +++ b/build-tests/localization-plugin-test-03/package.json @@ -24,5 +24,20 @@ "webpack": "~4.47.0", "webpack-bundle-analyzer": "~4.5.0", "webpack-dev-server": "~4.9.3" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/localization-plugin-test-03/tsconfig.json b/build-tests/localization-plugin-test-03/tsconfig.json index 5fafb6d9808..898e6469aff 100644 --- a/build-tests/localization-plugin-test-03/tsconfig.json +++ b/build-tests/localization-plugin-test-03/tsconfig.json @@ -2,6 +2,8 @@ "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "module": "esnext", + "outDir": "lib-esm", + "declarationDir": "lib-dts", "moduleResolution": "node", "incremental": false, "rootDirs": ["src", "temp/loc-json-ts"] diff --git a/build-tests/localization-plugin-test-03/webpack.config.js b/build-tests/localization-plugin-test-03/webpack.config.js index 56d3cf532e8..c0d97daef7d 100644 --- a/build-tests/localization-plugin-test-03/webpack.config.js +++ b/build-tests/localization-plugin-test-03/webpack.config.js @@ -118,7 +118,7 @@ function generateConfiguration(mode, outputFolderName, webpack) { }, typingsOptions: { generatedTsFolder: `${__dirname}/temp/loc-json-ts`, - secondaryGeneratedTsFolders: ['lib'], + secondaryGeneratedTsFolders: ['lib-commonjs'], sourceRoot: `${__dirname}/src`, exportAsDefault: true }, diff --git a/build-tests/run-scenarios-helpers/package.json b/build-tests/run-scenarios-helpers/package.json index a48ffe38513..0ecf9ea3efc 100644 --- a/build-tests/run-scenarios-helpers/package.json +++ b/build-tests/run-scenarios-helpers/package.json @@ -3,8 +3,29 @@ "description": "Helpers for the *-scenarios test projects.", "version": "1.0.0", "private": true, - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft build --clean" diff --git a/build-tests/run-scenarios-helpers/src/index.ts b/build-tests/run-scenarios-helpers/src/index.ts index 7fc8b403099..f788a86850f 100644 --- a/build-tests/run-scenarios-helpers/src/index.ts +++ b/build-tests/run-scenarios-helpers/src/index.ts @@ -33,7 +33,8 @@ export async function runScenariosAsync( const scenariosWithCustomCompilerOptions: string[] = []; const scenarioFolderNames: string[] = []; - const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(libFolderPath); + const libDtsFolderPath: string = `${buildFolderPath}/lib-dts`; + const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(libDtsFolderPath); for (const folderItem of folderItems) { if (folderItem.isDirectory()) { scenarioFolderNames.push(folderItem.name); @@ -43,7 +44,7 @@ export async function runScenariosAsync( await Async.forEachAsync( scenarioFolderNames, async (scenarioFolderName) => { - const entryPoint: string = `${buildFolderPath}/lib/${scenarioFolderName}/index.d.ts`; + const entryPoint: string = `${libDtsFolderPath}/${scenarioFolderName}/index.d.ts`; entryPoints.push(entryPoint); const overridesPath: string = `${buildFolderPath}/src/${scenarioFolderName}/config/api-extractor-overrides.json`; diff --git a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json index 0833997b92a..8318c777711 100644 --- a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json +++ b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json @@ -21,5 +21,20 @@ "eslint": "~9.37.0", "http-proxy": "~1.18.1", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/tsconfig.json b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/tsconfig.json index 2d179c7173f..7fed53142a3 100644 --- a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/tsconfig.json +++ b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -20,6 +21,6 @@ "target": "es2017", "lib": ["es2017"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/rush-lib-declaration-paths-test/package.json b/build-tests/rush-lib-declaration-paths-test/package.json index d497ba52b6f..d5fe4b307b3 100644 --- a/build-tests/rush-lib-declaration-paths-test/package.json +++ b/build-tests/rush-lib-declaration-paths-test/package.json @@ -16,5 +16,20 @@ "@types/node": "20.17.19", "eslint": "~9.37.0", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-lib-declaration-paths-test/scripts/createSrc.js b/build-tests/rush-lib-declaration-paths-test/scripts/createSrc.js index 85005b72b2b..d61fb703b1a 100644 --- a/build-tests/rush-lib-declaration-paths-test/scripts/createSrc.js +++ b/build-tests/rush-lib-declaration-paths-test/scripts/createSrc.js @@ -31,7 +31,7 @@ module.exports = { '// See LICENSE in the project root for license information.', '' ]; - for await (const dtsPath of collectDtsPaths(`${rushLibPath}/lib`, '@microsoft/rush-lib/lib')) { + for await (const dtsPath of collectDtsPaths(`${rushLibPath}/lib-commonjs`, '@microsoft/rush-lib/lib')) { indexFileLines.push(`import '${dtsPath}';`); } diff --git a/build-tests/rush-mcp-example-plugin/package.json b/build-tests/rush-mcp-example-plugin/package.json index 2f16f0b0044..26b4de36942 100644 --- a/build-tests/rush-mcp-example-plugin/package.json +++ b/build-tests/rush-mcp-example-plugin/package.json @@ -14,5 +14,28 @@ "@rushstack/mcp-server": "workspace:*", "local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" + }, + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-mcp-example-plugin/rush-mcp-plugin.json b/build-tests/rush-mcp-example-plugin/rush-mcp-plugin.json index 48ff8a67fb9..cf875f15e32 100644 --- a/build-tests/rush-mcp-example-plugin/rush-mcp-plugin.json +++ b/build-tests/rush-mcp-example-plugin/rush-mcp-plugin.json @@ -15,10 +15,10 @@ * * The config file path will be `/common/config/rush-mcp/.json`. */ - "configFileSchema": "./lib/rush-mcp-example-plugin.schema.json", + "configFileSchema": "./lib-commonjs/rush-mcp-example-plugin.schema.json", /** * The entry point, whose default export should be a class that implements */ - "entryPoint": "./lib/index.js" + "entryPoint": "./lib-commonjs/index.js" } diff --git a/build-tests/rush-package-manager-integration-test/package.json b/build-tests/rush-package-manager-integration-test/package.json index a8c688eb316..a812e495c73 100644 --- a/build-tests/rush-package-manager-integration-test/package.json +++ b/build-tests/rush-package-manager-integration-test/package.json @@ -7,7 +7,7 @@ "scripts": { "_phase:build": "heft build --clean", "build": "heft build --clean", - "test": "node lib/runTests.js" + "test": "node lib-commonjs/runTests.js" }, "devDependencies": { "@microsoft/rush": "workspace:*", @@ -16,5 +16,20 @@ "@rushstack/node-core-library": "workspace:*", "@rushstack/terminal": "workspace:*", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-project-change-analyzer-test/package.json b/build-tests/rush-project-change-analyzer-test/package.json index 5d53df9077e..eed4151ea5d 100644 --- a/build-tests/rush-project-change-analyzer-test/package.json +++ b/build-tests/rush-project-change-analyzer-test/package.json @@ -18,5 +18,20 @@ "@types/node": "20.17.19", "eslint": "~9.37.0", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/package.json b/build-tests/rush-redis-cobuild-plugin-integration-test/package.json index 309fe18fd9e..d444fec1651 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/package.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/package.json @@ -20,5 +20,20 @@ "eslint": "~9.37.0", "http-proxy": "~1.18.1", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/src/runRush.ts b/build-tests/rush-redis-cobuild-plugin-integration-test/src/runRush.ts index 8dd32b0fe81..953fa946c1c 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/src/runRush.ts +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/src/runRush.ts @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -// Import from lib-commonjs for easy debugging -import { RushCommandLineParser } from '@microsoft/rush-lib/lib-commonjs/cli/RushCommandLineParser'; -import * as rushLib from '@microsoft/rush-lib/lib-commonjs'; +import { RushCommandLineParser } from '@microsoft/rush-lib/lib/cli/RushCommandLineParser'; +import * as rushLib from '@microsoft/rush-lib'; // Setup redis cobuild plugin const builtInPluginConfigurations: rushLib._IBuiltInPluginConfiguration[] = []; diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/tsconfig.json b/build-tests/rush-redis-cobuild-plugin-integration-test/tsconfig.json index 599b3beb19e..75355e8f91d 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/tsconfig.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-commonjs", + "declarationDir": "lib-dts", "rootDir": "src", "forceConsistentCasingInFileNames": true, @@ -21,6 +22,6 @@ "target": "es2017", "lib": ["es2017", "DOM"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["node_modules", "lib"] + + "include": ["src/**/*.ts", "src/**/*.tsx"] } diff --git a/build-tests/set-webpack-public-path-plugin-test/config/rush-project.json b/build-tests/set-webpack-public-path-plugin-test/config/rush-project.json index 543278bebd4..0dbbaa83178 100644 --- a/build-tests/set-webpack-public-path-plugin-test/config/rush-project.json +++ b/build-tests/set-webpack-public-path-plugin-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib", "dist-dev", "dist-prod"] + "outputFolderNames": ["lib-esm", "dist-dev", "dist-prod"] } ] } diff --git a/build-tests/set-webpack-public-path-plugin-test/tsconfig.json b/build-tests/set-webpack-public-path-plugin-test/tsconfig.json index dad0392042f..cf3d039b7db 100644 --- a/build-tests/set-webpack-public-path-plugin-test/tsconfig.json +++ b/build-tests/set-webpack-public-path-plugin-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, diff --git a/build-tests/set-webpack-public-path-plugin-test/webpack.config.js b/build-tests/set-webpack-public-path-plugin-test/webpack.config.js index b04d9ecd5c4..1fa002a56a4 100644 --- a/build-tests/set-webpack-public-path-plugin-test/webpack.config.js +++ b/build-tests/set-webpack-public-path-plugin-test/webpack.config.js @@ -10,7 +10,7 @@ function generateConfiguration(mode, outputFolderName) { mode: mode, target: ['web', 'es5'], entry: { - 'test-bundle': `${__dirname}/lib/index.js` + 'test-bundle': `${__dirname}/lib-esm/index.js` }, output: { path: `${__dirname}/${outputFolderName}`, diff --git a/build-tests/webpack-local-version-test/config/rush-project.json b/build-tests/webpack-local-version-test/config/rush-project.json index a3516b19e56..504f3875412 100644 --- a/build-tests/webpack-local-version-test/config/rush-project.json +++ b/build-tests/webpack-local-version-test/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib"] + "outputFolderNames": ["lib-esm"] } ] } diff --git a/build-tests/webpack-local-version-test/tsconfig.json b/build-tests/webpack-local-version-test/tsconfig.json index dad0392042f..cf3d039b7db 100644 --- a/build-tests/webpack-local-version-test/tsconfig.json +++ b/build-tests/webpack-local-version-test/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { - "outDir": "lib", + "outDir": "lib-esm", "rootDir": "src", "forceConsistentCasingInFileNames": true, diff --git a/build-tests/webpack-local-version-test/webpack.config.js b/build-tests/webpack-local-version-test/webpack.config.js index ef670ec1c8d..7a72077f946 100644 --- a/build-tests/webpack-local-version-test/webpack.config.js +++ b/build-tests/webpack-local-version-test/webpack.config.js @@ -25,7 +25,7 @@ module.exports = ({ webpack }) => { return { mode: 'development', entry: { - 'test-bundle': `${__dirname}/lib/index.js` + 'test-bundle': `${__dirname}/lib-esm/index.js` } }; }; diff --git a/common/changes/@microsoft/api-documenter/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/api-documenter/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..a63df450b99 --- /dev/null +++ b/common/changes/@microsoft/api-documenter/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/api-documenter" + } + ], + "packageName": "@microsoft/api-documenter", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/api-extractor-model/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/api-extractor-model/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..3805dad3bf4 --- /dev/null +++ b/common/changes/@microsoft/api-extractor-model/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/api-extractor-model" + } + ], + "packageName": "@microsoft/api-extractor-model", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/api-extractor/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/api-extractor/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..bda63897ae8 --- /dev/null +++ b/common/changes/@microsoft/api-extractor/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/api-extractor" + } + ], + "packageName": "@microsoft/api-extractor", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/load-themed-styles/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/load-themed-styles/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..5d0a3aac90b --- /dev/null +++ b/common/changes/@microsoft/load-themed-styles/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/load-themed-styles" + } + ], + "packageName": "@microsoft/load-themed-styles", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/loader-load-themed-styles/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/loader-load-themed-styles/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..8fa0576e504 --- /dev/null +++ b/common/changes/@microsoft/loader-load-themed-styles/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/loader-load-themed-styles" + } + ], + "packageName": "@microsoft/loader-load-themed-styles", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/rush/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/rush/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..b45e3eeed1a --- /dev/null +++ b/common/changes/@microsoft/rush/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs` and DTS is now under `lib-dts`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "none", + "packageName": "@microsoft/rush" + } + ], + "packageName": "@microsoft/rush", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/webpack5-load-themed-styles-loader/normalize-build-output_2026-02-17-18-56.json b/common/changes/@microsoft/webpack5-load-themed-styles-loader/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..72e154de97d --- /dev/null +++ b/common/changes/@microsoft/webpack5-load-themed-styles-loader/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@microsoft/webpack5-load-themed-styles-loader" + } + ], + "packageName": "@microsoft/webpack5-load-themed-styles-loader", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/cpu-profile-summarizer/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/cpu-profile-summarizer/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..f86aa8df812 --- /dev/null +++ b/common/changes/@rushstack/cpu-profile-summarizer/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/cpu-profile-summarizer" + } + ], + "packageName": "@rushstack/cpu-profile-summarizer", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/credential-cache/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/credential-cache/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..1a289e59fef --- /dev/null +++ b/common/changes/@rushstack/credential-cache/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/credential-cache" + } + ], + "packageName": "@rushstack/credential-cache", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/debug-certificate-manager/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/debug-certificate-manager/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..b54e457c33b --- /dev/null +++ b/common/changes/@rushstack/debug-certificate-manager/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/debug-certificate-manager" + } + ], + "packageName": "@rushstack/debug-certificate-manager", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-bulk/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-bulk/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..94951271d93 --- /dev/null +++ b/common/changes/@rushstack/eslint-bulk/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/eslint-bulk" + } + ], + "packageName": "@rushstack/eslint-bulk", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-config/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-config/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..eb979d5ff2e --- /dev/null +++ b/common/changes/@rushstack/eslint-config/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Add `sideEffects` field to package.json.", + "type": "patch", + "packageName": "@rushstack/eslint-config" + } + ], + "packageName": "@rushstack/eslint-config", + "email": "iclanton@users.noreply.github.com" +} diff --git a/common/changes/@rushstack/eslint-patch/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-patch/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..680408a38ed --- /dev/null +++ b/common/changes/@rushstack/eslint-patch/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/eslint-patch" + } + ], + "packageName": "@rushstack/eslint-patch", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin-packlets/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-plugin-packlets/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..8fe60edcf09 --- /dev/null +++ b/common/changes/@rushstack/eslint-plugin-packlets/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/eslint-plugin-packlets" + } + ], + "packageName": "@rushstack/eslint-plugin-packlets", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin-security/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-plugin-security/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ecfca174f77 --- /dev/null +++ b/common/changes/@rushstack/eslint-plugin-security/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/eslint-plugin-security" + } + ], + "packageName": "@rushstack/eslint-plugin-security", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/eslint-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..211ed1a5e50 --- /dev/null +++ b/common/changes/@rushstack/eslint-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/eslint-plugin" + } + ], + "packageName": "@rushstack/eslint-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/hashed-folder-copy-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/hashed-folder-copy-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..496441fe170 --- /dev/null +++ b/common/changes/@rushstack/hashed-folder-copy-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/hashed-folder-copy-plugin" + } + ], + "packageName": "@rushstack/hashed-folder-copy-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-api-extractor-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-api-extractor-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..26d53ebd192 --- /dev/null +++ b/common/changes/@rushstack/heft-api-extractor-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-api-extractor-plugin" + } + ], + "packageName": "@rushstack/heft-api-extractor-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-config-file/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-config-file/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..a3ddd77ae53 --- /dev/null +++ b/common/changes/@rushstack/heft-config-file/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-config-file" + } + ], + "packageName": "@rushstack/heft-config-file", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-dev-cert-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-dev-cert-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..d148aa63640 --- /dev/null +++ b/common/changes/@rushstack/heft-dev-cert-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-dev-cert-plugin" + } + ], + "packageName": "@rushstack/heft-dev-cert-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-isolated-typescript-transpile-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-isolated-typescript-transpile-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..b601d637812 --- /dev/null +++ b/common/changes/@rushstack/heft-isolated-typescript-transpile-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-isolated-typescript-transpile-plugin" + } + ], + "packageName": "@rushstack/heft-isolated-typescript-transpile-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-jest-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-jest-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..3119747267b --- /dev/null +++ b/common/changes/@rushstack/heft-jest-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-jest-plugin" + } + ], + "packageName": "@rushstack/heft-jest-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-json-schema-typings-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-json-schema-typings-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..d59b0e555e1 --- /dev/null +++ b/common/changes/@rushstack/heft-json-schema-typings-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-json-schema-typings-plugin" + } + ], + "packageName": "@rushstack/heft-json-schema-typings-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-lint-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-lint-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..6beab2558eb --- /dev/null +++ b/common/changes/@rushstack/heft-lint-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-lint-plugin" + } + ], + "packageName": "@rushstack/heft-lint-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-localization-typings-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-localization-typings-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..21bfc05f81f --- /dev/null +++ b/common/changes/@rushstack/heft-localization-typings-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-localization-typings-plugin" + } + ], + "packageName": "@rushstack/heft-localization-typings-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-node-rig/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-node-rig/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..3bc1f7490c1 --- /dev/null +++ b/common/changes/@rushstack/heft-node-rig/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Add `sideEffects` field to package.json.", + "type": "patch", + "packageName": "@rushstack/heft-node-rig" + } + ], + "packageName": "@rushstack/heft-node-rig", + "email": "iclanton@users.noreply.github.com" +} diff --git a/common/changes/@rushstack/heft-rspack-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-rspack-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..48d5c7186e1 --- /dev/null +++ b/common/changes/@rushstack/heft-rspack-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-rspack-plugin" + } + ], + "packageName": "@rushstack/heft-rspack-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-sass-load-themed-styles-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-sass-load-themed-styles-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..e60a9bb9576 --- /dev/null +++ b/common/changes/@rushstack/heft-sass-load-themed-styles-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-sass-load-themed-styles-plugin" + } + ], + "packageName": "@rushstack/heft-sass-load-themed-styles-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-sass-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-sass-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..95dcd955b7a --- /dev/null +++ b/common/changes/@rushstack/heft-sass-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-sass-plugin" + } + ], + "packageName": "@rushstack/heft-sass-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-serverless-stack-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-serverless-stack-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..67e01f7bc76 --- /dev/null +++ b/common/changes/@rushstack/heft-serverless-stack-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-serverless-stack-plugin" + } + ], + "packageName": "@rushstack/heft-serverless-stack-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-storybook-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-storybook-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..aabe996c286 --- /dev/null +++ b/common/changes/@rushstack/heft-storybook-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-storybook-plugin" + } + ], + "packageName": "@rushstack/heft-storybook-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-typescript-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-typescript-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..c498fdc2c68 --- /dev/null +++ b/common/changes/@rushstack/heft-typescript-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-typescript-plugin" + } + ], + "packageName": "@rushstack/heft-typescript-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-vscode-extension-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-vscode-extension-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..4edfb969c35 --- /dev/null +++ b/common/changes/@rushstack/heft-vscode-extension-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-vscode-extension-plugin" + } + ], + "packageName": "@rushstack/heft-vscode-extension-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-vscode-extension-rig/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-vscode-extension-rig/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..3f5bc04a5e2 --- /dev/null +++ b/common/changes/@rushstack/heft-vscode-extension-rig/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Add `sideEffects` field to package.json.", + "type": "patch", + "packageName": "@rushstack/heft-vscode-extension-rig" + } + ], + "packageName": "@rushstack/heft-vscode-extension-rig", + "email": "iclanton@users.noreply.github.com" +} diff --git a/common/changes/@rushstack/heft-web-rig/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-web-rig/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..557f0364f04 --- /dev/null +++ b/common/changes/@rushstack/heft-web-rig/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "", + "type": "none", + "packageName": "@rushstack/heft-web-rig" + } + ], + "packageName": "@rushstack/heft-web-rig", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-webpack4-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-webpack4-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..29732a160ec --- /dev/null +++ b/common/changes/@rushstack/heft-webpack4-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-webpack4-plugin" + } + ], + "packageName": "@rushstack/heft-webpack4-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-webpack5-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft-webpack5-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..30f4b425089 --- /dev/null +++ b/common/changes/@rushstack/heft-webpack5-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft-webpack5-plugin" + } + ], + "packageName": "@rushstack/heft-webpack5-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/heft/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..c8a7a3f1ecc --- /dev/null +++ b/common/changes/@rushstack/heft/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/heft" + } + ], + "packageName": "@rushstack/heft", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/loader-raw-script/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/loader-raw-script/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..e36284f9aae --- /dev/null +++ b/common/changes/@rushstack/loader-raw-script/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/loader-raw-script" + } + ], + "packageName": "@rushstack/loader-raw-script", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/localization-utilities/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/localization-utilities/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..589e79c7da4 --- /dev/null +++ b/common/changes/@rushstack/localization-utilities/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/localization-utilities" + } + ], + "packageName": "@rushstack/localization-utilities", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/lockfile-explorer/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/lockfile-explorer/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..29f2362a245 --- /dev/null +++ b/common/changes/@rushstack/lockfile-explorer/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/lockfile-explorer" + } + ], + "packageName": "@rushstack/lockfile-explorer", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/lookup-by-path/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/lookup-by-path/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..bc2caf59cd8 --- /dev/null +++ b/common/changes/@rushstack/lookup-by-path/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/lookup-by-path" + } + ], + "packageName": "@rushstack/lookup-by-path", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/mcp-server/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/mcp-server/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..0568b49893a --- /dev/null +++ b/common/changes/@rushstack/mcp-server/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/mcp-server" + } + ], + "packageName": "@rushstack/mcp-server", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/module-minifier/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/module-minifier/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..f601edf12b3 --- /dev/null +++ b/common/changes/@rushstack/module-minifier/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/module-minifier" + } + ], + "packageName": "@rushstack/module-minifier", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/node-core-library/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/node-core-library/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..e40edad2b9b --- /dev/null +++ b/common/changes/@rushstack/node-core-library/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/node-core-library" + } + ], + "packageName": "@rushstack/node-core-library", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/npm-check-fork/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/npm-check-fork/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..27dce54b5cc --- /dev/null +++ b/common/changes/@rushstack/npm-check-fork/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/npm-check-fork" + } + ], + "packageName": "@rushstack/npm-check-fork", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/operation-graph/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/operation-graph/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ed8817c65c9 --- /dev/null +++ b/common/changes/@rushstack/operation-graph/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/operation-graph" + } + ], + "packageName": "@rushstack/operation-graph", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/package-deps-hash/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/package-deps-hash/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..d4a4db906dc --- /dev/null +++ b/common/changes/@rushstack/package-deps-hash/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/package-deps-hash" + } + ], + "packageName": "@rushstack/package-deps-hash", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/package-extractor/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/package-extractor/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..a48111e08af --- /dev/null +++ b/common/changes/@rushstack/package-extractor/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/package-extractor" + } + ], + "packageName": "@rushstack/package-extractor", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/playwright-browser-tunnel/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/playwright-browser-tunnel/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ed9d3051a3f --- /dev/null +++ b/common/changes/@rushstack/playwright-browser-tunnel/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/playwright-browser-tunnel" + } + ], + "packageName": "@rushstack/playwright-browser-tunnel", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/problem-matcher/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/problem-matcher/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..9bf0538a93d --- /dev/null +++ b/common/changes/@rushstack/problem-matcher/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/problem-matcher" + } + ], + "packageName": "@rushstack/problem-matcher", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rig-package/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rig-package/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..eadc3e18fd6 --- /dev/null +++ b/common/changes/@rushstack/rig-package/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rig-package" + } + ], + "packageName": "@rushstack/rig-package", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rundown/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rundown/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..abe21c614c5 --- /dev/null +++ b/common/changes/@rushstack/rundown/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rundown" + } + ], + "packageName": "@rushstack/rundown", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rush-mcp-docs-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rush-mcp-docs-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..6f945b5c344 --- /dev/null +++ b/common/changes/@rushstack/rush-mcp-docs-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rush-mcp-docs-plugin" + } + ], + "packageName": "@rushstack/rush-mcp-docs-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rush-pnpm-kit-v10/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rush-pnpm-kit-v10/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ef8c9f65fa0 --- /dev/null +++ b/common/changes/@rushstack/rush-pnpm-kit-v10/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rush-pnpm-kit-v10" + } + ], + "packageName": "@rushstack/rush-pnpm-kit-v10", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rush-pnpm-kit-v8/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rush-pnpm-kit-v8/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..2f1ae105fd2 --- /dev/null +++ b/common/changes/@rushstack/rush-pnpm-kit-v8/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rush-pnpm-kit-v8" + } + ], + "packageName": "@rushstack/rush-pnpm-kit-v8", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rush-pnpm-kit-v9/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/rush-pnpm-kit-v9/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..96f6cc6ff86 --- /dev/null +++ b/common/changes/@rushstack/rush-pnpm-kit-v9/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/rush-pnpm-kit-v9" + } + ], + "packageName": "@rushstack/rush-pnpm-kit-v9", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/set-webpack-public-path-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/set-webpack-public-path-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..3d54ffa9c1b --- /dev/null +++ b/common/changes/@rushstack/set-webpack-public-path-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/set-webpack-public-path-plugin" + } + ], + "packageName": "@rushstack/set-webpack-public-path-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/stream-collator/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/stream-collator/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..5aa474c9866 --- /dev/null +++ b/common/changes/@rushstack/stream-collator/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/stream-collator" + } + ], + "packageName": "@rushstack/stream-collator", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/terminal/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/terminal/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..094c649f966 --- /dev/null +++ b/common/changes/@rushstack/terminal/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/terminal" + } + ], + "packageName": "@rushstack/terminal", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/trace-import/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/trace-import/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..cd9282f71dd --- /dev/null +++ b/common/changes/@rushstack/trace-import/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/trace-import" + } + ], + "packageName": "@rushstack/trace-import", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/tree-pattern/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/tree-pattern/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ce147b4f180 --- /dev/null +++ b/common/changes/@rushstack/tree-pattern/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/tree-pattern" + } + ], + "packageName": "@rushstack/tree-pattern", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/ts-command-line/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/ts-command-line/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..1040e479f39 --- /dev/null +++ b/common/changes/@rushstack/ts-command-line/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/ts-command-line" + } + ], + "packageName": "@rushstack/ts-command-line", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/typings-generator/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/typings-generator/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ed4e6e00ff5 --- /dev/null +++ b/common/changes/@rushstack/typings-generator/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/typings-generator" + } + ], + "packageName": "@rushstack/typings-generator", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack-embedded-dependencies-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack-embedded-dependencies-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..938285e6405 --- /dev/null +++ b/common/changes/@rushstack/webpack-embedded-dependencies-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack-embedded-dependencies-plugin" + } + ], + "packageName": "@rushstack/webpack-embedded-dependencies-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack-plugin-utilities/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack-plugin-utilities/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..668c236b308 --- /dev/null +++ b/common/changes/@rushstack/webpack-plugin-utilities/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack-plugin-utilities" + } + ], + "packageName": "@rushstack/webpack-plugin-utilities", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack-preserve-dynamic-require-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack-preserve-dynamic-require-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..9fe8d030ef4 --- /dev/null +++ b/common/changes/@rushstack/webpack-preserve-dynamic-require-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack-preserve-dynamic-require-plugin" + } + ], + "packageName": "@rushstack/webpack-preserve-dynamic-require-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack-workspace-resolve-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack-workspace-resolve-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..e53deae0e09 --- /dev/null +++ b/common/changes/@rushstack/webpack-workspace-resolve-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack-workspace-resolve-plugin" + } + ], + "packageName": "@rushstack/webpack-workspace-resolve-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack4-localization-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack4-localization-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..0c84d0c4f25 --- /dev/null +++ b/common/changes/@rushstack/webpack4-localization-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack4-localization-plugin" + } + ], + "packageName": "@rushstack/webpack4-localization-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack4-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack4-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..15aa12e4530 --- /dev/null +++ b/common/changes/@rushstack/webpack4-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack4-module-minifier-plugin" + } + ], + "packageName": "@rushstack/webpack4-module-minifier-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack5-localization-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack5-localization-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..e1f99e4c64b --- /dev/null +++ b/common/changes/@rushstack/webpack5-localization-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack5-localization-plugin" + } + ], + "packageName": "@rushstack/webpack5-localization-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack5-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/webpack5-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..36ff29bb429 --- /dev/null +++ b/common/changes/@rushstack/webpack5-module-minifier-plugin/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/webpack5-module-minifier-plugin" + } + ], + "packageName": "@rushstack/webpack5-module-minifier-plugin", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/worker-pool/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/worker-pool/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..6d0655119eb --- /dev/null +++ b/common/changes/@rushstack/worker-pool/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/worker-pool" + } + ], + "packageName": "@rushstack/worker-pool", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@rushstack/zipsync/normalize-build-output_2026-02-17-18-56.json b/common/changes/@rushstack/zipsync/normalize-build-output_2026-02-17-18-56.json new file mode 100644 index 00000000000..ebe1391dda7 --- /dev/null +++ b/common/changes/@rushstack/zipsync/normalize-build-output_2026-02-17-18-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`.", + "type": "minor", + "packageName": "@rushstack/zipsync" + } + ], + "packageName": "@rushstack/zipsync", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/config/azure-pipelines/vscode-extension-publish.yaml b/common/config/azure-pipelines/vscode-extension-publish.yaml index d9dedb8cc22..0c23c46d4ef 100644 --- a/common/config/azure-pipelines/vscode-extension-publish.yaml +++ b/common/config/azure-pipelines/vscode-extension-publish.yaml @@ -102,7 +102,7 @@ extends: } ] - - bash: node node_modules/@rushstack/heft/lib/start.js verify-signature --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --manifest-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.manifestPath }} --signature-path ${{ extension.projectRelativeAssetsDir }}/extension.signature.p7s + - bash: node node_modules/@rushstack/heft/lib-commonjs/start.js verify-signature --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --manifest-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.manifestPath }} --signature-path ${{ extension.projectRelativeAssetsDir }}/extension.signature.p7s displayName: 'Verify Signature: ${{ extension.key }}' workingDirectory: ${{ extension.projectPath }} @@ -114,6 +114,6 @@ extends: scriptLocation: 'inlineScript' workingDirectory: ${{ extension.projectPath }} ${{ if parameters.publishUnsigned }}: - inlineScript: node node_modules/@rushstack/heft/lib/start.js publish-vsix --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --publish-unsigned + inlineScript: node node_modules/@rushstack/heft/lib-commonjs/start.js publish-vsix --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --publish-unsigned ${{ else }}: - inlineScript: node node_modules/@rushstack/heft/lib/start.js publish-vsix --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --manifest-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.manifestPath }} --signature-path ${{ extension.projectRelativeAssetsDir }}/extension.signature.p7s + inlineScript: node node_modules/@rushstack/heft/lib-commonjs/start.js publish-vsix --vsix-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.vsixPath }} --manifest-path ${{ extension.projectRelativeAssetsDir }}/${{ extension.manifestPath }} --signature-path ${{ extension.projectRelativeAssetsDir }}/extension.signature.p7s diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index 46eaa2cddb9..283a7f4adc0 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -3531,15 +3531,12 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft - '@rushstack/heft-node-rig': - specifier: workspace:* - version: link:../../rigs/heft-node-rig - '@types/node': - specifier: 20.17.19 - version: 20.17.19 eslint: specifier: ~9.37.0 version: 9.37.0 + local-node-rig: + specifier: workspace:* + version: link:../../rigs/local-node-rig ../../../heft-plugins/heft-webpack4-plugin: dependencies: diff --git a/eslint/eslint-bulk/bin/eslint-bulk b/eslint/eslint-bulk/bin/eslint-bulk index aee68e80224..eef2fc27066 100755 --- a/eslint/eslint-bulk/bin/eslint-bulk +++ b/eslint/eslint-bulk/bin/eslint-bulk @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/start.js'); +require('../lib-commonjs/start.js'); diff --git a/eslint/eslint-bulk/package.json b/eslint/eslint-bulk/package.json index 6e22e408f65..1b31724457a 100755 --- a/eslint/eslint-bulk/package.json +++ b/eslint/eslint-bulk/package.json @@ -2,7 +2,21 @@ "name": "@rushstack/eslint-bulk", "version": "0.4.15", "description": "Roll out new ESLint rules in a large monorepo without cluttering up your code with \"eslint-ignore-next-line\"", - "main": "index.js", + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -16,7 +30,7 @@ "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", - "start": "node ./lib/start.js" + "start": "node ./lib-commonjs/start.js" }, "keywords": [ "eslintrc", @@ -36,5 +50,9 @@ "@types/node": "20.17.19", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": [ + "lib-commonjs/start.js", + "lib-esm/start.js" + ] } diff --git a/eslint/eslint-config/package.json b/eslint/eslint-config/package.json index 1b07e3584eb..f848c30878e 100644 --- a/eslint/eslint-config/package.json +++ b/eslint/eslint-config/package.json @@ -42,5 +42,6 @@ "devDependencies": { "eslint": "~9.37.0", "typescript": "~5.8.2" - } + }, + "sideEffects": false } diff --git a/eslint/eslint-patch/custom-config-package-names.js b/eslint/eslint-patch/custom-config-package-names.js deleted file mode 100644 index 8897e869792..00000000000 --- a/eslint/eslint-patch/custom-config-package-names.js +++ /dev/null @@ -1 +0,0 @@ -require('./lib/custom-config-package-names'); diff --git a/eslint/eslint-patch/eslint-bulk-suppressions.js b/eslint/eslint-patch/eslint-bulk-suppressions.js deleted file mode 100644 index b1236d4e449..00000000000 --- a/eslint/eslint-patch/eslint-bulk-suppressions.js +++ /dev/null @@ -1 +0,0 @@ -require('./lib/eslint-bulk-suppressions'); diff --git a/eslint/eslint-patch/modern-module-resolution.js b/eslint/eslint-patch/modern-module-resolution.js deleted file mode 100644 index 921317824f4..00000000000 --- a/eslint/eslint-patch/modern-module-resolution.js +++ /dev/null @@ -1 +0,0 @@ -require('./lib/modern-module-resolution'); diff --git a/eslint/eslint-patch/package.json b/eslint/eslint-patch/package.json index 2b2428efe66..3b72100ccd8 100644 --- a/eslint/eslint-patch/package.json +++ b/eslint/eslint-patch/package.json @@ -2,7 +2,39 @@ "name": "@rushstack/eslint-patch", "version": "1.15.0", "description": "Enhance ESLint with better support for large scale monorepos", - "main": "lib/usage.js", + "main": "./lib-commonjs/usage.js", + "module": "./lib-esm/usage.js", + "exports": { + ".": { + "import": "./lib-esm/usage.js", + "require": "./lib-commonjs/usage.js" + }, + "./modern-module-resolution": { + "import": "./lib-esm/modern-module-resolution.js", + "require": "./lib-commonjs/modern-module-resolution.js" + }, + "./custom-config-package-names": { + "import": "./lib-esm/custom-config-package-names.js", + "require": "./lib-commonjs/custom-config-package-names.js" + }, + "./eslint-bulk-suppressions": { + "import": "./lib-esm/eslint-bulk-suppressions/index.js", + "require": "./lib-commonjs/eslint-bulk-suppressions/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -39,5 +71,13 @@ "eslint-9": "npm:eslint@~9.25.1", "eslint": "~9.37.0", "typescript": "~5.8.2" - } + }, + "sideEffects": [ + "lib-esm/modern-module-resolution.js", + "lib-esm/custom-config-package-names.js", + "lib-esm/eslint-bulk-suppressions/index.js", + "lib-commonjs/modern-module-resolution.js", + "lib-commonjs/custom-config-package-names.js", + "lib-commonjs/eslint-bulk-suppressions/index.js" + ] } diff --git a/eslint/eslint-plugin-packlets/package.json b/eslint/eslint-plugin-packlets/package.json index 61e19408a8c..a37aebc372c 100644 --- a/eslint/eslint-plugin-packlets/package.json +++ b/eslint/eslint-plugin-packlets/package.json @@ -15,8 +15,29 @@ "packlets", "rules" ], - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -35,5 +56,6 @@ "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0", "typescript": "~5.8.2" - } + }, + "sideEffects": false } diff --git a/eslint/eslint-plugin-security/package.json b/eslint/eslint-plugin-security/package.json index 2bf5f3da83f..c03825030e1 100644 --- a/eslint/eslint-plugin-security/package.json +++ b/eslint/eslint-plugin-security/package.json @@ -14,8 +14,29 @@ "eslint-config", "security" ], - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -36,5 +57,6 @@ "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0", "typescript": "~5.8.2" - } + }, + "sideEffects": false } diff --git a/eslint/eslint-plugin/package.json b/eslint/eslint-plugin/package.json index fa87538dc6e..19043ef0fb7 100644 --- a/eslint/eslint-plugin/package.json +++ b/eslint/eslint-plugin/package.json @@ -18,8 +18,29 @@ "scale", "typescript" ], - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -40,5 +61,6 @@ "eslint": "~9.37.0", "typescript": "~5.8.2", "@typescript-eslint/types": "~8.46.0" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-api-extractor-plugin/heft-plugin.json b/heft-plugins/heft-api-extractor-plugin/heft-plugin.json index 6ee3f11034f..54a11f5ea15 100644 --- a/heft-plugins/heft-api-extractor-plugin/heft-plugin.json +++ b/heft-plugins/heft-api-extractor-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "api-extractor-plugin", - "entryPoint": "./lib/ApiExtractorPlugin" + "entryPoint": "./lib-commonjs/ApiExtractorPlugin" } ] } diff --git a/heft-plugins/heft-api-extractor-plugin/package.json b/heft-plugins/heft-api-extractor-plugin/package.json index e11e07978e0..0e9321d06ad 100644 --- a/heft-plugins/heft-api-extractor-plugin/package.json +++ b/heft-plugins/heft-api-extractor-plugin/package.json @@ -28,5 +28,23 @@ "@types/semver": "7.5.0", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-dev-cert-plugin/heft-plugin.json b/heft-plugins/heft-dev-cert-plugin/heft-plugin.json index 41e46022fcb..c8e7e137a5d 100644 --- a/heft-plugins/heft-dev-cert-plugin/heft-plugin.json +++ b/heft-plugins/heft-dev-cert-plugin/heft-plugin.json @@ -6,11 +6,11 @@ "taskPlugins": [ { "pluginName": "trust-dev-certificate-plugin", - "entryPoint": "./lib/TrustDevCertificatePlugin" + "entryPoint": "./lib-commonjs/TrustDevCertificatePlugin" }, { "pluginName": "untrust-dev-certificate-plugin", - "entryPoint": "./lib/UntrustDevCertificatePlugin" + "entryPoint": "./lib-commonjs/UntrustDevCertificatePlugin" } ] } diff --git a/heft-plugins/heft-dev-cert-plugin/package.json b/heft-plugins/heft-dev-cert-plugin/package.json index 7a87e2bb950..afd7cbc97da 100644 --- a/heft-plugins/heft-dev-cert-plugin/package.json +++ b/heft-plugins/heft-dev-cert-plugin/package.json @@ -26,5 +26,22 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-isolated-typescript-transpile-plugin/config/api-extractor.json b/heft-plugins/heft-isolated-typescript-transpile-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/config/api-extractor.json +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/heft-plugins/heft-isolated-typescript-transpile-plugin/heft-plugin.json b/heft-plugins/heft-isolated-typescript-transpile-plugin/heft-plugin.json index 87563eea79e..e94bf9c0815 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/heft-plugin.json +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "swc-isolated-transpile-plugin", - "entryPoint": "./lib/SwcIsolatedTranspilePlugin", - "optionsSchema": "./lib/schemas/swc-isolated-transpile-plugin.schema.json" + "entryPoint": "./lib-commonjs/SwcIsolatedTranspilePlugin", + "optionsSchema": "./lib-commonjs/schemas/swc-isolated-transpile-plugin.schema.json" } ] } diff --git a/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json b/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json index 1e956dfaa44..a28ed68154d 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json @@ -9,8 +9,31 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", - "main": "lib/index.js", - "types": "dist/heft-isolated-typescript-transpile-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft-isolated-typescript-transpile-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/heft-isolated-typescript-transpile-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", @@ -33,5 +56,6 @@ "@swc/core": "1.7.10", "@types/tapable": "1.0.6", "tapable": "1.1.3" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-jest-plugin/heft-plugin.json b/heft-plugins/heft-jest-plugin/heft-plugin.json index c43c7a81092..52c65540566 100644 --- a/heft-plugins/heft-jest-plugin/heft-plugin.json +++ b/heft-plugins/heft-jest-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "jest-plugin", - "entryPoint": "./lib/JestPlugin", - "optionsSchema": "./lib/schemas/heft-jest-plugin.schema.json", + "entryPoint": "./lib-commonjs/JestPlugin", + "optionsSchema": "./lib-commonjs/schemas/heft-jest-plugin.schema.json", "parameterScope": "jest", "parameters": [ diff --git a/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json b/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json index 766c8c5608e..68347ee0322 100644 --- a/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json +++ b/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json @@ -53,7 +53,7 @@ "printBasicPrototype": true }, - "snapshotResolver": "../lib/exports/jest-source-map-snapshot-resolver.js", + "snapshotResolver": "../lib-commonjs/exports/jest-source-map-snapshot-resolver.js", // Instruct jest not to run the transformer pipeline by default on JS files. The output files from TypeScript // will already be fully transformed, so this avoids redundant file system operations. @@ -63,9 +63,9 @@ // jest-string-mock-transform returns the filename, relative to the current working directory, where Webpack would return a URL // When using the heft-jest-plugin, these will be replaced with the resolved module location "transform": { - "\\.(css|sass|scss)$": "../lib/exports/jest-identity-mock-transform.js", + "\\.(css|sass|scss)$": "../lib-commonjs/exports/jest-identity-mock-transform.js", - "\\.(aac|eot|gif|jpeg|jpg|m4a|mp3|mp4|oga|otf|png|svg|ttf|wav|webm|webp|woff|woff2)$": "../lib/exports/jest-string-mock-transform.js" + "\\.(aac|eot|gif|jpeg|jpg|m4a|mp3|mp4|oga|otf|png|svg|ttf|wav|webm|webp|woff|woff2)$": "../lib-commonjs/exports/jest-string-mock-transform.js" }, // The modulePathIgnorePatterns below accepts these sorts of paths: @@ -78,8 +78,8 @@ "moduleFileExtensions": ["cjs", "js", "json", "node"], // When using the heft-jest-plugin, these will be replaced with the resolved module location - "setupFiles": ["../lib/exports/jest-global-setup.js"], + "setupFiles": ["../lib-commonjs/exports/jest-global-setup.js"], // When using the heft-jest-plugin, these will be replaced with the resolved module location - "resolver": "../lib/exports/jest-improved-resolver.js" + "resolver": "../lib-commonjs/exports/jest-improved-resolver.js" } diff --git a/heft-plugins/heft-jest-plugin/package.json b/heft-plugins/heft-jest-plugin/package.json index 34bffd4e4a7..c1327b5d34e 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -51,5 +51,23 @@ "jest-environment-jsdom": "~29.5.0", "jest-environment-node": "~29.5.0", "jest-watch-select-projects": "2.0.0" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts b/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts index 1ef210d665e..304ebad9922 100644 --- a/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts +++ b/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts @@ -75,9 +75,9 @@ describe('JestConfigLoader', () => { }); it('resolves extended config modules', async () => { - // Because we require the built modules, we need to set our rootDir to be in the 'lib' folder, since transpilation + // Because we require the built modules, we need to set our rootDir to be in the 'lib-commonjs' folder, since transpilation // means that we don't run on the built test assets directly - const rootDir: string = path.resolve(__dirname, '..', '..', 'lib', 'test', 'project1'); + const rootDir: string = path.resolve(__dirname, '..', '..', 'lib-commonjs', 'test', 'project1'); const loader: ProjectConfigurationFile = JestPlugin._getJestConfigurationLoader( rootDir, 'config/jest.config.json' @@ -162,9 +162,9 @@ describe('JestConfigLoader', () => { }); it('resolves extended package modules', async () => { - // Because we require the built modules, we need to set our rootDir to be in the 'lib' folder, since transpilation + // Because we require the built modules, we need to set our rootDir to be in the 'lib-commonjs' folder, since transpilation // means that we don't run on the built test assets directly - const rootDir: string = path.resolve(__dirname, '..', '..', 'lib', 'test', 'project2'); + const rootDir: string = path.resolve(__dirname, '..', '..', 'lib-commonjs', 'test', 'project2'); const loader: ProjectConfigurationFile = JestPlugin._getJestConfigurationLoader( rootDir, 'config/jest.config.json' @@ -189,9 +189,9 @@ describe('JestConfigLoader', () => { }); it('replaces jest-environment-jsdom with the patched version', async () => { - // Because we require the built modules, we need to set our rootDir to be in the 'lib' folder, since transpilation + // Because we require the built modules, we need to set our rootDir to be in the 'lib-commonjs' folder, since transpilation // means that we don't run on the built test assets directly - const rootDir: string = path.resolve(__dirname, '..', '..', 'lib', 'test', 'project3'); + const rootDir: string = path.resolve(__dirname, '..', '..', 'lib-commonjs', 'test', 'project3'); const loader: ProjectConfigurationFile = JestPlugin._getJestConfigurationLoader( rootDir, 'config/jest.config.json' diff --git a/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json b/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json index f9db17a5dbd..9d40b9828d2 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json +++ b/heft-plugins/heft-json-schema-typings-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "json-schema-typings-plugin", - "entryPoint": "./lib/JsonSchemaTypingsPlugin", - "optionsSchema": "./lib/schemas/heft-json-schema-typings-plugin.schema.json" + "entryPoint": "./lib-commonjs/JsonSchemaTypingsPlugin", + "optionsSchema": "./lib-commonjs/schemas/heft-json-schema-typings-plugin.schema.json" } ] } diff --git a/heft-plugins/heft-json-schema-typings-plugin/package.json b/heft-plugins/heft-json-schema-typings-plugin/package.json index 2a555c3fb77..e64b0ede4dd 100644 --- a/heft-plugins/heft-json-schema-typings-plugin/package.json +++ b/heft-plugins/heft-json-schema-typings-plugin/package.json @@ -27,5 +27,23 @@ "@rushstack/terminal": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-lint-plugin/heft-plugin.json b/heft-plugins/heft-lint-plugin/heft-plugin.json index 1de6fef351a..13c0b3f3656 100644 --- a/heft-plugins/heft-lint-plugin/heft-plugin.json +++ b/heft-plugins/heft-lint-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "lint-plugin", - "entryPoint": "./lib/LintPlugin", - "optionsSchema": "./lib/schemas/heft-lint-plugin.schema.json", + "entryPoint": "./lib-commonjs/LintPlugin", + "optionsSchema": "./lib-commonjs/schemas/heft-lint-plugin.schema.json", "parameterScope": "lint", "parameters": [ diff --git a/heft-plugins/heft-lint-plugin/package.json b/heft-plugins/heft-lint-plugin/package.json index 5b0b61e2754..1d6c0ec7579 100644 --- a/heft-plugins/heft-lint-plugin/package.json +++ b/heft-plugins/heft-lint-plugin/package.json @@ -36,5 +36,23 @@ "eslint-8": "npm:eslint@~8.57.0", "typescript": "~5.8.2", "tslint": "~5.20.1" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-localization-typings-plugin/heft-plugin.json b/heft-plugins/heft-localization-typings-plugin/heft-plugin.json index 3d1d82ac7f3..cae29929771 100644 --- a/heft-plugins/heft-localization-typings-plugin/heft-plugin.json +++ b/heft-plugins/heft-localization-typings-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "localization-typings-plugin", - "entryPoint": "./lib/LocalizationTypingsPlugin", - "optionsSchema": "./lib/schemas/heft-localization-typings-plugin.schema.json" + "entryPoint": "./lib-commonjs/LocalizationTypingsPlugin", + "optionsSchema": "./lib-commonjs/schemas/heft-localization-typings-plugin.schema.json" } ] } diff --git a/heft-plugins/heft-localization-typings-plugin/package.json b/heft-plugins/heft-localization-typings-plugin/package.json index 2085a36f6c2..a8bf297080c 100644 --- a/heft-plugins/heft-localization-typings-plugin/package.json +++ b/heft-plugins/heft-localization-typings-plugin/package.json @@ -25,5 +25,23 @@ }, "dependencies": { "@rushstack/localization-utilities": "workspace:*" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-rspack-plugin/config/api-extractor.json b/heft-plugins/heft-rspack-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/heft-plugins/heft-rspack-plugin/config/api-extractor.json +++ b/heft-plugins/heft-rspack-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/heft-plugins/heft-rspack-plugin/heft-plugin.json b/heft-plugins/heft-rspack-plugin/heft-plugin.json index a8ce14984a6..cec21c0dfc3 100644 --- a/heft-plugins/heft-rspack-plugin/heft-plugin.json +++ b/heft-plugins/heft-rspack-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "rspack-plugin", - "entryPoint": "./lib/RspackPlugin", - "optionsSchema": "./lib/schemas/heft-rspack-plugin.schema.json", + "entryPoint": "./lib-commonjs/RspackPlugin", + "optionsSchema": "./lib-commonjs/schemas/heft-rspack-plugin.schema.json", "parameterScope": "rspack", "parameters": [ diff --git a/heft-plugins/heft-rspack-plugin/package.json b/heft-plugins/heft-rspack-plugin/package.json index 710ffd51882..d71269bd557 100644 --- a/heft-plugins/heft-rspack-plugin/package.json +++ b/heft-plugins/heft-rspack-plugin/package.json @@ -8,8 +8,31 @@ "directory": "heft-plugins/heft-rspack-plugin" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "dist/heft-rspack-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft-rspack-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/heft-rspack-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -36,5 +59,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "@rspack/core": "~1.6.0-beta.0" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-sass-load-themed-styles-plugin/heft-plugin.json b/heft-plugins/heft-sass-load-themed-styles-plugin/heft-plugin.json index ef11936b177..ad7de05949d 100644 --- a/heft-plugins/heft-sass-load-themed-styles-plugin/heft-plugin.json +++ b/heft-plugins/heft-sass-load-themed-styles-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "sass-load-themed-styles-plugin", - "entryPoint": "./lib/SassLoadThemedStylesPlugin.js" + "entryPoint": "./lib-commonjs/SassLoadThemedStylesPlugin.js" } ] } diff --git a/heft-plugins/heft-sass-load-themed-styles-plugin/package.json b/heft-plugins/heft-sass-load-themed-styles-plugin/package.json index cdd1829114c..2e9bbf19864 100644 --- a/heft-plugins/heft-sass-load-themed-styles-plugin/package.json +++ b/heft-plugins/heft-sass-load-themed-styles-plugin/package.json @@ -26,5 +26,22 @@ "@rushstack/heft-sass-plugin": "workspace:*", "local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-sass-plugin/heft-plugin.json b/heft-plugins/heft-sass-plugin/heft-plugin.json index ab4d21de8f6..f077231c0d2 100644 --- a/heft-plugins/heft-sass-plugin/heft-plugin.json +++ b/heft-plugins/heft-sass-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "sass-plugin", - "entryPoint": "./lib/SassPlugin.js" + "entryPoint": "./lib-commonjs/SassPlugin.js" } ] } diff --git a/heft-plugins/heft-sass-plugin/package.json b/heft-plugins/heft-sass-plugin/package.json index 6b5685b48f2..d105f8f334b 100644 --- a/heft-plugins/heft-sass-plugin/package.json +++ b/heft-plugins/heft-sass-plugin/package.json @@ -15,8 +15,31 @@ "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean" }, - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "peerDependencies": { "@rushstack/heft": "^1.1.14" }, @@ -33,5 +56,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-serverless-stack-plugin/heft-plugin.json b/heft-plugins/heft-serverless-stack-plugin/heft-plugin.json index 7b3beee1a00..ff9ecc11ae8 100644 --- a/heft-plugins/heft-serverless-stack-plugin/heft-plugin.json +++ b/heft-plugins/heft-serverless-stack-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "serverless-stack-plugin", - "entryPoint": "./lib/ServerlessStackPlugin", + "entryPoint": "./lib-commonjs/ServerlessStackPlugin", "parameterScope": "serverless-stack", "parameters": [ diff --git a/heft-plugins/heft-serverless-stack-plugin/package.json b/heft-plugins/heft-serverless-stack-plugin/package.json index 9e6841116e8..43e25ae82af 100644 --- a/heft-plugins/heft-serverless-stack-plugin/package.json +++ b/heft-plugins/heft-serverless-stack-plugin/package.json @@ -26,5 +26,22 @@ "@rushstack/heft-webpack5-plugin": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-storybook-plugin/heft-plugin.json b/heft-plugins/heft-storybook-plugin/heft-plugin.json index c961ec466f9..107eca91df2 100644 --- a/heft-plugins/heft-storybook-plugin/heft-plugin.json +++ b/heft-plugins/heft-storybook-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "storybook-plugin", - "entryPoint": "./lib/StorybookPlugin", - "optionsSchema": "./lib/schemas/storybook.schema.json", + "entryPoint": "./lib-commonjs/StorybookPlugin", + "optionsSchema": "./lib-commonjs/schemas/storybook.schema.json", "parameterScope": "storybook", "parameters": [ diff --git a/heft-plugins/heft-storybook-plugin/package.json b/heft-plugins/heft-storybook-plugin/package.json index e4822640add..db4f9a8c6a7 100644 --- a/heft-plugins/heft-storybook-plugin/package.json +++ b/heft-plugins/heft-storybook-plugin/package.json @@ -29,5 +29,23 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "@rushstack/heft-rspack-plugin": "workspace:*" - } + }, + "exports": { + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-typescript-plugin/config/api-extractor.json b/heft-plugins/heft-typescript-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/heft-plugins/heft-typescript-plugin/config/api-extractor.json +++ b/heft-plugins/heft-typescript-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/heft-plugins/heft-typescript-plugin/heft-plugin.json b/heft-plugins/heft-typescript-plugin/heft-plugin.json index 8b0bdcbe4a6..f4603ba1068 100644 --- a/heft-plugins/heft-typescript-plugin/heft-plugin.json +++ b/heft-plugins/heft-typescript-plugin/heft-plugin.json @@ -4,7 +4,7 @@ "taskPlugins": [ { "pluginName": "typescript-plugin", - "entryPoint": "./lib/TypeScriptPlugin" + "entryPoint": "./lib-commonjs/TypeScriptPlugin" } ] } diff --git a/heft-plugins/heft-typescript-plugin/package.json b/heft-plugins/heft-typescript-plugin/package.json index 5a073a9e909..ebe51676dab 100644 --- a/heft-plugins/heft-typescript-plugin/package.json +++ b/heft-plugins/heft-typescript-plugin/package.json @@ -8,8 +8,31 @@ "directory": "heft-plugins/heft-typescript-plugin" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "dist/heft-typescript-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft-typescript-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/heft-typescript-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft test --clean", @@ -33,5 +56,6 @@ "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0", "typescript": "~5.8.2" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-vscode-extension-plugin/.npmignore b/heft-plugins/heft-vscode-extension-plugin/.npmignore index 65edae3d51a..bc349f9a4be 100644 --- a/heft-plugins/heft-vscode-extension-plugin/.npmignore +++ b/heft-plugins/heft-vscode-extension-plugin/.npmignore @@ -1,28 +1,32 @@ -# Ignore everything by default -** +# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO. -# Use negative patterns to bring back the specific things we want to publish +# Ignore all files by default, to avoid accidentally publishing unintended files. +* + +# Use negative patterns to bring back the specific things we want to publish. !/bin/** !/lib/** +!/lib-*/** !/dist/** + +!CHANGELOG.md +!CHANGELOG.json +!heft-plugin.json +!rush-plugin-manifest.json !ThirdPartyNotice.txt -!/EULA/** -# Ignore certain files in the above folder +# Ignore certain patterns that should not get published. /dist/*.stats.* -/lib/**/test/** -/lib/**/*.js.map -/dist/**/*.js.map +/lib/**/test/ +/lib-*/**/test/ +*.test.js # NOTE: These don't need to be specified, because NPM includes them automatically. # # package.json -# README (and its variants) -# CHANGELOG (and its variants) -# LICENSE / LICENCE +# README.md +# LICENSE -## Project specific definitions -# ----------------------------- - -# (Add your exceptions here) -!heft-plugin.json +# --------------------------------------------------------------------------- +# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. +# --------------------------------------------------------------------------- diff --git a/heft-plugins/heft-vscode-extension-plugin/config/rig.json b/heft-plugins/heft-vscode-extension-plugin/config/rig.json index 6ac88a96368..165ffb001f5 100644 --- a/heft-plugins/heft-vscode-extension-plugin/config/rig.json +++ b/heft-plugins/heft-vscode-extension-plugin/config/rig.json @@ -3,5 +3,5 @@ // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@rushstack/heft-node-rig" + "rigPackageName": "local-node-rig" } diff --git a/heft-plugins/heft-vscode-extension-plugin/eslint.config.js b/heft-plugins/heft-vscode-extension-plugin/eslint.config.js index 006cb82d1c0..c15e6077310 100644 --- a/heft-plugins/heft-vscode-extension-plugin/eslint.config.js +++ b/heft-plugins/heft-vscode-extension-plugin/eslint.config.js @@ -1,7 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -const nodeTrustedToolProfile = require('@rushstack/heft-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool'); -const friendlyLocalsMixin = require('@rushstack/heft-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals'); +const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool'); +const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals'); -module.exports = [...nodeTrustedToolProfile, ...friendlyLocalsMixin]; +module.exports = [ + ...nodeTrustedToolProfile, + ...friendlyLocalsMixin, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parserOptions: { + tsconfigRootDir: __dirname + } + } + } +]; diff --git a/heft-plugins/heft-vscode-extension-plugin/heft-plugin.json b/heft-plugins/heft-vscode-extension-plugin/heft-plugin.json index 24bef905318..a4df3eb5b8b 100644 --- a/heft-plugins/heft-vscode-extension-plugin/heft-plugin.json +++ b/heft-plugins/heft-vscode-extension-plugin/heft-plugin.json @@ -3,12 +3,12 @@ "taskPlugins": [ { "pluginName": "vscode-extension-package-plugin", - "entryPoint": "./lib/VSCodeExtensionPackagePlugin.js", + "entryPoint": "./lib-commonjs/VSCodeExtensionPackagePlugin.js", "parameterScope": "package" }, { "pluginName": "vscode-extension-verify-signature-plugin", - "entryPoint": "./lib/VSCodeExtensionVerifySignaturePlugin.js", + "entryPoint": "./lib-commonjs/VSCodeExtensionVerifySignaturePlugin.js", "parameterScope": "verify-signature", "parameters": [ { @@ -36,7 +36,7 @@ }, { "pluginName": "vscode-extension-publish-plugin", - "entryPoint": "./lib/VSCodeExtensionPublishPlugin.js", + "entryPoint": "./lib-commonjs/VSCodeExtensionPublishPlugin.js", "parameterScope": "publish-vsix", "parameters": [ { diff --git a/heft-plugins/heft-vscode-extension-plugin/package.json b/heft-plugins/heft-vscode-extension-plugin/package.json index 159c94a41fd..8a662db3000 100644 --- a/heft-plugins/heft-vscode-extension-plugin/package.json +++ b/heft-plugins/heft-vscode-extension-plugin/package.json @@ -15,21 +15,34 @@ "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean" }, - "main": "lib/index.js", - "types": "lib/index.d.ts", + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "peerDependencies": { "@rushstack/heft": "^1.1.14" }, + "dependencies": { + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", + "@vscode/vsce": "3.2.1" + }, "devDependencies": { "@rushstack/heft": "workspace:*", - "@rushstack/heft-node-rig": "workspace:*", "eslint": "~9.37.0", - "@types/node": "20.17.19" - }, - "dependencies": { - "@rushstack/node-core-library": "workspace:*", - "@vscode/vsce": "3.2.1", - "@rushstack/terminal": "workspace:*" + "local-node-rig": "workspace:*" }, "sideEffects": false } diff --git a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPackagePlugin.ts b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPackagePlugin.ts index ada8af53bdc..3a1dd05eb9d 100644 --- a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPackagePlugin.ts +++ b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPackagePlugin.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as path from 'node:path'; + import type { HeftConfiguration, IHeftTaskPlugin, @@ -8,7 +10,7 @@ import type { IHeftTaskRunHookOptions } from '@rushstack/heft'; import type { IWaitForExitResult } from '@rushstack/node-core-library'; -import * as path from 'node:path'; + import { executeAndWaitAsync, vsceScriptPath } from './util'; interface IVSCodeExtensionPackagePluginOptions { diff --git a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPublishPlugin.ts b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPublishPlugin.ts index 9440e1f53fd..3f41f3cf0b6 100644 --- a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPublishPlugin.ts +++ b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionPublishPlugin.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as path from 'node:path'; + import type { HeftConfiguration, IHeftTaskPlugin, @@ -10,7 +12,7 @@ import type { CommandLineFlagParameter } from '@rushstack/heft'; import type { IWaitForExitResult } from '@rushstack/node-core-library'; -import * as path from 'node:path'; + import { executeAndWaitAsync, vsceScriptPath } from './util'; interface IVSCodeExtensionPublishPluginOptions {} diff --git a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionVerifySignaturePlugin.ts b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionVerifySignaturePlugin.ts index fda739f015b..1d462e2f64d 100644 --- a/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionVerifySignaturePlugin.ts +++ b/heft-plugins/heft-vscode-extension-plugin/src/VSCodeExtensionVerifySignaturePlugin.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as path from 'node:path'; + import type { HeftConfiguration, IHeftTaskPlugin, @@ -9,7 +11,7 @@ import type { CommandLineStringParameter } from '@rushstack/heft'; import type { IWaitForExitResult } from '@rushstack/node-core-library'; -import * as path from 'node:path'; + import { executeAndWaitAsync, vsceScriptPath } from './util'; interface IVSCodeExtensionVerifySignaturePluginOptions {} diff --git a/heft-plugins/heft-vscode-extension-plugin/src/util.ts b/heft-plugins/heft-vscode-extension-plugin/src/util.ts index 0772a2698a0..5c32a56c949 100644 --- a/heft-plugins/heft-vscode-extension-plugin/src/util.ts +++ b/heft-plugins/heft-vscode-extension-plugin/src/util.ts @@ -1,10 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Executable, IExecutableSpawnOptions, IWaitForExitResult } from '@rushstack/node-core-library'; import type { ChildProcess } from 'node:child_process'; import * as path from 'node:path'; -import { TerminalStreamWritable, TerminalProviderSeverity, ITerminal } from '@rushstack/terminal'; + +import { + Executable, + type IExecutableSpawnOptions, + type IWaitForExitResult +} from '@rushstack/node-core-library'; +import { TerminalStreamWritable, TerminalProviderSeverity, type ITerminal } from '@rushstack/terminal'; export async function executeAndWaitAsync( terminal: ITerminal, diff --git a/heft-plugins/heft-vscode-extension-plugin/tsconfig.json b/heft-plugins/heft-vscode-extension-plugin/tsconfig.json index 7f8cf47e02b..dac21d04081 100644 --- a/heft-plugins/heft-vscode-extension-plugin/tsconfig.json +++ b/heft-plugins/heft-vscode-extension-plugin/tsconfig.json @@ -1,4 +1,3 @@ { - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json" + "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/heft-plugins/heft-webpack4-plugin/config/api-extractor.json b/heft-plugins/heft-webpack4-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/heft-plugins/heft-webpack4-plugin/config/api-extractor.json +++ b/heft-plugins/heft-webpack4-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/heft-plugins/heft-webpack4-plugin/heft-plugin.json b/heft-plugins/heft-webpack4-plugin/heft-plugin.json index 34b6f65442d..32f5ce328d0 100644 --- a/heft-plugins/heft-webpack4-plugin/heft-plugin.json +++ b/heft-plugins/heft-webpack4-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "webpack4-plugin", - "entryPoint": "./lib/Webpack4Plugin", - "optionsSchema": "./lib/schemas/heft-webpack4-plugin.schema.json", + "entryPoint": "./lib-commonjs/Webpack4Plugin", + "optionsSchema": "./lib-commonjs/schemas/heft-webpack4-plugin.schema.json", "parameterScope": "webpack4", "parameters": [ diff --git a/heft-plugins/heft-webpack4-plugin/package.json b/heft-plugins/heft-webpack4-plugin/package.json index 0b9fa7e0369..1ff1a1afc4e 100644 --- a/heft-plugins/heft-webpack4-plugin/package.json +++ b/heft-plugins/heft-webpack4-plugin/package.json @@ -8,8 +8,31 @@ "directory": "heft-plugins/heft-webpack4-plugin" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -43,5 +66,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "webpack": "~4.47.0" - } + }, + "sideEffects": false } diff --git a/heft-plugins/heft-webpack5-plugin/config/api-extractor.json b/heft-plugins/heft-webpack5-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/heft-plugins/heft-webpack5-plugin/config/api-extractor.json +++ b/heft-plugins/heft-webpack5-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/heft-plugins/heft-webpack5-plugin/heft-plugin.json b/heft-plugins/heft-webpack5-plugin/heft-plugin.json index 191a30e7cc6..165299e71d3 100644 --- a/heft-plugins/heft-webpack5-plugin/heft-plugin.json +++ b/heft-plugins/heft-webpack5-plugin/heft-plugin.json @@ -4,8 +4,8 @@ "taskPlugins": [ { "pluginName": "webpack5-plugin", - "entryPoint": "./lib/Webpack5Plugin", - "optionsSchema": "./lib/schemas/heft-webpack5-plugin.schema.json", + "entryPoint": "./lib-commonjs/Webpack5Plugin", + "optionsSchema": "./lib-commonjs/schemas/heft-webpack5-plugin.schema.json", "parameterScope": "webpack5", "parameters": [ diff --git a/heft-plugins/heft-webpack5-plugin/package.json b/heft-plugins/heft-webpack5-plugin/package.json index 7f752d2b2e6..cd0ed17dc7d 100644 --- a/heft-plugins/heft-webpack5-plugin/package.json +++ b/heft-plugins/heft-webpack5-plugin/package.json @@ -8,8 +8,31 @@ "directory": "heft-plugins/heft-webpack5-plugin" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "dist/heft-webpack5-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft-webpack5-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/heft-webpack5-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./heft-plugin.json": "./heft-plugin.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -36,5 +59,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/libraries/api-extractor-model/config/api-extractor.json b/libraries/api-extractor-model/config/api-extractor.json index aa9d8f810fd..05c675a8601 100644 --- a/libraries/api-extractor-model/config/api-extractor.json +++ b/libraries/api-extractor-model/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/api-extractor-model/package.json b/libraries/api-extractor-model/package.json index 7281c014d5a..dd22a952060 100644 --- a/libraries/api-extractor-model/package.json +++ b/libraries/api-extractor-model/package.json @@ -8,8 +8,29 @@ "directory": "libraries/api-extractor-model" }, "homepage": "https://api-extractor.com", - "main": "lib/index.js", - "typings": "dist/rollup.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rollup.d.ts", + "exports": { + ".": { + "types": "./dist/rollup.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -25,5 +46,6 @@ "@rushstack/heft": "1.1.7", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": false } diff --git a/libraries/credential-cache/config/api-extractor.json b/libraries/credential-cache/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/credential-cache/config/api-extractor.json +++ b/libraries/credential-cache/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/credential-cache/package.json b/libraries/credential-cache/package.json index b479c2ea4dc..6bd8700c34f 100644 --- a/libraries/credential-cache/package.json +++ b/libraries/credential-cache/package.json @@ -2,8 +2,30 @@ "name": "@rushstack/credential-cache", "version": "0.1.11", "description": "Cross-platform functionality to manage cached credentials.", - "main": "lib/index.js", - "typings": "dist/credential-cache.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/credential-cache.d.ts", + "exports": { + ".": { + "types": "./dist/credential-cache.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -22,5 +44,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/debug-certificate-manager/config/api-extractor.json b/libraries/debug-certificate-manager/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/debug-certificate-manager/config/api-extractor.json +++ b/libraries/debug-certificate-manager/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/debug-certificate-manager/package.json b/libraries/debug-certificate-manager/package.json index d6a0b97e471..52de5ca21ad 100644 --- a/libraries/debug-certificate-manager/package.json +++ b/libraries/debug-certificate-manager/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/debug-certificate-manager", "version": "1.6.14", "description": "Cross-platform functionality to create debug ssl certificates.", - "main": "lib/index.js", - "typings": "dist/debug-certificate-manager.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/debug-certificate-manager.d.ts", + "exports": { + ".": { + "types": "./dist/debug-certificate-manager.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -24,5 +45,6 @@ "@types/node-forge": "1.0.4", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/heft-config-file/config/api-extractor.json b/libraries/heft-config-file/config/api-extractor.json index 34fb7776c9d..1ddb4758d09 100644 --- a/libraries/heft-config-file/config/api-extractor.json +++ b/libraries/heft-config-file/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/libraries/heft-config-file/package.json b/libraries/heft-config-file/package.json index d886cd0bede..6828bd0c255 100644 --- a/libraries/heft-config-file/package.json +++ b/libraries/heft-config-file/package.json @@ -11,8 +11,29 @@ "node": ">=10.13.0" }, "homepage": "https://rushstack.io/pages/heft/overview/", - "main": "lib/index.js", - "types": "dist/heft-config-file.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/heft-config-file.d.ts", + "exports": { + ".": { + "types": "./dist/heft-config-file.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -32,5 +53,6 @@ "@types/ungap__structured-clone": "~1.2.0", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": false } diff --git a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts index 1d4b4b33f5b..56bbcca3d76 100644 --- a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts +++ b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts @@ -830,7 +830,7 @@ describe('ConfigurationFile', () => { 'node_modules', '@rushstack', 'node-core-library', - 'lib', + 'lib-commonjs', 'index.js' ) ) @@ -911,7 +911,7 @@ describe('ConfigurationFile', () => { 'node_modules', '@rushstack', 'node-core-library', - 'lib', + 'lib-commonjs', 'index.js' ) ) @@ -994,7 +994,7 @@ describe('ConfigurationFile', () => { 'node_modules', '@rushstack', 'node-core-library', - 'lib', + 'lib-commonjs', 'index.js' ) ) @@ -1075,7 +1075,7 @@ describe('ConfigurationFile', () => { 'node_modules', '@rushstack', 'node-core-library', - 'lib', + 'lib-commonjs', 'index.js' ) ) @@ -1762,7 +1762,7 @@ describe('ConfigurationFile', () => { // a newline on Windows, and a curly brace on other platforms, even though the location is // accurate in both cases. Use a regex to match either. expect(() => configFileLoader.loadConfigurationFileForProject(terminal, __dirname)).toThrowError( - /In configuration file "\/lib\/test\/errorCases\/invalidJson\/config.json": SyntaxError: Unexpected token '(}|\\n)' at 2:19/ + /In configuration file "\/lib-commonjs\/test\/errorCases\/invalidJson\/config.json": SyntaxError: Unexpected token '(}|\\n)' at 2:19/ ); jest.restoreAllMocks(); @@ -1792,7 +1792,7 @@ describe('ConfigurationFile', () => { await expect( configFileLoader.loadConfigurationFileForProjectAsync(terminal, __dirname) ).rejects.toThrowError( - /In configuration file "\/lib\/test\/errorCases\/invalidJson\/config.json": SyntaxError: Unexpected token '(}|\\n)' at 2:19/ + /In configuration file "\/lib-commonjs\/test\/errorCases\/invalidJson\/config.json": SyntaxError: Unexpected token '(}|\\n)' at 2:19/ ); jest.restoreAllMocks(); diff --git a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap index 5c90062d351..8189466f89b 100644 --- a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap +++ b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap @@ -126,7 +126,7 @@ exports[`ConfigurationFile a complex file with inheritance type annotations thro exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: -/lib/test/errorCases/invalidType/config.json +/lib-commonjs/test/errorCases/invalidType/config.json Error: #/filePaths must be array" @@ -136,7 +136,7 @@ exports[`ConfigurationFile error cases Throws an error for a file that doesn't m exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema async 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: -/lib/test/errorCases/invalidType/config.json +/lib-commonjs/test/errorCases/invalidType/config.json Error: #/filePaths must be array" @@ -146,7 +146,7 @@ exports[`ConfigurationFile error cases Throws an error for a file that doesn't m exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: -/lib/test/errorCases/invalidCombinedFile/config1.json +/lib-commonjs/test/errorCases/invalidCombinedFile/config1.json Error: # must NOT have additional properties: folderPaths @@ -160,7 +160,7 @@ exports[`ConfigurationFile error cases Throws an error when a combined config fi exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema async 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: -/lib/test/errorCases/invalidCombinedFile/config1.json +/lib-commonjs/test/errorCases/invalidCombinedFile/config1.json Error: # must NOT have additional properties: folderPaths @@ -172,35 +172,35 @@ Error: # exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema async 2`] = `Array []`; -exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 1`] = `"File does not exist: /lib/test/errorCases/folderThatDoesntExist/config.json"`; +exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 1`] = `"File does not exist: /lib-commonjs/test/errorCases/folderThatDoesntExist/config.json"`; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", ] `; -exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 1`] = `"File does not exist: /lib/test/errorCases/folderThatDoesntExist/config.json"`; +exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 1`] = `"File does not exist: /lib-commonjs/test/errorCases/folderThatDoesntExist/config.json"`; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", ] `; -exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 1`] = `"In file \\"/lib/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; +exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 1`] = `"In file \\"/lib-commonjs/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", ] `; -exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 1`] = `"In file \\"/lib/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; +exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 1`] = `"In file \\"/lib-commonjs/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", ] `; @@ -208,82 +208,82 @@ exports[`ConfigurationFile error cases Throws an error when the file isn't valid exports[`ConfigurationFile error cases Throws an error when the file isn't valid JSON async 1`] = `Array []`; -exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib/test/errorCases/circularReference/config1.json\\"."`; +exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib-commonjs/test/errorCases/circularReference/config1.json\\"."`; exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 2`] = `Array []`; -exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib/test/errorCases/circularReference/config1.json\\"."`; +exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib-commonjs/test/errorCases/circularReference/config1.json\\"."`; exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 2`] = `Array []`; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; -exports[`ConfigurationFile error cases throws an error when the file doesn't exist 1`] = `"File does not exist: /lib/test/errorCases/invalidType/notExist.json"`; +exports[`ConfigurationFile error cases throws an error when the file doesn't exist 1`] = `"File does not exist: /lib-commonjs/test/errorCases/invalidType/notExist.json"`; exports[`ConfigurationFile error cases throws an error when the file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; -exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 1`] = `"File does not exist: /lib/test/errorCases/invalidType/notExist.json"`; +exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 1`] = `"File does not exist: /lib-commonjs/test/errorCases/invalidType/notExist.json"`; exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig async 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; -exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 1`] = `"File does not exist: /lib/test/project-referencing-rig/config/notExist.json"`; +exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 1`] = `"File does not exist: /lib-commonjs/test/project-referencing-rig/config/notExist.json"`; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/notExist.json\\" not found.[n]", ] `; -exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 1`] = `"File does not exist: /lib/test/project-referencing-rig/config/notExist.json"`; +exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 1`] = `"File does not exist: /lib-commonjs/test/project-referencing-rig/config/notExist.json"`; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib-commonjs/test/project-referencing-rig/config/notExist.json\\" not found.[n]", ] `; diff --git a/libraries/load-themed-styles/config/heft.json b/libraries/load-themed-styles/config/heft.json deleted file mode 100644 index 90163480937..00000000000 --- a/libraries/load-themed-styles/config/heft.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json", - - "extends": "local-web-rig/profiles/library/config/heft.json", - - "phasesByName": { - "build": { - "cleanFiles": [{ "includeGlobs": ["lib-dts", "lib-esm"] }] - } - } -} diff --git a/libraries/load-themed-styles/config/rush-project.json b/libraries/load-themed-styles/config/rush-project.json deleted file mode 100644 index de5c9b428a0..00000000000 --- a/libraries/load-themed-styles/config/rush-project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json", - - "extends": "local-web-rig/profiles/library/config/rush-project.json", - - "operationSettings": [ - { - "operationName": "_phase:build", - "outputFolderNames": ["lib-dts", "lib-esm"] - } - ] -} diff --git a/libraries/load-themed-styles/config/typescript.json b/libraries/load-themed-styles/config/typescript.json index ece203c8107..757aae0da54 100644 --- a/libraries/load-themed-styles/config/typescript.json +++ b/libraries/load-themed-styles/config/typescript.json @@ -4,6 +4,8 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", + "extends": "local-web-rig/profiles/library/config/typescript.json", + /** * If provided, emit these module kinds in addition to the modules specified in the tsconfig. * Note that this option only applies to the main tsconfig.json configuration. @@ -23,11 +25,6 @@ { "moduleKind": "amd", "outFolderName": "lib-amd" - }, - - { - "moduleKind": "commonjs", - "outFolderName": "lib-commonjs" } ] } diff --git a/libraries/load-themed-styles/package.json b/libraries/load-themed-styles/package.json index 835ef302e79..987780917bd 100644 --- a/libraries/load-themed-styles/package.json +++ b/libraries/load-themed-styles/package.json @@ -8,30 +8,25 @@ "type": "git", "directory": "libraries/load-themed-styles" }, + "keywords": [], "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean" }, - "main": "lib-commonjs/index.js", - "module": "lib-esm/index.js", - "typings": "lib-dts/index.d.ts", - "keywords": [], - "devDependencies": { - "@rushstack/heft": "workspace:*", - "eslint": "~9.37.0", - "local-web-rig": "workspace:*" - }, + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", "exports": { ".": { - "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts", "import": "./lib-esm/index.js", - "types": "./lib-dts/index.d.ts" + "require": "./lib-commonjs/index.js" }, "./lib/*": { - "require": "./lib-commonjs/*", + "types": "./lib-dts/*", "import": "./lib-esm/*", - "types": "./lib-dts/*" + "require": "./lib-commonjs/*" }, "./package.json": "./package.json" }, @@ -41,5 +36,11 @@ "lib-dts/*" ] } - } + }, + "devDependencies": { + "@rushstack/heft": "workspace:*", + "eslint": "~9.37.0", + "local-web-rig": "workspace:*" + }, + "sideEffects": false } diff --git a/libraries/localization-utilities/config/api-extractor.json b/libraries/localization-utilities/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/localization-utilities/config/api-extractor.json +++ b/libraries/localization-utilities/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/localization-utilities/package.json b/libraries/localization-utilities/package.json index c6119d76302..6a5b44d4203 100644 --- a/libraries/localization-utilities/package.json +++ b/libraries/localization-utilities/package.json @@ -2,8 +2,30 @@ "name": "@rushstack/localization-utilities", "version": "0.14.14", "description": "This plugin contains some useful functions for localization.", - "main": "lib/index.js", - "typings": "dist/localization-utilities.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/localization-utilities.d.ts", + "exports": { + ".": { + "types": "./dist/localization-utilities.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -27,5 +49,6 @@ "@types/xmldoc": "1.1.4", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/lookup-by-path/config/api-extractor.json b/libraries/lookup-by-path/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/lookup-by-path/config/api-extractor.json +++ b/libraries/lookup-by-path/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/lookup-by-path/package.json b/libraries/lookup-by-path/package.json index 279ba5d8622..f1846a838c5 100644 --- a/libraries/lookup-by-path/package.json +++ b/libraries/lookup-by-path/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/lookup-by-path", "version": "0.8.16", "description": "Strongly typed trie data structure for path and URL-like strings.", - "main": "lib/index.js", - "typings": "dist/lookup-by-path.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/lookup-by-path.d.ts", + "exports": { + ".": { + "types": "./dist/lookup-by-path.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "keywords": [ "trie", "path", @@ -34,5 +55,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/module-minifier/config/api-extractor.json b/libraries/module-minifier/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/module-minifier/config/api-extractor.json +++ b/libraries/module-minifier/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/module-minifier/package.json b/libraries/module-minifier/package.json index 2df226cb848..96b15da7bc1 100644 --- a/libraries/module-minifier/package.json +++ b/libraries/module-minifier/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/module-minifier", "version": "0.8.14", "description": "Wrapper for terser to support bulk parallel minification.", - "main": "lib/index.js", - "typings": "dist/module-minifier.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/module-minifier.d.ts", + "exports": { + ".": { + "types": "./dist/module-minifier.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -35,5 +56,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/node-core-library/config/api-extractor.json b/libraries/node-core-library/config/api-extractor.json index ce0b9d7f01e..1494cc8b1b1 100644 --- a/libraries/node-core-library/config/api-extractor.json +++ b/libraries/node-core-library/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/node-core-library/config/heft.json b/libraries/node-core-library/config/heft.json deleted file mode 100644 index 11169bb1254..00000000000 --- a/libraries/node-core-library/config/heft.json +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Defines configuration used by core Heft. - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for standard - * settings to be shared across multiple projects. - */ - "extends": "decoupled-local-node-rig/profiles/default/config/heft.json", - - "phasesByName": { - "build": { - "tasksByName": { - "perform-copy": { - "taskPlugin": { - "pluginPackage": "@rushstack/heft", - "pluginName": "copy-files-plugin", - "options": { - "copyOperations": [ - { - "sourcePath": "src", - "destinationFolders": ["lib"], - "fileExtensions": [".lock"] - } - ] - } - } - } - } - } - } -} diff --git a/libraries/node-core-library/package.json b/libraries/node-core-library/package.json index 0417eb08fec..9a1de773736 100644 --- a/libraries/node-core-library/package.json +++ b/libraries/node-core-library/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/node-core-library", "version": "5.19.1", "description": "Core libraries that every NodeJS toolchain project should use", - "main": "lib/index.js", - "typings": "dist/node-core-library.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/node-core-library.d.ts", + "exports": { + ".": { + "types": "./dist/node-core-library.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -42,5 +63,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/node-core-library/src/test/2/test#999999999.lock b/libraries/node-core-library/src/test/2/test#999999999.lock deleted file mode 100644 index da4eb94a088..00000000000 --- a/libraries/node-core-library/src/test/2/test#999999999.lock +++ /dev/null @@ -1 +0,0 @@ -2012-01-02 12:53:12 \ No newline at end of file diff --git a/libraries/node-core-library/src/test/3/test#1.lock b/libraries/node-core-library/src/test/3/test#1.lock deleted file mode 100644 index da4eb94a088..00000000000 --- a/libraries/node-core-library/src/test/3/test#1.lock +++ /dev/null @@ -1 +0,0 @@ -2012-01-02 12:53:12 \ No newline at end of file diff --git a/libraries/node-core-library/src/test/LockFile.test.ts b/libraries/node-core-library/src/test/LockFile.test.ts index ea927795713..9e72fa82c8e 100644 --- a/libraries/node-core-library/src/test/LockFile.test.ts +++ b/libraries/node-core-library/src/test/LockFile.test.ts @@ -12,7 +12,7 @@ function setLockFileGetProcessStartTime(fn: (process: number) => string | undefi } // lib/test -const libTestFolder: string = path.resolve(__dirname, '../../lib/test'); +const libTestFolder: string = path.resolve(__dirname, '../../lib-commonjs/test'); describe(LockFile.name, () => { afterEach(() => { diff --git a/libraries/node-core-library/src/test/__snapshots__/Import.test.ts.snap b/libraries/node-core-library/src/test/__snapshots__/Import.test.ts.snap index 1928c092d24..0ff81af1df6 100644 --- a/libraries/node-core-library/src/test/__snapshots__/Import.test.ts.snap +++ b/libraries/node-core-library/src/test/__snapshots__/Import.test.ts.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find module \\"@rushstack/node-core-library\\" from \\"/lib/test\\": Error: Cannot find module '@rushstack/node-core-library' from ''"`; +exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find module \\"@rushstack/node-core-library\\" from \\"/lib-commonjs/test\\": Error: Cannot find module '@rushstack/node-core-library' from ''"`; -exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 2`] = `"Cannot find module \\"@rushstack/node-core-library/lib/Constants.js\\" from \\"/lib/test\\": Error: Cannot find module '@rushstack/node-core-library/lib/Constants.js' from ''"`; +exports[`Import resolveModule allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 2`] = `"Cannot find module \\"@rushstack/node-core-library/lib/Constants.js\\" from \\"/lib-commonjs/test\\": Error: Cannot find module '@rushstack/node-core-library/lib/Constants.js' from ''"`; -exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"Cannot find module \\"fs/foo/bar\\" from \\"/lib/test\\": Error: Cannot find module 'fs/foo/bar' from ''"`; +exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"Cannot find module \\"fs/foo/bar\\" from \\"/lib-commonjs/test\\": Error: Cannot find module 'fs/foo/bar' from ''"`; -exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find module \\"fs\\" from \\"/lib/test\\"."`; +exports[`Import resolveModule includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find module \\"fs\\" from \\"/lib-commonjs/test\\"."`; exports[`Import resolvePackage allowSelfReference fails to resolve a path inside this package with allowSelfReference turned on 1`] = `"The package name \\"@rushstack/node-core-library/lib/Constants.js\\" contains an invalid character: \\"/\\""`; -exports[`Import resolvePackage allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find package \\"@rushstack/node-core-library\\" from \\"/lib/test\\": Error: Cannot find module '@rushstack/node-core-library/package.json' from ''."`; +exports[`Import resolvePackage allowSelfReference throws on an attempt to reference this package without allowSelfReference turned on 1`] = `"Cannot find package \\"@rushstack/node-core-library\\" from \\"/lib-commonjs/test\\": Error: Cannot find module '@rushstack/node-core-library/package.json' from ''."`; exports[`Import resolvePackage fails to resolve a path inside a dependency 1`] = `"The package name \\"@rushstack/heft/lib/start.js\\" contains an invalid character: \\"/\\""`; @@ -18,4 +18,4 @@ exports[`Import resolvePackage fails to resolve a path inside a dependency of a exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a non-existing path inside a system module with includeSystemModules turned on 1`] = `"The package name \\"fs/foo/bar\\" contains an invalid character: \\"/\\""`; -exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find package \\"fs\\" from \\"/lib/test\\": Error: Cannot find module 'fs/package.json' from ''."`; +exports[`Import resolvePackage includeSystemModules throws on an attempt to resolve a system module without includeSystemModules turned on 1`] = `"Cannot find package \\"fs\\" from \\"/lib-commonjs/test\\": Error: Cannot find module 'fs/package.json' from ''."`; diff --git a/libraries/npm-check-fork/package.json b/libraries/npm-check-fork/package.json index 949828fa1dd..39c383d9365 100644 --- a/libraries/npm-check-fork/package.json +++ b/libraries/npm-check-fork/package.json @@ -8,8 +8,29 @@ "directory": "libraries/npm-check-fork" }, "homepage": "https://github.com/dylang/npm-check", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -29,5 +50,6 @@ "@types/semver": "7.5.0", "local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": false } diff --git a/libraries/npm-check-fork/tsconfig.json b/libraries/npm-check-fork/tsconfig.json index f9b633dca52..859b2901d5e 100644 --- a/libraries/npm-check-fork/tsconfig.json +++ b/libraries/npm-check-fork/tsconfig.json @@ -4,6 +4,7 @@ "declaration": true, "declarationMap": true, "emitDeclarationOnly": false, - "outDir": "./lib" + "outDir": "./lib-commonjs", + "declarationDir": "./lib-dts" } } diff --git a/libraries/operation-graph/config/api-extractor.json b/libraries/operation-graph/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/operation-graph/config/api-extractor.json +++ b/libraries/operation-graph/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/operation-graph/package.json b/libraries/operation-graph/package.json index eec4fe16ad5..10bb6a47c53 100644 --- a/libraries/operation-graph/package.json +++ b/libraries/operation-graph/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/operation-graph", "version": "0.5.7", "description": "Library for managing and executing operations in a directed acyclic graph.", - "main": "lib/index.js", - "typings": "dist/operation-graph.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/operation-graph.d.ts", + "exports": { + ".": { + "types": "./dist/operation-graph.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -31,5 +52,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/package-deps-hash/config/api-extractor.json b/libraries/package-deps-hash/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/package-deps-hash/config/api-extractor.json +++ b/libraries/package-deps-hash/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/package-deps-hash/package.json b/libraries/package-deps-hash/package.json index d9740cd4e12..ce528114a8d 100644 --- a/libraries/package-deps-hash/package.json +++ b/libraries/package-deps-hash/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/package-deps-hash", "version": "4.6.8", "description": "", - "main": "lib/index.js", - "typings": "dist/package-deps-hash.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/package-deps-hash.d.ts", + "exports": { + ".": { + "types": "./dist/package-deps-hash.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -22,5 +43,6 @@ }, "dependencies": { "@rushstack/node-core-library": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/package-deps-hash/src/test/getPackageDeps.test.ts b/libraries/package-deps-hash/src/test/getPackageDeps.test.ts index adae400ab4b..0c57ea6f3cb 100644 --- a/libraries/package-deps-hash/src/test/getPackageDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getPackageDeps.test.ts @@ -8,7 +8,9 @@ import { getPackageDeps, parseGitLsTree, parseGitFilename } from '../getPackageD import { FileSystem, FileConstants } from '@rushstack/node-core-library'; -const SOURCE_PATH: string = path.join(__dirname).replace(path.join('lib', 'test'), path.join('src', 'test')); +const SOURCE_PATH: string = path + .join(__dirname) + .replace(path.join('lib-commonjs', 'test'), path.join('src', 'test')); const TEST_PROJECT_PATH: string = path.join(SOURCE_PATH, 'testProject'); const NESTED_TEST_PROJECT_PATH: string = path.join(SOURCE_PATH, 'nestedTestProject'); diff --git a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts index b65928e5cdc..6e01af1fd6a 100644 --- a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts @@ -14,7 +14,9 @@ import { import { FileSystem } from '@rushstack/node-core-library'; -const SOURCE_PATH: string = path.join(__dirname).replace(path.join('lib', 'test'), path.join('src', 'test')); +const SOURCE_PATH: string = path + .join(__dirname) + .replace(path.join('lib-commonjs', 'test'), path.join('src', 'test')); const TEST_PREFIX: string = `libraries/package-deps-hash/src/test/`; const TEST_PROJECT_PATH: string = path.join(SOURCE_PATH, 'testProject'); diff --git a/libraries/package-extractor/config/api-extractor.json b/libraries/package-extractor/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/package-extractor/config/api-extractor.json +++ b/libraries/package-extractor/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/package-extractor/config/typescript.json b/libraries/package-extractor/config/typescript.json deleted file mode 100644 index 587de5fc0f8..00000000000 --- a/libraries/package-extractor/config/typescript.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/typescript.schema.json", - - "extends": "local-node-rig/profiles/default/config/typescript.json", - - "additionalModuleKindsToEmit": [ - { - "moduleKind": "esnext", - "outFolderName": "lib-esnext" - } - ] -} diff --git a/libraries/package-extractor/package.json b/libraries/package-extractor/package.json index 255011c1821..8e641415a47 100644 --- a/libraries/package-extractor/package.json +++ b/libraries/package-extractor/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/package-extractor", "version": "0.11.16", "description": "A library for bundling selected files and dependencies into a deployable package.", - "main": "lib/index.js", - "typings": "dist/package-extractor.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/package-extractor.d.ts", + "exports": { + ".": { + "types": "./dist/package-extractor.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "repository": { "type": "git", "url": "https://github.com/microsoft/rushstack.git", @@ -37,5 +58,6 @@ "eslint": "~9.37.0", "webpack": "~5.105.2", "@types/semver": "7.5.0" - } + }, + "sideEffects": false } diff --git a/libraries/package-extractor/webpack.config.js b/libraries/package-extractor/webpack.config.js index 89a6ddf1d87..d0a48573569 100644 --- a/libraries/package-extractor/webpack.config.js +++ b/libraries/package-extractor/webpack.config.js @@ -2,7 +2,7 @@ const webpack = require('webpack'); const { PreserveDynamicRequireWebpackPlugin } = require('@rushstack/webpack-preserve-dynamic-require-plugin'); -const { CREATE_LINKS_SCRIPT_FILENAME, SCRIPTS_FOLDER_PATH } = require('./lib/PathConstants'); +const { CREATE_LINKS_SCRIPT_FILENAME, SCRIPTS_FOLDER_PATH } = require('./lib-commonjs/PathConstants'); module.exports = () => { return { @@ -11,7 +11,7 @@ module.exports = () => { devtool: 'source-map', entry: { [CREATE_LINKS_SCRIPT_FILENAME]: { - import: `${__dirname}/lib-esnext/scripts/createLinks/start.js`, + import: `${__dirname}/lib-esm/scripts/createLinks/start.js`, filename: `[name]` } }, diff --git a/libraries/problem-matcher/config/api-extractor.json b/libraries/problem-matcher/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/problem-matcher/config/api-extractor.json +++ b/libraries/problem-matcher/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/problem-matcher/package.json b/libraries/problem-matcher/package.json index 88dc8f922bb..2984e8b95fc 100644 --- a/libraries/problem-matcher/package.json +++ b/libraries/problem-matcher/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/problem-matcher", "version": "0.1.1", "description": "A library for parsing VS Code style problem matchers", - "main": "lib/index.js", - "typings": "dist/problem-matcher.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/problem-matcher.d.ts", + "exports": { + ".": { + "types": "./dist/problem-matcher.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -27,5 +48,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/rig-package/config/api-extractor.json b/libraries/rig-package/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/rig-package/config/api-extractor.json +++ b/libraries/rig-package/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rig-package/package.json b/libraries/rig-package/package.json index 8b1bf298ed6..28ee41f1e41 100644 --- a/libraries/rig-package/package.json +++ b/libraries/rig-package/package.json @@ -2,8 +2,30 @@ "name": "@rushstack/rig-package", "version": "0.6.0", "description": "A system for sharing tool configurations between projects without duplicating config files.", - "main": "lib/index.js", - "typings": "dist/rig-package.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rig-package.d.ts", + "exports": { + ".": { + "types": "./dist/rig-package.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -26,5 +48,6 @@ "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0", "resolve": "~1.22.1" - } + }, + "sideEffects": false } diff --git a/libraries/rush-lib/.gitignore b/libraries/rush-lib/.gitignore new file mode 100644 index 00000000000..4717fcdca27 --- /dev/null +++ b/libraries/rush-lib/.gitignore @@ -0,0 +1 @@ +lib-intermediate-*/ \ No newline at end of file diff --git a/libraries/rush-lib/.npmignore b/libraries/rush-lib/.npmignore index 9194692aaff..280c047d5c9 100644 --- a/libraries/rush-lib/.npmignore +++ b/libraries/rush-lib/.npmignore @@ -34,3 +34,6 @@ !/assets/** +# Exclude intermediate build outputs (not shipped) +/lib-intermediate-*/** +/lib-commonjs/**/*.exports.json diff --git a/libraries/rush-lib/assets/rush-init/[dot]gitignore b/libraries/rush-lib/assets/rush-init/[dot]gitignore index 1fcd67c7805..5c2c2991940 100644 --- a/libraries/rush-lib/assets/rush-init/[dot]gitignore +++ b/libraries/rush-lib/assets/rush-init/[dot]gitignore @@ -110,6 +110,7 @@ temp/ lib/ lib-amd/ lib-es6/ +lib-esm/ lib-esnext/ lib-commonjs/ lib-shim/ diff --git a/libraries/rush-lib/config/api-extractor.json b/libraries/rush-lib/config/api-extractor.json index 3386b9a947a..5dbfda704f4 100644 --- a/libraries/rush-lib/config/api-extractor.json +++ b/libraries/rush-lib/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib-commonjs/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rush-lib/config/heft.json b/libraries/rush-lib/config/heft.json index e260d7e35e9..d361c6eb55b 100644 --- a/libraries/rush-lib/config/heft.json +++ b/libraries/rush-lib/config/heft.json @@ -9,7 +9,7 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["lib-esnext"] }], + "cleanFiles": [{ "includeGlobs": ["lib-intermediate-commonjs", "lib-intermediate-esm"] }], "tasksByName": { "copy-mock-flush-telemetry-plugin": { @@ -20,26 +20,26 @@ "options": { "copyOperations": [ { - "sourcePath": "lib-commonjs/cli/test/rush-mock-flush-telemetry-plugin", + "sourcePath": "lib-intermediate-commonjs/cli/test/rush-mock-flush-telemetry-plugin", "destinationFolders": [ - "lib-commonjs/cli/test/tapFlushTelemetryAndRunBuildActionRepo/common/autoinstallers/plugins/node_modules/rush-mock-flush-telemetry-plugin" + "lib-intermediate-commonjs/cli/test/tapFlushTelemetryAndRunBuildActionRepo/common/autoinstallers/plugins/node_modules/rush-mock-flush-telemetry-plugin" ], "fileExtensions": [".json", ".js", ".map"], "hardlink": true }, { "sourcePath": "src/cli/test", - "destinationFolders": ["lib-commonjs/cli/test"], + "destinationFolders": ["lib-intermediate-commonjs/cli/test"], "fileExtensions": [".js"] }, { "sourcePath": "src/logic/pnpm/test", - "destinationFolders": ["lib-commonjs/logic/pnpm/test"], + "destinationFolders": ["lib-intermediate-commonjs/logic/pnpm/test"], "fileExtensions": [".yaml"] }, { "sourcePath": "src/logic/test", - "destinationFolders": ["lib-commonjs/logic/test"], + "destinationFolders": ["lib-intermediate-commonjs/logic/test"], "includeGlobs": ["**/.mergequeueignore"] } ] @@ -58,6 +58,23 @@ } }, + "copy-legacy-compatibility-index-js": { + "taskDependencies": ["typescript"], + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + { + "sourcePath": "src/legacy-compatibility", + "destinationFolders": ["lib"], + "includeGlobs": ["*"] + } + ] + } + } + }, + "webpack": { "taskDependencies": ["typescript"], "taskPlugin": { diff --git a/libraries/rush-lib/config/jest.config.json b/libraries/rush-lib/config/jest.config.json index ad4d21b0971..38fb384805a 100644 --- a/libraries/rush-lib/config/jest.config.json +++ b/libraries/rush-lib/config/jest.config.json @@ -1,19 +1,19 @@ { "extends": "local-node-rig/profiles/default/config/jest.config.json", - "roots": ["/lib-commonjs"], + "roots": ["/lib-intermediate-commonjs"], - "testMatch": ["/lib-commonjs/**/*.test.js"], + "testMatch": ["/lib-intermediate-commonjs/**/*.test.js"], "collectCoverageFrom": [ - "lib-commonjs/**/*.js", - "!lib-commonjs/**/*.d.ts", - "!lib-commonjs/**/*.test.js", - "!lib-commonjs/**/test/**", - "!lib-commonjs/**/__tests__/**", - "!lib-commonjs/**/__fixtures__/**", - "!lib-commonjs/**/__mocks__/**" + "lib-intermediate-commonjs/**/*.js", + "!lib-intermediate-commonjs/**/*.d.ts", + "!lib-intermediate-commonjs/**/*.test.js", + "!lib-intermediate-commonjs/**/test/**", + "!lib-intermediate-commonjs/**/__tests__/**", + "!lib-intermediate-commonjs/**/__fixtures__/**", + "!lib-intermediate-commonjs/**/__mocks__/**" ], - "globalTeardown": "/lib-commonjs/utilities/test/global-teardown.js" + "globalTeardown": "/lib-intermediate-commonjs/utilities/test/global-teardown.js" } diff --git a/libraries/rush-lib/config/rush-project.json b/libraries/rush-lib/config/rush-project.json new file mode 100644 index 00000000000..4e4a32b3f81 --- /dev/null +++ b/libraries/rush-lib/config/rush-project.json @@ -0,0 +1,10 @@ +{ + "extends": "local-node-rig/profiles/default/config/rush-project.json", + + "operationSettings": [ + { + "operationName": "_phase:build", + "outputFolderNames": ["lib-intermediate-commonjs", "lib-intermediate-esm"] + } + ] +} diff --git a/libraries/rush-lib/config/typescript.json b/libraries/rush-lib/config/typescript.json index 587de5fc0f8..403432e06f5 100644 --- a/libraries/rush-lib/config/typescript.json +++ b/libraries/rush-lib/config/typescript.json @@ -3,10 +3,11 @@ "extends": "local-node-rig/profiles/default/config/typescript.json", + "$additionalModuleKindsToEmit.inheritanceType": "replace", "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-intermediate-esm" } ] } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index 4f30c553344..f9f162469cb 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -12,12 +12,24 @@ }, "engineStrict": true, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "typings": "dist/rush-lib.d.ts", + "main": "./lib-commonjs/index.js", + "types": "./dist/rush-lib.d.ts", + "exports": { + ".": { + "types": "./dist/rush-lib.d.ts", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, "typesVersions": { "*": { - "lib-esnext/*": [ - "lib/*" + "lib/*": [ + "lib-dts/*" ] } }, @@ -96,9 +108,13 @@ "@rushstack/rush-http-build-cache-plugin": "workspace:*" }, "sideEffects": [ - "lib-esnext/start-pnpm.js", - "lib-esnext/start.js", - "lib-esnext/startx.js", - "lib-esnext/utilities/SetRushLibPath.js" + "lib-esm/start-pnpm.js", + "lib-esm/start.js", + "lib-esm/startx.js", + "lib-esm/utilities/SetRushLibPath.js", + "lib-commonjs/start-pnpm.js", + "lib-commonjs/start.js", + "lib-commonjs/startx.js", + "lib-commonjs/utilities/SetRushLibPath.js" ] } diff --git a/libraries/rush-lib/scripts/copyEmptyModules.js b/libraries/rush-lib/scripts/copyEmptyModules.js index 9d0c50f9439..061a03d699e 100644 --- a/libraries/rush-lib/scripts/copyEmptyModules.js +++ b/libraries/rush-lib/scripts/copyEmptyModules.js @@ -22,7 +22,7 @@ module.exports = { // creates a problem when a `.d.ts` file references a module that doesn't have runtime code (i.e. - // a `.d.ts` file that only contains types). // - // This script looks through the `lib-esnext` folder for `.js` files that were produced by the TypeScript + // This script looks through the `lib-intermediate-esm` folder for `.js` files that were produced by the TypeScript // compiler from `.ts` files that contain no runtime code and generates stub `.js` files for them in the // `lib` folder and copies the corresponding `.d.ts` files to the `lib`. This ensures that the `.d.ts` // files that end up in the `lib` folder don't have any unresolved imports. This is tested by the @@ -43,9 +43,9 @@ module.exports = { return resultLines.join('\n'); } - const jsInFolderPath = `${buildFolderPath}/lib-esnext`; - const dtsInFolderPath = `${buildFolderPath}/lib-commonjs`; - const outFolderPath = `${buildFolderPath}/lib`; + const jsInFolderPath = `${buildFolderPath}/lib-intermediate-esm`; + const dtsInFolderPath = `${buildFolderPath}/lib-dts`; + const outCjsFolderPath = `${buildFolderPath}/lib-commonjs`; const emptyModuleBuffer = Buffer.from('module.exports = {};', 'utf8'); const folderPathQueue = new AsyncQueue([undefined]); @@ -65,7 +65,7 @@ module.exports = { const jsFileText = await FileSystem.readFileAsync(jsInPath); const strippedJsFileText = stripCommentsFromJsFile(jsFileText); if (strippedJsFileText === 'export {};') { - const outJsPath = `${outFolderPath}/${relativeItemPath}`; + const outJsPath = `${outCjsFolderPath}/${relativeItemPath}`; terminal.writeVerboseLine(`Writing stub to ${outJsPath}`); await FileSystem.writeFileAsync(outJsPath, emptyModuleBuffer, { ensureFolderExists: true @@ -74,7 +74,7 @@ module.exports = { const relativeDtsPath = relativeItemPath.slice(0, -JS_FILE_EXTENSION.length) + DTS_FILE_EXTENSION; const inDtsPath = `${dtsInFolderPath}/${relativeDtsPath}`; - const outDtsPath = `${outFolderPath}/${relativeDtsPath}`; + const outDtsPath = `${outCjsFolderPath}/${relativeDtsPath}`; terminal.writeVerboseLine(`Copying ${inDtsPath} to ${outDtsPath}`); // We know this is a file, don't need the redundant checks in FileSystem.copyFileAsync const buffer = await FileSystem.readFileToBufferAsync(inDtsPath); diff --git a/libraries/rush-lib/src/api/RushInternals.ts b/libraries/rush-lib/src/api/RushInternals.ts index 6abf2e7122e..714a5fd6a63 100644 --- a/libraries/rush-lib/src/api/RushInternals.ts +++ b/libraries/rush-lib/src/api/RushInternals.ts @@ -16,7 +16,7 @@ export class RushInternals { * @returns the module object as would be returned by `require()` */ public static loadModule(srcImportPath: string): unknown { - const libPath: string = `${Rush._rushLibPackageFolder}/lib/${srcImportPath}`; + const libPath: string = `${Rush._rushLibPackageFolder}/lib-commonjs/${srcImportPath}`; try { return require(libPath); } catch (e) { diff --git a/libraries/rush-lib/src/legacy-compatibility/index.js b/libraries/rush-lib/src/legacy-compatibility/index.js new file mode 100644 index 00000000000..16cb8ded821 --- /dev/null +++ b/libraries/rush-lib/src/legacy-compatibility/index.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +// This file is specifically included for compatibility with older global installations of Rush. +module.exports = require('../lib-commonjs/index.js'); diff --git a/libraries/rush-lib/tsconfig.json b/libraries/rush-lib/tsconfig.json index 7adbedc6d67..ab86a280c94 100644 --- a/libraries/rush-lib/tsconfig.json +++ b/libraries/rush-lib/tsconfig.json @@ -4,6 +4,7 @@ "types": ["heft-jest", "node", "webpack-env"], "skipLibCheck": true, "resolveJsonModule": true, - "outDir": "lib-commonjs" + "outDir": "lib-intermediate-commonjs", + "declarationDir": "lib-dts" } } diff --git a/libraries/rush-lib/webpack.config.js b/libraries/rush-lib/webpack.config.js index 69dab7281f7..6952beba9dc 100644 --- a/libraries/rush-lib/webpack.config.js +++ b/libraries/rush-lib/webpack.config.js @@ -4,7 +4,7 @@ const webpack = require('webpack'); const { PackageJsonLookup } = require('@rushstack/node-core-library'); const { PreserveDynamicRequireWebpackPlugin } = require('@rushstack/webpack-preserve-dynamic-require-plugin'); const { DeepImportsPlugin } = require('@rushstack/webpack-deep-imports-plugin'); -const PathConstants = require('./lib-commonjs/utilities/PathConstants'); +const PathConstants = require('./lib-intermediate-commonjs/utilities/PathConstants'); const SCRIPT_ENTRY_OPTIONS = { filename: `${PathConstants.scriptsFolderName}/[name]` @@ -42,6 +42,18 @@ module.exports = () => { }), ...extraPlugins ], + module: { + rules: [ + { + // These files have side effects (e.g. setting process.env variables) that must not + // be tree-shaken, even though they are only imported for their side effects. + // The package.json "sideEffects" field references the shipped folder names (lib-commonjs, + // lib-esm), but webpack reads from the intermediate build folders (lib-intermediate-esm). + test: /[\\/](SetRushLibPath|start|startx|start-pnpm)\.js$/, + sideEffects: true + } + ] + }, externals: [ ({ request }, callback) => { let packageName; @@ -75,10 +87,10 @@ module.exports = () => { const configurations = [ generateConfiguration( { - 'rush-lib': `${__dirname}/lib-esnext/index.js`, - start: `${__dirname}/lib-esnext/start.js`, - startx: `${__dirname}/lib-esnext/startx.js`, - 'start-pnpm': `${__dirname}/lib-esnext/start-pnpm.js` + 'rush-lib': `${__dirname}/lib-intermediate-esm/index.js`, + start: `${__dirname}/lib-intermediate-esm/start.js`, + startx: `${__dirname}/lib-intermediate-esm/startx.js`, + 'start-pnpm': `${__dirname}/lib-intermediate-esm/start-pnpm.js` }, [ new DeepImportsPlugin({ @@ -86,10 +98,10 @@ module.exports = () => { // it needs to specify a template for the manifest filename. // Otherwise webpack will throw an error about multiple writes to the same manifest file. path: `${__dirname}/temp/build/webpack-dll/[name].json`, - inFolderName: 'lib-esnext', - outFolderName: 'lib', + inFolderName: 'lib-intermediate-esm', + outFolderName: 'lib-commonjs', pathsToIgnore: ['utilities/prompts/SearchListPrompt.js'], - dTsFilesInputFolderName: 'lib-commonjs' + dTsFilesInputFolderName: 'lib-dts' }) ], { @@ -106,27 +118,27 @@ module.exports = () => { ), generateConfiguration({ [PathConstants.pnpmfileShimFilename]: { - import: `${__dirname}/lib-esnext/logic/pnpm/PnpmfileShim.js`, + import: `${__dirname}/lib-intermediate-esm/logic/pnpm/PnpmfileShim.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.subspacePnpmfileShimFilename]: { - import: `${__dirname}/lib-esnext/logic/pnpm/SubspaceGlobalPnpmfileShim.js`, + import: `${__dirname}/lib-intermediate-esm/logic/pnpm/SubspaceGlobalPnpmfileShim.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run.js`, + import: `${__dirname}/lib-intermediate-esm/scripts/install-run.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rush.js`, + import: `${__dirname}/lib-intermediate-esm/scripts/install-run-rush.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushxScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rushx.js`, + import: `${__dirname}/lib-intermediate-esm/scripts/install-run-rushx.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushPnpmScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rush-pnpm.js`, + import: `${__dirname}/lib-intermediate-esm/scripts/install-run-rush-pnpm.js`, ...SCRIPT_ENTRY_OPTIONS } }) diff --git a/libraries/rush-pnpm-kit-v10/config/api-extractor.json b/libraries/rush-pnpm-kit-v10/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/rush-pnpm-kit-v10/config/api-extractor.json +++ b/libraries/rush-pnpm-kit-v10/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rush-pnpm-kit-v10/package.json b/libraries/rush-pnpm-kit-v10/package.json index bb8112fe739..e7d58df296e 100644 --- a/libraries/rush-pnpm-kit-v10/package.json +++ b/libraries/rush-pnpm-kit-v10/package.json @@ -3,8 +3,29 @@ "version": "0.1.7", "description": "rush pnpm kit v10", "license": "MIT", - "main": "lib/index.js", - "typings": "dist/rush-pnpm-kit-v10.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rush-pnpm-kit-v10.d.ts", + "exports": { + ".": { + "types": "./dist/rush-pnpm-kit-v10.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean", @@ -19,5 +40,6 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/rush-pnpm-kit-v8/config/api-extractor.json b/libraries/rush-pnpm-kit-v8/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/rush-pnpm-kit-v8/config/api-extractor.json +++ b/libraries/rush-pnpm-kit-v8/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rush-pnpm-kit-v8/package.json b/libraries/rush-pnpm-kit-v8/package.json index 0b5d6364cb1..0477ed4d2ae 100644 --- a/libraries/rush-pnpm-kit-v8/package.json +++ b/libraries/rush-pnpm-kit-v8/package.json @@ -3,8 +3,29 @@ "version": "0.1.7", "description": "rush pnpm kit v8", "license": "MIT", - "main": "lib/index.js", - "typings": "dist/rush-pnpm-kit-v8.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rush-pnpm-kit-v8.d.ts", + "exports": { + ".": { + "types": "./dist/rush-pnpm-kit-v8.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean", @@ -19,5 +40,6 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/rush-pnpm-kit-v9/config/api-extractor.json b/libraries/rush-pnpm-kit-v9/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/rush-pnpm-kit-v9/config/api-extractor.json +++ b/libraries/rush-pnpm-kit-v9/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rush-pnpm-kit-v9/package.json b/libraries/rush-pnpm-kit-v9/package.json index 6c9bf5b5568..ed35379e2ea 100644 --- a/libraries/rush-pnpm-kit-v9/package.json +++ b/libraries/rush-pnpm-kit-v9/package.json @@ -3,8 +3,29 @@ "version": "0.1.7", "description": "rush pnpm kit v9", "license": "MIT", - "main": "lib/index.js", - "typings": "dist/rush-pnpm-kit-v9.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rush-pnpm-kit-v9.d.ts", + "exports": { + ".": { + "types": "./dist/rush-pnpm-kit-v9.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "_phase:build": "heft run --only build -- --clean", "_phase:test": "heft run --only test -- --clean", @@ -19,5 +40,6 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/rush-sdk/.gitignore b/libraries/rush-sdk/.gitignore new file mode 100644 index 00000000000..4717fcdca27 --- /dev/null +++ b/libraries/rush-sdk/.gitignore @@ -0,0 +1 @@ +lib-intermediate-*/ \ No newline at end of file diff --git a/libraries/rush-sdk/.npmignore b/libraries/rush-sdk/.npmignore index 6d66e80b784..b0201f80fdc 100644 --- a/libraries/rush-sdk/.npmignore +++ b/libraries/rush-sdk/.npmignore @@ -30,5 +30,6 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- -/lib-commonjs/** -/lib-esnext/** + +# Exclude intermediate build outputs (not shipped) +/lib-intermediate-*/** \ No newline at end of file diff --git a/libraries/rush-sdk/config/api-extractor.json b/libraries/rush-sdk/config/api-extractor.json index 6ac06d0c07e..545b27074b6 100644 --- a/libraries/rush-sdk/config/api-extractor.json +++ b/libraries/rush-sdk/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib-commonjs/loader.d.ts", + "mainEntryPointFilePath": "/lib-intermediate-dts/loader.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rush-sdk/config/heft.json b/libraries/rush-sdk/config/heft.json index 328e456a115..21b0acb80a3 100644 --- a/libraries/rush-sdk/config/heft.json +++ b/libraries/rush-sdk/config/heft.json @@ -9,7 +9,16 @@ // TODO: Add comments "phasesByName": { "build": { - "cleanFiles": [{ "includeGlobs": ["lib-shim", "lib-esnext"] }], + "cleanFiles": [ + { + "includeGlobs": [ + "lib-shim", + "lib-intermediate-commonjs", + "lib-intermediate-esm", + "lib-intermediate-dts" + ] + } + ], "tasksByName": { "copy-rush-lib-types": { @@ -45,7 +54,7 @@ "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib-commonjs/generate-stubs.js" + "scriptPath": "./lib-intermediate-commonjs/generate-stubs.js" } } } diff --git a/libraries/rush-sdk/config/jest.config.json b/libraries/rush-sdk/config/jest.config.json index 81cf6b77794..a50e6db90d0 100644 --- a/libraries/rush-sdk/config/jest.config.json +++ b/libraries/rush-sdk/config/jest.config.json @@ -1,9 +1,9 @@ { "extends": "local-node-rig/profiles/default/config/jest.config.json", - "roots": ["/lib-commonjs"], + "roots": ["/lib-intermediate-commonjs"], - "testMatch": ["/lib-commonjs/**/*.test.js"], + "testMatch": ["/lib-intermediate-commonjs/**/*.test.js"], "collectCoverageFrom": [ "lib-shim/**/*.js", diff --git a/libraries/rush-sdk/config/rush-project.json b/libraries/rush-sdk/config/rush-project.json index aa8aa5984cf..4e1fc0eb2a1 100644 --- a/libraries/rush-sdk/config/rush-project.json +++ b/libraries/rush-sdk/config/rush-project.json @@ -4,7 +4,12 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": ["lib-shim"] + "outputFolderNames": [ + "lib-shim", + "lib-intermediate-commonjs", + "lib-intermediate-esm", + "lib-intermediate-dts" + ] } ] } diff --git a/libraries/rush-sdk/config/typescript.json b/libraries/rush-sdk/config/typescript.json index 587de5fc0f8..403432e06f5 100644 --- a/libraries/rush-sdk/config/typescript.json +++ b/libraries/rush-sdk/config/typescript.json @@ -3,10 +3,11 @@ "extends": "local-node-rig/profiles/default/config/typescript.json", + "$additionalModuleKindsToEmit.inheritanceType": "replace", "additionalModuleKindsToEmit": [ { "moduleKind": "esnext", - "outFolderName": "lib-esnext" + "outFolderName": "lib-intermediate-esm" } ] } diff --git a/libraries/rush-sdk/package.json b/libraries/rush-sdk/package.json index 08b75d7ac75..f02c38ab503 100644 --- a/libraries/rush-sdk/package.json +++ b/libraries/rush-sdk/package.json @@ -8,8 +8,8 @@ "directory": "apps/rush-sdk" }, "homepage": "https://rushjs.io", - "main": "lib-shim/index.js", - "typings": "dist/rush-lib.d.ts", + "main": "./lib-shim/index.js", + "types": "./dist/rush-lib.d.ts", "exports": { ".": { "types": "./dist/rush-lib.d.ts", @@ -20,8 +20,8 @@ "default": "./lib-shim/loader.js" }, "./lib/*": { - "types": "./lib/*.d.ts", - "default": "./lib/*.js" + "types": "./lib-dts/*.d.ts", + "default": "./lib-commonjs/*.js" }, "./package.json": "./package.json" }, @@ -29,6 +29,9 @@ "*": { "loader": [ "./dist/loader.d.ts" + ], + "lib/*": [ + "lib-dts/*" ] } }, @@ -59,5 +62,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/libraries/rush-sdk/src/generate-stubs.ts b/libraries/rush-sdk/src/generate-stubs.ts index 6baeaa2943f..d43b5502fec 100644 --- a/libraries/rush-sdk/src/generate-stubs.ts +++ b/libraries/rush-sdk/src/generate-stubs.ts @@ -8,7 +8,8 @@ import { Async, FileSystem, type FolderItem, Import, JsonFile, Path } from '@rus interface IGenerateOptions { parentSourcePath: string; - parentTargetPath: string; + parentCjsTargetPath: string; + parentDtsTargetPath: string; parentSrcImportPathWithSlash: string; libShimIndexPath: string; } @@ -22,21 +23,29 @@ interface IFileTask { } async function* collectFileTasksAsync(options: IGenerateOptions): AsyncGenerator { - const { parentSourcePath, parentTargetPath, parentSrcImportPathWithSlash, libShimIndexPath } = options; + const { + parentSourcePath, + parentCjsTargetPath, + parentDtsTargetPath, + parentSrcImportPathWithSlash, + libShimIndexPath + } = options; const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(options.parentSourcePath); for (const folderItem of folderItems) { const itemName: string = folderItem.name; const sourcePath: string = `${parentSourcePath}/${itemName}`; - const targetPath: string = `${parentTargetPath}/${itemName}`; + const cjsTargetPath: string = `${parentCjsTargetPath}/${itemName}`; + const dtsTargetPath: string = `${parentDtsTargetPath}/${itemName}`; if (folderItem.isDirectory()) { // Ensure destination folder exists - await FileSystem.ensureFolderAsync(targetPath); + await FileSystem.ensureFolderAsync(cjsTargetPath); // Recursively yield tasks from subdirectory yield* collectFileTasksAsync({ parentSourcePath: sourcePath, - parentTargetPath: targetPath, + parentCjsTargetPath: cjsTargetPath, + parentDtsTargetPath: dtsTargetPath, parentSrcImportPathWithSlash: parentSrcImportPathWithSlash + itemName + '/', libShimIndexPath }); @@ -44,17 +53,17 @@ async function* collectFileTasksAsync(options: IGenerateOptions): AsyncGenerator yield { type: 'dts', sourcePath, - targetPath + targetPath: dtsTargetPath }; } else if (folderItem.name.endsWith('.js')) { const srcImportPath: string = parentSrcImportPathWithSlash + path.parse(folderItem.name).name; - const shimPath: string = path.relative(parentTargetPath, libShimIndexPath); + const shimPath: string = path.relative(parentCjsTargetPath, libShimIndexPath); const shimPathLiteral: string = JSON.stringify(Path.convertToSlashes(shimPath)); yield { type: 'js', sourcePath, - targetPath, + targetPath: cjsTargetPath, srcImportPath, shimPathLiteral }; @@ -116,16 +125,20 @@ export async function runAsync(options: IRunScriptOptions): Promise { useNodeJSResolver: true }); - const stubsTargetPath: string = `${buildFolderPath}/lib`; - terminal.writeLine('generate-stubs: Generating stub files under: ' + stubsTargetPath); + const cjsStubsTargetPath: string = `${buildFolderPath}/lib-commonjs`; + const dtsStubsTargetPath: string = `${buildFolderPath}/lib-dts`; + terminal.writeLine( + `generate-stubs: Generating stub files under ${cjsStubsTargetPath} and ${dtsStubsTargetPath}` + ); // Ensure the target folder exists - await FileSystem.ensureFolderAsync(stubsTargetPath); + await FileSystem.ensureFolderAsync(cjsStubsTargetPath); // Collect and process file tasks in parallel with controlled concurrency const tasks: AsyncGenerator = collectFileTasksAsync({ - parentSourcePath: `${rushLibFolder}/lib`, - parentTargetPath: stubsTargetPath, + parentSourcePath: `${rushLibFolder}/lib-commonjs`, + parentCjsTargetPath: cjsStubsTargetPath, + parentDtsTargetPath: dtsStubsTargetPath, parentSrcImportPathWithSlash: '', libShimIndexPath: `${buildFolderPath}/lib-shim/index.js` }); diff --git a/libraries/rush-sdk/src/index.ts b/libraries/rush-sdk/src/index.ts index beaa80bb959..6e1dbaa58b1 100644 --- a/libraries/rush-sdk/src/index.ts +++ b/libraries/rush-sdk/src/index.ts @@ -12,7 +12,7 @@ import { Executable } from '@rushstack/node-core-library'; import { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; -import { RushGlobalFolder } from '@microsoft/rush-lib/lib-esnext/api/RushGlobalFolder'; +import { RushGlobalFolder } from '@microsoft/rush-lib/lib/api/RushGlobalFolder'; import { RUSH_LIB_NAME, diff --git a/libraries/rush-sdk/tsconfig.json b/libraries/rush-sdk/tsconfig.json index 83f4fb550b8..6612b05ca1a 100644 --- a/libraries/rush-sdk/tsconfig.json +++ b/libraries/rush-sdk/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "outDir": "lib-commonjs", + "outDir": "lib-intermediate-commonjs", + "declarationDir": "lib-intermediate-dts", "types": [ "node", "heft-jest", diff --git a/libraries/rush-sdk/webpack.config.js b/libraries/rush-sdk/webpack.config.js index df7ae5c3929..9f5d2189ccc 100644 --- a/libraries/rush-sdk/webpack.config.js +++ b/libraries/rush-sdk/webpack.config.js @@ -16,7 +16,7 @@ module.exports = ({ webpack: { BannerPlugin } }) => { packageName: '@microsoft/rush-lib', useNodeJSResolver: true }); - const { moduleExports: exportSpecifiers } = require(`${rushLibFolder}/lib/index.exports.json`); + const { moduleExports: exportSpecifiers } = require(`${rushLibFolder}/lib-commonjs/index.exports.json`); // Assign named exports after the bundle to ensure they're properly exposed for ESM imports const footerCodeForLibShim = exportSpecifiers .map((name) => `exports.${name} = module.exports.${name};`) @@ -25,14 +25,19 @@ module.exports = ({ webpack: { BannerPlugin } }) => { // Explicitly exclude @microsoft/rush-lib externalDependencyNames.delete('@microsoft/rush-lib'); + // Resolve rush-lib deep imports to the intermediate ESM source rather than the + // DeepImportsPlugin stubs (which load from the dist/ webpack bundle). This avoids + // embedding a nested webpack runtime that expects a separate commons.js chunk. + const rushLibLibAlias = `${rushLibFolder}/lib-intermediate-esm`; + return { context: __dirname, mode: 'development', // So the output isn't minified devtool: 'source-map', entry: { // Using CommonJS due to access of module.parent - index: `${__dirname}/lib-commonjs/index.js`, - loader: `${__dirname}/lib-commonjs/loader.js` + index: `${__dirname}/lib-intermediate-commonjs/index.js`, + loader: `${__dirname}/lib-intermediate-commonjs/loader.js` }, output: { path: `${__dirname}/lib-shim`, @@ -63,6 +68,11 @@ module.exports = ({ webpack: { BannerPlugin } }) => { }), new PreserveDynamicRequireWebpackPlugin() ], + resolve: { + alias: { + '@microsoft/rush-lib/lib': rushLibLibAlias + } + }, externals: [ ({ request }, callback) => { let packageName; diff --git a/libraries/rush-themed-ui/config/api-extractor.json b/libraries/rush-themed-ui/config/api-extractor.json index cafe285cb0d..1cb6d1c00a1 100644 --- a/libraries/rush-themed-ui/config/api-extractor.json +++ b/libraries/rush-themed-ui/config/api-extractor.json @@ -45,7 +45,7 @@ * * SUPPORTED TOKENS: , , */ - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. diff --git a/libraries/rush-themed-ui/package.json b/libraries/rush-themed-ui/package.json index 2eaf61dcf2c..295898f8994 100644 --- a/libraries/rush-themed-ui/package.json +++ b/libraries/rush-themed-ui/package.json @@ -4,8 +4,8 @@ "version": "0.0.0", "private": true, "license": "MIT", - "module": "dist/rush-themed-ui.js", - "types": "dist/rush-themed-ui.d.ts", + "module": "./dist/rush-themed-ui.js", + "types": "./dist/rush-themed-ui.d.ts", "scripts": { "build": "heft test --clean", "start": "heft build --watch", @@ -27,5 +27,6 @@ "@types/react-dom": "19.2.3", "eslint": "~9.37.0", "local-web-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/rush-themed-ui/webpack.config.js b/libraries/rush-themed-ui/webpack.config.js index 3dc6a344989..dbebe07e1c7 100644 --- a/libraries/rush-themed-ui/webpack.config.js +++ b/libraries/rush-themed-ui/webpack.config.js @@ -10,6 +10,10 @@ module.exports = function createConfig(env, argv) { // Documentation: https://webpack.js.org/configuration/ configOverride: { + entry: { + ['rush-themed-ui']: `${__dirname}/lib-esm/index.js` + }, + externals: ['react', 'react-dom', 'tslib'], performance: { diff --git a/libraries/rushell/config/api-extractor.json b/libraries/rushell/config/api-extractor.json index 3e7ff571ed0..4ec2e429995 100644 --- a/libraries/rushell/config/api-extractor.json +++ b/libraries/rushell/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/rushell/package.json b/libraries/rushell/package.json index 9721b1fd440..5702cd7658c 100644 --- a/libraries/rushell/package.json +++ b/libraries/rushell/package.json @@ -7,8 +7,29 @@ "url": "https://github.com/microsoft/rushstack.git", "directory": "libraries/rushell" }, - "main": "lib/index.js", - "typings": "dist/rushell.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rushell.d.ts", + "exports": { + ".": { + "types": "./dist/rushell.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --watch", diff --git a/libraries/stream-collator/config/api-extractor.json b/libraries/stream-collator/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/stream-collator/config/api-extractor.json +++ b/libraries/stream-collator/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/stream-collator/package.json b/libraries/stream-collator/package.json index 3ef54c0c5f1..acdecb0076e 100644 --- a/libraries/stream-collator/package.json +++ b/libraries/stream-collator/package.json @@ -7,8 +7,29 @@ "url": "https://github.com/microsoft/rushstack.git", "directory": "libraries/stream-collator" }, - "main": "lib/index.js", - "typings": "dist/stream-collator.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/stream-collator.d.ts", + "exports": { + ".": { + "types": "./dist/stream-collator.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -23,5 +44,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/libraries/terminal/config/api-extractor.json b/libraries/terminal/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/terminal/config/api-extractor.json +++ b/libraries/terminal/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/terminal/package.json b/libraries/terminal/package.json index fff5c529818..d44e2718eff 100644 --- a/libraries/terminal/package.json +++ b/libraries/terminal/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/terminal", "version": "0.21.0", "description": "User interface primitives for console applications", - "main": "lib/index.js", - "typings": "dist/terminal.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/terminal.d.ts", + "exports": { + ".": { + "types": "./dist/terminal.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -33,5 +54,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/tree-pattern/config/api-extractor.json b/libraries/tree-pattern/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/tree-pattern/config/api-extractor.json +++ b/libraries/tree-pattern/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/tree-pattern/package.json b/libraries/tree-pattern/package.json index 47300639e1a..95c13269298 100644 --- a/libraries/tree-pattern/package.json +++ b/libraries/tree-pattern/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/tree-pattern", "version": "0.3.4", "description": "A fast, lightweight pattern matcher for tree structures such as an Abstract Syntax Tree (AST)", - "main": "lib/index.js", - "typings": "dist/tree-pattern.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/tree-pattern.d.ts", + "exports": { + ".": { + "types": "./dist/tree-pattern.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -19,5 +40,6 @@ "@rushstack/heft": "1.1.7", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": false } diff --git a/libraries/ts-command-line/config/api-extractor.json b/libraries/ts-command-line/config/api-extractor.json index 7454dd5c1d9..d96b3e7a9a7 100644 --- a/libraries/ts-command-line/config/api-extractor.json +++ b/libraries/ts-command-line/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/ts-command-line/package.json b/libraries/ts-command-line/package.json index 0ed7d4c8b64..b510247b435 100644 --- a/libraries/ts-command-line/package.json +++ b/libraries/ts-command-line/package.json @@ -7,8 +7,29 @@ "url": "https://github.com/microsoft/rushstack.git", "directory": "libraries/ts-command-line" }, - "main": "lib/index.js", - "typings": "dist/ts-command-line.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/ts-command-line.d.ts", + "exports": { + ".": { + "types": "./dist/ts-command-line.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -26,5 +47,6 @@ "@rushstack/node-core-library": "workspace:*", "decoupled-local-node-rig": "workspace:*", "eslint": "~9.37.0" - } + }, + "sideEffects": false } diff --git a/libraries/typings-generator/config/api-extractor.json b/libraries/typings-generator/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/typings-generator/config/api-extractor.json +++ b/libraries/typings-generator/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/typings-generator/package.json b/libraries/typings-generator/package.json index 316b4382cde..e34b5169e94 100644 --- a/libraries/typings-generator/package.json +++ b/libraries/typings-generator/package.json @@ -7,8 +7,29 @@ "typings", "generate" ], - "main": "lib/index.js", - "typings": "dist/typings-generator.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/typings-generator.d.ts", + "exports": { + ".": { + "types": "./dist/typings-generator.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -38,5 +59,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/libraries/worker-pool/config/api-extractor.json b/libraries/worker-pool/config/api-extractor.json index 996e271d3dd..5dbfda704f4 100644 --- a/libraries/worker-pool/config/api-extractor.json +++ b/libraries/worker-pool/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/libraries/worker-pool/package.json b/libraries/worker-pool/package.json index 78d60122f1b..fd65783cf61 100644 --- a/libraries/worker-pool/package.json +++ b/libraries/worker-pool/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/worker-pool", "version": "0.6.14", "description": "Lightweight worker pool using NodeJS worker_threads", - "main": "lib/index.js", - "typings": "dist/worker-pool.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/worker-pool.d.ts", + "exports": { + ".": { + "types": "./dist/worker-pool.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -27,5 +48,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/repo-scripts/doc-plugin-rush-stack/package.json b/repo-scripts/doc-plugin-rush-stack/package.json index 422186b3fdd..f398bfe0ed7 100644 --- a/repo-scripts/doc-plugin-rush-stack/package.json +++ b/repo-scripts/doc-plugin-rush-stack/package.json @@ -3,8 +3,29 @@ "version": "1.0.0", "private": true, "description": "API Documenter plugin used with the rushstack.io website", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/repo-scripts/repo-toolbox/package.json b/repo-scripts/repo-toolbox/package.json index 5a56b906323..88bc21ecfbe 100644 --- a/repo-scripts/repo-toolbox/package.json +++ b/repo-scripts/repo-toolbox/package.json @@ -20,5 +20,20 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" + }, + "exports": { + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/rigs/decoupled-local-node-rig/profiles/default/config/heft.json b/rigs/decoupled-local-node-rig/profiles/default/config/heft.json index 437ad9b13ba..77fe092ba04 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/config/heft.json +++ b/rigs/decoupled-local-node-rig/profiles/default/config/heft.json @@ -1,5 +1,25 @@ { "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json", - "extends": "@rushstack/heft-node-rig/profiles/default/config/heft.json" + "extends": "@rushstack/heft-node-rig/profiles/default/config/heft.json", + + "phasesByName": { + "build": { + "cleanFiles": [{ "includeGlobs": ["lib-esnext"] }], + + "tasksByName": { + "lint": { + "taskPlugin": { + "options": { + "sarifLogPath": "temp/build/lint/lint.sarif" + } + } + } + } + }, + + "test": { + "cleanFiles": [{ "includeGlobs": ["coverage"] }] + } + } } diff --git a/rigs/decoupled-local-node-rig/profiles/default/config/jest.config.json b/rigs/decoupled-local-node-rig/profiles/default/config/jest.config.json index 1127530a185..f14c1acd341 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/config/jest.config.json +++ b/rigs/decoupled-local-node-rig/profiles/default/config/jest.config.json @@ -1,10 +1,22 @@ { "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", "coverageReporters": ["cobertura", "html"], + "collectCoverageFrom": [ + "lib-commonjs/**/*.js", + "!lib-commonjs/**/*.d.ts", + "!lib-commonjs/**/*.test.js", + "!lib-commonjs/**/test/**", + "!lib-commonjs/**/__tests__/**", + "!lib-commonjs/**/__fixtures__/**", + "!lib-commonjs/**/__mocks__/**" + ], // Use v8 coverage provider to avoid Babel "coverageProvider": "v8", diff --git a/rigs/decoupled-local-node-rig/profiles/default/config/rush-project.json b/rigs/decoupled-local-node-rig/profiles/default/config/rush-project.json index b3e191a2bb6..cf4f5214575 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/config/rush-project.json +++ b/rigs/decoupled-local-node-rig/profiles/default/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib-esnext"] + "outputFolderNames": [".heft", "lib-dts", "lib-esm"] }, { "operationName": "_phase:test", diff --git a/rigs/decoupled-local-node-rig/profiles/default/config/typescript.json b/rigs/decoupled-local-node-rig/profiles/default/config/typescript.json index c86f0a36a0d..19141b16622 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/config/typescript.json +++ b/rigs/decoupled-local-node-rig/profiles/default/config/typescript.json @@ -3,5 +3,12 @@ "extends": "@rushstack/heft-node-rig/profiles/default/config/typescript.json", - "onlyResolveSymlinksInNodeModules": true + "onlyResolveSymlinksInNodeModules": true, + + "additionalModuleKindsToEmit": [ + { + "moduleKind": "esnext", + "outFolderName": "lib-esm" + } + ] } diff --git a/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json b/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json index dff2ef99dc1..a70f8605252 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json @@ -8,11 +8,12 @@ "isolatedModules": true, "target": "es2018", - "outDir": "../../../../lib", - "rootDir": "../../../../src", + "outDir": "${configDir}/lib-commonjs", + "declarationDir": "${configDir}/lib-dts", + "rootDir": "${configDir}/src", "types": ["heft-jest", "node"], - "typeRoots": ["../../../../node_modules/@types", "../../node_modules/@types"] + "typeRoots": ["${configDir}/node_modules/@types", "../../node_modules/@types"] }, - "include": ["../../../../src/**/*.ts", "../../../../src/**/*.tsx"] + "include": ["${configDir}/src/**/*.ts", "${configDir}/src/**/*.tsx"] } diff --git a/rigs/heft-node-rig/package.json b/rigs/heft-node-rig/package.json index f670aa03b03..52127f3fdf3 100644 --- a/rigs/heft-node-rig/package.json +++ b/rigs/heft-node-rig/package.json @@ -29,5 +29,6 @@ }, "devDependencies": { "@rushstack/heft": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rigs/heft-vscode-extension-rig/package.json b/rigs/heft-vscode-extension-rig/package.json index e760b6a7068..cc04480344d 100644 --- a/rigs/heft-vscode-extension-rig/package.json +++ b/rigs/heft-vscode-extension-rig/package.json @@ -28,5 +28,6 @@ }, "devDependencies": { "@rushstack/heft": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rigs/heft-web-rig/package.json b/rigs/heft-web-rig/package.json index 988d6d5e391..3ed08dcd011 100644 --- a/rigs/heft-web-rig/package.json +++ b/rigs/heft-web-rig/package.json @@ -47,5 +47,6 @@ }, "devDependencies": { "@rushstack/heft": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rigs/local-node-rig/profiles/default/config/heft.json b/rigs/local-node-rig/profiles/default/config/heft.json index b8d42182128..77fe092ba04 100644 --- a/rigs/local-node-rig/profiles/default/config/heft.json +++ b/rigs/local-node-rig/profiles/default/config/heft.json @@ -5,6 +5,8 @@ "phasesByName": { "build": { + "cleanFiles": [{ "includeGlobs": ["lib-esnext"] }], + "tasksByName": { "lint": { "taskPlugin": { @@ -14,6 +16,10 @@ } } } + }, + + "test": { + "cleanFiles": [{ "includeGlobs": ["coverage"] }] } } } diff --git a/rigs/local-node-rig/profiles/default/config/jest.config.json b/rigs/local-node-rig/profiles/default/config/jest.config.json index 1127530a185..1250d45a5a3 100644 --- a/rigs/local-node-rig/profiles/default/config/jest.config.json +++ b/rigs/local-node-rig/profiles/default/config/jest.config.json @@ -1,10 +1,22 @@ { "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.js"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", "coverageReporters": ["cobertura", "html"], + "collectCoverageFrom": [ + "lib-commonjs/**/*.js", + "!lib-commonjs/**/*.d.ts", + "!lib-commonjs/**/*.test.js", + "!lib-commonjs/**/test/**", + "!lib-commonjs/**/__tests__/**", + "!lib-commonjs/**/__fixtures__/**", + "!lib-commonjs/**/__mocks__/**" + ], // Use v8 coverage provider to avoid Babel "coverageProvider": "v8", @@ -22,5 +34,5 @@ ] ], - "resolver": "@rushstack/heft-jest-plugin/lib/exports/jest-node-modules-symlink-resolver.js" + "resolver": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-node-modules-symlink-resolver.js" } diff --git a/rigs/local-node-rig/profiles/default/config/rush-project.json b/rigs/local-node-rig/profiles/default/config/rush-project.json index b3e191a2bb6..cf4f5214575 100644 --- a/rigs/local-node-rig/profiles/default/config/rush-project.json +++ b/rigs/local-node-rig/profiles/default/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft", "lib-esnext"] + "outputFolderNames": [".heft", "lib-dts", "lib-esm"] }, { "operationName": "_phase:test", diff --git a/rigs/local-node-rig/profiles/default/config/typescript.json b/rigs/local-node-rig/profiles/default/config/typescript.json index c86f0a36a0d..19141b16622 100644 --- a/rigs/local-node-rig/profiles/default/config/typescript.json +++ b/rigs/local-node-rig/profiles/default/config/typescript.json @@ -3,5 +3,12 @@ "extends": "@rushstack/heft-node-rig/profiles/default/config/typescript.json", - "onlyResolveSymlinksInNodeModules": true + "onlyResolveSymlinksInNodeModules": true, + + "additionalModuleKindsToEmit": [ + { + "moduleKind": "esnext", + "outFolderName": "lib-esm" + } + ] } diff --git a/rigs/local-node-rig/profiles/default/tsconfig-base.json b/rigs/local-node-rig/profiles/default/tsconfig-base.json index 418d1448e6f..a70f8605252 100644 --- a/rigs/local-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/local-node-rig/profiles/default/tsconfig-base.json @@ -8,7 +8,8 @@ "isolatedModules": true, "target": "es2018", - "outDir": "${configDir}/lib", + "outDir": "${configDir}/lib-commonjs", + "declarationDir": "${configDir}/lib-dts", "rootDir": "${configDir}/src", "types": ["heft-jest", "node"], diff --git a/rigs/local-web-rig/profiles/app/config/heft.json b/rigs/local-web-rig/profiles/app/config/heft.json index e3679801f22..1888d38a36f 100644 --- a/rigs/local-web-rig/profiles/app/config/heft.json +++ b/rigs/local-web-rig/profiles/app/config/heft.json @@ -5,6 +5,8 @@ "phasesByName": { "build": { + "cleanFiles": [{ "includeGlobs": ["lib-dts", "lib-esm"] }], + "tasksByName": { "lint": { "taskPlugin": { @@ -14,6 +16,10 @@ } } } + }, + + "test": { + "cleanFiles": [{ "includeGlobs": ["coverage"] }] } } } diff --git a/rigs/local-web-rig/profiles/app/config/rush-project.json b/rigs/local-web-rig/profiles/app/config/rush-project.json index d1b5241fb62..1476defbc96 100644 --- a/rigs/local-web-rig/profiles/app/config/rush-project.json +++ b/rigs/local-web-rig/profiles/app/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft"] + "outputFolderNames": [".heft", "lib-dts", "lib-esm"] }, { "operationName": "_phase:test", diff --git a/rigs/local-web-rig/profiles/app/tsconfig-base.json b/rigs/local-web-rig/profiles/app/tsconfig-base.json index 03bbe4b704b..e609adca759 100644 --- a/rigs/local-web-rig/profiles/app/tsconfig-base.json +++ b/rigs/local-web-rig/profiles/app/tsconfig-base.json @@ -10,7 +10,8 @@ "target": "es2017", "lib": ["es2017", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"], - "outDir": "${configDir}/lib", + "outDir": "${configDir}/lib-esm", + "declarationDir": "${configDir}/lib-dts", "rootDir": "${configDir}/src", "rootDirs": ["${configDir}/src", "${configDir}/temp/sass-ts"], diff --git a/rigs/local-web-rig/profiles/library/config/heft.json b/rigs/local-web-rig/profiles/library/config/heft.json index d26de84e78b..541a146a9c8 100644 --- a/rigs/local-web-rig/profiles/library/config/heft.json +++ b/rigs/local-web-rig/profiles/library/config/heft.json @@ -5,6 +5,8 @@ "phasesByName": { "build": { + "cleanFiles": [{ "includeGlobs": ["lib-dts", "lib-esm"] }], + "tasksByName": { "lint": { "taskPlugin": { @@ -14,6 +16,10 @@ } } } + }, + + "test": { + "cleanFiles": [{ "includeGlobs": ["coverage"] }] } } } diff --git a/rigs/local-web-rig/profiles/library/config/rush-project.json b/rigs/local-web-rig/profiles/library/config/rush-project.json index 1df3cee0d79..d76c205b614 100644 --- a/rigs/local-web-rig/profiles/library/config/rush-project.json +++ b/rigs/local-web-rig/profiles/library/config/rush-project.json @@ -4,7 +4,7 @@ "operationSettings": [ { "operationName": "_phase:build", - "outputFolderNames": [".heft"] + "outputFolderNames": [".heft", "lib-dts", "lib-esm"] }, { "operationName": "_phase:test", diff --git a/rigs/local-web-rig/profiles/library/tsconfig-base.json b/rigs/local-web-rig/profiles/library/tsconfig-base.json index b3568c82cdb..eec41564e0e 100644 --- a/rigs/local-web-rig/profiles/library/tsconfig-base.json +++ b/rigs/local-web-rig/profiles/library/tsconfig-base.json @@ -7,7 +7,8 @@ "resolveJsonModule": true, "isolatedModules": true, - "outDir": "${configDir}/lib", + "outDir": "${configDir}/lib-esm", + "declarationDir": "${configDir}/lib-dts", "rootDir": "${configDir}/src", "rootDirs": ["${configDir}/src", "${configDir}/temp/sass-ts"], diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/config/api-extractor.json b/rush-plugins/rush-amazon-s3-build-cache-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/config/api-extractor.json +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json index 533fe23aa7c..08f0befe731 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json @@ -8,8 +8,31 @@ "directory": "rush-plugins/rush-amazon-s3-build-cache-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -30,5 +53,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/rush-plugin-manifest.json b/rush-plugins/rush-amazon-s3-build-cache-plugin/rush-plugin-manifest.json index 7ee2c764935..bf2fa9de952 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-amazon-s3-build-cache-plugin", "description": "Rush plugin for Amazon S3 cloud build cache", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/amazon-s3-config.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/amazon-s3-config.schema.json" } ] } diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/config/api-extractor.json b/rush-plugins/rush-azure-storage-build-cache-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/config/api-extractor.json +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json index 15b933f37f3..3605afaba46 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json @@ -8,8 +8,31 @@ "directory": "heft-plugins/heft-webpack5-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -30,5 +53,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/rush-plugin-manifest.json b/rush-plugins/rush-azure-storage-build-cache-plugin/rush-plugin-manifest.json index 92d33cef831..bfd4ef894a6 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/rush-plugin-manifest.json @@ -4,14 +4,14 @@ { "pluginName": "rush-azure-storage-build-cache-plugin", "description": "Rush plugin for Azure storage cloud build cache", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/azure-blob-storage-config.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/azure-blob-storage-config.schema.json" }, { "pluginName": "rush-azure-interactive-auth-plugin", "description": "Rush plugin for interactive authentication to Azure", - "entryPoint": "lib/RushAzureInteractiveAuthPlugin.js", - "optionsSchema": "lib/schemas/azure-interactive-auth.schema.json" + "entryPoint": "./lib-commonjs/RushAzureInteractiveAuthPlugin.js", + "optionsSchema": "./lib-commonjs/schemas/azure-interactive-auth.schema.json" } ] } diff --git a/rush-plugins/rush-bridge-cache-plugin/package.json b/rush-plugins/rush-bridge-cache-plugin/package.json index 4f94ed753c7..8af3a4e8cc4 100644 --- a/rush-plugins/rush-bridge-cache-plugin/package.json +++ b/rush-plugins/rush-bridge-cache-plugin/package.json @@ -3,14 +3,37 @@ "version": "5.168.0", "description": "Rush plugin that provides a --set-cache-only command flag to populate the cache from content on disk.", "license": "MIT", - "main": "lib/index.js", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", "repository": { "url": "https://github.com/microsoft/rushstack", "type": "git", "directory": "rush-plugins/rush-bridge-cache-plugin" }, "homepage": "https://rushjs.io", - "types": "lib/index.d.ts", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft test --clean", "start": "heft test --clean --watch", @@ -26,5 +49,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-bridge-cache-plugin/rush-plugin-manifest.json b/rush-plugins/rush-bridge-cache-plugin/rush-plugin-manifest.json index 481c0fa550f..372c2041705 100644 --- a/rush-plugins/rush-bridge-cache-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-bridge-cache-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-bridge-cache-plugin", "description": "Rush plugin that provides the ability to directly read or write the build cache from the command line via a custom choice parameter on build commands.", - "entryPoint": "./lib/index.js", - "optionsSchema": "lib/schemas/bridge-cache-config.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/bridge-cache-config.schema.json" } ] } diff --git a/rush-plugins/rush-buildxl-graph-plugin/config/api-extractor.json b/rush-plugins/rush-buildxl-graph-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/rush-plugins/rush-buildxl-graph-plugin/config/api-extractor.json +++ b/rush-plugins/rush-buildxl-graph-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/rush-plugins/rush-buildxl-graph-plugin/package.json b/rush-plugins/rush-buildxl-graph-plugin/package.json index a24c2f5967f..4a200bce24f 100644 --- a/rush-plugins/rush-buildxl-graph-plugin/package.json +++ b/rush-plugins/rush-buildxl-graph-plugin/package.json @@ -8,8 +8,31 @@ "directory": "rush-plugins/rush-buildxl-graph-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -28,5 +51,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-buildxl-graph-plugin/rush-plugin-manifest.json b/rush-plugins/rush-buildxl-graph-plugin/rush-plugin-manifest.json index a46fec2ce25..eac09fad7a9 100644 --- a/rush-plugins/rush-buildxl-graph-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-buildxl-graph-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-buildxl-graph-plugin", "description": "Plugin for providing access to Rush build graph.", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/rush-buildxl-graph-plugin.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/rush-buildxl-graph-plugin.schema.json" } ] } diff --git a/rush-plugins/rush-http-build-cache-plugin/package.json b/rush-plugins/rush-http-build-cache-plugin/package.json index 3dfe5400adc..c6517f241ed 100644 --- a/rush-plugins/rush-http-build-cache-plugin/package.json +++ b/rush-plugins/rush-http-build-cache-plugin/package.json @@ -8,8 +8,31 @@ "directory": "rush-plugins/rush-http-build-cache-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -30,5 +53,6 @@ "@rushstack/terminal": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-http-build-cache-plugin/rush-plugin-manifest.json b/rush-plugins/rush-http-build-cache-plugin/rush-plugin-manifest.json index 0018d99f4ca..08518e643e5 100644 --- a/rush-plugins/rush-http-build-cache-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-http-build-cache-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-http-build-cache-plugin", "description": "Rush plugin for generic HTTP build cache", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/http-config.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/http-config.schema.json" } ] } diff --git a/rush-plugins/rush-litewatch-plugin/package.json b/rush-plugins/rush-litewatch-plugin/package.json index 1e27d7c6274..ede71c66b88 100644 --- a/rush-plugins/rush-litewatch-plugin/package.json +++ b/rush-plugins/rush-litewatch-plugin/package.json @@ -23,5 +23,28 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" + }, + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } } } diff --git a/rush-plugins/rush-mcp-docs-plugin/package.json b/rush-plugins/rush-mcp-docs-plugin/package.json index 91936b91465..eecbb6248f9 100644 --- a/rush-plugins/rush-mcp-docs-plugin/package.json +++ b/rush-plugins/rush-mcp-docs-plugin/package.json @@ -8,8 +8,29 @@ "directory": "rush-plugins/rush-mcp-docs-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -25,5 +46,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-mcp-docs-plugin/rush-mcp-plugin.json b/rush-plugins/rush-mcp-docs-plugin/rush-mcp-plugin.json index 61d2750e169..518d2beeb56 100644 --- a/rush-plugins/rush-mcp-docs-plugin/rush-mcp-plugin.json +++ b/rush-plugins/rush-mcp-docs-plugin/rush-mcp-plugin.json @@ -15,10 +15,10 @@ * * The config file path will be `/common/config/rush-mcp/.json`. */ - // "configFileSchema": "./lib/rush-mcp-example-plugin.schema.json", + // "configFileSchema": "./lib-commonjs/rush-mcp-example-plugin.schema.json", /** * The entry point, whose default export should be a class that implements */ - "entryPoint": "./lib/index.js" + "entryPoint": "./lib-commonjs/index.js" } diff --git a/rush-plugins/rush-redis-cobuild-plugin/config/api-extractor.json b/rush-plugins/rush-redis-cobuild-plugin/config/api-extractor.json index 74590d3c4f8..05559c8de5e 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/config/api-extractor.json +++ b/rush-plugins/rush-redis-cobuild-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, "reportFolder": "../../../common/reviews/api" diff --git a/rush-plugins/rush-redis-cobuild-plugin/package.json b/rush-plugins/rush-redis-cobuild-plugin/package.json index 5de0d9009a5..4988c31c338 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/package.json +++ b/rush-plugins/rush-redis-cobuild-plugin/package.json @@ -8,8 +8,31 @@ "directory": "rush-plugins/rush-redis-cobuild-plugin" }, "homepage": "https://rushjs.io", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -29,5 +52,6 @@ "@rushstack/terminal": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-redis-cobuild-plugin/rush-plugin-manifest.json b/rush-plugins/rush-redis-cobuild-plugin/rush-plugin-manifest.json index 64ebf15d963..aedc0ffd0fc 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-redis-cobuild-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-redis-cobuild-plugin", "description": "Rush plugin for Redis cobuild lock", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/redis-config.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/redis-config.schema.json" } ] } diff --git a/rush-plugins/rush-resolver-cache-plugin/config/api-extractor.json b/rush-plugins/rush-resolver-cache-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/rush-plugins/rush-resolver-cache-plugin/config/api-extractor.json +++ b/rush-plugins/rush-resolver-cache-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/rush-plugins/rush-resolver-cache-plugin/package.json b/rush-plugins/rush-resolver-cache-plugin/package.json index 379c1521196..ebcc1893880 100644 --- a/rush-plugins/rush-resolver-cache-plugin/package.json +++ b/rush-plugins/rush-resolver-cache-plugin/package.json @@ -8,8 +8,9 @@ "type": "git", "directory": "rush-plugins/rush-resolver-cache-plugin" }, - "main": "lib-commonjs/index.js", - "types": "dist/rush-resolver-cache-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/rush-resolver-cache-plugin.d.ts", "scripts": { "build": "heft test --clean", "_phase:build": "heft run --only build -- --clean", @@ -30,16 +31,27 @@ }, "exports": { ".": { - "require": "./lib/index.js", - "types": "./dist/rush-resolver-cache-plugin.d.ts" + "types": "./dist/rush-resolver-cache-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", "./package.json": "./package.json" }, "typesVersions": { "*": { ".": [ "dist/rush-resolver-cache-plugin.d.ts" + ], + "lib/*": [ + "lib-dts/*" ] } - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-resolver-cache-plugin/rush-plugin-manifest.json b/rush-plugins/rush-resolver-cache-plugin/rush-plugin-manifest.json index 8911f040259..916540b96a5 100644 --- a/rush-plugins/rush-resolver-cache-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-resolver-cache-plugin/rush-plugin-manifest.json @@ -4,7 +4,7 @@ { "pluginName": "rush-resolver-cache-plugin", "description": "Rush plugin for generating a resolver cache file after successful install.", - "entryPoint": "lib/index.js" + "entryPoint": "./lib-commonjs/index.js" } ] } diff --git a/rush-plugins/rush-serve-plugin/config/api-extractor.json b/rush-plugins/rush-serve-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/rush-plugins/rush-serve-plugin/config/api-extractor.json +++ b/rush-plugins/rush-serve-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/rush-plugins/rush-serve-plugin/package.json b/rush-plugins/rush-serve-plugin/package.json index 12470ccc612..62f6a2175d2 100644 --- a/rush-plugins/rush-serve-plugin/package.json +++ b/rush-plugins/rush-serve-plugin/package.json @@ -8,8 +8,9 @@ "type": "git", "directory": "rush-plugins/rush-serve-plugin" }, - "main": "lib-commonjs/index.js", - "types": "dist/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/index.d.ts", "scripts": { "build": "heft test --clean", "_phase:build": "heft run --only build -- --clean", @@ -40,12 +41,20 @@ }, "exports": { ".": { - "require": "./lib/index.js", - "types": "./dist/rush-serve-plugin.d.ts" + "types": "./dist/rush-serve-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" }, "./api": { - "types": "./lib/api.types.d.ts" + "types": "./lib-dts/api.types.d.ts" }, + "./lib/*.schema.json": "./lib-commonjs/*.schema.json", + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./rush-plugin-manifest.json": "./rush-plugin-manifest.json", "./package.json": "./package.json" }, "typesVersions": { @@ -54,8 +63,12 @@ "dist/rush-serve-plugin.d.ts" ], "api": [ - "lib/api.types.d.ts" + "lib-dts/api.types.d.ts" + ], + "lib/*": [ + "lib-dts/*" ] } - } + }, + "sideEffects": false } diff --git a/rush-plugins/rush-serve-plugin/rush-plugin-manifest.json b/rush-plugins/rush-serve-plugin/rush-plugin-manifest.json index d8421eaf3a4..f1e04d9cef8 100644 --- a/rush-plugins/rush-serve-plugin/rush-plugin-manifest.json +++ b/rush-plugins/rush-serve-plugin/rush-plugin-manifest.json @@ -4,8 +4,8 @@ { "pluginName": "rush-serve-plugin", "description": "Rush plugin for serving built files from localhost", - "entryPoint": "lib/index.js", - "optionsSchema": "lib/schemas/rush-serve-plugin-options.schema.json" + "entryPoint": "./lib-commonjs/index.js", + "optionsSchema": "./lib-commonjs/schemas/rush-serve-plugin-options.schema.json" } ] } diff --git a/vscode-extensions/debug-certificate-manager-vscode-extension/package.json b/vscode-extensions/debug-certificate-manager-vscode-extension/package.json index 1c1f7d3d086..271aa6a85cb 100644 --- a/vscode-extensions/debug-certificate-manager-vscode-extension/package.json +++ b/vscode-extensions/debug-certificate-manager-vscode-extension/package.json @@ -122,5 +122,6 @@ "@types/node": "20.17.19", "@types/vscode": "1.103.0", "@types/webpack-env": "1.18.8" - } + }, + "sideEffects": false } diff --git a/vscode-extensions/playwright-local-browser-server-vscode-extension/package.json b/vscode-extensions/playwright-local-browser-server-vscode-extension/package.json index 1cff56f68ea..99c5c4c97b2 100644 --- a/vscode-extensions/playwright-local-browser-server-vscode-extension/package.json +++ b/vscode-extensions/playwright-local-browser-server-vscode-extension/package.json @@ -109,5 +109,6 @@ "@types/node": "20.17.19", "@types/vscode": "1.103.0", "@types/webpack-env": "1.18.8" - } + }, + "sideEffects": false } diff --git a/vscode-extensions/rush-vscode-command-webview/package.json b/vscode-extensions/rush-vscode-command-webview/package.json index 1b6991c2e6d..7d36d6cdad3 100644 --- a/vscode-extensions/rush-vscode-command-webview/package.json +++ b/vscode-extensions/rush-vscode-command-webview/package.json @@ -9,7 +9,8 @@ "directory": "vscode-extensions/rush-vscode-command-webview" }, "license": "MIT", - "main": "./lib/index.js", + "main": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", "scripts": { "_phase:build": "heft build --clean", "_phase:test": "", @@ -41,5 +42,6 @@ "local-web-rig": "workspace:*", "webpack": "~5.105.2", "webpack-bundle-analyzer": "~4.5.0" - } + }, + "sideEffects": false } diff --git a/vscode-extensions/rush-vscode-command-webview/webpack.config.js b/vscode-extensions/rush-vscode-command-webview/webpack.config.js index fc39d6df9e3..d729dd7a999 100644 --- a/vscode-extensions/rush-vscode-command-webview/webpack.config.js +++ b/vscode-extensions/rush-vscode-command-webview/webpack.config.js @@ -16,7 +16,7 @@ function createWebpackConfig({ production }) { } }, entry: { - ['bundle']: path.join(__dirname, 'lib', 'entry.js') + bundle: path.join(__dirname, 'lib-esm', 'entry.js') }, output: { path: path.join(__dirname, 'dist'), diff --git a/vscode-extensions/rush-vscode-extension/package.json b/vscode-extensions/rush-vscode-extension/package.json index 82ac18b350a..cc524ace78e 100644 --- a/vscode-extensions/rush-vscode-extension/package.json +++ b/vscode-extensions/rush-vscode-extension/package.json @@ -314,5 +314,6 @@ }, "engines": { "vscode": "^1.103.0" - } + }, + "sideEffects": false } diff --git a/webpack/hashed-folder-copy-plugin/config/api-extractor.json b/webpack/hashed-folder-copy-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/hashed-folder-copy-plugin/config/api-extractor.json +++ b/webpack/hashed-folder-copy-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/hashed-folder-copy-plugin/config/heft.json b/webpack/hashed-folder-copy-plugin/config/heft.json index 8e62ffe9487..34e1f80b425 100644 --- a/webpack/hashed-folder-copy-plugin/config/heft.json +++ b/webpack/hashed-folder-copy-plugin/config/heft.json @@ -41,7 +41,7 @@ { "sourcePath": "./src/test/scenarios/", "includeGlobs": ["**/*"], - "destinationFolders": ["lib/test/scenarios"] + "destinationFolders": ["lib-commonjs/test/scenarios"] } ] } diff --git a/webpack/hashed-folder-copy-plugin/package.json b/webpack/hashed-folder-copy-plugin/package.json index 296dfc95dd9..ac038f1d49e 100644 --- a/webpack/hashed-folder-copy-plugin/package.json +++ b/webpack/hashed-folder-copy-plugin/package.json @@ -2,19 +2,22 @@ "name": "@rushstack/hashed-folder-copy-plugin", "version": "1.2.14", "description": "Webpack plugin for copying a folder to the output directory with a hash in the folder name.", - "typings": "dist/hashed-folder-copy-plugin.d.ts", - "main": "lib/index.js", + "types": "./dist/hashed-folder-copy-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", "exports": { ".": { "types": "./dist/hashed-folder-copy-plugin.d.ts", - "default": "./lib/index.js" + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" }, "./ambientTypes": { "types": "./dist/ambientTypes.d.ts" }, "./lib/*": { - "types": "./lib/*.d.ts", - "default": "./lib/*.js" + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" }, "./package.json": "./package.json" }, @@ -25,6 +28,9 @@ ], "ambientTypes": [ "./dist/ambientTypes.d.ts" + ], + "lib/*": [ + "lib-dts/*" ] } }, @@ -53,5 +59,6 @@ "local-node-rig": "workspace:*", "memfs": "4.12.0", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/webpack/loader-load-themed-styles/config/api-extractor.json b/webpack/loader-load-themed-styles/config/api-extractor.json index dcfa9cfc5b7..c1ce1e4d743 100644 --- a/webpack/loader-load-themed-styles/config/api-extractor.json +++ b/webpack/loader-load-themed-styles/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/loader-load-themed-styles/package.json b/webpack/loader-load-themed-styles/package.json index e7cd564e5f5..1ac88fbdcf0 100644 --- a/webpack/loader-load-themed-styles/package.json +++ b/webpack/loader-load-themed-styles/package.json @@ -2,8 +2,29 @@ "name": "@microsoft/loader-load-themed-styles", "version": "2.1.125", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -34,5 +55,6 @@ "@types/webpack": "4.41.32", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/webpack/loader-raw-script/package.json b/webpack/loader-raw-script/package.json index d72a874bb28..4c049f40220 100644 --- a/webpack/loader-raw-script/package.json +++ b/webpack/loader-raw-script/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/loader-raw-script", "version": "1.5.14", "description": "", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -22,5 +43,6 @@ "@rushstack/heft": "workspace:*", "eslint": "~9.37.0", "local-node-rig": "workspace:*" - } + }, + "sideEffects": false } diff --git a/webpack/preserve-dynamic-require-plugin/config/api-extractor.json b/webpack/preserve-dynamic-require-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/preserve-dynamic-require-plugin/config/api-extractor.json +++ b/webpack/preserve-dynamic-require-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/preserve-dynamic-require-plugin/package.json b/webpack/preserve-dynamic-require-plugin/package.json index 555ed428372..c67dfc22d67 100644 --- a/webpack/preserve-dynamic-require-plugin/package.json +++ b/webpack/preserve-dynamic-require-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack-preserve-dynamic-require-plugin", "version": "0.11.125", "description": "This plugin tells webpack to leave dynamic calls to \"require\" as-is instead of trying to bundle them.", - "main": "lib/index.js", - "typings": "dist/webpack-preserve-dynamic-require-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack-preserve-dynamic-require-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack-preserve-dynamic-require-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/set-webpack-public-path-plugin/config/api-extractor.json b/webpack/set-webpack-public-path-plugin/config/api-extractor.json index 31010bc6261..f18620460f8 100644 --- a/webpack/set-webpack-public-path-plugin/config/api-extractor.json +++ b/webpack/set-webpack-public-path-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/set-webpack-public-path-plugin/package.json b/webpack/set-webpack-public-path-plugin/package.json index 261b00c49e1..419b5775c45 100644 --- a/webpack/set-webpack-public-path-plugin/package.json +++ b/webpack/set-webpack-public-path-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/set-webpack-public-path-plugin", "version": "5.2.15", "description": "This plugin sets the webpack public path at runtime.", - "main": "lib/index.js", - "typings": "dist/set-webpack-public-path-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/set-webpack-public-path-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/set-webpack-public-path-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -34,5 +55,6 @@ "local-node-rig": "workspace:*", "memfs": "4.12.0", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/webpack/webpack-deep-imports-plugin/README.md b/webpack/webpack-deep-imports-plugin/README.md index b26aa1ac02b..4eada1e0e2d 100644 --- a/webpack/webpack-deep-imports-plugin/README.md +++ b/webpack/webpack-deep-imports-plugin/README.md @@ -32,12 +32,12 @@ const { DeepImportsPlugin } = require('@rushstack/webpack-deep-imports-plugin'); const configuration = { entry: { - 'my-project': `${__dirname}/lib-esnext/index.js` + 'my-project': `${__dirname}/lib-esm/index.js` }, plugins: [ new DeepImportsPlugin({ path: `${__dirname}/dist/my-project-manifest.json`, // From `DllPlugin`'s options - inFolderName: 'lib-esnext', // The folder containing the original loose files and the entrypoint + inFolderName: 'lib-esm', // The folder containing the original loose files and the entrypoint outFolderName: 'lib', // The folder where the bundle and commonJS files will be written pathsToIgnore: ['folder/not-included-in-bundle.js'], dTsFilesInputFolderName: 'lib-commonjs' // The folder containing loose .d.ts files diff --git a/webpack/webpack-deep-imports-plugin/config/api-extractor.json b/webpack/webpack-deep-imports-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack-deep-imports-plugin/config/api-extractor.json +++ b/webpack/webpack-deep-imports-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack-deep-imports-plugin/package.json b/webpack/webpack-deep-imports-plugin/package.json index 2f33c47edeb..0e56aafcd7a 100644 --- a/webpack/webpack-deep-imports-plugin/package.json +++ b/webpack/webpack-deep-imports-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack-deep-imports-plugin", "version": "0.0.0", "description": "This plugin creates a bundle and commonJS files in a 'lib' folder mirroring modules in another 'lib' folder.", - "main": "lib/index.js", - "typings": "dist/webpack-deep-imports-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack-deep-imports-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack-deep-imports-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/webpack-embedded-dependencies-plugin/config/api-extractor.json b/webpack/webpack-embedded-dependencies-plugin/config/api-extractor.json index 31010bc6261..f18620460f8 100644 --- a/webpack/webpack-embedded-dependencies-plugin/config/api-extractor.json +++ b/webpack/webpack-embedded-dependencies-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack-embedded-dependencies-plugin/package.json b/webpack/webpack-embedded-dependencies-plugin/package.json index 451cfd01e07..a85863d9397 100644 --- a/webpack/webpack-embedded-dependencies-plugin/package.json +++ b/webpack/webpack-embedded-dependencies-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack-embedded-dependencies-plugin", "version": "0.3.15", "description": "This plugin analyzes bundled dependencies from Node Modules for use with Component Governance and License Scanning.", - "main": "lib/index.js", - "typings": "dist/webpack-embedded-dependencies-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack-embedded-dependencies-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack-embedded-dependencies-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -34,5 +55,6 @@ "local-node-rig": "workspace:*", "webpack": "~5.105.2", "memfs": "4.12.0" - } + }, + "sideEffects": false } diff --git a/webpack/webpack-plugin-utilities/config/api-extractor.json b/webpack/webpack-plugin-utilities/config/api-extractor.json index 31010bc6261..f18620460f8 100644 --- a/webpack/webpack-plugin-utilities/config/api-extractor.json +++ b/webpack/webpack-plugin-utilities/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack-plugin-utilities/package.json b/webpack/webpack-plugin-utilities/package.json index 38744edcf90..bac22b80ea6 100644 --- a/webpack/webpack-plugin-utilities/package.json +++ b/webpack/webpack-plugin-utilities/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack-plugin-utilities", "version": "0.5.14", "description": "This plugin sets the webpack public path at runtime.", - "main": "lib/index.js", - "typings": "dist/webpack-plugin-utilities.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack-plugin-utilities.d.ts", + "exports": { + ".": { + "types": "./dist/webpack-plugin-utilities.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -36,5 +57,6 @@ "local-node-rig": "workspace:*", "@types/tapable": "1.0.6", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/webpack/webpack-workspace-resolve-plugin/config/api-extractor.json b/webpack/webpack-workspace-resolve-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack-workspace-resolve-plugin/config/api-extractor.json +++ b/webpack/webpack-workspace-resolve-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack-workspace-resolve-plugin/package.json b/webpack/webpack-workspace-resolve-plugin/package.json index 438923a23cb..645c8ce5559 100644 --- a/webpack/webpack-workspace-resolve-plugin/package.json +++ b/webpack/webpack-workspace-resolve-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack-workspace-resolve-plugin", "version": "0.5.14", "description": "This plugin leverages workspace-level metadata to greatly accelerate module resolution.", - "main": "lib/index.js", - "typings": "dist/webpack-workspace-resolve-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack-workspace-resolve-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack-workspace-resolve-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/webpack4-localization-plugin/config/api-extractor.json b/webpack/webpack4-localization-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack4-localization-plugin/config/api-extractor.json +++ b/webpack/webpack4-localization-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack4-localization-plugin/package.json b/webpack/webpack4-localization-plugin/package.json index 84fbc33742b..45d98f628e8 100644 --- a/webpack/webpack4-localization-plugin/package.json +++ b/webpack/webpack4-localization-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack4-localization-plugin", "version": "0.19.14", "description": "This plugin facilitates localization with Webpack.", - "main": "lib/index.js", - "typings": "dist/webpack4-localization-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack4-localization-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack4-localization-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -48,5 +69,6 @@ "eslint": "~9.37.0", "local-node-rig": "workspace:*", "webpack": "~4.47.0" - } + }, + "sideEffects": false } diff --git a/webpack/webpack4-module-minifier-plugin/config/api-extractor.json b/webpack/webpack4-module-minifier-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack4-module-minifier-plugin/config/api-extractor.json +++ b/webpack/webpack4-module-minifier-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack4-module-minifier-plugin/package.json b/webpack/webpack4-module-minifier-plugin/package.json index 99e65c4e474..2aab0450dd4 100644 --- a/webpack/webpack4-module-minifier-plugin/package.json +++ b/webpack/webpack4-module-minifier-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack4-module-minifier-plugin", "version": "0.14.14", "description": "This plugin splits minification of webpack compilations into smaller units.", - "main": "lib/index.js", - "typings": "dist/webpack4-module-minifier-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack4-module-minifier-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack4-module-minifier-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -53,6 +74,7 @@ "webpack": "~4.47.0" }, "sideEffects": [ - "./lib/OverrideWebpackIdentifierAllocation" + "lib-esm/OverrideWebpackIdentifierAllocation.js", + "lib-commonjs/OverrideWebpackIdentifierAllocation.js" ] } diff --git a/webpack/webpack5-load-themed-styles-loader/config/api-extractor.json b/webpack/webpack5-load-themed-styles-loader/config/api-extractor.json index dcfa9cfc5b7..c1ce1e4d743 100644 --- a/webpack/webpack5-load-themed-styles-loader/config/api-extractor.json +++ b/webpack/webpack5-load-themed-styles-loader/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack5-load-themed-styles-loader/package.json b/webpack/webpack5-load-themed-styles-loader/package.json index e6651ee3519..0081d4b08f1 100644 --- a/webpack/webpack5-load-themed-styles-loader/package.json +++ b/webpack/webpack5-load-themed-styles-loader/package.json @@ -2,8 +2,29 @@ "name": "@microsoft/webpack5-load-themed-styles-loader", "version": "0.3.14", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./lib-dts/index.d.ts", + "exports": { + ".": { + "types": "./lib-dts/index.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -33,5 +54,6 @@ "local-node-rig": "workspace:*", "memfs": "4.12.0", "webpack": "~5.105.2" - } + }, + "sideEffects": false } diff --git a/webpack/webpack5-load-themed-styles-loader/src/test/LoadThemedStylesLoader.test.ts b/webpack/webpack5-load-themed-styles-loader/src/test/LoadThemedStylesLoader.test.ts index 13fc998b7dc..06b09544e36 100644 --- a/webpack/webpack5-load-themed-styles-loader/src/test/LoadThemedStylesLoader.test.ts +++ b/webpack/webpack5-load-themed-styles-loader/src/test/LoadThemedStylesLoader.test.ts @@ -40,7 +40,7 @@ describe('webpack5-load-themed-style-loader', () => { it('it allows for and inserts override of load-themed-styles path', async () => { // It would error when I attempt to use the .ts mock in src/test/testData // beacuse I'm not setting up default support for webpack to load .ts files. - const expectedPath: string = '../../../lib/test/testData/LoadThemedStylesMock'; + const expectedPath: string = '../../../lib-commonjs/test/testData/LoadThemedStylesMock'; const stats = await getCompiler('./MockStyle1.css', { loadThemedStylesPath: expectedPath }); if (!stats) { throw new Error(`Expected stats`); @@ -92,7 +92,7 @@ describe('webpack5-load-themed-style-loader', () => { // We mock the path of the loader because the full resolved path can change between machines // IE: Different folder topology, etc. So we just used the mocked module and set it // to loadThemedStylesPath option from the loader. - const expectedPath: string = '../../../lib/test/testData/LoadThemedStylesMock'; + const expectedPath: string = '../../../lib-commonjs/test/testData/LoadThemedStylesMock'; const stats = await getCompiler('./MockStyle1.css', { loadThemedStylesPath: expectedPath, esModule: true @@ -106,7 +106,7 @@ describe('webpack5-load-themed-style-loader', () => { }); it('generates desired loader output snapshot', async () => { - const expectedPath: string = '../../../lib/test/testData/LoadThemedStylesMock'; + const expectedPath: string = '../../../lib-commonjs/test/testData/LoadThemedStylesMock'; const stats = await getCompiler('./MockStyle1.css', { loadThemedStylesPath: expectedPath }); if (!stats) { throw new Error(`Expected stats`); diff --git a/webpack/webpack5-load-themed-styles-loader/src/test/__snapshots__/LoadThemedStylesLoader.test.ts.snap b/webpack/webpack5-load-themed-styles-loader/src/test/__snapshots__/LoadThemedStylesLoader.test.ts.snap index 6a9bb7fc79f..7bfacfd74ca 100644 --- a/webpack/webpack5-load-themed-styles-loader/src/test/__snapshots__/LoadThemedStylesLoader.test.ts.snap +++ b/webpack/webpack5-load-themed-styles-loader/src/test/__snapshots__/LoadThemedStylesLoader.test.ts.snap @@ -2,7 +2,7 @@ exports[`webpack5-load-themed-style-loader generates desired loader output snapshot: LoaderContent 1`] = ` "var content = require(\\"!!../../../../../common/temp/default/node_modules/.pnpm/css-loader@6.6.0_webpack@5.105.2/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./MockStyle1.css\\"); -var loader = require(\\"../../../lib/test/testData/LoadThemedStylesMock\\"); +var loader = require(\\"../../../lib-commonjs/test/testData/LoadThemedStylesMock\\"); if(typeof content === \\"string\\") content = [[module.id, content]]; @@ -14,7 +14,7 @@ if(content.locals) module.exports = content.locals;" exports[`webpack5-load-themed-style-loader generates desired output for esModule option set to "true" as a snapshot: LoaderContent ESModule 1`] = ` "import content from \\"!!../../../../../common/temp/default/node_modules/.pnpm/css-loader@6.6.0_webpack@5.105.2/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./MockStyle1.css\\"; -import { loadStyles } from \\"../../../lib/test/testData/LoadThemedStylesMock\\"; +import { loadStyles } from \\"../../../lib-commonjs/test/testData/LoadThemedStylesMock\\"; if(typeof content === \\"string\\") content = [[module.id, content]]; diff --git a/webpack/webpack5-localization-plugin/config/api-extractor.json b/webpack/webpack5-localization-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack5-localization-plugin/config/api-extractor.json +++ b/webpack/webpack5-localization-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack5-localization-plugin/package.json b/webpack/webpack5-localization-plugin/package.json index 2304fbeaa6c..2156a4784ee 100644 --- a/webpack/webpack5-localization-plugin/package.json +++ b/webpack/webpack5-localization-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack5-localization-plugin", "version": "0.15.14", "description": "This plugin facilitates localization with Webpack.", - "main": "lib/index.js", - "typings": "dist/webpack5-localization-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack5-localization-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack5-localization-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", @@ -36,5 +57,6 @@ "@types/node": { "optional": true } - } + }, + "sideEffects": false } diff --git a/webpack/webpack5-module-minifier-plugin/config/api-extractor.json b/webpack/webpack5-module-minifier-plugin/config/api-extractor.json index fba8a2992f6..1d56fc29ae1 100644 --- a/webpack/webpack5-module-minifier-plugin/config/api-extractor.json +++ b/webpack/webpack5-module-minifier-plugin/config/api-extractor.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "/lib/index.d.ts", + "mainEntryPointFilePath": "/lib-dts/index.d.ts", "apiReport": { "enabled": true, diff --git a/webpack/webpack5-module-minifier-plugin/package.json b/webpack/webpack5-module-minifier-plugin/package.json index 4b987484588..ab666641fea 100644 --- a/webpack/webpack5-module-minifier-plugin/package.json +++ b/webpack/webpack5-module-minifier-plugin/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/webpack5-module-minifier-plugin", "version": "5.7.0", "description": "This plugin splits minification of webpack compilations into smaller units.", - "main": "lib/index.js", - "typings": "dist/webpack5-module-minifier-plugin.d.ts", + "main": "./lib-commonjs/index.js", + "module": "./lib-esm/index.js", + "types": "./dist/webpack5-module-minifier-plugin.d.ts", + "exports": { + ".": { + "types": "./dist/webpack5-module-minifier-plugin.d.ts", + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" + }, + "./lib/*": { + "types": "./lib-dts/*.d.ts", + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git",