@yarnpkg/plugin-essentials 4.0.0-rc.50 → 4.0.0-rc.51
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/info.js +2 -6
- package/lib/suggestUtils.js +4 -2
- package/package.json +9 -9
package/lib/commands/info.js
CHANGED
|
@@ -183,16 +183,12 @@ class InfoCommand extends cli_1.BaseCommand {
|
|
|
183
183
|
async (pkg, extra, registerData) => {
|
|
184
184
|
if (!extra.has(`cache`))
|
|
185
185
|
return;
|
|
186
|
-
const cacheOptions = {
|
|
187
|
-
mockedPackages: project.disabledLocators,
|
|
188
|
-
unstablePackages: project.conditionalLocators,
|
|
189
|
-
};
|
|
190
186
|
const checksum = project.storedChecksums.get(pkg.locatorHash) ?? null;
|
|
191
|
-
const cachePath = cache.getLocatorPath(pkg, checksum
|
|
187
|
+
const cachePath = cache.getLocatorPath(pkg, checksum);
|
|
192
188
|
let stat;
|
|
193
189
|
if (cachePath !== null) {
|
|
194
190
|
try {
|
|
195
|
-
stat = fslib_1.xfs.
|
|
191
|
+
stat = await fslib_1.xfs.statPromise(cachePath);
|
|
196
192
|
}
|
|
197
193
|
catch { }
|
|
198
194
|
}
|
package/lib/suggestUtils.js
CHANGED
|
@@ -269,6 +269,8 @@ async function getSuggestedDescriptors(request, { project, workspace, cache, tar
|
|
|
269
269
|
break;
|
|
270
270
|
case Strategy.LATEST:
|
|
271
271
|
{
|
|
272
|
+
const hasNetwork = project.configuration.get(`enableNetwork`);
|
|
273
|
+
const isOfflineMode = project.configuration.get(`enableOfflineMode`);
|
|
272
274
|
await trySuggest(async () => {
|
|
273
275
|
if (target === Target.PEER) {
|
|
274
276
|
suggested.push({
|
|
@@ -277,7 +279,7 @@ async function getSuggestedDescriptors(request, { project, workspace, cache, tar
|
|
|
277
279
|
reason: `(catch-all peer dependency pattern)`,
|
|
278
280
|
});
|
|
279
281
|
}
|
|
280
|
-
else if (!
|
|
282
|
+
else if (!hasNetwork && !isOfflineMode) {
|
|
281
283
|
suggested.push({
|
|
282
284
|
descriptor: null,
|
|
283
285
|
name: `Resolve from latest`,
|
|
@@ -290,7 +292,7 @@ async function getSuggestedDescriptors(request, { project, workspace, cache, tar
|
|
|
290
292
|
suggested.push({
|
|
291
293
|
descriptor: latest,
|
|
292
294
|
name: `Use ${core_2.structUtils.prettyDescriptor(project.configuration, latest)}`,
|
|
293
|
-
reason: `(resolved from latest)`,
|
|
295
|
+
reason: `(resolved from ${isOfflineMode ? `the cache` : `latest`})`,
|
|
294
296
|
});
|
|
295
297
|
}
|
|
296
298
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/plugin-essentials",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.51",
|
|
4
4
|
"stableVersion": "3.3.0",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"./package.json": "./package.json"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@yarnpkg/fslib": "^3.0.0-rc.
|
|
13
|
-
"@yarnpkg/parsers": "^3.0.0-rc.
|
|
12
|
+
"@yarnpkg/fslib": "^3.0.0-rc.51",
|
|
13
|
+
"@yarnpkg/parsers": "^3.0.0-rc.51",
|
|
14
14
|
"ci-info": "^3.2.0",
|
|
15
15
|
"clipanion": "^4.0.0-rc.2",
|
|
16
16
|
"enquirer": "^2.3.6",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"typanion": "^3.14.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@yarnpkg/cli": "^4.0.0-rc.
|
|
25
|
-
"@yarnpkg/core": "^4.0.0-rc.
|
|
26
|
-
"@yarnpkg/plugin-git": "^3.0.0-rc.
|
|
24
|
+
"@yarnpkg/cli": "^4.0.0-rc.51",
|
|
25
|
+
"@yarnpkg/core": "^4.0.0-rc.51",
|
|
26
|
+
"@yarnpkg/plugin-git": "^3.0.0-rc.51"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/lodash": "^4.14.136",
|
|
30
30
|
"@types/micromatch": "^4.0.1",
|
|
31
31
|
"@types/semver": "^7.1.0",
|
|
32
|
-
"@yarnpkg/cli": "^4.0.0-rc.
|
|
33
|
-
"@yarnpkg/core": "^4.0.0-rc.
|
|
34
|
-
"@yarnpkg/plugin-git": "^3.0.0-rc.
|
|
32
|
+
"@yarnpkg/cli": "^4.0.0-rc.51",
|
|
33
|
+
"@yarnpkg/core": "^4.0.0-rc.51",
|
|
34
|
+
"@yarnpkg/plugin-git": "^3.0.0-rc.51"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|