Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yarnpkg/core

Package Overview
Dependencies
Maintainers
6
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/core - npm Package Compare versions

Comparing version 4.0.0-rc.51 to 4.0.0-rc.52

21

lib/Configuration.d.ts

@@ -200,9 +200,3 @@ /// <reference types="node" />

};
export declare enum ProjectLookup {
LOCKFILE = 0,
MANIFEST = 1,
NONE = 2
}
export type FindProjectOptions = {
lookup?: ProjectLookup;
strict?: boolean;

@@ -212,2 +206,7 @@ usePathCheck?: PortablePath | null;

};
export type RcFile = {
cwd: PortablePath;
path: PortablePath;
data: any;
};
export declare class Configuration {

@@ -260,3 +259,3 @@ static deleteProperty: symbol;

*/
static find(startingCwd: PortablePath, pluginConfiguration: PluginConfiguration | null, { lookup, strict, usePathCheck, useRc }?: FindProjectOptions): Promise<Configuration>;
static find(startingCwd: PortablePath, pluginConfiguration: PluginConfiguration | null, { strict, usePathCheck, useRc }?: FindProjectOptions): Promise<Configuration>;
static findRcFiles(startingCwd: PortablePath): Promise<{

@@ -267,8 +266,4 @@ path: PortablePath;

}[]>;
static findHomeRcFile(): Promise<{
path: PortablePath;
cwd: PortablePath;
data: any;
} | null>;
static findProjectCwd(startingCwd: PortablePath, lockfileFilename: Filename | null): Promise<PortablePath | null>;
static findFolderRcFile(cwd: PortablePath): Promise<RcFile | null>;
static findProjectCwd(startingCwd: PortablePath): Promise<PortablePath | null>;
static updateConfiguration(cwd: PortablePath, patch: {

@@ -275,0 +270,0 @@ [key: string]: ((current: unknown) => unknown) | {} | undefined;

@@ -15,3 +15,3 @@ import * as execUtils from './execUtils';

export { DEFAULT_RC_FILENAME, LEGACY_PLUGINS, TAG_REGEXP } from './Configuration';
export { Configuration, FormatType, ProjectLookup, SettingsType, WindowsLinkType } from './Configuration';
export { Configuration, FormatType, SettingsType, WindowsLinkType } from './Configuration';
export type { PluginConfiguration, SettingsDefinition, PackageExtensionData } from './Configuration';

@@ -35,3 +35,3 @@ export type { ConfigurationValueMap, ConfigurationDefinitionMap } from './Configuration';

export type { Resolver, ResolveOptions, MinimalResolveOptions } from './Resolver';
export { StreamReport } from './StreamReport';
export { StreamReport, reportOptionDeprecations } from './StreamReport';
export { TelemetryManager } from './TelemetryManager';

@@ -38,0 +38,0 @@ export { ThrowReport } from './ThrowReport';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.treeUtils = exports.tgzUtils = exports.structUtils = exports.semverUtils = exports.scriptUtils = exports.nodeUtils = exports.miscUtils = exports.formatUtils = exports.folderUtils = exports.execUtils = exports.httpUtils = exports.hashUtils = exports.PackageExtensionStatus = exports.PackageExtensionType = exports.LinkType = exports.YarnVersion = exports.Workspace = exports.WorkspaceResolver = exports.WorkspaceFetcher = exports.VirtualFetcher = exports.ThrowReport = exports.TelemetryManager = exports.StreamReport = exports.Report = exports.ReportError = exports.InstallMode = exports.Project = exports.LOCKFILE_VERSION = exports.MultiFetcher = exports.stringifyMessageName = exports.parseMessageName = exports.MessageName = exports.Manifest = exports.LockfileResolver = exports.LightReport = exports.LegacyMigrationResolver = exports.BuildDirectiveType = exports.WindowsLinkType = exports.SettingsType = exports.ProjectLookup = exports.FormatType = exports.Configuration = exports.TAG_REGEXP = exports.LEGACY_PLUGINS = exports.DEFAULT_RC_FILENAME = exports.Cache = exports.CACHE_CHECKPOINT = exports.CACHE_VERSION = void 0;
exports.treeUtils = exports.tgzUtils = exports.structUtils = exports.semverUtils = exports.scriptUtils = exports.nodeUtils = exports.miscUtils = exports.formatUtils = exports.folderUtils = exports.execUtils = exports.httpUtils = exports.hashUtils = exports.PackageExtensionStatus = exports.PackageExtensionType = exports.LinkType = exports.YarnVersion = exports.Workspace = exports.WorkspaceResolver = exports.WorkspaceFetcher = exports.VirtualFetcher = exports.ThrowReport = exports.TelemetryManager = exports.reportOptionDeprecations = exports.StreamReport = exports.Report = exports.ReportError = exports.InstallMode = exports.Project = exports.LOCKFILE_VERSION = exports.MultiFetcher = exports.stringifyMessageName = exports.parseMessageName = exports.MessageName = exports.Manifest = exports.LockfileResolver = exports.LightReport = exports.LegacyMigrationResolver = exports.BuildDirectiveType = exports.WindowsLinkType = exports.SettingsType = exports.FormatType = exports.Configuration = exports.TAG_REGEXP = exports.LEGACY_PLUGINS = exports.DEFAULT_RC_FILENAME = exports.Cache = exports.CACHE_CHECKPOINT = exports.CACHE_VERSION = void 0;
const tslib_1 = require("tslib");

@@ -40,3 +40,2 @@ const execUtils = tslib_1.__importStar(require("./execUtils"));

Object.defineProperty(exports, "FormatType", { enumerable: true, get: function () { return Configuration_2.FormatType; } });
Object.defineProperty(exports, "ProjectLookup", { enumerable: true, get: function () { return Configuration_2.ProjectLookup; } });
Object.defineProperty(exports, "SettingsType", { enumerable: true, get: function () { return Configuration_2.SettingsType; } });

@@ -69,2 +68,3 @@ Object.defineProperty(exports, "WindowsLinkType", { enumerable: true, get: function () { return Configuration_2.WindowsLinkType; } });

Object.defineProperty(exports, "StreamReport", { enumerable: true, get: function () { return StreamReport_1.StreamReport; } });
Object.defineProperty(exports, "reportOptionDeprecations", { enumerable: true, get: function () { return StreamReport_1.reportOptionDeprecations; } });
var TelemetryManager_1 = require("./TelemetryManager");

@@ -71,0 +71,0 @@ Object.defineProperty(exports, "TelemetryManager", { enumerable: true, get: function () { return TelemetryManager_1.TelemetryManager; } });

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

if (typeof data.bin === `string`) {
if (this.name !== null) {
if (data.bin.trim() === ``) {
errors.push(new Error(`Invalid bin field`));
}
else if (this.name !== null) {
this.bin.set(this.name.name, normalizeSlashes(data.bin));

@@ -216,3 +219,3 @@ }

for (const [key, value] of Object.entries(data.bin)) {
if (typeof value !== `string`) {
if (typeof value !== `string` || value.trim() === ``) {
errors.push(new Error(`Invalid bin definition for '${key}'`));

@@ -219,0 +222,0 @@ continue;

export declare const openUrl: ((url: string) => Promise<boolean>) | undefined;
export declare function builtinModules(): Set<string>;
export type Architecture = {

@@ -4,0 +3,0 @@ os: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.availableParallelism = exports.getCaller = exports.getArchitectureSet = exports.getArchitectureName = exports.getArchitecture = exports.builtinModules = exports.openUrl = void 0;
exports.availableParallelism = exports.getCaller = exports.getArchitectureSet = exports.getArchitectureName = exports.getArchitecture = exports.openUrl = void 0;
const tslib_1 = require("tslib");
const fslib_1 = require("@yarnpkg/fslib");
const module_1 = tslib_1.__importDefault(require("module"));
const os_1 = tslib_1.__importDefault(require("os"));

@@ -26,11 +25,6 @@ const execUtils = tslib_1.__importStar(require("./execUtils"));

: undefined;
function builtinModules() {
// @ts-expect-error
return new Set(module_1.default.builtinModules || Object.keys(process.binding(`natives`)));
}
exports.builtinModules = builtinModules;
function getLibc() {
// It seems that Node randomly crashes with no output under some circumstances when running a getReport() on Windows.
// Since Windows has no libc anyway, shortcut this path.
if (process.platform === `win32`)
// Darwin and Windows have their own standard libraries, and the getReport() call is costly.
// It also seems that Node randomly crashes with no output under some circumstances when running a getReport() on Windows.
if (process.platform === `darwin` || process.platform === `win32`)
return null;

@@ -37,0 +31,0 @@ const report = process.report?.getReport() ?? {};

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

await project.configuration.triggerHook(hook => hook.setupScriptEnvironment, project, scriptEnv, async (name, argv0, args) => {
return await makePathWrapper(binFolder, (0, fslib_2.toFilename)(name), argv0, args);
return await makePathWrapper(binFolder, name, argv0, args);
});

@@ -572,4 +572,4 @@ }

return isScript
? makePathWrapper(target, (0, fslib_2.toFilename)(binaryName), process.execPath, [binaryPath])
: makePathWrapper(target, (0, fslib_2.toFilename)(binaryName), binaryPath, []);
? makePathWrapper(target, binaryName, process.execPath, [binaryPath])
: makePathWrapper(target, binaryName, binaryPath, []);
}));

@@ -576,0 +576,0 @@ }

@@ -29,2 +29,15 @@ /// <reference types="node" />

}): string;
/**
* @internal
*/
export declare function reportOptionDeprecations({ configuration, stdout, forceError }: {
configuration: Configuration;
stdout: Writable;
forceError?: boolean;
}, checks: Array<{
option: unknown;
message: string;
error?: boolean;
callback?: () => void;
}>): Promise<0 | 1 | null>;
export declare class StreamReport extends Report {

@@ -31,0 +44,0 @@ static start(opts: StreamReportOptions, cb: (report: StreamReport) => Promise<void>): Promise<StreamReport>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamReport = exports.formatNameWithHyperlink = exports.formatName = exports.SUPPORTS_GROUPS = exports.SINGLE_LINE_CHAR = void 0;
exports.StreamReport = exports.reportOptionDeprecations = exports.formatNameWithHyperlink = exports.formatName = exports.SUPPORTS_GROUPS = exports.SINGLE_LINE_CHAR = void 0;
const tslib_1 = require("tslib");

@@ -85,2 +85,38 @@ const slice_ansi_1 = tslib_1.__importDefault(require("@arcanis/slice-ansi"));

exports.formatNameWithHyperlink = formatNameWithHyperlink;
/**
* @internal
*/
async function reportOptionDeprecations({ configuration, stdout, forceError }, checks) {
const deprecationReport = await StreamReport.start({
configuration,
stdout,
includeFooter: false,
}, async (report) => {
let hasWarnings = false;
let hasErrors = false;
for (const check of checks) {
if (typeof check.option !== `undefined`) {
if (check.error || forceError) {
hasErrors = true;
report.reportError(MessageName_1.MessageName.DEPRECATED_CLI_SETTINGS, check.message);
}
else {
hasWarnings = true;
report.reportWarning(MessageName_1.MessageName.DEPRECATED_CLI_SETTINGS, check.message);
}
check.callback?.();
}
}
if (hasWarnings && !hasErrors) {
report.reportSeparator();
}
});
if (deprecationReport.hasErrors()) {
return deprecationReport.exitCode();
}
else {
return null;
}
}
exports.reportOptionDeprecations = reportOptionDeprecations;
class StreamReport extends Report_1.Report {

@@ -87,0 +123,0 @@ static async start(opts, cb) {

/// <reference types="node" />
import { PortablePath } from '@yarnpkg/fslib';
import { Filename, PortablePath } from '@yarnpkg/fslib';
import querystring from 'querystring';

@@ -326,3 +326,3 @@ import { Configuration } from './Configuration';

*/
export declare function slugifyLocator(locator: Locator): import("@yarnpkg/fslib").Filename;
export declare function slugifyLocator(locator: Locator): Filename;
/**

@@ -329,0 +329,0 @@ * Returns a string that is suitable to be printed to stdout. Based on the

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

const tslib_1 = require("tslib");
const fslib_1 = require("@yarnpkg/fslib");
const querystring_1 = tslib_1.__importDefault(require("querystring"));

@@ -17,4 +16,4 @@ const semver_1 = tslib_1.__importDefault(require("semver"));

const VIRTUAL_ABBREVIATE = 5;
const conditionRegex = /(os|cpu|libc)=([a-z0-9_-]+)/;
const conditionParser = (0, tinylogic_1.makeParser)(conditionRegex);
const CONDITION_REGEX = /(os|cpu|libc)=([a-z0-9_-]+)/;
const conditionParser = (0, tinylogic_1.makeParser)(CONDITION_REGEX);
/**

@@ -177,2 +176,3 @@ * Creates a package ident.

exports.isVirtualLocator = isVirtualLocator;
const VIRTUAL_PREFIX_REGEXP = /^[^#]*#/;
/**

@@ -184,3 +184,3 @@ * Returns a new devirtualized descriptor based on a virtualized descriptor

throw new Error(`Not a virtual descriptor`);
return makeDescriptor(descriptor, descriptor.range.replace(/^[^#]*#/, ``));
return makeDescriptor(descriptor, descriptor.range.replace(VIRTUAL_PREFIX_REGEXP, ``));
}

@@ -195,3 +195,3 @@ exports.devirtualizeDescriptor = devirtualizeDescriptor;

throw new Error(`Not a virtual descriptor`);
return makeLocator(locator, locator.reference.replace(/^[^#]*#/, ``));
return makeLocator(locator, locator.reference.replace(VIRTUAL_PREFIX_REGEXP, ``));
}

@@ -205,3 +205,3 @@ exports.devirtualizeLocator = devirtualizeLocator;

return descriptor;
return makeDescriptor(descriptor, descriptor.range.replace(/^[^#]*#/, ``));
return makeDescriptor(descriptor, descriptor.range.replace(VIRTUAL_PREFIX_REGEXP, ``));
}

@@ -216,3 +216,3 @@ exports.ensureDevirtualizedDescriptor = ensureDevirtualizedDescriptor;

return locator;
return makeLocator(locator, locator.reference.replace(/^[^#]*#/, ``));
return makeLocator(locator, locator.reference.replace(VIRTUAL_PREFIX_REGEXP, ``));
}

@@ -320,2 +320,3 @@ exports.ensureDevirtualizedLocator = ensureDevirtualizedLocator;

exports.parseIdent = parseIdent;
const IDENT_REGEXP = /^(?:@([^/]+?)\/)?([^@/]+)$/;
/**

@@ -329,3 +330,3 @@ * Parses a string into an ident.

function tryParseIdent(string) {
const match = string.match(/^(?:@([^/]+?)\/)?([^@/]+)$/);
const match = string.match(IDENT_REGEXP);
if (!match)

@@ -355,2 +356,4 @@ return null;

exports.parseDescriptor = parseDescriptor;
const DESCRIPTOR_REGEX_STRICT = /^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/;
const DESCRIPTOR_REGEX_LOOSE = /^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/;
/**

@@ -366,4 +369,4 @@ * Parses a `string` into a descriptor

const match = strict
? string.match(/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/)
: string.match(/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/);
? string.match(DESCRIPTOR_REGEX_STRICT)
: string.match(DESCRIPTOR_REGEX_LOOSE);
if (!match)

@@ -398,2 +401,4 @@ return null;

exports.parseLocator = parseLocator;
const LOCATOR_REGEX_STRICT = /^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/;
const LOCATOR_REGEX_LOOSE = /^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/;
/**

@@ -409,4 +414,4 @@ * Parses a `string` into a locator

const match = strict
? string.match(/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/)
: string.match(/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/);
? string.match(LOCATOR_REGEX_STRICT)
: string.match(LOCATOR_REGEX_LOOSE);
if (!match)

@@ -426,2 +431,3 @@ return null;

exports.tryParseLocator = tryParseLocator;
const RANGE_REGEX = /^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/;
/**

@@ -439,3 +445,3 @@ * Parses a range into its constituents. Ranges typically follow these forms,

function parseRange(range, opts) {
const match = range.match(/^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/);
const match = range.match(RANGE_REGEX);
if (match === null)

@@ -515,5 +521,5 @@ throw new Error(`Invalid range (${range})`);

function encodeUnsafeCharacters(str) {
str = str.replace(/%/g, `%25`);
str = str.replace(/:/g, `%3A`);
str = str.replace(/#/g, `%23`);
str = str.replaceAll(`%`, `%25`);
str = str.replaceAll(`:`, `%3A`);
str = str.replaceAll(`#`, `%23`);
return str;

@@ -604,2 +610,3 @@ }

exports.slugifyIdent = slugifyIdent;
const TRAILING_COLON_REGEX = /:$/;
/**

@@ -611,3 +618,3 @@ * Returns a string from a locator, formatted as a slug (eg. `@types-lodash-npm-1.0.0-abcdef1234`).

const humanProtocol = protocol !== null
? protocol.replace(/:$/, ``)
? protocol.replace(TRAILING_COLON_REGEX, ``)
: `exotic`;

@@ -630,3 +637,3 @@ const humanVersion = semver_1.default.valid(selector);

: `${slugifyIdent(locator)}-${humanReference}-${locator.locatorHash.slice(0, hashTruncate)}`;
return (0, fslib_1.toFilename)(slug);
return slug;
}

@@ -650,2 +657,3 @@ exports.slugifyLocator = slugifyLocator;

exports.prettyIdent = prettyIdent;
const POST_QS_REGEX = /\?.*/;
function prettyRangeNoColors(range) {

@@ -660,3 +668,3 @@ if (range.startsWith(VIRTUAL_PROTOCOL)) {

else {
return range.replace(/\?.*/, `?[...]`);
return range.replace(POST_QS_REGEX, `?[...]`);
}

@@ -801,3 +809,3 @@ }

return conditionParser(pkg.conditions, specifier => {
const [, name, value] = specifier.match(conditionRegex);
const [, name, value] = specifier.match(CONDITION_REGEX);
const supported = architectures[name];

@@ -804,0 +812,0 @@ return supported ? supported.includes(value) : true;

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

finalParts.push(formatUtils.applyStyle(configuration, `${key}`, formatUtils.Style.BOLD));
const finalLabel = finalParts.join(`: `);
const finalLabel = finalParts.join(`: `).trim();
// The library we use, treeify, doesn't support having multiple nodes with

@@ -92,3 +92,3 @@ // the same label. To work around that, we prefix each label with a unique

for (let t = 0; t < 2; ++t)
treeOutput = treeOutput.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm, `$1$3 │\n$2`).replace(/^│\n/, ``);
treeOutput = treeOutput.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm, `$1$3 │ (\\n)?\n$2`).replace(/^│\n/, ``);
if (separators >= 3)

@@ -95,0 +95,0 @@ throw new Error(`Only the first two levels are accepted by treeUtils.emitTree`);

{
"name": "@yarnpkg/core",
"version": "4.0.0-rc.51",
"version": "4.0.0-rc.52",
"stableVersion": "3.5.3",

@@ -16,6 +16,6 @@ "license": "BSD-2-Clause",

"@types/treeify": "^1.0.0",
"@yarnpkg/fslib": "^3.0.0-rc.51",
"@yarnpkg/libzip": "^3.0.0-rc.51",
"@yarnpkg/parsers": "^3.0.0-rc.51",
"@yarnpkg/shell": "^4.0.0-rc.51",
"@yarnpkg/fslib": "^3.0.0-rc.52",
"@yarnpkg/libzip": "^3.0.0-rc.52",
"@yarnpkg/parsers": "^3.0.0-rc.52",
"@yarnpkg/shell": "^4.0.0-rc.52",
"camelcase": "^5.3.1",

@@ -53,6 +53,6 @@ "chalk": "^3.0.0",

"@types/tunnel": "^0.0.0",
"@yarnpkg/cli": "^4.0.0-rc.51",
"@yarnpkg/plugin-link": "^3.0.0-rc.51",
"@yarnpkg/plugin-npm": "^3.0.0-rc.51",
"@yarnpkg/plugin-pnp": "^4.0.0-rc.51",
"@yarnpkg/cli": "^4.0.0-rc.52",
"@yarnpkg/plugin-link": "^3.0.0-rc.52",
"@yarnpkg/plugin-npm": "^3.0.0-rc.52",
"@yarnpkg/plugin-pnp": "^4.0.0-rc.52",
"comment-json": "^2.2.0",

@@ -59,0 +59,0 @@ "esbuild": "npm:esbuild-wasm@^0.15.15",

Sorry, the diff of this file is too big to display

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