@nx/node 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/migrations.json CHANGED
@@ -34,6 +34,15 @@
34
34
  "alwaysAddToPackageJson": false
35
35
  }
36
36
  }
37
+ },
38
+ "17.3.1": {
39
+ "version": "17.3.1-beta.0",
40
+ "packages": {
41
+ "axios": {
42
+ "version": "^1.6.0",
43
+ "alwaysAddToPackageJson": false
44
+ }
45
+ }
37
46
  }
38
47
  }
39
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/node",
3
- "version": "18.0.0-beta.0",
3
+ "version": "18.0.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Node Plugin for Nx contains generators to manage Node applications within an Nx workspace.",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "tslib": "^2.3.0",
34
- "@nx/devkit": "18.0.0-beta.0",
35
- "@nx/jest": "18.0.0-beta.0",
36
- "@nx/js": "18.0.0-beta.0",
37
- "@nx/eslint": "18.0.0-beta.0",
38
- "@nrwl/node": "18.0.0-beta.0"
34
+ "@nx/devkit": "18.0.0-beta.2",
35
+ "@nx/jest": "18.0.0-beta.2",
36
+ "@nx/js": "18.0.0-beta.2",
37
+ "@nx/eslint": "18.0.0-beta.2",
38
+ "@nrwl/node": "18.0.0-beta.2"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -5,6 +5,6 @@ export interface NormalizedSchema extends Schema {
5
5
  parsedTags: string[];
6
6
  }
7
7
  export declare function addLintingToApplication(tree: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
8
- export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<any>;
9
- export declare function applicationGeneratorInternal(tree: Tree, schema: Schema): Promise<any>;
8
+ export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
9
+ export declare function applicationGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
10
10
  export default applicationGenerator;
@@ -14,6 +14,7 @@ const init_1 = require("../init/init");
14
14
  const setup_docker_1 = require("../setup-docker/setup-docker");
15
15
  const has_webpack_plugin_1 = require("../../utils/has-webpack-plugin");
16
16
  const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
17
+ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
17
18
  function getWebpackBuildConfig(project, options) {
18
19
  return {
19
20
  executor: `@nx/webpack:webpack`,
@@ -122,7 +123,7 @@ function addAppFiles(tree, options) {
122
123
  outputPath: (0, devkit_1.joinPathFragments)('dist', options.rootProject ? options.name : options.appProjectRoot),
123
124
  main: './src/main' + (options.js ? '.js' : '.ts'),
124
125
  tsConfig: './tsconfig.app.json',
125
- assets: ['./assets'],
126
+ assets: ['./src/assets'],
126
127
  }
127
128
  : null,
128
129
  });
@@ -188,6 +189,7 @@ async function addLintingToApplication(tree, options) {
188
189
  skipFormat: true,
189
190
  setParserOptionsProject: options.setParserOptionsProject,
190
191
  rootProject: options.rootProject,
192
+ addPlugin: options.addPlugin,
191
193
  });
192
194
  return lintTask;
193
195
  }
@@ -261,6 +263,7 @@ function updateTsConfigOptions(tree, options) {
261
263
  }
262
264
  async function applicationGenerator(tree, schema) {
263
265
  return await applicationGeneratorInternal(tree, {
266
+ addPlugin: false,
264
267
  projectNameAndRootFormat: 'derived',
265
268
  ...schema,
266
269
  });
@@ -270,8 +273,18 @@ async function applicationGeneratorInternal(tree, schema) {
270
273
  const options = await normalizeOptions(tree, schema);
271
274
  const tasks = [];
272
275
  if (options.framework === 'nest') {
276
+ // nx-ignore-next-line
273
277
  const { applicationGenerator } = (0, devkit_1.ensurePackage)('@nx/nest', versions_2.nxVersion);
274
- return await applicationGenerator(tree, { ...options, skipFormat: true });
278
+ const nestTasks = await applicationGenerator(tree, {
279
+ ...options,
280
+ skipFormat: true,
281
+ });
282
+ return (0, devkit_1.runTasksInSerial)(...[
283
+ nestTasks,
284
+ () => {
285
+ (0, log_show_project_command_1.logShowProjectCommand)(options.name);
286
+ },
287
+ ]);
275
288
  }
276
289
  const jsInitTask = await (0, js_1.initGenerator)(tree, {
277
290
  ...schema,
@@ -291,11 +304,14 @@ async function applicationGeneratorInternal(tree, schema) {
291
304
  const webpackInitTask = await webpackInitGenerator(tree, {
292
305
  skipPackageJson: options.skipPackageJson,
293
306
  skipFormat: true,
307
+ addPlugin: options.addPlugin,
294
308
  });
295
309
  tasks.push(webpackInitTask);
296
310
  if (!options.skipPackageJson) {
297
311
  const { ensureDependencies } = await Promise.resolve().then(() => require('@nx/webpack/src/utils/ensure-dependencies'));
298
- tasks.push(ensureDependencies(tree, { uiFramework: 'react' }));
312
+ tasks.push(ensureDependencies(tree, {
313
+ uiFramework: options.isNest ? 'none' : 'react',
314
+ }));
299
315
  }
300
316
  }
301
317
  addAppFiles(tree, options);
@@ -353,6 +369,9 @@ async function applicationGeneratorInternal(tree, schema) {
353
369
  if (!options.skipFormat) {
354
370
  await (0, devkit_1.formatFiles)(tree);
355
371
  }
372
+ tasks.push(() => {
373
+ (0, log_show_project_command_1.logShowProjectCommand)(options.name);
374
+ });
356
375
  return (0, devkit_1.runTasksInSerial)(...tasks);
357
376
  }
358
377
  exports.applicationGeneratorInternal = applicationGeneratorInternal;
@@ -373,6 +392,7 @@ async function normalizeOptions(host, options) {
373
392
  ? options.tags.split(',').map((s) => s.trim())
374
393
  : [];
375
394
  return {
395
+ addPlugin: process.env.NX_ADD_PLUGINS !== 'false',
376
396
  ...options,
377
397
  name: appProjectName,
378
398
  frontendProject: options.frontendProject
@@ -25,6 +25,7 @@ export interface Schema {
25
25
  rootProject?: boolean;
26
26
  docker?: boolean;
27
27
  isNest?: boolean;
28
+ addPlugin?: boolean;
28
29
  }
29
30
 
30
31
  export type NodeJsFrameWorks = 'express' | 'koa' | 'fastify' | 'nest' | 'none';
@@ -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": "SchematicsNxNodeApp",
5
5
  "title": "Nx Application Options Schema",
@@ -8,8 +8,10 @@ const global_eslint_config_1 = require("@nx/eslint/src/generators/init/global-es
8
8
  const path = require("path");
9
9
  const versions_1 = require("../../utils/versions");
10
10
  const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
11
+ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
11
12
  async function e2eProjectGenerator(host, options) {
12
13
  return await e2eProjectGeneratorInternal(host, {
14
+ addPlugin: false,
13
15
  projectNameAndRootFormat: 'derived',
14
16
  ...options,
15
17
  });
@@ -19,6 +21,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
19
21
  const tasks = [];
20
22
  const options = await normalizeOptions(host, _options);
21
23
  const appProject = (0, devkit_1.readProjectConfiguration)(host, options.project);
24
+ // TODO(@ndcunningham): This is broken.. the outputs are wrong.. and this isn't using the jest generator
22
25
  (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
23
26
  root: options.e2eProjectRoot,
24
27
  implicitDependencies: [options.project],
@@ -74,6 +77,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
74
77
  setParserOptionsProject: false,
75
78
  skipPackageJson: false,
76
79
  rootProject: options.rootProject,
80
+ addPlugin: options.addPlugin,
77
81
  });
78
82
  tasks.push(linterTask);
79
83
  if (options.rootProject && (0, eslint_file_1.isEslintConfigSupported)(host)) {
@@ -87,6 +91,9 @@ async function e2eProjectGeneratorInternal(host, _options) {
87
91
  if (!options.skipFormat) {
88
92
  await (0, devkit_1.formatFiles)(host);
89
93
  }
94
+ tasks.push(() => {
95
+ (0, log_show_project_command_1.logShowProjectCommand)(options.e2eProjectName);
96
+ });
90
97
  return (0, devkit_1.runTasksInSerial)(...tasks);
91
98
  }
92
99
  exports.e2eProjectGeneratorInternal = e2eProjectGeneratorInternal;
@@ -102,6 +109,7 @@ async function normalizeOptions(tree, options) {
102
109
  callingGenerator: null,
103
110
  });
104
111
  return {
112
+ addPlugin: process.env.NX_ADD_PLUGINS !== 'false',
105
113
  ...options,
106
114
  e2eProjectRoot,
107
115
  e2eProjectName,
@@ -11,4 +11,5 @@ export interface Schema {
11
11
  rootProject?: boolean;
12
12
  isNest?: boolean;
13
13
  skipFormat?: boolean;
14
+ addPlugin?: boolean;
14
15
  }
@@ -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": "SchematicsNxNodeE2eProject",
5
5
  "title": "Node E2E Project Generator",
@@ -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": "NxNodeInit",
5
5
  "title": "Init Node Plugin",
@@ -12,6 +12,7 @@ const init_1 = require("../init/init");
12
12
  const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
13
13
  async function libraryGenerator(tree, schema) {
14
14
  return await libraryGeneratorInternal(tree, {
15
+ addPlugin: false,
15
16
  projectNameAndRootFormat: 'derived',
16
17
  ...schema,
17
18
  });
@@ -29,7 +30,7 @@ async function libraryGeneratorInternal(tree, schema) {
29
30
  throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
30
31
  }
31
32
  const libraryInstall = await (0, js_1.libraryGenerator)(tree, {
32
- ...schema,
33
+ ...options,
33
34
  bundler: schema.buildable ? 'tsc' : 'none',
34
35
  includeBabelRc: schema.babelJest,
35
36
  importPath: options.importPath,
@@ -61,6 +62,7 @@ async function normalizeOptions(tree, options) {
61
62
  callingGenerator: '@nx/node:library',
62
63
  });
63
64
  options.projectNameAndRootFormat = projectNameAndRootFormat;
65
+ options.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false';
64
66
  const fileName = getCaseAwareFileName({
65
67
  fileName: options.simpleModuleName
66
68
  ? projectNames.projectSimpleName
@@ -23,4 +23,5 @@ export interface Schema {
23
23
  standaloneConfig?: boolean;
24
24
  setParserOptionsProject?: boolean;
25
25
  compiler: 'tsc' | 'swc';
26
+ addPlugin?: boolean;
26
27
  }
@@ -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": "NxNodeLibrary",
5
5
  "title": "Create a Node Library for Nx",
@@ -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": "SchematicsNxSetupDocker",
5
5
  "title": "Nx Node Docker Options Schema",
@@ -9,4 +9,4 @@ export declare const fastifyVersion = "~4.13.0";
9
9
  export declare const fastifyAutoloadVersion = "~5.7.1";
10
10
  export declare const fastifySensibleVersion = "~5.2.0";
11
11
  export declare const fastifyPluginVersion = "~4.5.0";
12
- export declare const axiosVersion = "^1.0.0";
12
+ export declare const axiosVersion = "^1.6.0";
@@ -12,4 +12,4 @@ exports.fastifyVersion = '~4.13.0';
12
12
  exports.fastifyAutoloadVersion = '~5.7.1';
13
13
  exports.fastifySensibleVersion = '~5.2.0';
14
14
  exports.fastifyPluginVersion = '~4.5.0';
15
- exports.axiosVersion = '^1.0.0';
15
+ exports.axiosVersion = '^1.6.0';