@nx/devkit 24.0.0-canary.20261013-994ecba → 24.0.0-pr.37405.acdaf31
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/dist/internal.d.ts +2 -0
- package/dist/internal.js +8 -4
- package/dist/src/utils/nx-directives.d.ts +6 -0
- package/dist/src/utils/nx-directives.js +59 -0
- package/dist/src/utils/test-file-depends-on.d.ts +11 -0
- package/dist/src/utils/test-file-depends-on.js +63 -0
- package/dist/src/utils/test-file-directives.d.ts +12 -0
- package/dist/src/utils/test-file-directives.js +59 -0
- package/dist/src/utils/ultracache-directive.d.ts +8 -0
- package/dist/src/utils/ultracache-directive.js +19 -0
- package/dist/src/utils/without-server-inputs.d.ts +6 -0
- package/dist/src/utils/without-server-inputs.js +12 -0
- package/package.json +2 -2
package/dist/internal.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export { loadConfigFile, clearRequireCache } from './src/utils/config-utils';
|
|
|
21
21
|
export { isRequireEsmRaceError, retryOnRequireEsmRace, } from './src/utils/require-esm-race';
|
|
22
22
|
export { findPluginForConfigFile } from './src/utils/find-plugin-for-config-file';
|
|
23
23
|
export { getNamedInputs } from './src/utils/get-named-inputs';
|
|
24
|
+
export { applyTestFileDirectives } from './src/utils/test-file-directives';
|
|
25
|
+
export { hasUltracacheImportsDirective } from './src/utils/ultracache-directive';
|
|
24
26
|
export { logShowProjectCommand } from './src/utils/log-show-project-command';
|
|
25
27
|
export { eachValueFrom } from './src/utils/rxjs-for-await';
|
|
26
28
|
export { checkAndCleanWithSemver } from './src/utils/semver';
|
package/dist/internal.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInstalledPackageVersion = exports.getDeclaredPackageVersion = exports.addPlugin = exports.upsertTargetDefault = exports.updateTargetDefault = exports.readTargetDefaultsForTarget = exports.findTargetDefault = exports.addE2eCiTargetDefaults = exports.addBuildTargetDefaults = exports.isInteractive = exports.resolveImportPath = exports.ensureRootProjectName = exports.determineProjectNameAndRootOptions = exports.toProjectRelativePath = exports.deleteMatchingProperties = exports.processTargetOutputs = exports.NoTargetsToMigrateError = exports.migrateProjectExecutorsToPluginV1 = exports.migrateProjectExecutorsToPlugin = exports.openBatchConversionSession = exports.finalizeBatchConversion = exports.AggregatedLog = exports.forEachExecutorOptions = exports.getE2EWebServerInfo = exports.getRelativeCwd = exports.determineArtifactNameAndDirectoryOptions = exports.oxfmtConfigFiles = exports.prettierConfigFiles = exports.detectFormatterInTree = exports.hashDaemonClientEnv = exports.getGraphTimeDotEnvForTask = exports.applyDaemonEnvFromClient = exports.getAppliedDaemonClientEnv = exports.getDaemonClientEnvGeneration = exports.getCatalogManager = exports.isAiAgent = exports.createOverrides = exports.createCliOptions = exports.acknowledgeBuildScripts = exports.PromptResolutionError = exports.resolvePrompt = exports.SchemaResolutionError = exports.ImplementationResolutionError = exports.resolveSchema = exports.resolveImplementation = exports.emitPluginWorkerLog = exports.safeWriteFileCache = exports.PluginCache = exports.createProjectRootMappingsFromProjectConfigurations = exports.signalToCode = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.workspaceRootInner = exports.workspaceDataDirectory = exports.warnUnshippableLocalPathSpec = exports.validateOutputs = exports.unparse = exports.textPrompt = exports.transformLegacyOutputs = exports.toOldFormat = exports.toNewFormat = exports.shouldStreamOutput = exports.setupWorkspaceContext = exports.setupAiAgentsGenerator = exports.setWorkspaceRoot = exports.selectPrompt = exports.safeSpawn = exports.safeExecFileSync = exports.runNxSync = exports.resolveCommandSyntacticSugar = exports.resetWorkspaceContext = void 0;
|
|
4
|
+
exports.createLockFile = exports.createDirectory = exports.connectToNxCloud = exports.combineGlobPatterns = exports.codeFrameColumns = exports.calculateReverseDeps = exports.calculateFileChanges = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.buildPackageJsonWorkspacesMatcher = exports.buildPackageJsonPatterns = exports.WholeFileChange = exports.TargetProjectLocator = exports.TEN_MEGABYTES = exports.SyncError = exports.RemoteCacheV2 = exports.NX_PREFIX = exports.LockFileChange = exports.LARGE_BUFFER = exports.FsTree = exports.confirmationPrompt = exports.DeletedFileChange = exports.CompositeLifeCycle = exports.Cache = exports.BatchFunctionRunner = exports.runCommandsExecutor = exports.dasherize = exports.classify = exports.capitalize = exports.camelize = exports.checkAndCleanWithSemver = exports.eachValueFrom = exports.logShowProjectCommand = exports.hasUltracacheImportsDirective = exports.applyTestFileDirectives = exports.getNamedInputs = exports.findPluginForConfigFile = exports.retryOnRequireEsmRace = exports.isRequireEsmRaceError = exports.clearRequireCache = exports.loadConfigFile = exports.calculateHashesForCreateNodes = exports.calculateHashForCreateNodes = exports.mapAsyncIterable = exports.combineAsyncIterables = exports.createAsyncIterable = exports.getSatisfyingInstalledPackageVersion = exports.getResolvedPackageVersion = exports.assertSupportedPackageVersion = exports.assertSupportedInstalledPackageVersion = exports.getInstalledPackageVersionFromTree = void 0;
|
|
5
|
+
exports.getRelativeProjectJsonSchemaPath = exports.getPrintableCommandArgsForTask = exports.getOutputs = exports.getNxRequirePaths = exports.getNxCloudUrl = exports.getNxCloudAppOnBoardingUrl = exports.getLockFileName = exports.getLatestCommitSha = exports.getLastValueFromAsyncIterableIterator = exports.getGlobPatternsFromPackageManagerWorkspaces = exports.getGeneratorInformation = exports.getFilesInDirectoryUsingContext = exports.getExecutorNameForTask = exports.getExecutorInformation = exports.getExecutorForTask = exports.getEnvPathsForTask = exports.getEnvFilesForTask = exports.getDependencyConfigs = exports.getCustomHasher = exports.getCliPath = exports.generatePrunedDeployOutput = exports.forceRegisterEsmLoader = exports.findProjectsNpmDependencies = exports.findProjectForPath = exports.findMatchingTargetNames = exports.findMatchingProjects = exports.findMatchingConfigFiles = exports.findInstalledPlugins = exports.findAllProjectNodeDependencies = exports.filterUsingGlobPatterns = exports.fileExists = exports.fileDataDepType = exports.fileDataDepTarget = exports.expandWildcardTargetConfiguration = exports.expandInitiatingTasksThroughNoop = exports.expandDependencyConfigSyntaxSugar = exports.dropEmptyPeerDependencySections = exports.directoryExists = exports.deriveGroupNameFromTarget = exports.defaultFileRead = exports.deduceDefaultBase = exports.daemonClient = exports.createTaskId = exports.createTargetDefaultsResults = exports.createRunManyDynamicOutputRenderer = exports.createProjectRootMappings = exports.createProjectGraphAndSourceMapsAsync = exports.createPackageJson = exports.createNxCloudOnboardingURLForWelcomeApp = exports.createNxCloudOnboardingURL = void 0;
|
|
6
|
+
exports.relocatePrunedLocalPathSpec = exports.registerTsProject = exports.registerTsConfigPaths = exports.readProjectAndTargetFromTargetString = exports.readPackageJson = exports.readNxMigrateConfig = exports.readNxJsonFromDisk = exports.readModulePackageJson = exports.readFileMapCache = exports.readFileIfExisting = exports.readCachedProjectConfiguration = exports.quoteShellArg = exports.preventRecursionInGraphConstruction = exports.parseVersionFromPackageManagerField = exports.parseExecutor = exports.orange = exports.nxVersion = exports.normalizeTargetDependencyWithStringProjects = exports.normalizeDependencyConfigProjects = exports.normalizeDependencyConfigDefinition = exports.multiselectPrompt = exports.movePeerDependencyToDependencies = exports.mergeTargetConfigurations = exports.loadTsFile = exports.killProcessTreeGraceful = exports.killChildOnHostExit = exports.isWholeFileChange = exports.isRelativePath = exports.isProjectGraphProjectNode = exports.isProjectGraphExternalNode = exports.isNxCloudUsed = exports.isNpmProject = exports.isLockFileChange = exports.isDeletedFileChange = exports.isCacheableTask = exports.isCI = exports.isBuiltinModuleImport = exports.interpolate = exports.hashWithWorkspaceContext = exports.hashObject = exports.hashFile = exports.handleProjectGraphError = exports.handleImport = exports.globWithWorkspaceContext = exports.getWorkspacePackagesFromGraph = exports.getUnparsedOverrideArgs = exports.getTargetInputs = exports.getTargetConfigurationForTask = exports.getSourceDirOfDependentProjects = exports.getSerializedArgsForTask = void 0;
|
|
7
|
+
exports.workspaceRootInner = exports.workspaceDataDirectory = exports.warnUnshippableLocalPathSpec = exports.validateOutputs = exports.unparse = exports.textPrompt = exports.transformLegacyOutputs = exports.toOldFormat = exports.toNewFormat = exports.shouldStreamOutput = exports.setupWorkspaceContext = exports.setupAiAgentsGenerator = exports.setWorkspaceRoot = exports.selectPrompt = exports.safeSpawn = exports.safeExecFileSync = exports.runNxSync = exports.resolveCommandSyntacticSugar = exports.resetWorkspaceContext = exports.requireWithTsconfigFallback = exports.removeTasksFromTaskGraph = void 0;
|
|
8
8
|
var devkit_internals_1 = require("nx/src/devkit-internals");
|
|
9
9
|
Object.defineProperty(exports, "signalToCode", { enumerable: true, get: function () { return devkit_internals_1.signalToCode; } });
|
|
10
10
|
Object.defineProperty(exports, "createProjectRootMappingsFromProjectConfigurations", { enumerable: true, get: function () { return devkit_internals_1.createProjectRootMappingsFromProjectConfigurations; } });
|
|
@@ -106,6 +106,10 @@ var find_plugin_for_config_file_1 = require("./src/utils/find-plugin-for-config-
|
|
|
106
106
|
Object.defineProperty(exports, "findPluginForConfigFile", { enumerable: true, get: function () { return find_plugin_for_config_file_1.findPluginForConfigFile; } });
|
|
107
107
|
var get_named_inputs_1 = require("./src/utils/get-named-inputs");
|
|
108
108
|
Object.defineProperty(exports, "getNamedInputs", { enumerable: true, get: function () { return get_named_inputs_1.getNamedInputs; } });
|
|
109
|
+
var test_file_directives_1 = require("./src/utils/test-file-directives");
|
|
110
|
+
Object.defineProperty(exports, "applyTestFileDirectives", { enumerable: true, get: function () { return test_file_directives_1.applyTestFileDirectives; } });
|
|
111
|
+
var ultracache_directive_1 = require("./src/utils/ultracache-directive");
|
|
112
|
+
Object.defineProperty(exports, "hasUltracacheImportsDirective", { enumerable: true, get: function () { return ultracache_directive_1.hasUltracacheImportsDirective; } });
|
|
109
113
|
var log_show_project_command_1 = require("./src/utils/log-show-project-command");
|
|
110
114
|
Object.defineProperty(exports, "logShowProjectCommand", { enumerable: true, get: function () { return log_show_project_command_1.logShowProjectCommand; } });
|
|
111
115
|
var rxjs_for_await_1 = require("./src/utils/rxjs-for-await");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@nx-<name>: <value>` directives in the comment block that opens a file,
|
|
3
|
+
* by name, with their trimmed values in order. Reading stops at the first line
|
|
4
|
+
* that is not blank, a shebang or a comment.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseNxDirectives(content: string): Map<string, string[]>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseNxDirectives = parseNxDirectives;
|
|
4
|
+
const DIRECTIVE = /^@nx-([\w-]+):(.*)$/;
|
|
5
|
+
/**
|
|
6
|
+
* The `@nx-<name>: <value>` directives in the comment block that opens a file,
|
|
7
|
+
* by name, with their trimmed values in order. Reading stops at the first line
|
|
8
|
+
* that is not blank, a shebang or a comment.
|
|
9
|
+
*/
|
|
10
|
+
function parseNxDirectives(content) {
|
|
11
|
+
const directives = new Map();
|
|
12
|
+
let inBlock = false;
|
|
13
|
+
let start = 0;
|
|
14
|
+
while (start < content.length) {
|
|
15
|
+
const newline = content.indexOf('\n', start);
|
|
16
|
+
const end = newline === -1 ? content.length : newline;
|
|
17
|
+
let line = content.slice(start, end).trim();
|
|
18
|
+
start = end + 1;
|
|
19
|
+
if (!inBlock) {
|
|
20
|
+
if (line === '' || line.startsWith('#!')) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (line.startsWith('//')) {
|
|
24
|
+
line = line.slice(2);
|
|
25
|
+
}
|
|
26
|
+
else if (line.startsWith('/*')) {
|
|
27
|
+
inBlock = true;
|
|
28
|
+
line = line.slice(2);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (inBlock) {
|
|
35
|
+
const blockEnd = line.indexOf('*/');
|
|
36
|
+
if (blockEnd !== -1) {
|
|
37
|
+
inBlock = false;
|
|
38
|
+
// Code after `*/` means the block is not a file header.
|
|
39
|
+
if (line.slice(blockEnd + 2).trim() !== '') {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
line = line.slice(0, blockEnd);
|
|
43
|
+
}
|
|
44
|
+
line = line.replace(/^\s*\*+/, '');
|
|
45
|
+
}
|
|
46
|
+
const match = line.trim().match(DIRECTIVE);
|
|
47
|
+
if (match) {
|
|
48
|
+
const [, name, value] = match;
|
|
49
|
+
const values = directives.get(name);
|
|
50
|
+
if (values) {
|
|
51
|
+
values.push(value.trim());
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
directives.set(name, [value.trim()]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return directives;
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TargetConfiguration } from 'nx/src/devkit-exports';
|
|
2
|
+
/** The distinct projects the `@nx-depends-on` values name. */
|
|
3
|
+
export declare function dependsOnProjects(values: string[]): string[];
|
|
4
|
+
/**
|
|
5
|
+
* `target` narrowed to the projects a test file names: its dependency inputs
|
|
6
|
+
* (`^…`, `dependencies: true`) become one input selecting `projects`, by the
|
|
7
|
+
* first named input among them (else `default`) and kept under ultracache
|
|
8
|
+
* (`always: true`). Its `dependsOn` entries naming projects, the servers the
|
|
9
|
+
* test talks to, get `inputs: false`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function scopeTestTargetToProjects(target: TargetConfiguration, projects: string[]): TargetConfiguration;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dependsOnProjects = dependsOnProjects;
|
|
4
|
+
exports.scopeTestTargetToProjects = scopeTestTargetToProjects;
|
|
5
|
+
const without_server_inputs_1 = require("./without-server-inputs");
|
|
6
|
+
/** The distinct projects the `@nx-depends-on` values name. */
|
|
7
|
+
function dependsOnProjects(values) {
|
|
8
|
+
const projects = new Set();
|
|
9
|
+
for (const value of values) {
|
|
10
|
+
for (const project of value.split(',')) {
|
|
11
|
+
const name = project.trim();
|
|
12
|
+
if (name) {
|
|
13
|
+
projects.add(name);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return [...projects];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `target` narrowed to the projects a test file names: its dependency inputs
|
|
21
|
+
* (`^…`, `dependencies: true`) become one input selecting `projects`, by the
|
|
22
|
+
* first named input among them (else `default`) and kept under ultracache
|
|
23
|
+
* (`always: true`). Its `dependsOn` entries naming projects, the servers the
|
|
24
|
+
* test talks to, get `inputs: false`.
|
|
25
|
+
*/
|
|
26
|
+
function scopeTestTargetToProjects(target, projects) {
|
|
27
|
+
return {
|
|
28
|
+
...target,
|
|
29
|
+
inputs: scopeDependencyInputs(target.inputs, projects),
|
|
30
|
+
...(target.dependsOn && {
|
|
31
|
+
dependsOn: (0, without_server_inputs_1.withoutServerInputs)(target.dependsOn),
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function scopeDependencyInputs(inputs, projects) {
|
|
36
|
+
let namedInput;
|
|
37
|
+
let position;
|
|
38
|
+
const own = [];
|
|
39
|
+
for (const input of inputs ?? []) {
|
|
40
|
+
const dependency = typeof input === 'string'
|
|
41
|
+
? input.startsWith('^')
|
|
42
|
+
: 'dependencies' in input && input.dependencies === true;
|
|
43
|
+
if (!dependency) {
|
|
44
|
+
own.push(input);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
position ??= own.length;
|
|
48
|
+
if (namedInput === undefined) {
|
|
49
|
+
if (typeof input === 'string' && !input.startsWith('^{')) {
|
|
50
|
+
namedInput = input.slice(1);
|
|
51
|
+
}
|
|
52
|
+
else if (typeof input !== 'string' && 'input' in input) {
|
|
53
|
+
namedInput = input.input;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
own.splice(position ?? own.length, 0, {
|
|
58
|
+
input: namedInput ?? 'default',
|
|
59
|
+
projects,
|
|
60
|
+
always: true,
|
|
61
|
+
});
|
|
62
|
+
return own;
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TargetConfiguration } from 'nx/src/devkit-exports';
|
|
2
|
+
declare const TEST_FILE_DIRECTIVES: readonly ['depends-on', 'ultracache'];
|
|
3
|
+
/** An `@nx-<name>` directive a plugin can apply to a test file's target. */
|
|
4
|
+
type TestFileDirective = (typeof TEST_FILE_DIRECTIVES)[number];
|
|
5
|
+
/**
|
|
6
|
+
* `target` with the `@nx-*` directives of a workspace-relative test file
|
|
7
|
+
* applied, for the directives in `supported`. A directive that is not
|
|
8
|
+
* supported, has an unsupported value or lists no projects is skipped with a
|
|
9
|
+
* warning.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyTestFileDirectives(target: TargetConfiguration, workspaceRoot: string, file: string, supported: readonly TestFileDirective[]): TargetConfiguration;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTestFileDirectives = applyTestFileDirectives;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
7
|
+
const nx_directives_1 = require("./nx-directives");
|
|
8
|
+
const test_file_depends_on_1 = require("./test-file-depends-on");
|
|
9
|
+
const ultracache_directive_1 = require("./ultracache-directive");
|
|
10
|
+
const without_server_inputs_1 = require("./without-server-inputs");
|
|
11
|
+
const TEST_FILE_DIRECTIVES = ['depends-on', 'ultracache'];
|
|
12
|
+
/**
|
|
13
|
+
* `target` with the `@nx-*` directives of a workspace-relative test file
|
|
14
|
+
* applied, for the directives in `supported`. A directive that is not
|
|
15
|
+
* supported, has an unsupported value or lists no projects is skipped with a
|
|
16
|
+
* warning.
|
|
17
|
+
*/
|
|
18
|
+
function applyTestFileDirectives(target, workspaceRoot, file, supported) {
|
|
19
|
+
const directives = (0, nx_directives_1.parseNxDirectives)((0, node_fs_1.readFileSync)((0, node_path_1.join)(workspaceRoot, file), 'utf-8'));
|
|
20
|
+
let result = target;
|
|
21
|
+
for (const directive of TEST_FILE_DIRECTIVES) {
|
|
22
|
+
const values = directives.get(directive);
|
|
23
|
+
if (values === undefined) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (!supported.includes(directive)) {
|
|
27
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-${directive}" is not supported in this test file, so Nx ignores it.`);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
result = applyDirective(result, directive, values, file);
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
function applyDirective(target, directive, values, file) {
|
|
35
|
+
switch (directive) {
|
|
36
|
+
case 'depends-on': {
|
|
37
|
+
const projects = (0, test_file_depends_on_1.dependsOnProjects)(values);
|
|
38
|
+
if (projects.length === 0) {
|
|
39
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-depends-on:" lists no projects, so Nx ignores it. List the projects the test depends on, separated by commas.`);
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
return (0, test_file_depends_on_1.scopeTestTargetToProjects)(target, projects);
|
|
43
|
+
}
|
|
44
|
+
case 'ultracache': {
|
|
45
|
+
const unsupported = (0, ultracache_directive_1.findUnsupportedUltracacheValue)(values);
|
|
46
|
+
if (unsupported !== undefined) {
|
|
47
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-ultracache:${unsupported && ` ${unsupported}`}" is not supported, so Nx ignores "@nx-ultracache" in this file. Use "@nx-ultracache: imports".`);
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
50
|
+
return target.dependsOn
|
|
51
|
+
? { ...target, dependsOn: (0, without_server_inputs_1.withoutServerInputs)(target.dependsOn) }
|
|
52
|
+
: target;
|
|
53
|
+
}
|
|
54
|
+
default: {
|
|
55
|
+
const unhandled = directive;
|
|
56
|
+
throw new Error(`Unhandled test file directive: ${unhandled}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the comment block that opens `content` has an
|
|
3
|
+
* `@nx-ultracache: imports` directive. False when any `@nx-ultracache` value
|
|
4
|
+
* there is unsupported.
|
|
5
|
+
*/
|
|
6
|
+
export declare function hasUltracacheImportsDirective(content: string): boolean;
|
|
7
|
+
/** The first of the `@nx-ultracache` values that is not supported. */
|
|
8
|
+
export declare function findUnsupportedUltracacheValue(values: string[]): string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasUltracacheImportsDirective = hasUltracacheImportsDirective;
|
|
4
|
+
exports.findUnsupportedUltracacheValue = findUnsupportedUltracacheValue;
|
|
5
|
+
const nx_directives_1 = require("./nx-directives");
|
|
6
|
+
const IMPORTS = 'imports';
|
|
7
|
+
/**
|
|
8
|
+
* Whether the comment block that opens `content` has an
|
|
9
|
+
* `@nx-ultracache: imports` directive. False when any `@nx-ultracache` value
|
|
10
|
+
* there is unsupported.
|
|
11
|
+
*/
|
|
12
|
+
function hasUltracacheImportsDirective(content) {
|
|
13
|
+
const values = (0, nx_directives_1.parseNxDirectives)(content).get('ultracache');
|
|
14
|
+
return (values !== undefined && findUnsupportedUltracacheValue(values) === undefined);
|
|
15
|
+
}
|
|
16
|
+
/** The first of the `@nx-ultracache` values that is not supported. */
|
|
17
|
+
function findUnsupportedUltracacheValue(values) {
|
|
18
|
+
return values.find((value) => value !== IMPORTS);
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TargetDependencyConfig } from 'nx/src/devkit-exports';
|
|
2
|
+
/**
|
|
3
|
+
* `dependsOn` with `inputs: false` on the entries that name projects: the
|
|
4
|
+
* servers a test talks to, not its readiness gate.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withoutServerInputs(dependsOn: (string | TargetDependencyConfig)[]): (string | TargetDependencyConfig)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withoutServerInputs = withoutServerInputs;
|
|
4
|
+
/**
|
|
5
|
+
* `dependsOn` with `inputs: false` on the entries that name projects: the
|
|
6
|
+
* servers a test talks to, not its readiness gate.
|
|
7
|
+
*/
|
|
8
|
+
function withoutServerInputs(dependsOn) {
|
|
9
|
+
return dependsOn.map((dependency) => typeof dependency !== 'string' && dependency.projects
|
|
10
|
+
? { ...dependency, inputs: false }
|
|
11
|
+
: dependency);
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/devkit",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-pr.37405.acdaf31",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"jest": "30.3.0",
|
|
70
|
-
"nx": "24.0.0-
|
|
70
|
+
"nx": "24.0.0-pr.37405.acdaf31"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"nx": ">= 23 <= 25 || ^24.0.0-0"
|