@nx/js 22.0.1 → 22.0.3

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/js",
3
- "version": "22.0.1",
3
+ "version": "22.0.3",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "22.0.1",
43
- "@nx/workspace": "22.0.1",
42
+ "@nx/devkit": "22.0.3",
43
+ "@nx/workspace": "22.0.3",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^3.1.0",
@@ -54,13 +54,13 @@
54
54
  "npm-run-path": "^4.0.1",
55
55
  "picocolors": "^1.1.0",
56
56
  "picomatch": "4.0.2",
57
- "semver": "^7.5.3",
57
+ "semver": "^7.6.3",
58
58
  "source-map-support": "0.5.19",
59
59
  "tinyglobby": "^0.2.12",
60
60
  "tslib": "^2.3.0"
61
61
  },
62
62
  "devDependencies": {
63
- "nx": "22.0.1"
63
+ "nx": "22.0.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "verdaccio": "^6.0.5"
@@ -1 +1 @@
1
- {"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAMrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;AAmTD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;AAoTD,eAAe,iBAAiB,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verdaccioExecutor = verdaccioExecutor;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const child_process_1 = require("child_process");
6
7
  const detectPort = require("detect-port");
7
8
  const node_fs_1 = require("node:fs");
@@ -85,7 +86,9 @@ function startVerdaccio(options, workspaceRoot) {
85
86
  childProcess.on('disconnect', (err) => {
86
87
  reject(err);
87
88
  });
88
- childProcess.on('exit', (code) => {
89
+ childProcess.on('exit', (code, signal) => {
90
+ if (code === null)
91
+ code = (0, internal_1.signalToCode)(signal);
89
92
  if (code === 0) {
90
93
  resolve(code);
91
94
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- <% if(js) {%>const { readFileSync } = require('fs')<% } else { %>import { readFileSync } from 'fs';<% } %>
2
+ <% if(ext === 'js' || ext === 'cts') {%>const { readFileSync } = require('fs')<% } else { %>import { readFileSync } from 'fs';<% } %>
3
3
 
4
4
  // Reading the SWC compilation config and remove the "exclude"
5
5
  // for the test files to be compiled by SWC
@@ -18,7 +18,7 @@ if (swcJestConfig.swcrc === undefined) {
18
18
  // jest needs EsModule Interop to find the default exported setup/teardown functions
19
19
  // swcJestConfig.module.noInterop = false;
20
20
 
21
- <% if(js) {%>module.exports =<% } else { %>export default<% } %> {
21
+ <% if(ext === 'js' || ext === 'cts') {%>module.exports =<% } else { %>export default<% } %> {
22
22
  displayName: '<%= project %>',
23
23
  preset: '<%= offsetFromRoot %><%= jestPreset %>',
24
24
  transform: {
@@ -520,14 +520,14 @@ async function addJest(tree, options) {
520
520
  function replaceJestConfig(tree, options) {
521
521
  const filesDir = (0, path_1.join)(__dirname, './files/jest-config');
522
522
  // the existing config has to be deleted otherwise the new config won't overwrite it
523
- const existingJestConfig = (0, devkit_1.joinPathFragments)(filesDir, `jest.config.${options.js ? 'js' : 'ts'}`);
523
+ const existingJestConfig = (0, devkit_1.joinPathFragments)(filesDir, `jest.config.${options.js ? 'js' : 'cts'}`);
524
524
  if (tree.exists(existingJestConfig)) {
525
525
  tree.delete(existingJestConfig);
526
526
  }
527
527
  const jestPreset = findRootJestPreset(tree) ?? 'jest.presets.js';
528
528
  // replace with JS:SWC specific jest config
529
529
  (0, devkit_1.generateFiles)(tree, filesDir, options.projectRoot, {
530
- ext: options.js ? 'js' : 'ts',
530
+ ext: options.js ? 'js' : 'cts',
531
531
  jestPreset,
532
532
  js: !!options.js,
533
533
  project: options.name,
@@ -1 +1 @@
1
- {"version":3,"file":"start-local-registry.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/jest/start-local-registry.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,aAAa,GACd,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,iBAK0B,IAAI,EA4E9B;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"start-local-registry.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/jest/start-local-registry.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,aAAa,GACd,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,iBAK0B,IAAI,EA6E9B;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.startLocalRegistry = startLocalRegistry;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const child_process_1 = require("child_process");
5
6
  /**
6
7
  * This function is used to start a local registry for testing purposes.
@@ -61,7 +62,9 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
61
62
  console.log('local registry error', err);
62
63
  reject(err);
63
64
  });
64
- childProcess.on('exit', (code) => {
65
+ childProcess.on('exit', (code, signal) => {
66
+ if (code === null)
67
+ code = (0, internal_1.signalToCode)(signal);
65
68
  console.log('local registry exit', code);
66
69
  if (code !== 0) {
67
70
  reject(code);
@@ -5,7 +5,7 @@ exports.addSwcConfig = addSwcConfig;
5
5
  exports.addSwcTestConfig = addSwcTestConfig;
6
6
  const path_1 = require("path");
7
7
  exports.defaultExclude = [
8
- 'jest.config.ts',
8
+ 'jest.config.[ct]s',
9
9
  '.*\\.spec.tsx?$',
10
10
  '.*\\.test.tsx?$',
11
11
  './src/jest-setup.ts$',