@nx/devkit 17.0.0-beta.1 → 17.0.0-beta.4

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/index.d.ts CHANGED
@@ -10,10 +10,5 @@
10
10
  *
11
11
  * @module @nx/devkit
12
12
  */
13
-
14
- // TODO(v17): remove this file, we can use the normally generated index.d.ts from index.ts
15
-
16
- /* eslint-disable @typescript-eslint/no-restricted-imports */
17
13
  export * from 'nx/src/devkit-exports';
18
-
19
14
  export * from './public-api';
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * The Nx Devkit is the underlying technology used to customize Nx to support
3
4
  * different technologies and custom use-cases. It contains many utility
@@ -10,18 +11,8 @@
10
11
  *
11
12
  * @module @nx/devkit
12
13
  */
13
-
14
- try {
15
- // TODO(v17): We will not need to maintain this file anymore, change this to a regular export statement
16
- // This file was introduced in the nx package in v15.7 but devkit is compatible down to v14.1 which doesn't have this file.
17
- module.exports = require('nx/src/devkit-exports');
18
- } catch {
19
- // These are the nx-reexports from before v16
20
- // TODO(v17): This can be removed once the above is done.
21
- module.exports = require('./nx-reexports-pre16');
22
- }
23
-
24
- module.exports = {
25
- ...module.exports,
26
- ...require('./public-api'),
27
- };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const tslib_1 = require("tslib");
16
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
17
+ tslib_1.__exportStar(require("nx/src/devkit-exports"), exports);
18
+ tslib_1.__exportStar(require("./public-api"), exports);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @category Ng CLI Adapter
3
3
  */
4
- export { wrapAngularDevkitSchematic, overrideCollectionResolutionForTesting, mockSchematicsForTesting, NxScopedHost, } from 'nx/src/adapter/ngcli-adapter';
4
+ export { wrapAngularDevkitSchematic, mockSchematicsForTesting, NxScopedHost, } from 'nx/src/adapter/ngcli-adapter';
package/ngcli-adapter.js CHANGED
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NxScopedHost = exports.mockSchematicsForTesting = exports.overrideCollectionResolutionForTesting = exports.wrapAngularDevkitSchematic = void 0;
3
+ exports.NxScopedHost = exports.mockSchematicsForTesting = exports.wrapAngularDevkitSchematic = void 0;
4
4
  /**
5
5
  * @category Ng CLI Adapter
6
6
  */
7
7
  // eslint-disable-next-line @typescript-eslint/no-restricted-imports
8
8
  var ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
9
9
  Object.defineProperty(exports, "wrapAngularDevkitSchematic", { enumerable: true, get: function () { return ngcli_adapter_1.wrapAngularDevkitSchematic; } });
10
- Object.defineProperty(exports, "overrideCollectionResolutionForTesting", { enumerable: true, get: function () { return ngcli_adapter_1.overrideCollectionResolutionForTesting; } });
11
10
  Object.defineProperty(exports, "mockSchematicsForTesting", { enumerable: true, get: function () { return ngcli_adapter_1.mockSchematicsForTesting; } });
12
11
  Object.defineProperty(exports, "NxScopedHost", { enumerable: true, get: function () { return ngcli_adapter_1.NxScopedHost; } });
package/nx.js CHANGED
@@ -5,21 +5,15 @@ exports.requireNx = void 0;
5
5
  // - import {} from 'nx/src/devkit-exports'
6
6
  // - import {} from 'nx/src/devkit-internals'
7
7
  function requireNx() {
8
+ let result = { ...require('nx/src/devkit-exports') };
8
9
  try {
9
- let result = { ...require('nx/src/devkit-exports') };
10
- try {
11
- result = {
12
- ...result,
13
- // Remove in Nx v18, devkit should not support Nx v16.0.2 at that point.
14
- ...require('nx/src/devkit-internals'),
15
- };
16
- }
17
- catch { }
18
- return result;
19
- }
20
- catch {
21
- // Remove in Nx V17, devkit should not support Nx < 16 at that point.
22
- return require('./nx-reexports-pre16');
10
+ result = {
11
+ ...result,
12
+ // Remove in Nx v18, devkit should not support Nx v16.0.2 at that point.
13
+ ...require('nx/src/devkit-internals'),
14
+ };
23
15
  }
16
+ catch { }
17
+ return result;
24
18
  }
25
19
  exports.requireNx = requireNx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/devkit",
3
- "version": "17.0.0-beta.1",
3
+ "version": "17.0.0-beta.4",
4
4
  "private": false,
5
5
  "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.",
6
6
  "repository": {
@@ -34,10 +34,10 @@
34
34
  "tmp": "~0.2.1",
35
35
  "tslib": "^2.3.0",
36
36
  "semver": "7.5.3",
37
- "@nrwl/devkit": "17.0.0-beta.1"
37
+ "@nrwl/devkit": "17.0.0-beta.4"
38
38
  },
39
39
  "peerDependencies": {
40
- "nx": ">= 15 <= 17"
40
+ "nx": ">= 16 <= 18"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -0,0 +1,42 @@
1
+ import type { Tree } from 'nx/src/generators/tree';
2
+ export type NameAndDirectoryFormat = 'as-provided' | 'derived';
3
+ export type ArtifactGenerationOptions = {
4
+ artifactType: string;
5
+ callingGenerator: string | null;
6
+ name: string;
7
+ directory?: string;
8
+ disallowPathInNameForDerived?: boolean;
9
+ fileExtension?: 'js' | 'jsx' | 'ts' | 'tsx';
10
+ fileName?: string;
11
+ flat?: boolean;
12
+ nameAndDirectoryFormat?: NameAndDirectoryFormat;
13
+ pascalCaseDirectory?: boolean;
14
+ pascalCaseFile?: boolean;
15
+ project?: string;
16
+ suffix?: string;
17
+ };
18
+ export type NameAndDirectoryOptions = {
19
+ /**
20
+ * Normalized artifact name.
21
+ */
22
+ artifactName: string;
23
+ /**
24
+ * Normalized directory path where the artifact will be generated.
25
+ */
26
+ directory: string;
27
+ /**
28
+ * Normalized file name of the artifact without the extension.
29
+ */
30
+ fileName: string;
31
+ /**
32
+ * Normalized full file path of the artifact.
33
+ */
34
+ filePath: string;
35
+ /**
36
+ * Project name where the artifact will be generated.
37
+ */
38
+ project: string;
39
+ };
40
+ export declare function determineArtifactNameAndDirectoryOptions(tree: Tree, options: ArtifactGenerationOptions): Promise<NameAndDirectoryOptions & {
41
+ nameAndDirectoryFormat: NameAndDirectoryFormat;
42
+ }>;
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.determineArtifactNameAndDirectoryOptions = void 0;
4
+ const enquirer_1 = require("enquirer");
5
+ const path_1 = require("path");
6
+ const nx_1 = require("../../nx");
7
+ const names_1 = require("../utils/names");
8
+ const { createProjectRootMappingsFromProjectConfigurations, findProjectForPath, getProjects, joinPathFragments, logger, normalizePath, output, workspaceRoot, } = (0, nx_1.requireNx)();
9
+ async function determineArtifactNameAndDirectoryOptions(tree, options) {
10
+ const formats = getNameAndDirectoryOptionFormats(tree, options);
11
+ const format = options.nameAndDirectoryFormat ?? (await determineFormat(formats, options));
12
+ validateResolvedProject(formats[format]?.project, options, formats[format]?.directory);
13
+ return {
14
+ ...formats[format],
15
+ nameAndDirectoryFormat: format,
16
+ };
17
+ }
18
+ exports.determineArtifactNameAndDirectoryOptions = determineArtifactNameAndDirectoryOptions;
19
+ async function determineFormat(formats, options) {
20
+ if (!formats.derived) {
21
+ return 'as-provided';
22
+ }
23
+ if (process.env.NX_INTERACTIVE !== 'true' || !isTTY()) {
24
+ logDeprecationMessage(options, formats);
25
+ return 'derived';
26
+ }
27
+ const asProvidedDescription = `As provided: ${formats['as-provided'].filePath}`;
28
+ const asProvidedSelectedValue = formats['as-provided'].filePath;
29
+ const derivedDescription = `Derived: ${formats['derived'].filePath}`;
30
+ const derivedSelectedValue = formats['derived'].filePath;
31
+ if (asProvidedSelectedValue === derivedSelectedValue) {
32
+ return 'as-provided';
33
+ }
34
+ const result = await (0, enquirer_1.prompt)({
35
+ type: 'select',
36
+ name: 'format',
37
+ message: `Where should the ${options.artifactType} be generated?`,
38
+ choices: [
39
+ {
40
+ message: asProvidedDescription,
41
+ name: asProvidedSelectedValue,
42
+ },
43
+ {
44
+ message: derivedDescription,
45
+ name: derivedSelectedValue,
46
+ },
47
+ ],
48
+ initial: 'as-provided',
49
+ }).then(({ format }) => format === asProvidedSelectedValue ? 'as-provided' : 'derived');
50
+ if (result === 'derived' && options.callingGenerator) {
51
+ logDeprecationMessage(options, formats);
52
+ }
53
+ return result;
54
+ }
55
+ function logDeprecationMessage(options, formats) {
56
+ logger.warn(`
57
+ In Nx 18, generating a ${options.artifactType} will no longer support providing a project and deriving the directory.
58
+ Please provide the exact directory in the future.
59
+ Example: nx g ${options.callingGenerator} ${formats['derived'].artifactName} --directory ${formats['derived'].directory}
60
+ NOTE: The example above assumes the command is being run from the workspace root. If the command is being run from a subdirectory, the directory option should be adjusted accordingly.
61
+ `);
62
+ }
63
+ function getNameAndDirectoryOptionFormats(tree, options) {
64
+ const directory = options.directory
65
+ ? normalizePath(options.directory.replace(/^\.?\//, ''))
66
+ : undefined;
67
+ const fileExtension = options.fileExtension ?? 'ts';
68
+ const { name: extractedName, directory: extractedDirectory } = extractNameAndDirectoryFromName(options.name);
69
+ if (extractedDirectory && directory) {
70
+ throw new Error(`You can't specify both a directory (${options.directory}) and a name with a directory path (${options.name}). ` +
71
+ `Please specify either a directory or a name with a directory path.`);
72
+ }
73
+ const asProvidedOptions = getAsProvidedOptions(tree, {
74
+ ...options,
75
+ directory: directory ?? extractedDirectory,
76
+ fileExtension,
77
+ name: extractedName,
78
+ });
79
+ if (!options.project) {
80
+ validateResolvedProject(asProvidedOptions.project, options, asProvidedOptions.directory);
81
+ }
82
+ if (options.nameAndDirectoryFormat === 'as-provided') {
83
+ return {
84
+ 'as-provided': asProvidedOptions,
85
+ derived: undefined,
86
+ };
87
+ }
88
+ if (options.disallowPathInNameForDerived && options.name.includes('/')) {
89
+ if (!options.nameAndDirectoryFormat) {
90
+ output.warn({
91
+ title: `The provided name "${options.name}" contains a path and this is not supported by the "${options.callingGenerator}" when using the "derived" format.`,
92
+ bodyLines: [
93
+ `The generator will try to generate the ${options.artifactType} using the "as-provided" format at "${asProvidedOptions.filePath}".`,
94
+ ],
95
+ });
96
+ return {
97
+ 'as-provided': asProvidedOptions,
98
+ derived: undefined,
99
+ };
100
+ }
101
+ throw new Error(`The provided name "${options.name}" contains a path and this is not supported by the "${options.callingGenerator}" when using the "derived" format. ` +
102
+ `Please provide a name without a path or use the "as-provided" format.`);
103
+ }
104
+ const derivedOptions = getDerivedOptions(tree, {
105
+ ...options,
106
+ directory,
107
+ fileExtension,
108
+ name: extractedName,
109
+ }, asProvidedOptions, !options.disallowPathInNameForDerived && extractedDirectory
110
+ ? extractedDirectory
111
+ : undefined);
112
+ return {
113
+ 'as-provided': asProvidedOptions,
114
+ derived: derivedOptions,
115
+ };
116
+ }
117
+ function getAsProvidedOptions(tree, options) {
118
+ const relativeCwd = getRelativeCwd();
119
+ const asProvidedDirectory = options.directory
120
+ ? joinPathFragments(relativeCwd, options.directory)
121
+ : relativeCwd;
122
+ const asProvidedProject = findProjectFromPath(tree, asProvidedDirectory);
123
+ const asProvidedFileName = options.fileName ??
124
+ (options.suffix ? `${options.name}.${options.suffix}` : options.name);
125
+ const asProvidedFilePath = joinPathFragments(asProvidedDirectory, `${asProvidedFileName}.${options.fileExtension}`);
126
+ return {
127
+ artifactName: options.name,
128
+ directory: asProvidedDirectory,
129
+ fileName: asProvidedFileName,
130
+ filePath: asProvidedFilePath,
131
+ project: asProvidedProject,
132
+ };
133
+ }
134
+ function getDerivedOptions(tree, options, asProvidedOptions, extractedDirectory) {
135
+ const projects = getProjects(tree);
136
+ if (options.project && !projects.has(options.project)) {
137
+ throw new Error(`The provided project "${options.project}" does not exist! Please provide an existing project name.`);
138
+ }
139
+ const projectName = options.project ?? asProvidedOptions.project;
140
+ const project = projects.get(projectName);
141
+ const derivedName = options.name;
142
+ const baseDirectory = options.directory
143
+ ? (0, names_1.names)(options.directory).fileName
144
+ : joinPathFragments(project.sourceRoot ?? joinPathFragments(project.root, 'src'), project.projectType === 'application' ? 'app' : 'lib', extractedDirectory ?? '');
145
+ const derivedDirectory = options.flat
146
+ ? normalizePath(baseDirectory)
147
+ : joinPathFragments(baseDirectory, options.pascalCaseDirectory
148
+ ? (0, names_1.names)(derivedName).className
149
+ : (0, names_1.names)(derivedName).fileName);
150
+ if (options.directory &&
151
+ !isDirectoryUnderProjectRoot(derivedDirectory, project.root)) {
152
+ if (!options.nameAndDirectoryFormat) {
153
+ output.warn({
154
+ title: `The provided directory "${options.directory}" is not under the provided project root "${project.root}".`,
155
+ bodyLines: [
156
+ `The generator will try to generate the ${options.artifactType} using the "as-provided" format.`,
157
+ `With the "as-provided" format, the "project" option is ignored and the ${options.artifactType} will be generated at "${asProvidedOptions.filePath}" (<cwd>/<provided directory>).`,
158
+ ],
159
+ });
160
+ return undefined;
161
+ }
162
+ throw new Error(`The provided directory "${options.directory}" is not under the provided project root "${project.root}". ` +
163
+ `Please provide a directory that is under the provided project root or use the "as-provided" format and only provide the directory.`);
164
+ }
165
+ let derivedFileName = options.fileName;
166
+ if (!derivedFileName) {
167
+ derivedFileName = options.suffix
168
+ ? `${derivedName}.${options.suffix}`
169
+ : derivedName;
170
+ derivedFileName = options.pascalCaseFile
171
+ ? (0, names_1.names)(derivedFileName).className
172
+ : (0, names_1.names)(derivedFileName).fileName;
173
+ }
174
+ const derivedFilePath = joinPathFragments(derivedDirectory, `${derivedFileName}.${options.fileExtension}`);
175
+ return {
176
+ artifactName: derivedName,
177
+ directory: derivedDirectory,
178
+ fileName: derivedFileName,
179
+ filePath: derivedFilePath,
180
+ project: projectName,
181
+ };
182
+ }
183
+ function validateResolvedProject(project, options, normalizedDirectory) {
184
+ if (project) {
185
+ return;
186
+ }
187
+ if (options.directory) {
188
+ throw new Error(`The provided directory resolved relative to the current working directory "${normalizedDirectory}" does not exist under any project root. ` +
189
+ `Please make sure to navigate to a location or provide a directory that exists under a project root.`);
190
+ }
191
+ throw new Error(`The current working directory "${getRelativeCwd() || '.'}" does not exist under any project root. ` +
192
+ `Please make sure to navigate to a location or provide a directory that exists under a project root.`);
193
+ }
194
+ function findProjectFromPath(tree, path) {
195
+ const projectConfigurations = {};
196
+ const projects = getProjects(tree);
197
+ for (const [projectName, project] of projects) {
198
+ projectConfigurations[projectName] = project;
199
+ }
200
+ const projectRootMappings = createProjectRootMappingsFromProjectConfigurations(projectConfigurations);
201
+ return findProjectForPath(path, projectRootMappings);
202
+ }
203
+ function isDirectoryUnderProjectRoot(directory, projectRoot) {
204
+ const normalizedDirectory = joinPathFragments(workspaceRoot, directory);
205
+ const normalizedProjectRoot = joinPathFragments(workspaceRoot, projectRoot).replace(/\/$/, '');
206
+ return (normalizedDirectory === normalizedProjectRoot ||
207
+ normalizedDirectory.startsWith(`${normalizedProjectRoot}/`));
208
+ }
209
+ function isTTY() {
210
+ return !!process.stdout.isTTY && process.env['CI'] !== 'true';
211
+ }
212
+ function getRelativeCwd() {
213
+ return normalizePath((0, path_1.relative)(workspaceRoot, getCwd()));
214
+ }
215
+ function getCwd() {
216
+ return process.env.INIT_CWD?.startsWith(workspaceRoot)
217
+ ? process.env.INIT_CWD
218
+ : process.cwd();
219
+ }
220
+ function extractNameAndDirectoryFromName(rawName) {
221
+ const parsedName = normalizePath(rawName).split('/');
222
+ const name = parsedName.pop();
223
+ const directory = parsedName.length ? parsedName.join('/') : undefined;
224
+ return { name, directory };
225
+ }
package/testing.d.ts CHANGED
@@ -1,2 +1 @@
1
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
2
1
  export * from 'nx/src/devkit-testing-exports';
package/testing.js CHANGED
@@ -1,9 +1,5 @@
1
- try {
2
- // TODO(v17): We will not need to maintain this file anymore, change this to a regular export statement
3
- // This file was introduced in the nx package in v15.7 but devkit is compatible down to v14.1 which doesn't have this file.
4
- module.exports = require('nx/src/devkit-testing-exports');
5
- } catch {
6
- // These are the nx-reexports from before v16
7
- // TODO(v17): This can be removed once the above is done.
8
- module.exports = require('./testing-pre16');
9
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
5
+ tslib_1.__exportStar(require("nx/src/devkit-testing-exports"), exports);
@@ -1,127 +0,0 @@
1
- /**
2
- * STOP! Do not change this file!
3
- *
4
- * If you need to export something from nx, it should go into nx/src/devkit-exports
5
- */
6
- /**
7
- * @category Tree
8
- */
9
- export type { Tree, FileChange } from 'nx/src/generators/tree';
10
- /**
11
- * @category Workspace
12
- */
13
- export type { WorkspaceJsonConfiguration, ProjectsConfigurations, TargetDependencyConfig, TargetConfiguration, ProjectConfiguration, ProjectType, Workspace, } from 'nx/src/config/workspace-json-project-json';
14
- /**
15
- * @category Workspace
16
- */
17
- export type { Generator, GeneratorCallback, Executor, ExecutorContext, TaskGraphExecutor, GeneratorsJson, ExecutorsJson, MigrationsJson, CustomHasher, HasherContext, } from 'nx/src/config/misc-interfaces';
18
- /**
19
- * @category Workspace
20
- */
21
- export { Workspaces } from 'nx/src/config/workspaces';
22
- export { workspaceLayout } from 'nx/src/config/configuration';
23
- export type { NxPlugin, ProjectTargetConfigurator, } from 'nx/src/utils/nx-plugin';
24
- /**
25
- * @category Workspace
26
- */
27
- export type { Task, TaskGraph } from 'nx/src/config/task-graph';
28
- /**
29
- * @category Workspace
30
- */
31
- export type { ImplicitDependencyEntry, ImplicitJsonSubsetDependency, NxJsonConfiguration, NxAffectedConfig, } from 'nx/src/config/nx-json';
32
- /**
33
- * @category Logger
34
- */
35
- export { logger } from 'nx/src/utils/logger';
36
- /**
37
- * @category Utils
38
- */
39
- export { output } from 'nx/src/utils/output';
40
- /**
41
- * @category Package Manager
42
- */
43
- export type { PackageManager } from 'nx/src/utils/package-manager';
44
- /**
45
- * @category Package Manager
46
- */
47
- export { getPackageManagerCommand, detectPackageManager, getPackageManagerVersion, } from 'nx/src/utils/package-manager';
48
- /**
49
- * @category Commands
50
- */
51
- export type { Target } from 'nx/src/command-line/run';
52
- /**
53
- * @category Commands
54
- */
55
- export { runExecutor } from 'nx/src/command-line/run';
56
- /**
57
- * @category Generators
58
- */
59
- export { addProjectConfiguration, readProjectConfiguration, removeProjectConfiguration, updateProjectConfiguration, getProjects, } from 'nx/src/generators/utils/project-configuration';
60
- /**
61
- * @category Generators
62
- */
63
- export { readNxJson, updateNxJson, readWorkspaceConfiguration, updateWorkspaceConfiguration, isStandaloneProject, WorkspaceConfiguration, getWorkspacePath, } from 'nx/src/generators/utils/project-configuration';
64
- /**
65
- * @category Project Graph
66
- */
67
- export type { ProjectFileMap, FileData, ProjectGraph, ProjectGraphDependency, ProjectGraphNode, ProjectGraphProjectNode, ProjectGraphExternalNode, ProjectGraphProcessorContext, } from 'nx/src/config/project-graph';
68
- /**
69
- * @category Project Graph
70
- */
71
- export { DependencyType } from 'nx/src/config/project-graph';
72
- /**
73
- * @category Project Graph
74
- */
75
- export { ProjectGraphBuilder } from 'nx/src/project-graph/project-graph-builder';
76
- /**
77
- * @category Utils
78
- */
79
- export { readJson, writeJson, updateJson } from 'nx/src/generators/utils/json';
80
- /**
81
- * @category Utils
82
- */
83
- export { parseJson, serializeJson, stripJsonComments } from 'nx/src/utils/json';
84
- /**
85
- * @category Utils
86
- */
87
- export type { JsonParseOptions, JsonSerializeOptions } from 'nx/src/utils/json';
88
- /**
89
- * @category Utils
90
- */
91
- export { readJsonFile, writeJsonFile } from 'nx/src/utils/fileutils';
92
- /**
93
- * @category Utils
94
- */
95
- export { stripIndents } from 'nx/src/utils/strip-indents';
96
- /**
97
- * @category Utils
98
- */
99
- export { joinPathFragments, normalizePath } from 'nx/src/utils/path';
100
- /**
101
- * @category Utils
102
- */
103
- export { workspaceRoot, appRootPath } from 'nx/src/utils/app-root';
104
- /**
105
- * @category Utils
106
- */
107
- export { reverse } from 'nx/src/project-graph/operators';
108
- /**
109
- * @category Utils
110
- */
111
- export { createProjectGraphAsync, readCachedProjectGraph, } from 'nx/src/project-graph/project-graph';
112
- /**
113
- * @category Utils
114
- */
115
- export { getOutputsForTargetAndConfiguration } from 'nx/src/tasks-runner/utils';
116
- /**
117
- * @category Utils
118
- */
119
- export { defaultTasksRunner, DefaultTasksRunnerOptions, RemoteCache, } from 'nx/src/tasks-runner/default-tasks-runner';
120
- /**
121
- * @category Utils
122
- */
123
- export { Hash, TaskHasher, Hasher } from 'nx/src/hasher/task-hasher';
124
- /**
125
- * @category Utils
126
- */
127
- export { cacheDir } from 'nx/src/utils/cache-directory';
@@ -1,131 +0,0 @@
1
- "use strict";
2
- /**
3
- * STOP! Do not change this file!
4
- *
5
- * If you need to export something from nx, it should go into nx/src/devkit-exports
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.cacheDir = exports.defaultTasksRunner = exports.getOutputsForTargetAndConfiguration = exports.readCachedProjectGraph = exports.createProjectGraphAsync = exports.reverse = exports.appRootPath = exports.workspaceRoot = exports.normalizePath = exports.joinPathFragments = exports.stripIndents = exports.writeJsonFile = exports.readJsonFile = exports.stripJsonComments = exports.serializeJson = exports.parseJson = exports.updateJson = exports.writeJson = exports.readJson = exports.ProjectGraphBuilder = exports.DependencyType = exports.getWorkspacePath = exports.isStandaloneProject = exports.updateWorkspaceConfiguration = exports.readWorkspaceConfiguration = exports.updateNxJson = exports.readNxJson = exports.getProjects = exports.updateProjectConfiguration = exports.removeProjectConfiguration = exports.readProjectConfiguration = exports.addProjectConfiguration = exports.runExecutor = exports.getPackageManagerVersion = exports.detectPackageManager = exports.getPackageManagerCommand = exports.output = exports.logger = exports.workspaceLayout = exports.Workspaces = void 0;
9
- /**
10
- * @category Workspace
11
- */
12
- var workspaces_1 = require("nx/src/config/workspaces");
13
- Object.defineProperty(exports, "Workspaces", { enumerable: true, get: function () { return workspaces_1.Workspaces; } });
14
- var configuration_1 = require("nx/src/config/configuration");
15
- Object.defineProperty(exports, "workspaceLayout", { enumerable: true, get: function () { return configuration_1.workspaceLayout; } });
16
- /**
17
- * @category Logger
18
- */
19
- var logger_1 = require("nx/src/utils/logger");
20
- Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
21
- /**
22
- * @category Utils
23
- */
24
- var output_1 = require("nx/src/utils/output");
25
- Object.defineProperty(exports, "output", { enumerable: true, get: function () { return output_1.output; } });
26
- /**
27
- * @category Package Manager
28
- */
29
- var package_manager_1 = require("nx/src/utils/package-manager");
30
- Object.defineProperty(exports, "getPackageManagerCommand", { enumerable: true, get: function () { return package_manager_1.getPackageManagerCommand; } });
31
- Object.defineProperty(exports, "detectPackageManager", { enumerable: true, get: function () { return package_manager_1.detectPackageManager; } });
32
- Object.defineProperty(exports, "getPackageManagerVersion", { enumerable: true, get: function () { return package_manager_1.getPackageManagerVersion; } });
33
- /**
34
- * @category Commands
35
- */
36
- var run_1 = require("nx/src/command-line/run");
37
- Object.defineProperty(exports, "runExecutor", { enumerable: true, get: function () { return run_1.runExecutor; } });
38
- /**
39
- * @category Generators
40
- */
41
- var project_configuration_1 = require("nx/src/generators/utils/project-configuration");
42
- Object.defineProperty(exports, "addProjectConfiguration", { enumerable: true, get: function () { return project_configuration_1.addProjectConfiguration; } });
43
- Object.defineProperty(exports, "readProjectConfiguration", { enumerable: true, get: function () { return project_configuration_1.readProjectConfiguration; } });
44
- Object.defineProperty(exports, "removeProjectConfiguration", { enumerable: true, get: function () { return project_configuration_1.removeProjectConfiguration; } });
45
- Object.defineProperty(exports, "updateProjectConfiguration", { enumerable: true, get: function () { return project_configuration_1.updateProjectConfiguration; } });
46
- Object.defineProperty(exports, "getProjects", { enumerable: true, get: function () { return project_configuration_1.getProjects; } });
47
- /**
48
- * @category Generators
49
- */
50
- var project_configuration_2 = require("nx/src/generators/utils/project-configuration");
51
- Object.defineProperty(exports, "readNxJson", { enumerable: true, get: function () { return project_configuration_2.readNxJson; } });
52
- Object.defineProperty(exports, "updateNxJson", { enumerable: true, get: function () { return project_configuration_2.updateNxJson; } });
53
- Object.defineProperty(exports, "readWorkspaceConfiguration", { enumerable: true, get: function () { return project_configuration_2.readWorkspaceConfiguration; } });
54
- Object.defineProperty(exports, "updateWorkspaceConfiguration", { enumerable: true, get: function () { return project_configuration_2.updateWorkspaceConfiguration; } });
55
- Object.defineProperty(exports, "isStandaloneProject", { enumerable: true, get: function () { return project_configuration_2.isStandaloneProject; } });
56
- Object.defineProperty(exports, "getWorkspacePath", { enumerable: true, get: function () { return project_configuration_2.getWorkspacePath; } });
57
- /**
58
- * @category Project Graph
59
- */
60
- var project_graph_1 = require("nx/src/config/project-graph");
61
- Object.defineProperty(exports, "DependencyType", { enumerable: true, get: function () { return project_graph_1.DependencyType; } });
62
- /**
63
- * @category Project Graph
64
- */
65
- var project_graph_builder_1 = require("nx/src/project-graph/project-graph-builder");
66
- Object.defineProperty(exports, "ProjectGraphBuilder", { enumerable: true, get: function () { return project_graph_builder_1.ProjectGraphBuilder; } });
67
- /**
68
- * @category Utils
69
- */
70
- var json_1 = require("nx/src/generators/utils/json");
71
- Object.defineProperty(exports, "readJson", { enumerable: true, get: function () { return json_1.readJson; } });
72
- Object.defineProperty(exports, "writeJson", { enumerable: true, get: function () { return json_1.writeJson; } });
73
- Object.defineProperty(exports, "updateJson", { enumerable: true, get: function () { return json_1.updateJson; } });
74
- /**
75
- * @category Utils
76
- */
77
- var json_2 = require("nx/src/utils/json");
78
- Object.defineProperty(exports, "parseJson", { enumerable: true, get: function () { return json_2.parseJson; } });
79
- Object.defineProperty(exports, "serializeJson", { enumerable: true, get: function () { return json_2.serializeJson; } });
80
- Object.defineProperty(exports, "stripJsonComments", { enumerable: true, get: function () { return json_2.stripJsonComments; } });
81
- /**
82
- * @category Utils
83
- */
84
- var fileutils_1 = require("nx/src/utils/fileutils");
85
- Object.defineProperty(exports, "readJsonFile", { enumerable: true, get: function () { return fileutils_1.readJsonFile; } });
86
- Object.defineProperty(exports, "writeJsonFile", { enumerable: true, get: function () { return fileutils_1.writeJsonFile; } });
87
- /**
88
- * @category Utils
89
- */
90
- var strip_indents_1 = require("nx/src/utils/strip-indents");
91
- Object.defineProperty(exports, "stripIndents", { enumerable: true, get: function () { return strip_indents_1.stripIndents; } });
92
- /**
93
- * @category Utils
94
- */
95
- var path_1 = require("nx/src/utils/path");
96
- Object.defineProperty(exports, "joinPathFragments", { enumerable: true, get: function () { return path_1.joinPathFragments; } });
97
- Object.defineProperty(exports, "normalizePath", { enumerable: true, get: function () { return path_1.normalizePath; } });
98
- // TODO(v16): Change this to export from 'nx/src/utils/workspace-root'
99
- /**
100
- * @category Utils
101
- */
102
- var app_root_1 = require("nx/src/utils/app-root");
103
- Object.defineProperty(exports, "workspaceRoot", { enumerable: true, get: function () { return app_root_1.workspaceRoot; } });
104
- Object.defineProperty(exports, "appRootPath", { enumerable: true, get: function () { return app_root_1.appRootPath; } });
105
- /**
106
- * @category Utils
107
- */
108
- var operators_1 = require("nx/src/project-graph/operators");
109
- Object.defineProperty(exports, "reverse", { enumerable: true, get: function () { return operators_1.reverse; } });
110
- /**
111
- * @category Utils
112
- */
113
- var project_graph_2 = require("nx/src/project-graph/project-graph");
114
- Object.defineProperty(exports, "createProjectGraphAsync", { enumerable: true, get: function () { return project_graph_2.createProjectGraphAsync; } });
115
- Object.defineProperty(exports, "readCachedProjectGraph", { enumerable: true, get: function () { return project_graph_2.readCachedProjectGraph; } });
116
- /**
117
- * @category Utils
118
- */
119
- var utils_1 = require("nx/src/tasks-runner/utils");
120
- Object.defineProperty(exports, "getOutputsForTargetAndConfiguration", { enumerable: true, get: function () { return utils_1.getOutputsForTargetAndConfiguration; } });
121
- /**
122
- * @category Utils
123
- */
124
- var default_tasks_runner_1 = require("nx/src/tasks-runner/default-tasks-runner");
125
- Object.defineProperty(exports, "defaultTasksRunner", { enumerable: true, get: function () { return default_tasks_runner_1.defaultTasksRunner; } });
126
- /**
127
- * @category Utils
128
- */
129
- var cache_directory_1 = require("nx/src/utils/cache-directory");
130
- Object.defineProperty(exports, "cacheDir", { enumerable: true, get: function () { return cache_directory_1.cacheDir; } });
131
- // STOP! Do not export any new things from the nx package
@@ -1,2 +0,0 @@
1
- export { createTreeWithEmptyWorkspace, createTreeWithEmptyV1Workspace, } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace';
2
- export { createTree } from 'nx/src/generators/testing-utils/create-tree';
package/testing-pre16.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTree = exports.createTreeWithEmptyV1Workspace = exports.createTreeWithEmptyWorkspace = void 0;
4
- /* eslint-disable @typescript-eslint/no-restricted-imports */
5
- var create_tree_with_empty_workspace_1 = require("nx/src/generators/testing-utils/create-tree-with-empty-workspace");
6
- Object.defineProperty(exports, "createTreeWithEmptyWorkspace", { enumerable: true, get: function () { return create_tree_with_empty_workspace_1.createTreeWithEmptyWorkspace; } });
7
- Object.defineProperty(exports, "createTreeWithEmptyV1Workspace", { enumerable: true, get: function () { return create_tree_with_empty_workspace_1.createTreeWithEmptyV1Workspace; } });
8
- var create_tree_1 = require("nx/src/generators/testing-utils/create-tree");
9
- Object.defineProperty(exports, "createTree", { enumerable: true, get: function () { return create_tree_1.createTree; } });