scriptc 0.2.0 → 0.2.2
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/README.md +3 -1
- package/package.json +9 -20
- package/scripts/install-native.mjs +0 -17
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ $ npm install -g scriptc
|
|
|
24
24
|
|
|
25
25
|
The installed compiler runs natively on supported macOS, Linux, and Windows hosts. Compilation, compile-time evaluation, and native execution do not require Node. `--emit=ir|llvm|asm|obj` uses the bundled TypeScript checker and LLVM helper without an external compiler, archiver, linker, or SDK. Executable builds additionally need a platform linker driver and SDK/sysroot; precompiled runtime packs supply the C runtime. Set `SCRIPTC_LINKER` to choose that driver. Runtime development with `--sanitize` additionally needs a C compiler. Node.js 24 or newer is needed for npm installation and `scriptc run` of WASI modules.
|
|
26
26
|
|
|
27
|
+
The native compiler includes its host runtime pack. Cross-compilation uses additional `@scriptc/runtime-<target>` packages installed in your project at the same version as `scriptc --version`. WASI builds use `@scriptc/runtime-wasm32-wasi`, for example. Run the compiler from that project or set `SCRIPTC_RUNTIME_PACK` to the pack directory. Linux GNU distributions require glibc 2.34 or newer.
|
|
28
|
+
|
|
27
29
|
Builds use a bounded persistent cache. Unchanged source can reuse the validated frontend result and LLVM program objects. Library identity getters occupy a separate LLVM module, so an identity change can reuse the large program object. Runtime objects come from the installed pack. Executable cache entries verify their native dependencies; FFI builds relink against current external inputs. Set `SCRIPTC_NO_CACHE=1` to bypass the cache or `SCRIPTC_CACHE_DIR` to select its location. An existing POSIX override must already be private.
|
|
28
30
|
|
|
29
31
|
## Commands
|
|
@@ -32,7 +34,7 @@ Builds use a bounded persistent cache. Unchanged source can reuse the validated
|
|
|
32
34
|
- `scriptc run <file.ts>` — compile and run
|
|
33
35
|
- `scriptc coverage <file.ts>` — what compiles statically, and why the rest doesn't
|
|
34
36
|
|
|
35
|
-
`scriptc build app.ts --emit=ir|llvm|asm|obj` selects serialized typed IR, textual LLVM IR, target assembly, or a relocatable program object as the one primary artifact. `--emit=exe` is the default. Assembly/object emission uses the matching helper on supported macOS, Linux, and Windows hosts (and produces WASI artifacts when that target is selected). Objects retain undefined `scr_*` runtime references plus the `
|
|
37
|
+
`scriptc build app.ts --emit=ir|llvm|asm|obj` selects serialized typed IR, textual LLVM IR, target assembly, or a relocatable program object as the one primary artifact. `--emit=exe` is the default. Assembly/object emission uses the matching helper on supported macOS, Linux, and Windows hosts (and produces WASI artifacts when that target is selected). Objects retain undefined `scr_*` runtime references plus the `scr_runtime_abi_v6` compatibility marker; they are not library archives. External consumption is experimental and requires the exact matching runtime. `scriptc build app.ts --print=native-link-info -o app.o` prints the versioned JSON target/runtime/link recipe without performing a link. `--emit=asm|obj --sanitize` is rejected until ASan pipeline parity is available.
|
|
36
38
|
|
|
37
39
|
For embedder-hosted modules that are not installed npm packages, coverage can map an exact bare specifier to a local declaration with repeatable `--external-types <specifier=file.d.ts>` options. This is analysis-only: the types unblock application measurement, while runtime module uses remain reported as blockers.
|
|
38
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scriptc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Compile ordinary TypeScript and JavaScript to small, fast native executables — no Node, no V8, no JavaScript engine in the binary",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://scriptc.dev",
|
|
@@ -21,27 +21,16 @@
|
|
|
21
21
|
"node": ">=24"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@scriptc/compiler": "0.2.
|
|
24
|
+
"@scriptc/compiler": "0.2.2"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@scriptc/cli-darwin-arm64": "0.2.
|
|
28
|
-
"@scriptc/cli-darwin-x64": "0.2.
|
|
29
|
-
"@scriptc/cli-linux-arm64-gnu": "0.2.
|
|
30
|
-
"@scriptc/cli-linux-
|
|
31
|
-
"@scriptc/cli-linux-
|
|
32
|
-
"@scriptc/cli-
|
|
33
|
-
"@scriptc/cli-
|
|
34
|
-
"@scriptc/runtime-darwin-arm64": "0.2.0",
|
|
35
|
-
"@scriptc/runtime-linux-arm64-gnu": "0.2.0",
|
|
36
|
-
"@scriptc/runtime-linux-x64-gnu": "0.2.0",
|
|
37
|
-
"@scriptc/runtime-darwin-x64": "0.2.0",
|
|
38
|
-
"@scriptc/runtime-linux-x64-musl": "0.2.0",
|
|
39
|
-
"@scriptc/runtime-win32-x64-msvc": "0.2.0",
|
|
40
|
-
"@scriptc/runtime-linux-arm64-musl": "0.2.0",
|
|
41
|
-
"@scriptc/runtime-wasm32-wasi": "0.2.0",
|
|
42
|
-
"@scriptc/runtime-ios-arm64": "0.2.0",
|
|
43
|
-
"@scriptc/runtime-ios-simulator-arm64": "0.2.0",
|
|
44
|
-
"@scriptc/runtime-android-arm64": "0.2.0"
|
|
27
|
+
"@scriptc/cli-darwin-arm64": "0.2.2",
|
|
28
|
+
"@scriptc/cli-darwin-x64": "0.2.2",
|
|
29
|
+
"@scriptc/cli-linux-arm64-gnu": "0.2.2",
|
|
30
|
+
"@scriptc/cli-linux-arm64-musl": "0.2.2",
|
|
31
|
+
"@scriptc/cli-linux-x64-gnu": "0.2.2",
|
|
32
|
+
"@scriptc/cli-win32-x64-msvc": "0.2.2",
|
|
33
|
+
"@scriptc/cli-linux-x64-musl": "0.2.2"
|
|
45
34
|
},
|
|
46
35
|
"scripts": {
|
|
47
36
|
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
@@ -56,23 +56,6 @@ export function installNativeCli(directory, packageName = nativeCliPackage(proce
|
|
|
56
56
|
const bin = join(directory, "bin");
|
|
57
57
|
mkdirSync(bin, { recursive: true });
|
|
58
58
|
const manifest = relocateToolchain(original, sourceDirectory, bin);
|
|
59
|
-
const packs = new Map((manifest.runtime_packs ?? []).map((pack) => [pack.target, pack]));
|
|
60
|
-
for (const suffix of ["darwin-arm64", "darwin-x64", "linux-x64-gnu", "linux-arm64-gnu", "linux-x64-musl", "linux-arm64-musl",
|
|
61
|
-
"win32-x64-msvc", "wasm32-wasi", "ios-arm64", "ios-simulator-arm64", "android-arm64"]) {
|
|
62
|
-
const name = `@scriptc/runtime-${suffix}`;
|
|
63
|
-
if (packageManifest.optionalDependencies?.[name] === undefined) continue;
|
|
64
|
-
let path;
|
|
65
|
-
try { path = require.resolve(`${name}/package.json`); }
|
|
66
|
-
catch { continue; }
|
|
67
|
-
const packIdentity = JSON.parse(readFileSync(path, "utf8"));
|
|
68
|
-
if (packIdentity.name !== name || packIdentity.version !== version) throw new Error(`scriptc requires ${name}@${version}`);
|
|
69
|
-
const pack = JSON.parse(readFileSync(join(dirname(path), "runtime-pack.json"), "utf8"));
|
|
70
|
-
if (pack.schema !== "scriptc.runtime-pack.v1" || pack.package !== name || pack.version !== version) {
|
|
71
|
-
throw new Error(`invalid runtime pack installed for ${name}@${version}`);
|
|
72
|
-
}
|
|
73
|
-
if (!packs.has(pack.target.name)) packs.set(pack.target.name, { target: pack.target.name, path: relative(bin, dirname(path)) });
|
|
74
|
-
}
|
|
75
|
-
manifest.runtime_packs = [...packs.values()];
|
|
76
59
|
// npm normalizes modes for payloads outside package bin entries. These
|
|
77
60
|
// tools are launched directly by the compiler after installation.
|
|
78
61
|
if (process.platform !== "win32") {
|