@nx/web 23.0.0-beta.12 → 23.0.0-beta.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/web",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"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
6
|
"repository": {
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"http-server": "^14.1.0",
|
|
37
37
|
"picocolors": "^1.1.0",
|
|
38
38
|
"tslib": "^2.3.0",
|
|
39
|
-
"@nx/devkit": "23.0.0-beta.
|
|
40
|
-
"@nx/js": "23.0.0-beta.
|
|
39
|
+
"@nx/devkit": "23.0.0-beta.14",
|
|
40
|
+
"@nx/js": "23.0.0-beta.14"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"nx": "23.0.0-beta.
|
|
44
|
-
"@nx/vitest": "23.0.0-beta.
|
|
43
|
+
"nx": "23.0.0-beta.14",
|
|
44
|
+
"@nx/vitest": "23.0.0-beta.14"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@nx/cypress": "23.0.0-beta.
|
|
48
|
-
"@nx/eslint": "23.0.0-beta.
|
|
49
|
-
"@nx/jest": "23.0.0-beta.
|
|
50
|
-
"@nx/playwright": "23.0.0-beta.
|
|
51
|
-
"@nx/vite": "23.0.0-beta.
|
|
52
|
-
"@nx/webpack": "23.0.0-beta.
|
|
47
|
+
"@nx/cypress": "23.0.0-beta.14",
|
|
48
|
+
"@nx/eslint": "23.0.0-beta.14",
|
|
49
|
+
"@nx/jest": "23.0.0-beta.14",
|
|
50
|
+
"@nx/playwright": "23.0.0-beta.14",
|
|
51
|
+
"@nx/vite": "23.0.0-beta.14",
|
|
52
|
+
"@nx/webpack": "23.0.0-beta.14"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@nx/cypress": {
|
|
@@ -12,7 +12,7 @@ const path_1 = require("path");
|
|
|
12
12
|
const package_json_1 = require("nx/src/utils/package-json");
|
|
13
13
|
const client_1 = require("nx/src/daemon/client/client");
|
|
14
14
|
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
15
|
-
const
|
|
15
|
+
const internal_2 = require("@nx/js/internal");
|
|
16
16
|
const detect_port_1 = tslib_1.__importDefault(require("detect-port"));
|
|
17
17
|
// platform specific command name
|
|
18
18
|
const pmCmd = (0, os_1.platform)() === 'win32' ? `npx.cmd` : 'npx';
|
|
@@ -86,7 +86,7 @@ function getBuildTargetOutputPath(options, context) {
|
|
|
86
86
|
projectName: project.data.name,
|
|
87
87
|
projectRoot: project.data.root,
|
|
88
88
|
});
|
|
89
|
-
outputPath = (0,
|
|
89
|
+
outputPath = (0, internal_2.stripGlobToBaseDir)(outputPath);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -102,7 +102,7 @@ function createFileWatcher(project, changeHandler) {
|
|
|
102
102
|
return client_1.daemonClient.registerFileWatcher({
|
|
103
103
|
watchProjects: project ? [project] : 'all',
|
|
104
104
|
includeGlobalWorkspaceFiles: true,
|
|
105
|
-
|
|
105
|
+
includeDependencies: true,
|
|
106
106
|
}, async (error, val) => {
|
|
107
107
|
if (error === 'reconnecting') {
|
|
108
108
|
// Silent - daemon restarts automatically on lockfile changes
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,8BAqW5E;AA0DD,eAAe,oBAAoB,CAAC"}
|
|
@@ -6,14 +6,12 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
|
-
const
|
|
9
|
+
const internal_2 = require("@nx/js/internal");
|
|
10
10
|
const path_1 = require("path");
|
|
11
|
-
const
|
|
11
|
+
const versions_1 = require("../../utils/versions");
|
|
12
12
|
const init_1 = require("../init/init");
|
|
13
|
-
const get_npm_scope_1 = require("@nx/js/src/utils/package-json/get-npm-scope");
|
|
14
13
|
const has_webpack_plugin_1 = require("../../utils/has-webpack-plugin");
|
|
15
14
|
const static_serve_configuration_1 = tslib_1.__importDefault(require("../static-serve/static-serve-configuration"));
|
|
16
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
17
15
|
function createApplicationFiles(tree, options) {
|
|
18
16
|
const rootTsConfigPath = (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot);
|
|
19
17
|
if (options.bundler === 'vite') {
|
|
@@ -85,7 +83,7 @@ async function setupBundler(tree, options) {
|
|
|
85
83
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
86
84
|
];
|
|
87
85
|
if (options.bundler === 'webpack') {
|
|
88
|
-
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/webpack',
|
|
86
|
+
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
|
|
89
87
|
await configurationGenerator(tree, {
|
|
90
88
|
target: 'web',
|
|
91
89
|
project: options.projectName,
|
|
@@ -196,7 +194,7 @@ async function applicationGenerator(host, schema) {
|
|
|
196
194
|
async function applicationGeneratorInternal(host, schema) {
|
|
197
195
|
const options = await normalizeOptions(host, schema);
|
|
198
196
|
if (options.isUsingTsSolutionConfig) {
|
|
199
|
-
await (0,
|
|
197
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
|
|
200
198
|
}
|
|
201
199
|
const tasks = [];
|
|
202
200
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
@@ -216,7 +214,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
216
214
|
}
|
|
217
215
|
createApplicationFiles(host, options);
|
|
218
216
|
if (options.linter === 'eslint') {
|
|
219
|
-
const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint',
|
|
217
|
+
const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
220
218
|
const lintTask = await lintProjectGenerator(host, {
|
|
221
219
|
linter: options.linter,
|
|
222
220
|
project: options.projectName,
|
|
@@ -236,7 +234,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
236
234
|
}
|
|
237
235
|
}
|
|
238
236
|
if (options.bundler === 'vite') {
|
|
239
|
-
const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite',
|
|
237
|
+
const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
240
238
|
// We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development.
|
|
241
239
|
// See: https://vite.dev/guide/env-and-mode.html
|
|
242
240
|
if (host.exists((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/environments'))) {
|
|
@@ -261,8 +259,8 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
261
259
|
}, false);
|
|
262
260
|
}
|
|
263
261
|
if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') {
|
|
264
|
-
const { createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite',
|
|
265
|
-
(0, devkit_1.ensurePackage)('@nx/vitest',
|
|
262
|
+
const { createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
263
|
+
(0, devkit_1.ensurePackage)('@nx/vitest', versions_1.nxVersion);
|
|
266
264
|
const { configurationGenerator } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/vitest/generators')));
|
|
267
265
|
const vitestTask = await configurationGenerator(host, {
|
|
268
266
|
uiFramework: 'none',
|
|
@@ -310,15 +308,15 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
310
308
|
e2eDevServerTarget: `${options.projectName}:serve`,
|
|
311
309
|
};
|
|
312
310
|
if (options.bundler === 'webpack') {
|
|
313
|
-
const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack',
|
|
311
|
+
const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
|
|
314
312
|
e2eWebServerInfo = await getWebpackE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `webpack.config.js`), options.addPlugin, 4200);
|
|
315
313
|
}
|
|
316
314
|
else if (options.bundler === 'vite') {
|
|
317
|
-
const { getViteE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite',
|
|
315
|
+
const { getViteE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
318
316
|
e2eWebServerInfo = await getViteE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.ts`), options.addPlugin, 4200);
|
|
319
317
|
}
|
|
320
318
|
if (options.e2eTestRunner === 'cypress') {
|
|
321
|
-
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress',
|
|
319
|
+
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
322
320
|
const packageJson = {
|
|
323
321
|
name: options.e2eProjectName,
|
|
324
322
|
version: '0.0.1',
|
|
@@ -359,7 +357,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
359
357
|
tasks.push(cypressTask);
|
|
360
358
|
}
|
|
361
359
|
else if (options.e2eTestRunner === 'playwright') {
|
|
362
|
-
const { configurationGenerator: playwrightConfigGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright',
|
|
360
|
+
const { configurationGenerator: playwrightConfigGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
363
361
|
const packageJson = {
|
|
364
362
|
name: options.e2eProjectName,
|
|
365
363
|
version: '0.0.1',
|
|
@@ -398,7 +396,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
398
396
|
tasks.push(playwrightTask);
|
|
399
397
|
}
|
|
400
398
|
if (options.unitTestRunner === 'jest') {
|
|
401
|
-
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest',
|
|
399
|
+
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
|
|
402
400
|
const jestTask = await configurationGenerator(host, {
|
|
403
401
|
project: options.projectName,
|
|
404
402
|
skipSerializers: true,
|
|
@@ -418,7 +416,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
418
416
|
target: 'es2016',
|
|
419
417
|
},
|
|
420
418
|
});
|
|
421
|
-
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@swc/core':
|
|
419
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@swc/core': internal_2.swcCoreVersion, 'swc-loader': versions_1.swcLoaderVersion });
|
|
422
420
|
tasks.push(installTask);
|
|
423
421
|
}
|
|
424
422
|
else {
|
|
@@ -427,8 +425,8 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
427
425
|
});
|
|
428
426
|
}
|
|
429
427
|
setDefaults(host, options);
|
|
430
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib:
|
|
431
|
-
(0,
|
|
428
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, { '@types/node': versions_1.typesNodeVersion }));
|
|
429
|
+
(0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
|
|
432
430
|
module: 'esnext',
|
|
433
431
|
moduleResolution: 'bundler',
|
|
434
432
|
}, options.linter === 'eslint'
|
|
@@ -453,11 +451,11 @@ async function normalizeOptions(host, options) {
|
|
|
453
451
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
454
452
|
nxJson.useInferencePlugins !== false;
|
|
455
453
|
options.addPlugin ??= addPluginDefault;
|
|
456
|
-
const isUsingTsSolutionConfig = (0,
|
|
454
|
+
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
457
455
|
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
458
456
|
const e2eProjectName = `${appProjectName}-e2e`;
|
|
459
457
|
const e2eProjectRoot = `${appProjectRoot}-e2e`;
|
|
460
|
-
const npmScope = (0,
|
|
458
|
+
const npmScope = (0, internal_2.getNpmScope)(host);
|
|
461
459
|
const parsedTags = options.tags
|
|
462
460
|
? options.tags.split(',').map((s) => s.trim())
|
|
463
461
|
: [];
|