Socket
Socket
Sign inDemoInstall

nx

Package Overview
Dependencies
Maintainers
8
Versions
1371
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 19.6.3 to 19.6.4

24

package.json
{
"name": "nx",
"version": "19.6.3",
"version": "19.6.4",
"private": false,

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

"ora": "5.3.0",
"@nrwl/tao": "19.6.3"
"@nrwl/tao": "19.6.4"
},

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

"optionalDependencies": {
"@nx/nx-darwin-x64": "19.6.3",
"@nx/nx-darwin-arm64": "19.6.3",
"@nx/nx-linux-x64-gnu": "19.6.3",
"@nx/nx-linux-x64-musl": "19.6.3",
"@nx/nx-win32-x64-msvc": "19.6.3",
"@nx/nx-linux-arm64-gnu": "19.6.3",
"@nx/nx-linux-arm64-musl": "19.6.3",
"@nx/nx-linux-arm-gnueabihf": "19.6.3",
"@nx/nx-win32-arm64-msvc": "19.6.3",
"@nx/nx-freebsd-x64": "19.6.3"
"@nx/nx-darwin-x64": "19.6.4",
"@nx/nx-darwin-arm64": "19.6.4",
"@nx/nx-linux-x64-gnu": "19.6.4",
"@nx/nx-linux-x64-musl": "19.6.4",
"@nx/nx-win32-x64-msvc": "19.6.4",
"@nx/nx-linux-arm64-gnu": "19.6.4",
"@nx/nx-linux-arm64-musl": "19.6.4",
"@nx/nx-linux-arm-gnueabihf": "19.6.4",
"@nx/nx-win32-arm64-msvc": "19.6.4",
"@nx/nx-freebsd-x64": "19.6.4"
},

@@ -102,0 +102,0 @@ "nx-migrations": {

@@ -678,4 +678,6 @@ "use strict";

inputs.forEach((input) => {
if (input.startsWith('{workspaceRoot}')) {
workspaceRootInputs.push(input);
// grouped workspace inputs look like workspace:[pattern,otherPattern]
if (input.startsWith('workspace:[')) {
const inputs = input.substring(11, input.length - 1).split(',');
workspaceRootInputs.push(...inputs);
return;

@@ -700,18 +702,3 @@ }

});
const workspaceRootsExpanded = workspaceRootInputs.flatMap((input) => {
const matches = [];
const withoutWorkspaceRoot = input.substring(16);
const matchingFile = allWorkspaceFiles.find((t) => t.file === withoutWorkspaceRoot);
if (matchingFile) {
matches.push(matchingFile.file);
}
else {
allWorkspaceFiles
.filter((f) => (0, minimatch_1.minimatch)(f.file, withoutWorkspaceRoot))
.forEach((f) => {
matches.push(f.file);
});
}
return matches;
});
const workspaceRootsExpanded = getExpandedWorkspaceRoots(workspaceRootInputs, allWorkspaceFiles);
const otherInputsExpanded = otherInputs.map((input) => {

@@ -749,2 +736,32 @@ if (input === 'TsConfig') {

}
function getExpandedWorkspaceRoots(workspaceRootInputs, allWorkspaceFiles) {
const workspaceRootsExpanded = [];
const negativeWRPatterns = [];
const positiveWRPatterns = [];
for (const fileset of workspaceRootInputs) {
if (fileset.startsWith('!')) {
negativeWRPatterns.push(fileset.substring(17));
}
else {
positiveWRPatterns.push(fileset.substring(16));
}
}
for (const pattern of positiveWRPatterns) {
const matchingFile = allWorkspaceFiles.find((t) => t.file === pattern);
if (matchingFile &&
!negativeWRPatterns.some((p) => (0, minimatch_1.minimatch)(matchingFile.file, p))) {
workspaceRootsExpanded.push(matchingFile.file);
}
else {
allWorkspaceFiles
.filter((f) => (0, minimatch_1.minimatch)(f.file, pattern) &&
!negativeWRPatterns.some((p) => (0, minimatch_1.minimatch)(f.file, p)))
.forEach((f) => {
workspaceRootsExpanded.push(f.file);
});
}
}
workspaceRootsExpanded.sort();
return workspaceRootsExpanded;
}
async function createJsonOutput(prunedGraph, rawGraph, projects, targets) {

@@ -751,0 +768,0 @@ const response = {

@@ -13,17 +13,19 @@ import type { NxReleaseConfiguration } from '../../config/nx-json';

}
declare const defaultClient: ReleaseClient;
/**
* @public
*/
export declare const releaseChangelog: any;
export declare const releaseChangelog: typeof defaultClient.releaseChangelog;
/**
* @public
*/
export declare const releasePublish: any;
export declare const releasePublish: typeof defaultClient.releasePublish;
/**
* @public
*/
export declare const releaseVersion: any;
export declare const releaseVersion: typeof defaultClient.releaseVersion;
/**
* @public
*/
export declare const release: any;
export declare const release: typeof defaultClient.release;
export {};

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

(0, task_env_1.unloadDotEnvFile)(path, env);
const result = (0, task_env_1.loadAndExpandDotEnvFile)(path, env);
const result = (0, task_env_1.loadAndExpandDotEnvFile)(path, env, true);
if (result.error) {

@@ -297,10 +297,15 @@ throw result.error;

const localEnv = (0, npm_run_path_1.env)({ cwd: cwd ?? process.cwd() });
const res = {
let res = {
...process.env,
...localEnv,
...env,
};
// env file from envFile option takes priority over process env
if (process.env.NX_LOAD_DOT_ENV_FILES !== 'false') {
loadEnvVars(envFile, res);
}
// env variables from env option takes priority over everything else
res = {
...res,
...env,
};
// need to override PATH to make sure we are using the local node_modules

@@ -307,0 +312,0 @@ if (localEnv.PATH)

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

private hashProjectInputs;
private hashRootFileset;
private hashRootFilesets;
private hashProjectConfig;

@@ -44,0 +44,0 @@ private hashTsConfig;

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

this.hashTsConfig(projectName),
...[
...workspaceFilesets,
...this.legacyFilesetInputs.map((r) => r.fileset),
].map((fileset) => this.hashRootFileset(fileset)),
...(workspaceFilesets.length
? [this.hashRootFilesets(workspaceFilesets)]
: []),
this.hashRootFilesets(this.legacyFilesetInputs.map((r) => r.fileset)),
...[...notFilesets, ...this.legacyRuntimeInputs].map((r) => r['runtime']

@@ -324,18 +324,36 @@ ? this.hashRuntime(env, r['runtime'])

}
async hashRootFileset(fileset) {
const mapKey = fileset;
const withoutWorkspaceRoot = fileset.substring(16);
async hashRootFilesets(filesets) {
const mapKey = `workspace:[${filesets.join(',')}]`;
if (!this.filesetHashes[mapKey]) {
this.filesetHashes[mapKey] = new Promise(async (res) => {
const parts = [];
const matchingFile = this.allWorkspaceFiles.find((t) => t.file === withoutWorkspaceRoot);
if (matchingFile) {
parts.push(matchingFile.hash);
const negativePatterns = [];
const positivePatterns = [];
for (const fileset of filesets) {
if (fileset.startsWith('!')) {
negativePatterns.push(fileset.substring(17));
}
else {
positivePatterns.push(fileset.substring(16));
}
}
else {
this.allWorkspaceFiles
.filter((f) => (0, minimatch_1.minimatch)(f.file, withoutWorkspaceRoot))
.forEach((f) => {
parts.push(f.hash);
});
for (const fileset of positivePatterns) {
const withoutWorkspaceRoot = fileset;
// Used to shortcut minimatch if not necessary
const matchingFile = this.allWorkspaceFiles.find((t) => t.file === withoutWorkspaceRoot);
// shortcut because there is a direct match
if (matchingFile) {
if (!negativePatterns.some((p) => (0, minimatch_1.minimatch)(matchingFile.file, p))) {
parts.push(matchingFile.hash);
}
// No direct match, check if pattern matched
}
else {
this.allWorkspaceFiles
.filter((f) => (0, minimatch_1.minimatch)(f.file, withoutWorkspaceRoot) &&
!negativePatterns.some((p) => (0, minimatch_1.minimatch)(f.file, p)))
.forEach((f) => {
parts.push(f.hash);
});
}
}

@@ -342,0 +360,0 @@ const value = (0, file_hasher_1.hashArray)(parts);

@@ -21,2 +21,9 @@ "use strict";

...node_module_1.builtinModules.map((x) => `node:${x}`),
// These are missing in the builtinModules list
// See: https://github.com/nodejs/node/issues/42785
// TODO(v20): We should be safe to use `isBuiltin` function instead of keep the set here (https://nodejs.org/api/module.html#moduleisbuiltinmodulename)
'test',
'node:test',
'node:sea',
'node:sqlite',
]);

@@ -269,3 +276,3 @@ function isBuiltinModuleImport(importExpr) {

let dir = (0, node_path_1.dirname)(pathOfFileInPackage);
while (dir !== (0, node_path_1.parse)(dir).root) {
while (dir !== (0, node_path_1.dirname)(dir)) {
const packageJsonPath = (0, node_path_1.join)(dir, 'package.json');

@@ -272,0 +279,0 @@ try {

@@ -26,5 +26,5 @@ "use strict";

async function runAllTasks(tasks, options, context) {
const orchestrator = new task_orchestrator_1.TaskOrchestrator(context.hasher, context.initiatingProject, context.projectGraph, context.taskGraph, options, context.nxArgs?.nxBail, context.daemon);
const orchestrator = new task_orchestrator_1.TaskOrchestrator(context.hasher, context.initiatingProject, context.projectGraph, context.taskGraph, options, context.nxArgs?.nxBail, context.daemon, context.nxArgs?.outputStyle);
return orchestrator.run();
}
exports.default = exports.defaultTasksRunner;
import { NxArgs } from '../utils/command-line-utils';
import { Task, TaskGraph } from '../config/task-graph';
import { TaskResult } from './life-cycle';
export declare function initTasksRunner(nxArgs: NxArgs): Promise<{

@@ -10,3 +11,4 @@ invoke: (opts: {

taskGraph: TaskGraph;
taskResults: Record<string, TaskResult>;
}>;
}>;

@@ -55,2 +55,3 @@ "use strict";

taskGraph,
taskResults: lifeCycle.getTaskResults(),
};

@@ -57,0 +58,0 @@ },

import { TaskStatus } from '../tasks-runner';
import type { LifeCycle } from '../life-cycle';
import type { LifeCycle, TaskResult } from '../life-cycle';
import { Task } from '../../config/task-graph';

@@ -8,11 +8,9 @@ export declare class InvokeRunnerTerminalOutputLifeCycle implements LifeCycle {

cachedTasks: Task[];
private taskResults;
constructor(tasks: Task[]);
startCommand(): void;
endCommand(): void;
endTasks(taskResults: {
task: Task;
status: TaskStatus;
code: number;
}[]): void;
endTasks(taskResults: TaskResult[]): void;
printTaskTerminalOutput(task: Task, cacheStatus: TaskStatus, terminalOutput: string): void;
getTaskResults(): Record<string, TaskResult>;
}

@@ -11,2 +11,3 @@ "use strict";

this.cachedTasks = [];
this.taskResults = {};
}

@@ -49,2 +50,3 @@ startCommand() {

for (let t of taskResults) {
this.taskResults[t.task.id] = t;
if (t.status === 'failure') {

@@ -68,3 +70,6 @@ this.failedTasks.push(t.task);

}
getTaskResults() {
return this.taskResults;
}
}
exports.InvokeRunnerTerminalOutputLifeCycle = InvokeRunnerTerminalOutputLifeCycle;

@@ -10,5 +10,5 @@ import { Task } from '../config/task-graph';

* This function loads a .env file and expands the variables in it.
* It is going to override existing environmentVariables.
* @param filename
* @param environmentVariables
* @param filename the .env file to load
* @param environmentVariables the object to load environment variables into
* @param override whether to override existing environment variables
*/

@@ -15,0 +15,0 @@ export declare function loadAndExpandDotEnvFile(filename: string, environmentVariables: NodeJS.ProcessEnv, override?: boolean): import("dotenv-expand").DotenvExpandOutput;

@@ -82,5 +82,5 @@ "use strict";

* This function loads a .env file and expands the variables in it.
* It is going to override existing environmentVariables.
* @param filename
* @param environmentVariables
* @param filename the .env file to load
* @param environmentVariables the object to load environment variables into
* @param override whether to override existing environment variables
*/

@@ -87,0 +87,0 @@ function loadAndExpandDotEnvFile(filename, environmentVariables, override = false) {

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

private readonly daemon;
private readonly outputStyle;
private cache;

@@ -27,3 +28,3 @@ private forkedProcessTaskRunner;

private bailed;
constructor(hasher: TaskHasher, initiatingProject: string | undefined, projectGraph: ProjectGraph, taskGraph: TaskGraph, options: DefaultTasksRunnerOptions, bail: boolean, daemon: DaemonClient);
constructor(hasher: TaskHasher, initiatingProject: string | undefined, projectGraph: ProjectGraph, taskGraph: TaskGraph, options: DefaultTasksRunnerOptions, bail: boolean, daemon: DaemonClient, outputStyle: string);
run(): Promise<{

@@ -30,0 +31,0 @@ [id: string]: TaskStatus;

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

// endregion internal state
constructor(hasher, initiatingProject, projectGraph, taskGraph, options, bail, daemon) {
constructor(hasher, initiatingProject, projectGraph, taskGraph, options, bail, daemon, outputStyle) {
this.hasher = hasher;

@@ -29,2 +29,3 @@ this.initiatingProject = initiatingProject;

this.daemon = daemon;
this.outputStyle = outputStyle;
this.cache = new cache_1.Cache(this.options);

@@ -205,3 +206,5 @@ this.forkedProcessTaskRunner = new forked_process_task_runner_1.ForkedProcessTaskRunner(this.options);

const temporaryOutputPath = this.cache.temporaryOutputPath(task);
const streamOutput = (0, utils_1.shouldStreamOutput)(task, this.initiatingProject);
const streamOutput = this.outputStyle === 'static'
? false
: (0, utils_1.shouldStreamOutput)(task, this.initiatingProject);
let env = pipeOutput

@@ -208,0 +211,0 @@ ? (0, task_env_1.getEnvVariablesForTask)(task, taskSpecificEnv, process.env.FORCE_COLOR === undefined

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