diff --git a/.gitignore b/.gitignore index 68c897ad310..c0fae6d5c91 100644 --- a/.gitignore +++ b/.gitignore @@ -107,17 +107,17 @@ common/autoinstallers/*/.npmrc *.lock # Common toolchain intermediate files -temp/ -lib/ +dist-storybook/ +dist/ lib-amd/ +lib-commonjs/ lib-dts/ lib-es6/ lib-esm/ lib-esnext/ -lib-commonjs/ lib-shim/ -dist/ -dist-storybook/ +lib/ +temp/ *.tsbuildinfo # Heft temporary files 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 2edd2ae1a2e..4a499b2dffb 100644 --- a/apps/api-documenter/package.json +++ b/apps/api-documenter/package.json @@ -17,8 +17,29 @@ "bin": { "api-documenter": "./bin/api-documenter" }, - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/rollup.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/rollup.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "dependencies": { "@microsoft/api-extractor-model": "workspace:*", "@microsoft/tsdoc": "~0.15.1", diff --git a/apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts b/apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts index 0050b7147ce..467ebd96171 100644 --- a/apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts +++ b/apps/api-documenter/src/documenters/OfficeYamlDocumenter.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import yaml = require('js-yaml'); +import yaml from 'js-yaml'; import type { ApiModel } from '@microsoft/api-extractor-model'; import { FileSystem } from '@rushstack/node-core-library'; diff --git a/apps/api-documenter/src/documenters/YamlDocumenter.ts b/apps/api-documenter/src/documenters/YamlDocumenter.ts index b165622ce84..5a600fd6d6a 100644 --- a/apps/api-documenter/src/documenters/YamlDocumenter.ts +++ b/apps/api-documenter/src/documenters/YamlDocumenter.ts @@ -3,7 +3,7 @@ import * as path from 'path'; -import yaml = require('js-yaml'); +import yaml from 'js-yaml'; import { JsonFile, JsonSchema, diff --git a/apps/api-documenter/src/utils/ToSdpConvertHelper.ts b/apps/api-documenter/src/utils/ToSdpConvertHelper.ts index 2de3530d9fc..d4cf4b28d47 100644 --- a/apps/api-documenter/src/utils/ToSdpConvertHelper.ts +++ b/apps/api-documenter/src/utils/ToSdpConvertHelper.ts @@ -19,7 +19,7 @@ import type { } from '../yaml/ISDPYamlFile'; import path from 'path'; import { FileSystem, Encoding, NewlineKind } from '@rushstack/node-core-library'; -import yaml = require('js-yaml'); +import yaml from 'js-yaml'; export function convertUDPYamlToSDP(folderPath: string): void { convert(folderPath, folderPath); diff --git a/apps/api-extractor/.npmignore b/apps/api-extractor/.npmignore index 8b61d7caa66..bc349f9a4be 100644 --- a/apps/api-extractor/.npmignore +++ b/apps/api-extractor/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- -!/extends/*.json 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/package.json b/apps/api-extractor/package.json index 3ef8224158b..84bc3398c71 100644 --- a/apps/api-extractor/package.json +++ b/apps/api-extractor/package.json @@ -25,8 +25,29 @@ "directory": "apps/api-extractor" }, "homepage": "https://api-extractor.com", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/rollup.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/rollup.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "bin": { "api-extractor": "./bin/api-extractor" }, @@ -53,7 +74,7 @@ }, "devDependencies": { "decoupled-local-node-rig": "workspace:*", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/lodash": "4.14.116", "@types/minimatch": "3.0.5", "@types/resolve": "1.20.2", diff --git a/apps/api-extractor/src/api/ExtractorConfig.ts b/apps/api-extractor/src/api/ExtractorConfig.ts index 5f9a739c820..0d607a1f1cd 100644 --- a/apps/api-extractor/src/api/ExtractorConfig.ts +++ b/apps/api-extractor/src/api/ExtractorConfig.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import * as resolve from 'resolve'; -import lodash = require('lodash'); +import lodash from 'lodash'; import { JsonFile, JsonSchema, diff --git a/apps/heft/.npmignore b/apps/heft/.npmignore index 3b7d5ed9526..472d3f38bec 100644 --- a/apps/heft/.npmignore +++ b/apps/heft/.npmignore @@ -33,4 +33,4 @@ !/includes/** !UPGRADING.md - +lib-*/root-lib/ 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 new file mode 100644 index 00000000000..5e01fd31703 --- /dev/null +++ b/apps/heft/config/heft.json @@ -0,0 +1,37 @@ +/** + * 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. + * + * To delete an inherited setting, set it to `null` in this file. + */ + "extends": "decoupled-local-node-rig/profiles/default/config/heft.json", + + "phasesByName": { + "build": { + "tasksByName": { + "copy-lib-start": { + "taskDependencies": ["transpile"], + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + { + "sourcePath": "lib-commonjs/root-lib", + "destinationFolders": ["lib"], + "fileExtensions": [".js", ".map"] + } + ] + } + } + } + } + } + } +} 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 97a4f5c6101..2399d6a7bd3 100644 --- a/apps/heft/package.json +++ b/apps/heft/package.json @@ -21,8 +21,29 @@ "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", + "typings": "dist/heft.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/heft.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "bin": { "heft": "./bin/heft" }, @@ -49,7 +70,7 @@ }, "devDependencies": { "@microsoft/api-extractor": "workspace:*", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/watchpack": "2.4.0", "decoupled-local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" diff --git a/apps/heft/src/root-lib/start.ts b/apps/heft/src/root-lib/start.ts new file mode 100644 index 00000000000..b1948c96695 --- /dev/null +++ b/apps/heft/src/root-lib/start.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +// For compatibility globally-installed copies of Heft have the `startWithVersionSelector.js` script that points +// at 'lib/start.js' + +require('../lib-commonjs/start'); diff --git a/apps/heft/src/startWithVersionSelector.ts b/apps/heft/src/startWithVersionSelector.ts index d78da294bbe..3fe2e716ed6 100644 --- a/apps/heft/src/startWithVersionSelector.ts +++ b/apps/heft/src/startWithVersionSelector.ts @@ -20,7 +20,7 @@ function tryGetPackageFolderFor(resolvedFileOrFolderPath: string): string | unde // } // Is resolvedFileOrFolderPath itself a folder with a package.json file? If so, return it. - if (fs.existsSync(path.join(resolvedFileOrFolderPath, 'package.json'))) { + if (fs.existsSync(`${resolvedFileOrFolderPath}/package.json`)) { // this._packageFolderCache.set(resolvedFileOrFolderPath, resolvedFileOrFolderPath); return resolvedFileOrFolderPath; } @@ -69,7 +69,7 @@ function tryStartLocalHeft(): boolean { if (projectFolder) { let heftEntryPoint: string; try { - const packageJsonPath: string = path.join(projectFolder, 'package.json'); + const packageJsonPath: string = `${projectFolder}/package.json`; const packageJsonContent: string = fs.readFileSync(packageJsonPath).toString(); let packageJson: IPackageJson; try { @@ -89,9 +89,9 @@ function tryStartLocalHeft(): boolean { // To avoid a loading the "resolve" NPM package, let's assume that the Heft dependency must be // installed as "/node_modules/@rushstack/heft". - const heftFolder: string = path.join(projectFolder, 'node_modules', Constants.heftPackageName); + const heftFolder: string = `${projectFolder}/node_modules/${Constants.heftPackageName}`; - heftEntryPoint = path.join(heftFolder, 'lib', 'start.js'); + heftEntryPoint = `${heftFolder}/lib-commonjs/start.js`; if (!fs.existsSync(heftEntryPoint)) { throw new Error('Unable to find Heft entry point: ' + heftEntryPoint); } diff --git a/apps/rundown/src/launcher.ts b/apps/rundown/src/launcher.ts index 8df4d4a9ef7..7d62a7e6f92 100644 --- a/apps/rundown/src/launcher.ts +++ b/apps/rundown/src/launcher.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import moduleApi = require('module'); +import moduleApi from 'module'; import process from 'process'; import { LauncherAction } from './LauncherTypes'; // "import type" doesn't work with const enums diff --git a/build-tests-subspace/rush-lib-test/src/start.ts b/build-tests-subspace/rush-lib-test/src/start.ts index 8add230a7e2..1fa42773c1e 100644 --- a/build-tests-subspace/rush-lib-test/src/start.ts +++ b/build-tests-subspace/rush-lib-test/src/start.ts @@ -7,7 +7,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 -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-sdk-test/config/heft.json b/build-tests-subspace/rush-sdk-test/config/heft.json index f72878eb953..7bbc7cf1abc 100644 --- a/build-tests-subspace/rush-sdk-test/config/heft.json +++ b/build-tests-subspace/rush-sdk-test/config/heft.json @@ -7,12 +7,12 @@ "build": { "tasksByName": { "run-start": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "./lib/run-start.js" + "scriptPath": "./lib-commonjs/run-start.js" } } } diff --git a/common/config/rush/nonbrowser-approved-packages.json b/common/config/rush/nonbrowser-approved-packages.json index 231e28659cf..c256d5b33f6 100644 --- a/common/config/rush/nonbrowser-approved-packages.json +++ b/common/config/rush/nonbrowser-approved-packages.json @@ -158,6 +158,10 @@ "name": "@rushstack/heft-dev-cert-plugin", "allowedCategories": [ "libraries", "tests" ] }, + { + "name": "@rushstack/heft-isolated-typescript-transpile-plugin", + "allowedCategories": [ "libraries" ] + }, { "name": "@rushstack/heft-jest-plugin", "allowedCategories": [ "libraries", "tests" ] diff --git a/common/config/rush/pnpm-config.json b/common/config/rush/pnpm-config.json index b862ec1ff0a..ffc424675b4 100644 --- a/common/config/rush/pnpm-config.json +++ b/common/config/rush/pnpm-config.json @@ -224,7 +224,7 @@ // "allowedVersions": { "react": "17" }, // "allowAny": ["@babel/*"] // TODO: Remove once Heft is 1.0.0 - "allowAny": ["@rushstack/heft"], + "allowAny": ["@rushstack/heft", "@rushstack/heft-typescript-plugin"], "allowedVersions": { "webpack": "^4 || ^5" } @@ -250,13 +250,13 @@ } }, - "@emotion/styled": { + "@emotion/styled-base": { "peerDependencies": { "@types/react": ">=16" } }, - "@emotion/styled-base": { + "@emotion/styled": { "peerDependencies": { "@types/react": ">=16" } @@ -367,13 +367,13 @@ } }, - "react-router": { + "react-router-dom": { "peerDependencies": { "@types/react": ">=16" } }, - "react-router-dom": { + "react-router": { "peerDependencies": { "@types/react": ">=16" } diff --git a/common/config/subspaces/build-tests-subspace/.pnpmfile.cjs b/common/config/subspaces/build-tests-subspace/.pnpmfile.cjs index b7821599ca7..1fa62f986e8 100644 --- a/common/config/subspaces/build-tests-subspace/.pnpmfile.cjs +++ b/common/config/subspaces/build-tests-subspace/.pnpmfile.cjs @@ -62,6 +62,13 @@ function readPackage(packageJson, context) { fixUndeclaredDependency(packageJson, '@typescript-eslint/parser'); break; } + + case '@rushstack/heft-isolated-typescript-transpile-plugin': { + if (packageJson.peerDependencies['@rushstack/heft-typescript-plugin'] === 'workspace:^') { + // This is to make the local installation happy + packageJson.peerDependencies['@rushstack/heft-typescript-plugin'] = '^0.8.2'; + } + } } return packageJson; diff --git a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml index adcbd23621c..9a3a7f0f372 100644 --- a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml +++ b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml @@ -114,10 +114,10 @@ importers: version: file:../../../apps/heft(@types/node@20.17.19) '@rushstack/heft-lint-plugin': specifier: file:../../heft-plugins/heft-lint-plugin - version: file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19) + version: file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@rushstack/heft-typescript-plugin': specifier: file:../../heft-plugins/heft-typescript-plugin - version: file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19) + version: file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) eslint: specifier: ~8.57.0 version: 8.57.1 @@ -1019,6 +1019,131 @@ packages: '@sinonjs/commons': 3.0.1 dev: true + /@swc/core-darwin-arm64@1.7.10: + resolution: {integrity: sha512-TYp4x/9w/C/yMU1olK5hTKq/Hi7BjG71UJ4V1U1WxI1JA3uokjQ/GoktDfmH5V5pX4dgGSOJwUe2RjoN8Z/XnA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@swc/core-darwin-x64@1.7.10: + resolution: {integrity: sha512-P3LJjAWh5yLc6p5IUwV5LgRfA3R1oDCZDMabYyb2BVQuJTD4MfegW9DhBcUUF5dhBLwq3191KpLVzE+dLTbiXw==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-arm-gnueabihf@1.7.10: + resolution: {integrity: sha512-yGOFjE7w/akRTmqGY3FvWYrqbxO7OB2N2FHj2LO5HtzXflfoABb5RyRvdEquX+17J6mEpu4EwjYNraTD/WHIEQ==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-arm64-gnu@1.7.10: + resolution: {integrity: sha512-SPWsgWHfdWKKjLrYlvhxcdBJ7Ruy6crJbPoE9NfD95eJEjMnS2yZTqj2ChFsY737WeyhWYlHzgYhYOVCp83YwQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-arm64-musl@1.7.10: + resolution: {integrity: sha512-PUi50bkNqnBL3Z/Zq6jSfwgN9A/taA6u2Zou0tjDJi7oVdpjdr7SxNgCGzMJ/nNg5D/IQn1opM1jktMvpsPAuQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-x64-gnu@1.7.10: + resolution: {integrity: sha512-Sc+pY55gknCAmBQBR6DhlA7jZSxHaLSDb5Sevzi6DOFMXR79NpA6zWTNKwp1GK2AnRIkbAfvYLgOxS5uWTFVpg==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-linux-x64-musl@1.7.10: + resolution: {integrity: sha512-g5NKx2LXaGd0K26hmEts1Cvb7ptIvq3MHSgr6/D1tRPcDZw1Sp0dYsmyOv0ho4F5GOJyiCooG3oE9FXdb7jIpQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@swc/core-win32-arm64-msvc@1.7.10: + resolution: {integrity: sha512-plRIsOcfy9t9Q/ivm5DA7I0HaIvfAWPbI+bvVRrr3C/1K2CSqnqZJjEWOAmx2LiyipijNnEaFYuLBp0IkGuJpg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@swc/core-win32-ia32-msvc@1.7.10: + resolution: {integrity: sha512-GntrVNT23viHtbfzmlK8lfBiKeajH24GzbDT7qXhnoO20suUPcyYZxyvCb4gWM2zu8ZBTPHNlqfrNsriQCZ+lQ==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@swc/core-win32-x64-msvc@1.7.10: + resolution: {integrity: sha512-uXIF8GuSappe1imm6Lf7pHGepfCBjDQlS+qTqvEGE0wZAsL1IVATK9P/cH/OCLfJXeQDTLeSYmrpwjtXNt46tQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@swc/core@1.7.10: + resolution: {integrity: sha512-l0xrFwBQ9atizhmV94yC2nwcecTk/oftofwMNPiFMGe56dqdmi2ArHaTV3PCtMlgaUH6rGCehoRMt5OrCI1ktg==} + engines: {node: '>=10'} + requiresBuild: true + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.21 + optionalDependencies: + '@swc/core-darwin-arm64': 1.7.10 + '@swc/core-darwin-x64': 1.7.10 + '@swc/core-linux-arm-gnueabihf': 1.7.10 + '@swc/core-linux-arm64-gnu': 1.7.10 + '@swc/core-linux-arm64-musl': 1.7.10 + '@swc/core-linux-x64-gnu': 1.7.10 + '@swc/core-linux-x64-musl': 1.7.10 + '@swc/core-win32-arm64-msvc': 1.7.10 + '@swc/core-win32-ia32-msvc': 1.7.10 + '@swc/core-win32-x64-msvc': 1.7.10 + dev: true + + /@swc/counter@0.1.3: + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + dev: true + + /@swc/types@0.1.21: + resolution: {integrity: sha512-2YEtj5HJVbKivud9N4bpPBAyZhj4S2Ipe5LkUG94alTpr7in/GU/EARgPAd3BwU+YOmFVJC2+kjqhGRi3r0ZpQ==} + dependencies: + '@swc/counter': 0.1.3 + dev: true + /@szmarczak/http-timer@4.0.6: resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} @@ -6235,7 +6360,7 @@ packages: - typescript dev: true - file:../../../heft-plugins/heft-api-extractor-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19): + file:../../../heft-plugins/heft-api-extractor-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19): resolution: {directory: ../../../heft-plugins/heft-api-extractor-plugin, type: directory} id: file:../../../heft-plugins/heft-api-extractor-plugin name: '@rushstack/heft-api-extractor-plugin' @@ -6243,14 +6368,33 @@ packages: '@rushstack/heft': '*' dependencies: '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) - '@rushstack/heft-config-file': file:../../../libraries/heft-config-file(@types/node@20.17.19) '@rushstack/node-core-library': file:../../../libraries/node-core-library(@types/node@20.17.19) semver: 7.5.4 transitivePeerDependencies: - '@types/node' dev: true - file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19)(jest-environment-node@29.5.0): + file:../../../heft-plugins/heft-isolated-typescript-transpile-plugin(@rushstack/heft-typescript-plugin@0.9.2)(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {directory: ../../../heft-plugins/heft-isolated-typescript-transpile-plugin, type: directory} + id: file:../../../heft-plugins/heft-isolated-typescript-transpile-plugin + name: '@rushstack/heft-isolated-typescript-transpile-plugin' + peerDependencies: + '@rushstack/heft': '*' + '@rushstack/heft-typescript-plugin': '*' + dependencies: + '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/lookup-by-path': file:../../../libraries/lookup-by-path(@types/node@20.17.19) + '@rushstack/node-core-library': file:../../../libraries/node-core-library(@types/node@20.17.19) + '@swc/core': 1.7.10 + '@types/tapable': 1.0.6 + tapable: 1.1.3 + transitivePeerDependencies: + - '@swc/helpers' + - '@types/node' + dev: true + + file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19)(jest-environment-node@29.5.0): resolution: {directory: ../../../heft-plugins/heft-jest-plugin, type: directory} id: file:../../../heft-plugins/heft-jest-plugin name: '@rushstack/heft-jest-plugin' @@ -6285,7 +6429,7 @@ packages: - ts-node dev: true - file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19): + file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19): resolution: {directory: ../../../heft-plugins/heft-lint-plugin, type: directory} id: file:../../../heft-plugins/heft-lint-plugin name: '@rushstack/heft-lint-plugin' @@ -6299,7 +6443,7 @@ packages: - '@types/node' dev: true - file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19): + file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19): resolution: {directory: ../../../heft-plugins/heft-typescript-plugin, type: directory} id: file:../../../heft-plugins/heft-typescript-plugin name: '@rushstack/heft-typescript-plugin' @@ -6478,6 +6622,7 @@ packages: '@rushstack/package-deps-hash': file:../../../libraries/package-deps-hash(@types/node@20.17.19) '@rushstack/terminal': file:../../../libraries/terminal(@types/node@20.17.19) tapable: 2.2.1 + true-case-path: 2.2.1 transitivePeerDependencies: - '@types/node' dev: false @@ -6523,7 +6668,7 @@ packages: transitivePeerDependencies: - '@types/node' - file:../../../rigs/heft-node-rig(@rushstack/heft@0.71.2)(@types/node@20.17.19): + file:../../../rigs/heft-node-rig(@rushstack/heft@0.73.1)(@types/node@20.17.19): resolution: {directory: ../../../rigs/heft-node-rig, type: directory} id: file:../../../rigs/heft-node-rig name: '@rushstack/heft-node-rig' @@ -6533,10 +6678,10 @@ packages: '@microsoft/api-extractor': file:../../../apps/api-extractor(@types/node@20.17.19) '@rushstack/eslint-config': file:../../../eslint/eslint-config(eslint@8.57.1)(typescript@5.8.2) '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) - '@rushstack/heft-api-extractor-plugin': file:../../../heft-plugins/heft-api-extractor-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19) - '@rushstack/heft-jest-plugin': file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19)(jest-environment-node@29.5.0) - '@rushstack/heft-lint-plugin': file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19) - '@rushstack/heft-typescript-plugin': file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.71.2)(@types/node@20.17.19) + '@rushstack/heft-api-extractor-plugin': file:../../../heft-plugins/heft-api-extractor-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-jest-plugin': file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19)(jest-environment-node@29.5.0) + '@rushstack/heft-lint-plugin': file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@types/heft-jest': 1.0.1 eslint: 8.57.1 jest-environment-node: 29.5.0 @@ -6556,7 +6701,9 @@ packages: dependencies: '@microsoft/api-extractor': file:../../../apps/api-extractor(@types/node@20.17.19) '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) - '@rushstack/heft-node-rig': file:../../../rigs/heft-node-rig(@rushstack/heft@0.71.2)(@types/node@20.17.19) + '@rushstack/heft-isolated-typescript-transpile-plugin': file:../../../heft-plugins/heft-isolated-typescript-transpile-plugin(@rushstack/heft-typescript-plugin@0.9.2)(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-node-rig': file:../../../rigs/heft-node-rig(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@types/heft-jest': 1.0.1 '@types/node': 20.17.19 eslint: 8.57.1 @@ -6564,6 +6711,7 @@ packages: local-eslint-config: file:../../../eslint/local-eslint-config(eslint@8.57.1)(typescript@5.8.2) typescript: 5.8.2 transitivePeerDependencies: + - '@swc/helpers' - babel-plugin-macros - jest-environment-jsdom - node-notifier diff --git a/common/config/subspaces/build-tests-subspace/repo-state.json b/common/config/subspaces/build-tests-subspace/repo-state.json index 74f84055b68..e943beca122 100644 --- a/common/config/subspaces/build-tests-subspace/repo-state.json +++ b/common/config/subspaces/build-tests-subspace/repo-state.json @@ -1,6 +1,6 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "d9e805ea30f80e290b5d5ea83856c8b5d7302941", + "pnpmShrinkwrapHash": "2374a98eef05ff12f1392be2e1c9c5f30fccf734", "preferredVersionsHash": "54149ea3f01558a859c96dee2052b797d4defe68", - "packageJsonInjectedDependenciesHash": "949bb6038c34cb0580b82a6f728b26a66fff3177" + "packageJsonInjectedDependenciesHash": "1cdadb3bdd1bee22f08aa0248a4b4f7b4e1018ff" } diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index 8998cadae57..0c236c3279d 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -93,8 +93,8 @@ importers: version: 5.8.2 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/lodash': specifier: 4.14.116 version: 4.14.116 @@ -173,8 +173,8 @@ importers: specifier: workspace:* version: link:../api-extractor '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/watchpack': specifier: 2.4.0 version: 2.4.0 @@ -2350,8 +2350,8 @@ importers: ../../../eslint/eslint-patch: devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/eslint': specifier: 8.56.10 version: 8.56.10 @@ -2381,8 +2381,8 @@ importers: specifier: ~3.0.0 version: 3.0.2 '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/eslint': specifier: 8.56.10 version: 8.56.10 @@ -2418,8 +2418,8 @@ importers: version: 8.26.1(eslint@8.57.0)(typescript@5.8.2) devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/eslint': specifier: 8.56.10 version: 8.56.10 @@ -2455,8 +2455,8 @@ importers: specifier: ~3.0.0 version: 3.0.2 '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/eslint': specifier: 8.56.10 version: 8.56.10 @@ -2510,8 +2510,8 @@ importers: version: 4.3.0(eslint@8.57.0) devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig @@ -2590,9 +2590,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../heft-typescript-plugin - local-node-rig: + decoupled-local-node-rig: specifier: workspace:* - version: link:../../rigs/local-node-rig + version: link:../../rigs/decoupled-local-node-rig ../../../heft-plugins/heft-jest-plugin: dependencies: @@ -2926,8 +2926,8 @@ importers: version: link:../node-core-library devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig @@ -2976,8 +2976,8 @@ importers: version: 10.3.0 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig @@ -3027,9 +3027,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft - local-node-rig: + decoupled-local-node-rig: specifier: workspace:* - version: link:../../rigs/local-node-rig + version: link:../../rigs/decoupled-local-node-rig ../../../libraries/module-minifier: dependencies: @@ -3087,8 +3087,8 @@ importers: version: 7.5.4 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/fs-extra': specifier: 7.0.0 version: 7.0.0 @@ -3118,8 +3118,8 @@ importers: version: link:../terminal devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig @@ -3211,8 +3211,8 @@ importers: version: 3.1.1 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/resolve': specifier: 1.20.2 version: 1.20.2 @@ -3418,6 +3418,9 @@ importers: tapable: specifier: 2.2.1 version: 2.2.1 + true-case-path: + specifier: ~2.2.1 + version: 2.2.1 devDependencies: '@microsoft/rush-lib': specifier: workspace:* @@ -3526,8 +3529,8 @@ importers: version: 8.1.1 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@types/supports-color': specifier: 8.1.3 version: 8.1.3 @@ -3541,8 +3544,8 @@ importers: ../../../libraries/tree-pattern: devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) decoupled-local-node-rig: specifier: workspace:* version: link:../../rigs/decoupled-local-node-rig @@ -3563,8 +3566,8 @@ importers: version: 0.3.2 devDependencies: '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library @@ -3674,8 +3677,8 @@ importers: ../../../rigs/decoupled-local-node-rig: dependencies: '@microsoft/api-extractor': - specifier: 7.52.3 - version: 7.52.3(@types/node@20.17.19) + specifier: 7.52.4 + version: 7.52.4(@types/node@20.17.19) '@rushstack/eslint-config': specifier: 4.3.0 version: 4.3.0(eslint@8.57.0)(typescript@5.8.2) @@ -3683,11 +3686,17 @@ importers: specifier: 1.11.0 version: 1.11.0 '@rushstack/heft': - specifier: 0.71.2 - version: 0.71.2(@types/node@20.17.19) + specifier: 0.73.1 + version: 0.73.1(@types/node@20.17.19) + '@rushstack/heft-isolated-typescript-transpile-plugin': + specifier: 0.1.6 + version: 0.1.6(@rushstack/heft-typescript-plugin@0.9.2)(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@rushstack/heft-node-rig': - specifier: 2.8.5 - version: 2.8.5(@rushstack/heft@0.71.2)(@types/node@20.17.19) + specifier: 2.8.8 + version: 2.8.8(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': + specifier: 0.9.2 + version: 0.9.2(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@types/heft-jest': specifier: 1.0.1 version: 1.0.1 @@ -3858,9 +3867,15 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/heft-isolated-typescript-transpile-plugin': + specifier: workspace:* + version: link:../../heft-plugins/heft-isolated-typescript-transpile-plugin '@rushstack/heft-node-rig': specifier: workspace:* version: link:../heft-node-rig + '@rushstack/heft-typescript-plugin': + specifier: workspace:* + version: link:../../heft-plugins/heft-typescript-plugin '@types/heft-jest': specifier: 1.0.1 version: 1.0.1 @@ -9542,8 +9557,8 @@ packages: - '@types/node' dev: false - /@microsoft/api-extractor@7.52.3(@types/node@20.17.19): - resolution: {integrity: sha512-QEs6l8h7p9eOSHrQ9NBBUZhUuq+j/2QKcRgigbSs2YQepKz8glvsqmsUOp+nvuaY60ps7KkpVVYQCj81WLoMVQ==} + /@microsoft/api-extractor@7.52.4(@types/node@20.17.19): + resolution: {integrity: sha512-mIEcqgx877CFwNrTuCdPnlIGak8FjlayZb8sSBwWXX+i4gxkZRpMsb5BQcFW3v1puuJB3jYMqQ08kyAc4Vldhw==} hasBin: true dependencies: '@microsoft/api-extractor-model': 7.30.5(@types/node@20.17.19) @@ -10652,21 +10667,20 @@ packages: - typescript dev: false - /@rushstack/heft-api-extractor-plugin@0.3.77(@rushstack/heft@0.71.2)(@types/node@20.17.19): - resolution: {integrity: sha512-+qeHUee4wc3gHr+0vCNm9SoiO1UK3GOpcJ5CXHeUY8ym8gvfJyinzl/sfuzODA2DDc9tEaViZ006QIz0CJpwIA==} + /@rushstack/heft-api-extractor-plugin@0.4.2(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {integrity: sha512-xz/Tnxh9woPx2ywUPSyvDISS2pzV6aafCzuZ9uRg/sWYzEZ5BA7kT/BK1Kd00lv2zijAMkJAFbmqUVcDSy+GXw==} peerDependencies: '@rushstack/heft': '*' dependencies: - '@rushstack/heft': 0.71.2(@types/node@20.17.19) - '@rushstack/heft-config-file': 0.16.8(@types/node@20.17.19) + '@rushstack/heft': 0.73.1(@types/node@20.17.19) '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) semver: 7.5.4 transitivePeerDependencies: - '@types/node' dev: false - /@rushstack/heft-config-file@0.16.8(@types/node@20.17.19): - resolution: {integrity: sha512-zmdN2w3XFUjh9ftE5raNiocJCDlqsYdQNu8ldGdyZUqWfpumyC5wHuWHRS72g2+vHOddRMgZ02SNb/HmWI8J0A==} + /@rushstack/heft-config-file@0.18.0(@types/node@20.17.19): + resolution: {integrity: sha512-46EMMCk+7HQOsDDG65+D0jP8+aps517Bw6PClIVZIYNyP+XL3cRGelI3/aXF7Svp+gHhFIy+CXAtmUoay3t8tg==} engines: {node: '>=10.13.0'} dependencies: '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) @@ -10676,8 +10690,26 @@ packages: transitivePeerDependencies: - '@types/node' - /@rushstack/heft-jest-plugin@0.16.0(@rushstack/heft@0.71.2)(@types/node@20.17.19)(jest-environment-node@29.5.0): - resolution: {integrity: sha512-sz3b3dAsuzH7QIehSZbXYlmD1mP1I7qq9Du95+7TE+RsbxTSJCj7uj3sPTdkZOWa0G72/lAN3OiwkBC1K9VG0w==} + /@rushstack/heft-isolated-typescript-transpile-plugin@0.1.6(@rushstack/heft-typescript-plugin@0.9.2)(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {integrity: sha512-Dh9w7w7V3abTmQ0L17wU3N99ygMAL+xQ4f92AzxTYooQ+DphwC06f77eYuM/AVfqjm9RZdBmIWKKOnGTWKMd4w==} + peerDependencies: + '@rushstack/heft': '*' + '@rushstack/heft-typescript-plugin': '*' + dependencies: + '@rushstack/heft': 0.73.1(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': 0.9.2(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/lookup-by-path': 0.5.19(@types/node@20.17.19) + '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) + '@swc/core': 1.7.10 + '@types/tapable': 1.0.6 + tapable: 1.1.3 + transitivePeerDependencies: + - '@swc/helpers' + - '@types/node' + dev: false + + /@rushstack/heft-jest-plugin@0.16.3(@rushstack/heft@0.73.1)(@types/node@20.17.19)(jest-environment-node@29.5.0): + resolution: {integrity: sha512-FqVGBBABj5mRNQWe/++U/4HhwicZ1dF9viTUO90dfpmIHvDR8lJVoDbFZ6wFuaTSGm5OvOBEFgnAy9g87gSU7g==} peerDependencies: '@rushstack/heft': '*' jest-environment-jsdom: ^29.5.0 @@ -10691,8 +10723,8 @@ packages: '@jest/core': 29.5.0 '@jest/reporters': 29.5.0 '@jest/transform': 29.5.0 - '@rushstack/heft': 0.71.2(@types/node@20.17.19) - '@rushstack/heft-config-file': 0.16.8(@types/node@20.17.19) + '@rushstack/heft': 0.73.1(@types/node@20.17.19) + '@rushstack/heft-config-file': 0.18.0(@types/node@20.17.19) '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) '@rushstack/terminal': 0.15.2(@types/node@20.17.19) jest-config: 29.5.0(@types/node@20.17.19) @@ -10709,30 +10741,30 @@ packages: - ts-node dev: false - /@rushstack/heft-lint-plugin@0.5.30(@rushstack/heft@0.71.2)(@types/node@20.17.19): - resolution: {integrity: sha512-ZUxJeoiflblk4bTveA9U8t5hQp+NElt+kRlakvWwqQ9arOwjkqzX25nGagOCQHqEqjV8zjVBuu/oy0WBXkeh7A==} + /@rushstack/heft-lint-plugin@0.5.33(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {integrity: sha512-SThQ2nraN1SnMGx0S2PQkv7MP1nVkbrGTJsjZDmPBMDPgWI2YeGbsP4F/oUoQJB572al+8wl9isCUkvANYc2Cg==} peerDependencies: '@rushstack/heft': '*' dependencies: - '@rushstack/heft': 0.71.2(@types/node@20.17.19) + '@rushstack/heft': 0.73.1(@types/node@20.17.19) '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) semver: 7.5.4 transitivePeerDependencies: - '@types/node' dev: false - /@rushstack/heft-node-rig@2.8.5(@rushstack/heft@0.71.2)(@types/node@20.17.19): - resolution: {integrity: sha512-xpoQYjkYtQ/mDCg+hpfKZh8cW1FHMuYqHJAh1cfJtVeEnm2rouSgp4yi16F++cv6Ujcn7ZwlxP/Na7OqGUc3Kg==} + /@rushstack/heft-node-rig@2.8.8(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {integrity: sha512-zUVcJFEP0t3rfc2GaI3fHXIqaEWZnoD15Yj+B/p3LJySvV1XnAU/872cGR+arxbZ//zRdz0mSigqzKnkwBqjzg==} peerDependencies: '@rushstack/heft': '*' dependencies: - '@microsoft/api-extractor': 7.52.3(@types/node@20.17.19) + '@microsoft/api-extractor': 7.52.4(@types/node@20.17.19) '@rushstack/eslint-config': 4.3.0(eslint@8.57.0)(typescript@5.8.2) - '@rushstack/heft': 0.71.2(@types/node@20.17.19) - '@rushstack/heft-api-extractor-plugin': 0.3.77(@rushstack/heft@0.71.2)(@types/node@20.17.19) - '@rushstack/heft-jest-plugin': 0.16.0(@rushstack/heft@0.71.2)(@types/node@20.17.19)(jest-environment-node@29.5.0) - '@rushstack/heft-lint-plugin': 0.5.30(@rushstack/heft@0.71.2)(@types/node@20.17.19) - '@rushstack/heft-typescript-plugin': 0.8.2(@rushstack/heft@0.71.2)(@types/node@20.17.19) + '@rushstack/heft': 0.73.1(@types/node@20.17.19) + '@rushstack/heft-api-extractor-plugin': 0.4.2(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-jest-plugin': 0.16.3(@rushstack/heft@0.73.1)(@types/node@20.17.19)(jest-environment-node@29.5.0) + '@rushstack/heft-lint-plugin': 0.5.33(@rushstack/heft@0.73.1)(@types/node@20.17.19) + '@rushstack/heft-typescript-plugin': 0.9.2(@rushstack/heft@0.73.1)(@types/node@20.17.19) '@types/heft-jest': 1.0.1 eslint: 8.57.0 jest-environment-node: 29.5.0 @@ -10746,13 +10778,13 @@ packages: - ts-node dev: false - /@rushstack/heft-typescript-plugin@0.8.2(@rushstack/heft@0.71.2)(@types/node@20.17.19): - resolution: {integrity: sha512-BotfR1KhbKiu/b/ATDcSQmMQCjGCXdeBcWMcpaLmowRK165Zbi5gJwHkBmJFTjyLOEI0ZKTm+nSyoG8GJNW0aA==} + /@rushstack/heft-typescript-plugin@0.9.2(@rushstack/heft@0.73.1)(@types/node@20.17.19): + resolution: {integrity: sha512-knOTOE9QIXdVxnYzL91riYp8AZUtCMOQ1HI5IaNtFwX5CBhxzd94b9Dq0w+o7jttK0B1nLk17FpGt11mQJoB2A==} peerDependencies: '@rushstack/heft': '*' dependencies: - '@rushstack/heft': 0.71.2(@types/node@20.17.19) - '@rushstack/heft-config-file': 0.16.8(@types/node@20.17.19) + '@rushstack/heft': 0.73.1(@types/node@20.17.19) + '@rushstack/heft-config-file': 0.18.0(@types/node@20.17.19) '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) '@types/tapable': 1.0.6 semver: 7.5.4 @@ -10761,12 +10793,12 @@ packages: - '@types/node' dev: false - /@rushstack/heft@0.71.2(@types/node@20.17.19): - resolution: {integrity: sha512-/YWKtIVQjpZmplLYUiNbnnkbGESCvUVMCfnUnUshILKNO6vFuMSUzZCxX4OOkeH0pr/qV8z2IPTJtUZ85VtZRw==} + /@rushstack/heft@0.73.1(@types/node@20.17.19): + resolution: {integrity: sha512-MII08AcHH6MDPqnvzn91YQ2jG0Z9AWEWHNaTjie4YNtF//D7cmTContXKpGop94lD9D0cTeO36RgcbiSTmdwRg==} engines: {node: '>=10.13.0'} hasBin: true dependencies: - '@rushstack/heft-config-file': 0.16.8(@types/node@20.17.19) + '@rushstack/heft-config-file': 0.18.0(@types/node@20.17.19) '@rushstack/node-core-library': 5.13.0(@types/node@20.17.19) '@rushstack/operation-graph': 0.2.40(@types/node@20.17.19) '@rushstack/rig-package': 0.5.3 @@ -10781,6 +10813,17 @@ packages: transitivePeerDependencies: - '@types/node' + /@rushstack/lookup-by-path@0.5.19(@types/node@20.17.19): + resolution: {integrity: sha512-42O/4V9excl2sMFtAsPZAgzbUaAOwGkVDyBaLAEkWWl60PkIbj3QBn5FT8peBxf3WJOH9w1OcjJJIS5tR1jXWw==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 20.17.19 + dev: false + /@rushstack/node-core-library@3.63.0(@types/node@20.17.19): resolution: {integrity: sha512-Q7B3dVpBQF1v+mUfxNcNZh5uHVR8ntcnkN5GYjbBLrxUYHBGKbnCM+OdcN+hzCpFlLBH6Ob0dEHhZ0spQwf24A==} peerDependencies: diff --git a/common/config/subspaces/default/repo-state.json b/common/config/subspaces/default/repo-state.json index a3eea450b29..0099ea807a8 100644 --- a/common/config/subspaces/default/repo-state.json +++ b/common/config/subspaces/default/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "1cd4f5444a9d6a085d5418372291de283264d9fb", + "pnpmShrinkwrapHash": "9e771772ef1c715b89ee8ee5b5e1c92de6165cc5", "preferredVersionsHash": "54149ea3f01558a859c96dee2052b797d4defe68" } diff --git a/eslint/eslint-bulk/.npmignore b/eslint/eslint-bulk/.npmignore index e15a94aeb84..bc349f9a4be 100755 --- a/eslint/eslint-bulk/.npmignore +++ b/eslint/eslint-bulk/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - diff --git a/eslint/eslint-bulk/package.json b/eslint/eslint-bulk/package.json index c2fd3e91bfb..63f2630417c 100755 --- a/eslint/eslint-bulk/package.json +++ b/eslint/eslint-bulk/package.json @@ -2,7 +2,29 @@ "name": "@rushstack/eslint-bulk", "version": "0.1.90", "description": "Roll out new ESLint rules in a large monorepo without cluttering up your code with \"eslint-ignore-next-line\"", - "main": "index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", diff --git a/eslint/eslint-patch/custom-config-package-names.js b/eslint/eslint-patch/custom-config-package-names.js index 8897e869792..de98ebc7853 100644 --- a/eslint/eslint-patch/custom-config-package-names.js +++ b/eslint/eslint-patch/custom-config-package-names.js @@ -1 +1 @@ -require('./lib/custom-config-package-names'); +require('./lib-commonjs/custom-config-package-names'); diff --git a/eslint/eslint-patch/eslint-bulk-suppressions.js b/eslint/eslint-patch/eslint-bulk-suppressions.js index b1236d4e449..1c629a2c31c 100644 --- a/eslint/eslint-patch/eslint-bulk-suppressions.js +++ b/eslint/eslint-patch/eslint-bulk-suppressions.js @@ -1 +1 @@ -require('./lib/eslint-bulk-suppressions'); +require('./lib-commonjs/eslint-bulk-suppressions'); diff --git a/eslint/eslint-patch/modern-module-resolution.js b/eslint/eslint-patch/modern-module-resolution.js index 921317824f4..37be4b71a1c 100644 --- a/eslint/eslint-patch/modern-module-resolution.js +++ b/eslint/eslint-patch/modern-module-resolution.js @@ -1 +1 @@ -require('./lib/modern-module-resolution'); +require('./lib-commonjs/modern-module-resolution'); diff --git a/eslint/eslint-patch/package.json b/eslint/eslint-patch/package.json index 638dc643dfc..0ca19961f5f 100644 --- a/eslint/eslint-patch/package.json +++ b/eslint/eslint-patch/package.json @@ -2,7 +2,41 @@ "name": "@rushstack/eslint-patch", "version": "1.11.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", + "typings": "lib-dts/usage.d.ts", + "exports": { + "./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" + }, + "./modern-module-resolution": { + "import": "./lib-esm/modern-module-resolution.js", + "require": "./lib-commonjs/modern-module-resolution.js" + }, + ".": { + "import": "./lib-esm/usage.js", + "require": "./lib-commonjs/usage.js", + "types": "./lib-dts/usage.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -30,7 +64,7 @@ "patch" ], "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/eslint": "8.56.10", "@typescript-eslint/types": "~8.26.1", "decoupled-local-node-rig": "workspace:*", diff --git a/eslint/eslint-plugin-packlets/.npmignore b/eslint/eslint-plugin-packlets/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/eslint/eslint-plugin-packlets/.npmignore +++ b/eslint/eslint-plugin-packlets/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - diff --git a/eslint/eslint-plugin-packlets/package.json b/eslint/eslint-plugin-packlets/package.json index ba6654f5949..2fc7082ad5b 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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -30,7 +51,7 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/eslint": "8.56.10", "@types/estree": "1.0.6", "@typescript-eslint/parser": "~8.26.1", diff --git a/eslint/eslint-plugin-packlets/src/index.ts b/eslint/eslint-plugin-packlets/src/index.ts index 9f80f769502..610bae522ca 100644 --- a/eslint/eslint-plugin-packlets/src/index.ts +++ b/eslint/eslint-plugin-packlets/src/index.ts @@ -31,4 +31,4 @@ const plugin: IPlugin = { } }; -export = plugin; +module.exports = plugin; diff --git a/eslint/eslint-plugin-packlets/tsconfig.json b/eslint/eslint-plugin-packlets/tsconfig.json index e98df1ad324..1a33d17b873 100644 --- a/eslint/eslint-plugin-packlets/tsconfig.json +++ b/eslint/eslint-plugin-packlets/tsconfig.json @@ -1,7 +1,3 @@ { - "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json", - - "compilerOptions": { - "module": "Node16" - } + "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/eslint/eslint-plugin-security/package.json b/eslint/eslint-plugin-security/package.json index 88faa5a51ca..b9d0c1d6de9 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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -30,7 +51,7 @@ }, "devDependencies": { "@eslint/eslintrc": "~3.0.0", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/eslint": "8.56.10", "@types/estree": "1.0.6", "@typescript-eslint/parser": "~8.26.1", diff --git a/eslint/eslint-plugin-security/src/index.ts b/eslint/eslint-plugin-security/src/index.ts index 78c620b45f2..377420ab146 100644 --- a/eslint/eslint-plugin-security/src/index.ts +++ b/eslint/eslint-plugin-security/src/index.ts @@ -15,4 +15,4 @@ const plugin: IPlugin = { } }; -export = plugin; +module.exports = plugin; diff --git a/eslint/eslint-plugin-security/tsconfig.json b/eslint/eslint-plugin-security/tsconfig.json index e98df1ad324..1a33d17b873 100644 --- a/eslint/eslint-plugin-security/tsconfig.json +++ b/eslint/eslint-plugin-security/tsconfig.json @@ -1,7 +1,3 @@ { - "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json", - - "compilerOptions": { - "module": "Node16" - } + "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/eslint/eslint-plugin/.npmignore b/eslint/eslint-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/eslint/eslint-plugin/.npmignore +++ b/eslint/eslint-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - diff --git a/eslint/eslint-plugin/package.json b/eslint/eslint-plugin/package.json index 25ca4dbe576..72ec7975918 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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -34,7 +55,7 @@ }, "devDependencies": { "@eslint/eslintrc": "~3.0.0", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/eslint": "8.56.10", "@types/estree": "1.0.6", "@typescript-eslint/parser": "~8.26.1", diff --git a/eslint/eslint-plugin/src/index.ts b/eslint/eslint-plugin/src/index.ts index 7aee5411dc2..4912c02a4cf 100644 --- a/eslint/eslint-plugin/src/index.ts +++ b/eslint/eslint-plugin/src/index.ts @@ -48,4 +48,4 @@ const plugin: IPlugin = { } }; -export = plugin; +module.exports = plugin; diff --git a/eslint/eslint-plugin/tsconfig.json b/eslint/eslint-plugin/tsconfig.json index 09aacf59d98..392e6e3fb38 100644 --- a/eslint/eslint-plugin/tsconfig.json +++ b/eslint/eslint-plugin/tsconfig.json @@ -2,8 +2,6 @@ "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "module": "Node16", - // TODO: Update the rest of the repo to target ES2020 "target": "ES2020", "lib": ["ES2020"] diff --git a/eslint/local-eslint-config/package.json b/eslint/local-eslint-config/package.json index a41c1820662..07aace1945f 100644 --- a/eslint/local-eslint-config/package.json +++ b/eslint/local-eslint-config/package.json @@ -10,7 +10,7 @@ "devDependencies": { "eslint": "~8.57.0", "typescript": "~5.8.2", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "decoupled-local-node-rig": "workspace:*" }, "dependencies": { diff --git a/heft-plugins/heft-api-extractor-plugin/.npmignore b/heft-plugins/heft-api-extractor-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/heft-plugins/heft-api-extractor-plugin/.npmignore +++ b/heft-plugins/heft-api-extractor-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - 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 a8c6c1c125f..0ec82a2e3a8 100644 --- a/heft-plugins/heft-api-extractor-plugin/package.json +++ b/heft-plugins/heft-api-extractor-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft test --clean", "start": "heft build-watch", 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 adc8a8ac420..63e85e9383d 100644 --- a/heft-plugins/heft-dev-cert-plugin/package.json +++ b/heft-plugins/heft-dev-cert-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", diff --git a/heft-plugins/heft-isolated-typescript-transpile-plugin/.eslintrc.js b/heft-plugins/heft-isolated-typescript-transpile-plugin/.eslintrc.js index 27dc0bdff95..bc633c3e1b9 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/.eslintrc.js +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/.eslintrc.js @@ -1,12 +1,12 @@ // This is a workaround for https://github.com/eslint/eslint/issues/3458 -require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); // This is a workaround for https://github.com/microsoft/rushstack/issues/3021 -require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); module.exports = { extends: [ - 'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', - 'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' + 'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', + 'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' ], parserOptions: { tsconfigRootDir: __dirname } }; 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/config/rig.json b/heft-plugins/heft-isolated-typescript-transpile-plugin/config/rig.json index 165ffb001f5..cc98dea43dd 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/config/rig.json +++ b/heft-plugins/heft-isolated-typescript-transpile-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": "local-node-rig" + "rigPackageName": "decoupled-local-node-rig" } 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 96dd53b146d..92be6f7f884 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/package.json @@ -9,8 +9,29 @@ }, "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", + "typings": "dist/heft-isolated-typescript-transpile-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/heft-isolated-typescript-transpile-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", @@ -22,9 +43,9 @@ "@rushstack/heft-typescript-plugin": "workspace:^" }, "devDependencies": { + "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft": "workspace:*", - "local-node-rig": "workspace:*", - "@rushstack/heft-typescript-plugin": "workspace:*" + "decoupled-local-node-rig": "workspace:*" }, "dependencies": { "@rushstack/lookup-by-path": "workspace:*", diff --git a/heft-plugins/heft-isolated-typescript-transpile-plugin/tsconfig.json b/heft-plugins/heft-isolated-typescript-transpile-plugin/tsconfig.json index dac21d04081..1a33d17b873 100644 --- a/heft-plugins/heft-isolated-typescript-transpile-plugin/tsconfig.json +++ b/heft-plugins/heft-isolated-typescript-transpile-plugin/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" + "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json" } diff --git a/heft-plugins/heft-jest-plugin/.npmignore b/heft-plugins/heft-jest-plugin/.npmignore index c672d8fde22..ffb155d74e6 100644 --- a/heft-plugins/heft-jest-plugin/.npmignore +++ b/heft-plugins/heft-jest-plugin/.npmignore @@ -31,4 +31,4 @@ # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- -!/includes/** \ No newline at end of file +!/includes/** 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 a01ff7dd054..90d795d17dc 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft test --clean", "start": "heft build-watch", diff --git a/heft-plugins/heft-jest-plugin/src/HeftJestResolver.ts b/heft-plugins/heft-jest-plugin/src/HeftJestResolver.ts index 6168a667f40..11807fb2dc3 100644 --- a/heft-plugins/heft-jest-plugin/src/HeftJestResolver.ts +++ b/heft-plugins/heft-jest-plugin/src/HeftJestResolver.ts @@ -78,4 +78,4 @@ function resolve(request: string, options: IResolverOptions): string { return options.defaultResolver(newRequest, options); } -export = resolve; +export default resolve; diff --git a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts index ad47e6f85fa..865c4b44bc1 100644 --- a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts +++ b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts @@ -893,6 +893,7 @@ export default class JestPlugin implements IHeftTaskPlugin { * - replace `` with the same rootDir * - replace `` with the directory containing the current configuration file * - replace `` with the path to the resolved package (NOT module) + * - re-path `@rushstack/heft-jest-plugin/lib/...` to `@rushstack/heft-jest-plugin/lib-commonjs/...` */ private static _getJsonPathMetadata( options: IJestResolutionOptions @@ -970,7 +971,11 @@ export default class JestPlugin implements IHeftTaskPlugin { // Example: @rushstack/heft-jest-plugin/path/to/file.js if (propertyValue.startsWith(PLUGIN_PACKAGE_NAME)) { - const restOfPath: string = path.normalize('./' + propertyValue.slice(PLUGIN_PACKAGE_NAME.length)); + let restOfPath: string = path.posix.normalize( + './' + propertyValue.slice(PLUGIN_PACKAGE_NAME.length) + ); + restOfPath = restOfPath.replace(/^(\.\/)?lib(\/|\\)/, 'lib-commonjs/'); + return path.join(PLUGIN_PACKAGE_FOLDER, restOfPath); } diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-identity-mock-transform.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-identity-mock-transform.ts index 3f2aff47b9b..a77daa70e35 100644 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-identity-mock-transform.ts +++ b/heft-plugins/heft-jest-plugin/src/exports/jest-identity-mock-transform.ts @@ -2,4 +2,4 @@ // See LICENSE in the project root for license information. import { IdentityMockTransformer } from '../transformers/IdentityMockTransformer'; -export = new IdentityMockTransformer(); +module.exports = new IdentityMockTransformer(); diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-improved-resolver.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-improved-resolver.ts index d16ddfc0116..0718de7ec75 100644 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-improved-resolver.ts +++ b/heft-plugins/heft-jest-plugin/src/exports/jest-improved-resolver.ts @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import resolver = require('../HeftJestResolver'); -export = resolver; +import resolver from '../HeftJestResolver'; +module.exports = resolver; diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-node-modules-symlink-resolver.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-node-modules-symlink-resolver.ts index 5c4f9fb6e70..9c5f5b45c1f 100644 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-node-modules-symlink-resolver.ts +++ b/heft-plugins/heft-jest-plugin/src/exports/jest-node-modules-symlink-resolver.ts @@ -2,6 +2,6 @@ // See LICENSE in the project root for license information. import '../JestRealPathPatch'; -// Using this syntax because HeftJestResolver uses `export =` syntax. -import resolver = require('../HeftJestResolver'); -export = resolver; + +import resolver from '../HeftJestResolver'; +module.exports = resolver; diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-source-map-snapshot-resolver.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-source-map-snapshot-resolver.ts index a91c56443d6..7686d7dc10a 100644 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-source-map-snapshot-resolver.ts +++ b/heft-plugins/heft-jest-plugin/src/exports/jest-source-map-snapshot-resolver.ts @@ -2,4 +2,4 @@ // See LICENSE in the project root for license information. import resolver from '../SourceMapSnapshotResolver'; -export = resolver; +module.exports = resolver; diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-string-mock-transform.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-string-mock-transform.ts index 9a4da921af6..73d311abc75 100644 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-string-mock-transform.ts +++ b/heft-plugins/heft-jest-plugin/src/exports/jest-string-mock-transform.ts @@ -2,4 +2,4 @@ // See LICENSE in the project root for license information. import { StringMockTransformer } from '../transformers/StringMockTransformer'; -export = new StringMockTransformer(); +module.exports = new StringMockTransformer(); diff --git a/heft-plugins/heft-jest-plugin/src/identityMock.ts b/heft-plugins/heft-jest-plugin/src/identityMock.ts index d8acdeb5988..c718551d6f8 100644 --- a/heft-plugins/heft-jest-plugin/src/identityMock.ts +++ b/heft-plugins/heft-jest-plugin/src/identityMock.ts @@ -15,4 +15,4 @@ const identityMock: unknown = new Proxy( } ); -export = identityMock; +module.exports = identityMock; 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 9833d353a33..cfb2a0601fe 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-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 8e4065d074c..4679b124154 100644 --- a/heft-plugins/heft-lint-plugin/package.json +++ b/heft-plugins/heft-lint-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft test --clean", "start": "heft build-watch", diff --git a/heft-plugins/heft-localization-typings-plugin/.npmignore b/heft-plugins/heft-localization-typings-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/heft-plugins/heft-localization-typings-plugin/.npmignore +++ b/heft-plugins/heft-localization-typings-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - diff --git a/heft-plugins/heft-localization-typings-plugin/heft-plugin.json b/heft-plugins/heft-localization-typings-plugin/heft-plugin.json index f4a6d738ecf..5aecfa0210b 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/options.schema.json" + "entryPoint": "./lib-commonjs/LocalizationTypingsPlugin", + "optionsSchema": "./lib-commonjs/schemas/options.schema.json" } ] } diff --git a/heft-plugins/heft-localization-typings-plugin/package.json b/heft-plugins/heft-localization-typings-plugin/package.json index 0aeaccb2ba2..0078ad40219 100644 --- a/heft-plugins/heft-localization-typings-plugin/package.json +++ b/heft-plugins/heft-localization-typings-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", diff --git a/heft-plugins/heft-sass-load-themed-styles-plugin/.npmignore b/heft-plugins/heft-sass-load-themed-styles-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/heft-plugins/heft-sass-load-themed-styles-plugin/.npmignore +++ b/heft-plugins/heft-sass-load-themed-styles-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - 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 490000c0799..a6145af6512 100644 --- a/heft-plugins/heft-sass-load-themed-styles-plugin/package.json +++ b/heft-plugins/heft-sass-load-themed-styles-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", diff --git a/heft-plugins/heft-sass-plugin/.npmignore b/heft-plugins/heft-sass-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/heft-plugins/heft-sass-plugin/.npmignore +++ b/heft-plugins/heft-sass-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - 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 0927a6cfefd..2aeb526ba71 100644 --- a/heft-plugins/heft-sass-plugin/package.json +++ b/heft-plugins/heft-sass-plugin/package.json @@ -15,8 +15,29 @@ "_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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "peerDependencies": { "@rushstack/heft": "^0.73.2" }, diff --git a/heft-plugins/heft-serverless-stack-plugin/.npmignore b/heft-plugins/heft-serverless-stack-plugin/.npmignore index e15a94aeb84..bc349f9a4be 100644 --- a/heft-plugins/heft-serverless-stack-plugin/.npmignore +++ b/heft-plugins/heft-serverless-stack-plugin/.npmignore @@ -30,4 +30,3 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- - 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 23b2152d78c..b0855e7d141 100644 --- a/heft-plugins/heft-serverless-stack-plugin/package.json +++ b/heft-plugins/heft-serverless-stack-plugin/package.json @@ -8,6 +8,21 @@ "directory": "heft-plugins/heft-serverless-stack-plugin" }, "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", 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 b9ab91fc1ed..b0e5a53dc4f 100644 --- a/heft-plugins/heft-storybook-plugin/package.json +++ b/heft-plugins/heft-storybook-plugin/package.json @@ -9,6 +9,21 @@ }, "homepage": "https://rushstack.io/pages/heft/overview/", "license": "MIT", + "exports": { + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "start": "heft test --clean --watch", 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 454500fc5eb..f900e7de6f8 100644 --- a/heft-plugins/heft-typescript-plugin/package.json +++ b/heft-plugins/heft-typescript-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "dist/heft-typescript-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/heft-typescript-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft test --clean", 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 13765398e6d..3fbd3119b19 100644 --- a/heft-plugins/heft-webpack4-plugin/package.json +++ b/heft-plugins/heft-webpack4-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", 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 097273caccc..1d73587df1d 100644 --- a/heft-plugins/heft-webpack5-plugin/package.json +++ b/heft-plugins/heft-webpack5-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "dist/heft-webpack5-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/heft-webpack5-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", 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 9f2a1a36ee1..85f89b9f31f 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/rollup.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/rollup.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -22,7 +43,7 @@ "@rushstack/node-core-library": "workspace:*" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "decoupled-local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" } 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 577a6b74194..0e32afd38e1 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.4.32", "description": "Cross-platform functionality to create debug ssl certificates.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/debug-certificate-manager.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/debug-certificate-manager.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", 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 fe6ee7e8dac..4a171950cd5 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", + "typings": "dist/heft-config-file.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/heft-config-file.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", @@ -28,7 +49,7 @@ }, "devDependencies": { "local-eslint-config": "workspace:*", - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "decoupled-local-node-rig": "workspace:*" } } 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 af9fb2a7c8d..37d48d90975 100644 --- a/libraries/localization-utilities/package.json +++ b/libraries/localization-utilities/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/localization-utilities", "version": "0.13.11", "description": "This plugin contains some useful functions for localization.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/localization-utilities.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/localization-utilities.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/libraries/lookup-by-path/.eslintrc.js b/libraries/lookup-by-path/.eslintrc.js index 0b04796d1ee..dc4a3aab930 100644 --- a/libraries/lookup-by-path/.eslintrc.js +++ b/libraries/lookup-by-path/.eslintrc.js @@ -1,13 +1,13 @@ // This is a workaround for https://github.com/eslint/eslint/issues/3458 -require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); // This is a workaround for https://github.com/microsoft/rushstack/issues/3021 -require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); +require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); module.exports = { extends: [ - 'local-node-rig/profiles/default/includes/eslint/profile/node', - 'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals', - 'local-node-rig/profiles/default/includes/eslint/mixins/tsdoc' + 'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node', + 'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals', + 'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/tsdoc' ], parserOptions: { tsconfigRootDir: __dirname } }; 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/config/jest.config.json b/libraries/lookup-by-path/config/jest.config.json index d1749681d90..7c0f9ccc9d6 100644 --- a/libraries/lookup-by-path/config/jest.config.json +++ b/libraries/lookup-by-path/config/jest.config.json @@ -1,3 +1,3 @@ { - "extends": "local-node-rig/profiles/default/config/jest.config.json" + "extends": "decoupled-local-node-rig/profiles/default/config/jest.config.json" } diff --git a/libraries/lookup-by-path/config/rig.json b/libraries/lookup-by-path/config/rig.json index 165ffb001f5..cc98dea43dd 100644 --- a/libraries/lookup-by-path/config/rig.json +++ b/libraries/lookup-by-path/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": "local-node-rig" + "rigPackageName": "decoupled-local-node-rig" } diff --git a/libraries/lookup-by-path/package.json b/libraries/lookup-by-path/package.json index e334a81805d..87462027a73 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.5.20", "description": "Strongly typed trie data structure for path and URL-like strings.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/lookup-by-path.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/lookup-by-path.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "keywords": [ "trie", "path", @@ -24,7 +45,7 @@ }, "devDependencies": { "@rushstack/heft": "workspace:*", - "local-node-rig": "workspace:*" + "decoupled-local-node-rig": "workspace:*" }, "peerDependencies": { "@types/node": "*" diff --git a/libraries/lookup-by-path/tsconfig.json b/libraries/lookup-by-path/tsconfig.json index 9a79fa4af11..0d401094047 100644 --- a/libraries/lookup-by-path/tsconfig.json +++ b/libraries/lookup-by-path/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", + "extends": "./node_modules/decoupled-local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "target": "ES2019" 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 fd83f28c300..13861ceff95 100644 --- a/libraries/module-minifier/package.json +++ b/libraries/module-minifier/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/module-minifier", "version": "0.7.18", "description": "Wrapper for terser to support bulk parallel minification.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/module-minifier.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/module-minifier.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", diff --git a/libraries/node-core-library/config/api-extractor.json b/libraries/node-core-library/config/api-extractor.json index 996e271d3dd..5dbfda704f4 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/package.json b/libraries/node-core-library/package.json index 5d3e45973ff..9dcc5938b56 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.13.0", "description": "Core libraries that every NodeJS toolchain project should use", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/node-core-library.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/node-core-library.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -26,7 +47,7 @@ "ajv-formats": "~3.0.1" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/fs-extra": "7.0.0", "@types/jju": "1.4.1", "@types/resolve": "1.20.2", diff --git a/libraries/node-core-library/src/Import.ts b/libraries/node-core-library/src/Import.ts index cfb8aaf6140..8d49562c3d0 100644 --- a/libraries/node-core-library/src/Import.ts +++ b/libraries/node-core-library/src/Import.ts @@ -2,9 +2,9 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import importLazy = require('import-lazy'); +import importLazy from 'import-lazy'; import * as Resolve from 'resolve'; -import nodeModule = require('module'); +import nodeModule from 'module'; import { PackageJsonLookup } from './PackageJsonLookup'; import { FileSystem } from './FileSystem'; 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/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 5c99131b0f5..6c8206fa6d1 100644 --- a/libraries/operation-graph/package.json +++ b/libraries/operation-graph/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/operation-graph", "version": "0.2.40", "description": "Library for managing and executing operations in a directed acyclic graph.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/operation-graph.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/operation-graph.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -20,7 +41,7 @@ "@rushstack/terminal": "workspace:*" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "decoupled-local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" }, 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 e366f5494c8..d4b58c886c0 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.3.21", "description": "", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/package-deps-hash.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/package-deps-hash.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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/heft.json b/libraries/package-extractor/config/heft.json index e345f0f7b15..c1e1517ee37 100644 --- a/libraries/package-extractor/config/heft.json +++ b/libraries/package-extractor/config/heft.json @@ -10,7 +10,7 @@ "build": { "tasksByName": { "webpack": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft-webpack5-plugin" } 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 4ae29cbec69..c42acfeb826 100644 --- a/libraries/package-extractor/package.json +++ b/libraries/package-extractor/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/package-extractor", "version": "0.10.25", "description": "A library for bundling selected files and dependencies into a deployable package.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/package-extractor.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/package-extractor.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "repository": { "type": "git", "url": "https://github.com/microsoft/rushstack.git", 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/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 49e2ed37bff..53a7a6ac74b 100644 --- a/libraries/rig-package/package.json +++ b/libraries/rig-package/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/rig-package", "version": "0.5.3", "description": "A system for sharing tool configurations between projects without duplicating config files.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/rig-package.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/rig-package.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -20,7 +41,7 @@ "strip-json-comments": "~3.1.1" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/resolve": "1.20.2", "ajv": "~8.13.0", "decoupled-local-node-rig": "workspace:*", diff --git a/libraries/rush-lib/.npmignore b/libraries/rush-lib/.npmignore index 2c1b4d582e5..e620bb7c326 100644 --- a/libraries/rush-lib/.npmignore +++ b/libraries/rush-lib/.npmignore @@ -32,4 +32,4 @@ # --------------------------------------------------------------------------- !/assets/** - +lib-commonjs/** 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 cb203be79e0..06f5ab67667 100644 --- a/libraries/rush-lib/config/heft.json +++ b/libraries/rush-lib/config/heft.json @@ -13,7 +13,7 @@ "tasksByName": { "copy-mock-flush-telemetry-plugin": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft", "pluginName": "copy-files-plugin", @@ -48,7 +48,7 @@ }, "copy-empty-modules": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", @@ -59,7 +59,7 @@ }, "webpack": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft-webpack5-plugin" } diff --git a/libraries/rush-lib/config/typescript.json b/libraries/rush-lib/config/typescript.json deleted file mode 100644 index 587de5fc0f8..00000000000 --- a/libraries/rush-lib/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/rush-lib/package.json b/libraries/rush-lib/package.json index ea9378fd565..da3e827ce75 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -13,11 +13,25 @@ "engineStrict": true, "homepage": "https://rushjs.io", "main": "lib/index.js", + "module": "lib-esm/index.js", "typings": "dist/rush-lib.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib/index.js", + "types": "./dist/rush-lib.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, "typesVersions": { "*": { - "lib-esnext/*": [ - "lib/*" + "lib/*": [ + "lib-dts/*" ] } }, @@ -94,9 +108,9 @@ "@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" ] } diff --git a/libraries/rush-lib/scripts/copyEmptyModules.js b/libraries/rush-lib/scripts/copyEmptyModules.js index 9d0c50f9439..d6ff6757bc7 100644 --- a/libraries/rush-lib/scripts/copyEmptyModules.js +++ b/libraries/rush-lib/scripts/copyEmptyModules.js @@ -3,7 +3,6 @@ const { FileSystem, Async, AsyncQueue } = require('@rushstack/node-core-library'); const JS_FILE_EXTENSION = '.js'; -const DTS_FILE_EXTENSION = '.d.ts'; module.exports = { runAsync: async ({ @@ -22,29 +21,19 @@ 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-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 // `rush-lib-declaration-paths-test` project in the `build-tests` function stripCommentsFromJsFile(jsFileText) { - const lines = jsFileText.split('\n'); - const resultLines = []; - for (const line of lines) { - const trimmedLine = line.trim(); - if (trimmedLine === '' || trimmedLine.startsWith('//')) { - continue; - } - - resultLines.push(trimmedLine); - } - - return resultLines.join('\n'); + jsFileText = jsFileText.replace(/^\s*\/\/.*$/gm, ''); + jsFileText = jsFileText.replace(/\/\*.*\*\//gs, ''); + return jsFileText; } - const jsInFolderPath = `${buildFolderPath}/lib-esnext`; - const dtsInFolderPath = `${buildFolderPath}/lib-commonjs`; + const inFolderPath = `${buildFolderPath}/lib-esm`; const outFolderPath = `${buildFolderPath}/lib`; const emptyModuleBuffer = Buffer.from('module.exports = {};', 'utf8'); const folderPathQueue = new AsyncQueue([undefined]); @@ -52,7 +41,7 @@ module.exports = { await Async.forEachAsync( folderPathQueue, async ([relativeFolderPath, callback]) => { - const folderPath = relativeFolderPath ? `${jsInFolderPath}/${relativeFolderPath}` : jsInFolderPath; + const folderPath = relativeFolderPath ? `${inFolderPath}/${relativeFolderPath}` : inFolderPath; const folderItems = await FileSystem.readFolderItemsAsync(folderPath); for (const folderItem of folderItems) { const itemName = folderItem.name; @@ -61,24 +50,15 @@ module.exports = { if (folderItem.isDirectory()) { folderPathQueue.push(relativeItemPath); } else if (folderItem.isFile() && itemName.endsWith(JS_FILE_EXTENSION)) { - const jsInPath = `${jsInFolderPath}/${relativeItemPath}`; + const jsInPath = `${inFolderPath}/${relativeItemPath}`; const jsFileText = await FileSystem.readFileAsync(jsInPath); const strippedJsFileText = stripCommentsFromJsFile(jsFileText); - if (strippedJsFileText === 'export {};') { + if (strippedJsFileText.match(/^\s*export\s+\{\s*\}\s*;?\s*$/gs)) { const outJsPath = `${outFolderPath}/${relativeItemPath}`; terminal.writeVerboseLine(`Writing stub to ${outJsPath}`); await FileSystem.writeFileAsync(outJsPath, emptyModuleBuffer, { ensureFolderExists: true }); - - const relativeDtsPath = - relativeItemPath.slice(0, -JS_FILE_EXTENSION.length) + DTS_FILE_EXTENSION; - const inDtsPath = `${dtsInFolderPath}/${relativeDtsPath}`; - const outDtsPath = `${outFolderPath}/${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); - await FileSystem.writeFileAsync(outDtsPath, buffer, { ensureFolderExists: true }); } } } diff --git a/libraries/rush-lib/tsconfig.json b/libraries/rush-lib/tsconfig.json index 7adbedc6d67..367447a13d0 100644 --- a/libraries/rush-lib/tsconfig.json +++ b/libraries/rush-lib/tsconfig.json @@ -2,8 +2,6 @@ "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "types": ["heft-jest", "node", "webpack-env"], - "skipLibCheck": true, - "resolveJsonModule": true, - "outDir": "lib-commonjs" + "skipLibCheck": true } } diff --git a/libraries/rush-lib/webpack.config.js b/libraries/rush-lib/webpack.config.js index 69dab7281f7..24be2a89d39 100644 --- a/libraries/rush-lib/webpack.config.js +++ b/libraries/rush-lib/webpack.config.js @@ -75,10 +75,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-esm/index.js`, + start: `${__dirname}/lib-esm/start.js`, + startx: `${__dirname}/lib-esm/startx.js`, + 'start-pnpm': `${__dirname}/lib-esm/start-pnpm.js` }, [ new DeepImportsPlugin({ @@ -86,7 +86,7 @@ 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', + inFolderName: 'lib-esm', outFolderName: 'lib', pathsToIgnore: ['utilities/prompts/SearchListPrompt.js'], dTsFilesInputFolderName: 'lib-commonjs' @@ -106,27 +106,27 @@ module.exports = () => { ), generateConfiguration({ [PathConstants.pnpmfileShimFilename]: { - import: `${__dirname}/lib-esnext/logic/pnpm/PnpmfileShim.js`, + import: `${__dirname}/lib-esm/logic/pnpm/PnpmfileShim.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.subspacePnpmfileShimFilename]: { - import: `${__dirname}/lib-esnext/logic/pnpm/SubspaceGlobalPnpmfileShim.js`, + import: `${__dirname}/lib-esm/logic/pnpm/SubspaceGlobalPnpmfileShim.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run.js`, + import: `${__dirname}/lib-esm/scripts/install-run.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rush.js`, + import: `${__dirname}/lib-esm/scripts/install-run-rush.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushxScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rushx.js`, + import: `${__dirname}/lib-esm/scripts/install-run-rushx.js`, ...SCRIPT_ENTRY_OPTIONS }, [PathConstants.installRunRushPnpmScriptFilename]: { - import: `${__dirname}/lib-esnext/scripts/install-run-rush-pnpm.js`, + import: `${__dirname}/lib-esm/scripts/install-run-rush-pnpm.js`, ...SCRIPT_ENTRY_OPTIONS } }) diff --git a/libraries/rush-sdk/.npmignore b/libraries/rush-sdk/.npmignore index 6d66e80b784..c9fa4f5ae40 100644 --- a/libraries/rush-sdk/.npmignore +++ b/libraries/rush-sdk/.npmignore @@ -30,5 +30,7 @@ # --------------------------------------------------------------------------- # DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. # --------------------------------------------------------------------------- + +/lib-dts/** /lib-commonjs/** -/lib-esnext/** +/lib-esm/** diff --git a/libraries/rush-sdk/config/api-extractor.json b/libraries/rush-sdk/config/api-extractor.json index 6ac06d0c07e..8eba8d0609b 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-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..8098a460697 100644 --- a/libraries/rush-sdk/config/heft.json +++ b/libraries/rush-sdk/config/heft.json @@ -33,14 +33,34 @@ }, "webpack": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft-webpack5-plugin" } }, + "copy-stub-dts": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + { + "sourcePath": "./node_modules/@microsoft/rush-lib/lib-dts", + "destinationFolders": ["lib"], + "fileExtensions": [".d.ts", ".map"] + } + ] + } + } + }, + "generate-stubs": { - "taskDependencies": ["typescript"], + "taskDependencies": [ + "transpile", + // Do this after "copy-stub-dts" to avoid disk concurrency issues + "copy-stub-dts" + ], "taskPlugin": { "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", diff --git a/libraries/rush-sdk/config/jest.config.json b/libraries/rush-sdk/config/jest.config.json index 62da56b72ce..d1749681d90 100644 --- a/libraries/rush-sdk/config/jest.config.json +++ b/libraries/rush-sdk/config/jest.config.json @@ -1,17 +1,3 @@ { - "extends": "local-node-rig/profiles/default/config/jest.config.json", - - "roots": ["/lib-shim"], - - "testMatch": ["/lib-shim/**/*.test.js"], - - "collectCoverageFrom": [ - "lib-shim/**/*.js", - "!lib-shim/**/*.d.ts", - "!lib-shim/**/*.test.js", - "!lib-shim/**/test/**", - "!lib-shim/**/__tests__/**", - "!lib-shim/**/__fixtures__/**", - "!lib-shim/**/__mocks__/**" - ] + "extends": "local-node-rig/profiles/default/config/jest.config.json" } diff --git a/libraries/rush-sdk/config/typescript.json b/libraries/rush-sdk/config/typescript.json deleted file mode 100644 index 587de5fc0f8..00000000000 --- a/libraries/rush-sdk/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/rush-sdk/package.json b/libraries/rush-sdk/package.json index c3222a85562..2aa84cfd7ed 100644 --- a/libraries/rush-sdk/package.json +++ b/libraries/rush-sdk/package.json @@ -44,7 +44,8 @@ "@rushstack/node-core-library": "workspace:*", "@rushstack/package-deps-hash": "workspace:*", "@rushstack/terminal": "workspace:*", - "tapable": "2.2.1" + "tapable": "2.2.1", + "true-case-path": "~2.2.1" }, "devDependencies": { "@microsoft/rush-lib": "workspace:*", diff --git a/libraries/rush-sdk/src/generate-stubs.ts b/libraries/rush-sdk/src/generate-stubs.ts index 1657eddcfef..8526c3b4829 100644 --- a/libraries/rush-sdk/src/generate-stubs.ts +++ b/libraries/rush-sdk/src/generate-stubs.ts @@ -1,69 +1,79 @@ // 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 'path'; +import path from 'node:path'; +import type { IRunScriptOptions } from '@rushstack/heft'; -import { FileSystem, Import, Path } from '@rushstack/node-core-library'; +import { Async, AsyncQueue, FileSystem, type FolderItem, Import, Path } from '@rushstack/node-core-library'; -function generateLibFilesRecursively(options: { - parentSourcePath: string; - parentTargetPath: string; - parentSrcImportPathWithSlash: string; - libShimIndexPath: string; -}): void { - for (const folderItem of FileSystem.readFolderItems(options.parentSourcePath)) { - const sourcePath: string = path.join(options.parentSourcePath, folderItem.name); - const targetPath: string = path.join(options.parentTargetPath, folderItem.name); +const JS_FILE_EXTENSION: '.js' = '.js'; - if (folderItem.isDirectory()) { - // create destination folder - FileSystem.ensureEmptyFolder(targetPath); - generateLibFilesRecursively({ - parentSourcePath: sourcePath, - parentTargetPath: targetPath, - parentSrcImportPathWithSlash: options.parentSrcImportPathWithSlash + folderItem.name + '/', - libShimIndexPath: options.libShimIndexPath - }); - } else { - if (folderItem.name.endsWith('.d.ts')) { - FileSystem.copyFile({ - sourcePath: sourcePath, - destinationPath: targetPath - }); - } else if (folderItem.name.endsWith('.js')) { - const srcImportPath: string = options.parentSrcImportPathWithSlash + path.parse(folderItem.name).name; - const shimPath: string = path.relative(options.parentTargetPath, options.libShimIndexPath); - const shimPathLiteral: string = JSON.stringify(Path.convertToSlashes(shimPath)); - const srcImportPathLiteral: string = JSON.stringify(srcImportPath); - - FileSystem.writeFile( - targetPath, - // Example: - // module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/policy/GitEmailPolicy"); - `module.exports = require(${shimPathLiteral})._rushSdk_loadInternalModule(${srcImportPathLiteral});` - ); - } +// Entry point invoked by "runScript" action from config/heft.json +export async function runAsync(options: IRunScriptOptions): Promise { + const { + heftConfiguration: { buildFolderPath }, + heftTaskSession: { + logger: { terminal } } - } -} + } = options; -// Entry point invoked by "runScript" action from config/heft.json -export async function runAsync(): Promise { const rushLibFolder: string = Import.resolvePackage({ - baseFolderPath: __dirname, + baseFolderPath: buildFolderPath, packageName: '@microsoft/rush-lib', useNodeJSResolver: true }); - const stubsTargetPath: string = path.resolve(__dirname, '../lib'); - // eslint-disable-next-line no-console - console.log('generate-stubs: Generating stub files under: ' + stubsTargetPath); - generateLibFilesRecursively({ - parentSourcePath: path.join(rushLibFolder, 'lib'), - parentTargetPath: stubsTargetPath, - parentSrcImportPathWithSlash: '', - libShimIndexPath: path.join(__dirname, '../lib-shim/index') - }); - // eslint-disable-next-line no-console - console.log('generate-stubs: Completed successfully.'); + const inFolderPath: string = `${rushLibFolder}/lib-esm`; + const stubsTargetPath: string = `${buildFolderPath}/lib`; + const libShimsIndexPath: string = `${buildFolderPath}/lib-shim/index`; + + terminal.writeLine(' Generating stub files under: ' + stubsTargetPath); + + const folderPathQueue: AsyncQueue = new AsyncQueue([undefined]); + await Async.forEachAsync( + folderPathQueue, + async ([relativeFolderPath, callback]) => { + let folderPath: string; + let targetFolderPath: string; + if (relativeFolderPath) { + folderPath = `${inFolderPath}/${relativeFolderPath}`; + targetFolderPath = `${stubsTargetPath}/${relativeFolderPath}`; + } else { + folderPath = inFolderPath; + targetFolderPath = stubsTargetPath; + } + + const folderItems: FolderItem[] = await FileSystem.readFolderItemsAsync(folderPath); + for (const folderItem of folderItems) { + const itemName: string = folderItem.name; + + if (folderItem.isDirectory()) { + const relativeItemPath: string = relativeFolderPath + ? `${relativeFolderPath}/${itemName}` + : itemName; + folderPathQueue.push(relativeItemPath); + } else if (folderItem.isFile() && itemName.endsWith(JS_FILE_EXTENSION)) { + const fileBaseName: string = path.parse(itemName).name; + const srcImportPath: string = relativeFolderPath + ? `${relativeFolderPath}/${fileBaseName}` + : fileBaseName; + const shimImportPath: string = path.relative(folderPath, libShimsIndexPath); + + const shimPathLiteral: string = JSON.stringify(Path.convertToSlashes(shimImportPath)); + const srcImportPathLiteral: string = JSON.stringify(srcImportPath); + + FileSystem.writeFile( + `${targetFolderPath}/${itemName}`, + // Example: + // module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/policy/GitEmailPolicy"); + `module.exports = require(${shimPathLiteral})._rushSdk_loadInternalModule(${srcImportPathLiteral});` + ); + } + } + callback(); + }, + { concurrency: 10 } + ); + + terminal.writeLine('Completed successfully.'); } diff --git a/libraries/rush-sdk/src/index.ts b/libraries/rush-sdk/src/index.ts index aebb2dd133e..3b1fe75e609 100644 --- a/libraries/rush-sdk/src/index.ts +++ b/libraries/rush-sdk/src/index.ts @@ -10,7 +10,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 type { SpawnSyncReturns } from 'child_process'; import { RUSH_LIB_NAME, @@ -211,6 +211,20 @@ ${errorMessage} process.exit(1); } +const exports: typeof import('@microsoft/rush-lib') = { + /** + * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs. + */ + _rushSdk_loadInternalModule: (srcImportPath: string) => { + if (!exports._RushInternals) { + throw new Error( + `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk` + ); + } + return exports._RushInternals.loadModule(srcImportPath); + } +} as unknown as typeof import('@microsoft/rush-lib'); + // Based on TypeScript's __exportStar() for (const property in sdkContext.rushLibModule) { if (property !== 'default' && !exports.hasOwnProperty(property)) { @@ -226,14 +240,4 @@ for (const property in sdkContext.rushLibModule) { } } -/** - * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs. - */ -export function _rushSdk_loadInternalModule(srcImportPath: string): unknown { - if (!exports._RushInternals) { - throw new Error( - `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk` - ); - } - return exports._RushInternals.loadModule(srcImportPath); -} +export default exports; diff --git a/libraries/rush-sdk/src/test/__snapshots__/script.test.ts.snap b/libraries/rush-sdk/src/test/__snapshots__/script.test.ts.snap index 77607c81853..2de046fb3f1 100644 --- a/libraries/rush-sdk/src/test/__snapshots__/script.test.ts.snap +++ b/libraries/rush-sdk/src/test/__snapshots__/script.test.ts.snap @@ -77,7 +77,11 @@ exports[`@rushstack/rush-sdk Should load via global (for plugins): stdout 1`] = exports[`@rushstack/rush-sdk Should load via install-run (for standalone tools): stderr 1`] = `""`; exports[`@rushstack/rush-sdk Should load via install-run (for standalone tools): stdout 1`] = ` -"Trying to load @microsoft/rush-lib installed by install-run-rush +"Try to load @microsoft/rush-lib from rush global folder +The expected global rush installed folder is \\"/Users/ianc/.rush/node-v22.12.0/rush-5.57.0\\" +Failed to load @microsoft/rush-lib from rush global folder: File does not exist: /Users/ianc/.rush/node-v22.12.0/rush-5.57.0 +ENOENT: no such file or directory, lstat '/Users/ianc/.rush/node-v22.12.0/rush-5.57.0' +Trying to load @microsoft/rush-lib installed by install-run-rush Loaded @microsoft/rush-lib installed by install-run-rush [ '_rushSdk_loadInternalModule', diff --git a/libraries/rush-sdk/tsconfig.json b/libraries/rush-sdk/tsconfig.json index 83f4fb550b8..ce98a2516c0 100644 --- a/libraries/rush-sdk/tsconfig.json +++ b/libraries/rush-sdk/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "outDir": "lib-commonjs", "types": [ "node", "heft-jest", diff --git a/libraries/rush-sdk/webpack.config.js b/libraries/rush-sdk/webpack.config.js index b86d582f7a8..d914986fd2f 100644 --- a/libraries/rush-sdk/webpack.config.js +++ b/libraries/rush-sdk/webpack.config.js @@ -17,16 +17,16 @@ module.exports = () => { 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-esm/index.js`, + loader: `${__dirname}/lib-esm/loader.js` }, output: { path: `${__dirname}/lib-shim`, filename: '[name].js', chunkFilename: 'chunks/[name].js', library: { - type: 'commonjs2' + type: 'commonjs2', + export: 'default' } }, optimization: { 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 20169cf41f8..e2a06e27039 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/rushell.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/rushell.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./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 580e71ab320..8aa034576d6 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/stream-collator.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/stream-collator.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", 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 947a4ef4540..5dc396d8464 100644 --- a/libraries/terminal/package.json +++ b/libraries/terminal/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/terminal", "version": "0.15.2", "description": "User interface primitives for console applications", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/terminal.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/terminal.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -20,7 +41,7 @@ "supports-color": "~8.1.1" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@types/supports-color": "8.1.3", "decoupled-local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" 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 e365b80348d..41a13cf97ab 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/tree-pattern.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/tree-pattern.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", @@ -16,7 +37,7 @@ "_phase:test": "heft run --only test -- --clean" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "decoupled-local-node-rig": "workspace:*" } } 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 ccb5f5c99e1..5b6136a4bfd 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/ts-command-line.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/ts-command-line.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "_phase:build": "heft run --only build -- --clean", @@ -22,7 +43,7 @@ "string-argv": "~0.3.1" }, "devDependencies": { - "@rushstack/heft": "0.71.2", + "@rushstack/heft": "0.73.1", "@rushstack/node-core-library": "workspace:*", "decoupled-local-node-rig": "workspace:*", "local-eslint-config": "workspace:*" 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 9d504802459..846860b797f 100644 --- a/libraries/typings-generator/package.json +++ b/libraries/typings-generator/package.json @@ -7,8 +7,29 @@ "typings", "generate" ], - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/typings-generator.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/typings-generator.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 cbe3234dd32..2388af12dfd 100644 --- a/libraries/worker-pool/package.json +++ b/libraries/worker-pool/package.json @@ -2,8 +2,29 @@ "name": "@rushstack/worker-pool", "version": "0.5.18", "description": "Lightweight worker pool using NodeJS worker_threads", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/worker-pool.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/worker-pool.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "url": "https://github.com/microsoft/rushstack.git", diff --git a/repo-scripts/doc-plugin-rush-stack/package.json b/repo-scripts/doc-plugin-rush-stack/package.json index a76bd5f65ab..b2680eab9f8 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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/repo-scripts/doc-plugin-rush-stack/src/RushStackFeature.ts b/repo-scripts/doc-plugin-rush-stack/src/RushStackFeature.ts index 7de3c775426..92bb72226dc 100644 --- a/repo-scripts/doc-plugin-rush-stack/src/RushStackFeature.ts +++ b/repo-scripts/doc-plugin-rush-stack/src/RushStackFeature.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import yaml = require('js-yaml'); +import yaml from 'js-yaml'; import { FileSystem } from '@rushstack/node-core-library'; import type { ApiItem } from '@microsoft/api-extractor-model'; import { diff --git a/rigs/decoupled-local-node-rig/package.json b/rigs/decoupled-local-node-rig/package.json index d21f0b501a4..6db99d0090b 100644 --- a/rigs/decoupled-local-node-rig/package.json +++ b/rigs/decoupled-local-node-rig/package.json @@ -9,11 +9,13 @@ "_phase:build": "" }, "dependencies": { - "@microsoft/api-extractor": "7.52.3", + "@microsoft/api-extractor": "7.52.4", "@rushstack/eslint-config": "4.3.0", "@rushstack/eslint-patch": "1.11.0", - "@rushstack/heft-node-rig": "2.8.5", - "@rushstack/heft": "0.71.2", + "@rushstack/heft-isolated-typescript-transpile-plugin": "0.1.6", + "@rushstack/heft-node-rig": "2.8.8", + "@rushstack/heft-typescript-plugin": "0.9.2", + "@rushstack/heft": "0.73.1", "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", "@typescript-eslint/parser": "~8.26.1", 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..b43a85e7401 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,50 @@ { "$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": ["dist", "lib", "lib-commonjs", "lib-esm", "lib-dts"] }], + + "tasksByName": { + "copy-json": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + // This was previously handled by `config/typescript.json`'s `staticAssetsToCopy` option. + { + "sourcePath": "src", + "destinationFolders": ["lib-commonjs", "lib-esm"], + "fileExtensions": [".json"] + } + ] + } + } + }, + + "transpile": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft-isolated-typescript-transpile-plugin", + "options": { + "emitKinds": [ + { + "outDir": "/lib-commonjs", + "formatOverride": "CommonJS", + "targetOverride": "ES2020" + }, + { + "outDir": "/lib-esm", + "formatOverride": "ES2020", + "targetOverride": "ES2020" + } + ] + } + } + } + } + } + } } 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..8a7269e4071 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,6 +1,9 @@ { "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.{cjs,js}"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", 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..0611863a944 100644 --- a/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/decoupled-local-node-rig/profiles/default/tsconfig-base.json @@ -7,9 +7,12 @@ "resolveJsonModule": true, "isolatedModules": true, "target": "es2018", + "module": "esnext", + "moduleResolution": "bundler", + "emitDeclarationOnly": true, - "outDir": "../../../../lib", "rootDir": "../../../../src", + "declarationDir": "../../../../lib-dts", "types": ["heft-jest", "node"], "typeRoots": ["../../../../node_modules/@types", "../../node_modules/@types"] diff --git a/rigs/local-node-rig/package.json b/rigs/local-node-rig/package.json index 2fc418e7070..8a3c7f5fc61 100644 --- a/rigs/local-node-rig/package.json +++ b/rigs/local-node-rig/package.json @@ -10,13 +10,15 @@ }, "dependencies": { "@microsoft/api-extractor": "workspace:*", + "@rushstack/heft-isolated-typescript-transpile-plugin": "workspace:*", "@rushstack/heft-node-rig": "workspace:*", + "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft": "workspace:*", "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", - "local-eslint-config": "workspace:*", "eslint": "~8.57.0", "jest-junit": "12.3.0", + "local-eslint-config": "workspace:*", "typescript": "~5.8.2" } } diff --git a/rigs/local-node-rig/profiles/default/config/heft.json b/rigs/local-node-rig/profiles/default/config/heft.json index 437ad9b13ba..b43a85e7401 100644 --- a/rigs/local-node-rig/profiles/default/config/heft.json +++ b/rigs/local-node-rig/profiles/default/config/heft.json @@ -1,5 +1,50 @@ { "$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": ["dist", "lib", "lib-commonjs", "lib-esm", "lib-dts"] }], + + "tasksByName": { + "copy-json": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "copy-files-plugin", + "options": { + "copyOperations": [ + // This was previously handled by `config/typescript.json`'s `staticAssetsToCopy` option. + { + "sourcePath": "src", + "destinationFolders": ["lib-commonjs", "lib-esm"], + "fileExtensions": [".json"] + } + ] + } + } + }, + + "transpile": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft-isolated-typescript-transpile-plugin", + "options": { + "emitKinds": [ + { + "outDir": "/lib-commonjs", + "formatOverride": "CommonJS", + "targetOverride": "ES2020" + }, + { + "outDir": "/lib-esm", + "formatOverride": "ES2020", + "targetOverride": "ES2020" + } + ] + } + } + } + } + } + } } 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..a581e40d83f 100644 --- a/rigs/local-node-rig/profiles/default/config/jest.config.json +++ b/rigs/local-node-rig/profiles/default/config/jest.config.json @@ -1,6 +1,9 @@ { "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json", + "roots": ["/lib-commonjs"], + "testMatch": ["/lib-commonjs/**/*.test.{cjs,js}"], + // Enable code coverage for Jest "collectCoverage": true, "coverageDirectory": "/coverage", @@ -22,5 +25,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/tsconfig-base.json b/rigs/local-node-rig/profiles/default/tsconfig-base.json index dff2ef99dc1..0611863a944 100644 --- a/rigs/local-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/local-node-rig/profiles/default/tsconfig-base.json @@ -7,9 +7,12 @@ "resolveJsonModule": true, "isolatedModules": true, "target": "es2018", + "module": "esnext", + "moduleResolution": "bundler", + "emitDeclarationOnly": true, - "outDir": "../../../../lib", "rootDir": "../../../../src", + "declarationDir": "../../../../lib-dts", "types": ["heft-jest", "node"], "typeRoots": ["../../../../node_modules/@types", "../../node_modules/@types"] 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 02806366d91..52f2eaaf39b 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,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", 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 8dcb7d4f87c..67bd17bffa5 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,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", 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 ff920ee574d..7dbca5f0106 100644 --- a/rush-plugins/rush-buildxl-graph-plugin/package.json +++ b/rush-plugins/rush-buildxl-graph-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/rush-plugins/rush-http-build-cache-plugin/package.json b/rush-plugins/rush-http-build-cache-plugin/package.json index b0d9949bf9a..b5e679f39ef 100644 --- a/rush-plugins/rush-http-build-cache-plugin/package.json +++ b/rush-plugins/rush-http-build-cache-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", diff --git a/rush-plugins/rush-litewatch-plugin/package.json b/rush-plugins/rush-litewatch-plugin/package.json index dd77b35abea..105a4dc9529 100644 --- a/rush-plugins/rush-litewatch-plugin/package.json +++ b/rush-plugins/rush-litewatch-plugin/package.json @@ -9,6 +9,29 @@ "type": "git", "directory": "rush-plugins/rush-litewatch-plugin" }, + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft test --clean", "_phase:build": "heft run --only build -- --clean", 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 3acb0a4858f..bd890f1da83 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/package.json +++ b/rush-plugins/rush-redis-cobuild-plugin/package.json @@ -8,8 +8,29 @@ "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "scripts": { "build": "heft build --clean", 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 a6bf876a649..41a8892e286 100644 --- a/rush-plugins/rush-resolver-cache-plugin/package.json +++ b/rush-plugins/rush-resolver-cache-plugin/package.json @@ -9,6 +9,7 @@ "directory": "rush-plugins/rush-resolver-cache-plugin" }, "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "types": "dist/rush-resolver-cache-plugin.d.ts", "scripts": { "build": "heft test --clean", @@ -29,15 +30,21 @@ }, "exports": { ".": { - "require": "./lib/index.js", - "types": "./dist/rush-resolver-cache-plugin.d.ts" + "require": "./lib-commonjs/index.js", + "types": "./dist/rush-resolver-cache-plugin.d.ts", + "import": "./lib-esm/index.js" }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + } }, "typesVersions": { "*": { - ".": [ - "dist/rush-resolver-cache-plugin.d.ts" + "lib/*": [ + "lib-dts/*" ] } } 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 f33ddb4e2e5..b8179626675 100644 --- a/rush-plugins/rush-serve-plugin/package.json +++ b/rush-plugins/rush-serve-plugin/package.json @@ -9,6 +9,7 @@ "directory": "rush-plugins/rush-serve-plugin" }, "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "types": "dist/index.d.ts", "scripts": { "build": "heft test --clean", @@ -39,21 +40,21 @@ }, "exports": { ".": { - "require": "./lib/index.js", - "types": "./dist/rush-serve-plugin.d.ts" + "require": "./lib-commonjs/index.js", + "types": "./dist/index.d.ts", + "import": "./lib-esm/index.js" }, - "./api": { - "types": "./lib/api.types.d.ts" - }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + } }, "typesVersions": { "*": { - ".": [ - "dist/rush-serve-plugin.d.ts" - ], - "api": [ - "lib/api.types.d.ts" + "lib/*": [ + "lib-dts/*" ] } } diff --git a/rush.json b/rush.json index c6f332c3d97..f6487b65aad 100644 --- a/rush.json +++ b/rush.json @@ -1236,10 +1236,12 @@ "shouldPublish": false, "decoupledLocalDependencies": [ "@microsoft/api-extractor", - "@rushstack/heft-node-rig", - "@rushstack/heft", + "@rushstack/eslint-config", "@rushstack/eslint-patch", - "@rushstack/eslint-config" + "@rushstack/heft-isolated-typescript-transpile-plugin", + "@rushstack/heft-node-rig", + "@rushstack/heft-typescript-plugin", + "@rushstack/heft" ] }, { diff --git a/vscode-extensions/rush-vscode-extension/config/heft.json b/vscode-extensions/rush-vscode-extension/config/heft.json index 15b954e3644..6cbb19fa109 100644 --- a/vscode-extensions/rush-vscode-extension/config/heft.json +++ b/vscode-extensions/rush-vscode-extension/config/heft.json @@ -15,7 +15,7 @@ "cleanFiles": [{ "includeGlobs": ["webview"] }], "tasksByName": { "webpack": { - "taskDependencies": ["typescript"], + "taskDependencies": ["transpile"], "taskPlugin": { "pluginPackage": "@rushstack/heft-webpack5-plugin" } @@ -36,12 +36,12 @@ } }, "generate-vscodeignore": { - "taskDependencies": ["copy-webview", "typescript", "webpack"], + "taskDependencies": ["copy-webview", "transpile", "webpack"], "taskPlugin": { "pluginPackage": "@rushstack/heft", "pluginName": "run-script-plugin", "options": { - "scriptPath": "lib/scripts/generate-vscodeignore.js" + "scriptPath": "lib-commonjs/scripts/generate-vscodeignore.js" } } } diff --git a/vscode-extensions/rush-vscode-extension/package.json b/vscode-extensions/rush-vscode-extension/package.json index b8fa544405d..ec55737d372 100644 --- a/vscode-extensions/rush-vscode-extension/package.json +++ b/vscode-extensions/rush-vscode-extension/package.json @@ -70,7 +70,29 @@ "description": "Rush Stack community support" } ], - "main": "./dist/extension.js", + "main": "lib-commonjs/./dist/extension.js", + "module": "lib-esm/./dist/extension.js", + "typings": "lib-dts/./dist/extension.d.ts", + "exports": { + ".": { + "import": "./lib-esm/./dist/extension.js", + "require": "./lib-commonjs/./dist/extension.js", + "types": "./lib-dts/./dist/extension.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "scripts": { "build": "heft build --clean", "build:watch": "heft build-watch", diff --git a/vscode-extensions/rush-vscode-extension/webpack.config.js b/vscode-extensions/rush-vscode-extension/webpack.config.js index 7e35e8bdc3f..e3cb4850095 100644 --- a/vscode-extensions/rush-vscode-extension/webpack.config.js +++ b/vscode-extensions/rush-vscode-extension/webpack.config.js @@ -16,7 +16,7 @@ function createExtensionConfig({ production, webpack }) { target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ mode: production ? 'production' : 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') - entry: './lib/extension.js', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + entry: './lib-esm/extension.js', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ path: path.resolve(__dirname, 'dist'), diff --git a/webpack/hashed-folder-copy-plugin/.npmignore b/webpack/hashed-folder-copy-plugin/.npmignore index 814dbc9e741..bc349f9a4be 100644 --- a/webpack/hashed-folder-copy-plugin/.npmignore +++ b/webpack/hashed-folder-copy-plugin/.npmignore @@ -1,25 +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 -# ----------------------------- +# --------------------------------------------------------------------------- +# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below. +# --------------------------------------------------------------------------- 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/package.json b/webpack/hashed-folder-copy-plugin/package.json index 1d13fdd876b..06b2f1c8620 100644 --- a/webpack/hashed-folder-copy-plugin/package.json +++ b/webpack/hashed-folder-copy-plugin/package.json @@ -3,28 +3,25 @@ "version": "1.1.9", "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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "exports": { ".": { "types": "./dist/hashed-folder-copy-plugin.d.ts", - "default": "./lib/index.js" - }, - "./ambientTypes": { - "types": "./dist/ambientTypes.d.ts" + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js" }, "./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" }, "typesVersions": { "*": { - ".": [ - "./dist/hashed-folder-copy-plugin.d.ts" - ], - "ambientTypes": [ - "./dist/ambientTypes.d.ts" + "lib/*": [ + "lib-dts/*" ] } }, 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 25b05af52b0..a93b7021710 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.98", "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/loader-load-themed-styles/src/LoadThemedStylesLoader.ts b/webpack/loader-load-themed-styles/src/LoadThemedStylesLoader.ts index a11d8d90f70..82933e0602a 100644 --- a/webpack/loader-load-themed-styles/src/LoadThemedStylesLoader.ts +++ b/webpack/loader-load-themed-styles/src/LoadThemedStylesLoader.ts @@ -8,7 +8,7 @@ */ import type { loader } from 'webpack'; -import loaderUtils = require('loader-utils'); +import loaderUtils from 'loader-utils'; const loadedThemedStylesPath: string = require.resolve('@microsoft/load-themed-styles'); diff --git a/webpack/loader-load-themed-styles/src/test/LoadThemedStylesLoader.test.ts b/webpack/loader-load-themed-styles/src/test/LoadThemedStylesLoader.test.ts index c0c687b572e..487ace4d277 100644 --- a/webpack/loader-load-themed-styles/src/test/LoadThemedStylesLoader.test.ts +++ b/webpack/loader-load-themed-styles/src/test/LoadThemedStylesLoader.test.ts @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import webpack = require('webpack'); +import webpack from 'webpack'; import { LoadThemedStylesLoader } from '../LoadThemedStylesLoader'; -import LoadThemedStylesMock = require('./testData/LoadThemedStylesMock'); +import LoadThemedStylesMock from './testData/LoadThemedStylesMock'; function wrapResult(loaderResult: string): string { return `var module = { id: 'testId', exports: {} }; diff --git a/webpack/loader-raw-script/package.json b/webpack/loader-raw-script/package.json index b26ec67ac0c..7f6fc582de3 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.4.98", "description": "", - "main": "lib/index.js", - "typings": "lib/index.d.ts", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/loader-raw-script/src/test/RawScriptLoader.test.ts b/webpack/loader-raw-script/src/test/RawScriptLoader.test.ts index b29eda6d79d..3e7bbf64b45 100644 --- a/webpack/loader-raw-script/src/test/RawScriptLoader.test.ts +++ b/webpack/loader-raw-script/src/test/RawScriptLoader.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import RawScriptLoader = require('./../RawScriptLoader'); +import RawScriptLoader from './../RawScriptLoader'; function wrapResult(result: string): string { return `var exports = {}; 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 c148642f23b..d8dee908053 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.98", "description": "This plugin tells webpack to leave dynamic calls to \"require\" as-is instead of trying to bundle them.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack-preserve-dynamic-require-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack-preserve-dynamic-require-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./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 8155dde97b9..23cf89a0f2a 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.1.82", "description": "This plugin sets the webpack public path at runtime.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/set-webpack-public-path-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/set-webpack-public-path-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 fe0766cc6a2..9a5bd699796 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", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack-deep-imports-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack-deep-imports-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./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 014b1e659ad..21437ac4112 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.2.99", "description": "This plugin analyzes bundled dependencies from Node Modules for use with Component Governance and License Scanning.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack-embedded-dependencies-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack-embedded-dependencies-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 9e16a520efc..c9af35d59f5 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.4.82", "description": "This plugin sets the webpack public path at runtime.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack-plugin-utilities.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack-plugin-utilities.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 f2a3941a4a2..df54b4d27f7 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.4.18", "description": "This plugin leverages workspace-level metadata to greatly accelerate module resolution.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack-workspace-resolve-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack-workspace-resolve-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./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 a5932a7d0ac..0e5c4faed73 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.18.102", "description": "This plugin facilitates localization with Webpack.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack4-localization-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack4-localization-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 5d71d3aebaf..5de58e24aff 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.13.101", "description": "This plugin splits minification of webpack compilations into smaller units.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack4-module-minifier-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack4-module-minifier-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", diff --git a/webpack/webpack4-module-minifier-plugin/src/workerPool/WebpackWorker.ts b/webpack/webpack4-module-minifier-plugin/src/workerPool/WebpackWorker.ts index b20c76f2805..430352205c1 100644 --- a/webpack/webpack4-module-minifier-plugin/src/workerPool/WebpackWorker.ts +++ b/webpack/webpack4-module-minifier-plugin/src/workerPool/WebpackWorker.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import webpack = require('webpack'); +import webpack from 'webpack'; import * as workerThreads from 'worker_threads'; import { MessagePortMinifier } from '@rushstack/module-minifier'; import { ModuleMinifierPlugin } from '../ModuleMinifierPlugin'; 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 e4ad8804e15..f6afb0f3ae8 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.2.98", "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", + "typings": "lib-dts/index.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./lib-dts/index.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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..f0cc7b49d0d 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 @@ -3,7 +3,7 @@ import * as loader from '..'; import type { Stats } from 'webpack'; -import LoadThemedStylesMock = require('./testData/LoadThemedStylesMock'); +import LoadThemedStylesMock from './testData/LoadThemedStylesMock'; import getCompiler from './testData/getCompiler'; const MATCH_GENERATED_LOADER_STRING_REGEXP: RegExp = /var\sloader\s\=\srequire\(["'](.+?)["']\)/; 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 b0f2b7462a6..165d4bc1bd4 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.13.11", "description": "This plugin facilitates localization with Webpack.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack5-localization-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack5-localization-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git", 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 9fea3bcd354..3344f062825 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.5.102", "description": "This plugin splits minification of webpack compilations into smaller units.", - "main": "lib/index.js", + "main": "lib-commonjs/index.js", + "module": "lib-esm/index.js", "typings": "dist/webpack5-module-minifier-plugin.d.ts", + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib-commonjs/index.js", + "types": "./dist/webpack5-module-minifier-plugin.d.ts" + }, + "./lib/*": { + "import": "./lib-esm/*.js", + "require": "./lib-commonjs/*.js", + "types": "./lib-dts/*.d.ts" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "lib/*": [ + "lib-dts/*" + ] + } + }, "license": "MIT", "repository": { "type": "git",