oclif 4.3.5 → 4.3.6-dev.0
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/tarballs/build.js +15 -11
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/lib/tarballs/build.js
CHANGED
|
@@ -27,6 +27,18 @@ const isYarnProject = (yarnRootPath) => {
|
|
|
27
27
|
const rootYarnLockFilePath = path.join(yarnRootPath, yarnLockFileName);
|
|
28
28
|
return (0, node_fs_1.existsSync)(rootYarnLockFilePath);
|
|
29
29
|
};
|
|
30
|
+
const copyYarnDirectory = async (relativePath, yarnRootPath, workspacePath) => {
|
|
31
|
+
const rootYarnDirectoryPath = path.join(yarnRootPath, relativePath);
|
|
32
|
+
const workspaceYarnDirectoryPath = path.join(workspacePath, relativePath);
|
|
33
|
+
if ((0, node_fs_1.existsSync)(rootYarnDirectoryPath)) {
|
|
34
|
+
// create the directory if it does not exist
|
|
35
|
+
if (!(0, node_fs_1.existsSync)(workspaceYarnDirectoryPath)) {
|
|
36
|
+
await (0, promises_1.mkdir)(workspaceYarnDirectoryPath, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
// recursively copy all files in the directory
|
|
39
|
+
await (0, fs_extra_1.copy)(rootYarnDirectoryPath, workspaceYarnDirectoryPath);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
30
42
|
const copyCoreYarnFiles = async (yarnRootPath, workspacePath) => {
|
|
31
43
|
// copy yarn dependencies lock file
|
|
32
44
|
const yarnLockFileName = 'yarn.lock';
|
|
@@ -43,17 +55,9 @@ const copyCoreYarnFiles = async (yarnRootPath, workspacePath) => {
|
|
|
43
55
|
await (0, fs_extra_1.copy)(rootYarnConfigFilePath, workspaceYarnConfigFilePath);
|
|
44
56
|
}
|
|
45
57
|
// copy yarn releases e.g. yarn may be installed via a local config path like "yarnPath"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
}
|
|
58
|
+
await copyYarnDirectory('./.yarn/releases/', yarnRootPath, workspacePath);
|
|
59
|
+
// copy yarn plugins if they exists
|
|
60
|
+
await copyYarnDirectory('./.yarn/plugins/', yarnRootPath, workspacePath);
|
|
57
61
|
};
|
|
58
62
|
async function build(c, options = {}) {
|
|
59
63
|
const { config, xz } = c;
|
package/oclif.manifest.json
CHANGED