Socket
Socket
Sign inDemoInstall

nx

Package Overview
Dependencies
Maintainers
8
Versions
1357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nx - npm Package Compare versions

Comparing version 0.0.0-pr-26816-51699f9 to 0.0.0-pr-26847-80c36f5

src/command-line/import/command-object.d.ts

5

bin/init-local.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rewriteTargetsAndProjects = exports.initLocal = void 0;
exports.initLocal = initLocal;
exports.rewriteTargetsAndProjects = rewriteTargetsAndProjects;
const perf_hooks_1 = require("perf_hooks");

@@ -48,3 +49,2 @@ const nx_commands_1 = require("../src/command-line/nx-commands");

}
exports.initLocal = initLocal;
function rewriteTargetsAndProjects(args) {

@@ -80,3 +80,2 @@ const newArgs = [args[2]];

}
exports.rewriteTargetsAndProjects = rewriteTargetsAndProjects;
function isKnownCommand(command) {

@@ -83,0 +82,0 @@ const commands = [

56

package.json
{
"name": "nx",
"version": "0.0.0-pr-26816-51699f9",
"version": "0.0.0-pr-26847-80c36f5",
"private": false,

@@ -40,2 +40,3 @@ "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",

"dependencies": {
"@napi-rs/wasm-runtime": "0.2.4",
"@yarnpkg/lockfile": "^1.1.0",

@@ -74,3 +75,3 @@ "@yarnpkg/parsers": "3.0.0-rc.46",

"ora": "5.3.0",
"@nrwl/tao": "0.0.0-pr-26816-51699f9"
"@nrwl/tao": "0.0.0-pr-26847-80c36f5"
},

@@ -90,12 +91,12 @@ "peerDependencies": {

"optionalDependencies": {
"@nx/nx-darwin-x64": "0.0.0-pr-26816-51699f9",
"@nx/nx-darwin-arm64": "0.0.0-pr-26816-51699f9",
"@nx/nx-linux-x64-gnu": "0.0.0-pr-26816-51699f9",
"@nx/nx-linux-x64-musl": "0.0.0-pr-26816-51699f9",
"@nx/nx-win32-x64-msvc": "0.0.0-pr-26816-51699f9",
"@nx/nx-linux-arm64-gnu": "0.0.0-pr-26816-51699f9",
"@nx/nx-linux-arm64-musl": "0.0.0-pr-26816-51699f9",
"@nx/nx-linux-arm-gnueabihf": "0.0.0-pr-26816-51699f9",
"@nx/nx-win32-arm64-msvc": "0.0.0-pr-26816-51699f9",
"@nx/nx-freebsd-x64": "0.0.0-pr-26816-51699f9"
"@nx/nx-darwin-x64": "0.0.0-pr-26847-80c36f5",
"@nx/nx-darwin-arm64": "0.0.0-pr-26847-80c36f5",
"@nx/nx-linux-x64-gnu": "0.0.0-pr-26847-80c36f5",
"@nx/nx-linux-x64-musl": "0.0.0-pr-26847-80c36f5",
"@nx/nx-win32-x64-msvc": "0.0.0-pr-26847-80c36f5",
"@nx/nx-linux-arm64-gnu": "0.0.0-pr-26847-80c36f5",
"@nx/nx-linux-arm64-musl": "0.0.0-pr-26847-80c36f5",
"@nx/nx-linux-arm-gnueabihf": "0.0.0-pr-26847-80c36f5",
"@nx/nx-win32-arm64-msvc": "0.0.0-pr-26847-80c36f5",
"@nx/nx-freebsd-x64": "0.0.0-pr-26847-80c36f5"
},

@@ -176,17 +177,20 @@ "nx-migrations": {

"napi": {
"name": "nx",
"package": {
"name": "@nx/nx"
"binaryName": "nx",
"packageName": "@nx/nx",
"wasm": {
"initialMemory": 1024,
"maximumMemory": 32768
},
"triples": {
"additional": [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-pc-windows-msvc",
"armv7-unknown-linux-gnueabihf",
"x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd"
]
}
"targets": [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-pc-windows-msvc",
"armv7-unknown-linux-gnueabihf",
"x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd"
]
},

@@ -193,0 +197,0 @@ "main": "./bin/nx.js",

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const workspace_root_1 = require("../src/utils/workspace-root");
const package_json_workspaces_1 = require("../src/plugins/package-json-workspaces");
const package_json_1 = require("../src/plugins/package-json");
const plugin = {

@@ -9,5 +9,5 @@ name: 'nx-all-package-jsons-plugin',

'*/**/package.json',
(f) => (0, package_json_workspaces_1.createNodeFromPackageJson)(f, workspace_root_1.workspaceRoot),
(f) => (0, package_json_1.createNodeFromPackageJson)(f, workspace_root_1.workspaceRoot),
],
};
module.exports = plugin;

@@ -62,3 +62,3 @@ <p style="text-align: center;">

- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
- [Blog Posts About Nx](https://nx.dev/blog)

@@ -65,0 +65,0 @@ <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"

@@ -7,2 +7,23 @@ {

"properties": {
"name": {
"type": "string",
"description": "Project's name. Optional if specified in workspace.json"
},
"root": {
"type": "string",
"description": "Project's location relative to the root of the workspace"
},
"sourceRoot": {
"type": "string",
"description": "The location of project's sources relative to the root of the workspace"
},
"projectType": {
"type": "string",
"description": "Type of project supported",
"enum": ["library", "application"]
},
"generators": {
"type": "object",
"description": "List of default values used by generators"
},
"namedInputs": {

@@ -116,2 +137,7 @@ "type": "object",

"description": "Specifies if the given target should be cacheable"
},
"parallelism": {
"type": "boolean",
"default": true,
"description": "Whether this target can be run in parallel with other tasks"
}

@@ -118,0 +144,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renamePropertyWithStableKeys = exports.toOldFormat = exports.toNewFormat = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = exports.NxAngularJsonPlugin = exports.NX_ANGULAR_JSON_PLUGIN_NAME = void 0;
exports.NxAngularJsonPlugin = exports.NX_ANGULAR_JSON_PLUGIN_NAME = void 0;
exports.shouldMergeAngularProjects = shouldMergeAngularProjects;
exports.isAngularPluginInstalled = isAngularPluginInstalled;
exports.toNewFormat = toNewFormat;
exports.toOldFormat = toOldFormat;
exports.renamePropertyWithStableKeys = renamePropertyWithStableKeys;
const fs_1 = require("fs");

@@ -31,3 +36,2 @@ const path = require("path");

}
exports.shouldMergeAngularProjects = shouldMergeAngularProjects;
function isAngularPluginInstalled() {

@@ -49,3 +53,2 @@ try {

}
exports.isAngularPluginInstalled = isAngularPluginInstalled;
function readAngularJson(angularCliWorkspaceRoot) {

@@ -83,3 +86,2 @@ return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;

}
exports.toNewFormat = toNewFormat;
function toOldFormat(w) {

@@ -114,3 +116,2 @@ if (w.projects) {

}
exports.toOldFormat = toOldFormat;
// we have to do it this way to preserve the order of properties

@@ -132,2 +133,1 @@ // not to screw up the formatting

}
exports.renamePropertyWithStableKeys = renamePropertyWithStableKeys;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decorateCli = void 0;
exports.decorateCli = decorateCli;
const fs_1 = require("fs");

@@ -25,2 +25,1 @@ const output_1 = require("../utils/output");

}
exports.decorateCli = decorateCli;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLogger = exports.wrapAngularDevkitSchematic = exports.mockSchematicsForTesting = exports.runMigration = exports.generate = exports.NxScopeHostUsedForWrappedSchematics = exports.arrayBufferToString = exports.NxScopedHostForBuilders = exports.NxScopedHost = exports.scheduleTarget = exports.createBuilderContext = void 0;
exports.getLogger = exports.NxScopeHostUsedForWrappedSchematics = exports.NxScopedHostForBuilders = exports.NxScopedHost = void 0;
exports.createBuilderContext = createBuilderContext;
exports.scheduleTarget = scheduleTarget;
exports.arrayBufferToString = arrayBufferToString;
exports.generate = generate;
exports.runMigration = runMigration;
exports.mockSchematicsForTesting = mockSchematicsForTesting;
exports.wrapAngularDevkitSchematic = wrapAngularDevkitSchematic;
const core_1 = require("@angular-devkit/core");

@@ -107,3 +114,2 @@ const node_1 = require("@angular-devkit/core/node");

}
exports.createBuilderContext = createBuilderContext;
async function scheduleTarget(root, opts, verbose) {

@@ -133,3 +139,2 @@ const { Architect } = require('@angular-devkit/architect');

}
exports.scheduleTarget = scheduleTarget;
function createNodeModulesEngineHost(resolvePaths, projects) {

@@ -418,3 +423,2 @@ const NodeModulesEngineHost = require('@angular-devkit/schematics/tools')

}
exports.arrayBufferToString = arrayBufferToString;
/**

@@ -513,3 +517,2 @@ * Host used by Angular CLI schematics. It reads the project configurations from

}
exports.generate = generate;
function createPromptProvider() {

@@ -585,3 +588,2 @@ return (definitions) => {

}
exports.runMigration = runMigration;
function resolveMigrationsCollection(name) {

@@ -644,3 +646,2 @@ let collectionPath = undefined;

}
exports.mockSchematicsForTesting = mockSchematicsForTesting;
function wrapAngularDevkitSchematic(collectionName, generatorName) {

@@ -732,3 +733,2 @@ // This is idempotent, if it happens to get called

}
exports.wrapAngularDevkitSchematic = wrapAngularDevkitSchematic;
let logger;

@@ -809,4 +809,6 @@ const getLogger = (isVerbose = false) => {

}
readExecutorsJson(nodeModule, builder) {
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, this.projects, this.root ? [this.root, __dirname] : [__dirname]);
readExecutorsJson(nodeModule, builder, extraRequirePaths = []) {
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, this.projects, this.root
? [this.root, __dirname, ...extraRequirePaths]
: [__dirname, ...extraRequirePaths]);
const executorsFile = packageJson.executors ?? packageJson.builders;

@@ -816,3 +818,4 @@ if (!executorsFile) {

}
const executorsFilePath = require.resolve((0, path_1.join)((0, path_1.dirname)(packageJsonPath), executorsFile));
const basePath = (0, path_1.dirname)(packageJsonPath);
const executorsFilePath = require.resolve((0, path_1.join)(basePath, executorsFile));
const executorsJson = (0, fileutils_1.readJsonFile)(executorsFilePath);

@@ -826,3 +829,3 @@ const executorConfig = executorsJson.builders?.[builder] ?? executorsJson.executors?.[builder];

const [packageName, executorName] = executorConfig.split(':');
return this.readExecutorsJson(packageName, executorName);
return this.readExecutorsJson(packageName, executorName, [basePath]);
}

@@ -829,0 +832,0 @@ return { executorsFilePath, executorConfig, isNgCompat: true };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nextValueFrom = exports.latestValueFrom = exports.bufferedValuesFrom = exports.eachValueFrom = exports.Deferred = void 0;
exports.Deferred = void 0;
exports.eachValueFrom = eachValueFrom;
exports.bufferedValuesFrom = bufferedValuesFrom;
exports.latestValueFrom = latestValueFrom;
exports.nextValueFrom = nextValueFrom;
class Deferred {

@@ -103,3 +107,2 @@ constructor() {

}
exports.eachValueFrom = eachValueFrom;
/**

@@ -196,3 +199,2 @@ * Will subscribe to the `source` observable provided

}
exports.bufferedValuesFrom = bufferedValuesFrom;
/**

@@ -287,3 +289,2 @@ * Will subscribe to the provided `source` observable,

}
exports.latestValueFrom = latestValueFrom;
/**

@@ -365,2 +366,1 @@ * Subscribes to the provided `source` observable and allows

}
exports.nextValueFrom = nextValueFrom;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.coreNxPluginVersions = exports.addHandler = void 0;
exports.coreNxPluginVersions = void 0;
exports.addHandler = addHandler;
const child_process_1 = require("child_process");

@@ -35,3 +36,2 @@ const fs_1 = require("fs");

}
exports.addHandler = addHandler;
async function installPackage(pkgName, version, nxJson) {

@@ -38,0 +38,0 @@ const spinner = ora(`Installing ${pkgName}@${version}...`);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAffectedGraphNodes = exports.affected = void 0;
exports.affected = affected;
exports.getAffectedGraphNodes = getAffectedGraphNodes;
const file_utils_1 = require("../../project-graph/file-utils");

@@ -65,3 +66,2 @@ const run_command_1 = require("../../tasks-runner/run-command");

}
exports.affected = affected;
async function getAffectedGraphNodes(nxArgs, projectGraph) {

@@ -79,3 +79,2 @@ let affectedGraph = nxArgs.all

}
exports.getAffectedGraphNodes = getAffectedGraphNodes;
function allProjectsWithTarget(projects, nxArgs) {

@@ -82,0 +81,0 @@ return projects.filter((p) => nxArgs.targets.find((target) => (0, project_graph_utils_1.projectHasTarget)(p, target)));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectExistingRepoToNxCloudPrompt = exports.connectToNxCloudWithPrompt = exports.connectToNxCloudCommand = exports.connectToNxCloudIfExplicitlyAsked = exports.onlyDefaultRunnerIsUsed = void 0;
exports.onlyDefaultRunnerIsUsed = onlyDefaultRunnerIsUsed;
exports.connectToNxCloudIfExplicitlyAsked = connectToNxCloudIfExplicitlyAsked;
exports.connectToNxCloudCommand = connectToNxCloudCommand;
exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
exports.connectExistingRepoToNxCloudPrompt = connectExistingRepoToNxCloudPrompt;
const output_1 = require("../../utils/output");

@@ -25,3 +29,2 @@ const configuration_1 = require("../../config/configuration");

}
exports.onlyDefaultRunnerIsUsed = onlyDefaultRunnerIsUsed;
async function connectToNxCloudIfExplicitlyAsked(opts) {

@@ -44,3 +47,2 @@ if (opts['cloud'] === true) {

}
exports.connectToNxCloudIfExplicitlyAsked = connectToNxCloudIfExplicitlyAsked;
async function connectToNxCloudCommand(command) {

@@ -74,3 +76,2 @@ const nxJson = (0, configuration_1.readNxJson)();

}
exports.connectToNxCloudCommand = connectToNxCloudCommand;
async function connectToNxCloudWithPrompt(command) {

@@ -86,7 +87,5 @@ const setNxCloud = await nxCloudPrompt('setupNxCloud');

}
exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
async function connectExistingRepoToNxCloudPrompt(key = 'setupNxCloud') {
return nxCloudPrompt(key).then((value) => value === 'yes');
}
exports.connectExistingRepoToNxCloudPrompt = connectExistingRepoToNxCloudPrompt;
async function nxCloudPrompt(key) {

@@ -93,0 +92,0 @@ const { message, choices, initial, footer, hint } = ab_testing_1.messages.getPrompt(key);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.viewLogs = void 0;
exports.viewLogs = viewLogs;
const package_manager_1 = require("../../utils/package-manager");

@@ -53,2 +53,1 @@ const child_process_1 = require("child_process");

}
exports.viewLogs = viewLogs;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.daemonHandler = void 0;
exports.daemonHandler = daemonHandler;
const tmp_dir_1 = require("../../daemon/tmp-dir");

@@ -27,2 +27,1 @@ const output_1 = require("../../utils/output");

}
exports.daemonHandler = daemonHandler;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nxExecCommand = void 0;
exports.nxExecCommand = nxExecCommand;
const child_process_1 = require("child_process");

@@ -47,3 +47,2 @@ const path_1 = require("path");

}
exports.nxExecCommand = nxExecCommand;
async function runScriptAsNxTarget(projectGraph, argv, nxArgs) {

@@ -50,0 +49,0 @@ // NPM, Yarn, and PNPM set this to the name of the currently executing script. Lets use it if we can.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.format = void 0;
exports.format = format;
const node_child_process_1 = require("node:child_process");

@@ -63,3 +63,2 @@ const path = require("node:path");

}
exports.format = format;
async function getPatterns(args) {

@@ -66,0 +65,0 @@ const graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generate = exports.printGenHelp = exports.parseGeneratorString = exports.printChanges = void 0;
exports.printChanges = printChanges;
exports.parseGeneratorString = parseGeneratorString;
exports.printGenHelp = printGenHelp;
exports.generate = generate;
const chalk = require("chalk");

@@ -31,3 +34,2 @@ const enquirer_1 = require("enquirer");

}
exports.printChanges = printChanges;
async function promptForCollection(generatorName, interactive, projectsConfiguration) {

@@ -148,3 +150,2 @@ const localPlugins = await (0, local_plugins_1.getLocalWorkspacePlugins)(projectsConfiguration, (0, configuration_1.readNxJson)());

}
exports.parseGeneratorString = parseGeneratorString;
async function convertToGenerateOptions(generatorOptions, mode, projectsConfiguration) {

@@ -209,3 +210,2 @@ let collectionName = null;

}
exports.printGenHelp = printGenHelp;
async function generate(cwd, args) {

@@ -269,2 +269,1 @@ if (args['verbose']) {

}
exports.generate = generate;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readGeneratorsJson = exports.getGeneratorInformation = void 0;
exports.getGeneratorInformation = getGeneratorInformation;
exports.readGeneratorsJson = readGeneratorsJson;
const path_1 = require("path");

@@ -42,3 +43,2 @@ const schema_utils_1 = require("../../config/schema-utils");

}
exports.getGeneratorInformation = getGeneratorInformation;
function readGeneratorsJson(collectionName, generator, root, projects) {

@@ -78,3 +78,2 @@ let generatorsFilePath;

}
exports.readGeneratorsJson = readGeneratorsJson;
function findFullGeneratorName(name, generators) {

@@ -81,0 +80,0 @@ if (generators) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withGraphOptions = exports.yargsGraphCommand = void 0;
exports.yargsGraphCommand = void 0;
exports.withGraphOptions = withGraphOptions;
const documentation_1 = require("../yargs-utils/documentation");

@@ -75,2 +76,1 @@ const shared_options_1 = require("../yargs-utils/shared-options");

}
exports.withGraphOptions = withGraphOptions;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateGraph = void 0;
exports.generateGraph = generateGraph;
const crypto_1 = require("crypto");

@@ -321,6 +321,10 @@ const node_child_process_1 = require("node:child_process");

}
exports.generateGraph = generateGraph;
async function startServer(html, environmentJs, host, port = 4211, watchForchanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
async function startServer(html, environmentJs, host, port = 4211, watchForChanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
let unregisterFileWatcher;
if (watchForchanges) {
if (watchForChanges && !client_1.daemonClient.enabled()) {
output_1.output.warn({
title: 'Nx Daemon is not enabled. Graph will not refresh on file changes.',
});
}
if (watchForChanges && client_1.daemonClient.enabled()) {
unregisterFileWatcher = await createFileWatcher();

@@ -778,4 +782,4 @@ }

return (0, node_child_process_1.execSync)(command, {
cwd: (0, path_1.join)(workspace_root_1.workspaceRoot, project.data.root),
cwd: target.options?.cwd ?? workspace_root_1.workspaceRoot,
}).toString();
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNxToMonorepo = void 0;
exports.addNxToMonorepo = addNxToMonorepo;
const enquirer_1 = require("enquirer");

@@ -80,3 +80,2 @@ const fs_1 = require("fs");

}
exports.addNxToMonorepo = addNxToMonorepo;
// scanning package.json files

@@ -83,0 +82,0 @@ function allProjectPackageJsonFiles(repoRoot) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNxToNest = void 0;
exports.addNxToNest = addNxToNest;
const enquirer = require("enquirer");

@@ -99,3 +99,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.addNxToNest = addNxToNest;
function addNestPluginToPackageJson(repoRoot) {

@@ -102,0 +101,0 @@ const path = (0, path_1.join)(repoRoot, `package.json`);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNxToNpmRepo = void 0;
exports.addNxToNpmRepo = addNxToNpmRepo;
const enquirer = require("enquirer");

@@ -73,2 +73,1 @@ const path_1 = require("path");

}
exports.addNxToNpmRepo = addNxToNpmRepo;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNxToAngularCliRepo = void 0;
exports.addNxToAngularCliRepo = addNxToAngularCliRepo;
const enquirer_1 = require("enquirer");

@@ -50,3 +50,2 @@ const path_1 = require("path");

}
exports.addNxToAngularCliRepo = addNxToAngularCliRepo;
async function collectCacheableOperations(options) {

@@ -53,0 +52,0 @@ let cacheableOperations;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupIntegratedWorkspace = void 0;
exports.setupIntegratedWorkspace = setupIntegratedWorkspace;
const child_process_1 = require("child_process");

@@ -10,2 +10,1 @@ const package_manager_1 = require("../../../../utils/package-manager");

}
exports.setupIntegratedWorkspace = setupIntegratedWorkspace;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLegacyMigrationFunctionIfApplicable = void 0;
exports.getLegacyMigrationFunctionIfApplicable = getLegacyMigrationFunctionIfApplicable;
const child_process_1 = require("child_process");

@@ -92,3 +92,2 @@ const path_1 = require("path");

}
exports.getLegacyMigrationFunctionIfApplicable = getLegacyMigrationFunctionIfApplicable;
async function installDependencies(repoRoot, pkgInfo, pmc) {

@@ -95,0 +94,0 @@ const json = (0, fileutils_1.readJsonFile)((0, path_1.join)(repoRoot, 'package.json'));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupStandaloneWorkspace = void 0;
exports.setupStandaloneWorkspace = setupStandaloneWorkspace;
const fs_1 = require("fs");

@@ -37,3 +37,2 @@ const path_1 = require("path");

}
exports.setupStandaloneWorkspace = setupStandaloneWorkspace;
function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjectConfigFile, test, karmaProjectConfigFile, }, workspaceTargets) {

@@ -40,0 +39,0 @@ (0, utils_1.createNxJsonFile)(repoRoot, [], cacheableOperations, {});

import { Tree } from '../../../../generators/tree';
export declare const nxWrapperPath: (p?: typeof import('path')) => string;
export declare const nxWrapperPath: (p?: typeof import("path")) => string;
export declare function generateDotNxSetup(version?: string): void;

@@ -4,0 +4,0 @@ export declare function normalizeVersionForNxJson(pkg: string, version: string): string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sanitizeWrapperScript = exports.getNxWrapperContents = exports.updateGitIgnore = exports.writeMinimalNxJson = exports.normalizeVersionForNxJson = exports.generateDotNxSetup = exports.nxWrapperPath = void 0;
exports.nxWrapperPath = void 0;
exports.generateDotNxSetup = generateDotNxSetup;
exports.normalizeVersionForNxJson = normalizeVersionForNxJson;
exports.writeMinimalNxJson = writeMinimalNxJson;
exports.updateGitIgnore = updateGitIgnore;
exports.getNxWrapperContents = getNxWrapperContents;
exports.sanitizeWrapperScript = sanitizeWrapperScript;
const child_process_1 = require("child_process");

@@ -57,3 +63,2 @@ const fs_1 = require("fs");

}
exports.generateDotNxSetup = generateDotNxSetup;
function normalizeVersionForNxJson(pkg, version) {

@@ -65,3 +70,2 @@ if (!(0, semver_1.valid)(version)) {

}
exports.normalizeVersionForNxJson = normalizeVersionForNxJson;
function writeMinimalNxJson(host, version) {

@@ -76,3 +80,2 @@ if (!host.exists('nx.json')) {

}
exports.writeMinimalNxJson = writeMinimalNxJson;
function updateGitIgnore(host) {

@@ -87,3 +90,2 @@ let contents = host.read('.gitignore', 'utf-8') ?? '';

}
exports.updateGitIgnore = updateGitIgnore;
// Gets the sanitized contents for nxw.js

@@ -93,3 +95,2 @@ function getNxWrapperContents() {

}
exports.getNxWrapperContents = getNxWrapperContents;
// Remove any empty comments or comments that start with `//#: ` or eslint-disable comments.

@@ -109,2 +110,1 @@ // This removes the sourceMapUrl since it is invalid, as well as any internal comments.

}
exports.sanitizeWrapperScript = sanitizeWrapperScript;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addCracoCommandsToPackageScripts = void 0;
exports.addCracoCommandsToPackageScripts = addCracoCommandsToPackageScripts;
const fileutils_1 = require("../../../../utils/fileutils");

@@ -22,2 +22,1 @@ function addCracoCommandsToPackageScripts(appName, isStandalone) {

}
exports.addCracoCommandsToPackageScripts = addCracoCommandsToPackageScripts;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addViteCommandsToPackageScripts = void 0;
exports.addViteCommandsToPackageScripts = addViteCommandsToPackageScripts;
const fileutils_1 = require("../../../../utils/fileutils");

@@ -19,2 +19,1 @@ function addViteCommandsToPackageScripts(appName, isStandalone) {

}
exports.addViteCommandsToPackageScripts = addViteCommandsToPackageScripts;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkForCustomWebpackSetup = void 0;
exports.checkForCustomWebpackSetup = checkForCustomWebpackSetup;
const fileutils_1 = require("../../../../utils/fileutils");

@@ -18,2 +18,1 @@ function checkForCustomWebpackSetup() {

}
exports.checkForCustomWebpackSetup = checkForCustomWebpackSetup;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkForUncommittedChanges = void 0;
exports.checkForUncommittedChanges = checkForUncommittedChanges;
const child_process_1 = require("child_process");

@@ -19,2 +19,1 @@ function checkForUncommittedChanges() {

}
exports.checkForUncommittedChanges = checkForUncommittedChanges;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanUpFiles = void 0;
exports.cleanUpFiles = cleanUpFiles;
const fs_extra_1 = require("fs-extra");

@@ -31,2 +31,1 @@ const fileutils_1 = require("../../../../utils/fileutils");

}
exports.cleanUpFiles = cleanUpFiles;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNxToCraRepo = void 0;
exports.addNxToCraRepo = addNxToCraRepo;
const child_process_1 = require("child_process");

@@ -29,3 +29,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.addNxToCraRepo = addNxToCraRepo;
function installDependencies(options) {

@@ -32,0 +31,0 @@ const dependencies = [

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readNameFromPackageJson = void 0;
exports.readNameFromPackageJson = readNameFromPackageJson;
const fileutils_1 = require("../../../../utils/fileutils");

@@ -17,2 +17,1 @@ function readNameFromPackageJson() {

}
exports.readNameFromPackageJson = readNameFromPackageJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renameJsToJsx = void 0;
exports.renameJsToJsx = renameJsToJsx;
const fs_extra_1 = require("fs-extra");

@@ -23,2 +23,1 @@ const workspace_context_1 = require("../../../../utils/workspace-context");

}
exports.renameJsToJsx = renameJsToJsx;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupTsConfig = void 0;
exports.setupTsConfig = setupTsConfig;
const path_1 = require("path");

@@ -109,2 +109,1 @@ const fileutils_1 = require("../../../../utils/fileutils");

}
exports.setupTsConfig = setupTsConfig;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeCracoConfig = void 0;
exports.writeCracoConfig = writeCracoConfig;
const fs_1 = require("fs");

@@ -62,2 +62,1 @@ function writeCracoConfig(appName, isCRA5, isStandalone) {

}
exports.writeCracoConfig = writeCracoConfig;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeViteConfig = void 0;
exports.writeViteConfig = writeViteConfig;
const fs_1 = require("fs");

@@ -38,2 +38,1 @@ function writeViteConfig(appName, isStandalone, isJs) {

}
exports.writeViteConfig = writeViteConfig;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeViteIndexHtml = void 0;
exports.writeViteIndexHtml = writeViteIndexHtml;
const fs_1 = require("fs");

@@ -25,2 +25,1 @@ function writeViteIndexHtml(appName, isStandalone, isJs) {

}
exports.writeViteIndexHtml = writeViteIndexHtml;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMonorepo = exports.printFinalMessage = exports.markPackageJsonAsNxProject = exports.markRootPackageJsonAsNxProjectLegacy = exports.addVsCodeRecommendedExtensions = exports.initCloud = exports.runInstall = exports.updateGitIgnore = exports.addDepsToPackageJson = exports.createNxJsonFile = void 0;
exports.createNxJsonFile = createNxJsonFile;
exports.addDepsToPackageJson = addDepsToPackageJson;
exports.updateGitIgnore = updateGitIgnore;
exports.runInstall = runInstall;
exports.initCloud = initCloud;
exports.addVsCodeRecommendedExtensions = addVsCodeRecommendedExtensions;
exports.markRootPackageJsonAsNxProjectLegacy = markRootPackageJsonAsNxProjectLegacy;
exports.markPackageJsonAsNxProject = markPackageJsonAsNxProject;
exports.printFinalMessage = printFinalMessage;
exports.isMonorepo = isMonorepo;
const child_process_1 = require("child_process");

@@ -47,3 +56,2 @@ const path_1 = require("path");

}
exports.createNxJsonFile = createNxJsonFile;
function deduceDefaultBase() {

@@ -97,3 +105,2 @@ try {

}
exports.addDepsToPackageJson = addDepsToPackageJson;
function updateGitIgnore(root) {

@@ -123,7 +130,5 @@ const ignorePath = (0, path_1.join)(root, '.gitignore');

}
exports.updateGitIgnore = updateGitIgnore;
function runInstall(repoRoot, pmc = (0, package_manager_1.getPackageManagerCommand)()) {
(0, child_process_1.execSync)(pmc.install, { stdio: [0, 1, 2], cwd: repoRoot });
}
exports.runInstall = runInstall;
function initCloud(repoRoot, installationSource) {

@@ -135,3 +140,2 @@ (0, child_process_2.runNxSync)(`g nx:connect-to-nx-cloud --installationSource=${installationSource} --quiet --no-interactive`, {

}
exports.initCloud = initCloud;
function addVsCodeRecommendedExtensions(repoRoot, extensions) {

@@ -153,3 +157,2 @@ const vsCodeExtensionsPath = (0, path_1.join)(repoRoot, '.vscode/extensions.json');

}
exports.addVsCodeRecommendedExtensions = addVsCodeRecommendedExtensions;
function markRootPackageJsonAsNxProjectLegacy(repoRoot, cacheableScripts, pmc) {

@@ -174,3 +177,2 @@ const json = (0, fileutils_1.readJsonFile)((0, path_2.joinPathFragments)(repoRoot, `package.json`));

}
exports.markRootPackageJsonAsNxProjectLegacy = markRootPackageJsonAsNxProjectLegacy;
function markPackageJsonAsNxProject(packageJsonPath) {

@@ -184,3 +186,2 @@ const json = (0, fileutils_1.readJsonFile)(packageJsonPath);

}
exports.markPackageJsonAsNxProject = markPackageJsonAsNxProject;
function printFinalMessage({ learnMoreLink, }) {

@@ -197,3 +198,2 @@ const pmc = (0, package_manager_1.getPackageManagerCommand)();

}
exports.printFinalMessage = printFinalMessage;
function isMonorepo(packageJson) {

@@ -208,2 +208,1 @@ if (!!packageJson.workspaces)

}
exports.isMonorepo = isMonorepo;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initHandler = void 0;
exports.initHandler = initHandler;
const child_process_1 = require("child_process");

@@ -94,3 +94,2 @@ const enquirer_1 = require("enquirer");

}
exports.initHandler = initHandler;
function isCRA(packageJson) {

@@ -97,0 +96,0 @@ const combinedDependencies = {

@@ -0,1 +1,3 @@

import { PackageManagerCommands } from '../../utils/package-manager';
import { NxJsonConfiguration } from 'nx/src/config/nx-json';
export interface InitArgs {

@@ -7,2 +9,7 @@ interactive: boolean;

}
export declare function installPlugins(repoRoot: string, plugins: string[], pmc: PackageManagerCommands, updatePackageScripts: boolean): void;
export declare function initHandler(options: InitArgs): Promise<void>;
export declare function detectPlugins(nxJson: NxJsonConfiguration): Promise<{
plugins: string[];
updatePackageScripts: boolean;
}>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initHandler = void 0;
exports.installPlugins = installPlugins;
exports.initHandler = initHandler;
exports.detectPlugins = detectPlugins;
const fs_1 = require("fs");

@@ -20,2 +22,17 @@ const semver_1 = require("semver");

const add_nx_to_monorepo_1 = require("./implementation/add-nx-to-monorepo");
const nx_json_1 = require("nx/src/config/nx-json");
function installPlugins(repoRoot, plugins, pmc, updatePackageScripts) {
if (plugins.length === 0) {
return;
}
(0, utils_1.addDepsToPackageJson)(repoRoot, plugins);
(0, utils_1.runInstall)(repoRoot, pmc);
output_1.output.log({ title: '🔨 Configuring plugins' });
for (const plugin of plugins) {
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''} --no-interactive`, {
stdio: [0, 1, 2],
cwd: repoRoot,
});
}
}
async function initHandler(options) {

@@ -35,3 +52,4 @@ process.env.NX_RUNNING_NX_INIT = 'true';

(0, add_nx_scripts_1.generateDotNxSetup)(version);
const { plugins } = await detectPlugins();
const nxJson = (0, nx_json_1.readNxJson)(process.cwd());
const { plugins } = await detectPlugins(nxJson);
plugins.forEach((plugin) => {

@@ -57,4 +75,2 @@ (0, child_process_2.execSync)(`./nx add ${plugin}`, {

}
output_1.output.log({ title: '🧐 Checking dependencies' });
const { plugins, updatePackageScripts } = await detectPlugins();
const packageJson = (0, fileutils_1.readJsonFile)('package.json');

@@ -82,14 +98,7 @@ if ((0, utils_1.isMonorepo)(packageJson)) {

(0, utils_1.updateGitIgnore)(repoRoot);
(0, utils_1.addDepsToPackageJson)(repoRoot, plugins);
const nxJson = (0, nx_json_1.readNxJson)(repoRoot);
output_1.output.log({ title: '🧐 Checking dependencies' });
const { plugins, updatePackageScripts } = await detectPlugins(nxJson);
output_1.output.log({ title: '📦 Installing Nx' });
(0, utils_1.runInstall)(repoRoot, pmc);
if (plugins.length > 0) {
output_1.output.log({ title: '🔨 Configuring plugins' });
for (const plugin of plugins) {
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''} --no-interactive`, {
stdio: [0, 1, 2],
cwd: repoRoot,
});
}
}
installPlugins(repoRoot, plugins, pmc, updatePackageScripts);
if (useNxCloud) {

@@ -106,3 +115,2 @@ output_1.output.log({ title: '🛠️ Setting up Nx Cloud' });

}
exports.initHandler = initHandler;
const npmPackageToPluginMap = {

@@ -129,4 +137,5 @@ // Generic JS tools

};
async function detectPlugins() {
async function detectPlugins(nxJson) {
let files = ['package.json'].concat(await (0, workspace_context_1.globWithWorkspaceContext)(process.cwd(), ['**/*/package.json']));
const currentPlugins = new Set((nxJson.plugins ?? []).map((p) => (typeof p === 'string' ? p : p.plugin)));
const detectedPlugins = new Set();

@@ -157,2 +166,8 @@ for (const file of files) {

}
// Remove existing plugins
for (const plugin of detectedPlugins) {
if (currentPlugins.has(plugin)) {
detectedPlugins.delete(plugin);
}
}
const plugins = Array.from(detectedPlugins);

@@ -159,0 +174,0 @@ if (plugins.length === 0) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listHandler = void 0;
exports.listHandler = listHandler;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -47,2 +47,1 @@ const output_1 = require("../../utils/output");

}
exports.listHandler = listHandler;

@@ -109,3 +109,3 @@ import { MigrationsJson, PackageJsonUpdateForPackage as PackageUpdate } from '../../config/misc-interfaces';

version: string;
cli?: 'nx' | 'angular';
cli?: "nx" | "angular";
}[]>;

@@ -112,0 +112,0 @@ export declare function migrate(root: string, args: {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.migrate = exports.executeMigrations = exports.parseMigrationsOptions = exports.Migrator = exports.normalizeVersion = void 0;
exports.Migrator = void 0;
exports.normalizeVersion = normalizeVersion;
exports.parseMigrationsOptions = parseMigrationsOptions;
exports.executeMigrations = executeMigrations;
exports.migrate = migrate;
const chalk = require("chalk");

@@ -57,3 +61,2 @@ const child_process_1 = require("child_process");

}
exports.normalizeVersion = normalizeVersion;
function cleanSemver(version) {

@@ -491,3 +494,2 @@ return (0, semver_1.clean)(version) ?? (0, semver_1.coerce)(version);

}
exports.parseMigrationsOptions = parseMigrationsOptions;
function createInstalledPackageVersionsResolver(root) {

@@ -957,3 +959,2 @@ const cache = {};

}
exports.executeMigrations = executeMigrations;
async function runMigrations(root, opts, args, isVerbose, shouldCreateCommits = false, commitPrefix) {

@@ -1039,3 +1040,2 @@ if (!process.env.NX_MIGRATE_SKIP_INSTALL) {

}
exports.migrate = migrate;
function readMigrationCollection(packageName, root) {

@@ -1042,0 +1042,0 @@ const collectionPath = readPackageMigrationConfig(packageName, root).migrations;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newWorkspace = void 0;
exports.newWorkspace = newWorkspace;
const tree_1 = require("../../generators/tree");

@@ -30,2 +30,1 @@ const params_1 = require("../../utils/params");

}
exports.newWorkspace = newWorkspace;

@@ -13,15 +13,16 @@ "use strict";

const command_object_7 = require("./generate/command-object");
const command_object_8 = require("./init/command-object");
const command_object_9 = require("./list/command-object");
const command_object_10 = require("./migrate/command-object");
const command_object_11 = require("./new/command-object");
const command_object_12 = require("./repair/command-object");
const command_object_13 = require("./report/command-object");
const command_object_14 = require("./run/command-object");
const command_object_15 = require("./run-many/command-object");
const command_object_16 = require("./show/command-object");
const command_object_17 = require("./watch/command-object");
const command_object_18 = require("./reset/command-object");
const command_object_19 = require("./release/command-object");
const command_object_20 = require("./add/command-object");
const command_object_8 = require("./import/command-object");
const command_object_9 = require("./init/command-object");
const command_object_10 = require("./list/command-object");
const command_object_11 = require("./migrate/command-object");
const command_object_12 = require("./new/command-object");
const command_object_13 = require("./repair/command-object");
const command_object_14 = require("./report/command-object");
const command_object_15 = require("./run/command-object");
const command_object_16 = require("./run-many/command-object");
const command_object_17 = require("./show/command-object");
const command_object_18 = require("./watch/command-object");
const command_object_19 = require("./reset/command-object");
const command_object_20 = require("./release/command-object");
const command_object_21 = require("./add/command-object");
const command_objects_1 = require("./deprecated/command-objects");

@@ -44,3 +45,3 @@ // Ensure that the output takes up the available width of the terminal.

.demandCommand(1, '')
.command(command_object_20.yargsAddCommand)
.command(command_object_21.yargsAddCommand)
.command(command_object_1.yargsAffectedBuildCommand)

@@ -59,18 +60,19 @@ .command(command_object_1.yargsAffectedCommand)

.command(command_object_7.yargsGenerateCommand)
.command(command_object_8.yargsInitCommand)
.command(command_object_10.yargsInternalMigrateCommand)
.command(command_object_9.yargsListCommand)
.command(command_object_10.yargsMigrateCommand)
.command(command_object_11.yargsNewCommand)
.command(command_object_8.yargsImportCommand)
.command(command_object_9.yargsInitCommand)
.command(command_object_11.yargsInternalMigrateCommand)
.command(command_object_10.yargsListCommand)
.command(command_object_11.yargsMigrateCommand)
.command(command_object_12.yargsNewCommand)
.command(command_objects_1.yargsPrintAffectedCommand)
.command(command_object_19.yargsReleaseCommand)
.command(command_object_12.yargsRepairCommand)
.command(command_object_13.yargsReportCommand)
.command(command_object_18.yargsResetCommand)
.command(command_object_14.yargsRunCommand)
.command(command_object_15.yargsRunManyCommand)
.command(command_object_16.yargsShowCommand)
.command(command_object_20.yargsReleaseCommand)
.command(command_object_13.yargsRepairCommand)
.command(command_object_14.yargsReportCommand)
.command(command_object_19.yargsResetCommand)
.command(command_object_15.yargsRunCommand)
.command(command_object_16.yargsRunManyCommand)
.command(command_object_17.yargsShowCommand)
.command(command_object_2.yargsViewLogsCommand)
.command(command_object_17.yargsWatchCommand)
.command(command_object_14.yargsNxInfixCommand)
.command(command_object_18.yargsWatchCommand)
.command(command_object_15.yargsNxInfixCommand)
.scriptName('nx')

@@ -77,0 +79,0 @@ .help()

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldCreateGitHubRelease = exports.releaseChangelog = exports.releaseChangelogCLIHandler = void 0;
exports.releaseChangelogCLIHandler = void 0;
exports.releaseChangelog = releaseChangelog;
exports.shouldCreateGitHubRelease = shouldCreateGitHubRelease;
const chalk = require("chalk");

@@ -468,3 +470,2 @@ const enquirer_1 = require("enquirer");

}
exports.releaseChangelog = releaseChangelog;
function resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredProjects) {

@@ -867,3 +868,2 @@ if (!args.version && !args.versionData) {

}
exports.shouldCreateGitHubRelease = shouldCreateGitHubRelease;
async function promptForGitHubRelease() {

@@ -870,0 +870,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleNxReleaseConfigError = exports.createNxReleaseConfig = exports.IMPLICIT_DEFAULT_RELEASE_GROUP = void 0;
exports.IMPLICIT_DEFAULT_RELEASE_GROUP = void 0;
exports.createNxReleaseConfig = createNxReleaseConfig;
exports.handleNxReleaseConfigError = handleNxReleaseConfigError;
/**

@@ -371,3 +373,2 @@ * `nx release` is a powerful feature which spans many possible use cases. The possible variations

}
exports.createNxReleaseConfig = createNxReleaseConfig;
/**

@@ -542,3 +543,2 @@ * In some cases it is much cleaner and more intuitive for the user to be able to

}
exports.handleNxReleaseConfigError = handleNxReleaseConfigError;
function ensureReleaseGroupReleaseTagPatternIsValid(releaseTagPattern, releaseGroupName) {

@@ -545,0 +545,0 @@ // ensure that any provided releaseTagPattern contains exactly one instance of {version}

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterReleaseGroups = void 0;
exports.filterReleaseGroups = filterReleaseGroups;
const find_matching_projects_1 = require("../../../utils/find-matching-projects");

@@ -151,2 +151,1 @@ const output_1 = require("../../../utils/output");

}
exports.filterReleaseGroups = filterReleaseGroups;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVersionPlansAbsolutePath = exports.setVersionPlansOnGroups = exports.readRawVersionPlans = void 0;
exports.readRawVersionPlans = readRawVersionPlans;
exports.setVersionPlansOnGroups = setVersionPlansOnGroups;
exports.getVersionPlansAbsolutePath = getVersionPlansAbsolutePath;
const fs_1 = require("fs");

@@ -36,3 +38,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.readRawVersionPlans = readRawVersionPlans;
function setVersionPlansOnGroups(rawVersionPlans, releaseGroups, allProjectNamesInWorkspace) {

@@ -170,3 +171,2 @@ const groupsByName = releaseGroups.reduce((acc, group) => acc.set(group.name, group), new Map());

}
exports.setVersionPlansOnGroups = setVersionPlansOnGroups;
function isDefault(releaseGroups) {

@@ -179,3 +179,2 @@ return (releaseGroups.length === 1 &&

}
exports.getVersionPlansAbsolutePath = getVersionPlansAbsolutePath;
function isReleaseType(value) {

@@ -182,0 +181,0 @@ return semver_1.RELEASE_TYPES.includes(value);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.releasePlan = exports.releasePlanCLIHandler = void 0;
exports.releasePlanCLIHandler = void 0;
exports.releasePlan = releasePlan;
const enquirer_1 = require("enquirer");

@@ -111,3 +112,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.releasePlan = releasePlan;
async function promptForVersion(message) {

@@ -114,0 +114,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.releasePublish = exports.releasePublishCLIHandler = void 0;
exports.releasePublishCLIHandler = void 0;
exports.releasePublish = releasePublish;
const nx_json_1 = require("../../config/nx-json");

@@ -81,3 +82,2 @@ const file_map_utils_1 = require("../../project-graph/file-map-utils");

}
exports.releasePublish = releasePublish;
async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, isCLI, extraOptions) {

@@ -84,0 +84,0 @@ const projectsToRun = projectNames.map((projectName) => projectGraph.nodes[projectName]);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.release = exports.releaseCLIHandler = void 0;
exports.releaseCLIHandler = void 0;
exports.release = release;
const enquirer_1 = require("enquirer");

@@ -200,3 +201,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.release = release;
async function promptForPublish() {

@@ -203,0 +203,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.batchProjectsByGeneratorConfig = void 0;
exports.batchProjectsByGeneratorConfig = batchProjectsByGeneratorConfig;
const json_diff_1 = require("../../../utils/json-diff");

@@ -37,2 +37,1 @@ /**

}
exports.batchProjectsByGeneratorConfig = batchProjectsByGeneratorConfig;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.execCommand = void 0;
exports.execCommand = execCommand;
const node_child_process_1 = require("node:child_process");

@@ -34,2 +34,1 @@ async function execCommand(cmd, args, options) {

}
exports.execCommand = execCommand;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFirstGitCommit = exports.getCommitHash = exports.parseGitCommit = exports.parseConventionalCommitsMessage = exports.parseCommits = exports.gitPush = exports.gitTag = exports.gitCommit = exports.gitAdd = exports.getGitDiff = exports.getLatestGitTagForPattern = void 0;
exports.getLatestGitTagForPattern = getLatestGitTagForPattern;
exports.getGitDiff = getGitDiff;
exports.gitAdd = gitAdd;
exports.gitCommit = gitCommit;
exports.gitTag = gitTag;
exports.gitPush = gitPush;
exports.parseCommits = parseCommits;
exports.parseConventionalCommitsMessage = parseConventionalCommitsMessage;
exports.parseGitCommit = parseGitCommit;
exports.getCommitHash = getCommitHash;
exports.getFirstGitCommit = getFirstGitCommit;
/**

@@ -68,3 +78,2 @@ * Special thanks to changelogen for the original inspiration for many of these utilities:

}
exports.getLatestGitTagForPattern = getLatestGitTagForPattern;
async function getGitDiff(from, to = 'HEAD') {

@@ -101,3 +110,2 @@ let range = '';

}
exports.getGitDiff = getGitDiff;
async function getChangedTrackedFiles(cwd) {

@@ -164,3 +172,2 @@ const result = await (0, exec_command_1.execCommand)('git', ['status', '--porcelain'], {

}
exports.gitAdd = gitAdd;
async function isIgnored(filePath, cwd) {

@@ -210,3 +217,2 @@ try {

}
exports.gitCommit = gitCommit;
async function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, }) {

@@ -241,3 +247,2 @@ logFn = logFn || console.log;

}
exports.gitTag = gitTag;
async function gitPush({ gitRemote, dryRun, verbose, }) {

@@ -269,7 +274,5 @@ const commandArgs = [

}
exports.gitPush = gitPush;
function parseCommits(commits) {
return commits.map((commit) => parseGitCommit(commit)).filter(Boolean);
}
exports.parseCommits = parseCommits;
function parseConventionalCommitsMessage(message) {

@@ -287,3 +290,2 @@ const match = message.match(ConventionalCommitRegex);

}
exports.parseConventionalCommitsMessage = parseConventionalCommitsMessage;
// https://www.conventionalcommits.org/en/v1.0.0/

@@ -353,3 +355,2 @@ // https://regex101.com/r/FSfNvA/1

}
exports.parseGitCommit = parseGitCommit;
async function getCommitHash(ref) {

@@ -363,3 +364,2 @@ try {

}
exports.getCommitHash = getCommitHash;
async function getFirstGitCommit() {

@@ -378,2 +378,1 @@ try {

}
exports.getFirstGitCommit = getFirstGitCommit;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatReferences = exports.getGithubReleaseByTag = exports.resolveGithubToken = exports.createOrUpdateGithubRelease = exports.getGitHubRepoSlug = void 0;
exports.getGitHubRepoSlug = getGitHubRepoSlug;
exports.createOrUpdateGithubRelease = createOrUpdateGithubRelease;
exports.resolveGithubToken = resolveGithubToken;
exports.getGithubReleaseByTag = getGithubReleaseByTag;
exports.formatReferences = formatReferences;
const chalk = require("chalk");

@@ -36,3 +40,2 @@ const enquirer_1 = require("enquirer");

}
exports.getGitHubRepoSlug = getGitHubRepoSlug;
async function createOrUpdateGithubRelease(releaseVersion, changelogContents, latestCommit, { dryRun }) {

@@ -95,3 +98,2 @@ const githubRepoSlug = getGitHubRepoSlug();

}
exports.createOrUpdateGithubRelease = createOrUpdateGithubRelease;
async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release, existingGithubReleaseForVersion) {

@@ -247,7 +249,5 @@ const result = await syncGithubRelease(githubRequestConfig, release, existingGithubReleaseForVersion);

}
exports.resolveGithubToken = resolveGithubToken;
async function getGithubReleaseByTag(config, tag) {
return await makeGithubRequest(config, `/repos/${config.repo}/releases/tags/${tag}`, {});
}
exports.getGithubReleaseByTag = getGithubReleaseByTag;
async function makeGithubRequest(config, url, opts = {}) {

@@ -300,2 +300,1 @@ return (await axios(url, {

}
exports.formatReferences = formatReferences;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.launchEditor = void 0;
exports.launchEditor = launchEditor;
const node_child_process_1 = require("node:child_process");

@@ -27,3 +27,2 @@ async function launchEditor(filePath) {

}
exports.launchEditor = launchEditor;
function getGitConfig(key) {

@@ -30,0 +29,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseChangelogMarkdown = void 0;
exports.parseChangelogMarkdown = parseChangelogMarkdown;
function parseChangelogMarkdown(contents) {

@@ -29,2 +29,1 @@ /**

}
exports.parseChangelogMarkdown = parseChangelogMarkdown;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Tree } from '../../../generators/tree';

@@ -3,0 +2,0 @@ export declare function printDiff(before: string, after: string, contextLines?: number, noDiffMessage?: string): void;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printAndFlushChanges = exports.printDiff = void 0;
exports.printDiff = printDiff;
exports.printAndFlushChanges = printAndFlushChanges;
const chalk = require("chalk");

@@ -29,3 +30,2 @@ const jest_diff_1 = require("jest-diff");

}
exports.printDiff = printDiff;
function printAndFlushChanges(tree, isDryRun, diffContextLines = 1, shouldPrintDryRunMessage = true, noDiffMessage, changePredicate) {

@@ -61,2 +61,1 @@ changePredicate = changePredicate || (() => true);

}
exports.printAndFlushChanges = printAndFlushChanges;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveChangelogRenderer = void 0;
exports.resolveChangelogRenderer = resolveChangelogRenderer;
const register_1 = require("../../../plugins/js/utils/register");

@@ -31,2 +31,1 @@ const typescript_1 = require("../../../plugins/js/utils/typescript");

}
exports.resolveChangelogRenderer = resolveChangelogRenderer;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveNxJsonConfigErrorMessage = void 0;
exports.resolveNxJsonConfigErrorMessage = resolveNxJsonConfigErrorMessage;
const node_fs_1 = require("node:fs");

@@ -18,3 +18,2 @@ const node_path_1 = require("node:path");

}
exports.resolveNxJsonConfigErrorMessage = resolveNxJsonConfigErrorMessage;
async function getJsonConfigLinesForErrorMessage(rawConfig, jsonPath) {

@@ -21,0 +20,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveSemverSpecifierFromPrompt = exports.resolveSemverSpecifierFromConventionalCommits = void 0;
exports.resolveSemverSpecifierFromConventionalCommits = resolveSemverSpecifierFromConventionalCommits;
exports.resolveSemverSpecifierFromPrompt = resolveSemverSpecifierFromPrompt;
const enquirer_1 = require("enquirer");

@@ -15,3 +16,2 @@ const semver_1 = require("semver");

}
exports.resolveSemverSpecifierFromConventionalCommits = resolveSemverSpecifierFromConventionalCommits;
async function resolveSemverSpecifierFromPrompt(selectionMessage, customVersionMessage) {

@@ -59,2 +59,1 @@ try {

}
exports.resolveSemverSpecifierFromPrompt = resolveSemverSpecifierFromPrompt;

@@ -7,3 +7,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.deriveNewSemverVersion = exports.determineSemverChange = exports.isValidSemverSpecifier = exports.isRelativeVersionKeyword = void 0;
exports.isRelativeVersionKeyword = isRelativeVersionKeyword;
exports.isValidSemverSpecifier = isValidSemverSpecifier;
exports.determineSemverChange = determineSemverChange;
exports.deriveNewSemverVersion = deriveNewSemverVersion;
const semver_1 = require("semver");

@@ -13,7 +16,5 @@ function isRelativeVersionKeyword(val) {

}
exports.isRelativeVersionKeyword = isRelativeVersionKeyword;
function isValidSemverSpecifier(specifier) {
return (specifier && !!((0, semver_1.valid)(specifier) || isRelativeVersionKeyword(specifier)));
}
exports.isValidSemverSpecifier = isValidSemverSpecifier;
// https://github.com/unjs/changelogen/blob/main/src/semver.ts

@@ -39,3 +40,2 @@ function determineSemverChange(commits, config) {

}
exports.determineSemverChange = determineSemverChange;
function deriveNewSemverVersion(currentSemverVersion, semverSpecifier, preid) {

@@ -62,2 +62,1 @@ if (!(0, semver_1.valid)(currentSemverVersion)) {

}
exports.deriveNewSemverVersion = deriveNewSemverVersion;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommitsRelevantToProjects = exports.handleDuplicateGitTags = exports.createGitTagValues = exports.createCommitMessageValues = exports.commitChanges = exports.ReleaseVersion = exports.noDiffInChangelogMessage = void 0;
exports.ReleaseVersion = exports.noDiffInChangelogMessage = void 0;
exports.commitChanges = commitChanges;
exports.createCommitMessageValues = createCommitMessageValues;
exports.createGitTagValues = createGitTagValues;
exports.handleDuplicateGitTags = handleDuplicateGitTags;
exports.getCommitsRelevantToProjects = getCommitsRelevantToProjects;
const chalk = require("chalk");

@@ -51,3 +56,2 @@ const semver_1 = require("semver");

}
exports.commitChanges = commitChanges;
function createCommitMessageValues(releaseGroups, releaseGroupToFilteredProjects, versionData, commitMessage) {

@@ -136,3 +140,2 @@ const commitMessageValues = [commitMessage];

}
exports.createCommitMessageValues = createCommitMessageValues;
function stripPlaceholders(str, placeholders) {

@@ -176,3 +179,2 @@ for (const placeholder of placeholders) {

}
exports.createGitTagValues = createGitTagValues;
function findDuplicates(arr) {

@@ -206,3 +208,2 @@ const seen = new Set();

}
exports.handleDuplicateGitTags = handleDuplicateGitTags;
async function getCommitsRelevantToProjects(projectGraph, commits, projects) {

@@ -220,2 +221,1 @@ const { fileMap } = await (0, file_map_utils_1.createFileMapUsingProjectGraph)(projectGraph);

}
exports.getCommitsRelevantToProjects = getCommitsRelevantToProjects;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.releaseVersion = exports.releaseVersionCLIHandler = exports.validReleaseVersionPrefixes = exports.deriveNewSemverVersion = void 0;
exports.releaseVersionCLIHandler = exports.validReleaseVersionPrefixes = exports.deriveNewSemverVersion = void 0;
exports.releaseVersion = releaseVersion;
const chalk = require("chalk");

@@ -284,3 +285,2 @@ const node_child_process_1 = require("node:child_process");

}
exports.releaseVersion = releaseVersion;
function appendVersionData(existingVersionData, newVersionData) {

@@ -287,0 +287,0 @@ // Mutate the existing version data

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.repair = void 0;
exports.repair = repair;
const params_1 = require("../../utils/params");

@@ -41,2 +41,1 @@ const migrationsJson = require("../../../migrations.json");

}
exports.repair = repair;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findInstalledPackagesWeCareAbout = exports.findRegisteredPluginsBeingUsed = exports.findInstalledCommunityPlugins = exports.findMisalignedPackagesForPackage = exports.getReportData = exports.reportHandler = exports.patternsWeIgnoreInCommunityReport = exports.packagesWeCareAbout = void 0;
exports.patternsWeIgnoreInCommunityReport = exports.packagesWeCareAbout = void 0;
exports.reportHandler = reportHandler;
exports.getReportData = getReportData;
exports.findMisalignedPackagesForPackage = findMisalignedPackagesForPackage;
exports.findInstalledCommunityPlugins = findInstalledCommunityPlugins;
exports.findRegisteredPluginsBeingUsed = findRegisteredPluginsBeingUsed;
exports.findInstalledPackagesWeCareAbout = findInstalledPackagesWeCareAbout;
const chalk = require("chalk");

@@ -16,2 +22,3 @@ const output_1 = require("../../utils/output");

const nx_json_1 = require("../../config/nx-json");
const error_types_1 = require("../../project-graph/error-types");
const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));

@@ -93,19 +100,10 @@ exports.packagesWeCareAbout = [

}
exports.reportHandler = reportHandler;
async function getReportData() {
const pm = (0, package_manager_1.detectPackageManager)();
const pmVersion = (0, package_manager_1.getPackageManagerVersion)(pm);
const { graph, error: projectGraphError } = await tryGetProjectGraph();
const nxJson = (0, nx_json_1.readNxJson)();
const localPlugins = await findLocalPlugins(nxJson);
const localPlugins = await findLocalPlugins(graph, nxJson);
const communityPlugins = findInstalledCommunityPlugins();
const registeredPlugins = findRegisteredPluginsBeingUsed(nxJson);
let projectGraphError = null;
if (isNativeAvailable()) {
try {
await (0, project_graph_1.createProjectGraphAsync)();
}
catch (e) {
projectGraphError = e;
}
}
const packageVersionsWeCareAbout = findInstalledPackagesWeCareAbout();

@@ -134,6 +132,20 @@ packageVersionsWeCareAbout.unshift({

}
exports.getReportData = getReportData;
async function findLocalPlugins(nxJson) {
async function tryGetProjectGraph() {
try {
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
return { graph: await (0, project_graph_1.createProjectGraphAsync)() };
}
catch (error) {
if (error instanceof error_types_1.ProjectGraphError) {
return {
graph: error.getPartialProjectGraph(),
error: error,
};
}
return {
error,
};
}
}
async function findLocalPlugins(projectGraph, nxJson) {
try {
const localPlugins = await (0, local_plugins_1.getLocalWorkspacePlugins)((0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph), nxJson);

@@ -185,3 +197,2 @@ return Array.from(localPlugins.keys());

}
exports.findMisalignedPackagesForPackage = findMisalignedPackagesForPackage;
function findInstalledCommunityPlugins() {

@@ -194,3 +205,2 @@ const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();

}
exports.findInstalledCommunityPlugins = findInstalledCommunityPlugins;
function findRegisteredPluginsBeingUsed(nxJson) {

@@ -202,3 +212,2 @@ if (!nxJson.plugins) {

}
exports.findRegisteredPluginsBeingUsed = findRegisteredPluginsBeingUsed;
function findInstalledPackagesWeCareAbout() {

@@ -246,3 +255,2 @@ const packagesWeMayCareAbout = {};

}
exports.findInstalledPackagesWeCareAbout = findInstalledPackagesWeCareAbout;
function isNativeAvailable() {

@@ -249,0 +257,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resetHandler = void 0;
exports.resetHandler = resetHandler;
const fs_extra_1 = require("fs-extra");

@@ -55,3 +55,3 @@ const client_1 = require("../../daemon/client/client");

catch {
errors.push('Failed to clean up the native file cache.');
// ignore, deleting the native file cache is not critical and can fail if another process is locking the file
}

@@ -78,3 +78,2 @@ try {

}
exports.resetHandler = resetHandler;
function killDaemon() {

@@ -81,0 +80,0 @@ return client_1.daemonClient.stop();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.projectsToRun = exports.runMany = void 0;
exports.runMany = runMany;
exports.projectsToRun = projectsToRun;
const run_command_1 = require("../../tasks-runner/run-command");

@@ -49,3 +50,2 @@ const command_line_utils_1 = require("../../utils/command-line-utils");

}
exports.runMany = runMany;
function projectsToRun(nxArgs, projectGraph) {

@@ -84,3 +84,2 @@ const selectedProjects = {};

}
exports.projectsToRun = projectsToRun;
function runnableForTarget(projects, targets) {

@@ -87,0 +86,0 @@ const runnable = new Set();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.yargsNxInfixCommand = exports.yargsRunCommand = void 0;
const yargs_1 = require("yargs");
const shared_options_1 = require("../yargs-utils/shared-options");

@@ -32,2 +33,7 @@ const params_1 = require("../../utils/params");

const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
// Yargs parses <target> as 'undefined' if running just 'nx'
if (!args.target || args.target === 'undefined') {
(0, yargs_1.showHelp)();
process.exit(1);
}
return (await Promise.resolve().then(() => require('./run-one'))).runOne(process.cwd(), (0, shared_options_1.withOverrides)(args, 0));

@@ -34,0 +40,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExecutorInformation = exports.normalizeExecutorSchema = void 0;
exports.normalizeExecutorSchema = normalizeExecutorSchema;
exports.getExecutorInformation = getExecutorInformation;
const path_1 = require("path");

@@ -20,3 +21,2 @@ const plugins_1 = require("../../project-graph/plugins");

}
exports.normalizeExecutorSchema = normalizeExecutorSchema;
function cacheKey(nodeModule, executor, root) {

@@ -57,7 +57,12 @@ return `${root}:${nodeModule}:${executor}`;

}
exports.getExecutorInformation = getExecutorInformation;
function readExecutorJson(nodeModule, executor, root, projects) {
function readExecutorJson(nodeModule, executor, root, projects, extraRequirePaths = []) {
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, projects, root
? [root, __dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)()]
: [__dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)()]);
? [
root,
__dirname,
process.cwd(),
...(0, installation_directory_1.getNxRequirePaths)(),
...extraRequirePaths,
]
: [__dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)(), ...extraRequirePaths]);
const executorsFile = packageJson.executors ?? packageJson.builders;

@@ -67,3 +72,4 @@ if (!executorsFile) {

}
const executorsFilePath = require.resolve((0, path_1.join)((0, path_1.dirname)(packageJsonPath), executorsFile));
const basePath = (0, path_1.dirname)(packageJsonPath);
const executorsFilePath = require.resolve((0, path_1.join)(basePath, executorsFile));
const executorsJson = (0, fileutils_1.readJsonFile)(executorsFilePath);

@@ -77,3 +83,5 @@ const executorConfig = executorsJson.executors?.[executor] || executorsJson.builders?.[executor];

const [packageName, executorName] = executorConfig.split(':');
return readExecutorJson(packageName, executorName, root, projects);
return readExecutorJson(packageName, executorName, root, projects, [
basePath,
]);
}

@@ -80,0 +88,0 @@ const isNgCompat = !executorsJson.executors?.[executor];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runOne = void 0;
exports.runOne = runOne;
const run_command_1 = require("../../tasks-runner/run-command");

@@ -57,3 +57,2 @@ const command_line_utils_1 = require("../../utils/command-line-utils");

}
exports.runOne = runOne;
function getProjects(projectGraph, project) {

@@ -60,0 +59,0 @@ if (!projectGraph.nodes[project]) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = exports.printTargetRunHelp = exports.runExecutor = exports.validateProject = exports.printRunHelp = void 0;
exports.printRunHelp = printRunHelp;
exports.validateProject = validateProject;
exports.runExecutor = runExecutor;
exports.printTargetRunHelp = printTargetRunHelp;
exports.run = run;
const npm_run_path_1 = require("npm-run-path");

@@ -21,3 +25,2 @@ const params_1 = require("../../utils/params");

}
exports.printRunHelp = printRunHelp;
function validateProject(projects, projectName) {

@@ -29,3 +32,2 @@ const project = projects.projects[projectName];

}
exports.validateProject = validateProject;
function isPromise(v) {

@@ -176,3 +178,2 @@ return typeof v?.then === 'function';

}
exports.runExecutor = runExecutor;
function printTargetRunHelp(targetDescription, root) {

@@ -185,3 +186,2 @@ const projectGraph = (0, project_graph_1.readCachedProjectGraph)();

}
exports.printTargetRunHelp = printTargetRunHelp;
function run(cwd, root, targetDescription, overrides, isVerbose, taskGraph) {

@@ -194,2 +194,1 @@ const projectGraph = (0, project_graph_1.readCachedProjectGraph)();

}
exports.run = run;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.showProjectHandler = void 0;
exports.showProjectHandler = showProjectHandler;
const output_1 = require("../../utils/output");

@@ -61,2 +61,1 @@ const project_graph_1 = require("../../project-graph/project-graph");

}
exports.showProjectHandler = showProjectHandler;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.showProjectsHandler = void 0;
exports.showProjectsHandler = showProjectsHandler;
const output_1 = require("../../utils/output");

@@ -64,3 +64,2 @@ const nx_json_1 = require("../../config/nx-json");

}
exports.showProjectsHandler = showProjectsHandler;
function getGraphNodesMatchingPatterns(graph, patterns) {

@@ -67,0 +66,0 @@ const nodes = {};

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watch = exports.BatchFunctionRunner = void 0;
exports.BatchFunctionRunner = void 0;
exports.watch = watch;
const child_process_1 = require("child_process");

@@ -119,2 +120,8 @@ const client_1 = require("../../daemon/client/client");

}
if (client_1.daemonClient.enabled()) {
output_1.output.error({
title: 'Daemon is not running. The watch command is not supported without the Nx Daemon.',
});
process.exit(1);
}
if (args.includeGlobalWorkspaceFiles &&

@@ -170,2 +177,1 @@ args.command.match(projectReplacementRegex)) {

}
exports.watch = watch;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.linkToNxDevAndExamples = void 0;
exports.linkToNxDevAndExamples = linkToNxDevAndExamples;
const chalk = require("chalk");

@@ -12,2 +12,1 @@ const examples_1 = require("../examples");

}
exports.linkToNxDevAndExamples = linkToNxDevAndExamples;

@@ -31,3 +31,3 @@ import { Argv } from 'yargs';

}>;
export declare function withVerbose(yargs: Argv): Argv<{
export declare function withVerbose<T>(yargs: Argv<T>): Argv<T & {
verbose: boolean;

@@ -34,0 +34,0 @@ }>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseCSV = exports.withRunOneOptions = exports.withOutputStyleOption = exports.withOverrides = exports.withRunManyOptions = exports.withAffectedOptions = exports.withBatch = exports.withVerbose = exports.withConfiguration = exports.withTargetAndConfigurationOption = exports.withRunOptions = exports.withExcludeOption = void 0;
exports.withExcludeOption = withExcludeOption;
exports.withRunOptions = withRunOptions;
exports.withTargetAndConfigurationOption = withTargetAndConfigurationOption;
exports.withConfiguration = withConfiguration;
exports.withVerbose = withVerbose;
exports.withBatch = withBatch;
exports.withAffectedOptions = withAffectedOptions;
exports.withRunManyOptions = withRunManyOptions;
exports.withOverrides = withOverrides;
exports.withOutputStyleOption = withOutputStyleOption;
exports.withRunOneOptions = withRunOneOptions;
exports.parseCSV = parseCSV;
function withExcludeOption(yargs) {

@@ -11,3 +22,2 @@ return yargs.option('exclude', {

}
exports.withExcludeOption = withExcludeOption;
function withRunOptions(yargs) {

@@ -75,3 +85,2 @@ return withVerbose(withExcludeOption(yargs))

}
exports.withRunOptions = withRunOptions;
function withTargetAndConfigurationOption(yargs, demandOption = true) {

@@ -88,3 +97,2 @@ return withConfiguration(yargs).option('targets', {

}
exports.withTargetAndConfigurationOption = withTargetAndConfigurationOption;
function withConfiguration(yargs) {

@@ -97,3 +105,2 @@ return yargs.options('configuration', {

}
exports.withConfiguration = withConfiguration;
function withVerbose(yargs) {

@@ -111,3 +118,2 @@ return yargs

}
exports.withVerbose = withVerbose;
function withBatch(yargs) {

@@ -123,3 +129,2 @@ return yargs.options('batch', {

}
exports.withBatch = withBatch;
function withAffectedOptions(yargs) {

@@ -166,3 +171,2 @@ return withExcludeOption(yargs)

}
exports.withAffectedOptions = withAffectedOptions;
function withRunManyOptions(yargs) {

@@ -187,3 +191,2 @@ return withRunOptions(yargs)

}
exports.withRunManyOptions = withRunManyOptions;
function withOverrides(args, commandLevel = 1) {

@@ -198,3 +201,2 @@ const unparsedArgs = (args['--'] ?? args._.slice(commandLevel)).map((v) => v.toString());

}
exports.withOverrides = withOverrides;
const allOutputStyles = [

@@ -227,3 +229,2 @@ 'dynamic',

}
exports.withOutputStyleOption = withOutputStyleOption;
function withRunOneOptions(yargs) {

@@ -252,3 +253,2 @@ const executorShouldShowHelp = !(process.argv[2] === 'run' && process.argv[3] === '--help');

}
exports.withRunOneOptions = withRunOneOptions;
function parseCSV(args) {

@@ -267,2 +267,1 @@ if (!args) {

}
exports.parseCSV = parseCSV;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCommandGraph = void 0;
exports.createCommandGraph = createCommandGraph;
const task_graph_utils_1 = require("../tasks-runner/task-graph-utils");
const output_1 = require("../utils/output");
/**
* Make structure { lib: [dep], dep: [dep1], dep1: [] } from projectName lib and projectGraph
* @param projectGraph
* @param projectName
* @param resolved reference to an object that will contain resolved dependencies
* @returns
*/
const recursiveResolveDeps = (projectGraph, projectName, resolved) => {
if (projectGraph.dependencies[projectName].length === 0) {
// no deps - no resolve
resolved[projectName] = [];
return;
}
// if already resolved - just skip
if (resolved[projectName]) {
return resolved[projectName];
}
// deps string list
const projectDeps = [
...new Set(projectGraph.dependencies[projectName]
.map((projectDep) => projectDep.target)
.filter((projectDep) => projectGraph.nodes[projectDep])).values(),
];
// define
resolved[projectName] = projectDeps;
if (projectDeps.length > 0) {
for (const dep of projectDeps) {
recursiveResolveDeps(projectGraph, dep, resolved);
}
}
};
function createCommandGraph(projectGraph, projectNames, nxArgs) {
const dependencies = {};
for (const projectName of projectNames) {
if (projectGraph.dependencies[projectName].length >= 1) {
dependencies[projectName] = [
...new Set(projectGraph.dependencies[projectName]
.map((projectDep) => projectDep.target)
.filter((projectDep) => projectGraph.nodes[projectDep])).values(),
];
}
else {
dependencies[projectName] = [];
}
recursiveResolveDeps(projectGraph, projectName, dependencies);
}

@@ -44,2 +66,1 @@ const roots = Object.keys(dependencies).filter((d) => dependencies[d].length === 0);

}
exports.createCommandGraph = createCommandGraph;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommandProjects = void 0;
exports.getCommandProjects = getCommandProjects;
const utils_1 = require("../tasks-runner/utils");

@@ -10,3 +10,2 @@ const create_command_graph_1 = require("./create-command-graph");

}
exports.getCommandProjects = getCommandProjects;
function getSortedProjects(commandGraph, sortedProjects = []) {

@@ -13,0 +12,0 @@ const roots = commandGraph.roots;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findMatchingProjectInCwd = exports.calculateDefaultProjectName = void 0;
exports.calculateDefaultProjectName = calculateDefaultProjectName;
exports.findMatchingProjectInCwd = findMatchingProjectInCwd;
const find_project_for_path_1 = require("../project-graph/utils/find-project-for-path");

@@ -32,3 +33,2 @@ const path_1 = require("path");

}
exports.calculateDefaultProjectName = calculateDefaultProjectName;
function findMatchingProjectInCwd(projects, relativeCwd) {

@@ -43,2 +43,1 @@ const projectRootMappings = new Map();

}
exports.findMatchingProjectInCwd = findMatchingProjectInCwd;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readNxJson = exports.workspaceLayout = void 0;
exports.readNxJson = void 0;
exports.workspaceLayout = workspaceLayout;
const nx_json_1 = require("./nx-json");

@@ -15,4 +16,3 @@ /**

}
exports.workspaceLayout = workspaceLayout;
var nx_json_2 = require("./nx-json");
Object.defineProperty(exports, "readNxJson", { enumerable: true, get: function () { return nx_json_2.readNxJson; } });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasNxJson = exports.readNxJson = void 0;
exports.readNxJson = readNxJson;
exports.hasNxJson = hasNxJson;
const fs_1 = require("fs");

@@ -35,3 +36,2 @@ const path_1 = require("path");

}
exports.readNxJson = readNxJson;
function hasNxJson(root) {

@@ -41,2 +41,1 @@ const nxJson = (0, path_1.join)(root, 'nx.json');

}
exports.hasNxJson = hasNxJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DependencyType = exports.fileDataDepType = exports.fileDataDepTarget = void 0;
exports.DependencyType = void 0;
exports.fileDataDepTarget = fileDataDepTarget;
exports.fileDataDepType = fileDataDepType;
function fileDataDepTarget(dep) {

@@ -11,3 +13,2 @@ return typeof dep === 'string'

}
exports.fileDataDepTarget = fileDataDepTarget;
function fileDataDepType(dep) {

@@ -20,3 +21,2 @@ return typeof dep === 'string'

}
exports.fileDataDepType = fileDataDepType;
/**

@@ -23,0 +23,0 @@ * Type of dependency between projects

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveSchema = exports.resolveImplementation = exports.getImplementationFactory = void 0;
exports.getImplementationFactory = getImplementationFactory;
exports.resolveImplementation = resolveImplementation;
exports.resolveSchema = resolveSchema;
const fs_1 = require("fs");

@@ -26,3 +28,2 @@ const path_1 = require("path");

}
exports.getImplementationFactory = getImplementationFactory;
/**

@@ -50,3 +51,2 @@ * This function is used to resolve the implementation of an executor or generator.

}
exports.resolveImplementation = resolveImplementation;
function resolveSchema(schemaPath, directory) {

@@ -61,2 +61,1 @@ const maybeSchemaPath = (0, path_1.join)(directory, schemaPath);

}
exports.resolveSchema = resolveSchema;

@@ -83,2 +83,6 @@ /**

cache?: boolean;
/**
* Determines if a given task should be parallelizable.
*/
parallelism: boolean;
}

@@ -85,0 +89,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toProjectName = void 0;
exports.toProjectName = toProjectName;
const path_1 = require("path");

@@ -13,2 +13,1 @@ /**

}
exports.toProjectName = toProjectName;

@@ -215,2 +215,7 @@ import type { NxJsonConfiguration, NxReleaseVersionConfiguration } from './nx-json';

metadata?: TargetMetadata;
/**
* Whether this target can be run in parallel with other tasks
* Default is true
*/
parallelism?: boolean;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDaemonProcessIdSync = exports.safelyCleanUpExistingProcess = exports.writeDaemonJsonProcessCache = exports.deleteDaemonJsonProcessCache = exports.readDaemonProcessJsonCache = exports.serverProcessJsonPath = void 0;
exports.serverProcessJsonPath = void 0;
exports.readDaemonProcessJsonCache = readDaemonProcessJsonCache;
exports.deleteDaemonJsonProcessCache = deleteDaemonJsonProcessCache;
exports.writeDaemonJsonProcessCache = writeDaemonJsonProcessCache;
exports.safelyCleanUpExistingProcess = safelyCleanUpExistingProcess;
exports.getDaemonProcessIdSync = getDaemonProcessIdSync;
const fs_extra_1 = require("fs-extra");

@@ -14,3 +19,2 @@ const path_1 = require("path");

}
exports.readDaemonProcessJsonCache = readDaemonProcessJsonCache;
function deleteDaemonJsonProcessCache() {

@@ -24,7 +28,5 @@ try {

}
exports.deleteDaemonJsonProcessCache = deleteDaemonJsonProcessCache;
async function writeDaemonJsonProcessCache(daemonJson) {
await (0, fs_extra_1.writeJson)(exports.serverProcessJsonPath, daemonJson);
}
exports.writeDaemonJsonProcessCache = writeDaemonJsonProcessCache;
async function safelyCleanUpExistingProcess() {

@@ -58,3 +60,2 @@ const daemonProcessJson = await readDaemonProcessJsonCache();

}
exports.safelyCleanUpExistingProcess = safelyCleanUpExistingProcess;
// Must be sync for the help output use case

@@ -73,2 +74,1 @@ function getDaemonProcessIdSync() {

}
exports.getDaemonProcessIdSync = getDaemonProcessIdSync;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { ChildProcess } from 'child_process';

@@ -68,1 +66,2 @@ import { FileData, ProjectGraph } from '../../config/project-graph';

export declare const daemonClient: DaemonClient;
export declare function isDaemonEnabled(): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.daemonClient = exports.DaemonClient = void 0;
exports.isDaemonEnabled = isDaemonEnabled;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -16,8 +17,9 @@ const child_process_1 = require("child_process");

const is_ci_1 = require("../../utils/is-ci");
const nx_json_1 = require("../../config/nx-json");
const configuration_1 = require("../../config/configuration");
const promised_based_queue_1 = require("../../utils/promised-based-queue");
const nx_json_1 = require("../../config/nx-json");
const daemon_socket_messenger_1 = require("./daemon-socket-messenger");
const cache_1 = require("../cache");
const error_types_1 = require("../../project-graph/error-types");
const native_1 = require("../../native");
const get_nx_workspace_files_1 = require("../message-types/get-nx-workspace-files");

@@ -68,2 +70,3 @@ const get_context_file_data_1 = require("../message-types/get-context-file-data");

// CI=true,env=true => daemon
// WASM => no daemon because file watching does not work
if (((0, is_ci_1.isCI)() && env !== 'true') ||

@@ -79,2 +82,8 @@ isDocker() ||

}
else if (native_1.IS_WASM) {
output_1.output.warn({
title: 'The Nx Daemon is unsupported in WebAssembly environments. Some things may be slower than or not function as expected.',
});
this._enabled = false;
}
else {

@@ -408,2 +417,5 @@ this._enabled = true;

exports.daemonClient = new DaemonClient();
function isDaemonEnabled() {
return exports.daemonClient.enabled();
}
function isDocker() {

@@ -410,0 +422,0 @@ try {

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Socket } from 'net';

@@ -3,0 +2,0 @@ export interface Message extends Record<string, any> {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateDaemonHelpOutput = void 0;
exports.generateDaemonHelpOutput = generateDaemonHelpOutput;
const child_process_1 = require("child_process");

@@ -26,2 +26,1 @@ const cache_1 = require("../cache");

}
exports.generateDaemonHelpOutput = generateDaemonHelpOutput;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isOnDaemon = void 0;
exports.isOnDaemon = isOnDaemon;
function isOnDaemon() {
return !!global.NX_DAEMON;
}
exports.isOnDaemon = isOnDaemon;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleContextFileDataMessage = exports.GET_CONTEXT_FILE_DATA = void 0;
exports.GET_CONTEXT_FILE_DATA = void 0;
exports.isHandleContextFileDataMessage = isHandleContextFileDataMessage;
exports.GET_CONTEXT_FILE_DATA = 'GET_CONTEXT_FILE_DATA';

@@ -11,2 +12,1 @@ function isHandleContextFileDataMessage(message) {

}
exports.isHandleContextFileDataMessage = isHandleContextFileDataMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleGetFilesInDirectoryMessage = exports.GET_FILES_IN_DIRECTORY = void 0;
exports.GET_FILES_IN_DIRECTORY = void 0;
exports.isHandleGetFilesInDirectoryMessage = isHandleGetFilesInDirectoryMessage;
exports.GET_FILES_IN_DIRECTORY = 'GET_FILES_IN_DIRECTORY';

@@ -11,2 +12,1 @@ function isHandleGetFilesInDirectoryMessage(message) {

}
exports.isHandleGetFilesInDirectoryMessage = isHandleGetFilesInDirectoryMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleNxWorkspaceFilesMessage = exports.GET_NX_WORKSPACE_FILES = void 0;
exports.GET_NX_WORKSPACE_FILES = void 0;
exports.isHandleNxWorkspaceFilesMessage = isHandleNxWorkspaceFilesMessage;
exports.GET_NX_WORKSPACE_FILES = 'GET_NX_WORKSPACE_FILES';

@@ -11,2 +12,1 @@ function isHandleNxWorkspaceFilesMessage(message) {

}
exports.isHandleNxWorkspaceFilesMessage = isHandleNxWorkspaceFilesMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleGlobMessage = exports.GLOB = void 0;
exports.GLOB = void 0;
exports.isHandleGlobMessage = isHandleGlobMessage;
exports.GLOB = 'GLOB';

@@ -11,2 +12,1 @@ function isHandleGlobMessage(message) {

}
exports.isHandleGlobMessage = isHandleGlobMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleHashGlobMessage = exports.HASH_GLOB = void 0;
exports.HASH_GLOB = void 0;
exports.isHandleHashGlobMessage = isHandleHashGlobMessage;
exports.HASH_GLOB = 'HASH_GLOB';

@@ -11,2 +12,1 @@ function isHandleHashGlobMessage(message) {

}
exports.isHandleHashGlobMessage = isHandleHashGlobMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleWriteTaskRunsToHistoryMessage = exports.WRITE_TASK_RUNS_TO_HISTORY = exports.isHandleGetTaskHistoryForHashesMessage = exports.GET_TASK_HISTORY_FOR_HASHES = void 0;
exports.WRITE_TASK_RUNS_TO_HISTORY = exports.GET_TASK_HISTORY_FOR_HASHES = void 0;
exports.isHandleGetTaskHistoryForHashesMessage = isHandleGetTaskHistoryForHashesMessage;
exports.isHandleWriteTaskRunsToHistoryMessage = isHandleWriteTaskRunsToHistoryMessage;
exports.GET_TASK_HISTORY_FOR_HASHES = 'GET_TASK_HISTORY_FOR_HASHES';

@@ -11,3 +13,2 @@ function isHandleGetTaskHistoryForHashesMessage(message) {

}
exports.isHandleGetTaskHistoryForHashesMessage = isHandleGetTaskHistoryForHashesMessage;
exports.WRITE_TASK_RUNS_TO_HISTORY = 'WRITE_TASK_RUNS_TO_HISTORY';

@@ -20,2 +21,1 @@ function isHandleWriteTaskRunsToHistoryMessage(message) {

}
exports.isHandleWriteTaskRunsToHistoryMessage = isHandleWriteTaskRunsToHistoryMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHandleUpdateContextMessage = exports.GLOB = void 0;
exports.GLOB = void 0;
exports.isHandleUpdateContextMessage = isHandleUpdateContextMessage;
exports.GLOB = 'GLOB';

@@ -11,2 +12,1 @@ function isHandleUpdateContextMessage(message) {

}
exports.isHandleUpdateContextMessage = isHandleUpdateContextMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProjectsAndGlobalChanges = void 0;
exports.getProjectsAndGlobalChanges = getProjectsAndGlobalChanges;
const perf_hooks_1 = require("perf_hooks");

@@ -45,2 +45,1 @@ const project_graph_incremental_recomputation_1 = require("../project-graph-incremental-recomputation");

}
exports.getProjectsAndGlobalChanges = getProjectsAndGlobalChanges;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Socket } from 'net';

@@ -3,0 +2,0 @@ export declare let registeredFileWatcherSockets: {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.notifyFileWatcherSockets = exports.hasRegisteredFileWatcherSockets = exports.removeRegisteredFileWatcherSocket = exports.registeredFileWatcherSockets = void 0;
exports.registeredFileWatcherSockets = void 0;
exports.removeRegisteredFileWatcherSocket = removeRegisteredFileWatcherSocket;
exports.hasRegisteredFileWatcherSockets = hasRegisteredFileWatcherSockets;
exports.notifyFileWatcherSockets = notifyFileWatcherSockets;
const find_matching_projects_1 = require("../../../utils/find-matching-projects");

@@ -15,7 +18,5 @@ const project_graph_utils_1 = require("../../../utils/project-graph-utils");

}
exports.removeRegisteredFileWatcherSocket = removeRegisteredFileWatcherSocket;
function hasRegisteredFileWatcherSockets() {
return exports.registeredFileWatcherSockets.length > 0;
}
exports.hasRegisteredFileWatcherSockets = hasRegisteredFileWatcherSockets;
function notifyFileWatcherSockets(createdFiles, updatedFiles, deletedFiles) {

@@ -67,2 +68,1 @@ if (!hasRegisteredFileWatcherSockets()) {

}
exports.notifyFileWatcherSockets = notifyFileWatcherSockets;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleContextFileData = void 0;
exports.handleContextFileData = handleContextFileData;
const workspace_context_1 = require("../../utils/workspace-context");

@@ -13,2 +13,1 @@ const workspace_root_1 = require("../../utils/workspace-root");

}
exports.handleContextFileData = handleContextFileData;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleGetFilesInDirectory = void 0;
exports.handleGetFilesInDirectory = handleGetFilesInDirectory;
const workspace_context_1 = require("../../utils/workspace-context");

@@ -13,2 +13,1 @@ const workspace_root_1 = require("../../utils/workspace-root");

}
exports.handleGetFilesInDirectory = handleGetFilesInDirectory;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleGetTaskHistoryForHashes = void 0;
exports.handleGetTaskHistoryForHashes = handleGetTaskHistoryForHashes;
const task_history_1 = require("../../utils/task-history");

@@ -12,2 +12,1 @@ async function handleGetTaskHistoryForHashes(hashes) {

}
exports.handleGetTaskHistoryForHashes = handleGetTaskHistoryForHashes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleGlob = void 0;
exports.handleGlob = handleGlob;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -13,2 +13,1 @@ const workspace_context_1 = require("../../utils/workspace-context");

}
exports.handleGlob = handleGlob;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleHashGlob = void 0;
exports.handleHashGlob = handleHashGlob;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -13,2 +13,1 @@ const workspace_context_1 = require("../../utils/workspace-context");

}
exports.handleHashGlob = handleHashGlob;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleHashTasks = void 0;
exports.handleHashTasks = handleHashTasks;
const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");

@@ -36,2 +36,1 @@ const task_hasher_1 = require("../../hasher/task-hasher");

}
exports.handleHashTasks = handleHashTasks;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleNxWorkspaceFiles = void 0;
exports.handleNxWorkspaceFiles = handleNxWorkspaceFiles;
const workspace_context_1 = require("../../utils/workspace-context");

@@ -13,2 +13,1 @@ const workspace_root_1 = require("../../utils/workspace-root");

}
exports.handleNxWorkspaceFiles = handleNxWorkspaceFiles;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleOutputsHashesMatch = exports.handleRecordOutputsHash = void 0;
exports.handleRecordOutputsHash = handleRecordOutputsHash;
exports.handleOutputsHashesMatch = handleOutputsHashesMatch;
const outputs_tracking_1 = require("./outputs-tracking");

@@ -20,3 +21,2 @@ async function handleRecordOutputsHash(payload) {

}
exports.handleRecordOutputsHash = handleRecordOutputsHash;
async function handleOutputsHashesMatch(payload) {

@@ -37,2 +37,1 @@ try {

}
exports.handleOutputsHashesMatch = handleOutputsHashesMatch;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleProcessInBackground = void 0;
exports.handleProcessInBackground = handleProcessInBackground;
const logger_1 = require("./logger");

@@ -33,2 +33,1 @@ const installation_directory_1 = require("../../utils/installation-directory");

}
exports.handleProcessInBackground = handleProcessInBackground;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleRequestProjectGraph = void 0;
exports.handleRequestProjectGraph = handleRequestProjectGraph;
const perf_hooks_1 = require("perf_hooks");

@@ -37,2 +37,1 @@ const socket_utils_1 = require("../socket-utils");

}
exports.handleRequestProjectGraph = handleRequestProjectGraph;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Server } from 'net';

@@ -3,0 +2,0 @@ export declare function handleRequestShutdown(server: Server, numberOfConnections: number): Promise<{

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleRequestShutdown = void 0;
exports.handleRequestShutdown = handleRequestShutdown;
const shutdown_utils_1 = require("./shutdown-utils");

@@ -26,2 +26,1 @@ async function handleRequestShutdown(server, numberOfConnections) {

}
exports.handleRequestShutdown = handleRequestShutdown;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleWriteTaskRunsToHistory = void 0;
exports.handleWriteTaskRunsToHistory = handleWriteTaskRunsToHistory;
const task_history_1 = require("../../utils/task-history");

@@ -12,2 +12,1 @@ async function handleWriteTaskRunsToHistory(taskRuns) {

}
exports.handleWriteTaskRunsToHistory = handleWriteTaskRunsToHistory;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.disableOutputsTracking = exports.processFileChangesInOutputs = exports.outputsHashesMatch = exports.recordOutputsHash = exports.recordedHash = exports._outputsHashesMatch = exports._recordOutputsHash = void 0;
exports._recordOutputsHash = _recordOutputsHash;
exports._outputsHashesMatch = _outputsHashesMatch;
exports.recordedHash = recordedHash;
exports.recordOutputsHash = recordOutputsHash;
exports.outputsHashesMatch = outputsHashesMatch;
exports.processFileChangesInOutputs = processFileChangesInOutputs;
exports.disableOutputsTracking = disableOutputsTracking;
const path_1 = require("path");

@@ -28,3 +34,2 @@ const native_1 = require("../../native");

}
exports._recordOutputsHash = _recordOutputsHash;
function _outputsHashesMatch(outputs, hash) {

@@ -43,7 +48,5 @@ if (outputs.length !== numberOfExpandedOutputs[hash]) {

}
exports._outputsHashesMatch = _outputsHashesMatch;
function recordedHash(output) {
return recordedHashes[output];
}
exports.recordedHash = recordedHash;
async function recordOutputsHash(_outputs, hash) {

@@ -55,3 +58,2 @@ const outputs = await normalizeOutputs(_outputs);

}
exports.recordOutputsHash = recordOutputsHash;
async function outputsHashesMatch(_outputs, hash) {

@@ -63,3 +65,2 @@ const outputs = await normalizeOutputs(_outputs);

}
exports.outputsHashesMatch = outputsHashesMatch;
async function normalizeOutputs(outputs) {

@@ -94,6 +95,4 @@ let expandedOutputs = (0, collapse_expanded_outputs_1.collapseExpandedOutputs)((0, native_1.getFilesForOutputs)(workspace_root_1.workspaceRoot, outputs));

}
exports.processFileChangesInOutputs = processFileChangesInOutputs;
function disableOutputsTracking() {
disabled = true;
}
exports.disableOutputsTracking = disableOutputsTracking;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanupPlugins = exports.getPlugins = void 0;
exports.getPlugins = getPlugins;
exports.cleanupPlugins = cleanupPlugins;
const file_hasher_1 = require("../../hasher/file-hasher");

@@ -29,6 +30,4 @@ const nx_json_1 = require("../../config/nx-json");

}
exports.getPlugins = getPlugins;
function cleanupPlugins() {
cleanup();
}
exports.cleanupPlugins = cleanupPlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addUpdatedAndDeletedFiles = exports.getCachedSerializedProjectGraphPromise = exports.currentProjectGraph = exports.currentProjectFileMapCache = exports.fileMapWithFiles = void 0;
exports.currentProjectGraph = exports.currentProjectFileMapCache = exports.fileMapWithFiles = void 0;
exports.getCachedSerializedProjectGraphPromise = getCachedSerializedProjectGraphPromise;
exports.addUpdatedAndDeletedFiles = addUpdatedAndDeletedFiles;
const perf_hooks_1 = require("perf_hooks");

@@ -61,3 +63,2 @@ const nx_json_1 = require("../../config/nx-json");

}
exports.getCachedSerializedProjectGraphPromise = getCachedSerializedProjectGraphPromise;
function addUpdatedAndDeletedFiles(createdFiles, updatedFiles, deletedFiles) {

@@ -93,3 +94,2 @@ for (let f of [...createdFiles, ...updatedFiles]) {

}
exports.addUpdatedAndDeletedFiles = addUpdatedAndDeletedFiles;
function computeWorkspaceConfigHash(projectsConfigurations) {

@@ -96,0 +96,0 @@ const projectConfigurationStrings = Object.entries(projectsConfigurations)

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Server, Socket } from 'net';

@@ -3,0 +2,0 @@ export type HandlerResult = {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.startServer = exports.handleResult = void 0;
exports.handleResult = handleResult;
exports.startServer = startServer;
const fs_1 = require("fs");

@@ -150,3 +151,2 @@ const net_1 = require("net");

}
exports.handleResult = handleResult;
function handleInactivityTimeout() {

@@ -341,2 +341,1 @@ if (numberOfOpenConnections > 0) {

}
exports.startServer = startServer;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type { Server, Socket } from 'net';

@@ -3,0 +2,0 @@ import type { Watcher } from '../../native';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.respondWithErrorAndExit = exports.respondToClient = exports.resetInactivityTimeout = exports.handleServerProcessTermination = exports.getOutputWatcherInstance = exports.storeOutputWatcherInstance = exports.getWatcherInstance = exports.storeWatcherInstance = exports.SERVER_INACTIVITY_TIMEOUT_MS = void 0;
exports.SERVER_INACTIVITY_TIMEOUT_MS = void 0;
exports.storeWatcherInstance = storeWatcherInstance;
exports.getWatcherInstance = getWatcherInstance;
exports.storeOutputWatcherInstance = storeOutputWatcherInstance;
exports.getOutputWatcherInstance = getOutputWatcherInstance;
exports.handleServerProcessTermination = handleServerProcessTermination;
exports.resetInactivityTimeout = resetInactivityTimeout;
exports.respondToClient = respondToClient;
exports.respondWithErrorAndExit = respondWithErrorAndExit;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -15,7 +23,5 @@ const logger_1 = require("./logger");

}
exports.storeWatcherInstance = storeWatcherInstance;
function getWatcherInstance() {
return watcherInstance;
}
exports.getWatcherInstance = getWatcherInstance;
let outputWatcherInstance;

@@ -25,7 +31,5 @@ function storeOutputWatcherInstance(instance) {

}
exports.storeOutputWatcherInstance = storeOutputWatcherInstance;
function getOutputWatcherInstance() {
return outputWatcherInstance;
}
exports.getOutputWatcherInstance = getOutputWatcherInstance;
async function handleServerProcessTermination({ server, reason, }) {

@@ -50,3 +54,2 @@ try {

}
exports.handleServerProcessTermination = handleServerProcessTermination;
let serverInactivityTimerId;

@@ -59,3 +62,2 @@ function resetInactivityTimeout(cb) {

}
exports.resetInactivityTimeout = resetInactivityTimeout;
function respondToClient(socket, response, description) {

@@ -75,3 +77,2 @@ return new Promise(async (res) => {

}
exports.respondToClient = respondToClient;
async function respondWithErrorAndExit(socket, description, error) {

@@ -87,2 +88,1 @@ const normalizedError = error instanceof error_types_1.DaemonProjectGraphError

}
exports.respondWithErrorAndExit = respondWithErrorAndExit;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Server } from 'net';

@@ -3,0 +2,0 @@ import type { WatchEvent } from '../../native';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertChangeEventsToLogMessage = exports.watchOutputFiles = exports.watchWorkspace = void 0;
exports.watchWorkspace = watchWorkspace;
exports.watchOutputFiles = watchOutputFiles;
exports.convertChangeEventsToLogMessage = convertChangeEventsToLogMessage;
const workspace_root_1 = require("../../utils/workspace-root");

@@ -43,3 +45,2 @@ const path_1 = require("path");

}
exports.watchWorkspace = watchWorkspace;
async function watchOutputFiles(cb) {

@@ -58,3 +59,2 @@ const { Watcher } = await Promise.resolve().then(() => require('../../native'));

}
exports.watchOutputFiles = watchOutputFiles;
/**

@@ -101,2 +101,1 @@ * NOTE: An event type of "create" will also apply to the case where the user has restored

}
exports.convertChangeEventsToLogMessage = convertChangeEventsToLogMessage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeResult = exports.killSocketOrPath = exports.getPluginOsSocketPath = exports.getForkedProcessOsSocketPath = exports.getFullOsSocketPath = exports.isWindows = void 0;
exports.getPluginOsSocketPath = exports.getForkedProcessOsSocketPath = exports.getFullOsSocketPath = exports.isWindows = void 0;
exports.killSocketOrPath = killSocketOrPath;
exports.serializeResult = serializeResult;
const fs_1 = require("fs");

@@ -36,3 +38,2 @@ const os_1 = require("os");

}
exports.killSocketOrPath = killSocketOrPath;
// Prepare a serialized project graph result for sending over IPC from the server to the client

@@ -43,2 +44,1 @@ function serializeResult(error, serializedProjectGraph, serializedSourceMaps) {

}
exports.serializeResult = serializeResult;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeSocketDir = exports.getSocketDir = exports.isDaemonDisabled = exports.markDaemonAsDisabled = exports.writeDaemonLogs = exports.getDaemonSocketDir = exports.DAEMON_OUTPUT_LOG_FILE = exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = void 0;
exports.getDaemonSocketDir = exports.DAEMON_OUTPUT_LOG_FILE = exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE = void 0;
exports.writeDaemonLogs = writeDaemonLogs;
exports.markDaemonAsDisabled = markDaemonAsDisabled;
exports.isDaemonDisabled = isDaemonDisabled;
exports.getSocketDir = getSocketDir;
exports.removeSocketDir = removeSocketDir;
/**

@@ -27,7 +32,5 @@ * Per workspace (to avoid subtle differences and issues), we want to have a deterministic

}
exports.writeDaemonLogs = writeDaemonLogs;
function markDaemonAsDisabled() {
(0, fs_1.writeFileSync)((0, path_1.join)(exports.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'disabled'), 'true');
}
exports.markDaemonAsDisabled = markDaemonAsDisabled;
function isDaemonDisabled() {

@@ -42,3 +45,2 @@ try {

}
exports.isDaemonDisabled = isDaemonDisabled;
function socketDirName() {

@@ -64,3 +66,2 @@ const hasher = (0, crypto_1.createHash)('sha256');

}
exports.getSocketDir = getSocketDir;
function removeSocketDir() {

@@ -72,2 +73,1 @@ try {

}
exports.removeSocketDir = removeSocketDir;

@@ -135,1 +135,2 @@ /**

export { createProjectFileMapUsingProjectGraph } from './project-graph/file-map-utils';
export { isDaemonEnabled } from './daemon/client/client';

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createProjectFileMapUsingProjectGraph = exports.cacheDir = exports.hashArray = exports.defaultTasksRunner = exports.getOutputsForTargetAndConfiguration = exports.readProjectsConfigurationFromProjectGraph = 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.validateDependency = exports.ProjectGraphBuilder = exports.DependencyType = exports.updateNxJson = exports.readNxJson = exports.globAsync = exports.glob = exports.getProjects = exports.updateProjectConfiguration = exports.removeProjectConfiguration = exports.readProjectConfiguration = exports.addProjectConfiguration = exports.runExecutor = exports.isWorkspacesEnabled = exports.getPackageManagerVersion = exports.detectPackageManager = exports.getPackageManagerCommand = exports.output = exports.logger = exports.createNodesFromFiles = exports.AggregateCreateNodesError = exports.workspaceLayout = void 0;
exports.isDaemonEnabled = exports.createProjectFileMapUsingProjectGraph = exports.cacheDir = exports.hashArray = exports.defaultTasksRunner = exports.getOutputsForTargetAndConfiguration = exports.readProjectsConfigurationFromProjectGraph = 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.validateDependency = exports.ProjectGraphBuilder = exports.DependencyType = exports.updateNxJson = exports.readNxJson = exports.globAsync = exports.glob = exports.getProjects = exports.updateProjectConfiguration = exports.removeProjectConfiguration = exports.readProjectConfiguration = exports.addProjectConfiguration = exports.runExecutor = exports.isWorkspacesEnabled = exports.getPackageManagerVersion = exports.detectPackageManager = exports.getPackageManagerCommand = exports.output = exports.logger = exports.createNodesFromFiles = exports.AggregateCreateNodesError = exports.workspaceLayout = void 0;
var configuration_1 = require("./config/configuration");

@@ -142,1 +142,3 @@ Object.defineProperty(exports, "workspaceLayout", { enumerable: true, get: function () { return configuration_1.workspaceLayout; } });

Object.defineProperty(exports, "createProjectFileMapUsingProjectGraph", { enumerable: true, get: function () { return file_map_utils_1.createProjectFileMapUsingProjectGraph; } });
var client_1 = require("./daemon/client/client");
Object.defineProperty(exports, "isDaemonEnabled", { enumerable: true, get: function () { return client_1.isDaemonEnabled; } });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
async function default_1() {
return { success: true };
}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.interpolateArgsIntoCommand = exports.LARGE_BUFFER = void 0;
exports.LARGE_BUFFER = void 0;
exports.default = default_1;
exports.interpolateArgsIntoCommand = interpolateArgsIntoCommand;
const child_process_1 = require("child_process");

@@ -75,3 +77,2 @@ const path = require("path");

}
exports.default = default_1;
async function runInParallel(options, context) {

@@ -349,3 +350,2 @@ const procs = options.commands.map((c) => createProcess(null, c, options.readyWhenStatus, options.color, calculateCwd(options.cwd, context), options.env ?? {}, true, options.usePty, options.streamOutput, options.tty, options.envFile).then((result) => ({

}
exports.interpolateArgsIntoCommand = interpolateArgsIntoCommand;
function parseArgs(unparsedCommandArgs, unknownOptions, args) {

@@ -352,0 +352,0 @@ if (!args) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const path = require("path");

@@ -32,3 +33,2 @@ const package_manager_1 = require("../../utils/package-manager");

}
exports.default = default_1;
function nodeProcess(command, cwd, env) {

@@ -35,0 +35,0 @@ (0, child_process_1.execSync)(command, {

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.convertNxExecutor = void 0;
exports.convertNxExecutor = convertNxExecutor;
const nx_json_1 = require("../../config/nx-json");

@@ -47,3 +47,2 @@ const retrieve_workspace_files_1 = require("../../project-graph/utils/retrieve-workspace-files");

}
exports.convertNxExecutor = convertNxExecutor;
function toObservable(promiseOrAsyncIterator) {

@@ -50,0 +49,0 @@ return new (require('rxjs').Observable)((subscriber) => {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatChangedFilesWithPrettierIfAvailable = void 0;
exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPrettierIfAvailable;
const path = require("path");

@@ -49,2 +49,1 @@ /**

}
exports.formatChangedFilesWithPrettierIfAvailable = formatChangedFilesWithPrettierIfAvailable;

@@ -6,3 +6,3 @@ import type { Tree } from '../tree';

export declare function createTreeWithEmptyWorkspace(opts?: {
layout?: 'apps-libs';
layout?: "apps-libs";
}): Tree;

@@ -9,0 +9,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTreeWithEmptyV1Workspace = exports.createTreeWithEmptyWorkspace = void 0;
exports.createTreeWithEmptyWorkspace = createTreeWithEmptyWorkspace;
exports.createTreeWithEmptyV1Workspace = createTreeWithEmptyV1Workspace;
const tree_1 = require("../tree");

@@ -19,3 +20,2 @@ const workspace_root_1 = require("../../utils/workspace-root");

}
exports.createTreeWithEmptyWorkspace = createTreeWithEmptyWorkspace;
/**

@@ -27,3 +27,2 @@ * @deprecated use createTreeWithEmptyWorkspace instead

}
exports.createTreeWithEmptyV1Workspace = createTreeWithEmptyV1Workspace;
function addCommonFiles(tree, addAppsAndLibsFolders) {

@@ -30,0 +29,0 @@ tree.write('./.prettierrc', JSON.stringify({ singleQuote: true }));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTree = void 0;
exports.createTree = createTree;
const tree_1 = require("../tree");

@@ -11,2 +11,1 @@ /**

}
exports.createTree = createTree;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import type { Mode } from 'fs';

@@ -4,0 +2,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printChanges = exports.flushChanges = exports.FsTree = void 0;
exports.FsTree = void 0;
exports.flushChanges = flushChanges;
exports.printChanges = printChanges;
const fs_extra_1 = require("fs-extra");

@@ -295,3 +297,2 @@ const logger_1 = require("../utils/logger");

}
exports.flushChanges = flushChanges;
function printChanges(fileChanges, indent = '') {

@@ -310,2 +311,1 @@ fileChanges.forEach((f) => {

}
exports.printChanges = printChanges;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.globAsync = exports.glob = void 0;
exports.glob = glob;
exports.globAsync = globAsync;
const minimatch_1 = require("minimatch");

@@ -20,3 +21,2 @@ const globs_1 = require("../../utils/globs");

}
exports.glob = glob;
/**

@@ -34,3 +34,2 @@ * Performs a tree-aware glob search on the files in a workspace. Able to find newly

}
exports.globAsync = globAsync;
function combineGlobResultsWithTree(tree, patterns, results) {

@@ -37,0 +36,0 @@ const matches = new Set(results);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateJson = exports.writeJson = exports.readJson = void 0;
exports.readJson = readJson;
exports.writeJson = writeJson;
exports.updateJson = updateJson;
const json_1 = require("../../utils/json");

@@ -23,3 +25,2 @@ /**

}
exports.readJson = readJson;
/**

@@ -37,3 +38,2 @@ * Writes a JSON value to the file system tree

}
exports.writeJson = writeJson;
/**

@@ -51,2 +51,1 @@ * Updates a JSON value to the file system tree

}
exports.updateJson = updateJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateNxJson = exports.readNxJson = void 0;
exports.readNxJson = readNxJson;
exports.updateNxJson = updateNxJson;
const path_1 = require("path");

@@ -25,3 +26,2 @@ const json_1 = require("./json");

}
exports.readNxJson = readNxJson;
/**

@@ -50,3 +50,2 @@ * Update nx.json

}
exports.updateNxJson = updateNxJson;
function readNxJsonExtends(tree, extendsPath) {

@@ -53,0 +52,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRelativeProjectJsonSchemaPath = exports.getProjects = exports.readProjectConfiguration = exports.removeProjectConfiguration = exports.updateProjectConfiguration = exports.addProjectConfiguration = exports.updateNxJson = exports.readNxJson = void 0;
exports.updateNxJson = exports.readNxJson = void 0;
exports.addProjectConfiguration = addProjectConfiguration;
exports.updateProjectConfiguration = updateProjectConfiguration;
exports.removeProjectConfiguration = removeProjectConfiguration;
exports.readProjectConfiguration = readProjectConfiguration;
exports.getProjects = getProjects;
exports.getRelativeProjectJsonSchemaPath = getRelativeProjectJsonSchemaPath;
const minimatch_1 = require("minimatch");
const path_1 = require("path");
const package_json_workspaces_1 = require("../../plugins/package-json-workspaces");
const package_json_1 = require("../../plugins/package-json");
const project_json_1 = require("../../plugins/project-json/build-nodes/project-json");

@@ -45,3 +51,2 @@ const angular_json_1 = require("../../adapter/angular-json");

}
exports.addProjectConfiguration = addProjectConfiguration;
/**

@@ -67,3 +72,2 @@ * Updates the configuration of an existing project.

}
exports.updateProjectConfiguration = updateProjectConfiguration;
/**

@@ -85,3 +89,2 @@ * Removes the configuration of an existing project.

}
exports.removeProjectConfiguration = removeProjectConfiguration;
/**

@@ -107,3 +110,2 @@ * Reads a project configuration.

}
exports.readProjectConfiguration = readProjectConfiguration;
/**

@@ -125,7 +127,5 @@ * Get a map of all projects in a workspace.

}
exports.getProjects = getProjects;
function getRelativeProjectJsonSchemaPath(tree, project) {
return (0, path_2.normalizePath)((0, path_1.relative)((0, path_1.join)(tree.root, project.root), (0, path_1.join)(tree.root, 'node_modules/nx/schemas/project-schema.json')));
}
exports.getRelativeProjectJsonSchemaPath = getRelativeProjectJsonSchemaPath;
function readAndCombineAllProjectConfigurations(tree) {

@@ -140,3 +140,3 @@ /**

'project.json',
...(0, package_json_workspaces_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (p) => (0, json_1.readJson)(tree, p, { expectComments: true })),
...(0, package_json_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (p) => (0, json_1.readJson)(tree, p, { expectComments: true })),
];

@@ -156,3 +156,3 @@ const globbedFiles = (0, workspace_context_1.globWithWorkspaceContextSync)(tree.root, patterns);

const packageJson = (0, json_1.readJson)(tree, projectFile);
const config = (0, package_json_workspaces_1.buildProjectConfigurationFromPackageJson)(packageJson, tree.root, projectFile, (0, nx_json_1.readNxJson)(tree));
const config = (0, package_json_1.buildProjectConfigurationFromPackageJson)(packageJson, tree.root, projectFile, (0, nx_json_1.readNxJson)(tree));
if (!rootMap[config.root]) {

@@ -159,0 +159,0 @@ (0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(rootMap,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTaskHasher = void 0;
exports.createTaskHasher = createTaskHasher;
const client_1 = require("../daemon/client/client");

@@ -16,2 +16,1 @@ const build_project_graph_1 = require("../project-graph/build-project-graph");

}
exports.createTaskHasher = createTaskHasher;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashObject = exports.hashArray = void 0;
exports.hashArray = hashArray;
exports.hashObject = hashObject;
function hashArray(content) {

@@ -9,3 +10,2 @@ // Import as needed. There is also an issue running unit tests in Nx repo if this is a top-level import.

}
exports.hashArray = hashArray;
function hashObject(obj) {

@@ -20,2 +20,1 @@ const { hashArray } = require('../native');

}
exports.hashObject = hashObject;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Task, TaskGraph } from '../config/task-graph';

@@ -3,0 +2,0 @@ import { TaskHasher } from './task-hasher';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashTask = exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = void 0;
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
exports.hashTask = hashTask;
const utils_1 = require("../tasks-runner/utils");

@@ -33,3 +34,2 @@ const project_graph_1 = require("../project-graph/project-graph");

}
exports.hashTasksThatDoNotDependOnOutputsOfOtherTasks = hashTasksThatDoNotDependOnOutputsOfOtherTasks;
async function hashTask(hasher, projectGraph, taskGraph, task, env) {

@@ -55,2 +55,1 @@ performance.mark('hashSingleTask:start');

}
exports.hashTask = hashTask;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { NxJsonConfiguration } from '../config/nx-json';

@@ -3,0 +2,0 @@ import { ProjectGraph } from '../config/project-graph';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { NxJsonConfiguration } from '../config/nx-json';

@@ -3,0 +2,0 @@ import { FileData, ProjectFileMap, ProjectGraph } from '../config/project-graph';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { FileData, ProjectFileMap, ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';

@@ -3,0 +2,0 @@ import { NxJsonConfiguration } from '../config/nx-json';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterUsingGlobPatterns = exports.expandNamedInput = exports.expandSingleProjectInputs = exports.isDepsOutput = exports.isSelfInput = exports.getInputs = exports.extractPatternsFromFileSets = exports.getTargetInputs = exports.getNamedInputs = exports.InProcessTaskHasher = exports.DaemonBasedTaskHasher = void 0;
exports.InProcessTaskHasher = exports.DaemonBasedTaskHasher = void 0;
exports.getNamedInputs = getNamedInputs;
exports.getTargetInputs = getTargetInputs;
exports.extractPatternsFromFileSets = extractPatternsFromFileSets;
exports.getInputs = getInputs;
exports.isSelfInput = isSelfInput;
exports.isDepsOutput = isDepsOutput;
exports.expandSingleProjectInputs = expandSingleProjectInputs;
exports.expandNamedInput = expandNamedInput;
exports.filterUsingGlobPatterns = filterUsingGlobPatterns;
const file_hasher_1 = require("./file-hasher");

@@ -109,3 +118,2 @@ const node_task_hasher_impl_1 = require("./node-task-hasher-impl");

}
exports.getNamedInputs = getNamedInputs;
function getTargetInputs(nxJson, projectNode, target) {

@@ -120,3 +128,2 @@ const namedInputs = getNamedInputs(nxJson, projectNode);

}
exports.getTargetInputs = getTargetInputs;
function extractPatternsFromFileSets(inputs) {

@@ -127,3 +134,2 @@ return inputs

}
exports.extractPatternsFromFileSets = extractPatternsFromFileSets;
function getInputs(task, projectGraph, nxJson) {

@@ -137,3 +143,2 @@ const projectNode = projectGraph.nodes[task.target.project];

}
exports.getInputs = getInputs;
function splitInputsIntoSelfAndDependencies(inputs, namedInputs) {

@@ -188,7 +193,5 @@ const depsInputs = [];

}
exports.isSelfInput = isSelfInput;
function isDepsOutput(input) {
return 'dependentTasksOutputFiles' in input;
}
exports.isDepsOutput = isDepsOutput;
function expandSingleProjectInputs(inputs, namedInputs) {

@@ -225,3 +228,2 @@ const expanded = [];

}
exports.expandSingleProjectInputs = expandSingleProjectInputs;
function expandNamedInput(input, namedInputs) {

@@ -233,3 +235,2 @@ namedInputs ||= {};

}
exports.expandNamedInput = expandNamedInput;
function filterUsingGlobPatterns(root, files, patterns) {

@@ -273,2 +274,1 @@ const filesetWithExpandedProjectRoot = patterns

}
exports.filterUsingGlobPatterns = filterUsingGlobPatterns;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

@@ -93,3 +94,2 @@ const project_configuration_1 = require("../../generators/utils/project-configuration");

}
exports.default = default_1;
function isBuildATarget(tree) {

@@ -96,0 +96,0 @@ const projects = (0, project_configuration_1.getProjects)(tree);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

@@ -64,2 +65,1 @@ const project_configuration_1 = require("../../generators/utils/project-configuration");

}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

@@ -16,2 +17,1 @@ const json_1 = require("../../generators/utils/json");

}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const project_configuration_1 = require("../../generators/utils/project-configuration");

@@ -53,3 +54,2 @@ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

}
exports.default = default_1;
function updateDependsOnAndInputsInsideNxJson(tree) {

@@ -56,0 +56,0 @@ const nxJson = (0, project_configuration_1.readNxJson)(tree);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const project_configuration_1 = require("../../generators/utils/project-configuration");

@@ -27,2 +28,1 @@ const json_1 = require("../../generators/utils/json");

}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = removeRunCommandsOutputPath;
const path_1 = require("../../utils/path");

@@ -28,3 +29,2 @@ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

}
exports.default = removeRunCommandsOutputPath;
function updateTargetBlock(target) {

@@ -31,0 +31,0 @@ let changed = false;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = escapeDollarSignEnvVariables;
const logger_1 = require("../../utils/logger");

@@ -33,3 +34,2 @@ const project_configuration_1 = require("../../generators/utils/project-configuration");

}
exports.default = escapeDollarSignEnvVariables;
/**

@@ -36,0 +36,0 @@ * This function parse the env file and escape dollar sign

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = removeProjectNameAndRootFormat;
const json_1 = require("../../generators/utils/json");

@@ -21,2 +22,1 @@ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

}
exports.default = removeProjectNameAndRootFormat;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = moveCacheDirectory;
const ignore_1 = require("ignore");

@@ -22,3 +23,2 @@ function moveCacheDirectory(tree) {

}
exports.default = moveCacheDirectory;
function updateGitIgnore(tree) {

@@ -25,0 +25,0 @@ const gitignore = tree.exists('.gitignore')

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = update;
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

@@ -22,3 +23,2 @@ const nx_json_1 = require("../../generators/utils/nx-json");

}
exports.default = update;
function warnNpmScopeHasChanged(tree, nxJson) {

@@ -25,0 +25,0 @@ const originalScope = nxJson['npmScope'];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = migrate;
const json_1 = require("../../generators/utils/json");

@@ -76,3 +77,2 @@ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

}
exports.default = migrate;
async function isNxCloudClientSupported(nxJson) {

@@ -79,0 +79,0 @@ const nxCloudOptions = (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = update;
/* eslint-disable @typescript-eslint/no-unused-vars */

@@ -21,2 +22,1 @@ const nx_json_1 = require("../../generators/utils/nx-json");

}
exports.default = update;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.visitNotIgnoredFiles = void 0;
exports.default = nxReleasePath;
exports.visitNotIgnoredFiles = visitNotIgnoredFiles;
const node_path_1 = require("node:path");

@@ -23,3 +24,2 @@ const ignore_1 = require("../../utils/ignore");

}
exports.default = nxReleasePath;
// Adapted from devkit

@@ -45,3 +45,2 @@ function visitNotIgnoredFiles(tree, dirPath = tree.root, visitor) {

}
exports.visitNotIgnoredFiles = visitNotIgnoredFiles;
// Copied from devkit

@@ -48,0 +47,0 @@ function normalizePathRelativeToRoot(path, root) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const update_nxw_1 = require("../../utils/update-nxw");

@@ -7,2 +8,1 @@ async function default_1(tree) {

}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = migrate;
const nx_json_1 = require("../../generators/utils/nx-json");

@@ -9,2 +10,1 @@ function migrate(tree) {

}
exports.default = migrate;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateGitIgnore = exports.updatePrettierIgnore = void 0;
exports.default = moveGraphCacheDirectory;
exports.updatePrettierIgnore = updatePrettierIgnore;
exports.updateGitIgnore = updateGitIgnore;
async function moveGraphCacheDirectory(tree) {

@@ -8,3 +10,2 @@ updateGitIgnore(tree);

}
exports.default = moveGraphCacheDirectory;
function updatePrettierIgnore(tree) {

@@ -18,3 +19,2 @@ if (tree.exists('.prettierignore')) {

}
exports.updatePrettierIgnore = updatePrettierIgnore;
function updateGitIgnore(tree) {

@@ -36,2 +36,1 @@ const gitignore = tree.read('.gitignore', 'utf-8');

}
exports.updateGitIgnore = updateGitIgnore;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = setProjectName;
const to_project_name_1 = require("../../config/to-project-name");

@@ -34,2 +35,1 @@ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");

}
exports.default = setProjectName;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertSupportedPlatform = void 0;
exports.assertSupportedPlatform = assertSupportedPlatform;
const output_1 = require("../utils/output");

@@ -39,2 +39,1 @@ function assertSupportedPlatform() {

}
exports.assertSupportedPlatform = assertSupportedPlatform;

@@ -1,7 +0,5 @@

/* tslint:disable */
/* auto-generated by NAPI-RS */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export class ExternalObject<T> {
export declare class ExternalObject<T> {
readonly '': {

@@ -12,2 +10,79 @@ readonly '': unique symbol

}
export declare class ChildProcess {
kill(): void
onExit(callback: (message: string) => void): void
onOutput(callback: (message: string) => void): void
}
export declare class HashPlanner {
constructor(nxJson: NxJson, projectGraph: ExternalObject<ProjectGraph>)
getPlans(taskIds: Array<string>, taskGraph: TaskGraph): Record<string, string[]>
getPlansReference(taskIds: Array<string>, taskGraph: TaskGraph): JsExternal
}
export declare class ImportResult {
file: string
sourceProject: string
dynamicImportExpressions: Array<string>
staticImportExpressions: Array<string>
}
export declare class RustPseudoTerminal {
constructor()
runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, execArgv?: Array<string> | undefined | null, quiet?: boolean | undefined | null, tty?: boolean | undefined | null): ChildProcess
/**
* This allows us to run a pseudoterminal with a fake node ipc channel
* this makes it possible to be backwards compatible with the old implementation
*/
fork(id: string, forkScript: string, pseudoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, execArgv: Array<string> | undefined | null, quiet: boolean): ChildProcess
}
export declare class TaskHasher {
constructor(workspaceRoot: string, projectGraph: ExternalObject<ProjectGraph>, projectFileMap: ExternalObject<ProjectFiles>, allWorkspaceFiles: ExternalObject<Array<FileData>>, tsConfig: Buffer, tsConfigPaths: Record<string, Array<string>>, options?: HasherOptions | undefined | null)
hashPlans(hashPlans: ExternalObject<Record<string, Array<HashInstruction>>>, jsEnv: Record<string, string>): NapiDashMap
}
export declare class Watcher {
origin: string
/**
* Creates a new Watcher instance.
* Will always ignore the following directories:
* * .git/
* * node_modules/
* * .nx/
*/
constructor(origin: string, additionalGlobs?: Array<string> | undefined | null, useIgnore?: boolean | undefined | null)
watch(callback: (err: string | null, events: WatchEvent[]) => void): void
stop(): Promise<void>
}
export declare class WorkspaceContext {
workspaceRoot: string
constructor(workspaceRoot: string, cacheDir: string)
getWorkspaceFiles(projectRootMap: Record<string, string>): NxWorkspaceFiles
glob(globs: Array<string>, exclude?: Array<string> | undefined | null): Array<string>
hashFilesMatchingGlob(globs: Array<string>, exclude?: Array<string> | undefined | null): string
incrementalUpdate(updatedFiles: Array<string>, deletedFiles: Array<string>): Record<string, string>
updateProjectFiles(projectRootMappings: ProjectRootMappings, projectFiles: ExternalObject<ProjectFiles>, globalFiles: ExternalObject<Array<FileData>>, updatedFiles: Record<string, string>, deletedFiles: Array<string>): UpdatedWorkspaceFiles
allFileData(): Array<FileData>
getFilesInDirectory(directory: string): Array<string>
}
export declare export function copy(src: string, dest: string): void
export interface DepsOutputsInput {
dependentTasksOutputFiles: string
transitive?: boolean
}
export interface EnvironmentInput {
env: string
}
export declare const enum EventType {
delete = 'delete',
update = 'update',
create = 'create'
}
/**

@@ -17,18 +92,8 @@ * Expands the given entries into a list of existing directories and files.

*/
export function expandOutputs(directory: string, entries: Array<string>): Array<string>
/**
* Expands the given outputs into a list of existing files.
* This is used when hashing outputs
*/
export function getFilesForOutputs(directory: string, entries: Array<string>): Array<string>
export function remove(src: string): void
export function copy(src: string, dest: string): void
export function hashArray(input: Array<string>): string
export function hashFile(file: string): string | null
export function findImports(projectFileMap: Record<string, Array<string>>): Array<ImportResult>
/**
* Transfer the project graph from the JS world to the Rust world, so that we can pass the project graph via memory quicker
* This wont be needed once the project graph is created in Rust
*/
export function transferProjectGraph(projectGraph: ProjectGraph): ExternalObject<ProjectGraph>
export declare export function expandOutputs(directory: string, entries: Array<string>): Array<string>
export interface ExternalDependenciesInput {
externalDependencies: Array<string>
}
export interface ExternalNode {

@@ -39,20 +104,27 @@ packageName?: string

}
export interface Target {
executor?: string
inputs?: Array<JsInputs>
outputs?: Array<string>
options?: string
configurations?: string
export interface FileData {
file: string
hash: string
}
export interface Project {
root: string
namedInputs?: Record<string, Array<JsInputs>>
tags?: Array<string>
targets: Record<string, Target>
export interface FileMap {
projectFileMap: ProjectFiles
nonProjectFiles: Array<FileData>
}
export interface ProjectGraph {
nodes: Record<string, Project>
dependencies: Record<string, Array<string>>
externalNodes: Record<string, ExternalNode>
export interface FileSetInput {
fileset: string
}
export declare export function findImports(projectFileMap: Record<string, Array<string>>): Array<ImportResult>
/**
* Expands the given outputs into a list of existing files.
* This is used when hashing outputs
*/
export declare export function getFilesForOutputs(directory: string, entries: Array<string>): Array<string>
export declare export function hashArray(input: Array<string>): string
export interface HashDetails {

@@ -62,25 +134,9 @@ value: string

}
export interface HasherOptions {
selectivelyHashTsConfig: boolean
}
export interface Task {
id: string
target: TaskTarget
outputs: Array<string>
projectRoot?: string
}
export interface TaskTarget {
project: string
target: string
configuration?: string
}
export interface TaskGraph {
roots: Array<string>
tasks: Record<string, Task>
dependencies: Record<string, Array<string>>
}
export interface FileData {
file: string
hash: string
}
export declare export function hashFile(file: string): string | null
export interface InputsInput {

@@ -91,18 +147,5 @@ input: string

}
export interface FileSetInput {
fileset: string
}
export interface RuntimeInput {
runtime: string
}
export interface EnvironmentInput {
env: string
}
export interface ExternalDependenciesInput {
externalDependencies: Array<string>
}
export interface DepsOutputsInput {
dependentTasksOutputFiles: string
transitive?: boolean
}
export const IS_WASM: boolean
/** Stripped version of the NxJson interface for use in rust */

@@ -112,16 +155,3 @@ export interface NxJson {

}
export const enum EventType {
delete = 'delete',
update = 'update',
create = 'create'
}
export interface WatchEvent {
path: string
type: EventType
}
/** Public NAPI error codes that are for Node */
export const enum WorkspaceErrors {
ParseError = 'ParseError',
Generic = 'Generic'
}
export interface NxWorkspaceFiles {

@@ -132,2 +162,3 @@ projectFileMap: ProjectFiles

}
export interface NxWorkspaceFilesExternals {

@@ -138,63 +169,73 @@ projectFiles: ExternalObject<ProjectFiles>

}
export interface UpdatedWorkspaceFiles {
fileMap: FileMap
externalReferences: NxWorkspaceFilesExternals
export interface Project {
root: string
namedInputs?: Record<string, Array<JsInputs>>
tags?: Array<string>
targets: Record<string, Target>
}
export interface FileMap {
projectFileMap: ProjectFiles
nonProjectFiles: Array<FileData>
export interface ProjectGraph {
nodes: Record<string, Project>
dependencies: Record<string, Array<string>>
externalNodes: Record<string, ExternalNode>
}
export function testOnlyTransferFileMap(projectFiles: Record<string, Array<FileData>>, nonProjectFiles: Array<FileData>): NxWorkspaceFilesExternals
export class ImportResult {
file: string
sourceProject: string
dynamicImportExpressions: Array<string>
staticImportExpressions: Array<string>
export declare export function remove(src: string): void
export interface RuntimeInput {
runtime: string
}
export class ChildProcess {
kill(): void
onExit(callback: (message: string) => void): void
onOutput(callback: (message: string) => void): void
export interface Target {
executor?: string
inputs?: Array<JsInputs>
outputs?: Array<string>
options?: string
configurations?: string
parallelism?: boolean
}
export class RustPseudoTerminal {
constructor()
runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, execArgv?: Array<string> | undefined | null, quiet?: boolean | undefined | null, tty?: boolean | undefined | null): ChildProcess
/**
* This allows us to run a pseudoterminal with a fake node ipc channel
* this makes it possible to be backwards compatible with the old implementation
*/
fork(id: string, forkScript: string, pseudoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, execArgv: Array<string> | undefined | null, quiet: boolean): ChildProcess
export interface Task {
id: string
target: TaskTarget
outputs: Array<string>
projectRoot?: string
}
export class HashPlanner {
constructor(nxJson: NxJson, projectGraph: ExternalObject<ProjectGraph>)
getPlans(taskIds: Array<string>, taskGraph: TaskGraph): Record<string, string[]>
getPlansReference(taskIds: Array<string>, taskGraph: TaskGraph): JsExternal
export interface TaskGraph {
roots: Array<string>
tasks: Record<string, Task>
dependencies: Record<string, Array<string>>
}
export class TaskHasher {
constructor(workspaceRoot: string, projectGraph: ExternalObject<ProjectGraph>, projectFileMap: ExternalObject<ProjectFiles>, allWorkspaceFiles: ExternalObject<Array<FileData>>, tsConfig: Buffer, tsConfigPaths: Record<string, Array<string>>, options?: HasherOptions | undefined | null)
hashPlans(hashPlans: ExternalObject<Record<string, Array<HashInstruction>>>, jsEnv: Record<string, string>): NapiDashMap
export interface TaskTarget {
project: string
target: string
configuration?: string
}
export class Watcher {
origin: string
/**
* Creates a new Watcher instance.
* Will always ignore the following directories:
* * .git/
* * node_modules/
* * .nx/
*/
constructor(origin: string, additionalGlobs?: Array<string> | undefined | null, useIgnore?: boolean | undefined | null)
watch(callback: (err: string | null, events: WatchEvent[]) => void): void
stop(): Promise<void>
export declare export function testOnlyTransferFileMap(projectFiles: Record<string, Array<FileData>>, nonProjectFiles: Array<FileData>): NxWorkspaceFilesExternals
/**
* Transfer the project graph from the JS world to the Rust world, so that we can pass the project graph via memory quicker
* This wont be needed once the project graph is created in Rust
*/
export declare export function transferProjectGraph(projectGraph: ProjectGraph): ExternalObject<ProjectGraph>
export interface UpdatedWorkspaceFiles {
fileMap: FileMap
externalReferences: NxWorkspaceFilesExternals
}
export class WorkspaceContext {
workspaceRoot: string
constructor(workspaceRoot: string, cacheDir: string)
getWorkspaceFiles(projectRootMap: Record<string, string>): NxWorkspaceFiles
glob(globs: Array<string>, exclude?: Array<string> | undefined | null): Array<string>
hashFilesMatchingGlob(globs: Array<string>, exclude?: Array<string> | undefined | null): string
incrementalUpdate(updatedFiles: Array<string>, deletedFiles: Array<string>): Record<string, string>
updateProjectFiles(projectRootMappings: ProjectRootMappings, projectFiles: ExternalObject<ProjectFiles>, globalFiles: ExternalObject<Array<FileData>>, updatedFiles: Record<string, string>, deletedFiles: Array<string>): UpdatedWorkspaceFiles
allFileData(): Array<FileData>
getFilesInDirectory(directory: string): Array<string>
export interface WatchEvent {
path: string
type: EventType
}
/** Public NAPI error codes that are for Node */
export declare const enum WorkspaceErrors {
ParseError = 'ParseError',
Generic = 'Generic'
}

@@ -7,2 +7,18 @@ const { join, basename } = require('path');

// WASI is still experimental and throws a warning when used
// We spawn many many processes so the warning gets printed a lot
// We have a different warning elsewhere to warn people using WASI
const originalEmit = process.emit;
process.emit = function (eventName, eventData) {
if (
eventName === `warning` &&
typeof eventData === `object` &&
eventData?.name === `ExperimentalWarning` &&
eventData?.message?.includes(`WASI`)
) {
return false;
}
return originalEmit.apply(process, arguments);
};
const nxPackages = new Set([

@@ -9,0 +25,0 @@ '@nx/nx-android-arm64',

@@ -1,245 +0,360 @@

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')
// prettier-ignore
/* eslint-disable */
/* auto-generated by NAPI-RS */
const { platform, arch } = process
const { readFileSync } = require('fs')
let nativeBinding = null
let localFileExisted = false
let loadError = null
const loadErrors = []
function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
const lddPath = require('child_process').execSync('which ldd').toString().trim();
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
const isMusl = () => {
let musl = false
if (process.platform === 'linux') {
musl = isMuslFromFilesystem()
if (musl === null) {
musl = isMuslFromReport()
}
if (musl === null) {
musl = isMuslFromChildProcess()
}
}
return musl
}
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
const isMuslFromFilesystem = () => {
try {
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
} catch {
return null
}
}
const isMuslFromReport = () => {
const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
if (!report) {
return null
}
if (report.header && report.header.glibcVersionRuntime) {
return false
}
if (Array.isArray(report.sharedObjects)) {
if (report.sharedObjects.some(isFileMusl)) {
return true
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header
return !glibcVersionRuntime
}
return false
}
switch (platform) {
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'nx.android-arm64.node'))
const isMuslFromChildProcess = () => {
try {
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
} catch (e) {
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
return false
}
}
function requireNative() {
if (process.platform === 'android') {
if (process.arch === 'arm64') {
try {
return require('./nx.android-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-android-arm64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm') {
try {
return require('./nx.android-arm-eabi.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-android-arm-eabi')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
try {
return require('./nx.win32-x64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-win32-x64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'ia32') {
try {
return require('./nx.win32-ia32-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-win32-ia32-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./nx.win32-arm64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-win32-arm64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
}
} else if (process.platform === 'darwin') {
try {
return require('./nx.darwin-universal.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-darwin-universal')
} catch (e) {
loadErrors.push(e)
}
if (process.arch === 'x64') {
try {
return require('./nx.darwin-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-darwin-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./nx.darwin-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-darwin-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
}
} else if (process.platform === 'freebsd') {
if (process.arch === 'x64') {
try {
return require('./nx.freebsd-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-freebsd-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./nx.freebsd-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-freebsd-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
}
} else if (process.platform === 'linux') {
if (process.arch === 'x64') {
if (isMusl()) {
try {
if (localFileExisted) {
nativeBinding = require('./nx.android-arm64.node')
} else {
nativeBinding = require('@nx/nx-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'nx.android-arm-eabi.node'))
return require('./nx.linux-x64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-x64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
if (localFileExisted) {
nativeBinding = require('./nx.android-arm-eabi.node')
} else {
nativeBinding = require('@nx/nx-android-arm-eabi')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`)
}
break
case 'win32':
switch (arch) {
case 'x64':
localFileExisted = existsSync(
join(__dirname, 'nx.win32-x64-msvc.node')
)
return require('./nx.linux-x64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-x64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm64') {
if (isMusl()) {
try {
if (localFileExisted) {
nativeBinding = require('./nx.win32-x64-msvc.node')
} else {
nativeBinding = require('@nx/nx-win32-x64-msvc')
}
} catch (e) {
loadError = e
}
break
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'nx.win32-ia32-msvc.node')
)
return require('./nx.linux-arm64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-arm64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
if (localFileExisted) {
nativeBinding = require('./nx.win32-ia32-msvc.node')
} else {
nativeBinding = require('@nx/nx-win32-ia32-msvc')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'nx.win32-arm64-msvc.node')
)
return require('./nx.linux-arm64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-arm64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm') {
if (isMusl()) {
try {
if (localFileExisted) {
nativeBinding = require('./nx.win32-arm64-msvc.node')
} else {
nativeBinding = require('@nx/nx-win32-arm64-msvc')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Windows: ${arch}`)
}
break
case 'darwin':
localFileExisted = existsSync(join(__dirname, 'nx.darwin-universal.node'))
try {
if (localFileExisted) {
nativeBinding = require('./nx.darwin-universal.node')
return require('./nx.linux-arm-musleabihf.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-arm-musleabihf')
} catch (e) {
loadErrors.push(e)
}
} else {
nativeBinding = require('@nx/nx-darwin-universal')
try {
return require('./nx.linux-arm-gnueabihf.node')
} catch (e) {
loadErrors.push(e)
}
break
} catch {}
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'nx.darwin-x64.node'))
try {
return require('@nx/nx-linux-arm-gnueabihf')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'riscv64') {
if (isMusl()) {
try {
if (localFileExisted) {
nativeBinding = require('./nx.darwin-x64.node')
} else {
nativeBinding = require('@nx/nx-darwin-x64')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'nx.darwin-arm64.node')
)
return require('./nx.linux-riscv64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-riscv64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
if (localFileExisted) {
nativeBinding = require('./nx.darwin-arm64.node')
} else {
nativeBinding = require('@nx/nx-darwin-arm64')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on macOS: ${arch}`)
return require('./nx.linux-riscv64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-riscv64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'ppc64') {
try {
return require('./nx.linux-ppc64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-ppc64-gnu')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 's390x') {
try {
return require('./nx.linux-s390x-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@nx/nx-linux-s390x-gnu')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
}
break
case 'freebsd':
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
} else {
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
}
}
nativeBinding = requireNative()
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
nativeBinding = require('./nx.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
localFileExisted = existsSync(join(__dirname, 'nx.freebsd-x64.node'))
}
if (!nativeBinding) {
try {
if (localFileExisted) {
nativeBinding = require('./nx.freebsd-x64.node')
} else {
nativeBinding = require('@nx/nx-freebsd-x64')
nativeBinding = require('@nx/nx-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
} catch (e) {
loadError = e
}
break
case 'linux':
switch (arch) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'nx.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./nx.linux-x64-musl.node')
} else {
nativeBinding = require('@nx/nx-linux-x64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'nx.linux-x64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./nx.linux-x64-gnu.node')
} else {
nativeBinding = require('@nx/nx-linux-x64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'nx.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./nx.linux-arm64-musl.node')
} else {
nativeBinding = require('@nx/nx-linux-arm64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'nx.linux-arm64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./nx.linux-arm64-gnu.node')
} else {
nativeBinding = require('@nx/nx-linux-arm64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'nx.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./nx.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@nx/nx-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`)
}
break
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
}
}
if (!nativeBinding) {
if (loadError) {
throw loadError
if (loadErrors.length > 0) {
// TODO Link to documentation with potential fixes
// - The package owner could build/publish bindings for this arch
// - The user may need to bundle the correct files
// - The user may need to re-install node_modules to get new packages
throw new Error('Failed to load native binding', { cause: loadErrors })
}

@@ -249,21 +364,20 @@ throw new Error(`Failed to load native binding`)

const { expandOutputs, getFilesForOutputs, remove, copy, hashArray, hashFile, ImportResult, findImports, transferProjectGraph, ChildProcess, RustPseudoTerminal, HashPlanner, TaskHasher, EventType, Watcher, WorkspaceContext, WorkspaceErrors, testOnlyTransferFileMap } = nativeBinding
module.exports.expandOutputs = expandOutputs
module.exports.getFilesForOutputs = getFilesForOutputs
module.exports.remove = remove
module.exports.copy = copy
module.exports.hashArray = hashArray
module.exports.hashFile = hashFile
module.exports.ImportResult = ImportResult
module.exports.findImports = findImports
module.exports.transferProjectGraph = transferProjectGraph
module.exports.ChildProcess = ChildProcess
module.exports.RustPseudoTerminal = RustPseudoTerminal
module.exports.HashPlanner = HashPlanner
module.exports.TaskHasher = TaskHasher
module.exports.EventType = EventType
module.exports.Watcher = Watcher
module.exports.WorkspaceContext = WorkspaceContext
module.exports.WorkspaceErrors = WorkspaceErrors
module.exports.testOnlyTransferFileMap = testOnlyTransferFileMap
module.exports.ChildProcess = nativeBinding.ChildProcess
module.exports.HashPlanner = nativeBinding.HashPlanner
module.exports.ImportResult = nativeBinding.ImportResult
module.exports.RustPseudoTerminal = nativeBinding.RustPseudoTerminal
module.exports.TaskHasher = nativeBinding.TaskHasher
module.exports.Watcher = nativeBinding.Watcher
module.exports.WorkspaceContext = nativeBinding.WorkspaceContext
module.exports.copy = nativeBinding.copy
module.exports.EventType = nativeBinding.EventType
module.exports.expandOutputs = nativeBinding.expandOutputs
module.exports.findImports = nativeBinding.findImports
module.exports.getFilesForOutputs = nativeBinding.getFilesForOutputs
module.exports.hashArray = nativeBinding.hashArray
module.exports.hashFile = nativeBinding.hashFile
module.exports.IS_WASM = nativeBinding.IS_WASM
module.exports.remove = nativeBinding.remove
module.exports.testOnlyTransferFileMap = nativeBinding.testOnlyTransferFileMap
module.exports.transferProjectGraph = nativeBinding.transferProjectGraph
module.exports.WorkspaceErrors = nativeBinding.WorkspaceErrors
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNativeFileCacheLocation = void 0;
exports.getNativeFileCacheLocation = getNativeFileCacheLocation;
const os_1 = require("os");

@@ -23,2 +23,1 @@ const path_1 = require("path");

}
exports.getNativeFileCacheLocation = getNativeFileCacheLocation;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformProjectGraphForRust = void 0;
exports.transformProjectGraphForRust = transformProjectGraphForRust;
function transformProjectGraphForRust(graph) {

@@ -17,2 +17,3 @@ const dependencies = {};

configurations: JSON.stringify(targetConfig.configurations),
parallelism: targetConfig.parallelism,
};

@@ -52,2 +53,1 @@ }

}
exports.transformProjectGraphForRust = transformProjectGraphForRust;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.debugLog = void 0;
exports.debugLog = debugLog;
function debugLog(...args) {

@@ -9,2 +9,1 @@ if (process.env['NX_VERBOSE_LOGGING'] === 'true') {

}
exports.debugLog = debugLog;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectToNxCloud = void 0;
exports.connectToNxCloud = connectToNxCloud;
const child_process_1 = require("child_process");

@@ -152,3 +152,2 @@ const output_1 = require("../../../utils/output");

}
exports.connectToNxCloud = connectToNxCloud;
function sleep(ms) {

@@ -155,0 +154,0 @@ return new Promise((resolve) => setTimeout(resolve, ms));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findAncestorNodeModules = void 0;
exports.findAncestorNodeModules = findAncestorNodeModules;
const fs_1 = require("fs");

@@ -20,2 +20,1 @@ const path_1 = require("path");

}
exports.findAncestorNodeModules = findAncestorNodeModules;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyOrUpdateNxCloudClient = exports.NxCloudClientUnavailableError = exports.NxCloudEnterpriseOutdatedError = void 0;
exports.NxCloudClientUnavailableError = exports.NxCloudEnterpriseOutdatedError = void 0;
exports.verifyOrUpdateNxCloudClient = verifyOrUpdateNxCloudClient;
const fs_1 = require("fs");

@@ -85,3 +86,2 @@ const zlib_1 = require("zlib");

}
exports.verifyOrUpdateNxCloudClient = verifyOrUpdateNxCloudClient;
const runnerBundleInstallDirectory = (0, path_1.join)(cache_directory_1.cacheDir, 'cloud');

@@ -88,0 +88,0 @@ function getLatestInstalledRunnerBundle() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createApiAxiosInstance = void 0;
exports.createApiAxiosInstance = createApiAxiosInstance;
const path_1 = require("path");

@@ -24,2 +24,1 @@ const environment_1 = require("./environment");

}
exports.createApiAxiosInstance = createApiAxiosInstance;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCloudOptions = void 0;
exports.getCloudOptions = getCloudOptions;
const nx_json_1 = require("../../config/nx-json");

@@ -11,2 +11,1 @@ const run_command_1 = require("../../tasks-runner/run-command");

}
exports.getCloudOptions = getCloudOptions;
export declare function shortenedCloudUrl(installationSource: string, accessToken?: string, usesGithub?: boolean): Promise<string>;
export declare function repoUsesGithub(github?: boolean): Promise<boolean>;
export declare function removeTrailingSlash(apiUrl: string): string;
export declare function getURLifShortenFailed(usesGithub: boolean, githubSlug: string, apiUrl: string, source: string, accessToken?: string): string;
export declare function getNxCloudVersion(apiUrl: string): Promise<string | null>;
export declare function removeVersionModifier(versionString: string): string;
export declare function versionIsValid(version: string): boolean;
export declare function compareCleanCloudVersions(version1: string, version2: string): number;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.repoUsesGithub = exports.shortenedCloudUrl = void 0;
exports.shortenedCloudUrl = shortenedCloudUrl;
exports.repoUsesGithub = repoUsesGithub;
exports.removeTrailingSlash = removeTrailingSlash;
exports.getURLifShortenFailed = getURLifShortenFailed;
exports.getNxCloudVersion = getNxCloudVersion;
exports.removeVersionModifier = removeVersionModifier;
exports.versionIsValid = versionIsValid;
exports.compareCleanCloudVersions = compareCleanCloudVersions;
const devkit_exports_1 = require("../../devkit-exports");
const git_utils_1 = require("../../utils/git-utils");
const semver_1 = require("semver");
async function shortenedCloudUrl(installationSource, accessToken, usesGithub) {
const githubSlug = (0, git_utils_1.getGithubSlugOrNull)();
const apiUrl = removeTrailingSlash(process.env.NX_CLOUD_API || process.env.NRWL_API || `https://cloud.nx.app`);
const version = await getNxCloudVersion(apiUrl);
if (version && (0, semver_1.lt)(removeVersionModifier(version), '2406.11.5')) {
try {
const version = await getNxCloudVersion(apiUrl);
if ((version && compareCleanCloudVersions(version, '2406.11.5') < 0) ||
!version) {
return apiUrl;
}
}
catch (e) {
devkit_exports_1.logger.verbose(`Failed to get Nx Cloud version.
${e}`);
return apiUrl;

@@ -33,3 +47,2 @@ }

}
exports.shortenedCloudUrl = shortenedCloudUrl;
async function repoUsesGithub(github) {

@@ -44,3 +57,2 @@ const githubSlug = (0, git_utils_1.getGithubSlugOrNull)();

}
exports.repoUsesGithub = repoUsesGithub;
function removeTrailingSlash(apiUrl) {

@@ -94,5 +106,9 @@ return apiUrl[apiUrl.length - 1] === '/' ? apiUrl.slice(0, -1) : apiUrl;

const version = removeVersionModifier(response.data.version);
const isValid = versionIsValid(version);
if (!version) {
throw new Error('Failed to extract version from response.');
}
if (!isValid) {
throw new Error(`Invalid version format: ${version}`);
}
return version;

@@ -103,7 +119,37 @@ }

${e}`);
return null;
}
}
function removeVersionModifier(versionString) {
// version may be something like 2406.13.5.hotfix2
// Cloud version string is in the format of YYMM.DD.BuildNumber-Modifier
return versionString.split(/[\.-]/).slice(0, 3).join('.');
}
function versionIsValid(version) {
// Updated Regex pattern to require YYMM.DD.BuildNumber format
// All parts are required, including the BuildNumber.
const pattern = /^\d{4}\.\d{2}\.\d+$/;
return pattern.test(version);
}
function compareCleanCloudVersions(version1, version2) {
const parseVersion = (version) => {
// The format we're using is YYMM.DD.BuildNumber
const parts = version.split('.').map((part) => parseInt(part, 10));
return {
yearMonth: parts[0],
day: parts[1],
buildNumber: parts[2],
};
};
const v1 = parseVersion(version1);
const v2 = parseVersion(version2);
if (v1.yearMonth !== v2.yearMonth) {
return v1.yearMonth > v2.yearMonth ? 1 : -1;
}
if (v1.day !== v2.day) {
return v1.day > v2.day ? 1 : -1;
}
if (v1.buildNumber !== v2.buildNumber) {
return v1.buildNumber > v2.buildNumber ? 1 : -1;
}
return 0;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashTsConfig = void 0;
exports.hashTsConfig = hashTsConfig;
const fileutils_1 = require("../../../utils/fileutils");

@@ -31,3 +31,2 @@ const typescript_1 = require("../utils/typescript");

}
exports.hashTsConfig = hashTsConfig;
function removeOtherProjectsPathRecords(p, tsConfigJson, projectRootMapping) {

@@ -34,0 +33,0 @@ const { paths, ...compilerOptions } = tsConfigJson.compilerOptions;

@@ -7,3 +7,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createLockFile = exports.getLockFileName = exports.lockFileExists = exports.getLockFileDependencies = exports.getLockFileNodes = exports.LOCKFILES = void 0;
exports.LOCKFILES = void 0;
exports.getLockFileNodes = getLockFileNodes;
exports.getLockFileDependencies = getLockFileDependencies;
exports.lockFileExists = lockFileExists;
exports.getLockFileName = getLockFileName;
exports.createLockFile = createLockFile;
const fs_1 = require("fs");

@@ -66,3 +71,2 @@ const path_1 = require("path");

}
exports.getLockFileNodes = getLockFileNodes;
/**

@@ -98,3 +102,2 @@ * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}

}
exports.getLockFileDependencies = getLockFileDependencies;
function lockFileExists(packageManager) {

@@ -115,3 +118,2 @@ if (packageManager === 'yarn') {

}
exports.lockFileExists = lockFileExists;
/**

@@ -137,3 +139,2 @@ * Returns lock file name based on the detected package manager in the root

}
exports.getLockFileName = getLockFileName;
function getLockFilePath(packageManager) {

@@ -203,3 +204,2 @@ if (packageManager === 'yarn') {

}
exports.createLockFile = createLockFile;
// generate body lines for error message

@@ -206,0 +206,0 @@ function errorBodyLines(originalError, additionalInfo = []) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyNpmLockfile = exports.getNpmLockfileDependencies = exports.getNpmLockfileNodes = void 0;
exports.getNpmLockfileNodes = getNpmLockfileNodes;
exports.getNpmLockfileDependencies = getNpmLockfileDependencies;
exports.stringifyNpmLockfile = stringifyNpmLockfile;
const fs_1 = require("fs");

@@ -30,3 +32,2 @@ const semver_1 = require("semver");

}
exports.getNpmLockfileNodes = getNpmLockfileNodes;
function getNpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {

@@ -36,3 +37,2 @@ const data = parsePackageLockFile(lockFileContent, lockFileHash);

}
exports.getNpmLockfileDependencies = getNpmLockfileDependencies;
function getNodes(data, keyMap) {

@@ -258,3 +258,2 @@ const nodes = new Map();

}
exports.stringifyNpmLockfile = stringifyNpmLockfile;
function mapV3Snapshots(mappedPackages, packageJson) {

@@ -261,0 +260,0 @@ const output = {};

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyPnpmLockfile = exports.getPnpmLockfileDependencies = exports.getPnpmLockfileNodes = void 0;
exports.getPnpmLockfileNodes = getPnpmLockfileNodes;
exports.getPnpmLockfileDependencies = getPnpmLockfileDependencies;
exports.stringifyPnpmLockfile = stringifyPnpmLockfile;
const pnpm_normalizer_1 = require("./utils/pnpm-normalizer");

@@ -32,3 +34,2 @@ const package_json_1 = require("./utils/package-json");

}
exports.getPnpmLockfileNodes = getPnpmLockfileNodes;
function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {

@@ -42,3 +43,2 @@ const data = parsePnpmLockFile(lockFileContent, lockFileHash);

}
exports.getPnpmLockfileDependencies = getPnpmLockfileDependencies;
function matchPropValue(record, key, originalPackageName) {

@@ -295,3 +295,2 @@ if (!record) {

}
exports.stringifyPnpmLockfile = stringifyPnpmLockfile;
function mapSnapshots(packages, nodes, lockfileVersion) {

@@ -298,0 +297,0 @@ const result = {};

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pruneProjectGraph = void 0;
exports.pruneProjectGraph = pruneProjectGraph;
const semver_1 = require("semver");

@@ -20,3 +20,2 @@ const project_graph_builder_1 = require("../../../project-graph/project-graph-builder");

}
exports.pruneProjectGraph = pruneProjectGraph;
// ensure that dependency ranges from package.json (e.g. ^1.0.0)

@@ -23,0 +22,0 @@ // are replaced with the actual version based on the available nodes (e.g. 1.0.1)

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizePackageJson = exports.getHoistedPackageVersion = void 0;
exports.getHoistedPackageVersion = getHoistedPackageVersion;
exports.normalizePackageJson = normalizePackageJson;
const fs_1 = require("fs");

@@ -17,3 +18,2 @@ const workspace_root_1 = require("../../../../utils/workspace-root");

}
exports.getHoistedPackageVersion = getHoistedPackageVersion;
/**

@@ -35,2 +35,1 @@ * Strip off non-pruning related fields from package.json

}
exports.normalizePackageJson = normalizePackageJson;

@@ -7,3 +7,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyToPnpmYaml = exports.parseAndNormalizePnpmLockfile = exports.loadPnpmHoistedDepsDefinition = exports.usesLeadingDash = exports.isV5Syntax = void 0;
exports.isV5Syntax = isV5Syntax;
exports.usesLeadingDash = usesLeadingDash;
exports.loadPnpmHoistedDepsDefinition = loadPnpmHoistedDepsDefinition;
exports.parseAndNormalizePnpmLockfile = parseAndNormalizePnpmLockfile;
exports.stringifyToPnpmYaml = stringifyToPnpmYaml;
const fs_1 = require("fs");

@@ -21,3 +25,2 @@ const semver_1 = require("semver");

}
exports.isV5Syntax = isV5Syntax;
function usesLeadingDash(data) {

@@ -31,3 +34,2 @@ if (+data.lockfileVersion.toString() >= 9) {

}
exports.usesLeadingDash = usesLeadingDash;
function loadPnpmHoistedDepsDefinition() {

@@ -44,3 +46,2 @@ const fullPath = `${workspace_root_1.workspaceRoot}/node_modules/.modules.yaml`;

}
exports.loadPnpmHoistedDepsDefinition = loadPnpmHoistedDepsDefinition;
/**

@@ -53,3 +54,2 @@ * Parsing and mapping logic from pnpm lockfile `read` function

}
exports.parseAndNormalizePnpmLockfile = parseAndNormalizePnpmLockfile;
// https://github.com/pnpm/pnpm/blob/50e37072f42bcca6d393a74bed29f7f0e029805d/lockfile/lockfile-file/src/write.ts#L22

@@ -87,3 +87,2 @@ const LOCKFILE_YAML_FORMAT = {

}
exports.stringifyToPnpmYaml = stringifyToPnpmYaml;
/**

@@ -90,0 +89,0 @@ * The following code was copied over from pnpm source code and modified to work in this context.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyYarnLockfile = exports.getYarnLockfileDependencies = exports.getYarnLockfileNodes = void 0;
exports.getYarnLockfileNodes = getYarnLockfileNodes;
exports.getYarnLockfileDependencies = getYarnLockfileDependencies;
exports.stringifyYarnLockfile = stringifyYarnLockfile;
const package_json_1 = require("./utils/package-json");

@@ -32,3 +34,2 @@ const project_graph_builder_1 = require("../../../project-graph/project-graph-builder");

}
exports.getYarnLockfileNodes = getYarnLockfileNodes;
function getYarnLockfileDependencies(lockFileContent, lockFileHash, ctx) {

@@ -41,3 +42,2 @@ const { __metadata, ...dependencies } = parseLockFile(lockFileContent, lockFileHash);

}
exports.getYarnLockfileDependencies = getYarnLockfileDependencies;
function getPackageNameKeyPairs(keys) {

@@ -247,3 +247,2 @@ const result = new Map();

}
exports.stringifyYarnLockfile = stringifyYarnLockfile;
function groupDependencies(dependencies, isBerry) {

@@ -250,0 +249,0 @@ if (isBerry) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findProjectsNpmDependencies = exports.createPackageJson = void 0;
exports.createPackageJson = createPackageJson;
exports.findProjectsNpmDependencies = findProjectsNpmDependencies;
const fileutils_1 = require("../../../utils/fileutils");

@@ -125,3 +126,2 @@ const object_sort_1 = require("../../../utils/object-sort");

}
exports.createPackageJson = createPackageJson;
function findProjectsNpmDependencies(projectNode, graph, target, rootPackageJson, options, fileMap) {

@@ -156,3 +156,2 @@ if (fileMap == null) {

}
exports.findProjectsNpmDependencies = findProjectsNpmDependencies;
function findAllNpmDeps(projectFileMap, projectNode, graph, npmDeps, seen, ignoredDependencies, dependencyPatterns, rootPatterns) {

@@ -159,0 +158,0 @@ if (seen.has(projectNode.name))

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildExplicitDependencies = void 0;
exports.buildExplicitDependencies = buildExplicitDependencies;
const explicit_package_json_dependencies_1 = require("./explicit-package-json-dependencies");

@@ -41,3 +41,2 @@ const explicit_project_dependencies_1 = require("./explicit-project-dependencies");

}
exports.buildExplicitDependencies = buildExplicitDependencies;
function totalNumberOfFilesToProcess(ctx) {

@@ -44,0 +43,0 @@ let totalNumOfFilesToProcess = 0;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildExplicitPackageJsonDependencies = void 0;
exports.buildExplicitPackageJsonDependencies = buildExplicitPackageJsonDependencies;
const node_path_1 = require("node:path");

@@ -25,3 +25,2 @@ const project_graph_1 = require("../../../../config/project-graph");

}
exports.buildExplicitPackageJsonDependencies = buildExplicitPackageJsonDependencies;
function createPackageNameMap(projects) {

@@ -28,0 +27,0 @@ const res = {};

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildExplicitTypeScriptDependencies = void 0;
exports.buildExplicitTypeScriptDependencies = buildExplicitTypeScriptDependencies;
const path_1 = require("path");

@@ -79,3 +79,2 @@ const project_graph_1 = require("../../../../config/project-graph");

}
exports.buildExplicitTypeScriptDependencies = buildExplicitTypeScriptDependencies;
function isVuePluginInstalled() {

@@ -82,0 +81,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripSourceCode = void 0;
exports.stripSourceCode = stripSourceCode;
let SyntaxKind;

@@ -136,3 +136,2 @@ /**

}
exports.stripSourceCode = stripSourceCode;
function shouldRescanSlashToken(lastNonTriviaToken) {

@@ -139,0 +138,0 @@ switch (lastNonTriviaToken) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TargetProjectLocator = exports.isBuiltinModuleImport = void 0;
exports.TargetProjectLocator = void 0;
exports.isBuiltinModuleImport = isBuiltinModuleImport;
const node_module_1 = require("node:module");

@@ -25,3 +26,2 @@ const node_path_1 = require("node:path");

}
exports.isBuiltinModuleImport = isBuiltinModuleImport;
class TargetProjectLocator {

@@ -28,0 +28,0 @@ constructor(nodes, externalNodes = {}, npmResolutionCache = defaultNpmResolutionCache) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildNpmPackageNodes = void 0;
exports.buildNpmPackageNodes = buildNpmPackageNodes;
const fs_1 = require("fs");

@@ -32,2 +32,1 @@ const file_hasher_1 = require("../../../../hasher/file-hasher");

}
exports.buildNpmPackageNodes = buildNpmPackageNodes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsPluginConfig = void 0;
exports.jsPluginConfig = jsPluginConfig;
const node_path_1 = require("node:path");

@@ -69,2 +69,1 @@ const fileutils_1 = require("../../../utils/fileutils");

}
exports.jsPluginConfig = jsPluginConfig;

@@ -81,2 +81,3 @@ import type { CompilerOptions } from 'typescript';

isolatedModules?: any;
isolatedDeclarations?: any;
jsx?: any;

@@ -83,0 +84,0 @@ keyofStringsOnly?: any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTsNodeCompilerOptions = exports.registerTsConfigPaths = exports.registerTranspiler = exports.getTranspiler = exports.getTsNodeTranspiler = exports.getSwcTranspiler = exports.registerTsProject = void 0;
exports.registerTsProject = registerTsProject;
exports.getSwcTranspiler = getSwcTranspiler;
exports.getTsNodeTranspiler = getTsNodeTranspiler;
exports.getTranspiler = getTranspiler;
exports.registerTranspiler = registerTranspiler;
exports.registerTsConfigPaths = registerTsConfigPaths;
exports.getTsNodeCompilerOptions = getTsNodeCompilerOptions;
const path_1 = require("path");

@@ -73,3 +79,2 @@ const logger_1 = require("../../../utils/logger");

}
exports.registerTsProject = registerTsProject;
function getSwcTranspiler(compilerOptions) {

@@ -82,10 +87,3 @@ // These are requires to prevent it from registering when it shouldn't

}
exports.getSwcTranspiler = getSwcTranspiler;
const registered = new Set();
function getTsNodeTranspiler(compilerOptions) {
// Just return if transpiler was already registered before.
const registrationKey = JSON.stringify(compilerOptions);
if (registered.has(registrationKey)) {
return () => { };
}
const { register } = require('ts-node');

@@ -99,3 +97,2 @@ // ts-node doesn't provide a cleanup method

});
registered.add(registrationKey);
const { transpiler, swc } = service.options;

@@ -110,3 +107,2 @@ // Don't warn if a faster transpiler is enabled

}
exports.getTsNodeTranspiler = getTsNodeTranspiler;
/**

@@ -154,2 +150,3 @@ * Given the raw "ts-node" sub-object from a tsconfig, return an object with only the properties

}
const registered = new Map();
function getTranspiler(compilerOptions, tsConfigRaw) {

@@ -168,12 +165,33 @@ const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';

compilerOptions.skipLibCheck = true;
if (swcNodeInstalled && !preferTsNode) {
return () => getSwcTranspiler(compilerOptions);
// Just return if transpiler was already registered before.
const registrationKey = JSON.stringify(compilerOptions);
const registrationEntry = registered.get(registrationKey);
if (registered.has(registrationKey)) {
registrationEntry.refCount++;
return registrationEntry.cleanup;
}
// We can fall back on ts-node if it's available
if (tsNodeInstalled) {
const tsNodeOptions = filterRecognizedTsConfigTsNodeOptions(tsConfigRaw).recognized;
return () => getTsNodeTranspiler(compilerOptions);
const _getTranspiler = swcNodeInstalled && !preferTsNode
? getSwcTranspiler
: tsNodeInstalled
? // We can fall back on ts-node if it's available
getTsNodeTranspiler
: undefined;
if (_getTranspiler) {
const transpilerCleanup = _getTranspiler(compilerOptions);
const currRegistrationEntry = {
refCount: 1,
cleanup: () => {
return () => {
currRegistrationEntry.refCount--;
if (currRegistrationEntry.refCount === 0) {
registered.delete(registrationKey);
transpilerCleanup();
}
};
},
};
registered.set(registrationKey, currRegistrationEntry);
return currRegistrationEntry.cleanup;
}
}
exports.getTranspiler = getTranspiler;
/**

@@ -196,3 +214,2 @@ * Register ts-node or swc-node given a set of compiler options.

}
exports.registerTranspiler = registerTranspiler;
/**

@@ -227,3 +244,2 @@ * @param tsConfigPath Adds the paths from a tsconfig file into node resolutions

}
exports.registerTsConfigPaths = registerTsConfigPaths;
function readCompilerOptions(tsConfigPath) {

@@ -329,2 +345,1 @@ const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';

}
exports.getTsNodeCompilerOptions = getTsNodeCompilerOptions;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveRelativeToDir = void 0;
exports.resolveRelativeToDir = resolveRelativeToDir;
/**

@@ -18,2 +18,1 @@ * NOTE: This function is in its own file because it is not possible to mock

}
exports.resolveRelativeToDir = resolveRelativeToDir;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findNodes = exports.getRootTsConfigPath = exports.getRootTsConfigFileName = exports.resolveModuleByImport = exports.readTsConfig = void 0;
exports.readTsConfig = readTsConfig;
exports.resolveModuleByImport = resolveModuleByImport;
exports.getRootTsConfigFileName = getRootTsConfigFileName;
exports.getRootTsConfigPath = getRootTsConfigPath;
exports.findNodes = findNodes;
const workspace_root_1 = require("../../../utils/workspace-root");

@@ -16,3 +20,2 @@ const fs_1 = require("fs");

}
exports.readTsConfig = readTsConfig;
function readTsConfigOptions(tsConfigPath) {

@@ -50,3 +53,2 @@ if (!tsModule) {

}
exports.resolveModuleByImport = resolveModuleByImport;
function getCompilerHost(tsConfigPath) {

@@ -67,3 +69,2 @@ const options = readTsConfigOptions(tsConfigPath);

}
exports.getRootTsConfigFileName = getRootTsConfigFileName;
function getRootTsConfigPath() {

@@ -73,3 +74,2 @@ const tsConfigFileName = getRootTsConfigFileName();

}
exports.getRootTsConfigPath = getRootTsConfigPath;
function findNodes(node, kind, max = Infinity) {

@@ -102,2 +102,1 @@ if (!node || max == 0) {

}
exports.findNodes = findNodes;

@@ -1,1 +0,1 @@

export declare const typescriptVersion = "~5.4.2";
export declare const typescriptVersion = "~5.5.2";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.typescriptVersion = void 0;
exports.typescriptVersion = '~5.4.2';
exports.typescriptVersion = '~5.5.2';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readNameFromPackageJson = exports.buildProjectFromProjectJson = exports.ProjectJsonProjectsPlugin = void 0;
exports.ProjectJsonProjectsPlugin = void 0;
exports.buildProjectFromProjectJson = buildProjectFromProjectJson;
exports.readNameFromPackageJson = readNameFromPackageJson;
const node_path_1 = require("node:path");
const to_project_name_1 = require("../../../config/to-project-name");
const fileutils_1 = require("../../../utils/fileutils");
const plugins_1 = require("../../../project-graph/plugins");
exports.ProjectJsonProjectsPlugin = {
name: 'nx/core/project-json',
createNodes: [
createNodesV2: [
'{project.json,**/project.json}',
(file, _, { workspaceRoot }) => {
const json = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(workspaceRoot, file));
const project = buildProjectFromProjectJson(json, file);
return {
projects: {
[project.root]: project,
},
};
(configFiles, _, context) => {
return (0, plugins_1.createNodesFromFiles)((file) => {
const json = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(context.workspaceRoot, file));
const project = buildProjectFromProjectJson(json, file);
return {
projects: {
[project.root]: project,
},
};
}, configFiles, _, context);
},

@@ -32,3 +37,2 @@ ],

}
exports.buildProjectFromProjectJson = buildProjectFromProjectJson;
function readNameFromPackageJson(path) {

@@ -43,2 +47,1 @@ try {

}
exports.readNameFromPackageJson = readNameFromPackageJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterAffected = void 0;
exports.filterAffected = filterAffected;
const file_utils_1 = require("../file-utils");

@@ -29,3 +29,2 @@ const workspace_projects_1 = require("./locators/workspace-projects");

}
exports.filterAffected = filterAffected;
// -----------------------------------------------------------------------------

@@ -32,0 +31,0 @@ function filterAffectedProjects(graph, ctx) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyProjectMetadata = exports.buildProjectGraphUsingProjectFileMap = exports.getFileMap = void 0;
exports.getFileMap = getFileMap;
exports.buildProjectGraphUsingProjectFileMap = buildProjectGraphUsingProjectFileMap;
exports.applyProjectMetadata = applyProjectMetadata;
const workspace_root_1 = require("../utils/workspace-root");

@@ -42,3 +44,2 @@ const path_1 = require("path");

}
exports.getFileMap = getFileMap;
async function buildProjectGraphUsingProjectFileMap(projectRootMap, externalNodes, fileMap, allWorkspaceFiles, rustReferences, fileMapCache, plugins, sourceMap) {

@@ -107,3 +108,2 @@ storedFileMap = fileMap;

}
exports.buildProjectGraphUsingProjectFileMap = buildProjectGraphUsingProjectFileMap;
function readCombinedDeps() {

@@ -295,2 +295,1 @@ const installationPackageJsonPath = (0, path_1.join)(workspace_root_1.workspaceRoot, '.nx', 'installation', 'package.json');

}
exports.applyProjectMetadata = applyProjectMetadata;
"use strict";
var _ProjectGraphError_errors, _ProjectGraphError_partialProjectGraph, _ProjectGraphError_partialSourceMaps;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoadPluginError = exports.DaemonProjectGraphError = exports.isMergeNodesError = exports.isAggregateCreateNodesError = exports.isCreateMetadataError = exports.isAggregateProjectGraphError = exports.AggregateProjectGraphError = exports.ProcessProjectGraphError = exports.isWorkspaceValidityError = exports.WorkspaceValidityError = exports.ProcessDependenciesError = exports.CreateMetadataError = exports.MergeNodesError = exports.AggregateCreateNodesError = exports.isProjectConfigurationsError = exports.ProjectConfigurationsError = exports.isProjectWithNoNameError = exports.ProjectWithNoNameError = exports.isProjectsWithNoNameError = exports.ProjectsWithNoNameError = exports.isMultipleProjectsWithSameNameError = exports.isProjectWithExistingNameError = exports.ProjectWithExistingNameError = exports.MultipleProjectsWithSameNameError = exports.ProjectGraphError = void 0;
exports.LoadPluginError = exports.DaemonProjectGraphError = exports.AggregateProjectGraphError = exports.ProcessProjectGraphError = exports.WorkspaceValidityError = exports.ProcessDependenciesError = exports.CreateMetadataError = exports.MergeNodesError = exports.AggregateCreateNodesError = exports.ProjectConfigurationsError = exports.ProjectWithNoNameError = exports.ProjectsWithNoNameError = exports.ProjectWithExistingNameError = exports.MultipleProjectsWithSameNameError = exports.ProjectGraphError = void 0;
exports.isProjectWithExistingNameError = isProjectWithExistingNameError;
exports.isMultipleProjectsWithSameNameError = isMultipleProjectsWithSameNameError;
exports.isProjectsWithNoNameError = isProjectsWithNoNameError;
exports.isProjectWithNoNameError = isProjectWithNoNameError;
exports.isProjectConfigurationsError = isProjectConfigurationsError;
exports.isWorkspaceValidityError = isWorkspaceValidityError;
exports.isAggregateProjectGraphError = isAggregateProjectGraphError;
exports.isCreateMetadataError = isCreateMetadataError;
exports.isAggregateCreateNodesError = isAggregateCreateNodesError;
exports.isMergeNodesError = isMergeNodesError;
const tslib_1 = require("tslib");

@@ -74,3 +84,2 @@ class ProjectGraphError extends Error {

}
exports.isProjectWithExistingNameError = isProjectWithExistingNameError;
function isMultipleProjectsWithSameNameError(e) {

@@ -82,3 +91,2 @@ return (e instanceof MultipleProjectsWithSameNameError ||

}
exports.isMultipleProjectsWithSameNameError = isMultipleProjectsWithSameNameError;
class ProjectsWithNoNameError extends Error {

@@ -99,3 +107,2 @@ constructor(projectRoots, projects) {

}
exports.isProjectsWithNoNameError = isProjectsWithNoNameError;
class ProjectWithNoNameError extends Error {

@@ -115,3 +122,2 @@ constructor(projectRoot) {

}
exports.isProjectWithNoNameError = isProjectWithNoNameError;
class ProjectConfigurationsError extends Error {

@@ -132,3 +138,2 @@ constructor(errors, partialProjectConfigurationsResult) {

}
exports.isProjectConfigurationsError = isProjectConfigurationsError;
/**

@@ -230,3 +235,2 @@ * This error should be thrown when a `createNodesV2` function hits a recoverable error.

}
exports.isWorkspaceValidityError = isWorkspaceValidityError;
class ProcessProjectGraphError extends Error {

@@ -258,3 +262,2 @@ constructor(pluginName, { cause }) {

}
exports.isAggregateProjectGraphError = isAggregateProjectGraphError;
function isCreateMetadataError(e) {

@@ -266,3 +269,2 @@ return (e instanceof CreateMetadataError ||

}
exports.isCreateMetadataError = isCreateMetadataError;
function isAggregateCreateNodesError(e) {

@@ -274,3 +276,2 @@ return (e instanceof AggregateCreateNodesError ||

}
exports.isAggregateCreateNodesError = isAggregateCreateNodesError;
function isMergeNodesError(e) {

@@ -280,3 +281,2 @@ return (e instanceof MergeNodesError ||

}
exports.isMergeNodesError = isMergeNodesError;
class DaemonProjectGraphError extends Error {

@@ -283,0 +283,0 @@ constructor(errors, projectGraph, sourceMaps) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateFileMap = exports.createFileMap = exports.createFileMapUsingProjectGraph = exports.createProjectFileMapUsingProjectGraph = void 0;
exports.createProjectFileMapUsingProjectGraph = createProjectFileMapUsingProjectGraph;
exports.createFileMapUsingProjectGraph = createFileMapUsingProjectGraph;
exports.createFileMap = createFileMap;
exports.updateFileMap = updateFileMap;
const workspace_context_1 = require("../utils/workspace-context");

@@ -12,3 +15,2 @@ const workspace_root_1 = require("../utils/workspace-root");

}
exports.createProjectFileMapUsingProjectGraph = createProjectFileMapUsingProjectGraph;
// TODO: refactor this to pull straight from the rust context instead of creating the file map in JS

@@ -20,3 +22,2 @@ async function createFileMapUsingProjectGraph(graph) {

}
exports.createFileMapUsingProjectGraph = createFileMapUsingProjectGraph;
function createFileMap(projectsConfigurations, allWorkspaceFiles) {

@@ -49,3 +50,2 @@ const projectFileMap = {};

}
exports.createFileMap = createFileMap;
function updateFileMap(projectsConfigurations, rustReferences, updatedFiles, deletedFiles) {

@@ -59,2 +59,1 @@ const updates = (0, workspace_context_1.updateProjectFiles)(Object.fromEntries((0, find_project_for_path_1.createProjectRootMappingsFromProjectConfigurations)(projectsConfigurations)), rustReferences, updatedFiles, deletedFiles);

}
exports.updateFileMap = updateFileMap;

@@ -18,3 +18,3 @@ import { FileData } from '../config/project-graph';

export declare function isDeletedFileChange(change: Change): change is DeletedFileChange;
export declare function calculateFileChanges(files: string[], allWorkspaceFiles: FileData[], nxArgs?: NxArgs, readFileAtRevision?: (f: string, r: void | string) => string, ignore?: any): FileChange[];
export declare function calculateFileChanges(files: string[], allWorkspaceFiles: FileData[], nxArgs?: NxArgs, readFileAtRevision?: (f: string, r: void | string) => string, ignore?: ReturnType<typeof ignore>): FileChange[];
export declare const TEN_MEGABYTES: number;

@@ -21,0 +21,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readPackageJson = exports.defaultFileRead = exports.readWorkspaceConfig = exports.TEN_MEGABYTES = exports.calculateFileChanges = exports.isDeletedFileChange = exports.isWholeFileChange = exports.DeletedFileChange = exports.WholeFileChange = void 0;
exports.TEN_MEGABYTES = exports.DeletedFileChange = exports.WholeFileChange = void 0;
exports.isWholeFileChange = isWholeFileChange;
exports.isDeletedFileChange = isDeletedFileChange;
exports.calculateFileChanges = calculateFileChanges;
exports.readWorkspaceConfig = readWorkspaceConfig;
exports.defaultFileRead = defaultFileRead;
exports.readPackageJson = readPackageJson;
const child_process_1 = require("child_process");

@@ -15,3 +21,3 @@ const fs_1 = require("fs");

const project_configuration_utils_1 = require("./utils/project-configuration-utils");
const package_json_workspaces_1 = require("../plugins/package-json-workspaces");
const package_json_1 = require("../plugins/package-json");
const workspace_context_1 = require("../utils/workspace-context");

@@ -34,7 +40,5 @@ const project_json_1 = require("../plugins/project-json/build-nodes/project-json");

}
exports.isWholeFileChange = isWholeFileChange;
function isDeletedFileChange(change) {
return change.type === 'WholeFileDeleted';
}
exports.isDeletedFileChange = isDeletedFileChange;
function calculateFileChanges(files, allWorkspaceFiles, nxArgs, readFileAtRevision = defaultReadFileAtRevision, ignore = (0, ignore_1.getIgnoreObject)()) {

@@ -77,3 +81,2 @@ files = files.filter((f) => !ignore.ignores(f));

}
exports.calculateFileChanges = calculateFileChanges;
exports.TEN_MEGABYTES = 1024 * 10000;

@@ -130,7 +133,5 @@ function defaultReadFileAtRevision(file, revision) {

}
exports.readWorkspaceConfig = readWorkspaceConfig;
function defaultFileRead(filePath) {
return (0, fs_1.readFileSync)((0, path_1.join)(workspace_root_1.workspaceRoot, filePath), 'utf-8');
}
exports.defaultFileRead = defaultFileRead;
function readPackageJson() {

@@ -144,3 +145,2 @@ try {

}
exports.readPackageJson = readPackageJson;
/**

@@ -158,3 +158,3 @@ * TODO(v20): Remove this function.

'project.json',
...(0, package_json_workspaces_1.getGlobPatternsFromPackageManagerWorkspaces)(root, fileutils_1.readJsonFile),
...(0, package_json_1.getGlobPatternsFromPackageManagerWorkspaces)(root, fileutils_1.readJsonFile),
];

@@ -171,3 +171,3 @@ const projectFiles = (0, workspace_context_1.globWithWorkspaceContextSync)(root, patterns);

const packageJson = (0, fileutils_1.readJsonFile)(projectFile);
const config = (0, package_json_workspaces_1.buildProjectConfigurationFromPackageJson)(packageJson, root, projectFile, nxJson);
const config = (0, package_json_1.buildProjectConfigurationFromPackageJson)(packageJson, root, projectFile, nxJson);
if (!rootMap[config.root]) {

@@ -174,0 +174,0 @@ (0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(rootMap,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractCachedFileData = exports.shouldRecomputeWholeGraph = exports.writeCache = exports.createProjectFileMapCache = exports.readProjectGraphCache = exports.readFileMapCache = exports.ensureCacheDirectory = exports.nxFileMap = exports.nxProjectGraph = void 0;
exports.nxFileMap = exports.nxProjectGraph = void 0;
exports.ensureCacheDirectory = ensureCacheDirectory;
exports.readFileMapCache = readFileMapCache;
exports.readProjectGraphCache = readProjectGraphCache;
exports.createProjectFileMapCache = createProjectFileMapCache;
exports.writeCache = writeCache;
exports.shouldRecomputeWholeGraph = shouldRecomputeWholeGraph;
exports.extractCachedFileData = extractCachedFileData;
const fs_1 = require("fs");

@@ -35,3 +42,2 @@ const fs_extra_1 = require("fs-extra");

}
exports.ensureCacheDirectory = ensureCacheDirectory;
function readFileMapCache() {

@@ -54,3 +60,2 @@ perf_hooks_1.performance.mark('read cache:start');

}
exports.readFileMapCache = readFileMapCache;
function readProjectGraphCache() {

@@ -73,3 +78,2 @@ perf_hooks_1.performance.mark('read project-graph:start');

}
exports.readProjectGraphCache = readProjectGraphCache;
function createProjectFileMapCache(nxJson, packageJsonDeps, fileMap, tsConfig) {

@@ -89,3 +93,2 @@ const nxJsonPlugins = getNxJsonPluginsData(nxJson, packageJsonDeps);

}
exports.createProjectFileMapCache = createProjectFileMapCache;
function writeCache(cache, projectGraph) {

@@ -124,3 +127,2 @@ perf_hooks_1.performance.mark('write cache:start');

}
exports.writeCache = writeCache;
function shouldRecomputeWholeGraph(cache, packageJsonDeps, projects, nxJson, tsConfig) {

@@ -161,3 +163,2 @@ if (cache.version !== '6.0') {

}
exports.shouldRecomputeWholeGraph = shouldRecomputeWholeGraph;
/*

@@ -187,3 +188,2 @@ This can only be invoked when the list of projects is either the same

}
exports.extractCachedFileData = extractCachedFileData;
function processNonProjectFiles(cachedFiles, nonProjectFiles, filesToProcess, cachedFileData) {

@@ -190,0 +190,0 @@ const cachedHashMap = new Map(cachedFiles.map((f) => [f.file, f]));

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withDeps = exports.pruneExternalNodes = exports.isNpmProject = exports.filterNodes = exports.reverse = void 0;
exports.pruneExternalNodes = void 0;
exports.reverse = reverse;
exports.filterNodes = filterNodes;
exports.isNpmProject = isNpmProject;
exports.withDeps = withDeps;
const reverseMemo = new Map();

@@ -43,3 +47,2 @@ /**

}
exports.reverse = reverse;
function filterNodes(predicate) {

@@ -66,7 +69,5 @@ return (original) => {

}
exports.filterNodes = filterNodes;
function isNpmProject(project) {
return project?.type === 'npm';
}
exports.isNpmProject = isNpmProject;
exports.pruneExternalNodes = filterNodes();

@@ -116,2 +117,1 @@ function withDeps(original, subsetNodes) {

}
exports.withDeps = withDeps;

@@ -28,3 +28,3 @@ import { PluginConfiguration } from '../../config/nx-json';

]>;
export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<[LoadedNxPlugin[], () => void]>;
export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<readonly [LoadedNxPlugin[], () => void]>;
export declare function getDefaultPlugins(root: string): Promise<string[]>;

@@ -5,3 +5,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultPlugins = exports.loadNxPlugins = exports.nxPluginCache = exports.LoadedNxPlugin = void 0;
exports.nxPluginCache = exports.LoadedNxPlugin = void 0;
exports.loadNxPlugins = loadNxPlugins;
exports.getDefaultPlugins = getDefaultPlugins;
const path_1 = require("path");

@@ -14,2 +16,3 @@ const workspace_root_1 = require("../../utils/workspace-root");

const error_types_1 = require("../error-types");
const native_1 = require("../../native");
class LoadedNxPlugin {

@@ -74,14 +77,16 @@ constructor(plugin, pluginDefinition) {

async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
const result = [];
const loadingMethod = process.env.NX_ISOLATE_PLUGINS === 'true'
performance.mark('loadNxPlugins:start');
const loadingMethod = process.env.NX_ISOLATE_PLUGINS === 'true' ||
(!native_1.IS_WASM && process.env.NX_ISOLATE_PLUGINS !== 'false')
? isolation_1.loadNxPluginInIsolation
: loader_1.loadNxPlugin;
plugins = await normalizePlugins(plugins, root);
const result = new Array(plugins?.length);
const cleanupFunctions = [];
for (const plugin of plugins) {
await Promise.all(plugins.map(async (plugin, idx) => {
const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
result.push(loadedPluginPromise);
result[idx] = loadedPluginPromise;
cleanupFunctions.push(cleanup);
}
return [
}));
const ret = [
await Promise.all(result),

@@ -97,10 +102,9 @@ () => {

];
performance.mark('loadNxPlugins:end');
performance.measure('loadNxPlugins', 'loadNxPlugins:start', 'loadNxPlugins:end');
return ret;
}
exports.loadNxPlugins = loadNxPlugins;
async function normalizePlugins(plugins, root) {
plugins ??= [];
return [
// This plugin adds targets that we want to be able to overwrite
// in any user-land plugin, so it has to be first :).
(0, path_1.join)(__dirname, '../../plugins/project-json/build-nodes/package-json-next-to-project-json'),
...plugins,

@@ -114,10 +118,8 @@ // Most of the nx core node plugins go on the end, s.t. it overwrites any other plugins

(0, path_1.join)(__dirname, '../../plugins/js'),
(0, path_1.join)(__dirname, '../../plugins/target-defaults/target-defaults-plugin'),
...((0, angular_json_1.shouldMergeAngularProjects)(root, false)
? [(0, path_1.join)(__dirname, '../../adapter/angular-json')]
: []),
(0, path_1.join)(__dirname, '../../plugins/package-json-workspaces'),
(0, path_1.join)(__dirname, '../../plugins/package-json'),
(0, path_1.join)(__dirname, '../../plugins/project-json/build-nodes/project-json'),
];
}
exports.getDefaultPlugins = getDefaultPlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadNxPluginInIsolation = void 0;
exports.loadNxPluginInIsolation = loadNxPluginInIsolation;
const workspace_root_1 = require("../../../utils/workspace-root");

@@ -15,2 +15,1 @@ const plugin_pool_1 = require("./plugin-pool");

}
exports.loadNxPluginInIsolation = loadNxPluginInIsolation;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { ProjectGraph, ProjectGraphProcessorContext } from '../../../config/project-graph';

@@ -87,3 +85,3 @@ import { PluginConfiguration } from '../../../config/nx-json';

success: false;
error: string;
error: Error;
tx: string;

@@ -90,0 +88,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendMessageOverSocket = exports.consumeMessage = exports.isPluginWorkerResult = exports.isPluginWorkerMessage = void 0;
exports.isPluginWorkerMessage = isPluginWorkerMessage;
exports.isPluginWorkerResult = isPluginWorkerResult;
exports.consumeMessage = consumeMessage;
exports.sendMessageOverSocket = sendMessageOverSocket;
function isPluginWorkerMessage(message) {

@@ -16,3 +19,2 @@ return (typeof message === 'object' &&

}
exports.isPluginWorkerMessage = isPluginWorkerMessage;
function isPluginWorkerResult(message) {

@@ -30,3 +32,2 @@ return (typeof message === 'object' &&

}
exports.isPluginWorkerResult = isPluginWorkerResult;
// Takes a message and a map of handlers and calls the appropriate handler

@@ -44,6 +45,4 @@ // type safe and requires all handlers to be handled

}
exports.consumeMessage = consumeMessage;
function sendMessageOverSocket(socket, message) {
socket.write(JSON.stringify(message) + String.fromCodePoint(4));
}
exports.sendMessageOverSocket = sendMessageOverSocket;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadRemoteNxPlugin = void 0;
exports.loadRemoteNxPlugin = loadRemoteNxPlugin;
const child_process_1 = require("child_process");

@@ -51,3 +51,2 @@ const path = require("path");

}
exports.loadRemoteNxPlugin = loadRemoteNxPlugin;
function shutdownPluginWorker(worker) {

@@ -239,3 +238,3 @@ // Clears the plugin cache so no refs to the workers are held

], {
stdio: process.stdout.isTTY ? 'inherit' : 'ignore',
stdio: 'inherit',
env,

@@ -242,0 +241,0 @@ detached: true,

@@ -6,4 +6,4 @@ "use strict";

const serializable_error_1 = require("../../../utils/serializable-error");
const consume_messages_from_socket_1 = require("../../../utils/consume-messages-from-socket");
const net_1 = require("net");
const consume_messages_from_socket_1 = require("../../../utils/consume-messages-from-socket");
const fs_1 = require("fs");

@@ -121,3 +121,7 @@ if (process.env.NX_PERF_LOGGING === 'true') {

type: 'createMetadataResult',
payload: { success: false, error: e.stack, tx },
payload: {
success: false,
error: (0, serializable_error_1.createSerializableError)(e),
tx,
},
};

@@ -124,0 +128,0 @@ }

"use strict";
// This file contains methods and utilities that should **only** be used by the plugin worker.
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadNxPluginAsync = exports.loadNxPlugin = exports.getPluginPathAndName = exports.registerPluginTSTranspiler = exports.unregisterPluginTSTranspiler = exports.resolveLocalNxPlugin = exports.readPluginPackageJson = void 0;
exports.unregisterPluginTSTranspiler = void 0;
exports.readPluginPackageJson = readPluginPackageJson;
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
exports.getPluginPathAndName = getPluginPathAndName;
exports.loadNxPlugin = loadNxPlugin;
exports.loadNxPluginAsync = loadNxPluginAsync;
const posix_1 = require("node:path/posix");

@@ -47,7 +53,5 @@ const installation_directory_1 = require("../../utils/installation-directory");

}
exports.readPluginPackageJson = readPluginPackageJson;
function resolveLocalNxPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
return lookupLocalPlugin(importPath, projects, root);
}
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
exports.unregisterPluginTSTranspiler = null;

@@ -82,3 +86,2 @@ /**

}
exports.registerPluginTSTranspiler = registerPluginTSTranspiler;
function lookupLocalPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {

@@ -178,3 +181,2 @@ const projectConfig = findNxProjectForImportPath(importPath, projects, root);

}
exports.getPluginPathAndName = getPluginPathAndName;
let projectsWithoutInference;

@@ -187,3 +189,2 @@ function loadNxPlugin(plugin, root) {

}
exports.loadNxPlugin = loadNxPlugin;
async function loadNxPluginAsync(pluginConfiguration, paths, root) {

@@ -214,7 +215,8 @@ const moduleName = typeof pluginConfiguration === 'string'

}
exports.loadNxPluginAsync = loadNxPluginAsync;
async function importPluginModule(pluginPath) {
const m = await Promise.resolve(`${pluginPath}`).then(s => require(s));
if (m.default &&
('createNodes' in m.default || 'createDependencies' in m.default)) {
('createNodes' in m.default ||
'createNodesV2' in m.default ||
'createDependencies' in m.default)) {
return m.default;

@@ -221,0 +223,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createNodesFromFiles = exports.normalizeNxPlugin = exports.isNxPluginV1 = exports.isNxPluginV2 = void 0;
exports.isNxPluginV2 = isNxPluginV2;
exports.isNxPluginV1 = isNxPluginV1;
exports.normalizeNxPlugin = normalizeNxPlugin;
exports.createNodesFromFiles = createNodesFromFiles;
const node_path_1 = require("node:path");

@@ -11,7 +14,5 @@ const to_project_name_1 = require("../../config/to-project-name");

}
exports.isNxPluginV2 = isNxPluginV2;
function isNxPluginV1(plugin) {
return 'processProjectGraph' in plugin || 'projectFilePatterns' in plugin;
}
exports.isNxPluginV1 = isNxPluginV1;
function normalizeNxPlugin(plugin) {

@@ -42,3 +43,2 @@ if (isNxPluginV2(plugin)) {

}
exports.normalizeNxPlugin = normalizeNxPlugin;
async function createNodesFromFiles(createNodes, configFiles, options, context) {

@@ -53,3 +53,5 @@ const results = [];

});
results.push([file, value]);
if (value) {
results.push([file, value]);
}
}

@@ -65,2 +67,1 @@ catch (e) {

}
exports.createNodesFromFiles = createNodesFromFiles;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateDependency = exports.ProjectGraphBuilder = void 0;
exports.ProjectGraphBuilder = void 0;
exports.validateDependency = validateDependency;
/**

@@ -315,3 +316,2 @@ * Builder for adding nodes and dependencies to a {@link ProjectGraph}

}
exports.validateDependency = validateDependency;
function validateCommonDependencyRules(d, { externalNodes, projects, fileMap }) {

@@ -318,0 +318,0 @@ if (!projects[d.source] && !externalNodes[d.source]) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProjectGraphAndSourceMapsAsync = exports.createProjectGraphAsync = exports.handleProjectGraphError = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectConfiguration = exports.readCachedProjectGraph = void 0;
exports.readCachedProjectGraph = readCachedProjectGraph;
exports.readCachedProjectConfiguration = readCachedProjectConfiguration;
exports.readProjectsConfigurationFromProjectGraph = readProjectsConfigurationFromProjectGraph;
exports.buildProjectGraphAndSourceMapsWithoutDaemon = buildProjectGraphAndSourceMapsWithoutDaemon;
exports.handleProjectGraphError = handleProjectGraphError;
exports.createProjectGraphAsync = createProjectGraphAsync;
exports.createProjectGraphAndSourceMapsAsync = createProjectGraphAndSourceMapsAsync;
const perf_hooks_1 = require("perf_hooks");

@@ -44,3 +50,2 @@ const nx_json_1 = require("../config/nx-json");

}
exports.readCachedProjectGraph = readCachedProjectGraph;
function readCachedProjectConfiguration(projectName) {

@@ -56,3 +61,2 @@ const graph = readCachedProjectGraph();

}
exports.readCachedProjectConfiguration = readCachedProjectConfiguration;
/**

@@ -70,3 +74,2 @@ * Get the {@link ProjectsConfigurations} from the {@link ProjectGraph}

}
exports.readProjectsConfigurationFromProjectGraph = readProjectsConfigurationFromProjectGraph;
async function buildProjectGraphAndSourceMapsWithoutDaemon() {

@@ -141,3 +144,2 @@ global.NX_GRAPH_CREATION = true;

}
exports.buildProjectGraphAndSourceMapsWithoutDaemon = buildProjectGraphAndSourceMapsWithoutDaemon;
function handleProjectGraphError(opts, e) {

@@ -175,3 +177,2 @@ if (opts.exitOnError) {

}
exports.handleProjectGraphError = handleProjectGraphError;
/**

@@ -205,3 +206,2 @@ * Computes and returns a ProjectGraph.

}
exports.createProjectGraphAsync = createProjectGraphAsync;
async function createProjectGraphAndSourceMapsAsync(opts = {

@@ -268,2 +268,1 @@ exitOnError: false,

}
exports.createProjectGraphAndSourceMapsAsync = createProjectGraphAndSourceMapsAsync;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildAllWorkspaceFiles = void 0;
exports.buildAllWorkspaceFiles = buildAllWorkspaceFiles;
const perf_hooks_1 = require("perf_hooks");

@@ -15,2 +15,1 @@ function buildAllWorkspaceFiles(projectFileMap, globalFiles) {

}
exports.buildAllWorkspaceFiles = buildAllWorkspaceFiles;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeProjectRoot = exports.findProjectForPath = exports.createProjectRootMappings = exports.createProjectRootMappingsFromProjectConfigurations = void 0;
exports.createProjectRootMappingsFromProjectConfigurations = createProjectRootMappingsFromProjectConfigurations;
exports.createProjectRootMappings = createProjectRootMappings;
exports.findProjectForPath = findProjectForPath;
exports.normalizeProjectRoot = normalizeProjectRoot;
const path_1 = require("path");

@@ -17,3 +20,2 @@ const path_2 = require("../../utils/path");

}
exports.createProjectRootMappingsFromProjectConfigurations = createProjectRootMappingsFromProjectConfigurations;
/**

@@ -31,3 +33,2 @@ * This creates a map of project roots to project names to easily look up the project of a file

}
exports.createProjectRootMappings = createProjectRootMappings;
/**

@@ -53,3 +54,2 @@ * Locates a project in projectRootMap based on a file within it

}
exports.findProjectForPath = findProjectForPath;
function normalizeProjectRoot(root) {

@@ -59,2 +59,1 @@ root = root === '' ? '.' : root;

}
exports.normalizeProjectRoot = normalizeProjectRoot;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyImplicitDependencies = void 0;
exports.applyImplicitDependencies = applyImplicitDependencies;
function applyImplicitDependencies(projects, builder) {

@@ -19,2 +19,1 @@ Object.keys(projects).forEach((source) => {

}
exports.applyImplicitDependencies = applyImplicitDependencies;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeImplicitDependencies = exports.normalizeProjectNodes = void 0;
exports.normalizeProjectNodes = normalizeProjectNodes;
exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
const find_matching_projects_1 = require("../../utils/find-matching-projects");

@@ -59,3 +60,2 @@ async function normalizeProjectNodes({ projects }, builder) {

}
exports.normalizeProjectNodes = normalizeProjectNodes;
function normalizeImplicitDependencies(source, implicitDependencies, projects) {

@@ -90,2 +90,1 @@ if (!implicitDependencies?.length) {

}
exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
import { NxJsonConfiguration, TargetDefaults } from '../../config/nx-json';
import { ProjectGraphExternalNode } from '../../config/project-graph';
import { ProjectConfiguration, ProjectMetadata, TargetConfiguration, TargetMetadata } from '../../config/workspace-json-project-json';
import { ONLY_MODIFIES_EXISTING_TARGET } from '../../plugins/target-defaults/symbols';
import { LoadedNxPlugin } from '../plugins/internal-api';
export type SourceInformation = [file: string | null, plugin: string];
export type ConfigurationSourceMaps = Record<string, Record<string, SourceInformation>>;
export declare function mergeProjectConfigurationIntoRootMap(projectRootMap: Record<string, ProjectConfiguration>, project: ProjectConfiguration & {
targets?: Record<string, TargetConfiguration & {
[ONLY_MODIFIES_EXISTING_TARGET]?: boolean;
}>;
}, configurationSourceMaps?: ConfigurationSourceMaps, sourceInformation?: SourceInformation, skipTargetNormalization?: boolean): void;
export declare function mergeProjectConfigurationIntoRootMap(projectRootMap: Record<string, ProjectConfiguration>, project: ProjectConfiguration, configurationSourceMaps?: ConfigurationSourceMaps, sourceInformation?: SourceInformation, skipTargetNormalization?: boolean): void;
export declare function mergeMetadata<T = ProjectMetadata | TargetMetadata>(sourceMap: Record<string, [file: string, plugin: string]>, sourceInformation: [file: string, plugin: string], baseSourceMapPath: string, metadata: T, matchingMetadata?: T): T;

@@ -47,2 +42,3 @@ export type ConfigurationResult = {

export declare function validateProject(project: ProjectConfiguration, knownProjects: Record<string, ProjectConfiguration>): void;
export declare function mergeTargetDefaultWithTargetDefinition(targetName: string, project: ProjectConfiguration, targetDefault: Partial<TargetConfiguration>, sourceMap: Record<string, SourceInformation>): TargetConfiguration;
/**

@@ -72,2 +68,8 @@ * Merges two targets.

export declare function readTargetDefaultsForTarget(targetName: string, targetDefaults: TargetDefaults, executor?: string): TargetDefaults[string];
/**
* Expand's `command` syntactic sugar and replaces tokens in options.
* @param target The target to normalize
* @param project The project that the target belongs to
* @returns The normalized target configuration
*/
export declare function normalizeTarget(target: TargetConfiguration, project: ProjectConfiguration): TargetConfiguration<any>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeTarget = exports.readTargetDefaultsForTarget = exports.resolveNxTokensInOptions = exports.isCompatibleTarget = exports.mergeTargetConfigurations = exports.validateProject = exports.readProjectConfigurationsFromRootMap = exports.createProjectConfigurations = exports.mergeMetadata = exports.mergeProjectConfigurationIntoRootMap = void 0;
exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;
exports.mergeMetadata = mergeMetadata;
exports.createProjectConfigurations = createProjectConfigurations;
exports.readProjectConfigurationsFromRootMap = readProjectConfigurationsFromRootMap;
exports.validateProject = validateProject;
exports.mergeTargetDefaultWithTargetDefinition = mergeTargetDefaultWithTargetDefinition;
exports.mergeTargetConfigurations = mergeTargetConfigurations;
exports.isCompatibleTarget = isCompatibleTarget;
exports.resolveNxTokensInOptions = resolveNxTokensInOptions;
exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
exports.normalizeTarget = normalizeTarget;
const logger_1 = require("../../utils/logger");
const fileutils_1 = require("../../utils/fileutils");
const workspace_root_1 = require("../../utils/workspace-root");
const symbols_1 = require("../../plugins/target-defaults/symbols");
const minimatch_1 = require("minimatch");

@@ -12,2 +21,3 @@ const path_1 = require("path");

const error_types_1 = require("../error-types");
const globs_1 = require("../../utils/globs");
function mergeProjectConfigurationIntoRootMap(projectRootMap, project, configurationSourceMaps, sourceInformation,

@@ -124,11 +134,5 @@ // This function is used when reading project configuration

const target = project.targets?.[targetName];
if (sourceMap && !target?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET]) {
if (sourceMap) {
sourceMap[`targets.${targetName}`] = sourceInformation;
}
// If ONLY_MODIFIES_EXISTING_TARGET is true, and its not on the matching project
// we shouldn't merge its info into the graph
if (target?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET] &&
!matchingProject.targets?.[targetName]) {
continue;
}
const normalizedTarget = skipTargetNormalization

@@ -138,5 +142,2 @@ ? target

const mergedTarget = mergeTargetConfigurations(normalizedTarget, matchingProject.targets?.[targetName], sourceMap, sourceInformation, `targets.${targetName}`);
// We don't want the symbol to live on past the merge process
if (mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET])
delete mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET];
updatedProjectConfiguration.targets[targetName] = mergedTarget;

@@ -148,3 +149,2 @@ }

}
exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;
function mergeMetadata(sourceMap, sourceInformation, baseSourceMapPath, metadata, matchingMetadata) {

@@ -219,3 +219,2 @@ const result = {

}
exports.mergeMetadata = mergeMetadata;
/**

@@ -261,4 +260,6 @@ * Transforms a list of project paths into a map of project configurations.

}
const innerStackTrace = ' ' + e.stack.split('\n').join('\n ');
errorBodyLines.push(innerStackTrace);
}
error.message = errorBodyLines.join('\n');
error.stack = errorBodyLines.join('\n');
// This represents a single plugin erroring out with a hard error.

@@ -272,3 +273,3 @@ errors.push(error);

return Promise.all(results).then((results) => {
const { projectRootMap, externalNodes, rootMap, configurationSourceMaps } = mergeCreateNodesResults(results, errors);
const { projectRootMap, externalNodes, rootMap, configurationSourceMaps } = mergeCreateNodesResults(results, nxJson, errors);
perf_hooks_1.performance.mark('build-project-configs:end');

@@ -296,4 +297,3 @@ perf_hooks_1.performance.measure('build-project-configs', 'build-project-configs:start', 'build-project-configs:end');

}
exports.createProjectConfigurations = createProjectConfigurations;
function mergeCreateNodesResults(results, errors) {
function mergeCreateNodesResults(results, nxJsonConfiguration, errors) {
perf_hooks_1.performance.mark('createNodes:merge - start');

@@ -307,5 +307,2 @@ const projectRootMap = {};

const sourceInfo = [file, pluginName];
if (result[symbols_1.OVERRIDE_SOURCE_FILE]) {
sourceInfo[0] = result[symbols_1.OVERRIDE_SOURCE_FILE];
}
for (const node in projectNodes) {

@@ -334,3 +331,3 @@ // Handles `{projects: {'libs/foo': undefined}}`.

try {
validateAndNormalizeProjectRootMap(projectRootMap);
validateAndNormalizeProjectRootMap(projectRootMap, nxJsonConfiguration, configurationSourceMaps);
}

@@ -413,4 +410,3 @@ catch (e) {

}
exports.readProjectConfigurationsFromRootMap = readProjectConfigurationsFromRootMap;
function validateAndNormalizeProjectRootMap(projectRootMap) {
function validateAndNormalizeProjectRootMap(projectRootMap, nxJsonConfiguration, sourceMaps = {}) {
// Name -> Project, used to validate that all projects have unique names

@@ -448,20 +444,3 @@ const projects = {};

}
for (const targetName in project.targets) {
project.targets[targetName] = normalizeTarget(project.targets[targetName], project);
if (
// If the target has no executor or command, it doesn't do anything
!project.targets[targetName].executor &&
!project.targets[targetName].command) {
// But it may have dependencies that do something
if (project.targets[targetName].dependsOn &&
project.targets[targetName].dependsOn.length > 0) {
project.targets[targetName].executor = 'nx:noop';
}
else {
// If it does nothing, and has no depenencies,
// we can remove it.
delete project.targets[targetName];
}
}
}
normalizeTargets(project, sourceMaps, nxJsonConfiguration);
}

@@ -476,2 +455,29 @@ if (conflicts.size > 0) {

}
function normalizeTargets(project, sourceMaps, nxJsonConfiguration) {
for (const targetName in project.targets) {
project.targets[targetName] = normalizeTarget(project.targets[targetName], project);
const projectSourceMaps = sourceMaps[project.root];
const targetConfig = project.targets[targetName];
const targetDefaults = readTargetDefaultsForTarget(targetName, nxJsonConfiguration.targetDefaults, targetConfig.executor);
// We only apply defaults if they exist
if (targetDefaults && isCompatibleTarget(targetConfig, targetDefaults)) {
project.targets[targetName] = mergeTargetDefaultWithTargetDefinition(targetName, project, normalizeTarget(targetDefaults, project), projectSourceMaps);
}
if (
// If the target has no executor or command, it doesn't do anything
!project.targets[targetName].executor &&
!project.targets[targetName].command) {
// But it may have dependencies that do something
if (project.targets[targetName].dependsOn &&
project.targets[targetName].dependsOn.length > 0) {
project.targets[targetName].executor = 'nx:noop';
}
else {
// If it does nothing, and has no depenencies,
// we can remove it.
delete project.targets[targetName];
}
}
}
}
function validateProject(project,

@@ -497,3 +503,70 @@ // name -> project

}
exports.validateProject = validateProject;
function targetDefaultShouldBeApplied(key, sourceMap) {
const sourceInfo = sourceMap[key];
if (!sourceInfo) {
return true;
}
// The defined value of the target is from a plugin that
// isn't part of Nx's core plugins, so target defaults are
// applied on top of it.
const [, plugin] = sourceInfo;
return !plugin?.startsWith('nx/');
}
function mergeTargetDefaultWithTargetDefinition(targetName, project, targetDefault, sourceMap) {
const targetDefinition = project.targets[targetName] ?? {};
const result = JSON.parse(JSON.stringify(targetDefinition));
for (const key in targetDefault) {
switch (key) {
case 'options': {
const normalizedDefaults = resolveNxTokensInOptions(targetDefault.options, project, targetName);
for (const optionKey in normalizedDefaults) {
const sourceMapKey = `targets.${targetName}.options.${optionKey}`;
if (targetDefinition.options[optionKey] === undefined ||
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
result.options[optionKey] = targetDefault.options[optionKey];
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
}
}
break;
}
case 'configurations': {
if (!result.configurations) {
result.configurations = {};
sourceMap[`targets.${targetName}.configurations`] = [
'nx.json',
'nx/target-defaults',
];
}
for (const configuration in targetDefault.configurations) {
if (!result.configurations[configuration]) {
result.configurations[configuration] = {};
sourceMap[`targets.${targetName}.configurations.${configuration}`] =
['nx.json', 'nx/target-defaults'];
}
const normalizedConfigurationDefaults = resolveNxTokensInOptions(targetDefault.configurations[configuration], project, targetName);
for (const configurationKey in normalizedConfigurationDefaults) {
const sourceMapKey = `targets.${targetName}.configurations.${configuration}.${configurationKey}`;
if (targetDefinition.configurations?.[configuration]?.[configurationKey] === undefined ||
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
result.configurations[configuration][configurationKey] =
targetDefault.configurations[configuration][configurationKey];
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
}
}
}
break;
}
default: {
const sourceMapKey = `targets.${targetName}.${key}`;
if (targetDefinition[key] === undefined ||
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
result[key] = targetDefault[key];
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
}
break;
}
}
}
return result;
}
/**

@@ -517,9 +590,2 @@ * Merges two targets.

const isCompatible = isCompatibleTarget(baseTarget ?? {}, target);
// If the targets are not compatible, we would normally overwrite the old target
// with the new one. However, we have a special case for targets that have the
// ONLY_MODIFIES_EXISTING_TARGET symbol set. This prevents the merged target
// equaling info that should have only been used to modify the existing target.
if (!isCompatible && target[symbols_1.ONLY_MODIFIES_EXISTING_TARGET]) {
return baseTarget;
}
if (!isCompatible && projectConfigSourceMap) {

@@ -563,3 +629,2 @@ // if the target is not compatible, we will simply override the options

}
exports.mergeTargetConfigurations = mergeTargetConfigurations;
/**

@@ -597,3 +662,2 @@ * Checks if targets options are compatible - used when merging configurations

}
exports.isCompatibleTarget = isCompatibleTarget;
function mergeConfigurations(newConfigurations, baseConfigurations, projectConfigSourceMap, sourceInformation, targetIdentifier) {

@@ -656,5 +720,4 @@ const mergedConfigurations = {};

}
exports.resolveNxTokensInOptions = resolveNxTokensInOptions;
function readTargetDefaultsForTarget(targetName, targetDefaults, executor) {
if (executor) {
if (executor && targetDefaults?.[executor]) {
// If an executor is defined in project.json, defaults should be read

@@ -665,11 +728,22 @@ // from the most specific key that matches that executor.

// If not, use build if it is present.
const key = [executor, targetName].find((x) => targetDefaults?.[x]);
return key ? targetDefaults?.[key] : null;
return targetDefaults?.[executor];
}
else {
else if (targetDefaults?.[targetName]) {
// If the executor is not defined, the only key we have is the target name.
return targetDefaults?.[targetName];
}
let matchingTargetDefaultKey = null;
for (const key in targetDefaults ?? {}) {
if ((0, globs_1.isGlobPattern)(key) && (0, minimatch_1.minimatch)(targetName, key)) {
if (!matchingTargetDefaultKey ||
matchingTargetDefaultKey.length < key.length) {
matchingTargetDefaultKey = key;
}
}
}
if (matchingTargetDefaultKey) {
return targetDefaults[matchingTargetDefaultKey];
}
return null;
}
exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
function createRootMap(projectRootMap) {

@@ -702,11 +776,22 @@ const map = {};

}
/**
* Expand's `command` syntactic sugar and replaces tokens in options.
* @param target The target to normalize
* @param project The project that the target belongs to
* @returns The normalized target configuration
*/
function normalizeTarget(target, project) {
target = {
...target,
configurations: {
...target.configurations,
},
};
target = resolveCommandSyntacticSugar(target, project.root);
target.options = resolveNxTokensInOptions(target.options, project, `${project.root}:${target}`);
target.configurations ??= {};
for (const configuration in target.configurations) {
target.configurations[configuration] = resolveNxTokensInOptions(target.configurations[configuration], project, `${project.root}:${target}:${configuration}`);
}
target.parallelism ??= true;
return target;
}
exports.normalizeTarget = normalizeTarget;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configurationGlobs = exports.retrieveProjectConfigurationsWithoutPluginInference = exports.retrieveProjectConfigurationPaths = exports.retrieveProjectConfigurationsWithAngularProjects = exports.retrieveProjectConfigurations = exports.retrieveWorkspaceFiles = void 0;
exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
exports.retrieveProjectConfigurations = retrieveProjectConfigurations;
exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfigurationsWithAngularProjects;
exports.retrieveProjectConfigurationPaths = retrieveProjectConfigurationPaths;
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
exports.configurationGlobs = configurationGlobs;
const perf_hooks_1 = require("perf_hooks");

@@ -35,3 +40,2 @@ const angular_json_1 = require("../../adapter/angular-json");

}
exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
/**

@@ -45,3 +49,2 @@ * Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.

}
exports.retrieveProjectConfigurations = retrieveProjectConfigurations;
async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, nxJson) {

@@ -59,3 +62,2 @@ const pluginsToLoad = nxJson?.plugins ?? [];

}
exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfigurationsWithAngularProjects;
function retrieveProjectConfigurationPaths(root, plugins) {

@@ -65,3 +67,2 @@ const projectGlobPatterns = configurationGlobs(plugins);

}
exports.retrieveProjectConfigurationPaths = retrieveProjectConfigurationPaths;
const projectsWithoutPluginCache = new Map();

@@ -83,3 +84,2 @@ // TODO: This function is called way too often, it should be optimized without this cache

}
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
function configurationGlobs(plugins) {

@@ -94,2 +94,1 @@ const globPatterns = [];

}
exports.configurationGlobs = configurationGlobs;

@@ -14,6 +14,7 @@ import { ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';

};
private readonly allTargetNames;
constructor(extraTargetDependencies: TargetDependencies, projectGraph: ProjectGraph);
processTasks(projectNames: string[], targets: string[], configuration: string, overrides: Object, excludeTaskDependencies: boolean): string[];
processTask(task: Task, projectUsedToDeriveDependencies: string, configuration: string, overrides: Object): void;
private processTasksForMatchingProjects;
private processTasksForMultipleProjects;
private processTasksForSingleProject;

@@ -20,0 +21,0 @@ private processTasksForDependencies;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapTargetDefaultsToDependencies = exports.createTaskGraph = exports.ProcessTasks = void 0;
exports.ProcessTasks = void 0;
exports.createTaskGraph = createTaskGraph;
exports.mapTargetDefaultsToDependencies = mapTargetDefaultsToDependencies;
const utils_1 = require("./utils");
const project_graph_utils_1 = require("../utils/project-graph-utils");
const find_matching_projects_1 = require("../utils/find-matching-projects");
const output_1 = require("../utils/output");

@@ -15,2 +16,10 @@ class ProcessTasks {

this.dependencies = {};
const allTargetNames = new Set();
for (const projectName in projectGraph.nodes) {
const project = projectGraph.nodes[projectName];
for (const targetName in project.data.targets ?? {}) {
allTargetNames.add(targetName);
}
}
this.allTargetNames = Array.from(allTargetNames);
}

@@ -62,3 +71,3 @@ processTasks(projectNames, targets, configuration, overrides, excludeTaskDependencies) {

this.seen.add(seenKey);
const dependencyConfigs = (0, utils_1.getDependencyConfigs)({ project: task.target.project, target: task.target.target }, this.extraTargetDependencies, this.projectGraph);
const dependencyConfigs = (0, utils_1.getDependencyConfigs)({ project: task.target.project, target: task.target.target }, this.extraTargetDependencies, this.projectGraph, this.allTargetNames);
for (const dependencyConfig of dependencyConfigs) {

@@ -69,22 +78,3 @@ const taskOverrides = dependencyConfig.params === 'forward'

if (dependencyConfig.projects) {
/** LERNA SUPPORT START - Remove in v20 */
// Lerna uses `dependencies` in `prepNxOptions`, so we need to maintain
// support for it until lerna can be updated to use the syntax.
//
// This should have been removed in v17, but the updates to lerna had not
// been made yet.
//
// TODO(@agentender): Remove this part in v20
if (typeof dependencyConfig.projects === 'string') {
if (dependencyConfig.projects === 'self') {
this.processTasksForSingleProject(task, task.target.project, dependencyConfig, configuration, taskOverrides, overrides);
continue;
}
else if (dependencyConfig.projects === 'dependencies') {
this.processTasksForDependencies(projectUsedToDeriveDependencies, dependencyConfig, configuration, task, taskOverrides, overrides);
continue;
}
}
/** LERNA SUPPORT END - Remove in v17 */
this.processTasksForMatchingProjects(dependencyConfig, configuration, task, taskOverrides, overrides);
this.processTasksForMultipleProjects(dependencyConfig, configuration, task, taskOverrides, overrides);
}

@@ -99,16 +89,12 @@ else if (dependencyConfig.dependencies) {

}
processTasksForMatchingProjects(dependencyConfig, configuration, task, taskOverrides, overrides) {
const targetProjectSpecifiers = typeof dependencyConfig.projects === 'string'
? [dependencyConfig.projects]
: dependencyConfig.projects;
const matchingProjects = (0, find_matching_projects_1.findMatchingProjects)(targetProjectSpecifiers, this.projectGraph.nodes);
if (matchingProjects.length === 0) {
processTasksForMultipleProjects(dependencyConfig, configuration, task, taskOverrides, overrides) {
if (dependencyConfig.projects.length === 0) {
output_1.output.warn({
title: `\`dependsOn\` is misconfigured for ${task.target.project}:${task.target.target}`,
bodyLines: [
`Project patterns "${targetProjectSpecifiers}" does not match any projects.`,
`Project patterns "${dependencyConfig.projects}" does not match any projects.`,
],
});
}
for (const projectName of matchingProjects) {
for (const projectName of dependencyConfig.projects) {
this.processTasksForSingleProject(task, projectName, dependencyConfig, configuration, taskOverrides, overrides);

@@ -177,2 +163,3 @@ }

cache: project.data.targets[target].cache,
parallelism: project.data.targets[target].parallelism ?? true,
};

@@ -205,3 +192,2 @@ }

}
exports.createTaskGraph = createTaskGraph;
function mapTargetDefaultsToDependencies(defaults) {

@@ -214,3 +200,2 @@ const res = {};

}
exports.mapTargetDefaultsToDependencies = mapTargetDefaultsToDependencies;
function interpolateOverrides(args, projectName, project) {

@@ -217,0 +202,0 @@ const interpolatedArgs = { ...args };

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { DefaultTasksRunnerOptions } from './default-tasks-runner';

@@ -3,0 +2,0 @@ import { Batch } from './tasks-schedule';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initTasksRunner = void 0;
exports.initTasksRunner = initTasksRunner;
const workspace_configuration_check_1 = require("../utils/workspace-configuration-check");

@@ -59,2 +59,1 @@ const configuration_1 = require("../config/configuration");

}
exports.initTasksRunner = initTasksRunner;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRunManyDynamicOutputRenderer = void 0;
exports.createRunManyDynamicOutputRenderer = createRunManyDynamicOutputRenderer;
const cliCursor = require("cli-cursor");

@@ -321,3 +321,2 @@ const cli_spinners_1 = require("cli-spinners");

}
exports.createRunManyDynamicOutputRenderer = createRunManyDynamicOutputRenderer;
function writeCompletedTaskResultLine(line) {

@@ -324,0 +323,0 @@ output_1.output.overwriteLine(LEFT_PAD + line);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRunOneDynamicOutputRenderer = void 0;
exports.createRunOneDynamicOutputRenderer = createRunOneDynamicOutputRenderer;
const cliCursor = require("cli-cursor");

@@ -229,2 +229,1 @@ const cli_spinners_1 = require("cli-spinners");

}
exports.createRunOneDynamicOutputRenderer = createRunOneDynamicOutputRenderer;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatTargetsAndProjects = exports.formatFlags = void 0;
exports.formatFlags = formatFlags;
exports.formatTargetsAndProjects = formatTargetsAndProjects;
const output_1 = require("../../utils/output");

@@ -10,3 +11,2 @@ function formatFlags(leftPadding, flag, value) {

}
exports.formatFlags = formatFlags;
function formatValue(value) {

@@ -45,2 +45,1 @@ if (Array.isArray(value)) {

}
exports.formatTargetsAndProjects = formatTargetsAndProjects;

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.prettyTime = void 0;
exports.prettyTime = prettyTime;
const nano = (time) => +time[0] * 1e9 + +time[1];

@@ -75,2 +75,1 @@ const scale = {

}
exports.prettyTime = prettyTime;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.viewLogsFooterRows = void 0;
exports.viewLogsFooterRows = viewLogsFooterRows;
const nx_json_1 = require("../../config/nx-json");

@@ -16,2 +16,1 @@ const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");

}
exports.viewLogsFooterRows = viewLogsFooterRows;

@@ -19,3 +19,2 @@ /**

*/
/// <reference types="node" />
import { Serializable } from 'child_process';

@@ -22,0 +21,0 @@ export interface PseudoIPCMessage {

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { ChildProcess, RustPseudoTerminal } from '../native';

@@ -3,0 +2,0 @@ import { PseudoIPCServer } from './pseudo-ipc';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PseudoTtyProcessWithSend = exports.PseudoTtyProcess = exports.PseudoTerminal = exports.getPseudoTerminal = void 0;
exports.PseudoTtyProcessWithSend = exports.PseudoTtyProcess = exports.PseudoTerminal = void 0;
exports.getPseudoTerminal = getPseudoTerminal;
const native_1 = require("../native");

@@ -16,3 +17,2 @@ const pseudo_ipc_1 = require("./pseudo-ipc");

}
exports.getPseudoTerminal = getPseudoTerminal;
class PseudoTerminal {

@@ -143,2 +143,5 @@ static isSupported() {

function supportedPtyPlatform() {
if (native_1.IS_WASM) {
return false;
}
if (process.platform !== 'win32') {

@@ -145,0 +148,0 @@ return true;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRunnerOptions = exports.getRunner = exports.invokeTasksRunner = exports.runCommand = void 0;
exports.runCommand = runCommand;
exports.invokeTasksRunner = invokeTasksRunner;
exports.getRunner = getRunner;
exports.getRunnerOptions = getRunnerOptions;
const path_1 = require("path");

@@ -106,3 +109,2 @@ const workspace_root_1 = require("../utils/workspace-root");

}
exports.runCommand = runCommand;
function setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles) {

@@ -199,3 +201,2 @@ if (nxArgs.outputStyle == 'stream' ||

}
exports.invokeTasksRunner = invokeTasksRunner;
function constructLifeCycles(lifeCycle) {

@@ -303,3 +304,2 @@ const lifeCycles = [];

}
exports.getRunner = getRunner;
function getTasksRunnerPath(runner, nxJson) {

@@ -361,2 +361,1 @@ let modulePath = nxJson.tasksRunnerOptions?.[runner]?.runner;

}
exports.getRunnerOptions = getRunnerOptions;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { Task } from '../config/task-graph';

@@ -3,0 +2,0 @@ export declare function getEnvVariablesForBatchProcess(skipNxCache: boolean, captureStderr: boolean): NodeJS.ProcessEnv;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unloadDotEnvFile = exports.loadAndExpandDotEnvFile = exports.getEnvVariablesForTask = exports.getTaskSpecificEnv = exports.getEnvVariablesForBatchProcess = void 0;
exports.getEnvVariablesForBatchProcess = getEnvVariablesForBatchProcess;
exports.getTaskSpecificEnv = getTaskSpecificEnv;
exports.getEnvVariablesForTask = getEnvVariablesForTask;
exports.loadAndExpandDotEnvFile = loadAndExpandDotEnvFile;
exports.unloadDotEnvFile = unloadDotEnvFile;
const dotenv_1 = require("dotenv");

@@ -15,3 +19,2 @@ const dotenv_expand_1 = require("dotenv-expand");

}
exports.getEnvVariablesForBatchProcess = getEnvVariablesForBatchProcess;
function getTaskSpecificEnv(task) {

@@ -25,3 +28,2 @@ // Unload any dot env files at the root of the workspace that were loaded on init of Nx.

}
exports.getTaskSpecificEnv = getTaskSpecificEnv;
function getEnvVariablesForTask(task, taskSpecificEnv, forceColor, skipNxCache, captureStderr, outputPath, streamOutput) {

@@ -44,3 +46,2 @@ const res = {

}
exports.getEnvVariablesForTask = getEnvVariablesForTask;
function getNxEnvVariablesForForkedProcess(forceColor, skipNxCache, captureStderr, outputPath, streamOutput) {

@@ -98,3 +99,2 @@ const env = {

}
exports.loadAndExpandDotEnvFile = loadAndExpandDotEnvFile;
/**

@@ -114,3 +114,2 @@ * This function unloads a .env file and removes the variables in it from the environmentVariables.

}
exports.unloadDotEnvFile = unloadDotEnvFile;
function getEnvFilesForTask(task) {

@@ -117,0 +116,0 @@ // Collect dot env files that may pertain to a task

@@ -1,2 +0,2 @@

export declare function findCycle(taskGraph: {
export declare function findCycle(graph: {
dependencies: Record<string, string[]>;

@@ -3,0 +3,0 @@ }): string[] | null;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeAcyclic = exports.findCycle = void 0;
exports.findCycle = findCycle;
exports.makeAcyclic = makeAcyclic;
function _findCycle(graph, id, visited, path) {

@@ -17,9 +18,9 @@ if (visited[id])

}
function findCycle(taskGraph) {
function findCycle(graph) {
const visited = {};
for (const t of Object.keys(taskGraph.dependencies)) {
for (const t of Object.keys(graph.dependencies)) {
visited[t] = false;
}
for (const t of Object.keys(taskGraph.dependencies)) {
const cycle = _findCycle(taskGraph, t, visited, [t]);
for (const t of Object.keys(graph.dependencies)) {
const cycle = _findCycle(graph, t, visited, [t]);
if (cycle)

@@ -30,3 +31,2 @@ return cycle;

}
exports.findCycle = findCycle;
function _makeAcyclic(graph, id, visited, path) {

@@ -57,2 +57,1 @@ if (visited[id])

}
exports.makeAcyclic = makeAcyclic;

@@ -267,2 +267,10 @@ "use strict";

}
else if (targetConfiguration.executor === 'nx:noop') {
(0, fs_1.writeFileSync)(temporaryOutputPath, '');
results.push({
task,
status: 'success',
terminalOutput: '',
});
}
else {

@@ -269,0 +277,0 @@ // cache prep

@@ -17,2 +17,3 @@ import { DefaultTasksRunnerOptions } from './default-tasks-runner';

private scheduledTasks;
private runningTasks;
private completedTasks;

@@ -19,0 +20,0 @@ private scheduleRequestsExecutionChain;

@@ -17,2 +17,3 @@ "use strict";

this.scheduledTasks = [];
this.runningTasks = new Set();
this.completedTasks = new Set();

@@ -35,2 +36,3 @@ this.scheduleRequestsExecutionChain = Promise.resolve();

this.completedTasks.add(taskId);
this.runningTasks.delete(taskId);
}

@@ -89,2 +91,3 @@ this.notScheduledTaskGraph = (0, utils_1.removeTasksFromTaskGraph)(this.notScheduledTaskGraph, taskIds);

});
this.runningTasks.add(taskId);
}

@@ -108,3 +111,3 @@ async scheduleBatches() {

async processTaskForBatches(batches, task, rootExecutorName, isRoot) {
if (!this.canBatchTaskBeScheduled(task.id, batches[rootExecutorName])) {
if (!this.canBatchTaskBeScheduled(task, batches[rootExecutorName])) {
return;

@@ -138,10 +141,31 @@ }

}
canBatchTaskBeScheduled(taskId, batchTaskGraph) {
canBatchTaskBeScheduled(task, batchTaskGraph) {
// task self needs to have parallelism true
// all deps have either completed or belong to the same batch
return this.taskGraph.dependencies[taskId].every((id) => this.completedTasks.has(id) || !!batchTaskGraph?.tasks[id]);
return (task.parallelism === true &&
this.taskGraph.dependencies[task.id].every((id) => this.completedTasks.has(id) || !!batchTaskGraph?.tasks[id]));
}
canBeScheduled(taskId) {
return this.taskGraph.dependencies[taskId].every((id) => this.completedTasks.has(id));
const hasDependenciesCompleted = this.taskGraph.dependencies[taskId].every((id) => this.completedTasks.has(id));
// if dependencies have not completed, cannot schedule
if (!hasDependenciesCompleted) {
return false;
}
// if there are no running tasks, can schedule anything
if (this.runningTasks.size === 0) {
return true;
}
const runningTasksNotSupportParallelism = Array.from(this.runningTasks).some((taskId) => {
return this.taskGraph.tasks[taskId].parallelism === false;
});
if (runningTasksNotSupportParallelism) {
// if any running tasks do not support parallelism, no other tasks can be scheduled
return false;
}
else {
// if all running tasks support parallelism, can only schedule task with parallelism
return this.taskGraph.tasks[taskId].parallelism === true;
}
}
}
exports.TasksSchedule = TasksSchedule;

@@ -5,8 +5,21 @@ import { Task, TaskGraph } from '../config/task-graph';

import { CustomHasher, ExecutorConfig } from '../config/misc-interfaces';
export type NormalizedTargetDependencyConfig = TargetDependencyConfig & {
projects: string[];
};
export declare function getDependencyConfigs({ project, target }: {
project: string;
target: string;
}, extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]>, projectGraph: ProjectGraph): TargetDependencyConfig[] | undefined;
export declare function expandDependencyConfigSyntaxSugar(dependencyConfigString: string, graph: ProjectGraph): TargetDependencyConfig;
}, extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]>, projectGraph: ProjectGraph, allTargetNames: string[]): NormalizedTargetDependencyConfig[] | undefined;
export declare function normalizeDependencyConfigDefinition(definition: string | TargetDependencyConfig, currentProject: string, graph: ProjectGraph, allTargetNames: string[]): NormalizedTargetDependencyConfig[];
export declare function normalizeDependencyConfigProjects(dependencyConfig: TargetDependencyConfig, currentProject: string, graph: ProjectGraph): NormalizedTargetDependencyConfig;
export declare function expandDependencyConfigSyntaxSugar(dependencyConfigString: string | TargetDependencyConfig, graph: ProjectGraph): TargetDependencyConfig;
export declare function expandWildcardTargetConfiguration(dependencyConfig: NormalizedTargetDependencyConfig, allTargetNames: string[]): NormalizedTargetDependencyConfig[];
export declare function readProjectAndTargetFromTargetString(targetString: string, projects: Record<string, ProjectGraphProjectNode>): {
projects?: string[];
target: string;
};
export declare function getOutputs(p: Record<string, ProjectGraphProjectNode>, target: Task['target'], overrides: Task['overrides']): string[];
export declare function normalizeTargetDependencyWithStringProjects(dependencyConfig: TargetDependencyConfig): Omit<TargetDependencyConfig, 'projects'> & {
projects: string[];
};
declare class InvalidOutputsError extends Error {

@@ -13,0 +26,0 @@ outputs: string[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unparse = exports.isCacheableTask = exports.shouldStreamOutput = exports.getSerializedArgsForTask = exports.getPrintableCommandArgsForTask = exports.getCliPath = exports.calculateReverseDeps = exports.removeIdsFromGraph = exports.removeTasksFromTaskGraph = exports.getCustomHasher = exports.getExecutorForTask = exports.getExecutorNameForTask = exports.getTargetConfigurationForTask = exports.interpolate = exports.getOutputsForTargetAndConfiguration = exports.transformLegacyOutputs = exports.validateOutputs = exports.getOutputs = exports.expandDependencyConfigSyntaxSugar = exports.getDependencyConfigs = void 0;
const output_1 = require("../utils/output");
exports.getDependencyConfigs = getDependencyConfigs;
exports.normalizeDependencyConfigDefinition = normalizeDependencyConfigDefinition;
exports.normalizeDependencyConfigProjects = normalizeDependencyConfigProjects;
exports.expandDependencyConfigSyntaxSugar = expandDependencyConfigSyntaxSugar;
exports.expandWildcardTargetConfiguration = expandWildcardTargetConfiguration;
exports.readProjectAndTargetFromTargetString = readProjectAndTargetFromTargetString;
exports.getOutputs = getOutputs;
exports.normalizeTargetDependencyWithStringProjects = normalizeTargetDependencyWithStringProjects;
exports.validateOutputs = validateOutputs;
exports.transformLegacyOutputs = transformLegacyOutputs;
exports.getOutputsForTargetAndConfiguration = getOutputsForTargetAndConfiguration;
exports.interpolate = interpolate;
exports.getTargetConfigurationForTask = getTargetConfigurationForTask;
exports.getExecutorNameForTask = getExecutorNameForTask;
exports.getExecutorForTask = getExecutorForTask;
exports.getCustomHasher = getCustomHasher;
exports.removeTasksFromTaskGraph = removeTasksFromTaskGraph;
exports.removeIdsFromGraph = removeIdsFromGraph;
exports.calculateReverseDeps = calculateReverseDeps;
exports.getCliPath = getCliPath;
exports.getPrintableCommandArgsForTask = getPrintableCommandArgsForTask;
exports.getSerializedArgsForTask = getSerializedArgsForTask;
exports.shouldStreamOutput = shouldStreamOutput;
exports.isCacheableTask = isCacheableTask;
exports.unparse = unparse;
const path_1 = require("path");

@@ -14,24 +37,29 @@ const posix_1 = require("path/posix");

const project_graph_1 = require("../project-graph/project-graph");
function getDependencyConfigs({ project, target }, extraTargetDependencies, projectGraph) {
const find_matching_projects_1 = require("../utils/find-matching-projects");
const minimatch_1 = require("minimatch");
const globs_1 = require("../utils/globs");
function getDependencyConfigs({ project, target }, extraTargetDependencies, projectGraph, allTargetNames) {
const dependencyConfigs = (projectGraph.nodes[project].data?.targets[target]?.dependsOn ??
// This is passed into `run-command` from programmatic invocations
extraTargetDependencies[target] ??
[]).map((config) => typeof config === 'string'
? expandDependencyConfigSyntaxSugar(config, projectGraph)
: config);
for (const dependencyConfig of dependencyConfigs) {
if (dependencyConfig.projects && dependencyConfig.dependencies) {
output_1.output.error({
title: `dependsOn is improperly configured for ${project}:${target}`,
bodyLines: [
`dependsOn.projects and dependsOn.dependencies cannot be used together.`,
],
});
process.exit(1);
}
}
[]).flatMap((config) => normalizeDependencyConfigDefinition(config, project, projectGraph, allTargetNames));
return dependencyConfigs;
}
exports.getDependencyConfigs = getDependencyConfigs;
function normalizeDependencyConfigDefinition(definition, currentProject, graph, allTargetNames) {
return expandWildcardTargetConfiguration(normalizeDependencyConfigProjects(expandDependencyConfigSyntaxSugar(definition, graph), currentProject, graph), allTargetNames);
}
function normalizeDependencyConfigProjects(dependencyConfig, currentProject, graph) {
const noStringConfig = normalizeTargetDependencyWithStringProjects(dependencyConfig);
if (noStringConfig.projects) {
dependencyConfig.projects = (0, find_matching_projects_1.findMatchingProjects)(noStringConfig.projects, graph.nodes);
}
else if (!noStringConfig.dependencies) {
dependencyConfig.projects = [currentProject];
}
return dependencyConfig;
}
function expandDependencyConfigSyntaxSugar(dependencyConfigString, graph) {
if (typeof dependencyConfigString !== 'string') {
return dependencyConfigString;
}
const [dependencies, targetString] = dependencyConfigString.startsWith('^')

@@ -48,22 +76,75 @@ ? [true, dependencyConfigString.substring(1)]

}
const { projects, target } = readProjectAndTargetFromTargetString(targetString, graph.nodes);
return projects ? { projects, target } : { target };
}
// Weakmap let's the cache get cleared by garbage collector if allTargetNames is no longer used
const patternResultCache = new WeakMap();
function expandWildcardTargetConfiguration(dependencyConfig, allTargetNames) {
if (!(0, globs_1.isGlobPattern)(dependencyConfig.target)) {
return [dependencyConfig];
}
let cache = patternResultCache.get(allTargetNames);
if (!cache) {
cache = new Map();
patternResultCache.set(allTargetNames, cache);
}
const cachedResult = cache.get(dependencyConfig.target);
if (cachedResult) {
return cachedResult;
}
const matcher = minimatch_1.minimatch.filter(dependencyConfig.target);
const matchingTargets = allTargetNames.filter((t) => matcher(t));
const result = matchingTargets.map((t) => ({
...dependencyConfig,
target: t,
}));
cache.set(dependencyConfig.target, result);
return result;
}
function readProjectAndTargetFromTargetString(targetString, projects) {
// Support for both `project:target` and `target:with:colons` syntax
const [maybeProject, ...segments] = (0, split_target_1.splitByColons)(targetString);
// if no additional segments are provided, then the string references
// a target of the same project
if (!segments.length) {
// if no additional segments are provided, then the string references
// a target of the same project
return { target: maybeProject };
}
return {
else if (maybeProject in projects) {
// Only the first segment could be a project. If it is, the rest is a target.
// If its not, then the whole targetString was a target with colons in its name.
target: maybeProject in graph.nodes ? segments.join(':') : targetString,
return { projects: [maybeProject], target: segments.join(':') };
}
else {
// If the first segment is a project, then we have a specific project. Otherwise, we don't.
projects: maybeProject in graph.nodes ? [maybeProject] : undefined,
};
return { target: targetString };
}
}
exports.expandDependencyConfigSyntaxSugar = expandDependencyConfigSyntaxSugar;
function getOutputs(p, target, overrides) {
return getOutputsForTargetAndConfiguration(target, overrides, p[target.project]);
}
exports.getOutputs = getOutputs;
function normalizeTargetDependencyWithStringProjects(dependencyConfig) {
if (typeof dependencyConfig.projects === 'string') {
/** LERNA SUPPORT START - Remove in v20 */
// Lerna uses `dependencies` in `prepNxOptions`, so we need to maintain
// support for it until lerna can be updated to use the syntax.
//
// This should have been removed in v17, but the updates to lerna had not
// been made yet.
//
// TODO(@agentender): Remove this part in v20
if (dependencyConfig.projects === 'self') {
delete dependencyConfig.projects;
}
else if (dependencyConfig.projects === 'dependencies') {
dependencyConfig.dependencies = true;
delete dependencyConfig.projects;
return;
/** LERNA SUPPORT END - Remove in v20 */
}
else {
dependencyConfig.projects = [dependencyConfig.projects];
}
}
return dependencyConfig;
}
class InvalidOutputsError extends Error {

@@ -108,3 +189,2 @@ constructor(outputs, invalidOutputs) {

}
exports.validateOutputs = validateOutputs;
function transformLegacyOutputs(projectRoot, error) {

@@ -126,3 +206,2 @@ return error.outputs.map((output) => {

}
exports.transformLegacyOutputs = transformLegacyOutputs;
/**

@@ -138,3 +217,3 @@ * Returns the list of outputs that will be cached.

const options = {
...targetConfiguration.options,
...targetConfiguration?.options,
...targetConfiguration?.configurations?.[configuration],

@@ -174,3 +253,2 @@ ...overrides,

}
exports.getOutputsForTargetAndConfiguration = getOutputsForTargetAndConfiguration;
/**

@@ -195,3 +273,2 @@ * Matches portions of a string which need to be interpolated.

}
exports.interpolate = interpolate;
function _interpolate(template, data) {

@@ -218,7 +295,5 @@ let res = template;

}
exports.getTargetConfigurationForTask = getTargetConfigurationForTask;
function getExecutorNameForTask(task, projectGraph) {
return getTargetConfigurationForTask(task, projectGraph)?.executor;
}
exports.getExecutorNameForTask = getExecutorNameForTask;
function getExecutorForTask(task, projectGraph) {

@@ -229,3 +304,2 @@ const executor = getExecutorNameForTask(task, projectGraph);

}
exports.getExecutorForTask = getExecutorForTask;
function getCustomHasher(task, projectGraph) {

@@ -235,3 +309,2 @@ const factory = getExecutorForTask(task, projectGraph).hasherFactory;

}
exports.getCustomHasher = getCustomHasher;
function removeTasksFromTaskGraph(graph, ids) {

@@ -245,3 +318,2 @@ const newGraph = removeIdsFromGraph(graph, ids, graph.tasks);

}
exports.removeTasksFromTaskGraph = removeTasksFromTaskGraph;
function removeIdsFromGraph(graph, ids, mapWithIds) {

@@ -263,3 +335,2 @@ const filteredMapWithIds = {};

}
exports.removeIdsFromGraph = removeIdsFromGraph;
function calculateReverseDeps(taskGraph) {

@@ -277,7 +348,5 @@ const reverseTaskDeps = {};

}
exports.calculateReverseDeps = calculateReverseDeps;
function getCliPath() {
return require.resolve(`../../bin/run-executor.js`);
}
exports.getCliPath = getCliPath;
function getPrintableCommandArgsForTask(task) {

@@ -293,3 +362,2 @@ const args = task.overrides['__overrides_unparsed__'];

}
exports.getPrintableCommandArgsForTask = getPrintableCommandArgsForTask;
function getSerializedArgsForTask(task, isVerbose) {

@@ -304,3 +372,2 @@ return [

}
exports.getSerializedArgsForTask = getSerializedArgsForTask;
function shouldStreamOutput(task, initiatingProject) {

@@ -315,3 +382,2 @@ if (process.env.NX_STREAM_OUTPUT === 'true')

}
exports.shouldStreamOutput = shouldStreamOutput;
function isCacheableTask(task, options) {

@@ -326,3 +392,2 @@ if (task.cache !== undefined && !longRunningTask(task)) {

}
exports.isCacheableTask = isCacheableTask;
function longRunningTask(task) {

@@ -341,2 +406,1 @@ const t = task.target.target;

}
exports.unparse = unparse;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.recordStat = exports.messages = exports.PromptMessages = void 0;
exports.messages = exports.PromptMessages = void 0;
exports.recordStat = recordStat;
const node_child_process_1 = require("node:child_process");

@@ -90,3 +91,2 @@ const is_ci_1 = require("./is-ci");

}
exports.recordStat = recordStat;
function shouldRecordStats() {

@@ -93,0 +93,0 @@ const pmc = (0, package_manager_1.getPackageManagerCommand)();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.allFileData = void 0;
exports.allFileData = allFileData;
const workspace_context_1 = require("./workspace-context");

@@ -9,2 +9,1 @@ const workspace_root_1 = require("./workspace-root");

}
exports.allFileData = allFileData;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertWorkspaceValidity = void 0;
exports.assertWorkspaceValidity = assertWorkspaceValidity;
const find_matching_projects_1 = require("./find-matching-projects");

@@ -73,3 +73,2 @@ const output_1 = require("./output");

}
exports.assertWorkspaceValidity = assertWorkspaceValidity;
function detectAndSetInvalidProjectGlobValues(map, sourceName, desiredImplicitDeps, projectConfigurations, projects) {

@@ -76,0 +75,0 @@ const invalidProjectsOrGlobs = desiredImplicitDeps.filter((implicit) => {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLastValueFromAsyncIterableIterator = exports.isAsyncIterator = void 0;
exports.isAsyncIterator = isAsyncIterator;
exports.getLastValueFromAsyncIterableIterator = getLastValueFromAsyncIterableIterator;
function isAsyncIterator(v) {
return typeof v?.[Symbol.asyncIterator] === 'function';
}
exports.isAsyncIterator = isAsyncIterator;
async function getLastValueFromAsyncIterableIterator(i) {

@@ -19,2 +19,1 @@ let prev;

}
exports.getLastValueFromAsyncIterableIterator = getLastValueFromAsyncIterableIterator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workspaceDataDirectory = exports.cacheDirectoryForWorkspace = exports.cacheDir = void 0;
exports.workspaceDataDirectory = exports.cacheDir = void 0;
exports.cacheDirectoryForWorkspace = cacheDirectoryForWorkspace;
const fs_1 = require("fs");

@@ -64,5 +65,4 @@ const path_1 = require("path");

}
exports.cacheDirectoryForWorkspace = cacheDirectoryForWorkspace;
exports.workspaceDataDirectory = absolutePath(workspace_root_1.workspaceRoot, process.env.NX_WORKSPACE_DATA_DIRECTORY ??
process.env.NX_PROJECT_GRAPH_CACHE_DIRECTORY ??
defaultWorkspaceDataDirectory(workspace_root_1.workspaceRoot));

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { type ExecOptions, type ExecSyncOptions } from 'child_process';

@@ -3,0 +2,0 @@ import { ChildProcess } from '../native';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PseudoTtyProcess = exports.runNxAsync = exports.runNxSync = void 0;
exports.PseudoTtyProcess = void 0;
exports.runNxSync = runNxSync;
exports.runNxAsync = runNxAsync;
const child_process_1 = require("child_process");

@@ -27,3 +29,2 @@ const fs_1 = require("fs");

}
exports.runNxSync = runNxSync;
async function runNxAsync(cmd, options) {

@@ -64,3 +65,2 @@ let baseCmd;

}
exports.runNxAsync = runNxAsync;
function messageToCode(message) {

@@ -67,0 +67,0 @@ if (message.startsWith('Terminated by ')) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chunkify = void 0;
exports.chunkify = chunkify;
const child_process_1 = require("child_process");

@@ -26,3 +26,2 @@ const TERMINAL_SIZE = process.platform === 'win32' ? 8192 : getUnixTerminalSize();

}
exports.chunkify = chunkify;
function getUnixTerminalSize() {

@@ -29,0 +28,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.codeFrameColumns = void 0;
exports.codeFrameColumns = codeFrameColumns;
// Adapted from https://raw.githubusercontent.com/babel/babel/4108524/packages/babel-code-frame/src/index.js

@@ -119,2 +119,1 @@ const chalk = require("chalk");

}
exports.codeFrameColumns = codeFrameColumns;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.collapseExpandedOutputs = void 0;
exports.collapseExpandedOutputs = collapseExpandedOutputs;
const path_1 = require("path");

@@ -41,2 +41,1 @@ /**

}
exports.collapseExpandedOutputs = collapseExpandedOutputs;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readGraphFileFromGraphArg = exports.getProjectRoots = exports.parseFiles = exports.splitArgsIntoNxArgsAndOverrides = exports.createOverrides = void 0;
exports.createOverrides = createOverrides;
exports.splitArgsIntoNxArgsAndOverrides = splitArgsIntoNxArgsAndOverrides;
exports.parseFiles = parseFiles;
exports.getProjectRoots = getProjectRoots;
exports.readGraphFileFromGraphArg = readGraphFileFromGraphArg;
const yargsParser = require("yargs-parser");

@@ -22,3 +26,2 @@ const file_utils_1 = require("../project-graph/file-utils");

}
exports.createOverrides = createOverrides;
function splitArgsIntoNxArgsAndOverrides(args, mode, options = { printWarnings: true }, nxJson) {

@@ -131,3 +134,2 @@ // this is to lerna case when this function is invoked imperatively

}
exports.splitArgsIntoNxArgsAndOverrides = splitArgsIntoNxArgsAndOverrides;
function normalizeNxArgsRunner(nxArgs, nxJson, options) {

@@ -206,3 +208,2 @@ if (!nxArgs.runner) {

}
exports.parseFiles = parseFiles;
function getUncommittedFiles() {

@@ -252,3 +253,2 @@ return parseGitOutput(`git diff --name-only --no-renames --relative HEAD .`);

}
exports.getProjectRoots = getProjectRoots;
function readGraphFileFromGraphArg({ graph }) {

@@ -259,2 +259,1 @@ return typeof graph === 'string' && graph !== 'true' && graph !== ''

}
exports.readGraphFileFromGraphArg = readGraphFileFromGraphArg;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.consumeMessagesFromSocket = void 0;
exports.consumeMessagesFromSocket = consumeMessagesFromSocket;
function consumeMessagesFromSocket(callback) {

@@ -22,2 +22,1 @@ let message = '';

}
exports.consumeMessagesFromSocket = consumeMessagesFromSocket;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deduceDefaultBase = void 0;
exports.deduceDefaultBase = deduceDefaultBase;
const child_process_1 = require("child_process");

@@ -15,2 +15,1 @@ function deduceDefaultBase() {

}
exports.deduceDefaultBase = deduceDefaultBase;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadRootEnvFiles = void 0;
exports.loadRootEnvFiles = loadRootEnvFiles;
const dotenv_1 = require("dotenv");

@@ -22,2 +22,1 @@ const dotenv_expand_1 = require("dotenv-expand");

}
exports.loadRootEnvFiles = loadRootEnvFiles;

@@ -1,2 +0,1 @@

/// <reference types="node" />
/**

@@ -3,0 +2,0 @@ * Translates NodeJS signals to numeric exit code

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.signalToCode = void 0;
exports.signalToCode = signalToCode;
/**

@@ -20,2 +20,1 @@ * Translates NodeJS signals to numeric exit code

}
exports.signalToCode = signalToCode;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type { JsonParseOptions, JsonSerializeOptions } from './json';

@@ -3,0 +2,0 @@ import { PathLike } from 'fs';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readFileIfExisting = exports.extractFileFromTarball = exports.isRelativePath = exports.createDirectory = exports.fileExists = exports.directoryExists = exports.writeJsonFile = exports.readYamlFile = exports.readJsonFile = void 0;
exports.readJsonFile = readJsonFile;
exports.readYamlFile = readYamlFile;
exports.writeJsonFile = writeJsonFile;
exports.directoryExists = directoryExists;
exports.fileExists = fileExists;
exports.createDirectory = createDirectory;
exports.isRelativePath = isRelativePath;
exports.extractFileFromTarball = extractFileFromTarball;
exports.readFileIfExisting = readFileIfExisting;
const json_1 = require("./json");

@@ -29,3 +37,2 @@ const fs_1 = require("fs");

}
exports.readJsonFile = readJsonFile;
/**

@@ -42,3 +49,2 @@ * Reads a YAML file and returns the object the YAML content represents.

}
exports.readYamlFile = readYamlFile;
/**

@@ -59,3 +65,2 @@ * Serializes the given data to JSON and writes it to a file.

}
exports.writeJsonFile = writeJsonFile;
/**

@@ -73,3 +78,2 @@ * Check if a directory exists

}
exports.directoryExists = directoryExists;
/**

@@ -87,7 +91,5 @@ * Check if a file exists.

}
exports.fileExists = fileExists;
function createDirectory(path) {
(0, fs_1.mkdirSync)(path, { recursive: true });
}
exports.createDirectory = createDirectory;
function isRelativePath(path) {

@@ -99,3 +101,2 @@ return (path === '.' ||

}
exports.isRelativePath = isRelativePath;
/**

@@ -137,6 +138,4 @@ * Extracts a file from a given tarball to the specified destination.

}
exports.extractFileFromTarball = extractFileFromTarball;
function readFileIfExisting(path) {
return (0, fs_1.existsSync)(path) ? (0, fs_1.readFileSync)(path, 'utf-8') : '';
}
exports.readFileIfExisting = readFileIfExisting;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMatchingStringsWithCache = exports.findMatchingProjects = void 0;
exports.getMatchingStringsWithCache = void 0;
exports.findMatchingProjects = findMatchingProjects;
const minimatch_1 = require("minimatch");
const globs_1 = require("./globs");
const validPatternTypes = [

@@ -11,3 +13,2 @@ 'name', // Pattern is based on the project's name

];
const globCharacters = ['*', '|', '{', '}', '(', ')'];
/**

@@ -90,3 +91,2 @@ * Find matching project names given a list of potential project names or globs.

}
exports.findMatchingProjects = findMatchingProjects;
function addMatchingProjectsByDirectory(projectNames, projects, pattern, matchedProjects) {

@@ -115,3 +115,3 @@ for (const projectName of projectNames) {

}
if (!globCharacters.some((c) => pattern.value.includes(c))) {
if (!(0, globs_1.isGlobPattern)(pattern.value)) {
return;

@@ -141,3 +141,3 @@ }

}
if (!globCharacters.some((c) => pattern.value.includes(c))) {
if (!(0, globs_1.isGlobPattern)(pattern.value)) {
continue;

@@ -144,0 +144,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findWorkspaceRoot = void 0;
exports.findWorkspaceRoot = findWorkspaceRoot;
const workspace_root_1 = require("./workspace-root");

@@ -22,3 +22,2 @@ /**

}
exports.findWorkspaceRoot = findWorkspaceRoot;
function isAngularCliInstalled(root) {

@@ -25,0 +24,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPackageNameFromImportPath = void 0;
exports.getPackageNameFromImportPath = getPackageNameFromImportPath;
//# Converts import paths to package names.

@@ -18,2 +18,1 @@ //# e.g. - `@nx/workspace` -> `@nx/workspace`

}
exports.getPackageNameFromImportPath = getPackageNameFromImportPath;

@@ -0,1 +1,40 @@

import { ExecSyncOptions } from 'child_process';
export declare function cloneFromUpstream(url: string, destination: string): Promise<GitRepository>;
export declare class GitRepository {
private directory;
root: string;
constructor(directory: string);
getGitRootPath(cwd: string): string;
private execAsync;
showStat(): Promise<string>;
listBranches(): Promise<string[]>;
getGitFiles(path: string): Promise<string[]>;
deleteBranch(branch: string): Promise<string>;
reset(ref: string): Promise<string>;
squashLastTwoCommits(): Promise<string>;
mergeUnrelatedHistories(ref: string, message: string): Promise<string>;
fetch(remote: string): Promise<string>;
checkout(branch: string, opts: {
new: boolean;
base: string;
}): Promise<string>;
move(path: string, destination: string): Promise<string>;
push(ref: string): Promise<string>;
getGitRemotes(): Promise<Array<{
name: string;
url: string;
}>>;
stageToGit(...paths: string[]): Promise<string>;
commit(message: string): Promise<string>;
amendCommit(): Promise<string>;
getCurrentBranch(): Promise<string>;
isIgnored(path: string): Promise<boolean>;
deleteGitRemote(name: string): Promise<string>;
addGitRemote(name: string, url: string): Promise<string>;
}
/**
* This is used by the squash editor script to update the rebase file.
*/
export declare function updateRebaseFile(contents: string): string;
export declare function fetchGitRemote(name: string, branch: string, execOptions: ExecSyncOptions): string | Buffer;
export declare function getGithubSlugOrNull(): string | null;

@@ -2,0 +41,0 @@ export declare function extractUserAndRepoFromGitHubUrl(gitRemotes: string): string | null;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLatestCommitSha = exports.commitChanges = exports.extractUserAndRepoFromGitHubUrl = exports.getGithubSlugOrNull = void 0;
exports.GitRepository = void 0;
exports.cloneFromUpstream = cloneFromUpstream;
exports.updateRebaseFile = updateRebaseFile;
exports.fetchGitRemote = fetchGitRemote;
exports.getGithubSlugOrNull = getGithubSlugOrNull;
exports.extractUserAndRepoFromGitHubUrl = extractUserAndRepoFromGitHubUrl;
exports.commitChanges = commitChanges;
exports.getLatestCommitSha = getLatestCommitSha;
const child_process_1 = require("child_process");
const devkit_exports_1 = require("../devkit-exports");
const path_1 = require("path");
const SQUASH_EDITOR = (0, path_1.join)(__dirname, 'squash.js');
function execAsync(command, execOptions) {
return new Promise((res, rej) => {
(0, child_process_1.exec)(command, execOptions, (err, stdout, stderr) => {
if (err) {
return rej(err);
}
res(stdout);
});
});
}
async function cloneFromUpstream(url, destination) {
await execAsync(`git clone ${url} ${destination} --depth 1`, {
cwd: (0, path_1.dirname)(destination),
});
return new GitRepository(destination);
}
class GitRepository {
constructor(directory) {
this.directory = directory;
this.root = this.getGitRootPath(this.directory);
}
getGitRootPath(cwd) {
return (0, child_process_1.execSync)('git rev-parse --show-toplevel', {
cwd,
})
.toString()
.trim();
}
execAsync(command) {
return execAsync(command, {
cwd: this.root,
});
}
async showStat() {
return await this.execAsync(`git show --stat`);
}
async listBranches() {
return (await this.execAsync(`git ls-remote --heads --quiet`))
.trim()
.split('\n')
.map((s) => s
.trim()
.substring(s.indexOf('\t') + 1)
.replace('refs/heads/', ''));
}
async getGitFiles(path) {
return (await this.execAsync(`git ls-files ${path}`))
.trim()
.split('\n')
.map((s) => s.trim());
}
async deleteBranch(branch) {
return this.execAsync(`git branch -D ${branch}`);
}
async reset(ref) {
return this.execAsync(`git reset ${ref} --hard`);
}
async squashLastTwoCommits() {
return this.execAsync(`git -c core.editor="node ${SQUASH_EDITOR}" rebase --interactive --no-autosquash HEAD~2`);
}
async mergeUnrelatedHistories(ref, message) {
return this.execAsync(`git merge ${ref} -X ours --allow-unrelated-histories -m "${message}"`);
}
async fetch(remote) {
return this.execAsync(`git fetch ${remote}`);
}
async checkout(branch, opts) {
return this.execAsync(`git checkout ${opts.new ? '-b ' : ' '}${branch}${opts.base ? ' ' + opts.base : ''}`);
}
async move(path, destination) {
return this.execAsync(`git mv ${path} ${destination}`);
}
async push(ref) {
return this.execAsync(`git push -u -f origin ${ref}`);
}
async getGitRemotes() {
const remotes = (await this.execAsync('git remote -v'))
.toString()
.split('\n')
.filter((line) => line.endsWith(' (fetch)'))
.map((s) => s.replace(' (fetch)', '').split('\t'))
.map(([name, url]) => ({
name,
url,
}));
return remotes;
}
async stageToGit(...paths) {
return this.execAsync(`git add ${paths.join(' ')}`);
}
async commit(message) {
return this.execAsync(`git commit -am "${message}"`);
}
async amendCommit() {
return this.execAsync(`git commit --amend -a --no-edit`);
}
async getCurrentBranch() {
return this.execAsync(`git branch --show-current`);
}
async isIgnored(path) {
try {
await this.execAsync(`git check-ignore ${path}`);
return true;
}
catch {
return false;
}
}
deleteGitRemote(name) {
return this.execAsync(`git remote rm ${name}`);
}
addGitRemote(name, url) {
return this.execAsync(`git remote add ${name} ${url}`);
}
}
exports.GitRepository = GitRepository;
/**
* This is used by the squash editor script to update the rebase file.
*/
function updateRebaseFile(contents) {
const lines = contents.split('\n');
const lastCommitIndex = lines.findIndex((line) => line === '') - 1;
lines[lastCommitIndex] = lines[lastCommitIndex].replace('pick', 'fixup');
return lines.join('\n');
}
function fetchGitRemote(name, branch, execOptions) {
return (0, child_process_1.execSync)(`git fetch ${name} ${branch} --depth 1`, execOptions);
}
function getGithubSlugOrNull() {

@@ -15,3 +152,2 @@ try {

}
exports.getGithubSlugOrNull = getGithubSlugOrNull;
function extractUserAndRepoFromGitHubUrl(gitRemotes) {

@@ -33,3 +169,2 @@ const regex = /^\s*(\w+)\s+(git@github\.com:|https:\/\/github\.com\/)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\.git/gm;

}
exports.extractUserAndRepoFromGitHubUrl = extractUserAndRepoFromGitHubUrl;
function parseGitHubUrl(url) {

@@ -68,3 +203,2 @@ const sshPattern = /git@github\.com:([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\.git/;

}
exports.commitChanges = commitChanges;
function getLatestCommitSha() {

@@ -81,2 +215,1 @@ try {

}
exports.getLatestCommitSha = getLatestCommitSha;
export declare function combineGlobPatterns(...patterns: (string | string[])[]): string;
export declare const GLOB_CHARACTERS: Set<string>;
export declare function isGlobPattern(pattern: string): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.combineGlobPatterns = void 0;
exports.GLOB_CHARACTERS = void 0;
exports.combineGlobPatterns = combineGlobPatterns;
exports.isGlobPattern = isGlobPattern;
function combineGlobPatterns(...patterns) {

@@ -8,2 +10,10 @@ const p = patterns.flat();

}
exports.combineGlobPatterns = combineGlobPatterns;
exports.GLOB_CHARACTERS = new Set(['*', '|', '{', '}', '(', ')', '[']);
function isGlobPattern(pattern) {
for (const c of pattern) {
if (exports.GLOB_CHARACTERS.has(c)) {
return true;
}
}
return false;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIgnoreObject = exports.getAlwaysIgnore = exports.getIgnoredGlobs = exports.ALWAYS_IGNORE = void 0;
exports.ALWAYS_IGNORE = void 0;
exports.getIgnoredGlobs = getIgnoredGlobs;
exports.getAlwaysIgnore = getAlwaysIgnore;
exports.getIgnoreObject = getIgnoreObject;
const fs_extra_1 = require("fs-extra");

@@ -28,3 +31,2 @@ const ignore_1 = require("ignore");

}
exports.getIgnoredGlobs = getIgnoredGlobs;
function getAlwaysIgnore(root) {

@@ -41,3 +43,2 @@ const paths = [

}
exports.getAlwaysIgnore = getAlwaysIgnore;
function getIgnoreObject(root = workspace_root_1.workspaceRoot) {

@@ -49,3 +50,2 @@ const ig = (0, ignore_1.default)();

}
exports.getIgnoreObject = getIgnoreObject;
function getIgnoredGlobsFromFile(file, root) {

@@ -52,0 +52,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNxRequirePaths = exports.getNxInstallationPath = void 0;
exports.getNxInstallationPath = getNxInstallationPath;
exports.getNxRequirePaths = getNxRequirePaths;
const path_1 = require("path");

@@ -9,6 +10,4 @@ const workspace_root_1 = require("./workspace-root");

}
exports.getNxInstallationPath = getNxInstallationPath;
function getNxRequirePaths(root = workspace_root_1.workspaceRoot) {
return [root, getNxInstallationPath(root)];
}
exports.getNxRequirePaths = getNxRequirePaths;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCI = void 0;
exports.isCI = isCI;
function isCI() {

@@ -21,2 +21,1 @@ return ((process.env.CI && process.env.CI !== 'false') ||

}
exports.isCI = isCI;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deepEquals = exports.walkJsonTree = exports.jsonDiff = exports.isJsonChange = exports.JsonDiffType = void 0;
exports.JsonDiffType = void 0;
exports.isJsonChange = isJsonChange;
exports.jsonDiff = jsonDiff;
exports.walkJsonTree = walkJsonTree;
exports.deepEquals = deepEquals;
var JsonDiffType;

@@ -15,3 +19,2 @@ (function (JsonDiffType) {

}
exports.isJsonChange = isJsonChange;
function jsonDiff(lhs, rhs) {

@@ -61,3 +64,2 @@ const result = [];

}
exports.jsonDiff = jsonDiff;
// Depth-first walk down JSON tree.

@@ -76,3 +78,2 @@ function walkJsonTree(json, currPath, visitor) {

}
exports.walkJsonTree = walkJsonTree;
function hashArray(ary) {

@@ -115,2 +116,1 @@ return JSON.stringify(ary);

}
exports.deepEquals = deepEquals;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeJson = exports.parseJson = exports.stripJsonComments = void 0;
exports.stripJsonComments = void 0;
exports.parseJson = parseJson;
exports.serializeJson = serializeJson;
const jsonc_parser_1 = require("jsonc-parser");

@@ -31,3 +33,2 @@ Object.defineProperty(exports, "stripJsonComments", { enumerable: true, get: function () { return jsonc_parser_1.stripComments; } });

}
exports.parseJson = parseJson;
/**

@@ -63,2 +64,1 @@ * Nicely formats a JSON error with context

}
exports.serializeJson = serializeJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripIndent = exports.logger = exports.NX_ERROR = exports.NX_PREFIX = void 0;
exports.logger = exports.NX_ERROR = exports.NX_PREFIX = void 0;
exports.stripIndent = stripIndent;
const chalk = require("chalk");

@@ -52,2 +53,1 @@ exports.NX_PREFIX = chalk.inverse(chalk.bold(chalk.cyan(' NX ')));

}
exports.stripIndent = stripIndent;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNxCloudToken = exports.getNxCloudUrl = exports.isNxCloudUsed = void 0;
exports.isNxCloudUsed = isNxCloudUsed;
exports.getNxCloudUrl = getNxCloudUrl;
exports.getNxCloudToken = getNxCloudToken;
function isNxCloudUsed(nxJson) {

@@ -9,3 +11,2 @@ return (!!process.env.NX_CLOUD_ACCESS_TOKEN ||

}
exports.isNxCloudUsed = isNxCloudUsed;
function getNxCloudUrl(nxJson) {

@@ -18,3 +19,2 @@ const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');

}
exports.getNxCloudUrl = getNxCloudUrl;
function getNxCloudToken(nxJson) {

@@ -29,2 +29,1 @@ const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');

}
exports.getNxCloudToken = getNxCloudToken;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultPluginsSync = void 0;
exports.getDefaultPluginsSync = getDefaultPluginsSync;
const angular_json_1 = require("../adapter/angular-json");
const project_json_1 = require("../plugins/project-json/build-nodes/project-json");
const target_defaults_plugin_1 = require("../plugins/target-defaults/target-defaults-plugin");
const PackageJsonWorkspacesPlugin = require("../plugins/package-json-workspaces");
const PackageJsonWorkspacesPlugin = require("../plugins/package-json");
/**

@@ -17,3 +16,2 @@ * @todo(@agentender) v20: Remove this fn when we remove readWorkspaceConfig

: []),
target_defaults_plugin_1.default,
PackageJsonWorkspacesPlugin,

@@ -24,2 +22,1 @@ project_json_1.default,

}
exports.getDefaultPluginsSync = getDefaultPluginsSync;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortObjectByKeys = void 0;
exports.sortObjectByKeys = sortObjectByKeys;
function sortObjectByKeys(originalObject) {

@@ -10,2 +10,1 @@ const keys = Object.keys(originalObject).sort();

}
exports.sortObjectByKeys = sortObjectByKeys;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readModulePackageJson = exports.readModulePackageJsonWithoutFallbacks = exports.readTargetsFromPackageJson = exports.getTagsFromPackageJson = exports.getMetadataFromPackageJson = exports.buildTargetFromScript = exports.readNxMigrateConfig = exports.normalizePackageGroup = void 0;
exports.normalizePackageGroup = normalizePackageGroup;
exports.readNxMigrateConfig = readNxMigrateConfig;
exports.buildTargetFromScript = buildTargetFromScript;
exports.getMetadataFromPackageJson = getMetadataFromPackageJson;
exports.getTagsFromPackageJson = getTagsFromPackageJson;
exports.readTargetsFromPackageJson = readTargetsFromPackageJson;
exports.readModulePackageJsonWithoutFallbacks = readModulePackageJsonWithoutFallbacks;
exports.readModulePackageJson = readModulePackageJson;
const fs_1 = require("fs");

@@ -18,3 +25,2 @@ const path_1 = require("path");

}
exports.normalizePackageGroup = normalizePackageGroup;
function readNxMigrateConfig(json) {

@@ -42,3 +48,2 @@ const parseNxMigrationsConfig = (fromJson) => {

}
exports.readNxMigrateConfig = readNxMigrateConfig;
function buildTargetFromScript(script, scripts = {}, packageManagerCommand) {

@@ -56,3 +61,2 @@ return {

}
exports.buildTargetFromScript = buildTargetFromScript;
let packageManagerCommand;

@@ -69,3 +73,2 @@ function getMetadataFromPackageJson(packageJson) {

}
exports.getMetadataFromPackageJson = getMetadataFromPackageJson;
function getTagsFromPackageJson(packageJson) {

@@ -81,3 +84,2 @@ const tags = packageJson.private ? ['npm:private'] : ['npm:public'];

}
exports.getTagsFromPackageJson = getTagsFromPackageJson;
function readTargetsFromPackageJson(packageJson) {

@@ -108,3 +110,2 @@ const { scripts, nx, private: isPrivate } = packageJson ?? {};

}
exports.readTargetsFromPackageJson = readTargetsFromPackageJson;
/**

@@ -127,3 +128,2 @@ * Uses `require.resolve` to read the package.json for a module.

}
exports.readModulePackageJsonWithoutFallbacks = readModulePackageJsonWithoutFallbacks;
/**

@@ -170,2 +170,1 @@ * Reads the package.json file for a specified module.

}
exports.readModulePackageJson = readModulePackageJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.packageRegistryPack = exports.packageRegistryView = exports.resolvePackageVersionUsingInstallation = exports.resolvePackageVersionUsingRegistry = exports.createTempNpmDirectory = exports.copyPackageManagerConfigurationFiles = exports.modifyYarnRcToFitNewDirectory = exports.modifyYarnRcYmlToFitNewDirectory = exports.findFileInPackageJsonDirectory = exports.getPackageManagerVersion = exports.getPackageManagerCommand = exports.isWorkspacesEnabled = exports.detectPackageManager = void 0;
exports.detectPackageManager = detectPackageManager;
exports.isWorkspacesEnabled = isWorkspacesEnabled;
exports.getPackageManagerCommand = getPackageManagerCommand;
exports.getPackageManagerVersion = getPackageManagerVersion;
exports.findFileInPackageJsonDirectory = findFileInPackageJsonDirectory;
exports.modifyYarnRcYmlToFitNewDirectory = modifyYarnRcYmlToFitNewDirectory;
exports.modifyYarnRcToFitNewDirectory = modifyYarnRcToFitNewDirectory;
exports.copyPackageManagerConfigurationFiles = copyPackageManagerConfigurationFiles;
exports.createTempNpmDirectory = createTempNpmDirectory;
exports.resolvePackageVersionUsingRegistry = resolvePackageVersionUsingRegistry;
exports.resolvePackageVersionUsingInstallation = resolvePackageVersionUsingInstallation;
exports.packageRegistryView = packageRegistryView;
exports.packageRegistryPack = packageRegistryPack;
const child_process_1 = require("child_process");

@@ -31,3 +43,2 @@ const fs_1 = require("fs");

}
exports.detectPackageManager = detectPackageManager;
/**

@@ -46,3 +57,2 @@ * Returns true if the workspace is using npm workspaces, yarn workspaces, or pnpm workspaces.

}
exports.isWorkspacesEnabled = isWorkspacesEnabled;
/**

@@ -130,3 +140,3 @@ * Returns commands for the package manager used in the workspace.

install: 'npm install',
ciInstall: 'npm ci',
ciInstall: 'npm ci --legacy-peer-deps',
updateLockFile: 'npm install --package-lock-only',

@@ -161,3 +171,2 @@ add: 'npm install',

}
exports.getPackageManagerCommand = getPackageManagerCommand;
/**

@@ -193,3 +202,2 @@ * Returns the version of the package manager used in the workspace.

}
exports.getPackageManagerVersion = getPackageManagerVersion;
/**

@@ -206,3 +214,2 @@ * Checks for a project level npmrc file by crawling up the file tree until

}
exports.findFileInPackageJsonDirectory = findFileInPackageJsonDirectory;
/**

@@ -233,3 +240,2 @@ * We copy yarnrc.yml to the temporary directory to ensure things like the specified

}
exports.modifyYarnRcYmlToFitNewDirectory = modifyYarnRcYmlToFitNewDirectory;
/**

@@ -253,3 +259,2 @@ * We copy .yarnrc to the temporary directory to ensure things like the specified

}
exports.modifyYarnRcToFitNewDirectory = modifyYarnRcToFitNewDirectory;
function copyPackageManagerConfigurationFiles(root, destination) {

@@ -292,3 +297,2 @@ for (const packageManagerConfigFile of [

}
exports.copyPackageManagerConfigurationFiles = copyPackageManagerConfigurationFiles;
/**

@@ -316,3 +320,2 @@ * Creates a temporary directory where you can run package manager commands safely.

}
exports.createTempNpmDirectory = createTempNpmDirectory;
/**

@@ -350,3 +353,2 @@ * Returns the resolved version for a given package and version tag using the

}
exports.resolvePackageVersionUsingRegistry = resolvePackageVersionUsingRegistry;
/**

@@ -369,3 +371,2 @@ * Return the resolved version for a given package and version tag using by

}
exports.resolvePackageVersionUsingInstallation = resolvePackageVersionUsingInstallation;
async function packageRegistryView(pkg, version, args) {

@@ -389,3 +390,2 @@ let pm = detectPackageManager();

}
exports.packageRegistryView = packageRegistryView;
async function packageRegistryPack(cwd, pkg, version) {

@@ -409,2 +409,1 @@ let pm = detectPackageManager();

}
exports.packageRegistryPack = packageRegistryPack;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPromptsForSchema = exports.convertSmartDefaultsIntoNamedParams = exports.warnDeprecations = exports.combineOptionsForGenerator = exports.combineOptionsForExecutor = exports.applyVerbosity = exports.setDefaults = exports.validateObject = exports.validateOptsAgainstSchema = exports.SchemaError = exports.convertAliases = exports.coerceTypesInOptions = exports.convertToCamelCase = exports.handleErrors = void 0;
exports.SchemaError = void 0;
exports.handleErrors = handleErrors;
exports.convertToCamelCase = convertToCamelCase;
exports.coerceTypesInOptions = coerceTypesInOptions;
exports.convertAliases = convertAliases;
exports.validateOptsAgainstSchema = validateOptsAgainstSchema;
exports.validateObject = validateObject;
exports.setDefaults = setDefaults;
exports.applyVerbosity = applyVerbosity;
exports.combineOptionsForExecutor = combineOptionsForExecutor;
exports.combineOptionsForGenerator = combineOptionsForGenerator;
exports.warnDeprecations = warnDeprecations;
exports.convertSmartDefaultsIntoNamedParams = convertSmartDefaultsIntoNamedParams;
exports.getPromptsForSchema = getPromptsForSchema;
const logger_1 = require("./logger");

@@ -54,3 +67,2 @@ const output_1 = require("./output");

}
exports.handleErrors = handleErrors;
function camelCase(input) {

@@ -76,3 +88,2 @@ if (input.indexOf('-') > 1) {

}
exports.convertToCamelCase = convertToCamelCase;
/**

@@ -92,3 +103,2 @@ * Coerces (and replaces) options identified as 'boolean' or 'number' in the Schema

}
exports.coerceTypesInOptions = coerceTypesInOptions;
function coerceType(prop, value) {

@@ -160,3 +170,2 @@ if (!prop)

}
exports.convertAliases = convertAliases;
class SchemaError {

@@ -171,3 +180,2 @@ constructor(message) {

}
exports.validateOptsAgainstSchema = validateOptsAgainstSchema;
function validateObject(opts, schema, definitions) {

@@ -249,3 +257,2 @@ if (schema.anyOf) {

}
exports.validateObject = validateObject;
function validateProperty(propName, value, schema, definitions) {

@@ -395,3 +402,2 @@ if (!schema)

}
exports.setDefaults = setDefaults;
function setDefaultsInObject(opts, properties, definitions) {

@@ -451,3 +457,2 @@ Object.keys(properties).forEach((p) => {

}
exports.applyVerbosity = applyVerbosity;
function combineOptionsForExecutor(commandLineOpts, config, target, schema, defaultProjectName, relativeCwd, isVerbose = false) {

@@ -468,3 +473,2 @@ const r = convertAliases(coerceTypesInOptions(convertToCamelCase(commandLineOpts, schema), schema), schema, false);

}
exports.combineOptionsForExecutor = combineOptionsForExecutor;
async function combineOptionsForGenerator(commandLineOpts, collectionName, generatorName, projectsConfigurations, nxJsonConfiguration, schema, isInteractive, defaultProjectName, relativeCwd, isVerbose = false) {

@@ -485,3 +489,2 @@ const generatorDefaults = projectsConfigurations

}
exports.combineOptionsForGenerator = combineOptionsForGenerator;
function warnDeprecations(opts, schema) {

@@ -495,3 +498,2 @@ Object.keys(opts).forEach((option) => {

}
exports.warnDeprecations = warnDeprecations;
function convertSmartDefaultsIntoNamedParams(opts, schema, defaultProjectName, relativeCwd) {

@@ -544,3 +546,2 @@ const argv = opts['_'] || [];

}
exports.convertSmartDefaultsIntoNamedParams = convertSmartDefaultsIntoNamedParams;
function getGeneratorDefaults(projectName, projectsConfigurations, nxJsonConfiguration, collectionName, generatorName) {

@@ -675,3 +676,2 @@ let defaults = {};

}
exports.getPromptsForSchema = getPromptsForSchema;
async function promptForValues(opts, schema, projectsConfigurations) {

@@ -678,0 +678,0 @@ return await (await Promise.resolve().then(() => require('enquirer')))

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCwd = exports.joinPathFragments = exports.normalizePath = void 0;
exports.normalizePath = normalizePath;
exports.joinPathFragments = joinPathFragments;
exports.getCwd = getCwd;
const path = require("path");

@@ -16,3 +18,2 @@ const workspace_root_1 = require("./workspace-root");

}
exports.normalizePath = normalizePath;
/**

@@ -25,3 +26,2 @@ * Normalized path fragments and joins them. Use this when writing paths to config files.

}
exports.joinPathFragments = joinPathFragments;
/**

@@ -40,2 +40,1 @@ * When running a script with the package manager (e.g. `npm run`), the package manager will

}
exports.getCwd = getCwd;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchCommunityPlugins = void 0;
exports.fetchCommunityPlugins = fetchCommunityPlugins;
const https_1 = require("https");

@@ -29,2 +29,1 @@ const COMMUNITY_PLUGINS_JSON_URL = 'https://raw.githubusercontent.com/nrwl/nx/master/community/approved-plugins.json';

}
exports.fetchCommunityPlugins = fetchCommunityPlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listCorePlugins = exports.fetchCorePlugins = void 0;
exports.fetchCorePlugins = fetchCorePlugins;
exports.listCorePlugins = listCorePlugins;
const chalk = require("chalk");

@@ -106,3 +107,2 @@ const output_1 = require("../output");

}
exports.fetchCorePlugins = fetchCorePlugins;
function listCorePlugins(installedPlugins, corePlugins) {

@@ -119,2 +119,1 @@ const alsoAvailable = corePlugins.filter((p) => !installedPlugins.has(p.name));

}
exports.listCorePlugins = listCorePlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listInstalledPlugins = exports.getInstalledPluginsAndCapabilities = exports.findInstalledPlugins = void 0;
exports.findInstalledPlugins = findInstalledPlugins;
exports.getInstalledPluginsAndCapabilities = getInstalledPluginsAndCapabilities;
exports.listInstalledPlugins = listInstalledPlugins;
const chalk = require("chalk");

@@ -27,3 +29,2 @@ const output_1 = require("../output");

}
exports.findInstalledPlugins = findInstalledPlugins;
function getNxPluginPackageJsonOrNull(pkg) {

@@ -81,3 +82,2 @@ try {

}
exports.getInstalledPluginsAndCapabilities = getInstalledPluginsAndCapabilities;
function listInstalledPlugins(installedPlugins) {

@@ -106,2 +106,1 @@ const bodyLines = [];

}
exports.listInstalledPlugins = listInstalledPlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listLocalWorkspacePlugins = exports.getLocalWorkspacePlugins = void 0;
exports.getLocalWorkspacePlugins = getLocalWorkspacePlugins;
exports.listLocalWorkspacePlugins = listLocalWorkspacePlugins;
const chalk = require("chalk");

@@ -34,3 +35,2 @@ const output_1 = require("../output");

}
exports.getLocalWorkspacePlugins = getLocalWorkspacePlugins;
function listLocalWorkspacePlugins(installedPlugins) {

@@ -59,2 +59,1 @@ const bodyLines = [];

}
exports.listLocalWorkspacePlugins = listLocalWorkspacePlugins;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listPluginCapabilities = exports.getPluginCapabilities = void 0;
exports.getPluginCapabilities = getPluginCapabilities;
exports.listPluginCapabilities = listPluginCapabilities;
const chalk = require("chalk");

@@ -59,3 +60,2 @@ const path_1 = require("path");

}
exports.getPluginCapabilities = getPluginCapabilities;
async function tryGetModule(packageJson, workspaceRoot) {

@@ -118,3 +118,3 @@ try {

bodyLines.push('');
bodyLines.push(...Object.keys(plugin.executors).map((name) => `${chalk.bold(name)} : ${resolveExecutorDescription(plugin.executors[name], projects)}`));
bodyLines.push(...Object.keys(plugin.executors).map((name) => `${chalk.bold(name)} : ${resolveExecutorDescription(pluginName, plugin.executors[name], projects)}`));
}

@@ -132,4 +132,3 @@ if (hasProjectGraphExtension) {

}
exports.listPluginCapabilities = listPluginCapabilities;
function resolveExecutorDescription(executorJsonEntry, projects) {
function resolveExecutorDescription(pluginName, executorJsonEntry, projects, requirePaths = (0, installation_directory_1.getNxRequirePaths)(workspace_root_1.workspaceRoot)) {
try {

@@ -139,4 +138,11 @@ if (typeof executorJsonEntry === 'string') {

const [pkgName, executor] = executorJsonEntry.split(':');
const collection = loadExecutorsCollection(workspace_root_1.workspaceRoot, pkgName, projects);
return resolveExecutorDescription(collection[executor], projects);
// read the package.json of the parent plugin
const { path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(pluginName, projects, requirePaths);
// accumulate the require paths to resolve nested packages
const cummulativeRequirePaths = [
...requirePaths,
(0, path_1.dirname)(packageJsonPath),
];
const collection = loadExecutorsCollection(pkgName, projects, cummulativeRequirePaths);
return resolveExecutorDescription(pkgName, collection[executor], projects, cummulativeRequirePaths);
}

@@ -149,4 +155,4 @@ return executorJsonEntry.description;

}
function loadExecutorsCollection(workspaceRoot, pluginName, projects) {
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(pluginName, projects, (0, installation_directory_1.getNxRequirePaths)(workspaceRoot));
function loadExecutorsCollection(pluginName, projects, requirePaths) {
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(pluginName, projects, requirePaths);
return {

@@ -153,0 +159,0 @@ ...tryGetCollection(packageJsonPath, packageJson.builders, 'builders'),

"use strict";
// Lifted in part from https://github.com/nrwl/angular-console
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasElements = void 0;
exports.hasElements = hasElements;
function hasElements(obj) {
return obj && Object.values(obj).length > 0;
}
exports.hasElements = hasElements;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printHelp = void 0;
exports.printHelp = printHelp;
const chalk = require("chalk");

@@ -39,3 +39,2 @@ const stringWidth = require("string-width");

}
exports.printHelp = printHelp;
function generateOverviewOutput({ pluginName, name, description, mode, aliases, }) {

@@ -42,0 +41,0 @@ switch (mode) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findAllProjectNodeDependencies = exports.getSourceDirOfDependentProjects = exports.projectHasTargetAndConfiguration = exports.projectHasTarget = void 0;
exports.projectHasTarget = projectHasTarget;
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
exports.findAllProjectNodeDependencies = findAllProjectNodeDependencies;
const project_graph_1 = require("../project-graph/project-graph");

@@ -10,3 +13,2 @@ function projectHasTarget(project, target) {

}
exports.projectHasTarget = projectHasTarget;
function projectHasTargetAndConfiguration(project, target, configuration) {

@@ -17,3 +19,2 @@ return (projectHasTarget(project, target) &&

}
exports.projectHasTargetAndConfiguration = projectHasTargetAndConfiguration;
function getSourceDirOfDependentProjects(projectName, projectGraph = (0, project_graph_1.readCachedProjectGraph)()) {

@@ -34,3 +35,2 @@ if (!projectGraph.nodes[projectName]) {

}
exports.getSourceDirOfDependentProjects = getSourceDirOfDependentProjects;
/**

@@ -49,3 +49,2 @@ * Find all internal project dependencies.

}
exports.findAllProjectNodeDependencies = findAllProjectNodeDependencies;
// Recursively get all the dependencies of the node

@@ -52,0 +51,0 @@ function collectDependentProjectNodesNames(nxDeps, dependencyNodeNames, parentNodeName, includeExternalDependencies) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSerializableError = void 0;
exports.createSerializableError = createSerializableError;
/**

@@ -20,3 +20,9 @@ * This function transforms an error into an object which can be properly serialized and deserialized to be sent between processes.

return createSerializableError(v);
// Support for AggregateCreateNodesError
}
else if (Array.isArray(v) &&
v.length === 2 &&
v[1] instanceof Error) {
return [v[0], createSerializableError(v[1])];
}
return v;

@@ -29,2 +35,1 @@ });

}
exports.createSerializableError = createSerializableError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeOverridesIntoCommandLine = void 0;
exports.serializeOverridesIntoCommandLine = serializeOverridesIntoCommandLine;
const flat_1 = require("flat");

@@ -15,3 +15,2 @@ function serializeOverridesIntoCommandLine(options) {

}
exports.serializeOverridesIntoCommandLine = serializeOverridesIntoCommandLine;
function serializeOption(key, value, unparsed) {

@@ -18,0 +17,0 @@ if (value === true) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeTarget = void 0;
exports.serializeTarget = serializeTarget;
function serializeTarget(project, target, configuration) {
return [project, target, configuration].filter((part) => !!part).join(':');
}
exports.serializeTarget = serializeTarget;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitByColons = exports.splitTarget = void 0;
exports.splitTarget = splitTarget;
exports.splitByColons = splitByColons;
function splitTarget(s, projectGraph) {

@@ -12,3 +13,2 @@ let [project, ...segments] = splitByColons(s);

}
exports.splitTarget = splitTarget;
function groupJointSegments(segments, validTargetNames) {

@@ -50,2 +50,1 @@ for (let endingSegmentIdx = segments.length; endingSegmentIdx > 0; endingSegmentIdx--) {

}
exports.splitByColons = splitByColons;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripIndents = void 0;
exports.stripIndents = stripIndents;
/**

@@ -24,2 +24,1 @@ * Removes indents, which is useful for printing warning and messages.

}
exports.stripIndents = stripIndents;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.taskHistoryFile = exports.writeTaskRunsToHistory = exports.getHistoryForHashes = void 0;
exports.taskHistoryFile = void 0;
exports.getHistoryForHashes = getHistoryForHashes;
exports.writeTaskRunsToHistory = writeTaskRunsToHistory;
const fs_1 = require("fs");

@@ -40,3 +42,2 @@ const path_1 = require("path");

}
exports.getHistoryForHashes = getHistoryForHashes;
async function writeTaskRunsToHistory(taskRuns) {

@@ -62,3 +63,2 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.writeTaskRunsToHistory = writeTaskRunsToHistory;
exports.taskHistoryFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'task-history.csv');

@@ -65,0 +65,0 @@ function loadTaskHistoryFromDisk() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateNxw = void 0;
exports.updateNxw = updateNxw;
const add_nx_scripts_1 = require("../command-line/init/implementation/dot-nx/add-nx-scripts");

@@ -12,2 +12,1 @@ const path_1 = require("../utils/path");

}
exports.updateNxw = updateNxw;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workspaceConfigurationCheck = void 0;
exports.workspaceConfigurationCheck = workspaceConfigurationCheck;
const workspace_root_1 = require("./workspace-root");

@@ -37,2 +37,1 @@ const fs_1 = require("fs");

}
exports.workspaceConfigurationCheck = workspaceConfigurationCheck;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resetWorkspaceContext = exports.updateProjectFiles = exports.getFilesInDirectoryUsingContext = exports.getAllFileDataInContext = exports.updateFilesInContext = exports.hashWithWorkspaceContext = exports.globWithWorkspaceContext = exports.globWithWorkspaceContextSync = exports.getNxWorkspaceFilesFromContext = exports.setupWorkspaceContext = void 0;
exports.setupWorkspaceContext = setupWorkspaceContext;
exports.getNxWorkspaceFilesFromContext = getNxWorkspaceFilesFromContext;
exports.globWithWorkspaceContextSync = globWithWorkspaceContextSync;
exports.globWithWorkspaceContext = globWithWorkspaceContext;
exports.hashWithWorkspaceContext = hashWithWorkspaceContext;
exports.updateFilesInContext = updateFilesInContext;
exports.getAllFileDataInContext = getAllFileDataInContext;
exports.getFilesInDirectoryUsingContext = getFilesInDirectoryUsingContext;
exports.updateProjectFiles = updateProjectFiles;
exports.resetWorkspaceContext = resetWorkspaceContext;
const perf_hooks_1 = require("perf_hooks");

@@ -16,3 +25,2 @@ const cache_directory_1 = require("./cache-directory");

}
exports.setupWorkspaceContext = setupWorkspaceContext;
async function getNxWorkspaceFilesFromContext(workspaceRoot, projectRootMap) {

@@ -25,3 +33,2 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.getNxWorkspaceFilesFromContext = getNxWorkspaceFilesFromContext;
/**

@@ -38,3 +45,2 @@ * Sync method to get files matching globs from workspace context.

}
exports.globWithWorkspaceContextSync = globWithWorkspaceContextSync;
async function globWithWorkspaceContext(workspaceRoot, globs, exclude) {

@@ -49,3 +55,2 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.globWithWorkspaceContext = globWithWorkspaceContext;
async function hashWithWorkspaceContext(workspaceRoot, globs, exclude) {

@@ -58,7 +63,5 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.hashWithWorkspaceContext = hashWithWorkspaceContext;
function updateFilesInContext(updatedFiles, deletedFiles) {
return workspaceContext?.incrementalUpdate(updatedFiles, deletedFiles);
}
exports.updateFilesInContext = updateFilesInContext;
async function getAllFileDataInContext(workspaceRoot) {

@@ -71,3 +74,2 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.getAllFileDataInContext = getAllFileDataInContext;
async function getFilesInDirectoryUsingContext(workspaceRoot, dir) {

@@ -80,7 +82,5 @@ if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {

}
exports.getFilesInDirectoryUsingContext = getFilesInDirectoryUsingContext;
function updateProjectFiles(projectRootMappings, rustReferences, updatedFiles, deletedFiles) {
return workspaceContext?.updateProjectFiles(projectRootMappings, rustReferences.projectFiles, rustReferences.globalFiles, updatedFiles, deletedFiles);
}
exports.updateProjectFiles = updateProjectFiles;
function ensureContextAvailable(workspaceRoot) {

@@ -94,2 +94,1 @@ if (!workspaceContext || workspaceContext?.workspaceRoot !== workspaceRoot) {

}
exports.resetWorkspaceContext = resetWorkspaceContext;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workspaceRootInner = exports.setWorkspaceRoot = exports.workspaceRoot = void 0;
exports.workspaceRoot = void 0;
exports.setWorkspaceRoot = setWorkspaceRoot;
exports.workspaceRootInner = workspaceRootInner;
const path = require("path");

@@ -14,3 +16,2 @@ const fileutils_1 = require("./fileutils");

}
exports.setWorkspaceRoot = setWorkspaceRoot;
function workspaceRootInner(dir, candidateRoot) {

@@ -40,2 +41,1 @@ if (process.env.NX_WORKSPACE_ROOT_PATH)

}
exports.workspaceRootInner = workspaceRootInner;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc