@nx/js 17.0.0-beta.8 → 17.0.0-rc.1

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/babel.d.ts CHANGED
@@ -4,6 +4,9 @@ export interface NxWebBabelPresetOptions {
4
4
  decoratorsBeforeExport?: boolean;
5
5
  legacy?: boolean;
6
6
  };
7
+ loose?: boolean;
8
+ /** @deprecated Use `loose` option instead of `classProperties.loose`
9
+ */
7
10
  classProperties?: {
8
11
  loose?: boolean;
9
12
  };
package/babel.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const path_1 = require("path");
4
+ const devkit_1 = require("@nx/devkit");
4
5
  module.exports = function (api, options = {}) {
5
6
  api.assertVersion(7);
6
7
  const isModern = api.caller((caller) => caller?.isModern);
@@ -9,9 +10,13 @@ module.exports = function (api, options = {}) {
9
10
  // This is set by `@nx/rollup:rollup` executor
10
11
  const isNxPackage = api.caller((caller) => caller?.isNxPackage);
11
12
  const emitDecoratorMetadata = api.caller((caller) => caller?.emitDecoratorMetadata ?? true);
12
- // Determine settings for `@babel/plugin-proposal-class-properties`,
13
+ // Determine settings for `@babel//babel-plugin-transform-class-properties`,
13
14
  // so that we can sync the `loose` option with `@babel/preset-env`.
14
- const classProperties = options.classProperties ?? { loose: true };
15
+ // TODO(v18): Remove classProperties since it's no longer needed, now that the class props transform is in preset-env.
16
+ const loose = options.classProperties?.loose ?? options.loose ?? true;
17
+ if (options.classProperties) {
18
+ devkit_1.logger.warn(`Use =\`loose\` option instead of \`classProperties.loose\`. The \`classProperties\` option will be removed in Nx 18`);
19
+ }
15
20
  return {
16
21
  presets: [
17
22
  // Support module/nomodule pattern.
@@ -33,7 +38,7 @@ module.exports = function (api, options = {}) {
33
38
  // Exclude transforms that make all code slower
34
39
  exclude: ['transform-typeof-symbol'],
35
40
  // This must match the setting for `@babel/plugin-proposal-class-properties`
36
- loose: classProperties.loose,
41
+ loose,
37
42
  },
38
43
  ],
39
44
  [
@@ -65,10 +70,6 @@ module.exports = function (api, options = {}) {
65
70
  require.resolve('@babel/plugin-proposal-decorators'),
66
71
  options.decorators ?? { legacy: true },
67
72
  ],
68
- [
69
- require.resolve('@babel/plugin-proposal-class-properties'),
70
- classProperties,
71
- ],
72
73
  ].filter(Boolean),
73
74
  overrides: [
74
75
  // Convert `const enum` to `enum`. The former cannot be supported by babel
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "17.0.0-beta.8",
3
+ "version": "17.0.0-rc.1",
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": {
@@ -31,7 +31,6 @@
31
31
  "executors": "./executors.json",
32
32
  "dependencies": {
33
33
  "@babel/core": "^7.22.9",
34
- "@babel/plugin-proposal-class-properties": "^7.18.6",
35
34
  "@babel/plugin-proposal-decorators": "^7.22.7",
36
35
  "@babel/plugin-transform-runtime": "^7.22.9",
37
36
  "@babel/preset-env": "^7.22.9",
@@ -57,9 +56,9 @@
57
56
  "semver": "7.5.3",
58
57
  "source-map-support": "0.5.19",
59
58
  "tslib": "^2.3.0",
60
- "@nx/devkit": "17.0.0-beta.8",
61
- "@nx/workspace": "17.0.0-beta.8",
62
- "@nrwl/js": "17.0.0-beta.8"
59
+ "@nx/devkit": "17.0.0-rc.1",
60
+ "@nx/workspace": "17.0.0-rc.1",
61
+ "@nrwl/js": "17.0.0-rc.1"
63
62
  },
64
63
  "peerDependencies": {
65
64
  "verdaccio": "^5.0.4"
@@ -6,11 +6,6 @@ const devkit_1 = require("@nx/devkit");
6
6
  * Read the npm scope that a workspace should use by default
7
7
  */
8
8
  function getNpmScope(tree) {
9
- const nxJson = (0, devkit_1.readNxJson)(tree);
10
- // TODO(v17): Remove reading this from nx.json
11
- if (nxJson?.npmScope) {
12
- return nxJson.npmScope;
13
- }
14
9
  const { name } = tree.exists('package.json')
15
10
  ? (0, devkit_1.readJson)(tree, 'package.json')
16
11
  : { name: null };