nx 13.8.8 → 13.9.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.
- package/bin/nx.d.ts +1 -0
- package/bin/nx.js +78 -1
- package/bin/nx.js.map +1 -1
- package/package.json +19 -2
- package/src/cli/decorate-cli.d.ts +1 -0
- package/src/cli/decorate-cli.js +19 -0
- package/src/cli/decorate-cli.js.map +1 -0
- package/src/cli/find-workspace-root.d.ts +8 -0
- package/src/cli/find-workspace-root.js +25 -0
- package/src/cli/find-workspace-root.js.map +1 -0
- package/src/cli/index.d.ts +3 -0
- package/src/cli/index.js +74 -0
- package/src/cli/index.js.map +1 -0
- package/src/cli/init-local.d.ts +2 -0
- package/src/cli/init-local.js +109 -0
- package/src/cli/init-local.js.map +1 -0
- package/src/cli/is_ci.d.ts +1 -0
- package/src/cli/is_ci.js +20 -0
- package/src/cli/is_ci.js.map +1 -0
- package/src/cli/output.d.ts +58 -0
- package/src/cli/output.js +129 -0
- package/src/cli/output.js.map +1 -0
- package/src/cli/parse-run-one-options.d.ts +6 -0
- package/src/cli/parse-run-one-options.js +139 -0
- package/src/cli/parse-run-one-options.js.map +1 -0
- package/src/cli/run-cli.d.ts +1 -0
- package/src/cli/run-cli.js +69 -0
- package/src/cli/run-cli.js.map +1 -0
- package/src/cli/workspace.d.ts +4 -0
- package/src/cli/workspace.js +3 -0
- package/src/cli/workspace.js.map +1 -0
- package/src/commands/generate.d.ts +15 -0
- package/src/commands/generate.js +170 -0
- package/src/commands/generate.js.map +1 -0
- package/src/commands/help.d.ts +1 -0
- package/src/commands/help.js +34 -0
- package/src/commands/help.js.map +1 -0
- package/src/commands/migrate.d.ts +77 -0
- package/src/commands/migrate.js +584 -0
- package/src/commands/migrate.js.map +1 -0
- package/src/commands/ngcli-adapter.d.ts +111 -0
- package/src/commands/ngcli-adapter.js +940 -0
- package/src/commands/ngcli-adapter.js.map +1 -0
- package/src/commands/run.d.ts +51 -0
- package/src/commands/run.js +224 -0
- package/src/commands/run.js.map +1 -0
- package/src/compat/compat.d.ts +1 -0
- package/src/compat/compat.js +86 -0
- package/src/compat/compat.js.map +1 -0
- package/src/shared/logger.d.ts +11 -0
- package/src/shared/logger.js +48 -0
- package/src/shared/logger.js.map +1 -0
- package/src/shared/nx-plugin.d.ts +18 -0
- package/src/shared/nx-plugin.js +53 -0
- package/src/shared/nx-plugin.js.map +1 -0
- package/src/shared/nx.d.ts +110 -0
- package/src/shared/nx.js +3 -0
- package/src/shared/nx.js.map +1 -0
- package/src/shared/package-json.d.ts +28 -0
- package/src/shared/package-json.js +10 -0
- package/src/shared/package-json.js.map +1 -0
- package/src/shared/package-manager.d.ts +32 -0
- package/src/shared/package-manager.js +83 -0
- package/src/shared/package-manager.js.map +1 -0
- package/src/shared/params.d.ts +113 -0
- package/src/shared/params.js +587 -0
- package/src/shared/params.js.map +1 -0
- package/src/shared/print-help.d.ts +2 -0
- package/src/shared/print-help.js +32 -0
- package/src/shared/print-help.js.map +1 -0
- package/src/shared/project-graph.d.ts +135 -0
- package/src/shared/project-graph.js +22 -0
- package/src/shared/project-graph.js.map +1 -0
- package/src/shared/tasks.d.ts +82 -0
- package/src/shared/tasks.js +3 -0
- package/src/shared/tasks.js.map +1 -0
- package/src/shared/tree.d.ts +115 -0
- package/src/shared/tree.js +259 -0
- package/src/shared/tree.js.map +1 -0
- package/src/shared/workspace.d.ts +257 -0
- package/src/shared/workspace.js +522 -0
- package/src/shared/workspace.js.map +1 -0
- package/src/utils/app-root.d.ts +2 -0
- package/src/utils/app-root.js +30 -0
- package/src/utils/app-root.js.map +1 -0
- package/src/utils/fileutils.d.ts +31 -0
- package/src/utils/fileutils.js +45 -0
- package/src/utils/fileutils.js.map +1 -0
- package/src/utils/json.d.ts +39 -0
- package/src/utils/json.js +48 -0
- package/src/utils/json.js.map +1 -0
- package/src/utils/object-sort.d.ts +1 -0
- package/src/utils/object-sort.js +12 -0
- package/src/utils/object-sort.js.map +1 -0
- package/src/utils/register.d.ts +9 -0
- package/src/utils/register.js +36 -0
- package/src/utils/register.js.map +1 -0
- package/src/utils/split-target.d.ts +1 -0
- package/src/utils/split-target.js +26 -0
- package/src/utils/split-target.js.map +1 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { NxJsonConfiguration } from './nx';
|
|
2
|
+
import { TaskGraph } from './tasks';
|
|
3
|
+
import { Ignore } from 'ignore';
|
|
4
|
+
export interface Workspace extends WorkspaceJsonConfiguration, NxJsonConfiguration {
|
|
5
|
+
projects: Record<string, ProjectConfiguration>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Workspace configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface WorkspaceJsonConfiguration {
|
|
11
|
+
/**
|
|
12
|
+
* Version of the configuration format
|
|
13
|
+
*/
|
|
14
|
+
version: number;
|
|
15
|
+
/**
|
|
16
|
+
* Projects' projects
|
|
17
|
+
*/
|
|
18
|
+
projects: {
|
|
19
|
+
[projectName: string]: ProjectConfiguration;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface RawWorkspaceJsonConfiguration extends Omit<WorkspaceJsonConfiguration, 'projects'> {
|
|
23
|
+
projects: {
|
|
24
|
+
[projectName: string]: ProjectConfiguration | string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Type of project supported
|
|
29
|
+
*/
|
|
30
|
+
export declare type ProjectType = 'library' | 'application';
|
|
31
|
+
/**
|
|
32
|
+
* Project configuration
|
|
33
|
+
*/
|
|
34
|
+
export interface ProjectConfiguration {
|
|
35
|
+
/**
|
|
36
|
+
* Project's name. Optional if specified in workspace.json
|
|
37
|
+
*/
|
|
38
|
+
name?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Project's targets
|
|
41
|
+
*/
|
|
42
|
+
targets?: {
|
|
43
|
+
[targetName: string]: TargetConfiguration;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Project's location relative to the root of the workspace
|
|
47
|
+
*/
|
|
48
|
+
root: string;
|
|
49
|
+
/**
|
|
50
|
+
* The location of project's sources relative to the root of the workspace
|
|
51
|
+
*/
|
|
52
|
+
sourceRoot?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Project type
|
|
55
|
+
*/
|
|
56
|
+
projectType?: ProjectType;
|
|
57
|
+
/**
|
|
58
|
+
* List of default values used by generators.
|
|
59
|
+
*
|
|
60
|
+
* These defaults are project specific.
|
|
61
|
+
*
|
|
62
|
+
* Example:
|
|
63
|
+
*
|
|
64
|
+
* ```
|
|
65
|
+
* {
|
|
66
|
+
* "@nrwl/react": {
|
|
67
|
+
* "library": {
|
|
68
|
+
* "style": "scss"
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
generators?: {
|
|
75
|
+
[collectionName: string]: {
|
|
76
|
+
[generatorName: string]: any;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* List of projects which are added as a dependency
|
|
81
|
+
*/
|
|
82
|
+
implicitDependencies?: string[];
|
|
83
|
+
/**
|
|
84
|
+
* List of tags used by nx-enforce-module-boundaries / project graph
|
|
85
|
+
*/
|
|
86
|
+
tags?: string[];
|
|
87
|
+
}
|
|
88
|
+
export interface TargetDependencyConfig {
|
|
89
|
+
/**
|
|
90
|
+
* This the projects that the targets belong to
|
|
91
|
+
*
|
|
92
|
+
* 'self': This target depends on another target of the same project
|
|
93
|
+
* 'deps': This target depends on targets of the projects of it's deps.
|
|
94
|
+
*/
|
|
95
|
+
projects: 'self' | 'dependencies';
|
|
96
|
+
/**
|
|
97
|
+
* The name of the target
|
|
98
|
+
*/
|
|
99
|
+
target: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Target's configuration
|
|
103
|
+
*/
|
|
104
|
+
export interface TargetConfiguration {
|
|
105
|
+
/**
|
|
106
|
+
* The executor/builder used to implement the target.
|
|
107
|
+
*
|
|
108
|
+
* Example: '@nrwl/web:rollup'
|
|
109
|
+
*/
|
|
110
|
+
executor: string;
|
|
111
|
+
/**
|
|
112
|
+
* List of the target's outputs. The outputs will be cached by the Nx computation
|
|
113
|
+
* caching engine.
|
|
114
|
+
*/
|
|
115
|
+
outputs?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* This describes other targets that a target depends on.
|
|
118
|
+
*/
|
|
119
|
+
dependsOn?: TargetDependencyConfig[];
|
|
120
|
+
/**
|
|
121
|
+
* Target's options. They are passed in to the executor.
|
|
122
|
+
*/
|
|
123
|
+
options?: any;
|
|
124
|
+
/**
|
|
125
|
+
* Sets of options
|
|
126
|
+
*/
|
|
127
|
+
configurations?: {
|
|
128
|
+
[config: string]: any;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* A default named configuration to use when a target configuration is not provided.
|
|
132
|
+
*/
|
|
133
|
+
defaultConfiguration?: string;
|
|
134
|
+
}
|
|
135
|
+
export declare function workspaceConfigName(root: string): "angular.json" | "workspace.json";
|
|
136
|
+
/**
|
|
137
|
+
* A callback function that is executed after changes are made to the file system
|
|
138
|
+
*/
|
|
139
|
+
export declare type GeneratorCallback = () => void | Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* A function that schedules updates to the filesystem to be done atomically
|
|
142
|
+
*/
|
|
143
|
+
export declare type Generator<T = unknown> = (tree: any, schema: T) => void | GeneratorCallback | Promise<void | GeneratorCallback>;
|
|
144
|
+
export interface ExecutorConfig {
|
|
145
|
+
schema: any;
|
|
146
|
+
hasherFactory?: () => any;
|
|
147
|
+
implementationFactory: () => Executor;
|
|
148
|
+
batchImplementationFactory?: () => TaskGraphExecutor;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Implementation of a target of a project
|
|
152
|
+
*/
|
|
153
|
+
export declare type Executor<T = any> = (
|
|
154
|
+
/**
|
|
155
|
+
* Options that users configure or pass via the command line
|
|
156
|
+
*/
|
|
157
|
+
options: T, context: ExecutorContext) => Promise<{
|
|
158
|
+
success: boolean;
|
|
159
|
+
}> | AsyncIterableIterator<{
|
|
160
|
+
success: boolean;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Implementation of a target of a project that handles multiple projects to be batched
|
|
164
|
+
*/
|
|
165
|
+
export declare type TaskGraphExecutor<T = any> = (
|
|
166
|
+
/**
|
|
167
|
+
* Graph of Tasks to be executed
|
|
168
|
+
*/
|
|
169
|
+
taskGraph: TaskGraph,
|
|
170
|
+
/**
|
|
171
|
+
* Map of Task IDs to options for the task
|
|
172
|
+
*/
|
|
173
|
+
options: Record<string, T>,
|
|
174
|
+
/**
|
|
175
|
+
* Set of overrides for the overall execution
|
|
176
|
+
*/
|
|
177
|
+
overrides: T, context: ExecutorContext) => Promise<Record<string, {
|
|
178
|
+
success: boolean;
|
|
179
|
+
terminalOutput: string;
|
|
180
|
+
}>>;
|
|
181
|
+
/**
|
|
182
|
+
* Context that is passed into an executor
|
|
183
|
+
*/
|
|
184
|
+
export interface ExecutorContext {
|
|
185
|
+
/**
|
|
186
|
+
* The root of the workspace
|
|
187
|
+
*/
|
|
188
|
+
root: string;
|
|
189
|
+
/**
|
|
190
|
+
* The name of the project being executed on
|
|
191
|
+
*/
|
|
192
|
+
projectName?: string;
|
|
193
|
+
/**
|
|
194
|
+
* The name of the target being executed
|
|
195
|
+
*/
|
|
196
|
+
targetName?: string;
|
|
197
|
+
/**
|
|
198
|
+
* The name of the configuration being executed
|
|
199
|
+
*/
|
|
200
|
+
configurationName?: string;
|
|
201
|
+
/**
|
|
202
|
+
* The configuration of the target being executed
|
|
203
|
+
*/
|
|
204
|
+
target?: TargetConfiguration;
|
|
205
|
+
/**
|
|
206
|
+
* The full workspace configuration
|
|
207
|
+
*/
|
|
208
|
+
workspace: WorkspaceJsonConfiguration & NxJsonConfiguration;
|
|
209
|
+
/**
|
|
210
|
+
* The current working directory
|
|
211
|
+
*/
|
|
212
|
+
cwd: string;
|
|
213
|
+
/**
|
|
214
|
+
* Enable verbose logging
|
|
215
|
+
*/
|
|
216
|
+
isVerbose: boolean;
|
|
217
|
+
}
|
|
218
|
+
export declare class Workspaces {
|
|
219
|
+
private root;
|
|
220
|
+
private cachedWorkspaceConfig;
|
|
221
|
+
constructor(root: string);
|
|
222
|
+
relativeCwd(cwd: string): string;
|
|
223
|
+
calculateDefaultProjectName(cwd: string, wc: WorkspaceJsonConfiguration & NxJsonConfiguration): string;
|
|
224
|
+
readWorkspaceConfiguration(): WorkspaceJsonConfiguration & NxJsonConfiguration;
|
|
225
|
+
isNxExecutor(nodeModule: string, executor: string): boolean;
|
|
226
|
+
isNxGenerator(collectionName: string, generatorName: string): boolean;
|
|
227
|
+
readExecutor(nodeModule: string, executor: string): ExecutorConfig;
|
|
228
|
+
readGenerator(collectionName: string, generatorName: string): {
|
|
229
|
+
normalizedGeneratorName: any;
|
|
230
|
+
schema: any;
|
|
231
|
+
implementationFactory: () => Generator<unknown>;
|
|
232
|
+
};
|
|
233
|
+
private getImplementationFactory;
|
|
234
|
+
private readExecutorsJson;
|
|
235
|
+
private readGeneratorsJson;
|
|
236
|
+
private resolvePaths;
|
|
237
|
+
private readFromWorkspaceJson;
|
|
238
|
+
}
|
|
239
|
+
export declare function reformattedWorkspaceJsonOrNull(w: any): any;
|
|
240
|
+
export declare function toNewFormat(w: any): WorkspaceJsonConfiguration;
|
|
241
|
+
export declare function toNewFormatOrNull(w: any): any;
|
|
242
|
+
export declare function toOldFormatOrNull(w: any): any;
|
|
243
|
+
export declare function resolveOldFormatWithInlineProjects(w: any, root?: string): any;
|
|
244
|
+
export declare function resolveNewFormatWithInlineProjects(w: any, root?: string): WorkspaceJsonConfiguration;
|
|
245
|
+
/**
|
|
246
|
+
* Pulled from toFileName in names from @nrwl/devkit.
|
|
247
|
+
* Todo: Should refactor, not duplicate.
|
|
248
|
+
*/
|
|
249
|
+
export declare function toProjectName(fileName: string, nxJson: NxJsonConfiguration): string;
|
|
250
|
+
export declare function globForProjectFiles(root: string, nxJson?: NxJsonConfiguration): string[];
|
|
251
|
+
export declare function deduplicateProjectFiles(files: string[], ig?: Ignore): string[];
|
|
252
|
+
export declare function inferProjectFromNonStandardFile(file: string, nxJson: NxJsonConfiguration): ProjectConfiguration & {
|
|
253
|
+
name: string;
|
|
254
|
+
};
|
|
255
|
+
export declare function buildWorkspaceConfigurationFromGlobs(nxJson: NxJsonConfiguration, projectFiles?: string[], // making this parameter allows devkit to pick up newly created projects
|
|
256
|
+
readJson?: (string: any) => any): WorkspaceJsonConfiguration;
|
|
257
|
+
export declare function renamePropertyWithStableKeys(obj: any, from: string, to: string): void;
|