nx 17.2.6 → 17.3.0-beta.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/README.md CHANGED
@@ -1,4 +1,9 @@
1
- <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
2
7
 
3
8
  <div style="text-align: center;">
4
9
 
@@ -15,9 +20,9 @@
15
20
 
16
21
  <hr>
17
22
 
18
- # Nx: Smart, Fast and Extensible Build System
23
+ # Nx: Smart Monorepos · Fast CI
19
24
 
20
- Nx is a next generation build system with first class monorepo support and powerful integrations.
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
21
26
 
22
27
  ## Getting Started
23
28
 
@@ -57,5 +62,5 @@ npx nx@latest init
57
62
  - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
58
63
 
59
64
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
60
- width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
65
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
61
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "17.2.6",
3
+ "version": "17.3.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  "yargs": "^17.6.2",
67
67
  "yargs-parser": "21.1.1",
68
68
  "node-machine-id": "1.1.12",
69
- "@nrwl/tao": "17.2.6"
69
+ "@nrwl/tao": "17.3.0-beta.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@swc-node/register": "^1.6.7",
@@ -81,16 +81,16 @@
81
81
  }
82
82
  },
83
83
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "17.2.6",
85
- "@nx/nx-darwin-arm64": "17.2.6",
86
- "@nx/nx-linux-x64-gnu": "17.2.6",
87
- "@nx/nx-linux-x64-musl": "17.2.6",
88
- "@nx/nx-win32-x64-msvc": "17.2.6",
89
- "@nx/nx-linux-arm64-gnu": "17.2.6",
90
- "@nx/nx-linux-arm64-musl": "17.2.6",
91
- "@nx/nx-linux-arm-gnueabihf": "17.2.6",
92
- "@nx/nx-win32-arm64-msvc": "17.2.6",
93
- "@nx/nx-freebsd-x64": "17.2.6"
84
+ "@nx/nx-darwin-x64": "17.3.0-beta.1",
85
+ "@nx/nx-darwin-arm64": "17.3.0-beta.1",
86
+ "@nx/nx-linux-x64-gnu": "17.3.0-beta.1",
87
+ "@nx/nx-linux-x64-musl": "17.3.0-beta.1",
88
+ "@nx/nx-win32-x64-msvc": "17.3.0-beta.1",
89
+ "@nx/nx-linux-arm64-gnu": "17.3.0-beta.1",
90
+ "@nx/nx-linux-arm64-musl": "17.3.0-beta.1",
91
+ "@nx/nx-linux-arm-gnueabihf": "17.3.0-beta.1",
92
+ "@nx/nx-win32-arm64-msvc": "17.3.0-beta.1",
93
+ "@nx/nx-freebsd-x64": "17.3.0-beta.1"
94
94
  },
95
95
  "nx-migrations": {
96
96
  "migrations": "./migrations.json",
@@ -135,6 +135,8 @@
135
135
  "@nrwl/react-native",
136
136
  "@nx/rollup",
137
137
  "@nrwl/rollup",
138
+ "@nx/remix",
139
+ "@nrwl/remix",
138
140
  "@nx/storybook",
139
141
  "@nrwl/storybook",
140
142
  "@nrwl/tao",
@@ -36,7 +36,7 @@ exports.parserConfiguration = {
36
36
  */
37
37
  exports.commandsObject = yargs
38
38
  .parserConfiguration(exports.parserConfiguration)
39
- .usage(chalk.bold('Smart, Fast and Extensible Build System'))
39
+ .usage(chalk.bold('Smart Monorepos · Fast CI'))
40
40
  .demandCommand(1, '')
41
41
  .command(command_object_1.yargsAffectedBuildCommand)
42
42
  .command(command_object_1.yargsAffectedCommand)
@@ -227,15 +227,20 @@ function resolveChangelogRenderer(changelogRendererPath) {
227
227
  }
228
228
  async function generateChangelogForWorkspace(tree, args, projectGraph, nxReleaseConfig, workspaceChangelogVersion, commits, postGitTasks) {
229
229
  const config = nxReleaseConfig.changelog.workspaceChangelog;
230
+ const isEnabled = args.workspaceChangelog ?? config;
230
231
  // The entire feature is disabled at the workspace level, exit early
231
- if (config === false) {
232
+ if (isEnabled === false) {
232
233
  return;
233
234
  }
234
235
  // If explicitly null it must mean that no changes were detected (e.g. when using conventional commits), so do nothing
235
236
  if (workspaceChangelogVersion === null) {
236
237
  return;
237
238
  }
238
- if (!workspaceChangelogVersion) {
239
+ // The user explicitly passed workspaceChangelog=true but does not have a workspace changelog config in nx.json
240
+ if (!config) {
241
+ throw new Error(`Workspace changelog is enabled but no configuration was provided. Please provide a workspaceChangelog object in your nx.json`);
242
+ }
243
+ if (!workspaceChangelogVersion && args.workspaceChangelog) {
239
244
  throw new Error(`Workspace changelog is enabled but no overall version was provided. Please provide an explicit version using --version`);
240
245
  }
241
246
  // Only trigger interactive mode for the workspace changelog if the user explicitly requested it via "all" or "workspace"
@@ -27,6 +27,7 @@ export type ChangelogOptions = NxReleaseArgs & GitCommitAndTagOptions & {
27
27
  from?: string;
28
28
  interactive?: string;
29
29
  gitRemote?: string;
30
+ workspaceChangelog?: boolean;
30
31
  };
31
32
  export type PublishOptions = NxReleaseArgs & Partial<RunManyOptions> & {
32
33
  outputStyle?: OutputStyle;
@@ -35,5 +36,9 @@ export type PublishOptions = NxReleaseArgs & Partial<RunManyOptions> & {
35
36
  tag?: string;
36
37
  otp?: number;
37
38
  };
39
+ export type ReleaseOptions = NxReleaseArgs & {
40
+ yes?: boolean;
41
+ skipPublish?: boolean;
42
+ };
38
43
  export declare const yargsReleaseCommand: CommandModule<Record<string, unknown>, NxReleaseArgs>;
39
44
  export {};
@@ -8,6 +8,7 @@ exports.yargsReleaseCommand = {
8
8
  command: 'release',
9
9
  describe: '**ALPHA**: Orchestrate versioning and publishing of applications and libraries',
10
10
  builder: (yargs) => yargs
11
+ .command(releaseCommand)
11
12
  .command(versionCommand)
12
13
  .command(changelogCommand)
13
14
  .command(publishCommand)
@@ -26,7 +27,7 @@ exports.yargsReleaseCommand = {
26
27
  coerce: shared_options_1.parseCSV,
27
28
  describe: 'Projects to run. (comma/space delimited project names and/or patterns)',
28
29
  })
29
- .option('dryRun', {
30
+ .option('dry-run', {
30
31
  describe: 'Preview the changes without updating files/creating releases',
31
32
  alias: 'd',
32
33
  type: 'boolean',
@@ -55,6 +56,37 @@ exports.yargsReleaseCommand = {
55
56
  process.exit(1);
56
57
  },
57
58
  };
59
+ const releaseCommand = {
60
+ command: '$0 [specifier]',
61
+ describe: 'Create a version and release for the workspace, generate a changelog, and optionally publish the packages',
62
+ builder: (yargs) => yargs
63
+ .positional('specifier', {
64
+ type: 'string',
65
+ describe: 'Exact version or semver keyword to apply to the selected release group.',
66
+ })
67
+ .option('yes', {
68
+ type: 'boolean',
69
+ alias: 'y',
70
+ description: 'Automatically answer yes to the confirmation prompt for publishing',
71
+ })
72
+ .option('skip-publish', {
73
+ type: 'boolean',
74
+ description: 'Skip publishing by automatically answering no to the confirmation prompt for publishing',
75
+ })
76
+ .check((argv) => {
77
+ if (argv.yes !== undefined && argv.skipPublish !== undefined) {
78
+ throw new Error('The --yes and --skip-publish options are mutually exclusive, please use one or the other.');
79
+ }
80
+ return true;
81
+ }),
82
+ handler: (args) => Promise.resolve().then(() => require('./release')).then((m) => m.releaseCLIHandler(args))
83
+ .then((versionDataOrExitCode) => {
84
+ if (typeof versionDataOrExitCode === 'number') {
85
+ return process.exit(versionDataOrExitCode);
86
+ }
87
+ process.exit(0);
88
+ }),
89
+ };
58
90
  const versionCommand = {
59
91
  command: 'version [specifier]',
60
92
  aliases: ['v'],
@@ -108,7 +140,7 @@ const changelogCommand = {
108
140
  description: 'Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level',
109
141
  choices: ['all', 'workspace', 'projects'],
110
142
  })
111
- .option('gitRemote', {
143
+ .option('git-remote', {
112
144
  type: 'string',
113
145
  description: 'Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing)',
114
146
  default: 'origin',
@@ -10,3 +10,7 @@ export { releasePublish } from './publish';
10
10
  * @public
11
11
  */
12
12
  export { releaseVersion } from './version';
13
+ /**
14
+ * @public
15
+ */
16
+ export { release } from './release';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = void 0;
3
+ exports.release = exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = void 0;
4
4
  /**
5
5
  * @public
6
6
  */
@@ -16,3 +16,8 @@ Object.defineProperty(exports, "releasePublish", { enumerable: true, get: functi
16
16
  */
17
17
  var version_1 = require("./version");
18
18
  Object.defineProperty(exports, "releaseVersion", { enumerable: true, get: function () { return version_1.releaseVersion; } });
19
+ /**
20
+ * @public
21
+ */
22
+ var release_1 = require("./release");
23
+ Object.defineProperty(exports, "release", { enumerable: true, get: function () { return release_1.release; } });
@@ -0,0 +1,4 @@
1
+ import { ReleaseOptions, VersionOptions } from './command-object';
2
+ import { NxReleaseVersionResult } from './version';
3
+ export declare const releaseCLIHandler: (args: VersionOptions) => Promise<any>;
4
+ export declare function release(args: ReleaseOptions): Promise<NxReleaseVersionResult | number>;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.release = exports.releaseCLIHandler = void 0;
4
+ const enquirer_1 = require("enquirer");
5
+ const nx_json_1 = require("../../config/nx-json");
6
+ const devkit_exports_1 = require("../../devkit-exports");
7
+ const project_graph_1 = require("../../project-graph/project-graph");
8
+ const params_1 = require("../../utils/params");
9
+ const changelog_1 = require("./changelog");
10
+ const config_1 = require("./config/config");
11
+ const publish_1 = require("./publish");
12
+ const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
13
+ const version_1 = require("./version");
14
+ const releaseCLIHandler = (args) => (0, params_1.handleErrors)(args.verbose, () => release(args));
15
+ exports.releaseCLIHandler = releaseCLIHandler;
16
+ async function release(args) {
17
+ const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
18
+ const nxJson = (0, nx_json_1.readNxJson)();
19
+ if (args.verbose) {
20
+ process.env.NX_VERBOSE_LOGGING = 'true';
21
+ }
22
+ const hasVersionGitConfig = Object.keys(nxJson.release?.version?.git ?? {}).length > 0;
23
+ const hasChangelogGitConfig = Object.keys(nxJson.release?.changelog?.git ?? {}).length > 0;
24
+ if (hasVersionGitConfig || hasChangelogGitConfig) {
25
+ const jsonConfigErrorPath = hasVersionGitConfig
26
+ ? ['release', 'version', 'git']
27
+ : ['release', 'changelog', 'git'];
28
+ const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)(jsonConfigErrorPath);
29
+ devkit_exports_1.output.error({
30
+ title: `The 'release' top level command cannot be used with granular git configuration. Instead, configure git options in the 'release.git' property in nx.json.`,
31
+ bodyLines: [nxJsonMessage],
32
+ });
33
+ process.exit(1);
34
+ }
35
+ // Apply default configuration to any optional user configuration
36
+ const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, nxJson.release, 'nx-release-publish');
37
+ if (configError) {
38
+ return await (0, config_1.handleNxReleaseConfigError)(configError);
39
+ }
40
+ const versionResult = await (0, version_1.releaseVersion)({
41
+ ...args,
42
+ // if enabled, committing and tagging will be handled by the changelog
43
+ // command, so we should only stage the changes in the version command
44
+ stageChanges: nxReleaseConfig.git?.commit,
45
+ gitCommit: false,
46
+ gitTag: false,
47
+ });
48
+ await (0, changelog_1.releaseChangelog)({
49
+ ...args,
50
+ versionData: versionResult.projectsVersionData,
51
+ version: versionResult.workspaceVersion,
52
+ workspaceChangelog: versionResult.workspaceVersion !== undefined,
53
+ });
54
+ let shouldPublish = !!args.yes && !args.skipPublish;
55
+ const shouldPromptPublishing = !args.yes && !args.skipPublish && !args.dryRun;
56
+ if (shouldPromptPublishing) {
57
+ shouldPublish = await promptForPublish();
58
+ }
59
+ if (shouldPublish) {
60
+ await (0, publish_1.releasePublish)(args);
61
+ }
62
+ else {
63
+ console.log('Skipped publishing packages.');
64
+ }
65
+ return versionResult;
66
+ }
67
+ exports.release = release;
68
+ async function promptForPublish() {
69
+ console.log('\n');
70
+ const reply = await (0, enquirer_1.prompt)([
71
+ {
72
+ name: 'confirmation',
73
+ message: 'Do you want to publish these versions?',
74
+ type: 'confirm',
75
+ },
76
+ ]);
77
+ console.log('\n');
78
+ return reply.confirmation;
79
+ }
@@ -15,7 +15,7 @@ export interface ReleaseVersionGeneratorSchema {
15
15
  currentVersionResolver?: 'registry' | 'disk' | 'git-tag';
16
16
  currentVersionResolverMetadata?: Record<string, unknown>;
17
17
  }
18
- interface NxReleaseVersionResult {
18
+ export interface NxReleaseVersionResult {
19
19
  /**
20
20
  * In one specific (and very common) case, an overall workspace version is relevant, for example when there is
21
21
  * only a single release group in which all projects have a fixed relationship to each other. In this case, the
@@ -198,13 +198,13 @@ interface NxReleaseConfiguration {
198
198
  };
199
199
  /**
200
200
  * Optionally override the git/release tag pattern to use. This field is the source of truth
201
- * for changelog generation and release tagging, as well as for conventional-commits parsing.
201
+ * for changelog generation and release tagging, as well as for conventional commits parsing.
202
202
  *
203
203
  * It supports interpolating the version as {version} and (if releasing independently or forcing
204
204
  * project level version control system releases) the project name as {projectName} within the string.
205
205
  *
206
- * The default releaseTagPattern for unified releases is: "v{version}"
207
- * The default releaseTagPattern for releases at the project level is: "{projectName}@v{version}"
206
+ * The default releaseTagPattern for fixed/unified releases is: "v{version}"
207
+ * The default releaseTagPattern for independent releases at the project level is: "{projectName}@v{version}"
208
208
  */
209
209
  releaseTagPattern?: string;
210
210
  /**
@@ -1,3 +1,29 @@
1
+ @babel/runtime
2
+ MIT
3
+ MIT License
4
+
5
+ Copyright (c) 2014-present Sebastian McKenzie and other contributors
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ "Software"), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+
1
27
  @floating-ui/react
2
28
  MIT
3
29
  MIT License
@@ -186,31 +212,6 @@ SOFTWARE.
186
212
 
187
213
 
188
214
 
189
- aria-hidden
190
- MIT
191
- MIT License
192
-
193
- Copyright (c) 2017 Anton Korzunov
194
-
195
- Permission is hereby granted, free of charge, to any person obtaining a copy
196
- of this software and associated documentation files (the "Software"), to deal
197
- in the Software without restriction, including without limitation the rights
198
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
199
- copies of the Software, and to permit persons to whom the Software is
200
- furnished to do so, subject to the following conditions:
201
-
202
- The above copyright notice and this permission notice shall be included in all
203
- copies or substantial portions of the Software.
204
-
205
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
206
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
207
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
208
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
209
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
210
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
211
- SOFTWARE.
212
-
213
-
214
215
  classnames
215
216
  MIT
216
217
  The MIT License (MIT)
@@ -589,57 +590,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
589
590
  SOFTWARE.
590
591
 
591
592
 
592
- regenerator-runtime
593
- MIT
594
- MIT License
595
-
596
- Copyright (c) 2014-present, Facebook, Inc.
597
-
598
- Permission is hereby granted, free of charge, to any person obtaining a copy
599
- of this software and associated documentation files (the "Software"), to deal
600
- in the Software without restriction, including without limitation the rights
601
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
602
- copies of the Software, and to permit persons to whom the Software is
603
- furnished to do so, subject to the following conditions:
604
-
605
- The above copyright notice and this permission notice shall be included in all
606
- copies or substantial portions of the Software.
607
-
608
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
609
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
610
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
611
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
612
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
613
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
614
- SOFTWARE.
615
-
616
-
617
- tabbable
618
- MIT
619
- The MIT License (MIT)
620
-
621
- Copyright (c) 2015 David Clark
622
-
623
- Permission is hereby granted, free of charge, to any person obtaining a copy
624
- of this software and associated documentation files (the "Software"), to deal
625
- in the Software without restriction, including without limitation the rights
626
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
627
- copies of the Software, and to permit persons to whom the Software is
628
- furnished to do so, subject to the following conditions:
629
-
630
- The above copyright notice and this permission notice shall be included in all
631
- copies or substantial portions of the Software.
632
-
633
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
634
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
635
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
636
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
637
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
638
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
639
- SOFTWARE.
640
-
641
-
642
-
643
593
  use-isomorphic-layout-effect
644
594
  MIT
645
595
  MIT License