@nx/rollup 23.0.0-pr.35413.460eeef → 23.0.0-rc.0

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.
Files changed (148) hide show
  1. package/{index.d.ts → dist/index.d.ts} +0 -1
  2. package/dist/internal.d.ts +1 -0
  3. package/dist/internal.js +7 -0
  4. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  5. package/{src → dist/src}/executors/rollup/lib/normalize.d.ts +0 -1
  6. package/{src → dist/src}/executors/rollup/lib/normalize.js +2 -2
  7. package/{src → dist/src}/executors/rollup/rollup.impl.d.ts +2 -3
  8. package/{src → dist/src}/executors/rollup/rollup.impl.js +9 -8
  9. package/{src → dist/src}/executors/rollup/schema.d.ts +0 -1
  10. package/{src → dist/src}/executors/rollup/schema.json +2 -6
  11. package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
  12. package/{src → dist/src}/generators/configuration/configuration.js +14 -12
  13. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  14. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +11 -6
  15. package/{src → dist/src}/generators/convert-to-inferred/lib/add-plugin-registrations.d.ts +0 -1
  16. package/{src → dist/src}/generators/convert-to-inferred/lib/extract-rollup-config-from-executor-options.d.ts +0 -1
  17. package/{src → dist/src}/generators/convert-to-inferred/lib/normalize-path-options.d.ts +0 -1
  18. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  19. package/{src → dist/src}/generators/init/init.js +10 -8
  20. package/{src → dist/src}/generators/init/schema.json +1 -1
  21. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
  22. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +223 -0
  23. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
  24. package/dist/src/migrations/update-23-0-0/remove-use-legacy-typescript-plugin.d.ts +2 -0
  25. package/dist/src/migrations/update-23-0-0/remove-use-legacy-typescript-plugin.js +125 -0
  26. package/dist/src/migrations/update-23-0-0/remove-use-legacy-typescript-plugin.md +100 -0
  27. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
  28. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +202 -0
  29. package/{src → dist/src}/plugins/analyze.d.ts +0 -1
  30. package/{src → dist/src}/plugins/delete-output.d.ts +0 -1
  31. package/{src → dist/src}/plugins/nx-copy-assets.plugin.d.ts +1 -2
  32. package/{src → dist/src}/plugins/nx-copy-assets.plugin.js +2 -2
  33. package/{src → dist/src}/plugins/package-json/generate-package-json.d.ts +0 -1
  34. package/{src → dist/src}/plugins/package-json/update-package-json.d.ts +0 -1
  35. package/{src → dist/src}/plugins/plugin.d.ts +3 -4
  36. package/{src → dist/src}/plugins/plugin.js +58 -27
  37. package/{src → dist/src}/plugins/postcss/index.d.ts +0 -1
  38. package/{src → dist/src}/plugins/postcss/loaders/index.d.ts +0 -1
  39. package/{src → dist/src}/plugins/postcss/loaders/less-loader.d.ts +0 -1
  40. package/{src → dist/src}/plugins/postcss/loaders/postcss-loader.d.ts +0 -1
  41. package/{src → dist/src}/plugins/postcss/loaders/sass-loader.d.ts +0 -1
  42. package/{src → dist/src}/plugins/postcss/loaders/stylus-loader.d.ts +0 -1
  43. package/{src → dist/src}/plugins/postcss/loaders/types.d.ts +0 -1
  44. package/{src → dist/src}/plugins/postcss/options.d.ts +0 -1
  45. package/{src → dist/src}/plugins/postcss/postcss-plugin.d.ts +0 -1
  46. package/{src → dist/src}/plugins/postcss/utils/index.d.ts +0 -1
  47. package/{src → dist/src}/plugins/postcss/utils/load-module.d.ts +0 -1
  48. package/{src → dist/src}/plugins/postcss/utils/normalize-path.d.ts +0 -1
  49. package/{src → dist/src}/plugins/postcss/utils/safe-identifier.d.ts +0 -1
  50. package/{src → dist/src}/plugins/postcss/utils/style-inject.d.ts +0 -1
  51. package/{src → dist/src}/plugins/swc.d.ts +0 -1
  52. package/{src → dist/src}/plugins/with-nx/get-project-node.d.ts +0 -1
  53. package/{src → dist/src}/plugins/with-nx/normalize-options.d.ts +0 -1
  54. package/{src → dist/src}/plugins/with-nx/normalize-options.js +3 -8
  55. package/dist/src/plugins/with-nx/type-definitions.d.ts +7 -0
  56. package/dist/src/plugins/with-nx/type-definitions.js +48 -0
  57. package/{src → dist/src}/plugins/with-nx/with-nx-options.d.ts +0 -5
  58. package/{src → dist/src}/plugins/with-nx/with-nx.d.ts +1 -2
  59. package/{src → dist/src}/plugins/with-nx/with-nx.js +26 -43
  60. package/dist/src/utils/deprecation.d.ts +3 -0
  61. package/dist/src/utils/deprecation.js +19 -0
  62. package/{src → dist/src}/utils/ensure-dependencies.d.ts +0 -1
  63. package/{src → dist/src}/utils/ensure-dependencies.js +10 -10
  64. package/{src → dist/src}/utils/fs.d.ts +0 -1
  65. package/{src → dist/src}/utils/has-plugin.d.ts +0 -1
  66. package/{src → dist/src}/utils/versions.d.ts +3 -1
  67. package/dist/src/utils/versions.js +18 -0
  68. package/{with-nx.d.ts → dist/with-nx.d.ts} +0 -1
  69. package/executors.json +2 -2
  70. package/generators.json +6 -6
  71. package/migrations.json +31 -2
  72. package/package.json +66 -12
  73. package/index.d.ts.map +0 -1
  74. package/plugin.d.ts.map +0 -1
  75. package/src/executors/rollup/lib/normalize.d.ts.map +0 -1
  76. package/src/executors/rollup/rollup.impl.d.ts.map +0 -1
  77. package/src/generators/configuration/configuration.d.ts.map +0 -1
  78. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  79. package/src/generators/convert-to-inferred/lib/add-plugin-registrations.d.ts.map +0 -1
  80. package/src/generators/convert-to-inferred/lib/extract-rollup-config-from-executor-options.d.ts.map +0 -1
  81. package/src/generators/convert-to-inferred/lib/normalize-path-options.d.ts.map +0 -1
  82. package/src/generators/init/init.d.ts.map +0 -1
  83. package/src/plugins/analyze.d.ts.map +0 -1
  84. package/src/plugins/delete-output.d.ts.map +0 -1
  85. package/src/plugins/nx-copy-assets.plugin.d.ts.map +0 -1
  86. package/src/plugins/package-json/generate-package-json.d.ts.map +0 -1
  87. package/src/plugins/package-json/update-package-json.d.ts.map +0 -1
  88. package/src/plugins/plugin.d.ts.map +0 -1
  89. package/src/plugins/postcss/index.d.ts.map +0 -1
  90. package/src/plugins/postcss/loaders/index.d.ts.map +0 -1
  91. package/src/plugins/postcss/loaders/less-loader.d.ts.map +0 -1
  92. package/src/plugins/postcss/loaders/postcss-loader.d.ts.map +0 -1
  93. package/src/plugins/postcss/loaders/sass-loader.d.ts.map +0 -1
  94. package/src/plugins/postcss/loaders/stylus-loader.d.ts.map +0 -1
  95. package/src/plugins/postcss/loaders/types.d.ts.map +0 -1
  96. package/src/plugins/postcss/options.d.ts.map +0 -1
  97. package/src/plugins/postcss/postcss-plugin.d.ts.map +0 -1
  98. package/src/plugins/postcss/utils/index.d.ts.map +0 -1
  99. package/src/plugins/postcss/utils/load-module.d.ts.map +0 -1
  100. package/src/plugins/postcss/utils/normalize-path.d.ts.map +0 -1
  101. package/src/plugins/postcss/utils/safe-identifier.d.ts.map +0 -1
  102. package/src/plugins/postcss/utils/style-inject.d.ts.map +0 -1
  103. package/src/plugins/swc.d.ts.map +0 -1
  104. package/src/plugins/with-nx/get-project-node.d.ts.map +0 -1
  105. package/src/plugins/with-nx/normalize-options.d.ts.map +0 -1
  106. package/src/plugins/with-nx/with-nx-options.d.ts.map +0 -1
  107. package/src/plugins/with-nx/with-nx.d.ts.map +0 -1
  108. package/src/utils/ensure-dependencies.d.ts.map +0 -1
  109. package/src/utils/fs.d.ts.map +0 -1
  110. package/src/utils/has-plugin.d.ts.map +0 -1
  111. package/src/utils/versions.d.ts.map +0 -1
  112. package/src/utils/versions.js +0 -8
  113. package/with-nx.d.ts.map +0 -1
  114. /package/{LICENSE → dist/LICENSE} +0 -0
  115. /package/{index.js → dist/index.js} +0 -0
  116. /package/{plugin.js → dist/plugin.js} +0 -0
  117. /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
  118. /package/{src → dist/src}/generators/configuration/schema.json +0 -0
  119. /package/{src → dist/src}/generators/convert-to-inferred/lib/add-plugin-registrations.js +0 -0
  120. /package/{src → dist/src}/generators/convert-to-inferred/lib/extract-rollup-config-from-executor-options.js +0 -0
  121. /package/{src → dist/src}/generators/convert-to-inferred/lib/normalize-path-options.js +0 -0
  122. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  123. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  124. /package/{src → dist/src}/plugins/analyze.js +0 -0
  125. /package/{src → dist/src}/plugins/delete-output.js +0 -0
  126. /package/{src → dist/src}/plugins/package-json/generate-package-json.js +0 -0
  127. /package/{src → dist/src}/plugins/package-json/update-package-json.js +0 -0
  128. /package/{src → dist/src}/plugins/postcss/index.js +0 -0
  129. /package/{src → dist/src}/plugins/postcss/loaders/index.js +0 -0
  130. /package/{src → dist/src}/plugins/postcss/loaders/less-loader.js +0 -0
  131. /package/{src → dist/src}/plugins/postcss/loaders/postcss-loader.js +0 -0
  132. /package/{src → dist/src}/plugins/postcss/loaders/sass-loader.js +0 -0
  133. /package/{src → dist/src}/plugins/postcss/loaders/stylus-loader.js +0 -0
  134. /package/{src → dist/src}/plugins/postcss/loaders/types.js +0 -0
  135. /package/{src → dist/src}/plugins/postcss/options.js +0 -0
  136. /package/{src → dist/src}/plugins/postcss/postcss-plugin.js +0 -0
  137. /package/{src → dist/src}/plugins/postcss/types/concat-with-sourcemaps.d.ts +0 -0
  138. /package/{src → dist/src}/plugins/postcss/utils/index.js +0 -0
  139. /package/{src → dist/src}/plugins/postcss/utils/load-module.js +0 -0
  140. /package/{src → dist/src}/plugins/postcss/utils/normalize-path.js +0 -0
  141. /package/{src → dist/src}/plugins/postcss/utils/safe-identifier.js +0 -0
  142. /package/{src → dist/src}/plugins/postcss/utils/style-inject.js +0 -0
  143. /package/{src → dist/src}/plugins/swc.js +0 -0
  144. /package/{src → dist/src}/plugins/with-nx/get-project-node.js +0 -0
  145. /package/{src → dist/src}/plugins/with-nx/with-nx-options.js +0 -0
  146. /package/{src → dist/src}/utils/fs.js +0 -0
  147. /package/{src → dist/src}/utils/has-plugin.js +0 -0
  148. /package/{with-nx.js → dist/with-nx.js} +0 -0
@@ -4,4 +4,3 @@ import type { Loader, PostCSSLoaderOptions } from './types';
4
4
  * This loader always runs last in the chain
5
5
  */
6
6
  export declare function createPostCSSLoader(options: PostCSSLoaderOptions): Loader;
7
- //# sourceMappingURL=postcss-loader.d.ts.map
@@ -4,4 +4,3 @@ import type { Loader, SassLoaderOptions } from './types';
4
4
  * Compiles .sass and .scss files to CSS
5
5
  */
6
6
  export declare function createSassLoader(options?: SassLoaderOptions): Loader;
7
- //# sourceMappingURL=sass-loader.d.ts.map
@@ -4,4 +4,3 @@ import type { Loader, StylusLoaderOptions } from './types';
4
4
  * Compiles .styl and .stylus files to CSS
5
5
  */
6
6
  export declare function createStylusLoader(options?: StylusLoaderOptions): Loader;
7
- //# sourceMappingURL=stylus-loader.d.ts.map
@@ -85,4 +85,3 @@ export interface StylusLoaderOptions {
85
85
  /** Additional Stylus options */
86
86
  [key: string]: unknown;
87
87
  }
88
- //# sourceMappingURL=types.d.ts.map
@@ -108,4 +108,3 @@ export interface NormalizedPostCSSOptions extends PostCSSPluginOptions {
108
108
  * Normalize plugin options with defaults
109
109
  */
110
110
  export declare function normalizeOptions(options?: PostCSSPluginOptions): NormalizedPostCSSOptions;
111
- //# sourceMappingURL=options.d.ts.map
@@ -7,4 +7,3 @@ import type { PostCSSPluginOptions } from './options';
7
7
  * Supports CSS injection into the DOM or extraction to separate files.
8
8
  */
9
9
  export declare function postcss(pluginOptions?: PostCSSPluginOptions): Plugin;
10
- //# sourceMappingURL=postcss-plugin.d.ts.map
@@ -2,4 +2,3 @@ export { normalizePath, humanizePath } from './normalize-path';
2
2
  export { loadModule, requireModule } from './load-module';
3
3
  export { safeIdentifier, escapeClassNameDashes } from './safe-identifier';
4
4
  export { styleInjectCode, STYLE_INJECT_ID, STYLE_INJECT_PATH, } from './style-inject';
5
- //# sourceMappingURL=index.d.ts.map
@@ -8,4 +8,3 @@ export declare function loadModule<T = unknown>(moduleId: string): T | undefined
8
8
  * Load a module and throw an error if it's not found
9
9
  */
10
10
  export declare function requireModule<T = unknown>(moduleId: string, feature: string): T;
11
- //# sourceMappingURL=load-module.d.ts.map
@@ -7,4 +7,3 @@ export declare function normalizePath(path: string | undefined): string;
7
7
  * Convert an absolute path to a human-readable relative path from cwd
8
8
  */
9
9
  export declare function humanizePath(filepath: string): string;
10
- //# sourceMappingURL=normalize-path.d.ts.map
@@ -11,4 +11,3 @@ export declare function escapeClassNameDashes(name: string): string;
11
11
  * Convert a CSS class name to a safe JavaScript identifier
12
12
  */
13
13
  export declare function safeIdentifier(name: string): string;
14
- //# sourceMappingURL=safe-identifier.d.ts.map
@@ -18,4 +18,3 @@ export declare const STYLE_INJECT_ID = "\0style-inject";
18
18
  * Path that will be used in imports
19
19
  */
20
20
  export declare const STYLE_INJECT_PATH = "style-inject";
21
- //# sourceMappingURL=style-inject.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Plugin } from 'rollup';
2
2
  export declare function swc(): Plugin;
3
- //# sourceMappingURL=swc.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ProjectGraphProjectNode } from '@nx/devkit';
2
2
  export declare function getProjectNode(): ProjectGraphProjectNode;
3
- //# sourceMappingURL=get-project-node.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { NormalizedRollupWithNxPluginOptions, RollupWithNxPluginOptions } from './with-nx-options';
2
2
  export declare function normalizeOptions(projectRoot: string, sourceRoot: string, options: RollupWithNxPluginOptions): NormalizedRollupWithNxPluginOptions;
3
- //# sourceMappingURL=normalize-options.d.ts.map
@@ -5,13 +5,13 @@ const node_path_1 = require("node:path");
5
5
  const node_fs_1 = require("node:fs");
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const js_1 = require("@nx/js");
8
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
8
+ const internal_1 = require("@nx/js/internal");
9
9
  function normalizeOptions(projectRoot, sourceRoot, options) {
10
10
  if (global.NX_GRAPH_CREATION)
11
11
  return options;
12
12
  normalizeRelativePaths(projectRoot, options);
13
13
  // New TS Solution already has a typecheck target
14
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)()) {
14
+ if ((0, internal_1.isUsingTsSolutionSetup)()) {
15
15
  options.skipTypeCheck = true;
16
16
  }
17
17
  return {
@@ -30,12 +30,7 @@ function normalizeOptions(projectRoot, sourceRoot, options) {
30
30
  javascriptEnabled: options.javascriptEnabled ?? false,
31
31
  skipTypeCheck: options.skipTypeCheck ?? false,
32
32
  skipTypeField: options.skipTypeField ?? false,
33
- /**
34
- * TODO(v23): Update default to true
35
- * This defaults to false for pure plugin usage to match what is the current behaviour for users
36
- * However, this differs from the Rollup executor usage as it defaulted to `true` in the `schema.json`
37
- */
38
- buildLibsFromSource: options.buildLibsFromSource ?? false,
33
+ buildLibsFromSource: options.buildLibsFromSource ?? true,
39
34
  };
40
35
  }
41
36
  function normalizeAssets(assets, root, sourceRoot) {
@@ -0,0 +1,7 @@
1
+ import type { OutputBundle } from 'rollup';
2
+ export declare function typeDefinitions(options: {
3
+ projectRoot: string;
4
+ }): {
5
+ name: string;
6
+ generateBundle(_opts: unknown, bundle: OutputBundle): Promise<void>;
7
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typeDefinitions = typeDefinitions;
4
+ const path_1 = require("path");
5
+ const devkit_1 = require("@nx/devkit");
6
+ /*
7
+ * This plugin takes all entry-points from the generated bundle and creates a
8
+ * bundled version of corresponding d.ts files.
9
+ *
10
+ * For example, `src/index.ts` generates two corresponding files:
11
+ * - `dist/xyz/index.js`
12
+ * - `dist/xyz/src/index.d.ts`
13
+ *
14
+ * We want a third file: `dist/index.d.ts` that re-exports from `src/index.d.ts`.
15
+ * That way, when TSC or IDEs look for types, it will find them in the right place.
16
+ */
17
+ function typeDefinitions(options) {
18
+ return {
19
+ name: 'dts-bundle',
20
+ async generateBundle(_opts, bundle) {
21
+ for (const [name, file] of Object.entries(bundle)) {
22
+ if (file.type === 'asset' ||
23
+ !file.isEntry ||
24
+ file.facadeModuleId == null) {
25
+ continue;
26
+ }
27
+ const hasDefaultExport = file.exports.includes('default');
28
+ const entrySourceFileName = (0, path_1.relative)(options.projectRoot, file.facadeModuleId);
29
+ const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, '');
30
+ // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.
31
+ // This regex matches the pattern used in packages/rollup/src/plugins/package-json/update-package-json.ts
32
+ const dtsFileName = file.fileName.replace(/(\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, '.d.ts');
33
+ const relativeSourceDtsName = JSON.stringify('./' + entrySourceDtsName);
34
+ const dtsFileSource = hasDefaultExport
35
+ ? (0, devkit_1.stripIndents) `
36
+ export * from ${relativeSourceDtsName};
37
+ export { default } from ${relativeSourceDtsName};
38
+ `
39
+ : `export * from ${relativeSourceDtsName};\n`;
40
+ this.emitFile({
41
+ type: 'asset',
42
+ fileName: dtsFileName,
43
+ source: dtsFileSource,
44
+ });
45
+ }
46
+ },
47
+ };
48
+ }
@@ -80,10 +80,6 @@ export interface RollupWithNxPluginOptions {
80
80
  * The path to tsconfig file.
81
81
  */
82
82
  tsConfig: string;
83
- /**
84
- * Use rollup-plugin-typescript2 instead of @rollup/plugin-typescript.
85
- */
86
- useLegacyTypescriptPlugin?: boolean;
87
83
  /**
88
84
  * Whether to generate a package.json file in the output path. It's not supported when the workspace is
89
85
  * set up with TypeScript Project References along with the package managers' Workspaces feature. Otherwise,
@@ -102,4 +98,3 @@ export interface NormalizedRollupWithNxPluginOptions extends RollupWithNxPluginO
102
98
  compiler: 'babel' | 'tsc' | 'swc';
103
99
  format: ('cjs' | 'esm')[];
104
100
  }
105
- //# sourceMappingURL=with-nx-options.d.ts.map
@@ -1,5 +1,4 @@
1
- import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
1
+ import { DependentBuildableProjectNode } from '@nx/js/internal';
2
2
  import * as rollup from 'rollup';
3
3
  import { RollupWithNxPluginOptions } from './with-nx-options';
4
4
  export declare function withNx(rawOptions: RollupWithNxPluginOptions, rollupConfig?: rollup.RollupOptions, dependencies?: DependentBuildableProjectNode[]): rollup.RollupOptions;
5
- //# sourceMappingURL=with-nx.d.ts.map
@@ -4,10 +4,9 @@ exports.withNx = withNx;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const path_1 = require("path");
7
- const type_definitions_1 = require("@nx/js/src/plugins/rollup/type-definitions");
8
- const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
9
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
- const ts_config_1 = require("@nx/js/src/utils/typescript/ts-config");
7
+ const internal_1 = require("@nx/js/internal");
8
+ const type_definitions_1 = require("./type-definitions");
9
+ const js_1 = require("@nx/js");
11
10
  const plugin_babel_1 = require("@rollup/plugin-babel");
12
11
  const plugin_node_resolve_1 = tslib_1.__importDefault(require("@rollup/plugin-node-resolve"));
13
12
  const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
@@ -52,16 +51,16 @@ dependencies) {
52
51
  : (0, devkit_1.readCachedProjectGraph)();
53
52
  // If dependencies are not passed from executor, calculate them from project graph.
54
53
  if (!dependencies && !global.NX_GRAPH_CREATION) {
55
- const result = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(undefined, projectGraph, devkit_1.workspaceRoot, projectNode.name, process.env.NX_TASK_TARGET_TARGET, process.env.NX_TASK_TARGET_CONFIGURATION, true);
54
+ const result = (0, internal_1.calculateProjectBuildableDependencies)(undefined, projectGraph, devkit_1.workspaceRoot, projectNode.name, process.env.NX_TASK_TARGET_TARGET, process.env.NX_TASK_TARGET_CONFIGURATION, true);
56
55
  dependencies = result.dependencies;
57
56
  }
58
- const projectSourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(projectNode.data);
57
+ const projectSourceRoot = (0, internal_1.getProjectSourceRoot)(projectNode.data);
59
58
  const options = (0, normalize_options_1.normalizeOptions)(projectNode.data.root, projectSourceRoot, rawOptions);
60
59
  const useBabel = options.compiler === 'babel';
61
60
  const useSwc = options.compiler === 'swc';
62
61
  const tsConfigPath = options.buildLibsFromSource || global.NX_GRAPH_CREATION
63
62
  ? (0, node_path_1.join)(devkit_1.workspaceRoot, options.tsConfig)
64
- : (0, buildable_libs_utils_1.createTmpTsConfig)(options.tsConfig, devkit_1.workspaceRoot, projectNode.data.root, dependencies);
63
+ : (0, internal_1.createTmpTsConfig)(options.tsConfig, devkit_1.workspaceRoot, projectNode.data.root, dependencies);
65
64
  ensureTypeScript();
66
65
  const tsConfigFile = ts.readConfigFile(tsConfigPath, ts.sys.readFile);
67
66
  const tsConfig = ts.parseJsonConfigFileContent(tsConfigFile.config, ts.sys, (0, node_path_1.dirname)(tsConfigPath));
@@ -141,7 +140,7 @@ dependencies) {
141
140
  if (!global.NX_GRAPH_CREATION) {
142
141
  // Ensure TypeScript is available before any plugin initialization
143
142
  ensureTypeScript();
144
- const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
143
+ const isTsSolutionSetup = (0, internal_1.isUsingTsSolutionSetup)();
145
144
  if (isTsSolutionSetup) {
146
145
  if (options.generatePackageJson) {
147
146
  throw new Error(`Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option. See https://nx.dev/docs/technologies/node/guides/deploying-node-projects for the recommended pruned package.json workflow.`);
@@ -166,39 +165,23 @@ dependencies) {
166
165
  }),
167
166
  image(),
168
167
  json(),
169
- // TypeScript compilation and declaration generation
170
- options.useLegacyTypescriptPlugin === true
171
- ? (() => {
172
- // TODO(v23): Remove in Nx 23
173
- // Show deprecation warning
174
- devkit_1.logger.warn(`rollup-plugin-typescript2 is deprecated and will be removed in Nx 23. ` +
175
- `You are explicitly using it with 'useLegacyTypescriptPlugin: true'. ` +
176
- `Consider removing this option to use the official @rollup/plugin-typescript.`);
177
- return require('rollup-plugin-typescript2')({
178
- check: !options.skipTypeCheck,
179
- tsconfig: tsConfigPath,
180
- tsconfigOverride: {
181
- compilerOptions,
182
- },
183
- });
184
- })()
185
- : (() => {
186
- // @rollup/plugin-typescript needs outDir and declarationDir to match Rollup's output directory
187
- const { outDir, declarationDir, ...tsCompilerOptions } = compilerOptions;
188
- const rollupOutputDir = Array.isArray(finalConfig.output)
189
- ? finalConfig.output[0].dir
190
- : finalConfig.output.dir;
191
- return require('@rollup/plugin-typescript')({
192
- tsconfig: tsConfigPath,
193
- compilerOptions: {
194
- ...tsCompilerOptions,
195
- composite: false,
196
- outDir: rollupOutputDir,
197
- declarationDir: rollupOutputDir,
198
- noEmitOnError: !options.skipTypeCheck,
199
- },
200
- });
201
- })(),
168
+ (() => {
169
+ // @rollup/plugin-typescript needs outDir and declarationDir to match Rollup's output directory
170
+ const { outDir, declarationDir, ...tsCompilerOptions } = compilerOptions;
171
+ const rollupOutputDir = Array.isArray(finalConfig.output)
172
+ ? finalConfig.output[0].dir
173
+ : finalConfig.output.dir;
174
+ return require('@rollup/plugin-typescript')({
175
+ tsconfig: tsConfigPath,
176
+ compilerOptions: {
177
+ ...tsCompilerOptions,
178
+ composite: false,
179
+ outDir: rollupOutputDir,
180
+ declarationDir: rollupOutputDir,
181
+ noEmitOnError: !options.skipTypeCheck,
182
+ },
183
+ });
184
+ })(),
202
185
  (0, type_definitions_1.typeDefinitions)({
203
186
  projectRoot,
204
187
  }),
@@ -268,10 +251,10 @@ function createInput(options) {
268
251
  return input;
269
252
  }
270
253
  function createTsCompilerOptions(projectRoot, config, tsConfigPath, options, dependencies) {
271
- const compilerOptionPaths = (0, buildable_libs_utils_1.computeCompilerOptionsPaths)(config, dependencies ?? []);
254
+ const compilerOptionPaths = (0, internal_1.computeCompilerOptionsPaths)(config, dependencies ?? []);
272
255
  // Resolve paths to absolute so they work without baseUrl and regardless
273
256
  // of which tsconfig the plugin reads (project vs workspace root).
274
- const pathsBase = (0, ts_config_1.resolvePathsBaseUrl)(tsConfigPath);
257
+ const pathsBase = (0, js_1.resolvePathsBaseUrl)(tsConfigPath);
275
258
  for (const key of Object.keys(compilerOptionPaths)) {
276
259
  compilerOptionPaths[key] = compilerOptionPaths[key].map((p) => {
277
260
  if ((0, path_1.isAbsolute)(p)) {
@@ -0,0 +1,3 @@
1
+ export declare const ROLLUP_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/rollup:rollup` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rollup:convert-to-inferred` to migrate to the `@nx/rollup/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
2
+ export declare function warnRollupExecutorDeprecation(): void;
3
+ export declare function warnRollupExecutorGenerating(): void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ROLLUP_EXECUTOR_DEPRECATION_MESSAGE = void 0;
4
+ exports.warnRollupExecutorDeprecation = warnRollupExecutorDeprecation;
5
+ exports.warnRollupExecutorGenerating = warnRollupExecutorGenerating;
6
+ const devkit_1 = require("@nx/devkit");
7
+ // TODO(v24): Remove the @nx/rollup:rollup executor. The inferred plugin
8
+ // (@nx/rollup/plugin) and the convert-to-inferred generator stay supported.
9
+ exports.ROLLUP_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/rollup:rollup` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rollup:convert-to-inferred` to migrate to the `@nx/rollup/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
10
+ function warnRollupExecutorDeprecation() {
11
+ devkit_1.logger.warn(exports.ROLLUP_EXECUTOR_DEPRECATION_MESSAGE);
12
+ }
13
+ // Fired when the @nx/rollup:configuration generator is about to generate a
14
+ // target that uses the deprecated executor — i.e. when @nx/rollup/plugin
15
+ // isn't registered in nx.json. Surfaces the deprecation at generation time
16
+ // rather than only when the user later runs the generated target.
17
+ function warnRollupExecutorGenerating() {
18
+ devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/rollup:rollup` executor. The executor will be removed in Nx v24. Run `nx g @nx/rollup:convert-to-inferred` next to migrate this target to the `@nx/rollup/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
19
+ }
@@ -3,4 +3,3 @@ export type EnsureDependenciesOptions = {
3
3
  compiler?: 'babel' | 'swc' | 'tsc';
4
4
  };
5
5
  export declare function ensureDependencies(tree: Tree, options: EnsureDependenciesOptions): GeneratorCallback;
6
- //# sourceMappingURL=ensure-dependencies.d.ts.map
@@ -2,22 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureDependencies = ensureDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("@nx/js/src/utils/versions");
6
- const versions_2 = require("./versions");
5
+ const internal_1 = require("@nx/js/internal");
6
+ const versions_1 = require("./versions");
7
7
  function ensureDependencies(tree, options) {
8
8
  switch (options.compiler) {
9
9
  case 'swc':
10
10
  return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
11
- '@swc/helpers': versions_1.swcHelpersVersion,
12
- '@swc/core': versions_1.swcCoreVersion,
13
- 'swc-loader': versions_2.swcLoaderVersion,
14
- });
11
+ '@swc/helpers': internal_1.swcHelpersVersion,
12
+ '@swc/core': internal_1.swcCoreVersion,
13
+ 'swc-loader': versions_1.swcLoaderVersion,
14
+ }, undefined, true);
15
15
  case 'babel':
16
16
  return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
17
- 'core-js': versions_2.coreJsVersion, // needed for preset-env to work
18
- tslib: versions_2.tsLibVersion,
19
- });
17
+ 'core-js': versions_1.coreJsVersion, // needed for preset-env to work
18
+ tslib: versions_1.tsLibVersion,
19
+ }, undefined, true);
20
20
  default:
21
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { tslib: versions_2.tsLibVersion });
21
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { tslib: versions_1.tsLibVersion }, undefined, true);
22
22
  }
23
23
  }
@@ -2,4 +2,3 @@
2
2
  * Delete an output directory, but error out if it's the root of the project.
3
3
  */
4
4
  export declare function deleteOutputDir(root: string, outputPath: string): void;
5
- //# sourceMappingURL=fs.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export declare function hasPlugin(tree: Tree): boolean;
3
- //# sourceMappingURL=has-plugin.d.ts.map
@@ -1,6 +1,8 @@
1
+ import { type Tree } from '@nx/devkit';
1
2
  export declare const nxVersion: any;
2
3
  export declare const coreJsVersion = "^3.36.1";
4
+ export declare const minSupportedRollupVersion = "3.0.0";
3
5
  export declare const rollupVersion = "^4.14.0";
4
6
  export declare const swcLoaderVersion = "0.1.15";
5
7
  export declare const tsLibVersion = "^2.3.0";
6
- //# sourceMappingURL=versions.d.ts.map
8
+ export declare function assertSupportedRollupVersion(tree: Tree): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tsLibVersion = exports.swcLoaderVersion = exports.rollupVersion = exports.minSupportedRollupVersion = exports.coreJsVersion = exports.nxVersion = void 0;
4
+ exports.assertSupportedRollupVersion = assertSupportedRollupVersion;
5
+ const path_1 = require("path");
6
+ const internal_1 = require("@nx/devkit/internal");
7
+ exports.nxVersion = require((0, path_1.join)('@nx/rollup', 'package.json')).version;
8
+ exports.coreJsVersion = '^3.36.1';
9
+ // Floor for the generator-level support check. The plugin's runtime code only
10
+ // uses Rollup APIs available since v3, so v3 and v4 are both supported.
11
+ exports.minSupportedRollupVersion = '3.0.0';
12
+ // Fresh-install version written when Rollup is not already present.
13
+ exports.rollupVersion = '^4.14.0';
14
+ exports.swcLoaderVersion = '0.1.15';
15
+ exports.tsLibVersion = '^2.3.0';
16
+ function assertSupportedRollupVersion(tree) {
17
+ (0, internal_1.assertSupportedPackageVersion)(tree, 'rollup', exports.minSupportedRollupVersion);
18
+ }
@@ -1,3 +1,2 @@
1
1
  export { withNx } from './src/plugins/with-nx/with-nx';
2
2
  export type { RollupWithNxPluginOptions } from './src/plugins/with-nx/with-nx-options';
3
- //# sourceMappingURL=with-nx.d.ts.map
package/executors.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "executors": {
3
3
  "rollup": {
4
- "implementation": "./src/executors/rollup/rollup.impl",
5
- "schema": "./src/executors/rollup/schema.json",
4
+ "implementation": "./dist/src/executors/rollup/rollup.impl",
5
+ "schema": "./dist/src/executors/rollup/schema.json",
6
6
  "description": "Bundle a package using Rollup."
7
7
  }
8
8
  }
package/generators.json CHANGED
@@ -3,21 +3,21 @@
3
3
  "version": "0.1",
4
4
  "generators": {
5
5
  "init": {
6
- "factory": "./src/generators/init/init#rollupInitGenerator",
7
- "schema": "./src/generators/init/schema.json",
6
+ "factory": "./dist/src/generators/init/init#rollupInitGenerator",
7
+ "schema": "./dist/src/generators/init/schema.json",
8
8
  "description": "Initialize the `@nx/rollup` plugin.",
9
9
  "aliases": ["ng-add"],
10
10
  "hidden": true
11
11
  },
12
12
  "configuration": {
13
13
  "aliases": ["rollup-project"],
14
- "factory": "./src/generators/configuration/configuration",
15
- "schema": "./src/generators/configuration/schema.json",
14
+ "factory": "./dist/src/generators/configuration/configuration",
15
+ "schema": "./dist/src/generators/configuration/schema.json",
16
16
  "description": "Add rollup configuration to a project."
17
17
  },
18
18
  "convert-to-inferred": {
19
- "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
20
- "schema": "./src/generators/convert-to-inferred/schema.json",
19
+ "factory": "./dist/src/generators/convert-to-inferred/convert-to-inferred",
20
+ "schema": "./dist/src/generators/convert-to-inferred/schema.json",
21
21
  "description": "Convert existing Rollup project(s) using `@nx/rollup:*` executors to use `@nx/rollup/plugin`."
22
22
  }
23
23
  }
package/migrations.json CHANGED
@@ -1,4 +1,33 @@
1
1
  {
2
- "generators": {},
3
- "packageJsonUpdates": {}
2
+ "generators": {
3
+ "update-23-0-0-remove-use-legacy-typescript-plugin": {
4
+ "cli": "nx",
5
+ "version": "23.0.0-beta.4",
6
+ "description": "Remove deprecated useLegacyTypescriptPlugin option from @nx/rollup:rollup",
7
+ "implementation": "./dist/src/migrations/update-23-0-0/remove-use-legacy-typescript-plugin",
8
+ "documentation": "./dist/src/migrations/update-23-0-0/remove-use-legacy-typescript-plugin.md"
9
+ },
10
+ "rewrite-rollup-internal-subpath-imports": {
11
+ "version": "23.0.0-beta.24",
12
+ "description": "Rewrites `@nx/rollup/src/*` subpath imports now that the `./src/*` subpath is no longer exposed by `@nx/rollup`'s exports map. Named imports/exports of public symbols are routed to `@nx/rollup` and the rest to the new `@nx/rollup/internal` entry; `require`, dynamic `import` and `jest.mock` calls reference the whole module and are routed to `@nx/rollup/internal`.",
13
+ "implementation": "./dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports"
14
+ },
15
+ "update-23-0-0-migrate-create-nodes-v2-import": {
16
+ "version": "23.0.0-beta.24",
17
+ "description": "Rename imports of `createNodesV2` from `@nx/rollup/plugin` to the canonical `createNodes` export.",
18
+ "implementation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes",
19
+ "documentation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md"
20
+ }
21
+ },
22
+ "packageJsonUpdates": {
23
+ "23.0.0": {
24
+ "version": "23.0.0-beta.24",
25
+ "packages": {
26
+ "rollup": {
27
+ "version": "^4.14.0",
28
+ "alwaysAddToPackageJson": true
29
+ }
30
+ }
31
+ }
32
+ }
4
33
  }
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@nx/rollup",
3
- "version": "23.0.0-pr.35413.460eeef",
3
+ "version": "23.0.0-rc.0",
4
4
  "private": false,
5
+ "type": "commonjs",
6
+ "files": [
7
+ "dist",
8
+ "!dist/tsconfig.tsbuildinfo",
9
+ "migrations.json",
10
+ "executors.json",
11
+ "generators.json"
12
+ ],
5
13
  "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
6
14
  "repository": {
7
15
  "type": "git",
@@ -14,9 +22,21 @@
14
22
  "Web",
15
23
  "CLI"
16
24
  ],
17
- "main": "./index.js",
18
- "type": "commonjs",
19
- "types": "./index.d.ts",
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "typesVersions": {
28
+ "*": {
29
+ "plugin": [
30
+ "dist/plugin.d.ts"
31
+ ],
32
+ "with-nx": [
33
+ "dist/with-nx.d.ts"
34
+ ],
35
+ "internal": [
36
+ "dist/internal.d.ts"
37
+ ]
38
+ }
39
+ },
20
40
  "author": "Victor Savkin",
21
41
  "license": "MIT",
22
42
  "bugs": {
@@ -27,11 +47,37 @@
27
47
  "executors": "./executors.json",
28
48
  "ng-update": {
29
49
  "requirements": {},
30
- "migrations": "./migrations.json"
50
+ "migrations": "./migrations.json",
51
+ "supportsOptionalMigrations": true
52
+ },
53
+ "exports": {
54
+ ".": {
55
+ "@nx/nx-source": "./index.ts",
56
+ "types": "./dist/index.d.ts",
57
+ "default": "./dist/index.js"
58
+ },
59
+ "./package.json": "./package.json",
60
+ "./migrations.json": "./migrations.json",
61
+ "./generators.json": "./generators.json",
62
+ "./executors.json": "./executors.json",
63
+ "./plugin": {
64
+ "@nx/nx-source": "./plugin.ts",
65
+ "types": "./dist/plugin.d.ts",
66
+ "default": "./dist/plugin.js"
67
+ },
68
+ "./with-nx": {
69
+ "@nx/nx-source": "./with-nx.ts",
70
+ "types": "./dist/with-nx.d.ts",
71
+ "default": "./dist/with-nx.js"
72
+ },
73
+ "./internal": {
74
+ "@nx/nx-source": "./internal.ts",
75
+ "types": "./dist/internal.d.ts",
76
+ "default": "./dist/internal.js"
77
+ }
31
78
  },
32
79
  "dependencies": {
33
- "@nx/devkit": "23.0.0-pr.35413.460eeef",
34
- "@nx/js": "23.0.0-pr.35413.460eeef",
80
+ "@phenomnomnominal/tsquery": "~6.2.0",
35
81
  "@rollup/plugin-babel": "^6.0.4",
36
82
  "@rollup/plugin-commonjs": "^25.0.7",
37
83
  "@rollup/plugin-image": "^3.0.3",
@@ -44,13 +90,21 @@
44
90
  "picomatch": "4.0.4",
45
91
  "postcss": "^8.4.38",
46
92
  "postcss-modules": "^6.0.1",
47
- "rollup": "^4.14.0",
48
- "rollup-plugin-typescript2": "^0.36.0",
49
- "tslib": "^2.3.0"
93
+ "tslib": "^2.3.0",
94
+ "@nx/devkit": "23.0.0-rc.0",
95
+ "@nx/js": "23.0.0-rc.0"
96
+ },
97
+ "peerDependencies": {
98
+ "rollup": "^3.0.0 || ^4.0.0"
99
+ },
100
+ "peerDependenciesMeta": {
101
+ "rollup": {
102
+ "optional": true
103
+ }
50
104
  },
51
105
  "devDependencies": {
52
- "nx": "23.0.0-pr.35413.460eeef",
53
- "source-map-js": "^1.2.0"
106
+ "source-map-js": "^1.2.0",
107
+ "nx": "23.0.0-rc.0"
54
108
  },
55
109
  "publishConfig": {
56
110
  "access": "public"
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/rollup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAGlC,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,+BAAyB,CAAC;AAE7D,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EACV,gBAAgB,EAChB,OAAO,EACP,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,cAAc,oCAAoC,CAAC"}
package/plugin.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../packages/rollup/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rollup/src/executors/rollup/lib/normalize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvD,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe,GACvB,+BAA+B,CAajC;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,UAS1E"}