@nx/web 20.5.0-rc.3 → 20.5.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/web",
|
|
3
|
-
"version": "20.5.0
|
|
3
|
+
"version": "20.5.0",
|
|
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": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"http-server": "^14.1.0",
|
|
36
36
|
"picocolors": "^1.1.0",
|
|
37
37
|
"tslib": "^2.3.0",
|
|
38
|
-
"@nx/devkit": "20.5.0
|
|
39
|
-
"@nx/js": "20.5.0
|
|
38
|
+
"@nx/devkit": "20.5.0",
|
|
39
|
+
"@nx/js": "20.5.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
@@ -16,13 +16,11 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
|
16
16
|
const static_serve_configuration_1 = require("../static-serve/static-serve-configuration");
|
|
17
17
|
const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
|
|
18
18
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
19
|
-
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
20
19
|
function createApplicationFiles(tree, options) {
|
|
21
20
|
const rootTsConfigPath = (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot);
|
|
22
21
|
if (options.bundler === 'vite') {
|
|
23
22
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files/app-vite'), options.appProjectRoot, {
|
|
24
23
|
...options,
|
|
25
|
-
...(0, devkit_1.names)(options.name),
|
|
26
24
|
tmpl: '',
|
|
27
25
|
offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
|
|
28
26
|
rootTsConfigPath,
|
|
@@ -32,7 +30,6 @@ function createApplicationFiles(tree, options) {
|
|
|
32
30
|
const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
|
33
31
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files/app-webpack'), options.appProjectRoot, {
|
|
34
32
|
...options,
|
|
35
|
-
...(0, devkit_1.names)(options.name),
|
|
36
33
|
tmpl: '',
|
|
37
34
|
offsetFromRoot: rootOffset,
|
|
38
35
|
rootTsConfigPath,
|
|
@@ -154,16 +151,19 @@ async function setupBundler(tree, options) {
|
|
|
154
151
|
}
|
|
155
152
|
async function addProject(tree, options) {
|
|
156
153
|
if (options.isUsingTsSolutionConfig) {
|
|
157
|
-
|
|
158
|
-
name:
|
|
154
|
+
const packageJson = {
|
|
155
|
+
name: options.importPath,
|
|
159
156
|
version: '0.0.1',
|
|
160
157
|
private: true,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
158
|
+
};
|
|
159
|
+
if (options.projectName !== options.importPath) {
|
|
160
|
+
packageJson.nx = { name: options.projectName };
|
|
161
|
+
}
|
|
162
|
+
if (options.parsedTags?.length) {
|
|
163
|
+
packageJson.nx ??= {};
|
|
164
|
+
packageJson.nx.tags = options.parsedTags;
|
|
165
|
+
}
|
|
166
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
169
|
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
@@ -316,8 +316,6 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
316
316
|
version: '0.0.1',
|
|
317
317
|
private: true,
|
|
318
318
|
nx: {
|
|
319
|
-
projectType: 'application',
|
|
320
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
321
319
|
implicitDependencies: [options.projectName],
|
|
322
320
|
},
|
|
323
321
|
});
|
|
@@ -373,8 +371,6 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
373
371
|
version: '0.0.1',
|
|
374
372
|
private: true,
|
|
375
373
|
nx: {
|
|
376
|
-
projectType: 'application',
|
|
377
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
378
374
|
implicitDependencies: [options.projectName],
|
|
379
375
|
},
|
|
380
376
|
});
|
|
@@ -462,8 +458,8 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
462
458
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
463
459
|
}
|
|
464
460
|
async function normalizeOptions(host, options) {
|
|
465
|
-
await (0, project_name_and_root_utils_1.
|
|
466
|
-
const { projectName
|
|
461
|
+
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
|
|
462
|
+
const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
467
463
|
name: options.name,
|
|
468
464
|
projectType: 'application',
|
|
469
465
|
directory: options.directory,
|
|
@@ -472,9 +468,10 @@ async function normalizeOptions(host, options) {
|
|
|
472
468
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
473
469
|
nxJson.useInferencePlugins !== false;
|
|
474
470
|
options.addPlugin ??= addPluginDefault;
|
|
471
|
+
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
472
|
+
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
475
473
|
const e2eProjectName = `${appProjectName}-e2e`;
|
|
476
474
|
const e2eProjectRoot = `${appProjectRoot}-e2e`;
|
|
477
|
-
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
478
475
|
const npmScope = (0, get_npm_scope_1.getNpmScope)(host);
|
|
479
476
|
const parsedTags = options.tags
|
|
480
477
|
? options.tags.split(',').map((s) => s.trim())
|
|
@@ -486,17 +483,16 @@ async function normalizeOptions(host, options) {
|
|
|
486
483
|
return {
|
|
487
484
|
...options,
|
|
488
485
|
prefix: options.prefix ?? npmScope ?? 'app',
|
|
489
|
-
name: (0, devkit_1.names)(options.name).fileName,
|
|
490
486
|
compiler: options.compiler ?? 'babel',
|
|
491
487
|
bundler: options.bundler ?? 'webpack',
|
|
492
|
-
projectName:
|
|
493
|
-
|
|
494
|
-
: appProjectName,
|
|
488
|
+
projectName: appProjectName,
|
|
489
|
+
importPath,
|
|
495
490
|
strict: options.strict ?? true,
|
|
496
491
|
appProjectRoot,
|
|
497
492
|
e2eProjectRoot,
|
|
498
493
|
e2eProjectName,
|
|
499
494
|
parsedTags,
|
|
495
|
+
names: (0, devkit_1.names)(projectName),
|
|
500
496
|
isUsingTsSolutionConfig,
|
|
501
497
|
};
|
|
502
498
|
}
|