nx 22.6.0-beta.1 → 22.6.0-beta.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"init-local.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/init-local.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,oBAAoB,iBA6C9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,YA6BvD"}
1
+ {"version":3,"file":"init-local.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/init-local.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,oBAAoB,iBA8C9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,YA6BvD"}
package/bin/init-local.js CHANGED
@@ -44,6 +44,7 @@ async function initLocal(workspace) {
44
44
  const split = newArgs.indexOf('--');
45
45
  if (help > -1 && (split === -1 || split > help)) {
46
46
  nx_commands_1.commandsObject.showHelp();
47
+ process.exit(0);
47
48
  }
48
49
  else {
49
50
  nx_commands_1.commandsObject.parse(newArgs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "22.6.0-beta.1",
3
+ "version": "22.6.0-beta.2",
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": {
@@ -84,16 +84,16 @@
84
84
  }
85
85
  },
86
86
  "optionalDependencies": {
87
- "@nx/nx-darwin-arm64": "22.6.0-beta.1",
88
- "@nx/nx-darwin-x64": "22.6.0-beta.1",
89
- "@nx/nx-freebsd-x64": "22.6.0-beta.1",
90
- "@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.1",
91
- "@nx/nx-linux-arm64-gnu": "22.6.0-beta.1",
92
- "@nx/nx-linux-arm64-musl": "22.6.0-beta.1",
93
- "@nx/nx-linux-x64-gnu": "22.6.0-beta.1",
94
- "@nx/nx-linux-x64-musl": "22.6.0-beta.1",
95
- "@nx/nx-win32-arm64-msvc": "22.6.0-beta.1",
96
- "@nx/nx-win32-x64-msvc": "22.6.0-beta.1"
87
+ "@nx/nx-darwin-arm64": "22.6.0-beta.2",
88
+ "@nx/nx-darwin-x64": "22.6.0-beta.2",
89
+ "@nx/nx-freebsd-x64": "22.6.0-beta.2",
90
+ "@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.2",
91
+ "@nx/nx-linux-arm64-gnu": "22.6.0-beta.2",
92
+ "@nx/nx-linux-arm64-musl": "22.6.0-beta.2",
93
+ "@nx/nx-linux-x64-gnu": "22.6.0-beta.2",
94
+ "@nx/nx-linux-x64-musl": "22.6.0-beta.2",
95
+ "@nx/nx-win32-arm64-msvc": "22.6.0-beta.2",
96
+ "@nx/nx-win32-x64-msvc": "22.6.0-beta.2"
97
97
  },
98
98
  "nx-migrations": {
99
99
  "migrations": "./migrations.json",
@@ -1,5 +1,5 @@
1
- import type { ProjectGraphProjectNode } from '../../config/project-graph';
2
1
  import { CommandModule } from 'yargs';
2
+ import type { ProjectGraphProjectNode } from '../../config/project-graph';
3
3
  export interface NxShowArgs {
4
4
  json?: boolean;
5
5
  }
@@ -23,5 +23,18 @@ export type ShowProjectOptions = NxShowArgs & {
23
23
  open?: boolean;
24
24
  verbose?: boolean;
25
25
  };
26
+ export type ShowTargetBaseOptions = NxShowArgs & {
27
+ target?: string;
28
+ configuration?: string;
29
+ verbose?: boolean;
30
+ };
31
+ export type ShowTargetInputsOptions = NxShowArgs & {
32
+ target?: string;
33
+ check?: string[];
34
+ verbose?: boolean;
35
+ };
36
+ export type ShowTargetOutputsOptions = ShowTargetBaseOptions & {
37
+ check?: string[];
38
+ };
26
39
  export declare const yargsShowCommand: CommandModule<Record<string, unknown>, NxShowArgs>;
27
40
  //# sourceMappingURL=command-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/show/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAQhD,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,UAAU,CA6BX,CAAC"}
1
+ {"version":3,"file":"command-object.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C,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,UAAU,CA0CX,CAAC"}
@@ -2,14 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsShowCommand = void 0;
4
4
  const yargs_1 = require("yargs");
5
- const shared_options_1 = require("../yargs-utils/shared-options");
6
5
  const handle_errors_1 = require("../../utils/handle-errors");
6
+ const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsShowCommand = {
8
8
  command: 'show',
9
9
  describe: 'Show information about the workspace (e.g., list of projects).',
10
10
  builder: (yargs) => yargs
11
11
  .command(showProjectsCommand)
12
12
  .command(showProjectCommand)
13
+ .command(showTargetCommand)
13
14
  .demandCommand()
14
15
  .option('json', {
15
16
  type: 'boolean',
@@ -17,7 +18,10 @@ exports.yargsShowCommand = {
17
18
  })
18
19
  .example('$0 show projects', 'Show a list of all projects in the workspace')
19
20
  .example('$0 show projects --with-target serve', 'Show a list of all projects in the workspace that have a "serve" target')
20
- .example('$0 show project [projectName]', 'Shows the resolved configuration for [projectName]'),
21
+ .example('$0 show project [projectName]', 'Shows the resolved configuration for [projectName]')
22
+ .example('$0 show target my-app:build', 'Shows resolved configuration for the build target of my-app')
23
+ .example('$0 show target inputs my-app:build', 'List resolved input files for the build target')
24
+ .example('$0 show target outputs my-app:build', 'List resolved output paths for the build target'),
21
25
  handler: async (args) => {
22
26
  (0, yargs_1.showHelp)();
23
27
  process.exit(1);
@@ -114,3 +118,113 @@ const showProjectCommand = {
114
118
  process.exit(exitCode);
115
119
  },
116
120
  };
121
+ const showTargetInfoCommand = {
122
+ command: '$0 [target] [subcommand]',
123
+ describe: 'Shows resolved target configuration for a given project target. Target can be specified as project:target or just target (infers project from cwd).',
124
+ builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
125
+ .positional('target', {
126
+ type: 'string',
127
+ description: 'The target to inspect, in the format project:target or just target.',
128
+ })
129
+ .positional('subcommand', {
130
+ type: 'string',
131
+ choices: ['inputs', 'outputs'],
132
+ description: 'Invokes `nx show target inputs/outputs for the specified target.',
133
+ })
134
+ .option('configuration', {
135
+ type: 'string',
136
+ alias: 'c',
137
+ description: 'The configuration to inspect.',
138
+ })
139
+ .option('check', {
140
+ type: 'string',
141
+ array: true,
142
+ description: 'Checks whether a set of values are or are not an input/output for the target.',
143
+ })
144
+ .implies('check', 'subcommand')
145
+ .conflicts('check', 'json')
146
+ .example('$0 show target my-app:build', 'Show target configuration for my-app:build')
147
+ .example('$0 show target my-app:build -c production', 'Show target configuration with production configuration applied'),
148
+ handler: async (args) => {
149
+ const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
150
+ const { showTargetInfoHandler, showTargetInputsHandler, showTargetOutputsHandler, } = await Promise.resolve().then(() => require('./target'));
151
+ if (args.subcommand === 'inputs') {
152
+ await showTargetInputsHandler(args);
153
+ return;
154
+ }
155
+ else if (args.subcommand === 'outputs') {
156
+ await showTargetOutputsHandler(args);
157
+ return;
158
+ }
159
+ await showTargetInfoHandler(args);
160
+ });
161
+ process.exit(process.exitCode || exitCode);
162
+ },
163
+ };
164
+ const showTargetInputsCommand = {
165
+ command: 'inputs [target]',
166
+ describe: 'List resolved input files for a target.',
167
+ builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
168
+ .positional('target', {
169
+ type: 'string',
170
+ description: 'The target to inspect, in the format project:target or just target.',
171
+ })
172
+ .option('check', {
173
+ type: 'string',
174
+ array: true,
175
+ requiresArg: true,
176
+ description: 'Check whether a set of values are an input for the target. Accepts a file path, environment variable name, runtime command, or external dependency.',
177
+ })
178
+ .conflicts('check', 'json')
179
+ .example('$0 show target inputs my-app:build', 'List resolved input files for my-app:build')
180
+ .example('$0 show target inputs my-app:build --check src/main.ts', 'Check if src/main.ts is an input for my-app:build'),
181
+ handler: async (args) => {
182
+ const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
183
+ const { showTargetInputsHandler } = await Promise.resolve().then(() => require('./target'));
184
+ await showTargetInputsHandler(args);
185
+ });
186
+ process.exit(process.exitCode || exitCode);
187
+ },
188
+ };
189
+ const showTargetOutputsCommand = {
190
+ command: 'outputs [target]',
191
+ describe: 'List resolved output paths for a target.',
192
+ builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
193
+ .positional('target', {
194
+ type: 'string',
195
+ description: 'The target to inspect, in the format project:target or just target.',
196
+ })
197
+ .option('configuration', {
198
+ type: 'string',
199
+ alias: 'c',
200
+ description: 'The configuration to inspect.',
201
+ })
202
+ .option('check', {
203
+ type: 'string',
204
+ array: true,
205
+ requiresArg: true,
206
+ description: 'Check whether a set of files is an output for the target. Accepts a workspace-relative path.',
207
+ })
208
+ .conflicts('check', 'json')
209
+ .example('$0 show target outputs my-app:build', 'List resolved output paths for my-app:build')
210
+ .example('$0 show target outputs my-app:build --check dist/my-app', 'Check if dist/my-app is an output of my-app:build'),
211
+ handler: async (args) => {
212
+ const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
213
+ const { showTargetOutputsHandler } = await Promise.resolve().then(() => require('./target'));
214
+ await showTargetOutputsHandler(args);
215
+ });
216
+ process.exit(process.exitCode || exitCode);
217
+ },
218
+ };
219
+ const showTargetCommand = {
220
+ command: 'target',
221
+ describe: 'Shows resolved target configuration for a given project target. Use subcommands to inspect inputs or outputs.',
222
+ builder: (yargs) => yargs
223
+ .command(showTargetInputsCommand)
224
+ .command(showTargetOutputsCommand)
225
+ .command(showTargetInfoCommand),
226
+ handler: async () => {
227
+ (0, yargs_1.showHelp)();
228
+ process.exit(1);
229
+ },
230
+ };
@@ -0,0 +1,5 @@
1
+ import type { ShowTargetBaseOptions, ShowTargetInputsOptions, ShowTargetOutputsOptions } from './command-object';
2
+ export declare function showTargetInfoHandler(args: ShowTargetBaseOptions): Promise<void>;
3
+ export declare function showTargetInputsHandler(args: ShowTargetInputsOptions): Promise<void>;
4
+ export declare function showTargetOutputsHandler(args: ShowTargetOutputsOptions): Promise<void>;
5
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/show/target.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAuDf"}