oclif 3.6.3 → 3.6.5
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/.oclif.manifest.json +1 -1
- package/lib/commands/manifest.js +5 -4
- package/package.json +1 -1
package/.oclif.manifest.json
CHANGED
package/lib/commands/manifest.js
CHANGED
|
@@ -17,27 +17,28 @@ async function fileExists(filePath) {
|
|
|
17
17
|
}
|
|
18
18
|
class Manifest extends core_1.Command {
|
|
19
19
|
async run() {
|
|
20
|
+
var _a;
|
|
20
21
|
const { flags } = await this.parse(Manifest);
|
|
21
22
|
try {
|
|
22
23
|
fs.unlinkSync('oclif.manifest.json');
|
|
23
24
|
}
|
|
24
|
-
catch (
|
|
25
|
+
catch (_b) { }
|
|
25
26
|
const { args } = await this.parse(Manifest);
|
|
26
27
|
const root = path.resolve(args.path);
|
|
27
28
|
const packageJson = fs.readJSONSync('package.json');
|
|
28
29
|
let jitPluginManifests = [];
|
|
29
|
-
if (flags.jit && packageJson.oclif.jitPlugins) {
|
|
30
|
+
if (flags.jit && ((_a = packageJson.oclif) === null || _a === void 0 ? void 0 : _a.jitPlugins)) {
|
|
30
31
|
this.debug('jitPlugins: %s', packageJson.oclif.jitPlugins);
|
|
31
32
|
const tmpDir = os.tmpdir();
|
|
32
33
|
const promises = Object.entries(packageJson.oclif.jitPlugins).map(async ([jitPlugin, version]) => {
|
|
33
34
|
const pluginDir = jitPlugin.replace('/', '-').replace('@', '');
|
|
34
|
-
const repo = this.executeCommand(`npm view ${jitPlugin} repository --json`);
|
|
35
|
+
const repo = this.executeCommand(`npm view ${jitPlugin}@latest repository --json`);
|
|
35
36
|
const stdout = JSON.parse(repo.stdout);
|
|
36
37
|
const repoUrl = stdout.url.replace(`${stdout.type}+`, '');
|
|
37
38
|
const fullPath = path.join(tmpDir, pluginDir);
|
|
38
39
|
if (await fileExists(fullPath))
|
|
39
40
|
await fs.remove(fullPath);
|
|
40
|
-
const versions = JSON.parse(this.executeCommand(`npm view ${jitPlugin} versions --json`).stdout);
|
|
41
|
+
const versions = JSON.parse(this.executeCommand(`npm view ${jitPlugin}@latest versions --json`).stdout);
|
|
41
42
|
const maxSatisfying = semver.maxSatisfying(versions, version);
|
|
42
43
|
this.cloneRepo(repoUrl, fullPath, maxSatisfying);
|
|
43
44
|
this.executeCommand('yarn', { cwd: fullPath });
|