@gjsify/tsc 0.4.34

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 ADDED
@@ -0,0 +1,75 @@
1
+ # @gjsify/tsc
2
+
3
+ [TypeScript][typescript] for [GJS][gjs] — the upstream `typescript` compiler
4
+ bundled to a single GJS module and shipped with a `tsc` bin that runs
5
+ **directly under [SpiderMonkey][spidermonkey] via GJS**, without Node.js in
6
+ the loop.
7
+
8
+ ```bash
9
+ # Node-free TypeScript checking on any GJS-equipped system:
10
+ gjsify-tsc --version # → Version 5.9.3
11
+ gjsify-tsc -p tsconfig.json # type-check (--noEmit-style usage)
12
+ gjsify-tsc --diagnostics foo.ts # tsc perf info works the same as on Node
13
+ ```
14
+
15
+ ## Why
16
+
17
+ `typescript` is itself written in TypeScript and ships as plain JS. There is
18
+ no Node-only API in the compiler proper — it talks to disk through `sys` and
19
+ that's it. With `@gjsify/cli`'s `--app gjs` target, the same compiler runs
20
+ unchanged under GJS, polyfilled by the rest of the gjsify family
21
+ (`@gjsify/fs`, `@gjsify/path`, `@gjsify/process`, `@gjsify/perf_hooks`, …).
22
+
23
+ This package is the first proof-of-concept that **the gjsify build chain can
24
+ be Node-free** — the long-standing goal tracked in the project's
25
+ `STATUS.md`. The `gjsify` CLI itself already ships as a GJS bundle; pairing
26
+ that with `gjsify-tsc` removes Node from the type-check step of any
27
+ gjsify-built app.
28
+
29
+ ## Layout
30
+
31
+ ```
32
+ packages/infra/tsc/
33
+ ├── package.json
34
+ ├── src/index.ts ← metadata stub (TSC_BUNDLE_PATH, TYPESCRIPT_VERSION)
35
+ ├── scripts/
36
+ │ └── build-bundle.mjs ← runs `gjsify build` against typescript/lib/_tsc.js
37
+ └── dist/
38
+ └── tsc.gjs.mjs ← committed, ~3.5 MiB, the actual bin
39
+ ```
40
+
41
+ The bundle is **committed** because it's a heavy artifact the rest of the
42
+ repo (and downstream consumers) don't want to rebuild on every install. It
43
+ ships in the npm tarball via `files: ["dist/tsc.gjs.mjs"]`.
44
+
45
+ ## Updating the bundled TypeScript version
46
+
47
+ ```bash
48
+ gjsify workspace @gjsify/tsc clear
49
+ # bump devDependency typescript: in package.json (or workspace-wide)
50
+ gjsify install --immutable
51
+ gjsify workspace @gjsify/tsc build
52
+ # commit the new dist/tsc.gjs.mjs
53
+ ```
54
+
55
+ The bundled version is pinned in `src/index.ts` as `TYPESCRIPT_VERSION`.
56
+
57
+ ## Runtime triplet
58
+
59
+ ```json
60
+ { "gjs": "polyfill", "node": "none", "browser": "none" }
61
+ ```
62
+
63
+ This is a GJS-only artifact. On Node, consumers use the upstream
64
+ `typescript` package directly. On the browser, type-checking isn't a use
65
+ case.
66
+
67
+ ## Reference
68
+
69
+ - [`refs/typescript`][typescript] — Microsoft's reference implementation.
70
+ - Originally implemented for Node.js / SpiderMonkey; this package bundles
71
+ upstream's pre-built `_tsc.js` CLI entry, not a reimplementation.
72
+
73
+ [typescript]: https://github.com/microsoft/TypeScript
74
+ [gjs]: https://gitlab.gnome.org/GNOME/gjs
75
+ [spidermonkey]: https://spidermonkey.dev/