@vltpkg/vlx 0.0.0-17 → 0.0.0-19
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/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infer-default-executable.d.ts +2 -2
- package/dist/esm/infer-default-executable.d.ts.map +1 -1
- package/dist/esm/infer-default-executable.js.map +1 -1
- package/dist/esm/info.d.ts +2 -2
- package/dist/esm/info.d.ts.map +1 -1
- package/dist/esm/info.js.map +1 -1
- package/package.json +10 -10
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { InstallOptions } from '@vltpkg/graph';
|
|
2
2
|
import type { PackageInfoClientOptions, PackageInfoClientRequestOptions, Resolution } from '@vltpkg/package-info';
|
|
3
3
|
import type { Spec, SpecOptions } from '@vltpkg/spec';
|
|
4
|
-
import type { Integrity,
|
|
5
|
-
export type VlxManifest =
|
|
4
|
+
import type { Integrity, NormalizedManifest } from '@vltpkg/types';
|
|
5
|
+
export type VlxManifest = NormalizedManifest & {
|
|
6
6
|
vlx?: {
|
|
7
7
|
integrity?: Integrity;
|
|
8
8
|
signatures?: Resolution['signatures'];
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAC/B,UAAU,EACX,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mapp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AO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA","sourcesContent":["import type { InstallOptions } from '@vltpkg/graph'\nimport type {\n PackageInfoClientOptions,\n PackageInfoClientRequestOptions,\n Resolution,\n} from '@vltpkg/package-info'\nimport type { Spec, SpecOptions } from '@vltpkg/spec'\nimport type { Integrity,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA","sourcesContent":["import type { InstallOptions } from '@vltpkg/graph'\nimport type {\n PackageInfoClientOptions,\n PackageInfoClientRequestOptions,\n Resolution,\n} from '@vltpkg/package-info'\nimport type { Spec, SpecOptions } from '@vltpkg/spec'\nimport type { Integrity, NormalizedManifest } from '@vltpkg/types'\n\nexport type VlxManifest = NormalizedManifest & {\n vlx?: {\n integrity?: Integrity\n signatures?: Resolution['signatures']\n }\n}\n\n/**\n * Provide a promptFn which is `()=>Promise<string>` if you want to confirm\n * before installing things. If it returns a string that does not start with\n * the letter 'y', then operation will be aborted. If not provided, consent is\n * assumed.\n */\nexport type PromptFn = (\n pkgSpec: Spec,\n path: string,\n resolution: string,\n) => Promise<string>\n\n/** The info about a given vlx installation */\nexport type VlxInfo = VlxManifest['vlx'] & {\n /** name of the package that is being run */\n name: string\n\n /** version of the package being run */\n version?: string\n\n /**\n * path to the synthetic project for non-local installs, or to the\n * current projectRoot if the resolution is local.\n */\n path: string\n\n /**\n * resolution of the package installed, for non-local installs,\n * or a file URL into the node_modules for project local installs.\n */\n resolved: string\n\n /**\n * Full path to the inferred default binary for the dependency if it exists.\n */\n arg0?: string\n}\n\nexport type VlxOptions = SpecOptions &\n PackageInfoClientOptions &\n PackageInfoClientRequestOptions &\n InstallOptions & {\n package?: string\n yes?: boolean\n }\n\nexport { vlxDelete as delete } from './delete.ts'\nexport { vlxInfo as info } from './info.ts'\nexport { vlxInstall as install } from './install.ts'\nexport { vlxList as list } from './list.ts'\nexport { vlxResolve as resolve } from './resolve.ts'\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NormalizedManifest } from '@vltpkg/types';
|
|
2
2
|
/**
|
|
3
3
|
* Infer the default binary from a package.
|
|
4
4
|
*
|
|
5
5
|
* Returns `undefined` if it couldn't be determined
|
|
6
6
|
*/
|
|
7
|
-
export declare const inferDefaultExecutable: ({ name, bin, }:
|
|
7
|
+
export declare const inferDefaultExecutable: ({ name, bin, }: NormalizedManifest) => undefined | [string, string];
|
|
8
8
|
//# sourceMappingURL=infer-default-executable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer-default-executable.d.ts","sourceRoot":"","sources":["../../src/infer-default-executable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
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 +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,
|
|
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"]}
|
package/dist/esm/info.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NormalizedManifest } from '@vltpkg/types';
|
|
2
2
|
import type { VlxInfo, VlxOptions } from './index.ts';
|
|
3
|
-
export declare const vlxInfo: (path: string, options: VlxOptions, manifest?:
|
|
3
|
+
export declare const vlxInfo: (path: string, options: VlxOptions, manifest?: NormalizedManifest) => VlxInfo;
|
|
4
4
|
//# sourceMappingURL=info.d.ts.map
|
package/dist/esm/info.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAGvD,OAAO,KAAK,EAAE,OAAO,EAAe,UAAU,EAAE,MAAM,YAAY,CAAA;AAKlE,eAAO,MAAM,OAAO,SACZ,MAAM,WACH,UAAU,aACR,kBAAkB,KAC5B,OA8BF,CAAA"}
|
package/dist/esm/info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,IAAY,EACZ,OAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,IAAY,EACZ,OAAmB,EACnB,QAA6B,EACpB,EAAE;IACX,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAA;IACtC,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAE5B,IAAI,CAAC;QACH,yDAAyD;QACzD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAC/B,QAAQ,KAAK,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,QAAQ,CAAA;QAEtC,8DAA8D;QAC9D,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;YAC5D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAA;YAC7C,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;YAChD,MAAM,GAAG,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAA;YACtC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;YACrB,MAAM,EAAE,GAAG,EAAE,GAAG,QAAuB,CAAA;YACvC,OAAO;gBACL,IAAI;gBACJ,IAAI;gBACJ,OAAO,EAAE,EAAE,CAAC,OAAO;gBACnB,QAAQ;gBACR,IAAI;gBACJ,GAAG,GAAG;aACP,CAAA;QACH,CAAC;IACH,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC,+BAA+B,EAAE,EAAW,CAAC,CAAA;IAC3D,CAAC;IACD,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAA;AAC9C,CAAC,CAAA","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport type { NormalizedManifest } from '@vltpkg/types'\nimport { XDG } from '@vltpkg/xdg'\nimport { resolve } from 'node:path'\nimport type { VlxInfo, VlxManifest, VlxOptions } from './index.ts'\nimport { inferDefaultExecutable } from './infer-default-executable.ts'\n\nimport { mountPath } from './mount-path.ts'\n\nexport const vlxInfo = (\n path: string,\n options: VlxOptions,\n manifest?: NormalizedManifest,\n): VlxInfo => {\n const root = new XDG('vlt/vlx').data()\n path = mountPath(root, path)\n\n try {\n // do not allow it to traverse up or read arbitrary paths\n const { packageJson } = options\n manifest ??= packageJson.read(path)\n const { dependencies = {} } = manifest\n\n // every one of these has exactly one dep, on the resolved url\n for (const [name, resolved] of Object.entries(dependencies)) {\n const p = resolve(path, 'node_modules', name)\n const pj = packageJson.read(p, { reload: true })\n const def = inferDefaultExecutable(pj)\n const arg0 = def?.[0]\n const { vlx } = manifest as VlxManifest\n return {\n path,\n name,\n version: pj.version,\n resolved,\n arg0,\n ...vlx,\n }\n }\n } catch (er) {\n throw error('Could not get vlx information', er as Error)\n }\n throw error('Could not get vlx information')\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-19",
|
|
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-info": "0.0.0-
|
|
28
|
-
"@vltpkg/
|
|
29
|
-
"@vltpkg/spec": "0.0.0-
|
|
30
|
-
"@vltpkg/
|
|
31
|
-
"@vltpkg/
|
|
32
|
-
"@vltpkg/
|
|
24
|
+
"@vltpkg/cmd-shim": "0.0.0-19",
|
|
25
|
+
"@vltpkg/error-cause": "0.0.0-19",
|
|
26
|
+
"@vltpkg/rollback-remove": "0.0.0-19",
|
|
27
|
+
"@vltpkg/package-info": "0.0.0-19",
|
|
28
|
+
"@vltpkg/graph": "0.0.0-19",
|
|
29
|
+
"@vltpkg/spec": "0.0.0-19",
|
|
30
|
+
"@vltpkg/package-json": "0.0.0-19",
|
|
31
|
+
"@vltpkg/types": "0.0.0-19",
|
|
32
|
+
"@vltpkg/xdg": "0.0.0-19"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "^9.28.0",
|