scriptc 0.0.0 → 0.0.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,35 @@
1
1
  # scriptc
2
2
 
3
- Coming soon.
3
+ Compile ordinary TypeScript and JavaScript to small, fast native executables — no Node, no V8, no JavaScript engine in the binary. What compiles behaves byte-for-byte like Node.
4
+
5
+ ```console
6
+ $ cat fib.ts
7
+ function fib(n: number): number {
8
+ return n < 2 ? n : fib(n - 1) + fib(n - 2);
9
+ }
10
+ console.log(fib(30));
11
+
12
+ $ scriptc run fib.ts
13
+ 832040
14
+
15
+ $ scriptc build fib.ts -o fib && ./fib
16
+ 832040
17
+ ```
18
+
19
+ ## Install
20
+
21
+ ```console
22
+ $ npm install -g scriptc
23
+ ```
24
+
25
+ Requires clang on the PATH (Xcode Command Line Tools on macOS, `clang` package on Linux).
26
+
27
+ ## Commands
28
+
29
+ - `scriptc build <file.ts>` — compile to a native executable
30
+ - `scriptc run <file.ts>` — compile and run
31
+ - `scriptc coverage <file.ts>` — what compiles statically, and why the rest doesn't
32
+
33
+ No annotations, no dialect, no special stdlib: the same TypeScript you run on Node, type-checked by the real TypeScript compiler. Programs outside the static tier can opt into `--dynamic`, which embeds a small JavaScript engine (~620KB) for the parts that can't be static; everything else fails the build with a specific error code and usually a rewrite hint.
34
+
35
+ Docs: [scriptc.dev](https://scriptc.dev)
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/main.js ADDED
@@ -0,0 +1,192 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { rmSync } from "node:fs";
4
+ import { basename, dirname, join, resolve } from "node:path";
5
+ import { parseArgs } from "node:util";
6
+ import { analyze, compile, compileC, renderAll, renderCoverage, resolveProvenanceSources, setProvenanceSources } from "@scriptc/compiler";
7
+ const USAGE = `scriptc — TypeScript/JavaScript to native executables (experimental)
8
+
9
+ Usage:
10
+ scriptc build <file.ts|.js> [options] compile to a native executable
11
+ scriptc run <file.ts|.js> [options] compile and run
12
+ scriptc coverage <file.ts|.js> how much compiles statically, and why not
13
+ scriptc coverage <file.ts|.js> --dynamic what a --dynamic build compiles, and what still blocks it
14
+
15
+ Options:
16
+ -o, --out <path> output executable path (default: .scriptc/<name>)
17
+ --backend <b> code generator: llvm (default — emits LLVM IR text,
18
+ compiled by the same clang) or c (the readable reference
19
+ backend). The default falls back to the C backend when a
20
+ program is outside the LLVM tier (a one-line stderr note
21
+ says so; program behavior is identical); an explicit
22
+ --backend llvm fails loudly instead of falling back
23
+ --from-c treat input as a C (or .ll) file (toolchain plumbing/debugging)
24
+ --keep-c keep the generated program TU next to the executable
25
+ (default; the .ll — or the .c under --backend=c or
26
+ when the build fell back)
27
+ --no-keep-c delete the generated program TU after compiling
28
+ --emit-ir also write the IR as JSON next to the executable
29
+ --sanitize build with ASan + runtime RC audit
30
+ --dynamic embed the dynamic engine (adds ~620KB; static stays the default)
31
+ --npm-static <pkg[,pkg…]|auto>
32
+ compile the named npm packages' shipped JS statically as
33
+ program modules (repeatable; "auto" opts in every eligible
34
+ direct import: own .d.ts, unminified JS, no build-transform
35
+ markers). A package preflight refuses falls back to the
36
+ island (--dynamic) with a coverage-report note — opt-in,
37
+ experimental
38
+ --provenance-sources
39
+ EXPERIMENTAL: compile npm dependencies from their
40
+ provenance-attested SOURCE (fetched at the attested
41
+ commit) as static program modules; packages without a
42
+ usable attestation keep the island path (a note, never
43
+ a failure)
44
+ -h, --help show this help
45
+ `;
46
+ /* The exit discipline: NEVER process.exit() after writing output. stdout/
47
+ * stderr to a PIPE are async streams — process.exit() drops whatever libuv
48
+ * hasn't flushed yet, which truncates large diagnostic renders at the pipe
49
+ * buffer (observed: 64KB cut mid-code-frame). Every path sets
50
+ * process.exitCode and returns instead; Node exits naturally once the
51
+ * streams drain. */
52
+ class CliExit extends Error {
53
+ code;
54
+ constructor(code) {
55
+ super(`exit ${code}`);
56
+ this.code = code;
57
+ }
58
+ }
59
+ function fail(msg) {
60
+ process.stderr.write(msg + "\n");
61
+ throw new CliExit(1);
62
+ }
63
+ async function main() {
64
+ const { values, positionals } = parseArgs({
65
+ options: {
66
+ out: { type: "string", short: "o" },
67
+ // No parseArgs default: unset means the compiler's default lane
68
+ // (LLVM with the transparent C fallback); an explicit value pins.
69
+ backend: { type: "string" },
70
+ "from-c": { type: "boolean", default: false },
71
+ "keep-c": { type: "boolean", default: true },
72
+ "emit-ir": { type: "boolean", default: false },
73
+ sanitize: { type: "boolean", default: false },
74
+ dynamic: { type: "boolean", default: false },
75
+ "npm-static": { type: "string", multiple: true },
76
+ "provenance-sources": { type: "boolean", default: false },
77
+ help: { type: "boolean", short: "h", default: false },
78
+ },
79
+ allowPositionals: true,
80
+ allowNegative: true,
81
+ });
82
+ if (values.help || positionals.length === 0) {
83
+ process.stdout.write(USAGE);
84
+ return values.help ? 0 : 1;
85
+ }
86
+ const [command, inputArg] = positionals;
87
+ if (command !== "build" && command !== "run" && command !== "coverage") {
88
+ fail(`unknown command "${command}"\n\n${USAGE}`);
89
+ }
90
+ if (!inputArg)
91
+ fail(`missing input file\n\n${USAGE}`);
92
+ const input = resolve(inputArg);
93
+ const backend = values.backend;
94
+ if (backend !== undefined && backend !== "c" && backend !== "llvm") {
95
+ fail(`unknown backend "${backend}" (supported: c, llvm)\n\n${USAGE}`);
96
+ }
97
+ // --npm-static: repeatable and comma-splittable; the literal "auto"
98
+ // switches to eligibility-based detection (mixing "auto" with names
99
+ // is rejected — the shapes answer different questions).
100
+ const npmStaticRaw = (values["npm-static"] ?? []).flatMap((v) => v.split(",")).map((v) => v.trim()).filter((v) => v !== "");
101
+ let npmStatic;
102
+ if (npmStaticRaw.includes("auto")) {
103
+ if (npmStaticRaw.length > 1)
104
+ fail(`--npm-static auto cannot be combined with package names\n\n${USAGE}`);
105
+ npmStatic = "auto";
106
+ }
107
+ else if (npmStaticRaw.length > 0) {
108
+ npmStatic = npmStaticRaw;
109
+ }
110
+ // --provenance-sources resolves BEFORE the program loads (tsgo needs the
111
+ // source "paths" at creation): attestations and source trees fetch (or
112
+ // ride the content-addressed cache / the offline manifest), the registry
113
+ // installs, and every fallback prints as a note — never a failure.
114
+ const provenance = values["provenance-sources"] ? await resolveProvenanceSources(input) : null;
115
+ if (provenance !== null) {
116
+ setProvenanceSources(provenance);
117
+ for (const pkg of provenance.packages) {
118
+ process.stderr.write(`provenance: ${pkg.name}@${pkg.version} ← ${pkg.repo.replace(/^git\+/, "")} @ ${pkg.commit.slice(0, 12)} (source compiles statically)\n`);
119
+ }
120
+ for (const note of provenance.notes)
121
+ process.stderr.write(`provenance: ${note}\n`);
122
+ }
123
+ if (command === "coverage") {
124
+ const { coverage, sourceTexts } = analyze(input, { dynamic: values.dynamic, ...(npmStatic !== undefined ? { npmStatic } : {}) });
125
+ const color = process.stdout.isTTY ?? false;
126
+ process.stdout.write(renderCoverage(coverage, { color, sourceTexts }) + "\n");
127
+ return coverage.preflightFailed ? 1 : 0;
128
+ }
129
+ const outDir = values.out ? dirname(resolve(values.out)) : join(dirname(input), ".scriptc");
130
+ const stem = basename(input).replace(/\.(ts|js|mjs|cjs|c|ll)$/, "");
131
+ const outPath = values.out ? resolve(values.out) : join(outDir, stem);
132
+ const build = async () => {
133
+ if (values["from-c"]) {
134
+ await compileC({ cPath: input, outPath, sanitize: values.sanitize, dynamic: values.dynamic });
135
+ return outPath;
136
+ }
137
+ const result = await compile(input, {
138
+ outPath,
139
+ outDir,
140
+ emitIr: values["emit-ir"],
141
+ sanitize: values.sanitize,
142
+ dynamic: values.dynamic,
143
+ ...(backend !== undefined ? { backend } : {}),
144
+ ...(npmStatic !== undefined ? { npmStatic } : {}),
145
+ });
146
+ if (!result.ok) {
147
+ const color = process.stderr.isTTY ?? false;
148
+ process.stderr.write(renderAll(result.diagnostics, result.sourceTexts, { color }) + "\n");
149
+ const n = result.diagnostics.length;
150
+ process.stderr.write(`\n${n} error${n === 1 ? "" : "s"}.\n`);
151
+ throw new CliExit(1);
152
+ }
153
+ // The lane-change note: the ONLY case where silence would be dishonest
154
+ // is the default lane quietly building through C — one stderr line
155
+ // names the refusal. A successful LLVM build is the documented default
156
+ // (and the kept .ll next to the binary is the durable record), and an
157
+ // explicit --backend was the user's own choice — neither gets a line.
158
+ if (result.llvmRefusal !== undefined) {
159
+ process.stderr.write(`scriptc: backend c (llvm refused: ${result.llvmRefusal})\n`);
160
+ }
161
+ if (!values["keep-c"])
162
+ rmSync(result.cPath, { force: true });
163
+ return result.binaryPath;
164
+ };
165
+ const binary = await build();
166
+ if (command === "run") {
167
+ return new Promise((resolveExit) => {
168
+ const child = spawn(binary, [], { stdio: "inherit" });
169
+ child.on("exit", (code, signal) => {
170
+ if (signal) {
171
+ process.stderr.write(`scriptc: program killed by ${signal}\n`);
172
+ resolveExit(1);
173
+ }
174
+ else {
175
+ resolveExit(code ?? 0);
176
+ }
177
+ });
178
+ });
179
+ }
180
+ process.stdout.write(`${binary}\n`);
181
+ return 0;
182
+ }
183
+ try {
184
+ process.exitCode = await main();
185
+ }
186
+ catch (err) {
187
+ if (err instanceof CliExit)
188
+ process.exitCode = err.code;
189
+ else
190
+ throw err;
191
+ }
192
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EA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",
6
- "author": "",
7
- "license": "MIT",
3
+ "version": "0.0.2",
4
+ "description": "Compile ordinary TypeScript and JavaScript to small, fast native executables — no Node, no V8, no JavaScript engine in the binary",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://scriptc.dev",
8
7
  "repository": {
9
8
  "type": "git",
10
- "url": ""
9
+ "url": "git+https://github.com/vercel-labs/scriptc.git",
10
+ "directory": "packages/cli"
11
+ },
12
+ "type": "module",
13
+ "bin": {
14
+ "scriptc": "dist/main.js"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "dependencies": {
23
+ "@scriptc/compiler": "0.0.2"
24
+ },
25
+ "scripts": {
26
+ "build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json"
11
27
  }
12
28
  }
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- // Coming soon
2
- module.exports = {};