@vantail/runtime 0.1.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/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +137 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -0
- package/platforms.json +10 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding the native runtime.
|
|
3
|
+
*
|
|
4
|
+
* Application developers never compile Rust. The runtime is a precompiled
|
|
5
|
+
* binary published per platform, and this module is the only thing that knows
|
|
6
|
+
* where it might be:
|
|
7
|
+
*
|
|
8
|
+
* 1. `$VANTAIL_RUNTIME_BIN` - an explicit override, for CI and for anyone
|
|
9
|
+
* hacking on the runtime itself.
|
|
10
|
+
* 2. `@vantail/runtime-<platform>-<arch>` - the published binary, installed
|
|
11
|
+
* as an optional dependency so only the current platform is downloaded.
|
|
12
|
+
* 3. A `cargo build` inside this repository - how Vantail's own examples run
|
|
13
|
+
* before anything is published.
|
|
14
|
+
*/
|
|
15
|
+
export type RuntimeSource = "env" | "package" | "workspace";
|
|
16
|
+
export interface RuntimeResolution {
|
|
17
|
+
/** Absolute path to the runtime executable. */
|
|
18
|
+
path: string;
|
|
19
|
+
source: RuntimeSource;
|
|
20
|
+
/** The npm package it came from, when it came from one. */
|
|
21
|
+
package?: string;
|
|
22
|
+
/** Which Cargo profile a workspace build came from. */
|
|
23
|
+
profile?: "release" | "debug";
|
|
24
|
+
}
|
|
25
|
+
export interface ResolveOptions {
|
|
26
|
+
/** Where to start looking for a project or workspace. Defaults to `cwd`. */
|
|
27
|
+
cwd?: string;
|
|
28
|
+
platform?: NodeJS.Platform;
|
|
29
|
+
arch?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Which local build to prefer when both exist. Only affects the workspace
|
|
32
|
+
* fallback; a published package has no profiles.
|
|
33
|
+
*
|
|
34
|
+
* - `newest` (default) - whatever was built last, which is what you want
|
|
35
|
+
* while iterating on the runtime.
|
|
36
|
+
* - `release` - for packaging, where picking up a debug build means
|
|
37
|
+
* shipping something ten times the size for no reason.
|
|
38
|
+
*/
|
|
39
|
+
prefer?: "newest" | "release";
|
|
40
|
+
}
|
|
41
|
+
export declare class RuntimeNotFoundError extends Error {
|
|
42
|
+
readonly packageName: string;
|
|
43
|
+
constructor(packageName: string, tried: string[]);
|
|
44
|
+
}
|
|
45
|
+
/** The npm package that carries the runtime for a platform. */
|
|
46
|
+
export declare function runtimePackageName(platform?: NodeJS.Platform, arch?: string): string;
|
|
47
|
+
export declare function runtimeBinaryName(platform?: NodeJS.Platform): string;
|
|
48
|
+
export declare function resolveRuntimeBinary(options?: ResolveOptions): RuntimeResolution;
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,YAAY,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAS/C;CACF;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAChC,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAqB,GAC1B,MAAM,CAER;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAEtF;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,cAAmB,GAAG,iBAAiB,CAqBpF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding the native runtime.
|
|
3
|
+
*
|
|
4
|
+
* Application developers never compile Rust. The runtime is a precompiled
|
|
5
|
+
* binary published per platform, and this module is the only thing that knows
|
|
6
|
+
* where it might be:
|
|
7
|
+
*
|
|
8
|
+
* 1. `$VANTAIL_RUNTIME_BIN` - an explicit override, for CI and for anyone
|
|
9
|
+
* hacking on the runtime itself.
|
|
10
|
+
* 2. `@vantail/runtime-<platform>-<arch>` - the published binary, installed
|
|
11
|
+
* as an optional dependency so only the current platform is downloaded.
|
|
12
|
+
* 3. A `cargo build` inside this repository - how Vantail's own examples run
|
|
13
|
+
* before anything is published.
|
|
14
|
+
*/
|
|
15
|
+
import { createRequire } from "node:module";
|
|
16
|
+
import { existsSync, statSync } from "node:fs";
|
|
17
|
+
import { dirname, join, resolve as resolvePath } from "node:path";
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
export class RuntimeNotFoundError extends Error {
|
|
20
|
+
packageName;
|
|
21
|
+
constructor(packageName, tried) {
|
|
22
|
+
super(`Could not find the Vantail runtime for this platform.\n\n` +
|
|
23
|
+
`Install it with:\n npm install --save-optional ${packageName}\n\n` +
|
|
24
|
+
`Or point at a build of your own:\n export VANTAIL_RUNTIME_BIN=/path/to/vantail-runtime\n\n` +
|
|
25
|
+
`Looked in:\n${tried.map((path) => ` ${path}`).join("\n")}`);
|
|
26
|
+
this.name = "RuntimeNotFoundError";
|
|
27
|
+
this.packageName = packageName;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** The npm package that carries the runtime for a platform. */
|
|
31
|
+
export function runtimePackageName(platform = process.platform, arch = process.arch) {
|
|
32
|
+
return `@vantail/runtime-${platform}-${arch}`;
|
|
33
|
+
}
|
|
34
|
+
export function runtimeBinaryName(platform = process.platform) {
|
|
35
|
+
return platform === "win32" ? "vantail-runtime.exe" : "vantail-runtime";
|
|
36
|
+
}
|
|
37
|
+
export function resolveRuntimeBinary(options = {}) {
|
|
38
|
+
const platform = options.platform ?? process.platform;
|
|
39
|
+
const arch = options.arch ?? process.arch;
|
|
40
|
+
const cwd = options.cwd ?? process.cwd();
|
|
41
|
+
const packageName = runtimePackageName(platform, arch);
|
|
42
|
+
const tried = [];
|
|
43
|
+
const override = process.env["VANTAIL_RUNTIME_BIN"];
|
|
44
|
+
if (override) {
|
|
45
|
+
const path = resolvePath(override);
|
|
46
|
+
if (isExecutable(path))
|
|
47
|
+
return { path, source: "env" };
|
|
48
|
+
tried.push(`${path} (from $VANTAIL_RUNTIME_BIN)`);
|
|
49
|
+
}
|
|
50
|
+
const fromPackage = fromInstalledPackage(packageName, platform, cwd, tried);
|
|
51
|
+
if (fromPackage)
|
|
52
|
+
return fromPackage;
|
|
53
|
+
const fromWorkspace = fromCargoTarget(cwd, platform, tried, options.prefer ?? "newest");
|
|
54
|
+
if (fromWorkspace)
|
|
55
|
+
return fromWorkspace;
|
|
56
|
+
throw new RuntimeNotFoundError(packageName, tried);
|
|
57
|
+
}
|
|
58
|
+
function fromInstalledPackage(packageName, platform, cwd, tried) {
|
|
59
|
+
const binary = runtimeBinaryName(platform);
|
|
60
|
+
// Resolve from the project first, then from this package, so an app can pin
|
|
61
|
+
// a runtime version that differs from the CLI's.
|
|
62
|
+
for (const from of [join(cwd, "package.json"), fileURLToPath(import.meta.url)]) {
|
|
63
|
+
try {
|
|
64
|
+
const require = createRequire(from);
|
|
65
|
+
const manifest = require.resolve(`${packageName}/package.json`);
|
|
66
|
+
const path = join(dirname(manifest), "bin", binary);
|
|
67
|
+
if (isExecutable(path))
|
|
68
|
+
return { path, source: "package", package: packageName };
|
|
69
|
+
tried.push(path);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Not installed here; try the next resolution root.
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
tried.push(`${packageName} (not installed)`);
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Find a locally built runtime by walking up for the Cargo workspace that
|
|
80
|
+
* contains it. Only used when developing Vantail itself.
|
|
81
|
+
*/
|
|
82
|
+
function fromCargoTarget(cwd, platform, tried, prefer) {
|
|
83
|
+
const binary = runtimeBinaryName(platform);
|
|
84
|
+
const roots = [cwd, dirname(fileURLToPath(import.meta.url))];
|
|
85
|
+
for (const start of roots) {
|
|
86
|
+
for (const root of ancestors(start)) {
|
|
87
|
+
if (!existsSync(join(root, "runtime", "Cargo.toml")))
|
|
88
|
+
continue;
|
|
89
|
+
const candidates = ["release", "debug"]
|
|
90
|
+
.map((profile) => ({ profile, path: join(root, "target", profile, binary) }))
|
|
91
|
+
.map((candidate) => ({ ...candidate, built: builtAt(candidate.path) }))
|
|
92
|
+
.filter((candidate) => candidate.built !== undefined)
|
|
93
|
+
.sort((a, b) => prefer === "release"
|
|
94
|
+
? // Release first, whenever there is one.
|
|
95
|
+
Number(b.profile === "release") - Number(a.profile === "release")
|
|
96
|
+
: // Otherwise whatever was built last: preferring release outright
|
|
97
|
+
// means a `cargo build` while debugging silently changes
|
|
98
|
+
// nothing, which is a confusing hour to spend.
|
|
99
|
+
b.built - a.built);
|
|
100
|
+
const newest = candidates[0];
|
|
101
|
+
if (newest) {
|
|
102
|
+
return { path: newest.path, source: "workspace", profile: newest.profile };
|
|
103
|
+
}
|
|
104
|
+
tried.push(join(root, "target", "{release,debug}", binary));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
/** Modification time, or `undefined` when there is no such file. */
|
|
110
|
+
function builtAt(path) {
|
|
111
|
+
try {
|
|
112
|
+
const info = statSync(path);
|
|
113
|
+
return info.isFile() ? info.mtimeMs : undefined;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function* ancestors(from) {
|
|
120
|
+
let current = resolvePath(from);
|
|
121
|
+
while (true) {
|
|
122
|
+
yield current;
|
|
123
|
+
const parent = dirname(current);
|
|
124
|
+
if (parent === current)
|
|
125
|
+
return;
|
|
126
|
+
current = parent;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function isExecutable(path) {
|
|
130
|
+
try {
|
|
131
|
+
return statSync(path).isFile();
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+BzC,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,WAAW,CAAS;IAE7B,YAAY,WAAmB,EAAE,KAAe;QAC9C,KAAK,CACH,2DAA2D;YACzD,mDAAmD,WAAW,MAAM;YACpE,6FAA6F;YAC7F,eAAe,KAAK,CAAC,GAAG,CAAC,CA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AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vantail/runtime",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Locates the precompiled Vantail native runtime for the current platform.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Vantail/vantail.git",
|
|
9
|
+
"directory": "packages/runtime"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Vantail/vantail",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"platforms.json"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
26
|
+
},
|
|
27
|
+
"optionalDependencies": {
|
|
28
|
+
"@vantail/runtime-darwin-arm64": "0.1.0",
|
|
29
|
+
"@vantail/runtime-win32-x64": "0.1.0",
|
|
30
|
+
"@vantail/runtime-win32-arm64": "0.1.0",
|
|
31
|
+
"@vantail/runtime-linux-x64": "0.1.0",
|
|
32
|
+
"@vantail/runtime-linux-arm64": "0.1.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/platforms.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "Targets the runtime is published for. `vantail package` and the release pipeline both read this.",
|
|
3
|
+
"targets": [
|
|
4
|
+
{ "package": "@vantail/runtime-darwin-arm64", "platform": "darwin", "arch": "arm64", "rust": "aarch64-apple-darwin", "tier": 1 },
|
|
5
|
+
{ "package": "@vantail/runtime-win32-x64", "platform": "win32", "arch": "x64", "rust": "x86_64-pc-windows-msvc", "tier": 1 },
|
|
6
|
+
{ "package": "@vantail/runtime-win32-arm64", "platform": "win32", "arch": "arm64", "rust": "aarch64-pc-windows-msvc", "tier": 2 },
|
|
7
|
+
{ "package": "@vantail/runtime-linux-x64", "platform": "linux", "arch": "x64", "rust": "x86_64-unknown-linux-gnu", "tier": 2 },
|
|
8
|
+
{ "package": "@vantail/runtime-linux-arm64", "platform": "linux", "arch": "arm64", "rust": "aarch64-unknown-linux-gnu", "tier": 2 }
|
|
9
|
+
]
|
|
10
|
+
}
|