@nx/web 23.0.0-beta.23 → 23.0.0-beta.24

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 (87) hide show
  1. package/dist/babel.d.ts +1 -0
  2. package/{babel.js → dist/babel.js} +2 -0
  3. package/{index.d.ts → dist/index.d.ts} +0 -1
  4. package/dist/internal.d.ts +2 -0
  5. package/dist/internal.js +11 -0
  6. package/{src → dist/src}/executors/file-server/compat.d.ts +0 -1
  7. package/{src → dist/src}/executors/file-server/file-server.impl.d.ts +0 -1
  8. package/{src → dist/src}/generators/application/application.d.ts +0 -1
  9. package/{src → dist/src}/generators/application/application.js +6 -2
  10. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  11. package/{src → dist/src}/generators/static-serve/static-serve-configuration.d.ts +0 -1
  12. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
  13. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +197 -0
  14. package/dist/src/plugins/webpack-nx-build-coordination-plugin.d.ts +1 -0
  15. package/dist/src/plugins/webpack-nx-build-coordination-plugin.js +5 -0
  16. package/dist/src/utils/fs.d.ts +1 -0
  17. package/dist/src/utils/fs.js +7 -0
  18. package/{src → dist/src}/utils/has-vite-plugin.d.ts +0 -1
  19. package/{src → dist/src}/utils/has-webpack-plugin.d.ts +0 -1
  20. package/dist/src/utils/normalize.d.ts +1 -0
  21. package/dist/src/utils/normalize.js +6 -0
  22. package/{src → dist/src}/utils/versions.d.ts +0 -1
  23. package/{src → dist/src}/utils/versions.js +2 -1
  24. package/{src → dist/src}/utils/wait-for-port-open.d.ts +0 -1
  25. package/executors.json +4 -4
  26. package/generators.json +6 -6
  27. package/migrations.json +7 -1
  28. package/package.json +53 -14
  29. package/babel.d.ts +0 -2
  30. package/babel.d.ts.map +0 -1
  31. package/index.d.ts.map +0 -1
  32. package/src/executors/file-server/compat.d.ts.map +0 -1
  33. package/src/executors/file-server/file-server.impl.d.ts.map +0 -1
  34. package/src/generators/application/application.d.ts.map +0 -1
  35. package/src/generators/init/init.d.ts.map +0 -1
  36. package/src/generators/static-serve/static-serve-configuration.d.ts.map +0 -1
  37. package/src/plugins/webpack-nx-build-coordination-plugin.d.ts +0 -2
  38. package/src/plugins/webpack-nx-build-coordination-plugin.d.ts.map +0 -1
  39. package/src/plugins/webpack-nx-build-coordination-plugin.js +0 -5
  40. package/src/utils/fs.d.ts +0 -2
  41. package/src/utils/fs.d.ts.map +0 -1
  42. package/src/utils/fs.js +0 -4
  43. package/src/utils/has-vite-plugin.d.ts.map +0 -1
  44. package/src/utils/has-webpack-plugin.d.ts.map +0 -1
  45. package/src/utils/normalize.d.ts +0 -2
  46. package/src/utils/normalize.d.ts.map +0 -1
  47. package/src/utils/normalize.js +0 -4
  48. package/src/utils/versions.d.ts.map +0 -1
  49. package/src/utils/wait-for-port-open.d.ts.map +0 -1
  50. /package/{LICENSE → dist/LICENSE} +0 -0
  51. /package/{index.js → dist/index.js} +0 -0
  52. /package/{src → dist/src}/executors/file-server/compat.js +0 -0
  53. /package/{src → dist/src}/executors/file-server/file-server.impl.js +0 -0
  54. /package/{src → dist/src}/executors/file-server/schema.d.ts +0 -0
  55. /package/{src → dist/src}/executors/file-server/schema.json +0 -0
  56. /package/{src → dist/src}/generators/application/files/app-vite/.babelrc__tmpl__ +0 -0
  57. /package/{src → dist/src}/generators/application/files/app-vite/index.html__tmpl__ +0 -0
  58. /package/{src → dist/src}/generators/application/files/app-vite/public/favicon.ico +0 -0
  59. /package/{src → dist/src}/generators/application/files/app-vite/src/app/app.element.__style__ +0 -0
  60. /package/{src → dist/src}/generators/application/files/app-vite/src/app/app.element.spec.ts__tmpl__ +0 -0
  61. /package/{src → dist/src}/generators/application/files/app-vite/src/app/app.element.ts__tmpl__ +0 -0
  62. /package/{src → dist/src}/generators/application/files/app-vite/src/assets/.gitkeep +0 -0
  63. /package/{src → dist/src}/generators/application/files/app-vite/src/main.ts__tmpl__ +0 -0
  64. /package/{src → dist/src}/generators/application/files/app-vite/src/styles.__style__ +0 -0
  65. /package/{src → dist/src}/generators/application/files/app-vite/tsconfig.app.json +0 -0
  66. /package/{src → dist/src}/generators/application/files/app-vite/tsconfig.json__tmpl__ +0 -0
  67. /package/{src → dist/src}/generators/application/files/app-webpack/src/app/app.element.__style__ +0 -0
  68. /package/{src → dist/src}/generators/application/files/app-webpack/src/app/app.element.spec.ts__tmpl__ +0 -0
  69. /package/{src → dist/src}/generators/application/files/app-webpack/src/app/app.element.ts__tmpl__ +0 -0
  70. /package/{src → dist/src}/generators/application/files/app-webpack/src/assets/.gitkeep +0 -0
  71. /package/{src → dist/src}/generators/application/files/app-webpack/src/favicon.ico +0 -0
  72. /package/{src → dist/src}/generators/application/files/app-webpack/src/index.html +0 -0
  73. /package/{src → dist/src}/generators/application/files/app-webpack/src/main.ts__tmpl__ +0 -0
  74. /package/{src → dist/src}/generators/application/files/app-webpack/src/styles.__style__ +0 -0
  75. /package/{src → dist/src}/generators/application/files/app-webpack/tsconfig.app.json +0 -0
  76. /package/{src → dist/src}/generators/application/files/app-webpack/tsconfig.json +0 -0
  77. /package/{src → dist/src}/generators/application/files/app-webpack/webpack.config.js__tmpl__ +0 -0
  78. /package/{src → dist/src}/generators/application/schema.d.ts +0 -0
  79. /package/{src → dist/src}/generators/application/schema.json +0 -0
  80. /package/{src → dist/src}/generators/init/init.js +0 -0
  81. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  82. /package/{src → dist/src}/generators/init/schema.json +0 -0
  83. /package/{src → dist/src}/generators/static-serve/schema.json +0 -0
  84. /package/{src → dist/src}/generators/static-serve/static-serve-configuration.js +0 -0
  85. /package/{src → dist/src}/utils/has-vite-plugin.js +0 -0
  86. /package/{src → dist/src}/utils/has-webpack-plugin.js +0 -0
  87. /package/{src → dist/src}/utils/wait-for-port-open.js +0 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const nxJsBabelPreset = require('@nx/js/babel');
2
4
  /** @deprecated Use `@nx/js/babel`. */
3
5
  module.exports = function (api, options = {}) {
@@ -1,4 +1,3 @@
1
1
  export { webInitGenerator } from './src/generators/init/init';
2
2
  export { applicationGenerator } from './src/generators/application/application';
3
3
  export { webStaticServeGenerator } from './src/generators/static-serve/static-serve-configuration';
4
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { waitForPortOpen } from './src/utils/wait-for-port-open';
2
+ export { default as fileServerExecutor } from './src/executors/file-server/file-server.impl';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fileServerExecutor = exports.waitForPortOpen = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Curated internal API surface for other first-party Nx plugins (e.g. @nx/react,
6
+ // @nx/angular, @nx/rspack, @nx/next, @nx/remix, @nx/module-federation). Prefer
7
+ // this over deep `@nx/web/src/*` imports — those are not part of the public API.
8
+ var wait_for_port_open_1 = require("./src/utils/wait-for-port-open");
9
+ Object.defineProperty(exports, "waitForPortOpen", { enumerable: true, get: function () { return wait_for_port_open_1.waitForPortOpen; } });
10
+ var file_server_impl_1 = require("./src/executors/file-server/file-server.impl");
11
+ Object.defineProperty(exports, "fileServerExecutor", { enumerable: true, get: function () { return tslib_1.__importDefault(file_server_impl_1).default; } });
@@ -1,3 +1,2 @@
1
1
  declare const _default: any;
2
2
  export default _default;
3
- //# sourceMappingURL=compat.d.ts.map
@@ -6,4 +6,3 @@ export default function fileServerExecutor(options: Schema, context: ExecutorCon
6
6
  }, {
7
7
  success: boolean;
8
8
  }, unknown>;
9
- //# sourceMappingURL=file-server.impl.d.ts.map
@@ -3,4 +3,3 @@ import { Schema } from './schema';
3
3
  export declare function applicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
4
  export declare function applicationGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
5
5
  export default applicationGenerator;
6
- //# sourceMappingURL=application.d.ts.map
@@ -229,7 +229,9 @@ async function applicationGeneratorInternal(host, schema) {
229
229
  tasks.push(lintTask);
230
230
  // Add out-tsc ignore pattern when using TS solution setup
231
231
  if (options.isUsingTsSolutionConfig) {
232
- const { addIgnoresToLintConfig } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/eslint/internal')));
232
+ // CommonJS `require` instead of dynamic ESM `import` — `ensurePackage`
233
+ // exposes the temp install via `Module._initPaths`, which ESM ignores.
234
+ const { addIgnoresToLintConfig, } = require('@nx/eslint/internal');
233
235
  addIgnoresToLintConfig(host, options.appProjectRoot, ['**/out-tsc']);
234
236
  }
235
237
  }
@@ -261,7 +263,9 @@ async function applicationGeneratorInternal(host, schema) {
261
263
  if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') {
262
264
  const { createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
263
265
  (0, devkit_1.ensurePackage)('@nx/vitest', versions_1.nxVersion);
264
- const { configurationGenerator } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/vitest/generators')));
266
+ // CommonJS `require` instead of dynamic ESM `import` — `ensurePackage`
267
+ // exposes the temp install via `Module._initPaths`, which ESM ignores.
268
+ const { configurationGenerator, } = require('@nx/vitest/generators');
265
269
  const vitestTask = await configurationGenerator(host, {
266
270
  uiFramework: 'none',
267
271
  project: options.projectName,
@@ -2,4 +2,3 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function webInitGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
4
4
  export default webInitGenerator;
5
- //# sourceMappingURL=init.d.ts.map
@@ -7,4 +7,3 @@ interface WebStaticServeSchema {
7
7
  }
8
8
  export declare function webStaticServeGenerator(tree: Tree, options: WebStaticServeSchema): Promise<void>;
9
9
  export default webStaticServeGenerator;
10
- //# sourceMappingURL=static-serve-configuration.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function rewriteInternalSubpathImports(tree: Tree): Promise<void>;
3
+ export declare function rewriteSubpathImports(source: string): string;
@@ -0,0 +1,197 @@
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/web/src/';
8
+ const TO_PUBLIC = '@nx/web';
9
+ const TO_INTERNAL = '@nx/web/internal';
10
+ // Symbols exported from `@nx/web`'s public entry (packages/web/index.ts).
11
+ // A named import/export of one of these from `@nx/web/src/*` is routed to
12
+ // the public `@nx/web` entry; everything else goes to `@nx/web/internal`.
13
+ const PUBLIC_SYMBOLS = new Set([
14
+ 'applicationGenerator',
15
+ 'webInitGenerator',
16
+ 'webStaticServeGenerator',
17
+ ]);
18
+ // Methods on `jest` and `vi` that take a module specifier as their first arg.
19
+ const MOCK_HELPER_METHODS = new Set([
20
+ 'mock',
21
+ 'unmock',
22
+ 'doMock',
23
+ 'dontMock',
24
+ 'requireActual',
25
+ 'requireMock',
26
+ 'importActual',
27
+ 'importMock',
28
+ ]);
29
+ let ts;
30
+ async function rewriteInternalSubpathImports(tree) {
31
+ let touchedCount = 0;
32
+ (0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
33
+ if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
34
+ return;
35
+ }
36
+ const original = tree.read(filePath, 'utf-8');
37
+ if (!original || !original.includes(FROM_PREFIX)) {
38
+ return;
39
+ }
40
+ const updated = rewriteSubpathImports(original);
41
+ if (updated !== original) {
42
+ tree.write(filePath, updated);
43
+ touchedCount += 1;
44
+ }
45
+ });
46
+ if (touchedCount > 0) {
47
+ devkit_1.logger.info(`Rewrote @nx/web/src/* imports in ${touchedCount} file(s) ` +
48
+ `(public symbols to @nx/web, internals to @nx/web/internal).`);
49
+ }
50
+ await (0, devkit_1.formatFiles)(tree);
51
+ }
52
+ function rewriteSubpathImports(source) {
53
+ ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
54
+ const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
55
+ /* setParentNodes */ true, ts.ScriptKind.TSX);
56
+ const changes = [];
57
+ for (const stmt of sourceFile.statements) {
58
+ if (ts.isImportDeclaration(stmt)) {
59
+ collectImportRewrite(sourceFile, stmt, changes);
60
+ }
61
+ else if (ts.isExportDeclaration(stmt)) {
62
+ collectExportRewrite(sourceFile, stmt, changes);
63
+ }
64
+ }
65
+ collectCallExpressionRewrites(sourceFile, changes);
66
+ return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
67
+ }
68
+ function isSubpathSpecifier(node) {
69
+ return ts.isStringLiteral(node) && node.text.startsWith(FROM_PREFIX);
70
+ }
71
+ function collectImportRewrite(sourceFile, stmt, changes) {
72
+ if (!isSubpathSpecifier(stmt.moduleSpecifier)) {
73
+ return;
74
+ }
75
+ const clause = stmt.importClause;
76
+ // Pure named imports (`import { a, b } from '...'`) can be split by symbol.
77
+ // A default or namespace import grabs the whole module, so it can't be
78
+ // split — route it wholesale to the internal entry.
79
+ if (clause &&
80
+ !clause.name &&
81
+ clause.namedBindings &&
82
+ ts.isNamedImports(clause.namedBindings)) {
83
+ rewriteNamedDeclaration(sourceFile, stmt, stmt.moduleSpecifier, clause.isTypeOnly, clause.namedBindings.elements, 'import', changes);
84
+ return;
85
+ }
86
+ replaceSpecifier(sourceFile, stmt.moduleSpecifier, TO_INTERNAL, changes);
87
+ }
88
+ function collectExportRewrite(sourceFile, stmt, changes) {
89
+ if (!stmt.moduleSpecifier || !isSubpathSpecifier(stmt.moduleSpecifier)) {
90
+ return;
91
+ }
92
+ // `export { a, b } from '...'` can be split; `export * from '...'` cannot.
93
+ if (stmt.exportClause && ts.isNamedExports(stmt.exportClause)) {
94
+ rewriteNamedDeclaration(sourceFile, stmt, stmt.moduleSpecifier, stmt.isTypeOnly, stmt.exportClause.elements, 'export', changes);
95
+ return;
96
+ }
97
+ replaceSpecifier(sourceFile, stmt.moduleSpecifier, TO_INTERNAL, changes);
98
+ }
99
+ /**
100
+ * Partition the named bindings of an import/export declaration into the ones
101
+ * that resolve to `@nx/web`'s public entry and the ones that don't. If both
102
+ * groups are non-empty, the single declaration is split into two.
103
+ */
104
+ function rewriteNamedDeclaration(sourceFile, decl, specifier, isTypeOnly, elements, keyword, changes) {
105
+ const publicEls = [];
106
+ const internalEls = [];
107
+ for (const el of elements) {
108
+ // `propertyName` is the original name in `orig as alias`; fall back to
109
+ // `name` for the plain `orig` form.
110
+ const importedName = (el.propertyName ?? el.name).text;
111
+ (PUBLIC_SYMBOLS.has(importedName) ? publicEls : internalEls).push(el);
112
+ }
113
+ if (publicEls.length === 0) {
114
+ replaceSpecifier(sourceFile, specifier, TO_INTERNAL, changes);
115
+ return;
116
+ }
117
+ if (internalEls.length === 0) {
118
+ replaceSpecifier(sourceFile, specifier, TO_PUBLIC, changes);
119
+ return;
120
+ }
121
+ // Mixed — replace the whole declaration with one statement per target.
122
+ const quote = sourceFile.text.charAt(specifier.getStart(sourceFile));
123
+ const start = decl.getStart(sourceFile);
124
+ const end = decl.getEnd();
125
+ const semicolon = sourceFile.text.charAt(end - 1) === ';' ? ';' : '';
126
+ const prefix = isTypeOnly ? `${keyword} type` : keyword;
127
+ const render = (els, target) => `${prefix} { ${els
128
+ .map((el) => el.getText(sourceFile))
129
+ .join(', ')} } from ${quote}${target}${quote}${semicolon}`;
130
+ changes.push({ type: devkit_1.ChangeType.Delete, start, length: end - start }, {
131
+ type: devkit_1.ChangeType.Insert,
132
+ index: start,
133
+ text: `${render(publicEls, TO_PUBLIC)}\n${render(internalEls, TO_INTERNAL)}`,
134
+ });
135
+ }
136
+ function collectCallExpressionRewrites(sourceFile, changes) {
137
+ const visit = (node) => {
138
+ if (ts.isCallExpression(node) &&
139
+ shouldRewriteCallExpression(node) &&
140
+ node.arguments.length >= 1 &&
141
+ isSubpathSpecifier(node.arguments[0])) {
142
+ // `require(...)`, dynamic `import(...)` and `jest.mock(...)` reference
143
+ // the module as a whole and can't be symbol-split, so they go to the
144
+ // internal entry.
145
+ replaceSpecifier(sourceFile, node.arguments[0], TO_INTERNAL, changes);
146
+ }
147
+ else if (ts.isImportTypeNode(node)) {
148
+ // `typeof import('...')` parses as an `ImportTypeNode`, not a
149
+ // CallExpression — its argument is `LiteralTypeNode<StringLiteral>`.
150
+ // The whole module is referenced, so it can't be symbol-split.
151
+ const literal = getImportTypeStringLiteral(node);
152
+ if (literal && literal.text.startsWith(FROM_PREFIX)) {
153
+ replaceSpecifier(sourceFile, literal, TO_INTERNAL, changes);
154
+ }
155
+ }
156
+ ts.forEachChild(node, visit);
157
+ };
158
+ visit(sourceFile);
159
+ }
160
+ function getImportTypeStringLiteral(node) {
161
+ const arg = node.argument;
162
+ if (arg && ts.isLiteralTypeNode(arg) && ts.isStringLiteral(arg.literal)) {
163
+ return arg.literal;
164
+ }
165
+ return undefined;
166
+ }
167
+ function shouldRewriteCallExpression(call) {
168
+ const callee = call.expression;
169
+ // `require('...')`
170
+ if (ts.isIdentifier(callee) && callee.text === 'require')
171
+ return true;
172
+ // dynamic `import('...')` (runtime form parses as a CallExpression whose
173
+ // callee is the `import` keyword). The `typeof import('...')` type-position
174
+ // form is an `ImportTypeNode` (handled in `collectCallExpressionRewrites`).
175
+ if (callee.kind === ts.SyntaxKind.ImportKeyword)
176
+ return true;
177
+ // `jest.mock(...)` / `vi.mock(...)` and friends.
178
+ if (ts.isPropertyAccessExpression(callee)) {
179
+ const obj = callee.expression;
180
+ if (ts.isIdentifier(obj) &&
181
+ (obj.text === 'jest' || obj.text === 'vi') &&
182
+ MOCK_HELPER_METHODS.has(callee.name.text)) {
183
+ return true;
184
+ }
185
+ }
186
+ return false;
187
+ }
188
+ function replaceSpecifier(sourceFile, literal, target, changes) {
189
+ const start = literal.getStart(sourceFile);
190
+ const end = literal.getEnd();
191
+ const quote = sourceFile.text.charAt(start);
192
+ changes.push({ type: devkit_1.ChangeType.Delete, start, length: end - start }, {
193
+ type: devkit_1.ChangeType.Insert,
194
+ index: start,
195
+ text: `${quote}${target}${quote}`,
196
+ });
197
+ }
@@ -0,0 +1 @@
1
+ export { WebpackNxBuildCoordinationPlugin } from '@nx/webpack/internal';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebpackNxBuildCoordinationPlugin = void 0;
4
+ var internal_1 = require("@nx/webpack/internal");
5
+ Object.defineProperty(exports, "WebpackNxBuildCoordinationPlugin", { enumerable: true, get: function () { return internal_1.WebpackNxBuildCoordinationPlugin; } });
@@ -0,0 +1 @@
1
+ export { findUp, findAllNodeModules, deleteOutputDir, } from '@nx/webpack/internal';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteOutputDir = exports.findAllNodeModules = exports.findUp = void 0;
4
+ var internal_1 = require("@nx/webpack/internal");
5
+ Object.defineProperty(exports, "findUp", { enumerable: true, get: function () { return internal_1.findUp; } });
6
+ Object.defineProperty(exports, "findAllNodeModules", { enumerable: true, get: function () { return internal_1.findAllNodeModules; } });
7
+ Object.defineProperty(exports, "deleteOutputDir", { enumerable: true, get: function () { return internal_1.deleteOutputDir; } });
@@ -1,3 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export declare function hasVitePlugin(tree: Tree): boolean;
3
- //# sourceMappingURL=has-vite-plugin.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export declare function hasWebpackPlugin(tree: Tree): boolean;
3
- //# sourceMappingURL=has-webpack-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ export { normalizeOptions, normalizePluginPath } from '@nx/webpack';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizePluginPath = exports.normalizeOptions = void 0;
4
+ var webpack_1 = require("@nx/webpack");
5
+ Object.defineProperty(exports, "normalizeOptions", { enumerable: true, get: function () { return webpack_1.normalizeOptions; } });
6
+ Object.defineProperty(exports, "normalizePluginPath", { enumerable: true, get: function () { return webpack_1.normalizePluginPath; } });
@@ -2,4 +2,3 @@ export declare const nxVersion: any;
2
2
  export declare const swcLoaderVersion = "0.1.15";
3
3
  export declare const typesNodeVersion = "^22.0.0";
4
4
  export declare const tsLibVersion = "^2.3.0";
5
- //# sourceMappingURL=versions.d.ts.map
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tsLibVersion = exports.typesNodeVersion = exports.swcLoaderVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = require('../../package.json').version;
4
+ const path_1 = require("path");
5
+ exports.nxVersion = require((0, path_1.join)('@nx/web', 'package.json')).version;
5
6
  exports.swcLoaderVersion = '0.1.15';
6
7
  exports.typesNodeVersion = '^22.0.0';
7
8
  exports.tsLibVersion = '^2.3.0';
@@ -3,4 +3,3 @@ export declare function waitForPortOpen(port: number, options?: {
3
3
  retries?: number;
4
4
  retryDelay?: number;
5
5
  }): Promise<void>;
6
- //# sourceMappingURL=wait-for-port-open.d.ts.map
package/executors.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "builders": {
3
3
  "file-server": {
4
- "implementation": "./src/executors/file-server/compat",
5
- "schema": "./src/executors/file-server/schema.json",
4
+ "implementation": "./dist/src/executors/file-server/compat",
5
+ "schema": "./dist/src/executors/file-server/schema.json",
6
6
  "description": "Serve a web application from a folder."
7
7
  }
8
8
  },
9
9
  "executors": {
10
10
  "file-server": {
11
- "implementation": "./src/executors/file-server/file-server.impl",
12
- "schema": "./src/executors/file-server/schema.json",
11
+ "implementation": "./dist/src/executors/file-server/file-server.impl",
12
+ "schema": "./dist/src/executors/file-server/schema.json",
13
13
  "description": "Serve a web application from a folder."
14
14
  }
15
15
  }
package/generators.json CHANGED
@@ -4,21 +4,21 @@
4
4
  "extends": ["@nx/workspace"],
5
5
  "generators": {
6
6
  "init": {
7
- "factory": "./src/generators/init/init#webInitGenerator",
8
- "schema": "./src/generators/init/schema.json",
7
+ "factory": "./dist/src/generators/init/init#webInitGenerator",
8
+ "schema": "./dist/src/generators/init/schema.json",
9
9
  "description": "Add `@nrwl/web` to a project.",
10
10
  "hidden": true
11
11
  },
12
12
  "application": {
13
- "factory": "./src/generators/application/application#applicationGeneratorInternal",
14
- "schema": "./src/generators/application/schema.json",
13
+ "factory": "./dist/src/generators/application/application#applicationGeneratorInternal",
14
+ "schema": "./dist/src/generators/application/schema.json",
15
15
  "aliases": ["app"],
16
16
  "x-type": "application",
17
17
  "description": "Create an web application."
18
18
  },
19
19
  "static-config": {
20
- "factory": "./src/generators/static-serve/static-serve-configuration",
21
- "schema": "./src/generators/static-serve/schema.json",
20
+ "factory": "./dist/src/generators/static-serve/static-serve-configuration",
21
+ "schema": "./dist/src/generators/static-serve/schema.json",
22
22
  "description": "Add a new static-serve target to a project."
23
23
  }
24
24
  }
package/migrations.json CHANGED
@@ -1,4 +1,10 @@
1
1
  {
2
- "generators": {},
2
+ "generators": {
3
+ "rewrite-web-internal-subpath-imports": {
4
+ "version": "23.0.0-beta.25",
5
+ "description": "Rewrites `@nx/web/src/*` subpath imports now that the `./src/*` subpath is no longer exposed by `@nx/web`'s exports map. Named imports/exports of public symbols are routed to `@nx/web` and the rest to the new `@nx/web/internal` entry; `require`, dynamic `import` and `jest.mock` calls reference the whole module and are routed to `@nx/web/internal`.",
6
+ "implementation": "./dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports"
7
+ }
8
+ },
3
9
  "packageJsonUpdates": {}
4
10
  }
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@nx/web",
3
- "version": "23.0.0-beta.23",
3
+ "version": "23.0.0-beta.24",
4
4
  "private": false,
5
+ "type": "commonjs",
6
+ "files": [
7
+ "dist",
8
+ "!dist/tsconfig.tsbuildinfo",
9
+ "!dist/spec",
10
+ "migrations.json",
11
+ "executors.json",
12
+ "generators.json"
13
+ ],
5
14
  "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Playwright, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
6
15
  "repository": {
7
16
  "type": "git",
@@ -16,9 +25,18 @@
16
25
  "CLI",
17
26
  "Front-end"
18
27
  ],
19
- "main": "./index.js",
20
- "type": "commonjs",
21
- "types": "./index.d.ts",
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "typesVersions": {
31
+ "*": {
32
+ "babel": [
33
+ "dist/babel.d.ts"
34
+ ],
35
+ "internal": [
36
+ "dist/internal.d.ts"
37
+ ]
38
+ }
39
+ },
22
40
  "author": "Victor Savkin",
23
41
  "license": "MIT",
24
42
  "bugs": {
@@ -31,25 +49,46 @@
31
49
  "requirements": {},
32
50
  "migrations": "./migrations.json"
33
51
  },
52
+ "exports": {
53
+ ".": {
54
+ "@nx/nx-source": "./index.ts",
55
+ "types": "./dist/index.d.ts",
56
+ "default": "./dist/index.js"
57
+ },
58
+ "./package.json": "./package.json",
59
+ "./migrations.json": "./migrations.json",
60
+ "./generators.json": "./generators.json",
61
+ "./executors.json": "./executors.json",
62
+ "./babel": {
63
+ "@nx/nx-source": "./babel.ts",
64
+ "types": "./dist/babel.d.ts",
65
+ "default": "./dist/babel.js"
66
+ },
67
+ "./internal": {
68
+ "@nx/nx-source": "./internal.ts",
69
+ "types": "./dist/internal.d.ts",
70
+ "default": "./dist/internal.js"
71
+ }
72
+ },
34
73
  "dependencies": {
35
74
  "detect-port": "^2.1.0",
36
75
  "http-server": "^14.1.0",
37
76
  "picocolors": "^1.1.0",
38
77
  "tslib": "^2.3.0",
39
- "@nx/devkit": "23.0.0-beta.23",
40
- "@nx/js": "23.0.0-beta.23"
78
+ "@nx/js": "23.0.0-beta.24",
79
+ "@nx/devkit": "23.0.0-beta.24"
41
80
  },
42
81
  "devDependencies": {
43
- "nx": "23.0.0-beta.23",
44
- "@nx/vitest": "23.0.0-beta.23"
82
+ "@nx/vitest": "23.0.0-beta.24",
83
+ "nx": "23.0.0-beta.24"
45
84
  },
46
85
  "peerDependencies": {
47
- "@nx/cypress": "23.0.0-beta.23",
48
- "@nx/eslint": "23.0.0-beta.23",
49
- "@nx/jest": "23.0.0-beta.23",
50
- "@nx/playwright": "23.0.0-beta.23",
51
- "@nx/vite": "23.0.0-beta.23",
52
- "@nx/webpack": "23.0.0-beta.23"
86
+ "@nx/cypress": "23.0.0-beta.24",
87
+ "@nx/eslint": "23.0.0-beta.24",
88
+ "@nx/jest": "23.0.0-beta.24",
89
+ "@nx/vite": "23.0.0-beta.24",
90
+ "@nx/playwright": "23.0.0-beta.24",
91
+ "@nx/webpack": "23.0.0-beta.24"
53
92
  },
54
93
  "peerDependenciesMeta": {
55
94
  "@nx/cypress": {
package/babel.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const nxJsBabelPreset: any;
2
- //# sourceMappingURL=babel.d.ts.map
package/babel.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel.d.ts","sourceRoot":"","sources":["../../../packages/web/babel.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,eAAe,KAA0B,CAAC"}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/executors/file-server/compat.ts"],"names":[],"mappings":";AAGA,wBAA6C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/executors/file-server/file-server.impl.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAgJlC,wBAA+B,kBAAkB,CAC/C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe;;;;aA4HM,OAAO;YAUtC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/generators/application/application.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,iBAAiB,EASjB,IAAI,EAKL,MAAM,YAAY,CAAC;AAoBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAkPlC,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAKpE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAmW5E;AA0DD,eAAe,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAkBlC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAWhE;AAED,eAAe,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"static-serve-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/generators/static-serve/static-serve-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAGpB,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AASD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,oBAAoB,iBAI9B;AA4FD,eAAe,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { WebpackNxBuildCoordinationPlugin } from '@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin';
2
- //# sourceMappingURL=webpack-nx-build-coordination-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpack-nx-build-coordination-plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/plugins/webpack-nx-build-coordination-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,8DAA8D,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebpackNxBuildCoordinationPlugin = void 0;
4
- var webpack_nx_build_coordination_plugin_1 = require("@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin");
5
- Object.defineProperty(exports, "WebpackNxBuildCoordinationPlugin", { enumerable: true, get: function () { return webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin; } });
package/src/utils/fs.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from '@nx/webpack/src/utils/fs';
2
- //# sourceMappingURL=fs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/fs.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
package/src/utils/fs.js DELETED
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("@nx/webpack/src/utils/fs"), exports);
@@ -1 +0,0 @@
1
- {"version":3,"file":"has-vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/has-vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,WAOvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"has-webpack-plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/has-webpack-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,WAO1C"}
@@ -1,2 +0,0 @@
1
- export * from '@nx/webpack/src/executors/webpack/lib/normalize-options';
2
- //# sourceMappingURL=normalize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/normalize.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("@nx/webpack/src/executors/webpack/lib/normalize-options"), exports);
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,YAAY,WAAW,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"wait-for-port-open.d.ts","sourceRoot":"","sources":["../../../../../packages/web/src/utils/wait-for-port-open.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GACrE,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes