closure-rs 0.0.1-exp.2 → 20261006.0.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/README.md +22 -8
- package/bin/linux-x64/closure-rs +0 -0
- package/bin/win32-x64/closure-rs.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,14 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
A Rust port of the [Closure Compiler](https://github.com/google/closure-compiler) command line
|
|
4
4
|
(`CommandLineRunner`), with an npm wrapper that has the programmatic API of the official
|
|
5
|
-
[`google-closure-compiler`](https://www.npmjs.com/package/google-closure-compiler) package
|
|
6
|
-
|
|
5
|
+
[`google-closure-compiler`](https://www.npmjs.com/package/google-closure-compiler) package. For the
|
|
6
|
+
same inputs and flags it produces the same output, diagnostics, exit code and source maps as the
|
|
7
|
+
Java compiler of the Closure Compiler release that its major version names (see below). Not
|
|
8
|
+
affiliated with or published by Google. The
|
|
9
|
+
[repository README](https://github.com/Smrtnyk/closure-rs#readme) describes the guarantees, the
|
|
10
|
+
flags outside the port and how the port is checked.
|
|
7
11
|
|
|
8
12
|
The compiler is a native binary. The package carries one per supported system (Linux x64 and
|
|
9
|
-
Windows x64
|
|
13
|
+
Windows x64, under `bin/<platform>-<arch>/`) and runs the one for yours; no Java is needed.
|
|
10
14
|
The Linux binary is statically linked: it runs on any x86-64 Linux, glibc or musl (Alpine, without
|
|
11
15
|
gcompat), with no C library version requirement.
|
|
12
16
|
|
|
17
|
+
## Versions
|
|
18
|
+
|
|
19
|
+
The major version is the upstream release the output matches: `20261006.x.y` matches
|
|
20
|
+
`google-closure-compiler@20261006.0.0`. Minor releases leave the output unchanged (speed, the
|
|
21
|
+
wrapper, platforms); patch releases fix differences from the Java compiler, crashes and wrapper
|
|
22
|
+
bugs. `latest` is the stable release; experimental builds are prereleases under the dist-tag
|
|
23
|
+
`exp`. See [Versioning](https://github.com/Smrtnyk/closure-rs#versioning).
|
|
24
|
+
|
|
13
25
|
## Switching from google-closure-compiler
|
|
14
26
|
|
|
15
27
|
Change only `package.json`:
|
|
@@ -20,7 +32,9 @@ Change only `package.json`:
|
|
|
20
32
|
}
|
|
21
33
|
```
|
|
22
34
|
|
|
23
|
-
|
|
35
|
+
To stay on one upstream release, use a range instead of `latest`, for example
|
|
36
|
+
`"npm:closure-rs@^20261006.0.0"`. Code that imports `google-closure-compiler` keeps working,
|
|
37
|
+
TypeScript types included:
|
|
24
38
|
|
|
25
39
|
```ts
|
|
26
40
|
import ClosureCompiler from 'google-closure-compiler'; // or: import {compiler} from ...
|
|
@@ -47,8 +61,8 @@ The same exports as the official package's `index.js`:
|
|
|
47
61
|
| `gulp`, `grunt` | Present, but **not implemented**: calling either throws an error (see below). |
|
|
48
62
|
| `COMPILER_PATH` | Added: the path of the closure-rs binary. |
|
|
49
63
|
|
|
50
|
-
`compiler.JAR_PATH`, `compiler.COMPILER_PATH` and `compiler.
|
|
51
|
-
|
|
64
|
+
`compiler.JAR_PATH`, `compiler.COMPILER_PATH`, `compiler.CONTRIB_PATH` and `compiler.EXTERNS_PATH`
|
|
65
|
+
exist as statics too; `@types/google-closure-compiler` declares the first three.
|
|
52
66
|
|
|
53
67
|
The package is ESM like the official one (`"type": "module"`). `require('google-closure-compiler')`
|
|
54
68
|
works where Node supports `require()` of ES modules (Node 20.19+, 22.12+), as for the official
|
|
@@ -73,8 +87,8 @@ No shell is involved, so values need no quoting. The flags are the Java compiler
|
|
|
73
87
|
stderr)` once the process has closed; for a non-zero exit code `stderr` starts with the full
|
|
74
88
|
command line. If the process is ended by a signal (for example killed by the out-of-memory
|
|
75
89
|
killer), `exitCode` is 128 + the signal number, as a shell reports it (137 for `SIGKILL`), and
|
|
76
|
-
`stderr` names the signal. The official package passes `null` in that case. Without `--js` the
|
|
77
|
-
process's `stdin` and end it.
|
|
90
|
+
`stderr` names the signal. The official package passes `null` in that case. Without `--js` the
|
|
91
|
+
compiler reads the input from stdin: write it to the returned process's `stdin` and end it.
|
|
78
92
|
|
|
79
93
|
### Types
|
|
80
94
|
|
package/bin/linux-x64/closure-rs
CHANGED
|
Binary file
|
|
Binary file
|