@nx/web 18.0.0-beta.0 → 18.0.0-beta.2

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": "18.0.0-beta.0",
3
+ "version": "18.0.0-beta.2",
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, 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": {
@@ -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": "18.0.0-beta.0",
38
- "@nx/js": "18.0.0-beta.0",
39
- "@nrwl/web": "18.0.0-beta.0"
37
+ "@nx/devkit": "18.0.0-beta.2",
38
+ "@nx/js": "18.0.0-beta.2",
39
+ "@nrwl/web": "18.0.0-beta.2"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -11,6 +11,7 @@ const init_1 = require("../init/init");
11
11
  const get_npm_scope_1 = require("@nx/js/src/utils/package-json/get-npm-scope");
12
12
  const has_webpack_plugin_1 = require("../../utils/has-webpack-plugin");
13
13
  const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
14
+ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
14
15
  function createApplicationFiles(tree, options) {
15
16
  if (options.bundler === 'vite') {
16
17
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files/app-vite'), options.appProjectRoot, {
@@ -30,6 +31,7 @@ function createApplicationFiles(tree, options) {
30
31
  rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot),
31
32
  webpackPluginOptions: (0, has_webpack_plugin_1.hasWebpackPlugin)(tree)
32
33
  ? {
34
+ compiler: options.compiler,
33
35
  target: 'web',
34
36
  outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot != '.'
35
37
  ? options.appProjectRoot
@@ -66,6 +68,7 @@ async function setupBundler(tree, options) {
66
68
  devServer: true,
67
69
  webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
68
70
  skipFormat: true,
71
+ addPlugin: options.addPlugin,
69
72
  });
70
73
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
71
74
  if (project.targets.build) {
@@ -140,6 +143,7 @@ function setDefaults(tree, options) {
140
143
  }
141
144
  async function applicationGenerator(host, schema) {
142
145
  return await applicationGeneratorInternal(host, {
146
+ addPlugin: false,
143
147
  projectNameAndRootFormat: 'derived',
144
148
  ...schema,
145
149
  });
@@ -177,6 +181,7 @@ async function applicationGeneratorInternal(host, schema) {
177
181
  includeVitest: options.unitTestRunner === 'vitest',
178
182
  inSourceTests: options.inSourceTests,
179
183
  skipFormat: true,
184
+ addPlugin: options.addPlugin,
180
185
  });
181
186
  tasks.push(viteTask);
182
187
  createOrEditViteConfig(host, {
@@ -194,6 +199,7 @@ async function applicationGeneratorInternal(host, schema) {
194
199
  coverageProvider: 'v8',
195
200
  inSourceTests: options.inSourceTests,
196
201
  skipFormat: true,
202
+ addPlugin: options.addPlugin,
197
203
  });
198
204
  tasks.push(vitestTask);
199
205
  createOrEditViteConfig(host, {
@@ -218,6 +224,7 @@ async function applicationGeneratorInternal(host, schema) {
218
224
  unitTestRunner: options.unitTestRunner,
219
225
  skipFormat: true,
220
226
  setParserOptionsProject: options.setParserOptionsProject,
227
+ addPlugin: options.addPlugin,
221
228
  });
222
229
  tasks.push(lintTask);
223
230
  }
@@ -260,6 +267,7 @@ async function applicationGeneratorInternal(host, schema) {
260
267
  setParserOptionsProject: options.setParserOptionsProject,
261
268
  webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
262
269
  webServerAddress: 'http://localhost:4200',
270
+ addPlugin: options.addPlugin,
263
271
  });
264
272
  tasks.push(playwrightTask);
265
273
  }
@@ -271,6 +279,7 @@ async function applicationGeneratorInternal(host, schema) {
271
279
  setupFile: 'web-components',
272
280
  compiler: options.compiler,
273
281
  skipFormat: true,
282
+ addPlugin: options.addPlugin,
274
283
  });
275
284
  tasks.push(jestTask);
276
285
  }
@@ -296,6 +305,9 @@ async function applicationGeneratorInternal(host, schema) {
296
305
  if (!schema.skipFormat) {
297
306
  await (0, devkit_1.formatFiles)(host);
298
307
  }
308
+ tasks.push(() => {
309
+ (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
310
+ });
299
311
  return (0, devkit_1.runTasksInSerial)(...tasks);
300
312
  }
301
313
  exports.applicationGeneratorInternal = applicationGeneratorInternal;
@@ -308,6 +320,7 @@ async function normalizeOptions(host, options) {
308
320
  callingGenerator: '@nx/web:application',
309
321
  });
310
322
  options.projectNameAndRootFormat = projectNameAndRootFormat;
323
+ options.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false';
311
324
  const e2eProjectName = `${appProjectName}-e2e`;
312
325
  const e2eProjectRoot = `${appProjectRoot}-e2e`;
313
326
  const npmScope = (0, get_npm_scope_1.getNpmScope)(host);
@@ -12,6 +12,7 @@ module.exports = {
12
12
  plugins: [
13
13
  new NxWebpackPlugin({
14
14
  tsConfig: '<%= webpackPluginOptions.tsConfig %>',
15
+ compiler: '<%= webpackPluginOptions.compiler %>',
15
16
  main: '<%= webpackPluginOptions.main %>',
16
17
  index: '<%= webpackPluginOptions.index %>',
17
18
  baseHref: '<%= webpackPluginOptions.baseHref %>',
@@ -17,4 +17,5 @@ export interface Schema {
17
17
  linter?: Linter;
18
18
  standaloneConfig?: boolean;
19
19
  setParserOptionsProject?: boolean;
20
+ addPlugin?: boolean;
20
21
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "cli": "nx",
4
4
  "$id": "NxWebApp",
5
5
  "title": "Create a Web Application for Nx",
@@ -39,11 +39,11 @@
39
39
  },
40
40
  {
41
41
  "value": "scss",
42
- "label": "SASS(.scss) [ http://sass-lang.com ]"
42
+ "label": "SASS(.scss) [ https://sass-lang.com ]"
43
43
  },
44
44
  {
45
45
  "value": "less",
46
- "label": "LESS [ http://lesscss.org ]"
46
+ "label": "LESS [ https://lesscss.org ]"
47
47
  }
48
48
  ]
49
49
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWebInit",
4
4
  "cli": "nx",
5
5
  "title": "Init Web Plugin",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
2
+ "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxWebStaticServe",
4
4
  "cli": "nx",
5
5
  "title": "Static Serve Configuration",