@nx/web 19.0.0-beta.1 → 19.0.0-beta.11

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/migrations.json CHANGED
@@ -1,29 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "add-babel-inputs": {
4
- "cli": "nx",
5
- "version": "15.0.0-beta.0",
6
- "description": "Adds babel.config.json to the hash of all tasks",
7
- "factory": "./src/migrations/update-15-0-0/add-babel-inputs"
8
- },
9
- "update-rollup-executor": {
10
- "cli": "nx",
11
- "version": "15.0.0-beta.1",
12
- "description": "Update usages of rollup executors to @nrwl/rollup",
13
- "factory": "./src/migrations/update-15-0-0/update-rollup-executor"
14
- },
15
- "update-babel-preset": {
16
- "cli": "nx",
17
- "version": "15.5.4-beta.0",
18
- "description": "Update `@nrwl/web/babel` preset to `@nrwl/js/babel` for projects that have a .babelrc file.",
19
- "factory": "./src/migrations/update-15-5-4/update-babel-preset"
20
- },
21
- "add-dropped-dependencies": {
22
- "cli": "nx",
23
- "version": "15.9.1",
24
- "description": "Add @nrwl/linter, @nrwl/cypress, @nrwl/jest, @nrwl/rollup if they are used",
25
- "factory": "./src/migrations/update-15-9-1/add-dropped-dependencies"
26
- },
27
3
  "update-16-0-0-add-nx-packages": {
28
4
  "cli": "nx",
29
5
  "version": "16.0.0-beta.1",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nx/web",
3
- "version": "19.0.0-beta.1",
3
+ "version": "19.0.0-beta.11",
4
4
  "private": false,
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, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
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": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/nrwl/nx.git",
@@ -34,9 +34,9 @@
34
34
  "detect-port": "^1.5.1",
35
35
  "http-server": "^14.1.0",
36
36
  "tslib": "^2.3.0",
37
- "@nx/devkit": "19.0.0-beta.1",
38
- "@nx/js": "19.0.0-beta.1",
39
- "@nrwl/web": "19.0.0-beta.1"
37
+ "@nx/devkit": "19.0.0-beta.11",
38
+ "@nx/js": "19.0.0-beta.11",
39
+ "@nrwl/web": "19.0.0-beta.11"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -255,6 +255,7 @@ async function applicationGeneratorInternal(host, schema) {
255
255
  sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
256
256
  projectType: 'application',
257
257
  targets: {},
258
+ tags: [],
258
259
  implicitDependencies: [options.projectName],
259
260
  });
260
261
  const playwrightTask = await playwrightConfigGenerator(host, {
@@ -363,7 +364,7 @@ async function normalizeOptions(host, options) {
363
364
  options.style = options.style || 'css';
364
365
  options.linter = options.linter || 'eslint';
365
366
  options.unitTestRunner = options.unitTestRunner || 'jest';
366
- options.e2eTestRunner = options.e2eTestRunner || 'cypress';
367
+ options.e2eTestRunner = options.e2eTestRunner || 'playwright';
367
368
  return {
368
369
  ...options,
369
370
  prefix: options.prefix ?? npmScope ?? 'app',
@@ -1,5 +1,5 @@
1
1
  <% if (webpackPluginOptions) { %>
2
- const { NxWebpackPlugin } = require('@nx/webpack');
2
+ const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
3
3
  const { join } = require('path');
4
4
 
5
5
  module.exports = {
@@ -10,7 +10,7 @@ module.exports = {
10
10
  port: 4200
11
11
  },
12
12
  plugins: [
13
- new NxWebpackPlugin({
13
+ new NxAppWebpackPlugin({
14
14
  tsConfig: '<%= webpackPluginOptions.tsConfig %>',
15
15
  compiler: '<%= webpackPluginOptions.compiler %>',
16
16
  main: '<%= webpackPluginOptions.main %>',
@@ -87,10 +87,10 @@
87
87
  },
88
88
  "e2eTestRunner": {
89
89
  "type": "string",
90
- "enum": ["cypress", "playwright", "none"],
90
+ "enum": ["playwright", "cypress", "none"],
91
91
  "x-prompt": "Which E2E test runner would you like to use?",
92
92
  "description": "Test runner to use for end to end (e2e) tests",
93
- "default": "cypress"
93
+ "default": "playwright"
94
94
  },
95
95
  "tags": {
96
96
  "type": "string",
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const add_babel_inputs_1 = require("@nx/js/src/utils/add-babel-inputs");
5
- async function default_1(tree) {
6
- (0, add_babel_inputs_1.addBabelInputs)(tree);
7
- await (0, devkit_1.formatFiles)(tree);
8
- }
9
- exports.default = default_1;
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(host: Tree): Promise<void>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- async function update(host) {
5
- const projects = (0, devkit_1.getProjects)(host);
6
- for (const [name, config] of projects.entries()) {
7
- let updated = false;
8
- if (config?.targets?.build?.executor === '@nrwl/web:rollup') {
9
- config.targets.build.executor = '@nrwl/rollup:rollup';
10
- updated = true;
11
- }
12
- if (config?.targets?.build?.options?.formats?.includes('umd')) {
13
- config.targets.build.options.formats =
14
- config.targets.build.options.formats.reduce((acc, x) => {
15
- const format = x === 'umd' ? 'cjs' : x;
16
- if (format === 'cjs') {
17
- if (!acc.includes('cjs'))
18
- acc.push(format);
19
- }
20
- else {
21
- acc.push(format);
22
- }
23
- return acc;
24
- }, []);
25
- updated = true;
26
- }
27
- if (updated) {
28
- (0, devkit_1.updateProjectConfiguration)(host, name, config);
29
- }
30
- }
31
- await (0, devkit_1.formatFiles)(host);
32
- }
33
- exports.default = update;
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(tree: Tree): Promise<void>;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const versions_1 = require("../../utils/versions");
5
- /* Updates @nrwl/web/babel to @nrwl/js/babel because web package is no longer necessary to use webpack/rollup + babel. */
6
- async function update(tree) {
7
- // Add `@nrwl/js` in case it was missing before.
8
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
9
- '@nrwl/js': versions_1.nxVersion,
10
- });
11
- const projects = (0, devkit_1.getProjects)(tree);
12
- projects.forEach((config, name) => {
13
- const babelrcPath = (0, devkit_1.joinPathFragments)(config.root, '.babelrc');
14
- if (!tree.exists(babelrcPath))
15
- return;
16
- const babelrc = (0, devkit_1.readJson)(tree, babelrcPath);
17
- const idx = babelrc?.presets?.findIndex((p) => typeof p === 'string'
18
- ? p === '@nrwl/web/babel'
19
- : p[0] === '@nrwl/web/babel');
20
- if (idx === -1)
21
- return;
22
- const preset = babelrc.presets[idx];
23
- if (typeof preset === 'string') {
24
- babelrc.presets.splice(idx, 1, '@nrwl/js/babel');
25
- }
26
- else if (Array.isArray(preset)) {
27
- babelrc.presets.splice(idx, 1, ['@nrwl/js/babel', preset[1]]);
28
- }
29
- (0, devkit_1.writeJson)(tree, babelrcPath, babelrc);
30
- });
31
- }
32
- exports.default = update;
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function addDroppedDependencies(tree: Tree): Promise<void>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- async function addDroppedDependencies(tree) {
5
- const devDependencies = {};
6
- const droppedDependencies = [
7
- '@nrwl/linter',
8
- '@nrwl/cypress',
9
- '@nrwl/jest',
10
- '@nrwl/rollup',
11
- ];
12
- const projects = (0, devkit_1.getProjects)(tree);
13
- for (const [_, projectConfiguration] of projects) {
14
- for (const [_, targetConfiguration] of Object.entries(projectConfiguration.targets ?? {})) {
15
- for (const droppedDependency of droppedDependencies) {
16
- if (targetConfiguration?.['executor']?.startsWith(droppedDependency + ':')) {
17
- devDependencies[droppedDependency] = devkit_1.NX_VERSION;
18
- }
19
- }
20
- }
21
- }
22
- const nxJson = (0, devkit_1.readNxJson)(tree);
23
- for (const [_, targetConfiguration] of Object.entries(nxJson?.targetDefaults ?? {})) {
24
- for (const droppedDependency of droppedDependencies) {
25
- if (targetConfiguration?.['executor']?.startsWith(droppedDependency + ':')) {
26
- devDependencies[droppedDependency] = devkit_1.NX_VERSION;
27
- }
28
- }
29
- }
30
- if (Object.keys(devDependencies).length > 0) {
31
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
32
- }
33
- await (0, devkit_1.formatFiles)(tree);
34
- }
35
- exports.default = addDroppedDependencies;