@vltpkg/vlx 0.0.0-12 → 0.0.0-13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer-default-executable.d.ts","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mBAGhC,QAAQ,KAAG,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"infer-default-executable.d.ts","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mBAGhC,QAAQ,KAAG,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAqBxC,CAAA"}
|
|
@@ -6,12 +6,18 @@
|
|
|
6
6
|
export const inferDefaultExecutable = ({ name, bin, }) => {
|
|
7
7
|
if (!bin)
|
|
8
8
|
return undefined;
|
|
9
|
-
|
|
9
|
+
let binName = name?.startsWith('@') ? name.split('/')[1] : name;
|
|
10
10
|
if (!binName)
|
|
11
11
|
return undefined;
|
|
12
12
|
if (typeof bin === 'string') {
|
|
13
13
|
return [binName, bin];
|
|
14
14
|
}
|
|
15
|
+
// if it's exactly one key, that's the one,
|
|
16
|
+
// even if it doesn't match the name
|
|
17
|
+
const keys = Object.keys(bin);
|
|
18
|
+
if (keys.length === 1) {
|
|
19
|
+
binName = keys[0];
|
|
20
|
+
}
|
|
15
21
|
bin = bin[binName];
|
|
16
22
|
if (!bin)
|
|
17
23
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer-default-executable.js","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,GAAG,GACM,EAAgC,EAAE;IAC3C,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,
|
|
1
|
+
{"version":3,"file":"infer-default-executable.js","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,GAAG,GACM,EAAgC,EAAE;IAC3C,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,IAAI,OAAO,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAE9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACvB,CAAC;IAED,2CAA2C;IAC3C,oCAAoC;IACpC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,GAAI,IAAiB,CAAC,CAAC,CAAC,CAAA;IACjC,CAAC;IAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACvB,CAAC,CAAA","sourcesContent":["import type { Manifest } from '@vltpkg/types'\n\n/**\n * Infer the default binary from a package.\n *\n * Returns `undefined` if it couldn't be determined\n */\nexport const inferDefaultExecutable = ({\n name,\n bin,\n}: Manifest): undefined | [string, string] => {\n if (!bin) return undefined\n\n let binName = name?.startsWith('@') ? name.split('/')[1] : name\n if (!binName) return undefined\n\n if (typeof bin === 'string') {\n return [binName, bin]\n }\n\n // if it's exactly one key, that's the one,\n // even if it doesn't match the name\n const keys = Object.keys(bin)\n if (keys.length === 1) {\n binName = (keys as [string])[0]\n }\n\n bin = bin[binName]\n if (!bin) return undefined\n\n return [binName, bin]\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/vlx",
|
|
3
3
|
"description": "vlt exec management",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-13",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"path-scurry": "^2.0.0",
|
|
23
23
|
"walk-up-path": "^4.0.0",
|
|
24
|
-
"@vltpkg/cmd-shim": "0.0.0-
|
|
25
|
-
"@vltpkg/
|
|
26
|
-
"@vltpkg/
|
|
27
|
-
"@vltpkg/package-
|
|
28
|
-
"@vltpkg/package-
|
|
29
|
-
"@vltpkg/rollback-remove": "0.0.0-
|
|
30
|
-
"@vltpkg/spec": "0.0.0-
|
|
31
|
-
"@vltpkg/types": "0.0.0-
|
|
32
|
-
"@vltpkg/xdg": "0.0.0-
|
|
24
|
+
"@vltpkg/cmd-shim": "0.0.0-13",
|
|
25
|
+
"@vltpkg/error-cause": "0.0.0-13",
|
|
26
|
+
"@vltpkg/graph": "0.0.0-13",
|
|
27
|
+
"@vltpkg/package-info": "0.0.0-13",
|
|
28
|
+
"@vltpkg/package-json": "0.0.0-13",
|
|
29
|
+
"@vltpkg/rollback-remove": "0.0.0-13",
|
|
30
|
+
"@vltpkg/spec": "0.0.0-13",
|
|
31
|
+
"@vltpkg/types": "0.0.0-13",
|
|
32
|
+
"@vltpkg/xdg": "0.0.0-13"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "^9.25.1",
|