@nx/workspace 22.7.7 → 22.7.8

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/workspace",
3
- "version": "22.7.7",
3
+ "version": "22.7.8",
4
4
  "private": false,
5
5
  "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@nx/devkit": "22.7.7",
42
+ "@nx/devkit": "22.7.8",
43
43
  "@zkochan/js-yaml": "0.0.7",
44
44
  "chalk": "^4.1.0",
45
45
  "enquirer": "~2.3.6",
@@ -47,10 +47,10 @@
47
47
  "semver": "^7.6.3",
48
48
  "tslib": "^2.3.0",
49
49
  "yargs-parser": "21.1.1",
50
- "nx": "22.7.7"
50
+ "nx": "22.7.8"
51
51
  },
52
52
  "devDependencies": {
53
- "nx": "22.7.7"
53
+ "nx": "22.7.8"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
@@ -146,7 +146,7 @@ async function generateWorkspaceFiles(tree, options) {
146
146
  const [packageMajor] = packageManagerVersion.split('.');
147
147
  if (options.packageManager === 'pnpm' && +packageMajor >= 7) {
148
148
  if ((0, semver_1.gte)(packageManagerVersion, '10.6.0')) {
149
- addPnpmSettings(tree, options);
149
+ addPnpmSettings(tree, options, packageManagerVersion);
150
150
  }
151
151
  else {
152
152
  createNpmrc(tree, options);
@@ -262,10 +262,13 @@ async function createReadme(tree, { name, appName, directory, preset, nxCloud, w
262
262
  nxCloudOnboardingUrl,
263
263
  });
264
264
  }
265
- // ensure that pnpm install add all the missing peer deps
266
- function addPnpmSettings(tree, options) {
267
- tree.write((0, path_1.join)(options.directory, 'pnpm-workspace.yaml'), `autoInstallPeers: true
268
- `);
265
+ function addPnpmSettings(tree, options, packageManagerVersion) {
266
+ // @swc/core is acknowledged (false) so pnpm 10.6+ doesn't fail the install on its
267
+ // ignored build script — its postinstall only checks the optional native binary.
268
+ const buildAllowlist = (0, semver_1.gte)(packageManagerVersion, '11.0.0')
269
+ ? `allowBuilds:\n nx: true\n '@swc/core': false`
270
+ : `onlyBuiltDependencies:\n - nx`;
271
+ tree.write((0, path_1.join)(options.directory, 'pnpm-workspace.yaml'), `autoInstallPeers: true\n${buildAllowlist}\n`);
269
272
  }
270
273
  function createNpmrc(tree, options) {
271
274
  tree.write((0, path_1.join)(options.directory, '.npmrc'), 'strict-peer-dependencies=false\nauto-install-peers=true\n');
@@ -1,4 +1,4 @@
1
- import * as chalk from 'chalk';
1
+ import chalk from 'chalk';
2
2
  export interface CLIErrorMessageConfig {
3
3
  title: string;
4
4
  bodyLines?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../../packages/workspace/src/utils/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AASD,cAAM,SAAS;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IACnE;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAC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AAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AASD,cAAM,SAAS;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IACnE;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACiB;IAEpD;;;;OAIG;IACH,MAAM;;MAEJ;IACF,IAAI,cAAc;IAClB,SAAS,cAAmB;IAE5B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,uBAAuB;IAQ/B,UAAU;IAIV,oBAAoB;IAIpB,mCAAmC;IAInC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,qBAAqB;IAyBvD,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,oBAAoB;IAyBrD,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,oBAAoB;IAa/C,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,uBAAuB;IAarD,aAAa,CAAC,OAAO,EAAE,MAAM;IAU7B,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAe;IAYrD,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,oBAAoB;CAW/C;AAED,eAAO,MAAM,MAAM,WAAkB,CAAC"}
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.output = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const chalk = tslib_1.__importStar(require("chalk"));
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  /**
7
7
  * Automatically disable styling applied by chalk if CI=true
8
8
  */
9
9
  if (process.env.CI === 'true') {
10
- chalk.level = 0;
10
+ chalk_1.default.level = 0;
11
11
  }
12
12
  class CLIOutput {
13
13
  constructor() {
14
- this.NX_PREFIX = chalk.reset.inverse.bold.cyan(' NX ');
14
+ this.NX_PREFIX = chalk_1.default.reset.inverse.bold.cyan(' NX ');
15
15
  /**
16
16
  * Longer dash character which forms more of a continuous line when place side to side
17
17
  * with itself, unlike the standard dash character
@@ -23,10 +23,10 @@ class CLIOutput {
23
23
  * implementation.
24
24
  */
25
25
  this.colors = {
26
- gray: chalk.gray,
26
+ gray: chalk_1.default.gray,
27
27
  };
28
- this.bold = chalk.bold;
29
- this.underline = chalk.underline;
28
+ this.bold = chalk_1.default.bold;
29
+ this.underline = chalk_1.default.underline;
30
30
  }
31
31
  writeToStdOut(str) {
32
32
  process.stdout.write(str);
@@ -52,16 +52,16 @@ class CLIOutput {
52
52
  this.writeToStdOut('\n');
53
53
  }
54
54
  addVerticalSeparator() {
55
- this.writeToStdOut(`\n${chalk.gray(this.VERTICAL_SEPARATOR)}\n\n`);
55
+ this.writeToStdOut(`\n${chalk_1.default.gray(this.VERTICAL_SEPARATOR)}\n\n`);
56
56
  }
57
57
  addVerticalSeparatorWithoutNewLines() {
58
- this.writeToStdOut(`${chalk.gray(this.VERTICAL_SEPARATOR)}\n`);
58
+ this.writeToStdOut(`${chalk_1.default.gray(this.VERTICAL_SEPARATOR)}\n`);
59
59
  }
60
60
  error({ title, slug, bodyLines }) {
61
61
  this.addNewline();
62
62
  this.writeOutputTitle({
63
- label: chalk.reset.inverse.bold.red(' ERROR '),
64
- title: chalk.bold.red(title),
63
+ label: chalk_1.default.reset.inverse.bold.red(' ERROR '),
64
+ title: chalk_1.default.bold.red(title),
65
65
  });
66
66
  this.writeOptionalOutputBody(bodyLines);
67
67
  /**
@@ -69,15 +69,15 @@ class CLIOutput {
69
69
  */
70
70
  if (slug && typeof slug === 'string') {
71
71
  this.addNewline();
72
- this.writeToStdOut(`${chalk.grey(' Learn more about this error: ')}https://errors.nx.dev/${slug}\n`);
72
+ this.writeToStdOut(`${chalk_1.default.grey(' Learn more about this error: ')}https://errors.nx.dev/${slug}\n`);
73
73
  }
74
74
  this.addNewline();
75
75
  }
76
76
  warn({ title, slug, bodyLines }) {
77
77
  this.addNewline();
78
78
  this.writeOutputTitle({
79
- label: chalk.reset.inverse.bold.yellow(' WARNING '),
80
- title: chalk.bold.yellow(title),
79
+ label: chalk_1.default.reset.inverse.bold.yellow(' WARNING '),
80
+ title: chalk_1.default.bold.yellow(title),
81
81
  });
82
82
  this.writeOptionalOutputBody(bodyLines);
83
83
  /**
@@ -85,15 +85,15 @@ class CLIOutput {
85
85
  */
86
86
  if (slug && typeof slug === 'string') {
87
87
  this.addNewline();
88
- this.writeToStdOut(`${chalk.grey(' Learn more about this warning: ')}https://errors.nx.dev/${slug}\n`);
88
+ this.writeToStdOut(`${chalk_1.default.grey(' Learn more about this warning: ')}https://errors.nx.dev/${slug}\n`);
89
89
  }
90
90
  this.addNewline();
91
91
  }
92
92
  note({ title, bodyLines }) {
93
93
  this.addNewline();
94
94
  this.writeOutputTitle({
95
- label: chalk.reset.inverse.bold.keyword('orange')(' NOTE '),
96
- title: chalk.bold.keyword('orange')(title),
95
+ label: chalk_1.default.reset.inverse.bold.keyword('orange')(' NOTE '),
96
+ title: chalk_1.default.bold.keyword('orange')(title),
97
97
  });
98
98
  this.writeOptionalOutputBody(bodyLines);
99
99
  this.addNewline();
@@ -101,8 +101,8 @@ class CLIOutput {
101
101
  success({ title, bodyLines }) {
102
102
  this.addNewline();
103
103
  this.writeOutputTitle({
104
- label: chalk.reset.inverse.bold.green(' SUCCESS '),
105
- title: chalk.bold.green(title),
104
+ label: chalk_1.default.reset.inverse.bold.green(' SUCCESS '),
105
+ title: chalk_1.default.bold.green(title),
106
106
  });
107
107
  this.writeOptionalOutputBody(bodyLines);
108
108
  this.addNewline();
@@ -116,16 +116,16 @@ class CLIOutput {
116
116
  }
117
117
  logCommand(message, isCached = false) {
118
118
  this.addNewline();
119
- this.writeToStdOut(chalk.bold(`> ${message} `));
119
+ this.writeToStdOut(chalk_1.default.bold(`> ${message} `));
120
120
  if (isCached) {
121
- this.writeToStdOut(chalk.bold.grey(`[retrieved from cache]`));
121
+ this.writeToStdOut(chalk_1.default.bold.grey(`[retrieved from cache]`));
122
122
  }
123
123
  this.addNewline();
124
124
  }
125
125
  log({ title, bodyLines }) {
126
126
  this.addNewline();
127
127
  this.writeOutputTitle({
128
- title: chalk.white(title),
128
+ title: chalk_1.default.white(title),
129
129
  });
130
130
  this.writeOptionalOutputBody(bodyLines);
131
131
  this.addNewline();