oclif 4.1.0 → 4.1.2

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.
@@ -76,8 +76,7 @@ class Manifest extends core_1.Command {
76
76
  throw new Error('plugin not found');
77
77
  await plugin.load();
78
78
  if (!plugin.valid) {
79
- const p = require.resolve('@oclif/plugin-legacy', { paths: [process.cwd()] });
80
- const { PluginLegacy } = require(p);
79
+ const { PluginLegacy } = await Promise.resolve().then(() => require('@oclif/plugin-legacy'));
81
80
  plugin = new PluginLegacy(this.config, plugin);
82
81
  await plugin.load();
83
82
  }
@@ -156,6 +156,7 @@ Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
156
156
  }
157
157
  const config = await core_1.Config.load({ devPlugins: false, root: cwd, userPlugins: false });
158
158
  try {
159
+ // eslint-disable-next-line node/no-missing-require
159
160
  const p = require.resolve('@oclif/plugin-legacy', { paths: [cwd] });
160
161
  const plugin = new core_1.Plugin({ root: p, type: 'core' });
161
162
  await plugin.load();
@@ -22,6 +22,39 @@ const pack = async (from, to) => {
22
22
  ? await exec(`tar czf ${to} ${path.basename(from)}`, { cwd })
23
23
  : await exec(`tar cfJ ${to} ${path.basename(from)}`, { cwd });
24
24
  };
25
+ const isYarnProject = (yarnRootPath) => {
26
+ const yarnLockFileName = 'yarn.lock';
27
+ const rootYarnLockFilePath = path.join(yarnRootPath, yarnLockFileName);
28
+ return (0, node_fs_1.existsSync)(rootYarnLockFilePath);
29
+ };
30
+ const copyCoreYarnFiles = async (yarnRootPath, workspacePath) => {
31
+ // copy yarn dependencies lock file
32
+ const yarnLockFileName = 'yarn.lock';
33
+ const rootYarnLockFilePath = path.join(yarnRootPath, yarnLockFileName);
34
+ const workspaceYarnLockFilePath = path.join(workspacePath, yarnLockFileName);
35
+ if ((0, node_fs_1.existsSync)(rootYarnLockFilePath)) {
36
+ await (0, fs_extra_1.copy)(rootYarnLockFilePath, workspaceYarnLockFilePath);
37
+ }
38
+ // copy yarn configuration file
39
+ const yarnConfigFileName = '.yarnrc.yml';
40
+ const rootYarnConfigFilePath = path.join(yarnRootPath, yarnConfigFileName);
41
+ const workspaceYarnConfigFilePath = path.join(workspacePath, yarnConfigFileName);
42
+ if ((0, node_fs_1.existsSync)(rootYarnConfigFilePath)) {
43
+ await (0, fs_extra_1.copy)(rootYarnConfigFilePath, workspaceYarnConfigFilePath);
44
+ }
45
+ // copy yarn releases e.g. yarn may be installed via a local config path like "yarnPath"
46
+ const yarnReleasesDirectoryRelativePath = './.yarn/releases/';
47
+ const rootYarnReleasesDirectoryPath = path.join(yarnRootPath, yarnReleasesDirectoryRelativePath);
48
+ const workspaceYarnReleasesDirectoryPath = path.join(workspacePath, yarnReleasesDirectoryRelativePath);
49
+ if ((0, node_fs_1.existsSync)(rootYarnReleasesDirectoryPath)) {
50
+ // create the directory if it does not exist
51
+ if (!(0, node_fs_1.existsSync)(workspaceYarnReleasesDirectoryPath)) {
52
+ await (0, promises_1.mkdir)(workspaceYarnReleasesDirectoryPath, { recursive: true });
53
+ }
54
+ // recursively copy all files in the directory
55
+ await (0, fs_extra_1.copy)(rootYarnReleasesDirectoryPath, workspaceYarnReleasesDirectoryPath);
56
+ }
57
+ };
25
58
  async function build(c, options = {}) {
26
59
  const { config, xz } = c;
27
60
  const packCLI = async () => {
@@ -52,8 +85,8 @@ async function build(c, options = {}) {
52
85
  };
53
86
  const addDependencies = async () => {
54
87
  const yarnRoot = findYarnWorkspaceRoot(c.root) || c.root;
55
- if ((0, node_fs_1.existsSync)(path.join(yarnRoot, 'yarn.lock'))) {
56
- await (0, fs_extra_1.copy)(path.join(yarnRoot, 'yarn.lock'), path.join(c.workspace(), 'yarn.lock'));
88
+ if (isYarnProject(yarnRoot)) {
89
+ await copyCoreYarnFiles(yarnRoot, c.workspace());
57
90
  const { stdout } = await exec('yarn -v');
58
91
  const yarnVersion = stdout.charAt(0);
59
92
  if (yarnVersion === '1') {
@@ -1,7 +1,20 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./bin"), exports);
5
- tslib_1.__exportStar(require("./build"), exports);
6
- tslib_1.__exportStar(require("./config"), exports);
7
- tslib_1.__exportStar(require("./node"), exports);
17
+ __exportStar(require("./bin"), exports);
18
+ __exportStar(require("./build"), exports);
19
+ __exportStar(require("./config"), exports);
20
+ __exportStar(require("./node"), exports);
@@ -717,5 +717,5 @@
717
717
  ]
718
718
  }
719
719
  },
720
- "version": "4.1.0"
720
+ "version": "4.1.2"
721
721
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "oclif",
3
3
  "description": "oclif: create your own CLI",
4
- "version": "4.1.0",
4
+ "version": "4.1.2",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run.js"
8
8
  },
9
9
  "bugs": "https://github.com/oclif/oclif/issues",
10
10
  "dependencies": {
11
- "@oclif/core": "^3.0.4",
12
- "@oclif/plugin-help": "^5.2.14",
13
- "@oclif/plugin-not-found": "^2.3.32",
14
- "@oclif/plugin-warn-if-update-available": "^3.0.0",
11
+ "@oclif/core": "^3.16.0",
12
+ "@oclif/plugin-help": "^6.0.9",
13
+ "@oclif/plugin-not-found": "^3.0.7",
14
+ "@oclif/plugin-warn-if-update-available": "^3.0.8",
15
15
  "async-retry": "^1.3.3",
16
16
  "aws-sdk": "^2.1231.0",
17
17
  "change-case": "^4",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@commitlint/config-conventional": "^17.7.0",
32
- "@oclif/plugin-legacy": "^1.3.0",
32
+ "@oclif/plugin-legacy": "^2.0.4",
33
33
  "@oclif/prettier-config": "^0.2.1",
34
34
  "@oclif/test": "^3.1.2",
35
35
  "@types/async-retry": "^1.4.5",