@vltpkg/vlx 0.0.0-31 → 1.0.0-rc.1

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,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mBAGhC,kBAAkB,KAAG,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAqBlD,CAAA"}
1
+ {"version":3,"file":"infer-default-executable.d.ts","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mBAGhC,kBAAkB,KAAG,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAiBlD,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { parseScope } from '@vltpkg/types';
1
2
  /**
2
3
  * Infer the default binary from a package.
3
4
  *
@@ -6,21 +7,18 @@
6
7
  export const inferDefaultExecutable = ({ name, bin, }) => {
7
8
  if (!bin)
8
9
  return undefined;
9
- let binName = name?.startsWith('@') ? name.split('/')[1] : name;
10
+ let [, binName] = parseScope(name ?? '');
10
11
  if (!binName)
11
12
  return undefined;
12
- if (typeof bin === 'string') {
13
- return [binName, bin];
14
- }
15
13
  // if it's exactly one key, that's the one,
16
14
  // even if it doesn't match the name
17
15
  const keys = Object.keys(bin);
18
16
  if (keys.length === 1) {
19
17
  binName = keys[0];
20
18
  }
21
- bin = bin[binName];
22
- if (!bin)
19
+ const res = bin[binName];
20
+ if (!res)
23
21
  return undefined;
24
- return [binName, bin];
22
+ return [binName, res];
25
23
  };
26
24
  //# sourceMappingURL=infer-default-executable.js.map
@@ -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,GACgB,EAAgC,EAAE;IACrD,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 { NormalizedManifest } 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}: NormalizedManifest): 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"]}
1
+ {"version":3,"file":"infer-default-executable.js","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,GAAG,GACgB,EAAgC,EAAE;IACrD,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,IAAI,CAAC,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IACxC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAE9B,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,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAA;IACxB,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACvB,CAAC,CAAA","sourcesContent":["import { parseScope } from '@vltpkg/types'\nimport type { NormalizedManifest } 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}: NormalizedManifest): undefined | [string, string] => {\n if (!bin) return undefined\n\n let [, binName] = parseScope(name ?? '')\n if (!binName) return undefined\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 const res = bin[binName]\n if (!res) return undefined\n\n return [binName, res]\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-31",
4
+ "version": "1.0.0-rc.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -22,15 +22,15 @@
22
22
  "dependencies": {
23
23
  "path-scurry": "^2.0.0",
24
24
  "walk-up-path": "^4.0.0",
25
- "@vltpkg/cmd-shim": "0.0.0-31",
26
- "@vltpkg/graph": "0.0.0-31",
27
- "@vltpkg/package-info": "0.0.0-31",
28
- "@vltpkg/error-cause": "0.0.0-31",
29
- "@vltpkg/rollback-remove": "0.0.0-31",
30
- "@vltpkg/spec": "0.0.0-31",
31
- "@vltpkg/package-json": "0.0.0-31",
32
- "@vltpkg/types": "0.0.0-31",
33
- "@vltpkg/xdg": "0.0.0-31"
25
+ "@vltpkg/graph": "1.0.0-rc.1",
26
+ "@vltpkg/error-cause": "1.0.0-rc.1",
27
+ "@vltpkg/package-info": "1.0.0-rc.1",
28
+ "@vltpkg/package-json": "1.0.0-rc.1",
29
+ "@vltpkg/types": "1.0.0-rc.1",
30
+ "@vltpkg/rollback-remove": "1.0.0-rc.1",
31
+ "@vltpkg/xdg": "1.0.0-rc.1",
32
+ "@vltpkg/spec": "1.0.0-rc.1",
33
+ "@vltpkg/cmd-shim": "1.0.0-rc.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@eslint/js": "^9.34.0",