@nx/node 16.4.0-beta.1 → 16.4.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/node",
3
- "version": "16.4.0-beta.1",
3
+ "version": "16.4.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Node Plugin for Nx contains generators and executors to manage Node applications within an Nx workspace.",
6
6
  "repository": {
@@ -31,17 +31,17 @@
31
31
  "migrations": "./migrations.json"
32
32
  },
33
33
  "dependencies": {
34
- "@nrwl/node": "16.4.0-beta.1",
35
- "@nx/devkit": "16.4.0-beta.1",
36
- "@nx/jest": "16.4.0-beta.1",
37
- "@nx/js": "16.4.0-beta.1",
38
- "@nx/linter": "16.4.0-beta.1",
39
- "@nx/workspace": "16.4.0-beta.1",
34
+ "@nrwl/node": "16.4.0-beta.2",
35
+ "@nx/devkit": "16.4.0-beta.2",
36
+ "@nx/jest": "16.4.0-beta.2",
37
+ "@nx/js": "16.4.0-beta.2",
38
+ "@nx/linter": "16.4.0-beta.2",
39
+ "@nx/workspace": "16.4.0-beta.2",
40
40
  "tslib": "^2.3.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
45
  "types": "./index.d.ts",
46
- "gitHead": "1c4fb934b607f0d93bb23bff2cf0f39b31a8fa43"
46
+ "gitHead": "abb2678056668cc8beaaf9c5ebc2a2e6ad487173"
47
47
  }
@@ -222,7 +222,7 @@ function applicationGenerator(tree, schema) {
222
222
  tasks.push(lintTask);
223
223
  }
224
224
  if (options.unitTestRunner === 'jest') {
225
- const jestTask = yield (0, jest_1.jestProjectGenerator)(tree, Object.assign(Object.assign({}, options), { project: options.name, setupFile: 'none', skipSerializers: true, supportTsx: options.js, testEnvironment: 'node', compiler: 'tsc', skipFormat: true }));
225
+ const jestTask = yield (0, jest_1.jestProjectGenerator)(tree, Object.assign(Object.assign({}, options), { project: options.name, setupFile: 'none', skipSerializers: true, supportTsx: options.js, testEnvironment: 'node', compiler: options.swcJest ? 'swc' : 'tsc', skipFormat: true }));
226
226
  tasks.push(jestTask);
227
227
  }
228
228
  else {
@@ -10,6 +10,8 @@ export interface Schema {
10
10
  linter?: Linter;
11
11
  tags?: string;
12
12
  frontendProject?: string;
13
+ swcJest?: boolean;
14
+ /** @deprecated use `swcJest` instead */
13
15
  babelJest?: boolean;
14
16
  js?: boolean;
15
17
  pascalCaseFiles?: boolean;
@@ -54,11 +54,17 @@
54
54
  "description": "Frontend project that needs to access this application. This sets up proxy configuration.",
55
55
  "x-priority": "important"
56
56
  },
57
- "babelJest": {
57
+ "swcJest": {
58
58
  "type": "boolean",
59
- "description": "Use `babel` instead of `ts-jest`.",
59
+ "description": "Use `@swc/jest` instead `ts-jest` for faster test compilation.",
60
60
  "default": false
61
61
  },
62
+ "babelJest": {
63
+ "type": "boolean",
64
+ "description": "Use `babel` instead `ts-jest`.",
65
+ "default": false,
66
+ "x-deprecated": "Use --swcJest instead for faster compilation"
67
+ },
62
68
  "pascalCaseFiles": {
63
69
  "type": "boolean",
64
70
  "description": "Use pascal case file names.",
@@ -1,2 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
- export default function update(host: Tree): Promise<void>;
2
+ export default function update(tree: Tree): Promise<void>;
@@ -2,19 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
- function update(host) {
6
- var _a, _b;
5
+ const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
+ function update(tree) {
7
7
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- const projects = (0, devkit_1.getProjects)(host);
9
- for (const [name, config] of projects.entries()) {
10
- if (((_b = (_a = config === null || config === void 0 ? void 0 : config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/node:webpack') {
11
- config.targets.build.executor = '@nrwl/webpack:webpack';
12
- config.targets.build.options.target = 'node';
13
- config.targets.build.options.compiler = 'tsc';
14
- (0, devkit_1.updateProjectConfiguration)(host, name, config);
15
- }
16
- }
17
- yield (0, devkit_1.formatFiles)(host);
8
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/node:webpack', (options, projectName, targetName) => {
9
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
10
+ projectConfig.targets[targetName].executor = '@nrwl/webpack:webpack';
11
+ projectConfig.targets[targetName].options.compiler = 'tsc';
12
+ projectConfig.targets[targetName].options.target = 'node';
13
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
14
+ });
15
+ yield (0, devkit_1.formatFiles)(tree);
18
16
  });
19
17
  }
20
18
  exports.default = update;
@@ -1,2 +1,2 @@
1
1
  import { Tree } from '@nx/devkit';
2
- export default function update(host: Tree): Promise<void>;
2
+ export default function update(tree: Tree): Promise<void>;
@@ -2,19 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
- function update(host) {
6
- var _a, _b;
5
+ const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
+ function update(tree) {
7
7
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- const projects = (0, devkit_1.getProjects)(host);
9
- for (const [name, config] of projects.entries()) {
10
- if (((_b = (_a = config === null || config === void 0 ? void 0 : config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/node:webpack') {
11
- config.targets.build.executor = '@nx/webpack:webpack';
12
- config.targets.build.options.target = 'node';
13
- config.targets.build.options.compiler = 'tsc';
14
- (0, devkit_1.updateProjectConfiguration)(host, name, config);
15
- }
16
- }
17
- yield (0, devkit_1.formatFiles)(host);
8
+ const migrateProject = (options, projectName, targetName) => {
9
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
10
+ projectConfig.targets[targetName].executor = '@nx/webpack:webpack';
11
+ projectConfig.targets[targetName].options.compiler = 'tsc';
12
+ projectConfig.targets[targetName].options.target = 'node';
13
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
14
+ };
15
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/node:webpack', migrateProject);
16
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/node:webpack', migrateProject);
17
+ yield (0, devkit_1.formatFiles)(tree);
18
18
  });
19
19
  }
20
20
  exports.default = update;