@nx/js 23.0.0-beta.2 → 23.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{babel.d.ts → dist/babel.d.ts} +0 -1
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +108 -0
- package/{plugins → dist/plugins}/jest/local-registry.d.ts +0 -1
- package/{src → dist/src}/executors/copy-workspace-modules/copy-workspace-modules.d.ts +0 -1
- package/{src → dist/src}/executors/node/lib/coalescing-debounce.d.ts +0 -1
- package/{src → dist/src}/executors/node/lib/detect-module-format.d.ts +2 -2
- package/{src → dist/src}/executors/node/lib/detect-module-format.js +7 -23
- package/{src → dist/src}/executors/node/lib/esm-loader.d.ts +0 -1
- package/{src → dist/src}/executors/node/lib/kill-tree.d.ts +0 -1
- package/{src → dist/src}/executors/node/lib/line-aware-writer.d.ts +0 -1
- package/{src → dist/src}/executors/node/lib/output-file.d.ts +0 -1
- package/dist/src/executors/node/node-with-esm-loader.d.ts +1 -0
- package/{src → dist/src}/executors/node/node-with-esm-loader.js +2 -0
- package/dist/src/executors/node/node-with-require-overrides.d.ts +1 -0
- package/{src → dist/src}/executors/node/node-with-require-overrides.js +2 -0
- package/{src → dist/src}/executors/node/node.impl.d.ts +0 -1
- package/{src → dist/src}/executors/node/node.impl.js +3 -3
- package/{src → dist/src}/executors/prune-lockfile/prune-lockfile.d.ts +0 -1
- package/{src → dist/src}/executors/release-publish/extract-npm-publish-json-data.d.ts +0 -1
- package/{src → dist/src}/executors/release-publish/format-bytes.d.ts +0 -1
- package/{src → dist/src}/executors/release-publish/log-tar.d.ts +0 -1
- package/{src → dist/src}/executors/release-publish/release-publish.impl.d.ts +0 -1
- package/{src → dist/src}/executors/release-publish/release-publish.impl.js +28 -2
- package/{src → dist/src}/executors/swc/swc.impl.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/build-task-info-per-tsconfig-map.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/index.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/normalize-tasks-options.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/types.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/watch.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/batch/watch.js +1 -1
- package/{src → dist/src}/executors/tsc/lib/get-custom-transformers-factory.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/get-task-options.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/get-tsconfig.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/index.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/typescript-compilation.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/lib/typescript-compilation.js +2 -2
- package/{src → dist/src}/executors/tsc/lib/typescript-diagnostic-reporters.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/tsc.batch-impl.d.ts +0 -1
- package/{src → dist/src}/executors/tsc/tsc.impl.d.ts +1 -2
- package/{src → dist/src}/executors/verdaccio/verdaccio.impl.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-swc/convert-to-swc.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-swc/convert-to-swc.js +3 -1
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +15 -42
- package/{src → dist/src}/generators/init/schema.json +1 -1
- package/{src → dist/src}/generators/library/library.d.ts +0 -1
- package/{src → dist/src}/generators/library/library.js +21 -17
- package/{src → dist/src}/generators/library/schema.d.ts +1 -1
- package/{src → dist/src}/generators/library/utils/add-release-config.d.ts +0 -1
- package/dist/src/generators/release-version/release-version.d.ts +1 -0
- package/{src → dist/src}/generators/setup-build/generator.d.ts +0 -1
- package/{src → dist/src}/generators/setup-build/generator.js +6 -6
- package/{src → dist/src}/generators/setup-prettier/generator.d.ts +0 -1
- package/{src → dist/src}/generators/setup-prettier/generator.js +2 -0
- package/{src → dist/src}/generators/setup-verdaccio/generator.d.ts +0 -1
- package/{src → dist/src}/generators/setup-verdaccio/generator.js +3 -1
- package/{src → dist/src}/generators/typescript-sync/typescript-sync.d.ts +0 -1
- package/{src → dist/src}/generators/typescript-sync/typescript-sync.js +2 -0
- package/{src → dist/src}/index.d.ts +0 -1
- package/dist/src/internal.d.ts +18 -0
- package/dist/src/internal.js +25 -0
- package/{src → dist/src}/migrations/update-21-5-0/migrate-development-custom-condition.d.ts +0 -1
- package/dist/src/migrations/update-21-5-0/migrate-development-custom-condition.md +87 -0
- package/{src → dist/src}/migrations/update-22-0-0/remove-external-options-from-js-executors.d.ts +0 -1
- package/dist/src/migrations/update-22-0-0/remove-external-options-from-js-executors.js +94 -0
- package/dist/src/migrations/update-22-0-0/remove-external-options-from-js-executors.md +79 -0
- package/{src → dist/src}/migrations/update-22-1-0/remove-redundant-ts-project-references.d.ts +0 -1
- package/dist/src/migrations/update-22-1-0/remove-redundant-ts-project-references.md +143 -0
- package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
- package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +144 -0
- package/{src → dist/src}/plugins/jest/start-local-registry.d.ts +0 -1
- package/{src → dist/src}/plugins/typescript/plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/typescript/plugin.js +22 -8
- package/{src → dist/src}/plugins/typescript/util.d.ts +0 -1
- package/{src → dist/src}/plugins/typescript/util.js +1 -1
- package/{src → dist/src}/release/utils/semver.d.ts +0 -1
- package/{src → dist/src}/release/utils/update-lock-file.d.ts +0 -1
- package/{src → dist/src}/release/version-actions.d.ts +0 -1
- package/{src → dist/src}/release/version-actions.js +3 -3
- package/{src → dist/src}/utils/add-babel-inputs.d.ts +0 -1
- package/{src → dist/src}/utils/add-local-registry-scripts.d.ts +0 -1
- package/dist/src/utils/assert-supported-typescript-version.d.ts +2 -0
- package/dist/src/utils/assert-supported-typescript-version.js +8 -0
- package/{src → dist/src}/utils/assets/assets.d.ts +0 -1
- package/{src → dist/src}/utils/assets/copy-assets-handler.d.ts +0 -1
- package/{src → dist/src}/utils/assets/index.d.ts +0 -1
- package/{src → dist/src}/utils/assets/normalize-assets.d.ts +0 -1
- package/{src → dist/src}/utils/buildable-libs-utils.d.ts +0 -1
- package/{src → dist/src}/utils/check-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/code-frames/highlight.d.ts +0 -1
- package/{src → dist/src}/utils/code-frames/identifiers.d.ts +0 -1
- package/{src → dist/src}/utils/compiler-helper-dependency.d.ts +0 -1
- package/{src → dist/src}/utils/find-npm-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/generate-globs.d.ts +0 -1
- package/{src → dist/src}/utils/generator-prompts.d.ts +0 -1
- package/{src → dist/src}/utils/generator-prompts.js +3 -3
- package/{src → dist/src}/utils/get-import-path.d.ts +0 -1
- package/{src → dist/src}/utils/get-main-file-dir.d.ts +0 -1
- package/{src → dist/src}/utils/is-locally-linked-package-version.d.ts +0 -1
- package/{src → dist/src}/utils/is-valid-variable.d.ts +0 -1
- package/dist/src/utils/module-format/is-esm-project.d.ts +16 -0
- package/dist/src/utils/module-format/is-esm-project.js +32 -0
- package/dist/src/utils/module-format/module-format.d.ts +17 -0
- package/dist/src/utils/module-format/module-format.js +43 -0
- package/{src → dist/src}/utils/npm-config.d.ts +0 -1
- package/{src → dist/src}/utils/package-json/create-entry-points.d.ts +0 -1
- package/{src → dist/src}/utils/package-json/get-npm-scope.d.ts +0 -1
- package/{src → dist/src}/utils/package-json/index.d.ts +0 -1
- package/{src → dist/src}/utils/package-json/sort-fields.d.ts +0 -1
- package/{src → dist/src}/utils/package-json/update-package-json.d.ts +0 -1
- package/{src → dist/src}/utils/package-manager-workspaces.d.ts +0 -1
- package/{src → dist/src}/utils/prettier.d.ts +0 -1
- package/{src → dist/src}/utils/prettier.js +3 -36
- package/{src → dist/src}/utils/strip-glob-to-base-dir.d.ts +0 -1
- package/{src → dist/src}/utils/swc/add-swc-config.d.ts +0 -1
- package/{src → dist/src}/utils/swc/add-swc-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/swc/add-swc-dependencies.js +2 -2
- package/{src → dist/src}/utils/swc/compile-swc.d.ts +0 -1
- package/{src → dist/src}/utils/swc/compile-swc.js +2 -2
- package/{src → dist/src}/utils/swc/get-swcrc-path.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/function-after-declarations-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/function-after-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/function-direct-export.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/function-multiple-hooks.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/plugin-a.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/__mocks__/plugin-b.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/add-tslib-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/ast-utils.d.ts +0 -1
- package/dist/src/utils/typescript/compilation.d.ts +22 -0
- package/dist/src/utils/typescript/compilation.js +119 -0
- package/{src → dist/src}/utils/typescript/compile-typescript-files.d.ts +1 -2
- package/{src → dist/src}/utils/typescript/compile-typescript-files.js +3 -3
- package/{src → dist/src}/utils/typescript/configuration.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/create-ts-config.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/ensure-typescript.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/get-source-nodes.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/load-ts-transformers.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/plugin.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/print-diagnostics.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/raw-tsconfig.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/run-type-check.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/run-type-check.js +1 -1
- package/{src → dist/src}/utils/typescript/ts-config.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/ts-solution-setup.d.ts +0 -1
- package/{src → dist/src}/utils/typescript/types.d.ts +0 -1
- package/dist/src/utils/typescript/types.js +2 -0
- package/{src → dist/src}/utils/versions.d.ts +2 -3
- package/{src → dist/src}/utils/versions.js +5 -4
- package/{src → dist/src}/utils/watch-for-single-file-changes.d.ts +0 -1
- package/{typescript.d.ts → dist/typescript.d.ts} +0 -1
- package/executors.json +15 -15
- package/generators.json +14 -14
- package/migrations.json +35 -7
- package/package.json +102 -11
- package/babel.d.ts.map +0 -1
- package/plugins/jest/local-registry.d.ts.map +0 -1
- package/src/executors/copy-workspace-modules/copy-workspace-modules.d.ts.map +0 -1
- package/src/executors/node/lib/coalescing-debounce.d.ts.map +0 -1
- package/src/executors/node/lib/detect-module-format.d.ts.map +0 -1
- package/src/executors/node/lib/esm-loader.d.ts.map +0 -1
- package/src/executors/node/lib/kill-tree.d.ts.map +0 -1
- package/src/executors/node/lib/line-aware-writer.d.ts.map +0 -1
- package/src/executors/node/lib/output-file.d.ts.map +0 -1
- package/src/executors/node/node-with-esm-loader.d.ts +0 -6
- package/src/executors/node/node-with-esm-loader.d.ts.map +0 -1
- package/src/executors/node/node-with-require-overrides.d.ts +0 -8
- package/src/executors/node/node-with-require-overrides.d.ts.map +0 -1
- package/src/executors/node/node.impl.d.ts.map +0 -1
- package/src/executors/prune-lockfile/prune-lockfile.d.ts.map +0 -1
- package/src/executors/release-publish/extract-npm-publish-json-data.d.ts.map +0 -1
- package/src/executors/release-publish/format-bytes.d.ts.map +0 -1
- package/src/executors/release-publish/log-tar.d.ts.map +0 -1
- package/src/executors/release-publish/release-publish.impl.d.ts.map +0 -1
- package/src/executors/swc/swc.impl.d.ts.map +0 -1
- package/src/executors/tsc/lib/batch/build-task-info-per-tsconfig-map.d.ts.map +0 -1
- package/src/executors/tsc/lib/batch/index.d.ts.map +0 -1
- package/src/executors/tsc/lib/batch/normalize-tasks-options.d.ts.map +0 -1
- package/src/executors/tsc/lib/batch/types.d.ts.map +0 -1
- package/src/executors/tsc/lib/batch/watch.d.ts.map +0 -1
- package/src/executors/tsc/lib/get-custom-transformers-factory.d.ts.map +0 -1
- package/src/executors/tsc/lib/get-task-options.d.ts.map +0 -1
- package/src/executors/tsc/lib/get-tsconfig.d.ts.map +0 -1
- package/src/executors/tsc/lib/index.d.ts.map +0 -1
- package/src/executors/tsc/lib/normalize-options.d.ts.map +0 -1
- package/src/executors/tsc/lib/typescript-compilation.d.ts.map +0 -1
- package/src/executors/tsc/lib/typescript-diagnostic-reporters.d.ts.map +0 -1
- package/src/executors/tsc/tsc.batch-impl.d.ts.map +0 -1
- package/src/executors/tsc/tsc.impl.d.ts.map +0 -1
- package/src/executors/verdaccio/verdaccio.impl.d.ts.map +0 -1
- package/src/generators/convert-to-swc/convert-to-swc.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/generators/library/library.d.ts.map +0 -1
- package/src/generators/library/utils/add-release-config.d.ts.map +0 -1
- package/src/generators/release-version/release-version.d.ts +0 -1
- package/src/generators/release-version/release-version.d.ts.map +0 -1
- package/src/generators/release-version/release-version.js +0 -0
- package/src/generators/setup-build/generator.d.ts.map +0 -1
- package/src/generators/setup-prettier/generator.d.ts.map +0 -1
- package/src/generators/setup-verdaccio/generator.d.ts.map +0 -1
- package/src/generators/typescript-sync/typescript-sync.d.ts.map +0 -1
- package/src/index.d.ts.map +0 -1
- package/src/internal.d.ts +0 -6
- package/src/internal.d.ts.map +0 -1
- package/src/internal.js +0 -18
- package/src/migrations/update-21-5-0/migrate-development-custom-condition.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/remove-external-options-from-js-executors.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/remove-external-options-from-js-executors.js +0 -65
- package/src/migrations/update-22-1-0/remove-redundant-ts-project-references.d.ts.map +0 -1
- package/src/plugins/jest/start-local-registry.d.ts.map +0 -1
- package/src/plugins/rollup/type-definitions.d.ts +0 -8
- package/src/plugins/rollup/type-definitions.d.ts.map +0 -1
- package/src/plugins/rollup/type-definitions.js +0 -49
- package/src/plugins/typescript/plugin.d.ts.map +0 -1
- package/src/plugins/typescript/util.d.ts.map +0 -1
- package/src/release/utils/semver.d.ts.map +0 -1
- package/src/release/utils/update-lock-file.d.ts.map +0 -1
- package/src/release/version-actions.d.ts.map +0 -1
- package/src/utils/add-babel-inputs.d.ts.map +0 -1
- package/src/utils/add-local-registry-scripts.d.ts.map +0 -1
- package/src/utils/assets/assets.d.ts.map +0 -1
- package/src/utils/assets/copy-assets-handler.d.ts.map +0 -1
- package/src/utils/assets/index.d.ts.map +0 -1
- package/src/utils/assets/normalize-assets.d.ts.map +0 -1
- package/src/utils/buildable-libs-utils.d.ts.map +0 -1
- package/src/utils/check-dependencies.d.ts.map +0 -1
- package/src/utils/code-frames/highlight.d.ts.map +0 -1
- package/src/utils/code-frames/identifiers.d.ts.map +0 -1
- package/src/utils/compiler-helper-dependency.d.ts.map +0 -1
- package/src/utils/find-npm-dependencies.d.ts.map +0 -1
- package/src/utils/generate-globs.d.ts.map +0 -1
- package/src/utils/generator-prompts.d.ts.map +0 -1
- package/src/utils/get-import-path.d.ts.map +0 -1
- package/src/utils/get-main-file-dir.d.ts.map +0 -1
- package/src/utils/is-locally-linked-package-version.d.ts.map +0 -1
- package/src/utils/is-valid-variable.d.ts.map +0 -1
- package/src/utils/npm-config.d.ts.map +0 -1
- package/src/utils/package-json/create-entry-points.d.ts.map +0 -1
- package/src/utils/package-json/get-npm-scope.d.ts.map +0 -1
- package/src/utils/package-json/index.d.ts.map +0 -1
- package/src/utils/package-json/sort-fields.d.ts.map +0 -1
- package/src/utils/package-json/update-package-json.d.ts.map +0 -1
- package/src/utils/package-manager-workspaces.d.ts.map +0 -1
- package/src/utils/prettier.d.ts.map +0 -1
- package/src/utils/strip-glob-to-base-dir.d.ts.map +0 -1
- package/src/utils/swc/add-swc-config.d.ts.map +0 -1
- package/src/utils/swc/add-swc-dependencies.d.ts.map +0 -1
- package/src/utils/swc/compile-swc.d.ts.map +0 -1
- package/src/utils/swc/get-swcrc-path.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/function-after-declarations-plugin.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/function-after-plugin.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/function-direct-export.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/function-multiple-hooks.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/plugin-a.d.ts.map +0 -1
- package/src/utils/typescript/__mocks__/plugin-b.d.ts.map +0 -1
- package/src/utils/typescript/add-tslib-dependencies.d.ts.map +0 -1
- package/src/utils/typescript/ast-utils.d.ts.map +0 -1
- package/src/utils/typescript/compile-typescript-files.d.ts.map +0 -1
- package/src/utils/typescript/configuration.d.ts.map +0 -1
- package/src/utils/typescript/create-ts-config.d.ts.map +0 -1
- package/src/utils/typescript/ensure-typescript.d.ts.map +0 -1
- package/src/utils/typescript/get-source-nodes.d.ts.map +0 -1
- package/src/utils/typescript/load-ts-transformers.d.ts.map +0 -1
- package/src/utils/typescript/plugin.d.ts.map +0 -1
- package/src/utils/typescript/print-diagnostics.d.ts.map +0 -1
- package/src/utils/typescript/raw-tsconfig.d.ts.map +0 -1
- package/src/utils/typescript/run-type-check.d.ts.map +0 -1
- package/src/utils/typescript/ts-config.d.ts.map +0 -1
- package/src/utils/typescript/ts-solution-setup.d.ts.map +0 -1
- package/src/utils/typescript/types.d.ts.map +0 -1
- package/src/utils/versions.d.ts.map +0 -1
- package/src/utils/watch-for-single-file-changes.d.ts.map +0 -1
- package/typescript.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{babel.js → dist/babel.js} +0 -0
- /package/{plugins → dist/plugins}/jest/local-registry.js +0 -0
- /package/{src → dist/src}/executors/copy-workspace-modules/copy-workspace-modules.js +0 -0
- /package/{src → dist/src}/executors/copy-workspace-modules/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/copy-workspace-modules/schema.json +0 -0
- /package/{src → dist/src}/executors/node/lib/coalescing-debounce.js +0 -0
- /package/{src → dist/src}/executors/node/lib/esm-loader.js +0 -0
- /package/{src → dist/src}/executors/node/lib/kill-tree.js +0 -0
- /package/{src → dist/src}/executors/node/lib/line-aware-writer.js +0 -0
- /package/{src → dist/src}/executors/node/lib/output-file.js +0 -0
- /package/{src → dist/src}/executors/node/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/node/schema.json +0 -0
- /package/{src → dist/src}/executors/prune-lockfile/prune-lockfile.js +0 -0
- /package/{src → dist/src}/executors/prune-lockfile/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/prune-lockfile/schema.json +0 -0
- /package/{src → dist/src}/executors/release-publish/extract-npm-publish-json-data.js +0 -0
- /package/{src → dist/src}/executors/release-publish/format-bytes.js +0 -0
- /package/{src → dist/src}/executors/release-publish/log-tar.js +0 -0
- /package/{src → dist/src}/executors/release-publish/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/release-publish/schema.json +0 -0
- /package/{src → dist/src}/executors/swc/schema.json +0 -0
- /package/{src → dist/src}/executors/swc/swc.impl.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/batch/build-task-info-per-tsconfig-map.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/batch/index.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/batch/normalize-tasks-options.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/batch/types.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/get-custom-transformers-factory.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/get-task-options.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/get-tsconfig.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/index.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/executors/tsc/lib/typescript-diagnostic-reporters.js +0 -0
- /package/{src → dist/src}/executors/tsc/schema.json +0 -0
- /package/{src → dist/src}/executors/tsc/tsc.batch-impl.js +0 -0
- /package/{src → dist/src}/executors/tsc/tsc.impl.js +0 -0
- /package/{src → dist/src}/executors/verdaccio/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/verdaccio/schema.json +0 -0
- /package/{src → dist/src}/executors/verdaccio/verdaccio.impl.js +0 -0
- /package/{src → dist/src}/generators/convert-to-swc/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/convert-to-swc/schema.json +0 -0
- /package/{src → dist/src}/generators/init/files/non-ts-solution/__fileName__ +0 -0
- /package/{src → dist/src}/generators/init/files/ts-solution/tsconfig.base.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/init/files/ts-solution/tsconfig.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/library/files/jest-config/jest.config.__ext__ +0 -0
- /package/{src → dist/src}/generators/library/files/lib/src/index.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/library/files/lib/src/lib/__fileName__.spec.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/library/files/lib/src/lib/__fileName__.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/library/files/readme/README.md +0 -0
- /package/{src → dist/src}/generators/library/files/tsconfig-lib/non-ts-solution/tsconfig.lib.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/library/files/tsconfig-lib/ts-solution/tsconfig.lib.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/library/schema.json +0 -0
- /package/{src → dist/src}/generators/library/utils/add-release-config.js +0 -0
- /package/{src/utils/typescript/types.js → dist/src/generators/release-version/release-version.js} +0 -0
- /package/{src → dist/src}/generators/setup-build/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/setup-build/schema.json +0 -0
- /package/{src → dist/src}/generators/setup-prettier/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/setup-prettier/schema.json +0 -0
- /package/{src → dist/src}/generators/setup-verdaccio/files/config.yml +0 -0
- /package/{src → dist/src}/generators/setup-verdaccio/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/setup-verdaccio/schema.json +0 -0
- /package/{src → dist/src}/generators/typescript-sync/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/typescript-sync/schema.json +0 -0
- /package/{src → dist/src}/index.js +0 -0
- /package/{src → dist/src}/migrations/update-21-5-0/migrate-development-custom-condition.js +0 -0
- /package/{src → dist/src}/migrations/update-22-1-0/remove-redundant-ts-project-references.js +0 -0
- /package/{src → dist/src}/plugins/jest/start-local-registry.js +0 -0
- /package/{src → dist/src}/release/utils/semver.js +0 -0
- /package/{src → dist/src}/release/utils/update-lock-file.js +0 -0
- /package/{src → dist/src}/utils/add-babel-inputs.js +0 -0
- /package/{src → dist/src}/utils/add-local-registry-scripts.js +0 -0
- /package/{src → dist/src}/utils/assets/assets.js +0 -0
- /package/{src → dist/src}/utils/assets/copy-assets-handler.js +0 -0
- /package/{src → dist/src}/utils/assets/index.js +0 -0
- /package/{src → dist/src}/utils/assets/normalize-assets.js +0 -0
- /package/{src → dist/src}/utils/buildable-libs-utils.js +0 -0
- /package/{src → dist/src}/utils/check-dependencies.js +0 -0
- /package/{src → dist/src}/utils/code-frames/highlight.js +0 -0
- /package/{src → dist/src}/utils/code-frames/identifiers.js +0 -0
- /package/{src → dist/src}/utils/compiler-helper-dependency.js +0 -0
- /package/{src → dist/src}/utils/find-npm-dependencies.js +0 -0
- /package/{src → dist/src}/utils/generate-globs.js +0 -0
- /package/{src → dist/src}/utils/get-import-path.js +0 -0
- /package/{src → dist/src}/utils/get-main-file-dir.js +0 -0
- /package/{src → dist/src}/utils/is-locally-linked-package-version.js +0 -0
- /package/{src → dist/src}/utils/is-valid-variable.js +0 -0
- /package/{src → dist/src}/utils/npm-config.js +0 -0
- /package/{src → dist/src}/utils/package-json/create-entry-points.js +0 -0
- /package/{src → dist/src}/utils/package-json/get-npm-scope.js +0 -0
- /package/{src → dist/src}/utils/package-json/index.js +0 -0
- /package/{src → dist/src}/utils/package-json/sort-fields.js +0 -0
- /package/{src → dist/src}/utils/package-json/update-package-json.js +0 -0
- /package/{src → dist/src}/utils/package-manager-workspaces.js +0 -0
- /package/{src → dist/src}/utils/schema.d.ts +0 -0
- /package/{src → dist/src}/utils/strip-glob-to-base-dir.js +0 -0
- /package/{src → dist/src}/utils/swc/add-swc-config.js +0 -0
- /package/{src → dist/src}/utils/swc/get-swcrc-path.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/function-after-declarations-plugin.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/function-after-plugin.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/function-direct-export.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/function-multiple-hooks.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/plugin-a.js +0 -0
- /package/{src → dist/src}/utils/typescript/__mocks__/plugin-b.js +0 -0
- /package/{src → dist/src}/utils/typescript/add-tslib-dependencies.js +0 -0
- /package/{src → dist/src}/utils/typescript/ast-utils.js +0 -0
- /package/{src → dist/src}/utils/typescript/configuration.js +0 -0
- /package/{src → dist/src}/utils/typescript/create-ts-config.js +0 -0
- /package/{src → dist/src}/utils/typescript/ensure-typescript.js +0 -0
- /package/{src → dist/src}/utils/typescript/get-source-nodes.js +0 -0
- /package/{src → dist/src}/utils/typescript/load-ts-transformers.js +0 -0
- /package/{src → dist/src}/utils/typescript/plugin.js +0 -0
- /package/{src → dist/src}/utils/typescript/print-diagnostics.js +0 -0
- /package/{src → dist/src}/utils/typescript/raw-tsconfig.js +0 -0
- /package/{src → dist/src}/utils/typescript/ts-config.js +0 -0
- /package/{src → dist/src}/utils/typescript/ts-solution-setup.js +0 -0
- /package/{src → dist/src}/utils/watch-for-single-file-changes.js +0 -0
- /package/{typescript.js → dist/typescript.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#### Remove the `external` and `externalBuildTargets` Options from the `@nx/js:swc` and `@nx/js:tsc` Executors
|
|
2
|
+
|
|
3
|
+
Remove the deprecated `external` and `externalBuildTargets` options from the `@nx/js:swc` and `@nx/js:tsc` executors. These options were used for inlining dependencies, which was an experimental feature and has been deprecated for a long time. The migration only removes the options from the project configuration and target defaults. If you rely on inlining dependencies, you need to make sure they are all buildable or use a different build tool that supports bundling.
|
|
4
|
+
|
|
5
|
+
#### Sample Code Changes
|
|
6
|
+
|
|
7
|
+
Remove `external` and `externalBuildTargets` from the `@nx/js:swc` or `@nx/js:tsc` executor options in project configuration.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="libs/my-lib/project.json" {9-10}
|
|
12
|
+
{
|
|
13
|
+
"targets": {
|
|
14
|
+
"build": {
|
|
15
|
+
"executor": "@nx/js:swc",
|
|
16
|
+
"options": {
|
|
17
|
+
"main": "libs/my-lib/src/index.ts",
|
|
18
|
+
"outputPath": "dist/libs/my-lib",
|
|
19
|
+
"tsConfig": "libs/my-lib/tsconfig.lib.json",
|
|
20
|
+
"external": ["react", "react-dom"],
|
|
21
|
+
"externalBuildTargets": ["build"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
##### After
|
|
29
|
+
|
|
30
|
+
```json title="libs/my-lib/project.json"
|
|
31
|
+
{
|
|
32
|
+
"targets": {
|
|
33
|
+
"build": {
|
|
34
|
+
"executor": "@nx/js:swc",
|
|
35
|
+
"options": {
|
|
36
|
+
"main": "libs/my-lib/src/index.ts",
|
|
37
|
+
"outputPath": "dist/libs/my-lib",
|
|
38
|
+
"tsConfig": "libs/my-lib/tsconfig.lib.json"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Remove `external` and `externalBuildTargets` from the `@nx/js:swc` or `@nx/js:tsc` executor target defaults in `nx.json`.
|
|
46
|
+
|
|
47
|
+
##### Before
|
|
48
|
+
|
|
49
|
+
```json title="nx.json" {8-9}
|
|
50
|
+
{
|
|
51
|
+
"targetDefaults": {
|
|
52
|
+
"@nx/js:swc": {
|
|
53
|
+
"options": {
|
|
54
|
+
"main": "{projectRoot}/src/index.ts",
|
|
55
|
+
"outputPath": "dist/{projectRoot}",
|
|
56
|
+
"tsConfig": "{projectRoot}/tsconfig.lib.json",
|
|
57
|
+
"external": "all",
|
|
58
|
+
"externalBuildTargets": ["build"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
##### After
|
|
66
|
+
|
|
67
|
+
```json title="nx.json"
|
|
68
|
+
{
|
|
69
|
+
"targetDefaults": {
|
|
70
|
+
"@nx/js:swc": {
|
|
71
|
+
"options": {
|
|
72
|
+
"main": "{projectRoot}/src/index.ts",
|
|
73
|
+
"outputPath": "dist/{projectRoot}",
|
|
74
|
+
"tsConfig": "{projectRoot}/tsconfig.lib.json"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#### Removes Redundant TypeScript Project References from tsconfig.json Files
|
|
2
|
+
|
|
3
|
+
Removes redundant TypeScript project references from `tsconfig.json` files when runtime tsconfig files (e.g., `tsconfig.lib.json`, `tsconfig.app.json`) exist. Previously, external project references were duplicated in both the project's `tsconfig.json` and runtime tsconfig files. This migration syncs the TypeScript project references to match the project graph, ensuring that external references only appear in runtime tsconfig files when they exist.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
When a project has runtime tsconfig files like `tsconfig.lib.json`, the migration will remove external project references from the project's `tsconfig.json` file:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```jsonc {7-9}
|
|
12
|
+
// libs/my-lib/tsconfig.json
|
|
13
|
+
{
|
|
14
|
+
"compilerOptions": {
|
|
15
|
+
"composite": true,
|
|
16
|
+
},
|
|
17
|
+
"references": [
|
|
18
|
+
{
|
|
19
|
+
"path": "../other-lib",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
##### After
|
|
26
|
+
|
|
27
|
+
```jsonc {6}
|
|
28
|
+
// libs/my-lib/tsconfig.json
|
|
29
|
+
{
|
|
30
|
+
"compilerOptions": {
|
|
31
|
+
"composite": true,
|
|
32
|
+
},
|
|
33
|
+
"references": [],
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The external references remain in the runtime tsconfig file where they belong:
|
|
38
|
+
|
|
39
|
+
##### Before
|
|
40
|
+
|
|
41
|
+
```jsonc {7-9}
|
|
42
|
+
// libs/my-lib/tsconfig.lib.json
|
|
43
|
+
{
|
|
44
|
+
"compilerOptions": {
|
|
45
|
+
"composite": true,
|
|
46
|
+
},
|
|
47
|
+
"references": [
|
|
48
|
+
{
|
|
49
|
+
"path": "../other-lib/tsconfig.lib.json",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
##### After
|
|
56
|
+
|
|
57
|
+
```jsonc {7-9}
|
|
58
|
+
// libs/my-lib/tsconfig.lib.json
|
|
59
|
+
{
|
|
60
|
+
"compilerOptions": {
|
|
61
|
+
"composite": true,
|
|
62
|
+
},
|
|
63
|
+
"references": [
|
|
64
|
+
{
|
|
65
|
+
"path": "../other-lib/tsconfig.lib.json",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For projects without runtime tsconfig files, the project's `tsconfig.json` file will continue to contain external project references:
|
|
72
|
+
|
|
73
|
+
##### Before
|
|
74
|
+
|
|
75
|
+
```jsonc {7-9}
|
|
76
|
+
// libs/legacy-lib/tsconfig.json
|
|
77
|
+
{
|
|
78
|
+
"compilerOptions": {
|
|
79
|
+
"composite": true,
|
|
80
|
+
},
|
|
81
|
+
"references": [
|
|
82
|
+
{
|
|
83
|
+
"path": "../other-lib",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
##### After
|
|
90
|
+
|
|
91
|
+
```jsonc {7-9}
|
|
92
|
+
// libs/legacy-lib/tsconfig.json
|
|
93
|
+
{
|
|
94
|
+
"compilerOptions": {
|
|
95
|
+
"composite": true,
|
|
96
|
+
},
|
|
97
|
+
"references": [
|
|
98
|
+
{
|
|
99
|
+
"path": "../other-lib",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Internal project references (references within the same project directory) are preserved in the project's `tsconfig.json`:
|
|
106
|
+
|
|
107
|
+
##### Before
|
|
108
|
+
|
|
109
|
+
```jsonc {7-12}
|
|
110
|
+
// libs/my-lib/tsconfig.json
|
|
111
|
+
{
|
|
112
|
+
"compilerOptions": {
|
|
113
|
+
"composite": true,
|
|
114
|
+
},
|
|
115
|
+
"references": [
|
|
116
|
+
{
|
|
117
|
+
"path": "./tsconfig.lib.json",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": "./tsconfig.spec.json",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
##### After
|
|
127
|
+
|
|
128
|
+
```jsonc {7-12}
|
|
129
|
+
// libs/my-lib/tsconfig.json
|
|
130
|
+
{
|
|
131
|
+
"compilerOptions": {
|
|
132
|
+
"composite": true,
|
|
133
|
+
},
|
|
134
|
+
"references": [
|
|
135
|
+
{
|
|
136
|
+
"path": "./tsconfig.lib.json",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"path": "./tsconfig.spec.json",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
}
|
|
143
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = rewriteInternalSubpathImports;
|
|
4
|
+
exports.rewriteSubpathImports = rewriteSubpathImports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const FROM_PREFIX = '@nx/js/src/';
|
|
8
|
+
const TO_SPECIFIER = '@nx/js/internal';
|
|
9
|
+
// Subpaths kept as explicit (non-wildcard) exports entries on `@nx/js`, so
|
|
10
|
+
// imports of them keep resolving. Don't rewrite these:
|
|
11
|
+
// - `release/version-actions`: referenced by a runtime string default baked
|
|
12
|
+
// into existing user `nx.json` release configs.
|
|
13
|
+
// - `utils/assets/copy-assets-handler`: consumed by project-graph plugins
|
|
14
|
+
// (e.g. nx's own `tools/workspace-plugin`) that load before any build and
|
|
15
|
+
// therefore can't resolve the source-only `@nx/js/internal` entry.
|
|
16
|
+
const PRESERVED_SUBPATHS = new Set([
|
|
17
|
+
'@nx/js/src/release/version-actions',
|
|
18
|
+
'@nx/js/src/utils/assets/copy-assets-handler',
|
|
19
|
+
]);
|
|
20
|
+
// Methods on `jest` and `vi` that take a module specifier as their first arg.
|
|
21
|
+
const MOCK_HELPER_METHODS = new Set([
|
|
22
|
+
'mock',
|
|
23
|
+
'unmock',
|
|
24
|
+
'doMock',
|
|
25
|
+
'dontMock',
|
|
26
|
+
'requireActual',
|
|
27
|
+
'requireMock',
|
|
28
|
+
'importActual',
|
|
29
|
+
'importMock',
|
|
30
|
+
]);
|
|
31
|
+
let ts;
|
|
32
|
+
async function rewriteInternalSubpathImports(tree) {
|
|
33
|
+
let touchedCount = 0;
|
|
34
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
35
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const original = tree.read(filePath, 'utf-8');
|
|
39
|
+
if (!original || !original.includes(FROM_PREFIX)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const updated = rewriteSubpathImports(original);
|
|
43
|
+
if (updated !== original) {
|
|
44
|
+
tree.write(filePath, updated);
|
|
45
|
+
touchedCount += 1;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
if (touchedCount > 0) {
|
|
49
|
+
devkit_1.logger.info(`Rewrote @nx/js/src/* imports to @nx/js/internal in ${touchedCount} file(s).`);
|
|
50
|
+
}
|
|
51
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
52
|
+
}
|
|
53
|
+
function rewriteSubpathImports(source) {
|
|
54
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
55
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
56
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
57
|
+
const changes = [];
|
|
58
|
+
collectImportRewrites(sourceFile, changes);
|
|
59
|
+
collectCallExpressionRewrites(sourceFile, changes);
|
|
60
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
61
|
+
}
|
|
62
|
+
function shouldRewriteSpecifier(specifier) {
|
|
63
|
+
if (!specifier.startsWith(FROM_PREFIX))
|
|
64
|
+
return false;
|
|
65
|
+
if (PRESERVED_SUBPATHS.has(specifier))
|
|
66
|
+
return false;
|
|
67
|
+
// Strip a trailing `.js` so e.g. `@nx/js/src/utils/foo.js` matches `@nx/js/src/utils/foo`
|
|
68
|
+
// for the preserved-subpath check.
|
|
69
|
+
const withoutJs = specifier.endsWith('.js')
|
|
70
|
+
? specifier.slice(0, -3)
|
|
71
|
+
: specifier;
|
|
72
|
+
return !PRESERVED_SUBPATHS.has(withoutJs);
|
|
73
|
+
}
|
|
74
|
+
function collectImportRewrites(sourceFile, changes) {
|
|
75
|
+
for (const stmt of sourceFile.statements) {
|
|
76
|
+
if (!ts.isImportDeclaration(stmt))
|
|
77
|
+
continue;
|
|
78
|
+
if (!ts.isStringLiteral(stmt.moduleSpecifier))
|
|
79
|
+
continue;
|
|
80
|
+
if (!shouldRewriteSpecifier(stmt.moduleSpecifier.text))
|
|
81
|
+
continue;
|
|
82
|
+
replaceSpecifier(sourceFile, stmt.moduleSpecifier, changes);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function collectCallExpressionRewrites(sourceFile, changes) {
|
|
86
|
+
const visit = (node) => {
|
|
87
|
+
if (ts.isCallExpression(node) &&
|
|
88
|
+
shouldRewriteCallExpression(node) &&
|
|
89
|
+
node.arguments.length >= 1 &&
|
|
90
|
+
ts.isStringLiteral(node.arguments[0]) &&
|
|
91
|
+
shouldRewriteSpecifier(node.arguments[0].text)) {
|
|
92
|
+
replaceSpecifier(sourceFile, node.arguments[0], changes);
|
|
93
|
+
}
|
|
94
|
+
else if (ts.isImportTypeNode(node)) {
|
|
95
|
+
// `typeof import('...')` parses as an `ImportTypeNode`, not a
|
|
96
|
+
// CallExpression — its argument is `LiteralTypeNode<StringLiteral>`.
|
|
97
|
+
// The whole module is referenced, so it can't be symbol-split.
|
|
98
|
+
const literal = getImportTypeStringLiteral(node);
|
|
99
|
+
if (literal && shouldRewriteSpecifier(literal.text)) {
|
|
100
|
+
replaceSpecifier(sourceFile, literal, changes);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
ts.forEachChild(node, visit);
|
|
104
|
+
};
|
|
105
|
+
visit(sourceFile);
|
|
106
|
+
}
|
|
107
|
+
function getImportTypeStringLiteral(node) {
|
|
108
|
+
const arg = node.argument;
|
|
109
|
+
if (arg && ts.isLiteralTypeNode(arg) && ts.isStringLiteral(arg.literal)) {
|
|
110
|
+
return arg.literal;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
function shouldRewriteCallExpression(call) {
|
|
115
|
+
const callee = call.expression;
|
|
116
|
+
// `require('...')`
|
|
117
|
+
if (ts.isIdentifier(callee) && callee.text === 'require')
|
|
118
|
+
return true;
|
|
119
|
+
// dynamic `import('...')` (runtime form parses as a CallExpression whose
|
|
120
|
+
// callee is the `import` keyword). The `typeof import('...')` type-position
|
|
121
|
+
// form is an `ImportTypeNode` (handled in `collectCallExpressionRewrites`).
|
|
122
|
+
if (callee.kind === ts.SyntaxKind.ImportKeyword)
|
|
123
|
+
return true;
|
|
124
|
+
// `jest.mock(...)` / `vi.mock(...)` and friends.
|
|
125
|
+
if (ts.isPropertyAccessExpression(callee)) {
|
|
126
|
+
const obj = callee.expression;
|
|
127
|
+
if (ts.isIdentifier(obj) &&
|
|
128
|
+
(obj.text === 'jest' || obj.text === 'vi') &&
|
|
129
|
+
MOCK_HELPER_METHODS.has(callee.name.text)) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
function replaceSpecifier(sourceFile, literal, changes) {
|
|
136
|
+
const start = literal.getStart(sourceFile);
|
|
137
|
+
const end = literal.getEnd();
|
|
138
|
+
const quote = sourceFile.text.charAt(start);
|
|
139
|
+
changes.push({ type: devkit_1.ChangeType.Delete, start, length: end - start }, {
|
|
140
|
+
type: devkit_1.ChangeType.Insert,
|
|
141
|
+
index: start,
|
|
142
|
+
text: `${quote}${TO_SPECIFIER}${quote}`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
@@ -21,4 +21,3 @@ export declare const createDependencies: CreateDependencies;
|
|
|
21
21
|
export declare const PLUGIN_NAME = "@nx/js/typescript";
|
|
22
22
|
export declare const createNodesV2: CreateNodesV2<TscPluginOptions>;
|
|
23
23
|
export declare const createNodes: CreateNodesV2<TscPluginOptions>;
|
|
24
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodes = exports.createNodesV2 = exports.PLUGIN_NAME = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
@@ -10,8 +10,20 @@ const picomatch = require("picomatch");
|
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
11
11
|
const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
12
12
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
|
+
const installation_directory_1 = require("nx/src/utils/installation-directory");
|
|
13
14
|
const util_1 = require("./util");
|
|
14
15
|
let ts;
|
|
16
|
+
const resolvedTypescriptPaths = {};
|
|
17
|
+
function resolveTypescriptPath(projectRoot, workspaceRoot) {
|
|
18
|
+
// Resolve from projectRoot first, then workspace paths, with __dirname as a
|
|
19
|
+
// last resort. Required so the lookup works under layouts where @nx/js's real
|
|
20
|
+
// path is outside the workspace tree (e.g. pnpm's enableGlobalVirtualStore),
|
|
21
|
+
// since typescript is not a declared dep.
|
|
22
|
+
resolvedTypescriptPaths[projectRoot] ??= require.resolve('typescript', {
|
|
23
|
+
paths: [projectRoot, ...(0, installation_directory_1.getNxRequirePaths)(workspaceRoot), __dirname],
|
|
24
|
+
});
|
|
25
|
+
return resolvedTypescriptPaths[projectRoot];
|
|
26
|
+
}
|
|
15
27
|
const TSCONFIG_CACHE_VERSION = 2;
|
|
16
28
|
const TS_CONFIG_CACHE_PATH = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, 'tsconfig-files.hash');
|
|
17
29
|
// Module-level cache store — each invocation gets a unique Symbol key
|
|
@@ -122,8 +134,10 @@ exports.createNodesV2 = [
|
|
|
122
134
|
const cache = cacheStore.get(cacheKey);
|
|
123
135
|
initializeTsConfigCache(configFilePaths, context.workspaceRoot, cache);
|
|
124
136
|
const normalizedOptions = normalizePluginOptions(options);
|
|
125
|
-
const
|
|
126
|
-
const
|
|
137
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
138
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
139
|
+
const lockFileName = (0, lock_file_1.getLockFileName)(packageManager);
|
|
140
|
+
const { configFilePaths: validConfigFilePaths, hashes, projectRoots, } = await resolveValidConfigFilesAndHashes(configFilePaths, normalizedOptions, optionsHash, context, cache, lockFileName);
|
|
127
141
|
try {
|
|
128
142
|
return await (0, devkit_1.createNodesFromFiles)((configFilePath, options, context, idx) => {
|
|
129
143
|
const projectRoot = projectRoots[idx];
|
|
@@ -156,8 +170,8 @@ exports.createNodesV2 = [
|
|
|
156
170
|
},
|
|
157
171
|
];
|
|
158
172
|
exports.createNodes = exports.createNodesV2;
|
|
159
|
-
async function resolveValidConfigFilesAndHashes(configFilePaths, options, optionsHash, context, cache) {
|
|
160
|
-
const lockFileHash = (0, file_hasher_1.hashFile)((0, node_path_1.join)(context.workspaceRoot,
|
|
173
|
+
async function resolveValidConfigFilesAndHashes(configFilePaths, options, optionsHash, context, cache, lockFileName) {
|
|
174
|
+
const lockFileHash = (0, file_hasher_1.hashFile)((0, node_path_1.join)(context.workspaceRoot, lockFileName)) ?? '';
|
|
161
175
|
const validConfigFilePaths = [];
|
|
162
176
|
const hashes = [];
|
|
163
177
|
const projectRoots = [];
|
|
@@ -246,7 +260,7 @@ function checkIfConfigFileShouldBeProject(config, cache) {
|
|
|
246
260
|
}
|
|
247
261
|
function buildTscTargets(config, options, context, configFiles, cache, pmc) {
|
|
248
262
|
const targets = {};
|
|
249
|
-
const namedInputs = (0,
|
|
263
|
+
const namedInputs = (0, internal_1.getNamedInputs)(config.project.root, context);
|
|
250
264
|
const tsConfig = retrieveTsConfigFromCache(config.absolutePath, context.workspaceRoot, cache);
|
|
251
265
|
let internalProjectReferences;
|
|
252
266
|
if (options.typecheck &&
|
|
@@ -354,7 +368,7 @@ function getInputs(namedInputs, config, tsConfig, internalProjectReferences, wor
|
|
|
354
368
|
];
|
|
355
369
|
const absoluteProjectRoot = config.project.absolute;
|
|
356
370
|
if (!ts) {
|
|
357
|
-
ts = require(
|
|
371
|
+
ts = require(resolveTypescriptPath(absoluteProjectRoot, workspaceRoot));
|
|
358
372
|
}
|
|
359
373
|
// https://github.com/microsoft/TypeScript/blob/19b777260b26aac5707b1efd34202054164d4a9d/src/compiler/utilities.ts#L9869
|
|
360
374
|
const supportedTSExtensions = [
|
|
@@ -819,7 +833,7 @@ function getExtendedFilesHash(extendedConfigFiles, workspaceRoot, cache) {
|
|
|
819
833
|
}
|
|
820
834
|
function readTsConfig(tsConfigPath, workspaceRoot, cache) {
|
|
821
835
|
if (!ts) {
|
|
822
|
-
ts = require(
|
|
836
|
+
ts = require(resolveTypescriptPath(workspaceRoot, workspaceRoot));
|
|
823
837
|
}
|
|
824
838
|
// Normalize to forward slashes for TypeScript compatibility on Windows.
|
|
825
839
|
// TypeScript's parser normalizes paths inconsistently — diagnostics use
|
|
@@ -16,4 +16,3 @@ export declare function addBuildAndWatchDepsTargets(workspaceRoot: string, proje
|
|
|
16
16
|
watchDepsTargetName?: string;
|
|
17
17
|
}, pmc: PackageManagerCommands): void;
|
|
18
18
|
export declare function isValidPackageJsonBuildConfig(tsConfig: ParsedTsconfigData, workspaceRoot: string, projectRoot: string): boolean;
|
|
19
|
-
//# sourceMappingURL=util.d.ts.map
|
|
@@ -32,7 +32,7 @@ function addBuildAndWatchDepsTargets(workspaceRoot, projectRoot, targets, option
|
|
|
32
32
|
targets[options.watchDepsTargetName ?? 'watch-deps'] = {
|
|
33
33
|
continuous: true,
|
|
34
34
|
dependsOn: [buildDepsTargetName],
|
|
35
|
-
command: `${pmc.exec} nx watch --projects ${projectName} --
|
|
35
|
+
command: `${pmc.exec} nx watch --projects ${projectName} --includeDependencies -- ${pmc.exec} nx ${buildDepsTargetName} ${projectName}`,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -20,4 +20,3 @@ export default class JsVersionActions extends VersionActions {
|
|
|
20
20
|
updateProjectDependencies(tree: Tree, projectGraph: ProjectGraph, dependenciesToUpdate: Record<string, string>): Promise<string[]>;
|
|
21
21
|
private isLocalDependencyProtocol;
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=version-actions.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.afterAllProjectsVersioned = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const catalog_1 = require("@nx/devkit/src/utils/catalog");
|
|
6
6
|
const node_child_process_1 = require("node:child_process");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const release_1 = require("nx/release");
|
|
@@ -109,7 +109,7 @@ class JsVersionActions extends release_1.VersionActions {
|
|
|
109
109
|
}
|
|
110
110
|
// Resolve catalog references if needed
|
|
111
111
|
if (currentVersion) {
|
|
112
|
-
const catalogManager = (0,
|
|
112
|
+
const catalogManager = (0, internal_1.getCatalogManager)(tree.root);
|
|
113
113
|
if (catalogManager?.isCatalogReference(currentVersion)) {
|
|
114
114
|
currentVersion = catalogManager.resolveCatalogReference(tree, dependencyPackageName, currentVersion);
|
|
115
115
|
}
|
|
@@ -137,7 +137,7 @@ class JsVersionActions extends release_1.VersionActions {
|
|
|
137
137
|
}
|
|
138
138
|
const logMessages = [];
|
|
139
139
|
const catalogUpdates = [];
|
|
140
|
-
const catalogManager = (0,
|
|
140
|
+
const catalogManager = (0, internal_1.getCatalogManager)(tree.root);
|
|
141
141
|
for (const manifestToUpdate of this.manifestsToUpdate) {
|
|
142
142
|
(0, devkit_1.updateJson)(tree, manifestToUpdate.manifestPath, (json) => {
|
|
143
143
|
const dependencyTypes = [
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedTypescriptVersion = assertSupportedTypescriptVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function assertSupportedTypescriptVersion(tree) {
|
|
7
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, 'typescript', versions_1.minSupportedTypescriptVersion);
|
|
8
|
+
}
|
|
@@ -23,4 +23,3 @@ export declare function normalizeAssets(assets: (string | AssetGlobInput)[], roo
|
|
|
23
23
|
* matching the dest logic used during file copying.
|
|
24
24
|
*/
|
|
25
25
|
export declare function getAssetOutputPath(src: string, assetEntry: NormalizedAssetEntry): string;
|
|
26
|
-
//# sourceMappingURL=normalize-assets.d.ts.map
|
|
@@ -39,4 +39,3 @@ export declare function updatePaths(dependencies: DependentBuildableProjectNode[
|
|
|
39
39
|
* the proper dependency and version
|
|
40
40
|
*/
|
|
41
41
|
export declare function updateBuildableProjectPackageJsonDependencies(root: string, projectName: string, targetName: string, configurationName: string, node: ProjectGraphProjectNode, dependencies: DependentBuildableProjectNode[], typeOfDependency?: 'dependencies' | 'peerDependencies'): void;
|
|
42
|
-
//# sourceMappingURL=buildable-libs-utils.d.ts.map
|
|
@@ -16,4 +16,3 @@ export declare enum HelperDependency {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function getHelperDependency(helperDependency: HelperDependency, configPath: string, dependencies: DependentBuildableProjectNode[], projectGraph: ProjectGraph, returnDependencyIfFound?: boolean): DependentBuildableProjectNode | null;
|
|
18
18
|
export declare function getHelperDependenciesFromProjectGraph(contextRoot: string, sourceProject: string, projectGraph: ProjectGraph): ProjectGraphDependency[];
|
|
19
|
-
//# sourceMappingURL=compiler-helper-dependency.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
|
2
2
|
export declare function normalizeLinterOption(tree: Tree, linter: undefined | 'none' | 'eslint'): Promise<'none' | 'eslint'>;
|
|
3
3
|
export declare function normalizeUnitTestRunnerOption<T extends 'none' | 'jest' | 'vitest'>(tree: Tree, unitTestRunner: undefined | T, testRunners?: Array<'jest' | 'vitest'>): Promise<T>;
|
|
4
|
-
//# sourceMappingURL=generator-prompts.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeLinterOption = normalizeLinterOption;
|
|
4
4
|
exports.normalizeUnitTestRunnerOption = normalizeUnitTestRunnerOption;
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts_solution_setup_1 = require("./typescript/ts-solution-setup");
|
|
7
7
|
async function normalizeLinterOption(tree, linter) {
|
|
8
8
|
if (linter) {
|
|
@@ -13,7 +13,7 @@ async function normalizeLinterOption(tree, linter) {
|
|
|
13
13
|
? [{ name: 'none' }, { name: 'eslint' }]
|
|
14
14
|
: [{ name: 'eslint' }, { name: 'none' }];
|
|
15
15
|
const defaultValue = isTsSolutionSetup ? 'none' : 'eslint';
|
|
16
|
-
return await (0,
|
|
16
|
+
return await (0, internal_1.promptWhenInteractive)({
|
|
17
17
|
type: 'autocomplete',
|
|
18
18
|
name: 'linter',
|
|
19
19
|
message: `Which linter would you like to use?`,
|
|
@@ -30,7 +30,7 @@ async function normalizeUnitTestRunnerOption(tree, unitTestRunner, testRunners =
|
|
|
30
30
|
? [{ name: 'none' }, ...testRunners.map((runner) => ({ name: runner }))]
|
|
31
31
|
: [...testRunners.map((runner) => ({ name: runner })), { name: 'none' }];
|
|
32
32
|
const defaultValue = (isTsSolutionSetup ? 'none' : testRunners[0]);
|
|
33
|
-
return await (0,
|
|
33
|
+
return await (0, internal_1.promptWhenInteractive)({
|
|
34
34
|
type: 'autocomplete',
|
|
35
35
|
name: 'unitTestRunner',
|
|
36
36
|
message: `Which unit test runner would you like to use?`,
|