@yarnpkg/plugin-essentials 4.0.2 → 4.1.1
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/install.js
CHANGED
|
@@ -289,11 +289,11 @@ YarnCommand.usage = clipanion_1.Command.Usage({
|
|
|
289
289
|
|
|
290
290
|
- **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).
|
|
291
291
|
|
|
292
|
-
- **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
|
|
292
|
+
- **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).
|
|
293
293
|
|
|
294
294
|
- **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.
|
|
295
295
|
|
|
296
|
-
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
|
|
296
|
+
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.
|
|
297
297
|
|
|
298
298
|
If the \`--immutable\` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the \`immutablePatterns\` configuration setting). For backward compatibility we offer an alias under the name of \`--frozen-lockfile\`, but it will be removed in a later release.
|
|
299
299
|
|
|
@@ -8,7 +8,6 @@ const core_2 = require("@yarnpkg/core");
|
|
|
8
8
|
const fslib_1 = require("@yarnpkg/fslib");
|
|
9
9
|
const clipanion_1 = require("clipanion");
|
|
10
10
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
11
|
-
const url_1 = require("url");
|
|
12
11
|
const vm_1 = require("vm");
|
|
13
12
|
const list_1 = require("./list");
|
|
14
13
|
// eslint-disable-next-line arca/no-default-export
|
|
@@ -39,7 +38,7 @@ class PluginImportCommand extends cli_1.BaseCommand {
|
|
|
39
38
|
let pluginUrl;
|
|
40
39
|
if (this.name.match(/^https?:/)) {
|
|
41
40
|
try {
|
|
42
|
-
new
|
|
41
|
+
new URL(this.name);
|
|
43
42
|
}
|
|
44
43
|
catch {
|
|
45
44
|
throw new core_1.ReportError(core_1.MessageName.INVALID_PLUGIN_REFERENCE, `Plugin specifier "${this.name}" is neither a plugin name nor a valid url`);
|
package/lib/commands/runIndex.js
CHANGED
|
@@ -3,9 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_1 = require("@yarnpkg/cli");
|
|
4
4
|
const core_1 = require("@yarnpkg/core");
|
|
5
5
|
const core_2 = require("@yarnpkg/core");
|
|
6
|
+
const clipanion_1 = require("clipanion");
|
|
6
7
|
const util_1 = require("util");
|
|
7
8
|
// eslint-disable-next-line arca/no-default-export
|
|
8
9
|
class RunIndexCommand extends cli_1.BaseCommand {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.json = clipanion_1.Option.Boolean(`--json`, false, {
|
|
13
|
+
description: `Format the output as an NDJSON stream`,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
9
16
|
async execute() {
|
|
10
17
|
const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins);
|
|
11
18
|
const { project, workspace } = await core_1.Project.find(configuration, this.context.cwd);
|
|
@@ -14,6 +21,7 @@ class RunIndexCommand extends cli_1.BaseCommand {
|
|
|
14
21
|
const report = await core_1.StreamReport.start({
|
|
15
22
|
configuration,
|
|
16
23
|
stdout: this.context.stdout,
|
|
24
|
+
json: this.json,
|
|
17
25
|
}, async (report) => {
|
|
18
26
|
const scripts = workspace.manifest.scripts;
|
|
19
27
|
const keys = core_2.miscUtils.sortMap(scripts.keys(), key => key);
|
|
@@ -25,8 +33,9 @@ class RunIndexCommand extends cli_1.BaseCommand {
|
|
|
25
33
|
const maxKeyLength = keys.reduce((max, key) => {
|
|
26
34
|
return Math.max(max, key.length);
|
|
27
35
|
}, 0);
|
|
28
|
-
for (const [key,
|
|
29
|
-
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${(0, util_1.inspect)(
|
|
36
|
+
for (const [key, script] of scripts.entries()) {
|
|
37
|
+
report.reportInfo(null, `${key.padEnd(maxKeyLength, ` `)} ${(0, util_1.inspect)(script, inspectConfig)}`);
|
|
38
|
+
report.reportJson({ name: key, script });
|
|
30
39
|
}
|
|
31
40
|
});
|
|
32
41
|
return report.exitCode();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"./package.json": "./package.json"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@yarnpkg/fslib": "^3.0.
|
|
11
|
+
"@yarnpkg/fslib": "^3.0.2",
|
|
12
12
|
"@yarnpkg/parsers": "^3.0.0",
|
|
13
13
|
"ci-info": "^3.2.0",
|
|
14
14
|
"clipanion": "^4.0.0-rc.2",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"typanion": "^3.14.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@yarnpkg/cli": "^4.
|
|
24
|
-
"@yarnpkg/core": "^4.0.
|
|
23
|
+
"@yarnpkg/cli": "^4.1.1",
|
|
24
|
+
"@yarnpkg/core": "^4.0.3",
|
|
25
25
|
"@yarnpkg/plugin-git": "^3.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/lodash": "^4.14.136",
|
|
29
29
|
"@types/micromatch": "^4.0.1",
|
|
30
30
|
"@types/semver": "^7.1.0",
|
|
31
|
-
"@yarnpkg/cli": "^4.
|
|
32
|
-
"@yarnpkg/core": "^4.0.
|
|
31
|
+
"@yarnpkg/cli": "^4.1.1",
|
|
32
|
+
"@yarnpkg/core": "^4.0.3",
|
|
33
33
|
"@yarnpkg/plugin-git": "^3.0.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|