scriptc 0.4.5 → 0.4.7
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/package.json +9 -9
- package/scripts/install-native.mjs +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scriptc",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Compile ordinary TypeScript and JavaScript to small, fast native executables and WebAssembly modules that run without Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://scriptc.dev",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"node": ">=24"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@scriptc/compiler": "0.4.
|
|
24
|
+
"@scriptc/compiler": "0.4.7"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@scriptc/cli-darwin-arm64": "0.4.
|
|
28
|
-
"@scriptc/cli-
|
|
29
|
-
"@scriptc/cli-linux-
|
|
30
|
-
"@scriptc/cli-linux-
|
|
31
|
-
"@scriptc/cli-
|
|
32
|
-
"@scriptc/cli-linux-x64-musl": "0.4.
|
|
33
|
-
"@scriptc/cli-win32-x64-msvc": "0.4.
|
|
27
|
+
"@scriptc/cli-darwin-arm64": "0.4.7",
|
|
28
|
+
"@scriptc/cli-linux-arm64-musl": "0.4.7",
|
|
29
|
+
"@scriptc/cli-linux-x64-gnu": "0.4.7",
|
|
30
|
+
"@scriptc/cli-linux-arm64-gnu": "0.4.7",
|
|
31
|
+
"@scriptc/cli-darwin-x64": "0.4.7",
|
|
32
|
+
"@scriptc/cli-linux-x64-musl": "0.4.7",
|
|
33
|
+
"@scriptc/cli-win32-x64-msvc": "0.4.7"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
@@ -49,6 +49,7 @@ export function relocateToolchain(manifest, sourceDirectory, destinationDirector
|
|
|
49
49
|
"declarations",
|
|
50
50
|
"comptime",
|
|
51
51
|
"wasi_node_runner",
|
|
52
|
+
"lib_diagnostics",
|
|
52
53
|
]) {
|
|
53
54
|
if (typeof relocated[name] === "string") relocated[name] = pathFrom(relocated[name]);
|
|
54
55
|
}
|
|
@@ -92,6 +93,34 @@ export function installNativeCli(
|
|
|
92
93
|
const bin = join(directory, "bin");
|
|
93
94
|
mkdirSync(bin, { recursive: true });
|
|
94
95
|
const manifest = relocateToolchain(original, sourceDirectory, bin);
|
|
96
|
+
// A platform package depends on its LLVM helper and runtime pack packages
|
|
97
|
+
// instead of bundling them. Record where the package manager put them.
|
|
98
|
+
if (manifest.llvm_package === undefined || manifest.runtime_pack === undefined) {
|
|
99
|
+
const dependencies = Object.keys(identity.dependencies ?? {});
|
|
100
|
+
const installed = (prefix) => {
|
|
101
|
+
const name = dependencies.find((dependency) => dependency.startsWith(prefix));
|
|
102
|
+
if (name === undefined)
|
|
103
|
+
throw new Error(`${packageName} does not depend on a ${prefix}* package`);
|
|
104
|
+
let path, found;
|
|
105
|
+
try {
|
|
106
|
+
path = createRequire(platformManifest).resolve(`${name}/package.json`);
|
|
107
|
+
found = JSON.parse(readFileSync(path, "utf8")).version;
|
|
108
|
+
} catch {
|
|
109
|
+
throw new Error(`scriptc requires ${name}@${version}; reinstall scriptc`);
|
|
110
|
+
}
|
|
111
|
+
if (found !== version)
|
|
112
|
+
throw new Error(`scriptc requires ${name}@${version}, found ${found}; reinstall scriptc`);
|
|
113
|
+
return relative(bin, dirname(path));
|
|
114
|
+
};
|
|
115
|
+
manifest.llvm_package ??= installed("@scriptc/llvm-");
|
|
116
|
+
if (manifest.runtime_pack === undefined) {
|
|
117
|
+
manifest.runtime_pack = installed("@scriptc/runtime-");
|
|
118
|
+
manifest.runtime_packs = [
|
|
119
|
+
{ target: manifest.target, path: manifest.runtime_pack },
|
|
120
|
+
...(manifest.runtime_packs ?? []),
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
95
124
|
// npm normalizes modes for payloads outside package bin entries. These
|
|
96
125
|
// tools are launched directly by the compiler after installation.
|
|
97
126
|
if (process.platform !== "win32") {
|