oclif 4.1.4 → 4.2.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/bin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Interfaces } from '@oclif/core';
|
|
2
|
-
export declare function writeBinScripts({ baseWorkspace, config, nodeVersion, }: {
|
|
2
|
+
export declare function writeBinScripts({ baseWorkspace, config, nodeOptions, nodeVersion, }: {
|
|
3
3
|
baseWorkspace: string;
|
|
4
4
|
config: Interfaces.Config;
|
|
5
|
+
nodeOptions: string[];
|
|
5
6
|
nodeVersion: string;
|
|
6
7
|
}): Promise<void>;
|
package/lib/tarballs/bin.js
CHANGED
|
@@ -6,7 +6,7 @@ const fs = require("node:fs");
|
|
|
6
6
|
const path = require("node:path");
|
|
7
7
|
const node_util_1 = require("node:util");
|
|
8
8
|
const exec = (0, node_util_1.promisify)(node_child_process_1.exec);
|
|
9
|
-
async function writeBinScripts({ baseWorkspace, config, nodeVersion, }) {
|
|
9
|
+
async function writeBinScripts({ baseWorkspace, config, nodeOptions, nodeVersion, }) {
|
|
10
10
|
const binPathEnvVar = config.scopedEnvVarKey('BINPATH');
|
|
11
11
|
const redirectedEnvVar = config.scopedEnvVarKey('REDIRECTED');
|
|
12
12
|
const clientHomeEnvVar = config.scopedEnvVarKey('OCLIF_CLIENT_HOME');
|
|
@@ -21,12 +21,13 @@ if not "%${redirectedEnvVar}%"=="1" if exist "%LOCALAPPDATA%\\${bin}\\client\\bi
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
if not defined ${binPathEnvVar} set ${binPathEnvVar}="%~dp0${bin}.cmd"
|
|
24
|
+
|
|
24
25
|
if exist "%~dp0..\\bin\\node.exe" (
|
|
25
|
-
"%~dp0..\\bin\\node.exe" "%~dp0..\\bin\\run" %*
|
|
26
|
+
"%~dp0..\\bin\\node.exe" ${`${nodeOptions.join(' ')} `}"%~dp0..\\bin\\run" %*
|
|
26
27
|
) else if exist "%LOCALAPPDATA%\\oclif\\node\\node-${nodeVersion}.exe" (
|
|
27
|
-
"%LOCALAPPDATA%\\oclif\\node\\node-${nodeVersion}.exe" "%~dp0..\\bin\\run" %*
|
|
28
|
+
"%LOCALAPPDATA%\\oclif\\node\\node-${nodeVersion}.exe" ${`${nodeOptions.join(' ')} `}"%~dp0..\\bin\\run" %*
|
|
28
29
|
) else (
|
|
29
|
-
node "%~dp0..\\bin\\run" %*
|
|
30
|
+
node ${`${nodeOptions.join(' ')} `}"%~dp0..\\bin\\run" %*
|
|
30
31
|
)
|
|
31
32
|
`);
|
|
32
33
|
};
|
|
@@ -73,9 +74,9 @@ else
|
|
|
73
74
|
exit 1
|
|
74
75
|
fi
|
|
75
76
|
if [ "\$DEBUG" == "*" ]; then
|
|
76
|
-
echoerr ${binPathEnvVar}="\$${binPathEnvVar}" "\$NODE" "\$DIR/run" "\$@"
|
|
77
|
+
echoerr ${binPathEnvVar}="\$${binPathEnvVar}" "\$NODE" ${`${nodeOptions.join(' ')} `}"\$DIR/run" "\$@"
|
|
77
78
|
fi
|
|
78
|
-
"\$NODE" "\$DIR/run" "\$@"
|
|
79
|
+
"\$NODE" ${`${nodeOptions.join(' ')} `}"\$DIR/run" "\$@"
|
|
79
80
|
fi
|
|
80
81
|
`, { mode: 0o755 });
|
|
81
82
|
};
|
package/lib/tarballs/build.js
CHANGED
|
@@ -201,7 +201,7 @@ async function build(c, options = {}) {
|
|
|
201
201
|
await extractCLI(options.tarball ?? (await packCLI()));
|
|
202
202
|
await updatePJSON();
|
|
203
203
|
await addDependencies();
|
|
204
|
-
await (0, bin_1.writeBinScripts)({ baseWorkspace: c.workspace(), config, nodeVersion: c.nodeVersion });
|
|
204
|
+
await (0, bin_1.writeBinScripts)({ baseWorkspace: c.workspace(), config, nodeOptions: c.nodeOptions, nodeVersion: c.nodeVersion });
|
|
205
205
|
await pretarball();
|
|
206
206
|
const targetsToBuild = c.targets.filter((t) => !options.platform || options.platform === t.platform);
|
|
207
207
|
if (options.parallel) {
|
package/lib/tarballs/config.d.ts
CHANGED
package/lib/tarballs/config.js
CHANGED
|
@@ -31,6 +31,7 @@ async function buildConfig(root, options = {}) {
|
|
|
31
31
|
const updateConfig = config.pjson.oclif.update || {};
|
|
32
32
|
updateConfig.s3 = updateConfig.s3 || {};
|
|
33
33
|
const nodeVersion = updateConfig.node.version || process.versions.node;
|
|
34
|
+
const nodeOptions = (0, util_1.castArray)(updateConfig.node.options ?? []);
|
|
34
35
|
const targets = (0, util_1.compact)(options.targets || updateConfig.node.targets || exports.TARGETS)
|
|
35
36
|
.filter((t) => {
|
|
36
37
|
if (t === 'darwin-arm64' && semver.lt(nodeVersion, '16.0.0')) {
|
|
@@ -47,6 +48,7 @@ async function buildConfig(root, options = {}) {
|
|
|
47
48
|
config,
|
|
48
49
|
dist: (...args) => path.join(config.root, 'dist', ...args),
|
|
49
50
|
gitSha: _gitSha,
|
|
51
|
+
nodeOptions,
|
|
50
52
|
nodeVersion,
|
|
51
53
|
root,
|
|
52
54
|
s3Config: updateConfig.s3,
|
package/oclif.manifest.json
CHANGED