@yarnpkg/plugin-essentials 3.1.0-rc.1 → 3.1.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/add.d.ts +2 -1
- package/lib/commands/add.js +4 -3
- package/lib/commands/bin.d.ts +1 -1
- package/lib/commands/cache/clean.d.ts +1 -1
- package/lib/commands/config/get.d.ts +1 -1
- package/lib/commands/config/get.js +3 -3
- package/lib/commands/config/set.d.ts +1 -1
- package/lib/commands/config/set.js +7 -7
- package/lib/commands/config/unset.d.ts +1 -1
- package/lib/commands/config/unset.js +6 -6
- package/lib/commands/config.d.ts +1 -1
- package/lib/commands/config.js +2 -2
- package/lib/commands/dedupe.d.ts +1 -1
- package/lib/commands/dedupe.js +2 -2
- package/lib/commands/entries/help.d.ts +1 -1
- package/lib/commands/explain/peerRequirements.d.ts +2 -2
- package/lib/commands/explain/peerRequirements.js +1 -1
- package/lib/commands/info.js +8 -4
- package/lib/commands/install.d.ts +2 -1
- package/lib/commands/install.js +14 -14
- package/lib/commands/link.d.ts +1 -1
- package/lib/commands/plugin/import/sources.d.ts +1 -1
- package/lib/commands/plugin/import/sources.js +5 -5
- package/lib/commands/plugin/import.d.ts +1 -1
- package/lib/commands/plugin/import.js +4 -4
- package/lib/commands/plugin/list.d.ts +1 -1
- package/lib/commands/plugin/list.js +1 -1
- package/lib/commands/plugin/remove.d.ts +1 -1
- package/lib/commands/plugin/runtime.d.ts +1 -1
- package/lib/commands/rebuild.d.ts +1 -1
- package/lib/commands/remove.d.ts +1 -1
- package/lib/commands/remove.js +5 -5
- package/lib/commands/runIndex.d.ts +1 -1
- package/lib/commands/runIndex.js +1 -1
- package/lib/commands/set/resolution.d.ts +1 -1
- package/lib/commands/set/version/sources.d.ts +1 -1
- package/lib/commands/set/version/sources.js +4 -4
- package/lib/commands/set/version.d.ts +1 -1
- package/lib/commands/set/version.js +1 -1
- package/lib/commands/unlink.d.ts +1 -1
- package/lib/commands/unlink.js +2 -2
- package/lib/commands/up.d.ts +3 -3
- package/lib/commands/up.js +6 -6
- package/lib/commands/workspace.d.ts +2 -2
- package/lib/commands/workspaces/list.d.ts +3 -1
- package/lib/commands/workspaces/list.js +24 -2
- package/lib/dedupeUtils.js +4 -1
- package/lib/index.js +37 -37
- package/lib/suggestUtils.js +2 -2
- package/package.json +10 -9
package/lib/commands/add.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class AddCommand extends BaseCommand {
|
|
|
15
15
|
interactive: boolean | undefined;
|
|
16
16
|
cached: boolean;
|
|
17
17
|
mode: InstallMode | undefined;
|
|
18
|
+
silent: boolean | undefined;
|
|
18
19
|
packages: string[];
|
|
19
|
-
execute(): Promise<
|
|
20
|
+
execute(): Promise<1 | 0>;
|
|
20
21
|
}
|
package/lib/commands/add.js
CHANGED
|
@@ -7,8 +7,8 @@ const core_2 = require("@yarnpkg/core");
|
|
|
7
7
|
const core_3 = require("@yarnpkg/core");
|
|
8
8
|
const clipanion_1 = require("clipanion");
|
|
9
9
|
const enquirer_1 = require("enquirer");
|
|
10
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
11
|
-
const suggestUtils = tslib_1.__importStar(require("../suggestUtils"));
|
|
10
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
11
|
+
const suggestUtils = (0, tslib_1.__importStar)(require("../suggestUtils"));
|
|
12
12
|
// eslint-disable-next-line arca/no-default-export
|
|
13
13
|
class AddCommand extends cli_1.BaseCommand {
|
|
14
14
|
constructor() {
|
|
@@ -47,6 +47,7 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
47
47
|
description: `Change what artifacts installs generate`,
|
|
48
48
|
validator: t.isEnum(core_2.InstallMode),
|
|
49
49
|
});
|
|
50
|
+
this.silent = clipanion_1.Option.Boolean(`--silent`, { hidden: true });
|
|
50
51
|
this.packages = clipanion_1.Option.Rest();
|
|
51
52
|
}
|
|
52
53
|
async execute() {
|
|
@@ -126,7 +127,7 @@ class AddCommand extends cli_1.BaseCommand {
|
|
|
126
127
|
}
|
|
127
128
|
else {
|
|
128
129
|
askedQuestions = true;
|
|
129
|
-
({ answer: selected } = await enquirer_1.prompt({
|
|
130
|
+
({ answer: selected } = await (0, enquirer_1.prompt)({
|
|
130
131
|
type: `select`,
|
|
131
132
|
name: `answer`,
|
|
132
133
|
message: `Which range do you want to use?`,
|
package/lib/commands/bin.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const cli_1 = require("@yarnpkg/cli");
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const clipanion_1 = require("clipanion");
|
|
7
|
-
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
7
|
+
const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
|
|
8
8
|
const util_1 = require("util");
|
|
9
9
|
// eslint-disable-next-line arca/no-default-export
|
|
10
10
|
class ConfigGetCommand extends cli_1.BaseCommand {
|
|
@@ -31,7 +31,7 @@ class ConfigGetCommand extends cli_1.BaseCommand {
|
|
|
31
31
|
});
|
|
32
32
|
const asObject = core_1.miscUtils.convertMapsToIndexableObjects(displayedValue);
|
|
33
33
|
const requestedObject = path
|
|
34
|
-
? get_1.default(asObject, path)
|
|
34
|
+
? (0, get_1.default)(asObject, path)
|
|
35
35
|
: asObject;
|
|
36
36
|
const report = await core_1.StreamReport.start({
|
|
37
37
|
configuration,
|
|
@@ -48,7 +48,7 @@ class ConfigGetCommand extends cli_1.BaseCommand {
|
|
|
48
48
|
}
|
|
49
49
|
// @ts-expect-error: The Node typings forgot one field
|
|
50
50
|
util_1.inspect.styles.name = `cyan`;
|
|
51
|
-
this.context.stdout.write(`${util_1.inspect(requestedObject, {
|
|
51
|
+
this.context.stdout.write(`${(0, util_1.inspect)(requestedObject, {
|
|
52
52
|
depth: Infinity,
|
|
53
53
|
colors: configuration.get(`enableColors`),
|
|
54
54
|
compact: false,
|
|
@@ -4,9 +4,9 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const cli_1 = require("@yarnpkg/cli");
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const clipanion_1 = require("clipanion");
|
|
7
|
-
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
8
|
-
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
9
|
-
const set_1 = tslib_1.__importDefault(require("lodash/set"));
|
|
7
|
+
const cloneDeep_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeep"));
|
|
8
|
+
const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
|
|
9
|
+
const set_1 = (0, tslib_1.__importDefault)(require("lodash/set"));
|
|
10
10
|
const util_1 = require("util");
|
|
11
11
|
// eslint-disable-next-line arca/no-default-export
|
|
12
12
|
class ConfigSetCommand extends cli_1.BaseCommand {
|
|
@@ -43,8 +43,8 @@ class ConfigSetCommand extends cli_1.BaseCommand {
|
|
|
43
43
|
: patch => core_1.Configuration.updateConfiguration(assertProjectCwd(), patch);
|
|
44
44
|
await updateConfiguration(current => {
|
|
45
45
|
if (path) {
|
|
46
|
-
const clone = cloneDeep_1.default(current);
|
|
47
|
-
set_1.default(clone, this.name, value);
|
|
46
|
+
const clone = (0, cloneDeep_1.default)(current);
|
|
47
|
+
(0, set_1.default)(clone, this.name, value);
|
|
48
48
|
return clone;
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
@@ -61,7 +61,7 @@ class ConfigSetCommand extends cli_1.BaseCommand {
|
|
|
61
61
|
});
|
|
62
62
|
const asObject = core_1.miscUtils.convertMapsToIndexableObjects(displayedValue);
|
|
63
63
|
const requestedObject = path
|
|
64
|
-
? get_1.default(asObject, path)
|
|
64
|
+
? (0, get_1.default)(asObject, path)
|
|
65
65
|
: asObject;
|
|
66
66
|
const report = await core_1.StreamReport.start({
|
|
67
67
|
configuration,
|
|
@@ -70,7 +70,7 @@ class ConfigSetCommand extends cli_1.BaseCommand {
|
|
|
70
70
|
}, async (report) => {
|
|
71
71
|
// @ts-expect-error: The Node typings forgot one field
|
|
72
72
|
util_1.inspect.styles.name = `cyan`;
|
|
73
|
-
report.reportInfo(core_1.MessageName.UNNAMED, `Successfully set ${this.name} to ${util_1.inspect(requestedObject, {
|
|
73
|
+
report.reportInfo(core_1.MessageName.UNNAMED, `Successfully set ${this.name} to ${(0, util_1.inspect)(requestedObject, {
|
|
74
74
|
depth: Infinity,
|
|
75
75
|
colors: configuration.get(`enableColors`),
|
|
76
76
|
compact: false,
|
|
@@ -4,9 +4,9 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const cli_1 = require("@yarnpkg/cli");
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const clipanion_1 = require("clipanion");
|
|
7
|
-
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
8
|
-
const has_1 = tslib_1.__importDefault(require("lodash/has"));
|
|
9
|
-
const unset_1 = tslib_1.__importDefault(require("lodash/unset"));
|
|
7
|
+
const cloneDeep_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeep"));
|
|
8
|
+
const has_1 = (0, tslib_1.__importDefault)(require("lodash/has"));
|
|
9
|
+
const unset_1 = (0, tslib_1.__importDefault)(require("lodash/unset"));
|
|
10
10
|
// eslint-disable-next-line arca/no-default-export
|
|
11
11
|
class ConfigUnsetCommand extends cli_1.BaseCommand {
|
|
12
12
|
constructor() {
|
|
@@ -38,15 +38,15 @@ class ConfigUnsetCommand extends cli_1.BaseCommand {
|
|
|
38
38
|
}, async (report) => {
|
|
39
39
|
let bailedOutEarly = false;
|
|
40
40
|
await updateConfiguration(current => {
|
|
41
|
-
if (!has_1.default(current, this.name)) {
|
|
41
|
+
if (!(0, has_1.default)(current, this.name)) {
|
|
42
42
|
report.reportWarning(core_1.MessageName.UNNAMED, `Configuration doesn't contain setting ${this.name}; there is nothing to unset`);
|
|
43
43
|
bailedOutEarly = true;
|
|
44
44
|
return current;
|
|
45
45
|
}
|
|
46
46
|
const clone = path
|
|
47
|
-
? cloneDeep_1.default(current)
|
|
47
|
+
? (0, cloneDeep_1.default)(current)
|
|
48
48
|
: { ...current };
|
|
49
|
-
unset_1.default(clone, this.name);
|
|
49
|
+
(0, unset_1.default)(clone, this.name);
|
|
50
50
|
return clone;
|
|
51
51
|
});
|
|
52
52
|
// We can't show the success message in the callback as we must first wait for the new configuration to be persisted
|
package/lib/commands/config.d.ts
CHANGED
package/lib/commands/config.js
CHANGED
|
@@ -72,12 +72,12 @@ class ConfigCommand extends cli_1.BaseCommand {
|
|
|
72
72
|
return Math.max(max, description.length);
|
|
73
73
|
}, 0);
|
|
74
74
|
for (const [key, description] of keysAndDescriptions) {
|
|
75
|
-
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${description.padEnd(maxDescriptionLength, ` `)} ${util_1.inspect(configuration.getSpecial(key, { hideSecrets: true, getNativePaths: true }), inspectConfig)}`);
|
|
75
|
+
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${description.padEnd(maxDescriptionLength, ` `)} ${(0, util_1.inspect)(configuration.getSpecial(key, { hideSecrets: true, getNativePaths: true }), inspectConfig)}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
79
|
for (const key of keys) {
|
|
80
|
-
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${util_1.inspect(configuration.getSpecial(key, { hideSecrets: true, getNativePaths: true }), inspectConfig)}`);
|
|
80
|
+
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${(0, util_1.inspect)(configuration.getSpecial(key, { hideSecrets: true, getNativePaths: true }), inspectConfig)}`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
package/lib/commands/dedupe.d.ts
CHANGED
package/lib/commands/dedupe.js
CHANGED
|
@@ -17,8 +17,8 @@ const tslib_1 = require("tslib");
|
|
|
17
17
|
const cli_1 = require("@yarnpkg/cli");
|
|
18
18
|
const core_1 = require("@yarnpkg/core");
|
|
19
19
|
const clipanion_1 = require("clipanion");
|
|
20
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
21
|
-
const dedupeUtils = tslib_1.__importStar(require("../dedupeUtils"));
|
|
20
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
21
|
+
const dedupeUtils = (0, tslib_1.__importStar)(require("../dedupeUtils"));
|
|
22
22
|
// eslint-disable-next-line arca/no-default-export
|
|
23
23
|
class DedupeCommand extends cli_1.BaseCommand {
|
|
24
24
|
constructor() {
|
|
@@ -6,8 +6,8 @@ export default class ExplainPeerRequirementsCommand extends BaseCommand {
|
|
|
6
6
|
static paths: string[][];
|
|
7
7
|
static usage: import("clipanion").Usage;
|
|
8
8
|
hash: string | undefined;
|
|
9
|
-
execute(): Promise<
|
|
9
|
+
execute(): Promise<1 | 0>;
|
|
10
10
|
}
|
|
11
11
|
export declare function explainPeerRequirements(peerRequirementsHash: string, project: Project, opts: {
|
|
12
12
|
stdout: Writable;
|
|
13
|
-
}): Promise<
|
|
13
|
+
}): Promise<1 | 0>;
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const cli_1 = require("@yarnpkg/cli");
|
|
6
6
|
const core_1 = require("@yarnpkg/core");
|
|
7
7
|
const clipanion_1 = require("clipanion");
|
|
8
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
8
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
9
9
|
// eslint-disable-next-line arca/no-default-export
|
|
10
10
|
class ExplainPeerRequirementsCommand extends cli_1.BaseCommand {
|
|
11
11
|
constructor() {
|
package/lib/commands/info.js
CHANGED
|
@@ -5,7 +5,7 @@ const cli_1 = require("@yarnpkg/cli");
|
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
7
7
|
const clipanion_1 = require("clipanion");
|
|
8
|
-
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
8
|
+
const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch"));
|
|
9
9
|
// eslint-disable-next-line arca/no-default-export
|
|
10
10
|
class InfoCommand extends cli_1.BaseCommand {
|
|
11
11
|
constructor() {
|
|
@@ -160,7 +160,7 @@ class InfoCommand extends cli_1.BaseCommand {
|
|
|
160
160
|
const infoTreeChildren = {};
|
|
161
161
|
const infoTree = { children: infoTreeChildren };
|
|
162
162
|
const fetcher = configuration.makeFetcher();
|
|
163
|
-
const fetcherOptions = { project, fetcher, cache, checksums: project.storedChecksums, report: new core_1.ThrowReport(), skipIntegrityCheck: true };
|
|
163
|
+
const fetcherOptions = { project, fetcher, cache, checksums: project.storedChecksums, report: new core_1.ThrowReport(), cacheOptions: { skipIntegrityCheck: true }, skipIntegrityCheck: true };
|
|
164
164
|
const builtinInfoBuilders = [
|
|
165
165
|
// Manifest fields
|
|
166
166
|
async (pkg, extra, registerData) => {
|
|
@@ -185,14 +185,18 @@ class InfoCommand extends cli_1.BaseCommand {
|
|
|
185
185
|
var _a;
|
|
186
186
|
if (!extra.has(`cache`))
|
|
187
187
|
return;
|
|
188
|
+
const cacheOptions = {
|
|
189
|
+
mockedPackages: project.disabledLocators,
|
|
190
|
+
unstablePackages: project.conditionalLocators,
|
|
191
|
+
};
|
|
188
192
|
const checksum = (_a = project.storedChecksums.get(pkg.locatorHash)) !== null && _a !== void 0 ? _a : null;
|
|
189
|
-
const cachePath = cache.getLocatorPath(pkg, checksum);
|
|
193
|
+
const cachePath = cache.getLocatorPath(pkg, checksum, cacheOptions);
|
|
190
194
|
let stat;
|
|
191
195
|
if (cachePath !== null) {
|
|
192
196
|
try {
|
|
193
197
|
stat = fslib_1.xfs.statSync(cachePath);
|
|
194
198
|
}
|
|
195
|
-
catch
|
|
199
|
+
catch { }
|
|
196
200
|
}
|
|
197
201
|
const size = typeof stat !== `undefined`
|
|
198
202
|
? [stat.size, core_1.formatUtils.Type.SIZE]
|
package/lib/commands/install.js
CHANGED
|
@@ -5,8 +5,9 @@ const cli_1 = require("@yarnpkg/cli");
|
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
7
7
|
const parsers_1 = require("@yarnpkg/parsers");
|
|
8
|
+
const ci_info_1 = (0, tslib_1.__importDefault)(require("ci-info"));
|
|
8
9
|
const clipanion_1 = require("clipanion");
|
|
9
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
10
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
10
11
|
// eslint-disable-next-line arca/no-default-export
|
|
11
12
|
class YarnCommand extends cli_1.BaseCommand {
|
|
12
13
|
constructor() {
|
|
@@ -39,14 +40,13 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
39
40
|
this.production = clipanion_1.Option.Boolean(`--production`, { hidden: true });
|
|
40
41
|
this.registry = clipanion_1.Option.String(`--registry`, { hidden: true });
|
|
41
42
|
this.silent = clipanion_1.Option.Boolean(`--silent`, { hidden: true });
|
|
43
|
+
this.networkTimeout = clipanion_1.Option.String(`--network-timeout`, { hidden: true });
|
|
42
44
|
}
|
|
43
45
|
async execute() {
|
|
44
46
|
var _a;
|
|
45
47
|
const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins);
|
|
46
48
|
if (typeof this.inlineBuilds !== `undefined`)
|
|
47
49
|
configuration.useWithSource(`<cli>`, { enableInlineBuilds: this.inlineBuilds }, configuration.startingCwd, { overwrite: true });
|
|
48
|
-
const isZeitNow = !!process.env.NOW_BUILDER;
|
|
49
|
-
const isNetlify = !!process.env.NETLIFY;
|
|
50
50
|
// These variables are used in Google Cloud Platform environment
|
|
51
51
|
// in process of deploying Google Cloud Functions and
|
|
52
52
|
// Google App Engine
|
|
@@ -79,7 +79,7 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
79
79
|
// it would definitely be a configuration setting.
|
|
80
80
|
if (typeof this.ignoreEngines !== `undefined`) {
|
|
81
81
|
const exitCode = await reportDeprecation(`The --ignore-engines option is deprecated; engine checking isn't a core feature anymore`, {
|
|
82
|
-
error: !
|
|
82
|
+
error: !ci_info_1.default.VERCEL,
|
|
83
83
|
});
|
|
84
84
|
if (exitCode !== null) {
|
|
85
85
|
return exitCode;
|
|
@@ -105,7 +105,7 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
105
105
|
// let someone implement this "resolver-that-reads-the-cache" logic.
|
|
106
106
|
if (typeof this.preferOffline !== `undefined`) {
|
|
107
107
|
const exitCode = await reportDeprecation(`The --prefer-offline flag is deprecated; use the --cached flag with 'yarn add' instead`, {
|
|
108
|
-
error: !
|
|
108
|
+
error: !ci_info_1.default.VERCEL,
|
|
109
109
|
});
|
|
110
110
|
if (exitCode !== null) {
|
|
111
111
|
return exitCode;
|
|
@@ -148,7 +148,7 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
148
148
|
// Yarn commands would use different caches, causing unexpected behaviors.
|
|
149
149
|
if (typeof this.cacheFolder !== `undefined`) {
|
|
150
150
|
const exitCode = await reportDeprecation(`The cache-folder option has been deprecated; use rc settings instead`, {
|
|
151
|
-
error: !
|
|
151
|
+
error: !ci_info_1.default.NETLIFY,
|
|
152
152
|
});
|
|
153
153
|
if (exitCode !== null) {
|
|
154
154
|
return exitCode;
|
|
@@ -177,7 +177,7 @@ class YarnCommand extends cli_1.BaseCommand {
|
|
|
177
177
|
try {
|
|
178
178
|
content = await fslib_1.xfs.readFilePromise(fslib_1.ppath.join(projectCwd, fslib_1.Filename.lockfile), `utf8`);
|
|
179
179
|
}
|
|
180
|
-
catch
|
|
180
|
+
catch { }
|
|
181
181
|
// If migrating from a v1 install, we automatically enable the node-modules linker,
|
|
182
182
|
// since that's likely what the author intended to do.
|
|
183
183
|
if (content === null || content === void 0 ? void 0 : content.includes(`yarn lockfile v1`)) {
|
|
@@ -250,15 +250,15 @@ YarnCommand.paths = [
|
|
|
250
250
|
YarnCommand.usage = clipanion_1.Command.Usage({
|
|
251
251
|
description: `install the project dependencies`,
|
|
252
252
|
details: `
|
|
253
|
-
This command
|
|
253
|
+
This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:
|
|
254
254
|
|
|
255
255
|
- **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).
|
|
256
256
|
|
|
257
|
-
- **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where
|
|
257
|
+
- **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where the cache files are stored).
|
|
258
258
|
|
|
259
|
-
- **Link:** Then we send the dependency tree information to internal plugins tasked
|
|
259
|
+
- **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the .pnp.cjs file you might know).
|
|
260
260
|
|
|
261
|
-
- **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another.
|
|
261
|
+
- **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.
|
|
262
262
|
|
|
263
263
|
Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your .pnp.cjs file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.
|
|
264
264
|
|
|
@@ -306,8 +306,8 @@ async function autofixMergeConflicts(configuration, immutable) {
|
|
|
306
306
|
let parsedLeft;
|
|
307
307
|
let parsedRight;
|
|
308
308
|
try {
|
|
309
|
-
parsedLeft = parsers_1.parseSyml(left);
|
|
310
|
-
parsedRight = parsers_1.parseSyml(right);
|
|
309
|
+
parsedLeft = (0, parsers_1.parseSyml)(left);
|
|
310
|
+
parsedRight = (0, parsers_1.parseSyml)(right);
|
|
311
311
|
}
|
|
312
312
|
catch (error) {
|
|
313
313
|
throw new core_1.ReportError(core_1.MessageName.AUTOMERGE_FAILED_TO_PARSE, `The individual variants of the lockfile failed to parse`);
|
|
@@ -323,7 +323,7 @@ async function autofixMergeConflicts(configuration, immutable) {
|
|
|
323
323
|
for (const [key, value] of Object.entries(merged))
|
|
324
324
|
if (typeof value === `string`)
|
|
325
325
|
delete merged[key];
|
|
326
|
-
await fslib_1.xfs.changeFilePromise(lockfilePath, parsers_1.stringifySyml(merged), {
|
|
326
|
+
await fslib_1.xfs.changeFilePromise(lockfilePath, (0, parsers_1.stringifySyml)(merged), {
|
|
327
327
|
automaticNewlines: true,
|
|
328
328
|
});
|
|
329
329
|
return true;
|
package/lib/commands/link.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export default class PluginDlSourcesCommand extends BaseCommand {
|
|
|
12
12
|
noMinify: boolean;
|
|
13
13
|
force: boolean;
|
|
14
14
|
name: string;
|
|
15
|
-
execute(): Promise<
|
|
15
|
+
execute(): Promise<1 | 0>;
|
|
16
16
|
}
|
|
17
17
|
export declare type BuildAndSavePluginsSpec = {
|
|
18
18
|
context: CommandContext;
|
|
@@ -38,7 +38,7 @@ class PluginDlSourcesCommand extends cli_1.BaseCommand {
|
|
|
38
38
|
const configuration = await core_2.Configuration.find(this.context.cwd, this.context.plugins);
|
|
39
39
|
const target = typeof this.installPath !== `undefined`
|
|
40
40
|
? fslib_1.ppath.resolve(this.context.cwd, fslib_1.npath.toPortablePath(this.installPath))
|
|
41
|
-
: fslib_1.ppath.resolve(fslib_1.npath.toPortablePath(os_1.tmpdir()), `yarnpkg-sources`, core_1.hashUtils.makeHash(this.repository).slice(0, 6));
|
|
41
|
+
: fslib_1.ppath.resolve(fslib_1.npath.toPortablePath((0, os_1.tmpdir)()), `yarnpkg-sources`, core_1.hashUtils.makeHash(this.repository).slice(0, 6));
|
|
42
42
|
const report = await core_2.StreamReport.start({
|
|
43
43
|
configuration,
|
|
44
44
|
stdout: this.context.stdout,
|
|
@@ -46,11 +46,11 @@ class PluginDlSourcesCommand extends cli_1.BaseCommand {
|
|
|
46
46
|
const { project } = await core_2.Project.find(configuration, this.context.cwd);
|
|
47
47
|
const ident = core_1.structUtils.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/, `@yarnpkg/plugin-`));
|
|
48
48
|
const identStr = core_1.structUtils.stringifyIdent(ident);
|
|
49
|
-
const data = await list_1.getAvailablePlugins(configuration);
|
|
49
|
+
const data = await (0, list_1.getAvailablePlugins)(configuration);
|
|
50
50
|
if (!Object.prototype.hasOwnProperty.call(data, identStr))
|
|
51
51
|
throw new core_2.ReportError(core_2.MessageName.PLUGIN_NAME_NOT_FOUND, `Couldn't find a plugin named "${identStr}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);
|
|
52
52
|
const pluginSpec = identStr;
|
|
53
|
-
await sources_1.prepareRepo(this, { configuration, report, target });
|
|
53
|
+
await (0, sources_1.prepareRepo)(this, { configuration, report, target });
|
|
54
54
|
await buildAndSavePlugin(pluginSpec, this, { project, report, target });
|
|
55
55
|
});
|
|
56
56
|
return report.exitCode();
|
|
@@ -82,13 +82,13 @@ async function buildAndSavePlugin(pluginSpec, { context, noMinify }, { project,
|
|
|
82
82
|
report.reportSeparator();
|
|
83
83
|
report.reportInfo(core_2.MessageName.UNNAMED, `Building a fresh ${pluginName}`);
|
|
84
84
|
report.reportSeparator();
|
|
85
|
-
await sources_1.runWorkflow(buildWorkflow({
|
|
85
|
+
await (0, sources_1.runWorkflow)(buildWorkflow({
|
|
86
86
|
pluginName,
|
|
87
87
|
noMinify,
|
|
88
88
|
}, target), { configuration, context, target });
|
|
89
89
|
report.reportSeparator();
|
|
90
90
|
const pluginPath = fslib_1.ppath.resolve(target, `packages/${pluginName}/bundles/${pluginSpec}.js`);
|
|
91
91
|
const pluginBuffer = await fslib_1.xfs.readFilePromise(pluginPath);
|
|
92
|
-
await import_1.savePlugin(pluginSpec, pluginBuffer, { project, report });
|
|
92
|
+
await (0, import_1.savePlugin)(pluginSpec, pluginBuffer, { project, report });
|
|
93
93
|
}
|
|
94
94
|
exports.buildAndSavePlugin = buildAndSavePlugin;
|
|
@@ -6,7 +6,7 @@ export default class PluginDlCommand extends BaseCommand {
|
|
|
6
6
|
static paths: string[][];
|
|
7
7
|
static usage: Usage;
|
|
8
8
|
name: string;
|
|
9
|
-
execute(): Promise<
|
|
9
|
+
execute(): Promise<1 | 0>;
|
|
10
10
|
}
|
|
11
11
|
export declare function savePlugin(pluginSpec: string, pluginBuffer: Buffer, { project, report }: {
|
|
12
12
|
project: Project;
|
|
@@ -7,7 +7,7 @@ const core_1 = require("@yarnpkg/core");
|
|
|
7
7
|
const core_2 = require("@yarnpkg/core");
|
|
8
8
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
9
9
|
const clipanion_1 = require("clipanion");
|
|
10
|
-
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
10
|
+
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
11
11
|
const url_1 = require("url");
|
|
12
12
|
const vm_1 = require("vm");
|
|
13
13
|
const list_1 = require("./list");
|
|
@@ -38,7 +38,7 @@ class PluginDlCommand extends cli_1.BaseCommand {
|
|
|
38
38
|
try {
|
|
39
39
|
new url_1.URL(this.name);
|
|
40
40
|
}
|
|
41
|
-
catch
|
|
41
|
+
catch {
|
|
42
42
|
throw new core_1.ReportError(core_1.MessageName.INVALID_PLUGIN_REFERENCE, `Plugin specifier "${this.name}" is neither a plugin name nor a valid url`);
|
|
43
43
|
}
|
|
44
44
|
pluginSpec = this.name;
|
|
@@ -49,7 +49,7 @@ class PluginDlCommand extends cli_1.BaseCommand {
|
|
|
49
49
|
if (locator.reference !== `unknown` && !semver_1.default.valid(locator.reference))
|
|
50
50
|
throw new core_1.ReportError(core_1.MessageName.UNNAMED, `Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.`);
|
|
51
51
|
const identStr = core_2.structUtils.stringifyIdent(locator);
|
|
52
|
-
const data = await list_1.getAvailablePlugins(configuration);
|
|
52
|
+
const data = await (0, list_1.getAvailablePlugins)(configuration);
|
|
53
53
|
if (!Object.prototype.hasOwnProperty.call(data, identStr))
|
|
54
54
|
throw new core_1.ReportError(core_1.MessageName.PLUGIN_NAME_NOT_FOUND, `Couldn't find a plugin named "${identStr}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be referenced by their name; any other plugin will have to be referenced through its public url (for example https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js).`);
|
|
55
55
|
pluginSpec = identStr;
|
|
@@ -105,7 +105,7 @@ async function savePlugin(pluginSpec, pluginBuffer, { project, report }) {
|
|
|
105
105
|
const { configuration } = project;
|
|
106
106
|
const vmExports = {};
|
|
107
107
|
const vmModule = { exports: vmExports };
|
|
108
|
-
vm_1.runInNewContext(pluginBuffer.toString(), {
|
|
108
|
+
(0, vm_1.runInNewContext)(pluginBuffer.toString(), {
|
|
109
109
|
module: vmModule,
|
|
110
110
|
exports: vmExports,
|
|
111
111
|
});
|
|
@@ -8,7 +8,7 @@ const clipanion_1 = require("clipanion");
|
|
|
8
8
|
const REMOTE_REGISTRY = `https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml`;
|
|
9
9
|
async function getAvailablePlugins(configuration) {
|
|
10
10
|
const raw = await core_1.httpUtils.get(REMOTE_REGISTRY, { configuration });
|
|
11
|
-
const data = parsers_1.parseSyml(raw.toString());
|
|
11
|
+
const data = (0, parsers_1.parseSyml)(raw.toString());
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
14
|
exports.getAvailablePlugins = getAvailablePlugins;
|
package/lib/commands/remove.d.ts
CHANGED
package/lib/commands/remove.js
CHANGED
|
@@ -6,9 +6,9 @@ const core_1 = require("@yarnpkg/core");
|
|
|
6
6
|
const core_2 = require("@yarnpkg/core");
|
|
7
7
|
const core_3 = require("@yarnpkg/core");
|
|
8
8
|
const clipanion_1 = require("clipanion");
|
|
9
|
-
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
10
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
11
|
-
const suggestUtils = tslib_1.__importStar(require("../suggestUtils"));
|
|
9
|
+
const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch"));
|
|
10
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
11
|
+
const suggestUtils = (0, tslib_1.__importStar)(require("../suggestUtils"));
|
|
12
12
|
// eslint-disable-next-line arca/no-default-export
|
|
13
13
|
class RemoveCommand extends cli_1.BaseCommand {
|
|
14
14
|
constructor() {
|
|
@@ -49,7 +49,7 @@ class RemoveCommand extends cli_1.BaseCommand {
|
|
|
49
49
|
const pseudoIdent = core_3.structUtils.parseIdent(pattern);
|
|
50
50
|
for (const workspace of affectedWorkspaces) {
|
|
51
51
|
const peerDependenciesMeta = [...workspace.manifest.peerDependenciesMeta.keys()];
|
|
52
|
-
for (const stringifiedIdent of micromatch_1.default(peerDependenciesMeta, pattern)) {
|
|
52
|
+
for (const stringifiedIdent of (0, micromatch_1.default)(peerDependenciesMeta, pattern)) {
|
|
53
53
|
workspace.manifest.peerDependenciesMeta.delete(stringifiedIdent);
|
|
54
54
|
hasChanged = true;
|
|
55
55
|
isReferenced = true;
|
|
@@ -59,7 +59,7 @@ class RemoveCommand extends cli_1.BaseCommand {
|
|
|
59
59
|
const stringifiedIdents = [...descriptors.values()].map(descriptor => {
|
|
60
60
|
return core_3.structUtils.stringifyIdent(descriptor);
|
|
61
61
|
});
|
|
62
|
-
for (const stringifiedIdent of micromatch_1.default(stringifiedIdents, core_3.structUtils.stringifyIdent(pseudoIdent))) {
|
|
62
|
+
for (const stringifiedIdent of (0, micromatch_1.default)(stringifiedIdents, core_3.structUtils.stringifyIdent(pseudoIdent))) {
|
|
63
63
|
const { identHash } = core_3.structUtils.parseIdent(stringifiedIdent);
|
|
64
64
|
const removedDescriptor = descriptors.get(identHash);
|
|
65
65
|
if (typeof removedDescriptor === `undefined`)
|
package/lib/commands/runIndex.js
CHANGED
|
@@ -26,7 +26,7 @@ class RunCommand extends cli_1.BaseCommand {
|
|
|
26
26
|
return Math.max(max, key.length);
|
|
27
27
|
}, 0);
|
|
28
28
|
for (const [key, value] of scripts.entries()) {
|
|
29
|
-
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${util_1.inspect(value, inspectConfig)}`);
|
|
29
|
+
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${(0, util_1.inspect)(value, inspectConfig)}`);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
return report.exitCode();
|
|
@@ -12,7 +12,7 @@ export default class SetVersionSourcesCommand extends BaseCommand {
|
|
|
12
12
|
noMinify: boolean;
|
|
13
13
|
force: boolean;
|
|
14
14
|
skipPlugins: boolean;
|
|
15
|
-
execute(): Promise<
|
|
15
|
+
execute(): Promise<1 | 0>;
|
|
16
16
|
}
|
|
17
17
|
export declare function runWorkflow(workflow: Array<Array<string>>, { configuration, context, target }: {
|
|
18
18
|
configuration: Configuration;
|
|
@@ -63,7 +63,7 @@ class SetVersionSourcesCommand extends cli_1.BaseCommand {
|
|
|
63
63
|
const { project } = await core_1.Project.find(configuration, this.context.cwd);
|
|
64
64
|
const target = typeof this.installPath !== `undefined`
|
|
65
65
|
? fslib_1.ppath.resolve(this.context.cwd, fslib_1.npath.toPortablePath(this.installPath))
|
|
66
|
-
: fslib_1.ppath.resolve(fslib_1.npath.toPortablePath(os_1.tmpdir()), `yarnpkg-sources`, core_1.hashUtils.makeHash(this.repository).slice(0, 6));
|
|
66
|
+
: fslib_1.ppath.resolve(fslib_1.npath.toPortablePath((0, os_1.tmpdir)()), `yarnpkg-sources`, core_1.hashUtils.makeHash(this.repository).slice(0, 6));
|
|
67
67
|
const report = await core_1.StreamReport.start({
|
|
68
68
|
configuration,
|
|
69
69
|
stdout: this.context.stdout,
|
|
@@ -76,7 +76,7 @@ class SetVersionSourcesCommand extends cli_1.BaseCommand {
|
|
|
76
76
|
report.reportSeparator();
|
|
77
77
|
const bundlePath = fslib_1.ppath.resolve(target, `packages/yarnpkg-cli/bundles/yarn.js`);
|
|
78
78
|
const bundleBuffer = await fslib_1.xfs.readFilePromise(bundlePath);
|
|
79
|
-
await version_1.setVersion(configuration, `sources`, bundleBuffer, {
|
|
79
|
+
await (0, version_1.setVersion)(configuration, `sources`, bundleBuffer, {
|
|
80
80
|
report,
|
|
81
81
|
});
|
|
82
82
|
if (!this.skipPlugins) {
|
|
@@ -156,11 +156,11 @@ async function prepareRepo(spec, { configuration, report, target }) {
|
|
|
156
156
|
}
|
|
157
157
|
exports.prepareRepo = prepareRepo;
|
|
158
158
|
async function updatePlugins(context, { project, report, target }) {
|
|
159
|
-
const data = await list_1.getAvailablePlugins(project.configuration);
|
|
159
|
+
const data = await (0, list_1.getAvailablePlugins)(project.configuration);
|
|
160
160
|
const contribPlugins = new Set(Object.keys(data));
|
|
161
161
|
for (const name of project.configuration.plugins.keys()) {
|
|
162
162
|
if (!contribPlugins.has(name))
|
|
163
163
|
continue;
|
|
164
|
-
await sources_1.buildAndSavePlugin(name, context, { project, report, target });
|
|
164
|
+
await (0, sources_1.buildAndSavePlugin)(name, context, { project, report, target });
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -11,7 +11,7 @@ export default class SetVersionCommand extends BaseCommand {
|
|
|
11
11
|
static usage: Usage;
|
|
12
12
|
onlyIfNeeded: boolean;
|
|
13
13
|
version: string;
|
|
14
|
-
execute(): Promise<
|
|
14
|
+
execute(): Promise<1 | 0>;
|
|
15
15
|
}
|
|
16
16
|
export declare function resolveRange(configuration: Configuration, request: string): Promise<string>;
|
|
17
17
|
export declare function resolveTag(configuration: Configuration, request: `stable` | `canary`): Promise<string>;
|
|
@@ -7,7 +7,7 @@ const core_1 = require("@yarnpkg/core");
|
|
|
7
7
|
const core_2 = require("@yarnpkg/core");
|
|
8
8
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
9
9
|
const clipanion_1 = require("clipanion");
|
|
10
|
-
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
10
|
+
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
11
11
|
// eslint-disable-next-line arca/no-default-export
|
|
12
12
|
class SetVersionCommand extends cli_1.BaseCommand {
|
|
13
13
|
constructor() {
|
package/lib/commands/unlink.d.ts
CHANGED
package/lib/commands/unlink.js
CHANGED
|
@@ -5,7 +5,7 @@ const cli_1 = require("@yarnpkg/cli");
|
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
7
7
|
const clipanion_1 = require("clipanion");
|
|
8
|
-
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
8
|
+
const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch"));
|
|
9
9
|
// eslint-disable-next-line arca/no-default-export
|
|
10
10
|
class UnlinkCommand extends cli_1.BaseCommand {
|
|
11
11
|
constructor() {
|
|
@@ -54,7 +54,7 @@ class UnlinkCommand extends cli_1.BaseCommand {
|
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
const fullNames = [...topLevelWorkspace.manifest.resolutions.map(({ pattern }) => pattern.descriptor.fullName)];
|
|
57
|
-
for (const fullName of micromatch_1.default(fullNames, leadingArgument)) {
|
|
57
|
+
for (const fullName of (0, micromatch_1.default)(fullNames, leadingArgument)) {
|
|
58
58
|
workspacesToUnlink.add(fullName);
|
|
59
59
|
}
|
|
60
60
|
}
|
package/lib/commands/up.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export default class UpCommand extends BaseCommand {
|
|
|
17
17
|
}, {
|
|
18
18
|
[key: string]: unknown;
|
|
19
19
|
}>[];
|
|
20
|
-
execute(): Promise<
|
|
21
|
-
executeUpRecursive(): Promise<
|
|
22
|
-
executeUpClassic(): Promise<
|
|
20
|
+
execute(): Promise<1 | 0>;
|
|
21
|
+
executeUpRecursive(): Promise<1 | 0>;
|
|
22
|
+
executeUpClassic(): Promise<1 | 0>;
|
|
23
23
|
}
|
package/lib/commands/up.js
CHANGED
|
@@ -7,9 +7,9 @@ const core_2 = require("@yarnpkg/core");
|
|
|
7
7
|
const core_3 = require("@yarnpkg/core");
|
|
8
8
|
const clipanion_1 = require("clipanion");
|
|
9
9
|
const enquirer_1 = require("enquirer");
|
|
10
|
-
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
11
|
-
const t = tslib_1.__importStar(require("typanion"));
|
|
12
|
-
const suggestUtils = tslib_1.__importStar(require("../suggestUtils"));
|
|
10
|
+
const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch"));
|
|
11
|
+
const t = (0, tslib_1.__importStar)(require("typanion"));
|
|
12
|
+
const suggestUtils = (0, tslib_1.__importStar)(require("../suggestUtils"));
|
|
13
13
|
// eslint-disable-next-line arca/no-default-export
|
|
14
14
|
class UpCommand extends cli_1.BaseCommand {
|
|
15
15
|
constructor() {
|
|
@@ -60,7 +60,7 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
60
60
|
for (const pattern of this.patterns) {
|
|
61
61
|
if (core_1.structUtils.parseDescriptor(pattern).range !== `unknown`)
|
|
62
62
|
throw new clipanion_1.UsageError(`Ranges aren't allowed when using --recursive`);
|
|
63
|
-
for (const stringifiedIdent of micromatch_1.default(stringifiedIdents, pattern)) {
|
|
63
|
+
for (const stringifiedIdent of (0, micromatch_1.default)(stringifiedIdents, pattern)) {
|
|
64
64
|
const ident = core_1.structUtils.parseIdent(stringifiedIdent);
|
|
65
65
|
relevantIdents.add(ident.identHash);
|
|
66
66
|
}
|
|
@@ -113,7 +113,7 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
113
113
|
const stringifiedIdents = [...descriptors.values()].map(descriptor => {
|
|
114
114
|
return core_1.structUtils.stringifyIdent(descriptor);
|
|
115
115
|
});
|
|
116
|
-
for (const stringifiedIdent of micromatch_1.default(stringifiedIdents, core_1.structUtils.stringifyIdent(pseudoDescriptor))) {
|
|
116
|
+
for (const stringifiedIdent of (0, micromatch_1.default)(stringifiedIdents, core_1.structUtils.stringifyIdent(pseudoDescriptor))) {
|
|
117
117
|
const ident = core_1.structUtils.parseIdent(stringifiedIdent);
|
|
118
118
|
const existingDescriptor = workspace.manifest[target].get(ident.identHash);
|
|
119
119
|
if (typeof existingDescriptor === `undefined`)
|
|
@@ -182,7 +182,7 @@ class UpCommand extends cli_1.BaseCommand {
|
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
184
|
askedQuestions = true;
|
|
185
|
-
({ answer: selected } = await enquirer_1.prompt({
|
|
185
|
+
({ answer: selected } = await (0, enquirer_1.prompt)({
|
|
186
186
|
type: `select`,
|
|
187
187
|
name: `answer`,
|
|
188
188
|
message: `Which range to you want to use in ${core_1.structUtils.prettyWorkspace(configuration, workspace)} ❯ ${target}?`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseCommand } from
|
|
2
|
-
import { Usage } from
|
|
1
|
+
import { BaseCommand } from '@yarnpkg/cli';
|
|
2
|
+
import { Usage } from 'clipanion';
|
|
3
3
|
export default class WorkspaceCommand extends BaseCommand {
|
|
4
4
|
static paths: string[][];
|
|
5
5
|
static usage: Usage;
|
|
@@ -3,7 +3,9 @@ import { Usage } from 'clipanion';
|
|
|
3
3
|
export default class WorkspacesListCommand extends BaseCommand {
|
|
4
4
|
static paths: string[][];
|
|
5
5
|
static usage: Usage;
|
|
6
|
+
since: string | boolean | undefined;
|
|
7
|
+
recursive: boolean;
|
|
6
8
|
verbose: boolean;
|
|
7
9
|
json: boolean;
|
|
8
|
-
execute(): Promise<
|
|
10
|
+
execute(): Promise<1 | 0>;
|
|
9
11
|
}
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_1 = require("@yarnpkg/cli");
|
|
4
4
|
const core_1 = require("@yarnpkg/core");
|
|
5
|
+
const plugin_git_1 = require("@yarnpkg/plugin-git");
|
|
5
6
|
const clipanion_1 = require("clipanion");
|
|
6
7
|
// eslint-disable-next-line arca/no-default-export
|
|
7
8
|
class WorkspacesListCommand extends cli_1.BaseCommand {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
11
|
+
this.since = clipanion_1.Option.String(`--since`, {
|
|
12
|
+
description: `Only include workspaces that have been changed since the specified ref.`,
|
|
13
|
+
tolerateBoolean: true,
|
|
14
|
+
});
|
|
15
|
+
this.recursive = clipanion_1.Option.Boolean(`-R,--recursive`, false, {
|
|
16
|
+
description: `Find packages via dependencies/devDependencies instead of using the workspaces field`,
|
|
17
|
+
});
|
|
10
18
|
this.verbose = clipanion_1.Option.Boolean(`-v,--verbose`, false, {
|
|
11
19
|
description: `Also return the cross-dependencies between workspaces`,
|
|
12
20
|
});
|
|
@@ -22,7 +30,15 @@ class WorkspacesListCommand extends cli_1.BaseCommand {
|
|
|
22
30
|
json: this.json,
|
|
23
31
|
stdout: this.context.stdout,
|
|
24
32
|
}, async (report) => {
|
|
25
|
-
|
|
33
|
+
const candidates = this.since
|
|
34
|
+
? await plugin_git_1.gitUtils.fetchChangedWorkspaces({ ref: this.since, project })
|
|
35
|
+
: project.workspaces;
|
|
36
|
+
const workspaces = new Set(candidates);
|
|
37
|
+
if (this.recursive)
|
|
38
|
+
for (const dependents of [...candidates].map(candidate => candidate.getRecursiveWorkspaceDependents()))
|
|
39
|
+
for (const dependent of dependents)
|
|
40
|
+
workspaces.add(dependent);
|
|
41
|
+
for (const workspace of workspaces) {
|
|
26
42
|
const { manifest } = workspace;
|
|
27
43
|
let extra;
|
|
28
44
|
if (this.verbose) {
|
|
@@ -71,6 +87,12 @@ WorkspacesListCommand.usage = clipanion_1.Command.Usage({
|
|
|
71
87
|
category: `Workspace-related commands`,
|
|
72
88
|
description: `list all available workspaces`,
|
|
73
89
|
details: `
|
|
74
|
-
This command will print the list of all workspaces in the project.
|
|
90
|
+
This command will print the list of all workspaces in the project.
|
|
91
|
+
|
|
92
|
+
- If \`--since\` is set, Yarn will only list workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the \`changesetBaseRefs\` configuration option.
|
|
93
|
+
|
|
94
|
+
- If \`-R,--recursive\` is set, Yarn will find workspaces to run the command on by recursively evaluating \`dependencies\` and \`devDependencies\` fields, instead of looking at the \`workspaces\` fields.
|
|
95
|
+
|
|
96
|
+
- If both the \`-v,--verbose\` and \`--json\` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).
|
|
75
97
|
`,
|
|
76
98
|
});
|
package/lib/dedupeUtils.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.dedupe = exports.acceptedStrategies = exports.Strategy = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const core_2 = require("@yarnpkg/core");
|
|
7
|
-
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
7
|
+
const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch"));
|
|
8
8
|
var Strategy;
|
|
9
9
|
(function (Strategy) {
|
|
10
10
|
/**
|
|
@@ -79,6 +79,9 @@ async function dedupe(project, { strategy, patterns, cache, report }) {
|
|
|
79
79
|
project,
|
|
80
80
|
report: throwReport,
|
|
81
81
|
skipIntegrityCheck: true,
|
|
82
|
+
cacheOptions: {
|
|
83
|
+
skipIntegrityCheck: true,
|
|
84
|
+
},
|
|
82
85
|
};
|
|
83
86
|
const resolveOptions = {
|
|
84
87
|
project,
|
package/lib/index.js
CHANGED
|
@@ -4,44 +4,44 @@ exports.suggestUtils = exports.dedupeUtils = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const ci_info_1 = require("ci-info");
|
|
7
|
-
const add_1 = tslib_1.__importDefault(require("./commands/add"));
|
|
8
|
-
const bin_1 = tslib_1.__importDefault(require("./commands/bin"));
|
|
9
|
-
const clean_1 = tslib_1.__importDefault(require("./commands/cache/clean"));
|
|
10
|
-
const get_1 = tslib_1.__importDefault(require("./commands/config/get"));
|
|
11
|
-
const set_1 = tslib_1.__importDefault(require("./commands/config/set"));
|
|
12
|
-
const unset_1 = tslib_1.__importDefault(require("./commands/config/unset"));
|
|
13
|
-
const config_1 = tslib_1.__importDefault(require("./commands/config"));
|
|
14
|
-
const dedupe_1 = tslib_1.__importDefault(require("./commands/dedupe"));
|
|
15
|
-
const clipanion_1 = tslib_1.__importDefault(require("./commands/entries/clipanion"));
|
|
16
|
-
const help_1 = tslib_1.__importDefault(require("./commands/entries/help"));
|
|
17
|
-
const run_1 = tslib_1.__importDefault(require("./commands/entries/run"));
|
|
18
|
-
const version_1 = tslib_1.__importDefault(require("./commands/entries/version"));
|
|
19
|
-
const exec_1 = tslib_1.__importDefault(require("./commands/exec"));
|
|
20
|
-
const peerRequirements_1 = tslib_1.__importDefault(require("./commands/explain/peerRequirements"));
|
|
21
|
-
const info_1 = tslib_1.__importDefault(require("./commands/info"));
|
|
22
|
-
const install_1 = tslib_1.__importDefault(require("./commands/install"));
|
|
23
|
-
const link_1 = tslib_1.__importDefault(require("./commands/link"));
|
|
24
|
-
const node_1 = tslib_1.__importDefault(require("./commands/node"));
|
|
25
|
-
const sources_1 = tslib_1.__importDefault(require("./commands/plugin/import/sources"));
|
|
26
|
-
const import_1 = tslib_1.__importDefault(require("./commands/plugin/import"));
|
|
27
|
-
const list_1 = tslib_1.__importDefault(require("./commands/plugin/list"));
|
|
28
|
-
const remove_1 = tslib_1.__importDefault(require("./commands/plugin/remove"));
|
|
29
|
-
const runtime_1 = tslib_1.__importDefault(require("./commands/plugin/runtime"));
|
|
30
|
-
const rebuild_1 = tslib_1.__importDefault(require("./commands/rebuild"));
|
|
31
|
-
const remove_2 = tslib_1.__importDefault(require("./commands/remove"));
|
|
32
|
-
const runIndex_1 = tslib_1.__importDefault(require("./commands/runIndex"));
|
|
33
|
-
const run_2 = tslib_1.__importDefault(require("./commands/run"));
|
|
34
|
-
const resolution_1 = tslib_1.__importDefault(require("./commands/set/resolution"));
|
|
35
|
-
const sources_2 = tslib_1.__importDefault(require("./commands/set/version/sources"));
|
|
36
|
-
const version_2 = tslib_1.__importDefault(require("./commands/set/version"));
|
|
37
|
-
const unlink_1 = tslib_1.__importDefault(require("./commands/unlink"));
|
|
38
|
-
const up_1 = tslib_1.__importDefault(require("./commands/up"));
|
|
39
|
-
const why_1 = tslib_1.__importDefault(require("./commands/why"));
|
|
40
|
-
const list_2 = tslib_1.__importDefault(require("./commands/workspaces/list"));
|
|
41
|
-
const workspace_1 = tslib_1.__importDefault(require("./commands/workspace"));
|
|
42
|
-
const dedupeUtils = tslib_1.__importStar(require("./dedupeUtils"));
|
|
7
|
+
const add_1 = (0, tslib_1.__importDefault)(require("./commands/add"));
|
|
8
|
+
const bin_1 = (0, tslib_1.__importDefault)(require("./commands/bin"));
|
|
9
|
+
const clean_1 = (0, tslib_1.__importDefault)(require("./commands/cache/clean"));
|
|
10
|
+
const get_1 = (0, tslib_1.__importDefault)(require("./commands/config/get"));
|
|
11
|
+
const set_1 = (0, tslib_1.__importDefault)(require("./commands/config/set"));
|
|
12
|
+
const unset_1 = (0, tslib_1.__importDefault)(require("./commands/config/unset"));
|
|
13
|
+
const config_1 = (0, tslib_1.__importDefault)(require("./commands/config"));
|
|
14
|
+
const dedupe_1 = (0, tslib_1.__importDefault)(require("./commands/dedupe"));
|
|
15
|
+
const clipanion_1 = (0, tslib_1.__importDefault)(require("./commands/entries/clipanion"));
|
|
16
|
+
const help_1 = (0, tslib_1.__importDefault)(require("./commands/entries/help"));
|
|
17
|
+
const run_1 = (0, tslib_1.__importDefault)(require("./commands/entries/run"));
|
|
18
|
+
const version_1 = (0, tslib_1.__importDefault)(require("./commands/entries/version"));
|
|
19
|
+
const exec_1 = (0, tslib_1.__importDefault)(require("./commands/exec"));
|
|
20
|
+
const peerRequirements_1 = (0, tslib_1.__importDefault)(require("./commands/explain/peerRequirements"));
|
|
21
|
+
const info_1 = (0, tslib_1.__importDefault)(require("./commands/info"));
|
|
22
|
+
const install_1 = (0, tslib_1.__importDefault)(require("./commands/install"));
|
|
23
|
+
const link_1 = (0, tslib_1.__importDefault)(require("./commands/link"));
|
|
24
|
+
const node_1 = (0, tslib_1.__importDefault)(require("./commands/node"));
|
|
25
|
+
const sources_1 = (0, tslib_1.__importDefault)(require("./commands/plugin/import/sources"));
|
|
26
|
+
const import_1 = (0, tslib_1.__importDefault)(require("./commands/plugin/import"));
|
|
27
|
+
const list_1 = (0, tslib_1.__importDefault)(require("./commands/plugin/list"));
|
|
28
|
+
const remove_1 = (0, tslib_1.__importDefault)(require("./commands/plugin/remove"));
|
|
29
|
+
const runtime_1 = (0, tslib_1.__importDefault)(require("./commands/plugin/runtime"));
|
|
30
|
+
const rebuild_1 = (0, tslib_1.__importDefault)(require("./commands/rebuild"));
|
|
31
|
+
const remove_2 = (0, tslib_1.__importDefault)(require("./commands/remove"));
|
|
32
|
+
const runIndex_1 = (0, tslib_1.__importDefault)(require("./commands/runIndex"));
|
|
33
|
+
const run_2 = (0, tslib_1.__importDefault)(require("./commands/run"));
|
|
34
|
+
const resolution_1 = (0, tslib_1.__importDefault)(require("./commands/set/resolution"));
|
|
35
|
+
const sources_2 = (0, tslib_1.__importDefault)(require("./commands/set/version/sources"));
|
|
36
|
+
const version_2 = (0, tslib_1.__importDefault)(require("./commands/set/version"));
|
|
37
|
+
const unlink_1 = (0, tslib_1.__importDefault)(require("./commands/unlink"));
|
|
38
|
+
const up_1 = (0, tslib_1.__importDefault)(require("./commands/up"));
|
|
39
|
+
const why_1 = (0, tslib_1.__importDefault)(require("./commands/why"));
|
|
40
|
+
const list_2 = (0, tslib_1.__importDefault)(require("./commands/workspaces/list"));
|
|
41
|
+
const workspace_1 = (0, tslib_1.__importDefault)(require("./commands/workspace"));
|
|
42
|
+
const dedupeUtils = (0, tslib_1.__importStar)(require("./dedupeUtils"));
|
|
43
43
|
exports.dedupeUtils = dedupeUtils;
|
|
44
|
-
const suggestUtils = tslib_1.__importStar(require("./suggestUtils"));
|
|
44
|
+
const suggestUtils = (0, tslib_1.__importStar)(require("./suggestUtils"));
|
|
45
45
|
exports.suggestUtils = suggestUtils;
|
|
46
46
|
const plugin = {
|
|
47
47
|
configuration: {
|
package/lib/suggestUtils.js
CHANGED
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@yarnpkg/core");
|
|
6
6
|
const core_2 = require("@yarnpkg/core");
|
|
7
7
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
8
|
-
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
8
|
+
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
9
9
|
const WORKSPACE_PROTOCOL = `workspace:`;
|
|
10
10
|
var Target;
|
|
11
11
|
(function (Target) {
|
|
@@ -313,7 +313,7 @@ async function fetchDescriptorFrom(ident, range, { project, cache, workspace, pr
|
|
|
313
313
|
const report = new core_1.ThrowReport();
|
|
314
314
|
const fetcher = project.configuration.makeFetcher();
|
|
315
315
|
const resolver = project.configuration.makeResolver();
|
|
316
|
-
const fetchOptions = { project, fetcher, cache, checksums: project.storedChecksums, report, skipIntegrityCheck: true };
|
|
316
|
+
const fetchOptions = { project, fetcher, cache, checksums: project.storedChecksums, report, cacheOptions: { skipIntegrityCheck: true }, skipIntegrityCheck: true };
|
|
317
317
|
const resolveOptions = { ...fetchOptions, resolver, fetchOptions };
|
|
318
318
|
// The descriptor has to be bound for the resolvers that need a parent locator. (e.g. FileResolver)
|
|
319
319
|
// If we didn't bind it, `yarn add ./folder` wouldn't work.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "3.1.0-rc.
|
|
3
|
+
"version": "3.1.0-rc.13",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@yarnpkg/fslib": "^2.6.0-rc.
|
|
7
|
+
"@yarnpkg/fslib": "^2.6.0-rc.13",
|
|
8
8
|
"@yarnpkg/json-proxy": "^2.1.1",
|
|
9
|
-
"@yarnpkg/parsers": "^2.4.1-rc.
|
|
10
|
-
"ci-info": "^2.0
|
|
9
|
+
"@yarnpkg/parsers": "^2.4.1-rc.13",
|
|
10
|
+
"ci-info": "^3.2.0",
|
|
11
11
|
"clipanion": "^3.0.1",
|
|
12
12
|
"enquirer": "^2.3.6",
|
|
13
13
|
"lodash": "^4.17.15",
|
|
@@ -17,17 +17,18 @@
|
|
|
17
17
|
"typanion": "^3.3.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@yarnpkg/cli": "^3.1.0-rc.
|
|
21
|
-
"@yarnpkg/core": "^3.1.0-rc.
|
|
20
|
+
"@yarnpkg/cli": "^3.1.0-rc.13",
|
|
21
|
+
"@yarnpkg/core": "^3.1.0-rc.14",
|
|
22
|
+
"@yarnpkg/plugin-git": "^2.5.0-rc.3"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@types/ci-info": "^2",
|
|
25
25
|
"@types/lodash": "^4.14.136",
|
|
26
26
|
"@types/micromatch": "^4.0.1",
|
|
27
27
|
"@types/semver": "^7.1.0",
|
|
28
28
|
"@types/treeify": "^1.0.0",
|
|
29
|
-
"@yarnpkg/cli": "3.1.0-rc.
|
|
30
|
-
"@yarnpkg/core": "3.1.0-rc.
|
|
29
|
+
"@yarnpkg/cli": "^3.1.0-rc.13",
|
|
30
|
+
"@yarnpkg/core": "^3.1.0-rc.14",
|
|
31
|
+
"@yarnpkg/plugin-git": "^2.5.0-rc.3"
|
|
31
32
|
},
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|