@nx/node 19.0.0-beta.5 → 19.0.0-beta.7

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": "19.0.0-beta.5",
3
+ "version": "19.0.0-beta.7",
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": "19.0.0-beta.5",
35
- "@nx/jest": "19.0.0-beta.5",
36
- "@nx/js": "19.0.0-beta.5",
37
- "@nx/eslint": "19.0.0-beta.5",
38
- "@nrwl/node": "19.0.0-beta.5"
34
+ "@nx/devkit": "19.0.0-beta.7",
35
+ "@nx/jest": "19.0.0-beta.7",
36
+ "@nx/js": "19.0.0-beta.7",
37
+ "@nx/eslint": "19.0.0-beta.7",
38
+ "@nrwl/node": "19.0.0-beta.7"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -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 = {
@@ -7,7 +7,7 @@ module.exports = {
7
7
  path: join(__dirname, '<%= offset %><%= webpackPluginOptions.outputPath %>'),
8
8
  },
9
9
  plugins: [
10
- new NxWebpackPlugin({
10
+ new NxAppWebpackPlugin({
11
11
  target: 'node',
12
12
  compiler: 'tsc',
13
13
  main: '<%= webpackPluginOptions.main %>',
@@ -34,9 +34,35 @@ async function e2eProjectGeneratorInternal(host, _options) {
34
34
  jestConfig: `${options.e2eProjectRoot}/jest.config.ts`,
35
35
  passWithNoTests: true,
36
36
  },
37
+ dependsOn: [`${options.project}:build`],
37
38
  },
38
39
  },
39
40
  });
41
+ // TODO(@nicholas): Find a better way to get build target
42
+ // We remove the 'test' target from the e2e project because it is not needed
43
+ // The 'e2e' target is the one that should run the tests for the e2e project
44
+ const nxJson = (0, devkit_1.readNxJson)(host);
45
+ const hasPlugin = nxJson.plugins?.some((p) => {
46
+ if (typeof p !== 'string' && p.plugin === '@nx/jest/plugin') {
47
+ return true;
48
+ }
49
+ });
50
+ if (hasPlugin) {
51
+ (0, devkit_1.updateJson)(host, 'nx.json', (json) => {
52
+ return {
53
+ ...json,
54
+ plugins: json.plugins?.map((p) => {
55
+ if (typeof p !== 'string' && p.plugin === '@nx/jest/plugin') {
56
+ return {
57
+ ...p,
58
+ exclude: [...(p.exclude || []), `${options.e2eProjectRoot}/**/*`],
59
+ };
60
+ }
61
+ return p;
62
+ }),
63
+ };
64
+ });
65
+ }
40
66
  if (options.projectType === 'server') {
41
67
  (0, devkit_1.generateFiles)(host, path.join(__dirname, 'files/server/common'), options.e2eProjectRoot, {
42
68
  ...options,