@dev.fast/diffr 0.1.7 → 0.1.8
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 +6 -2
- package/bin/fetch.mjs +9 -5
- package/package.json +1 -1
- package/pins.json +13 -5
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ Supports macOS arm64, macOS x64, Linux arm64, and Linux x64. `--check` verifies
|
|
|
16
16
|
network access. Downloads warn on network failure unless `--required`; invalid
|
|
17
17
|
hashes or archives always fail.
|
|
18
18
|
|
|
19
|
+
`--full` fetches the full edition, which adds the parsers lean builds omit (Apex,
|
|
20
|
+
Fortran, F#, Haskell, Julia, OCaml, QML, Verilog, VHDL). It requires full-edition
|
|
21
|
+
pins, which start with the next release.
|
|
22
|
+
|
|
19
23
|
## Wire changes
|
|
20
24
|
|
|
21
25
|
Keep these files in sync:
|
|
@@ -30,8 +34,8 @@ Keep these files in sync:
|
|
|
30
34
|
## Release
|
|
31
35
|
|
|
32
36
|
After tagging the matching Rust release and building with `cargo build --locked`,
|
|
33
|
-
run from `diffr-ts`. New pins select the CLI-only release archives;
|
|
34
|
-
continue to use the
|
|
37
|
+
run from `diffr-ts`. New pins select the lean and full CLI-only release archives;
|
|
38
|
+
older pins continue to use the combined archives:
|
|
35
39
|
|
|
36
40
|
```sh
|
|
37
41
|
bun install --frozen-lockfile
|
package/bin/fetch.mjs
CHANGED
|
@@ -19,6 +19,7 @@ try {
|
|
|
19
19
|
async function main() {
|
|
20
20
|
const { values } = parseArgs({ options: {
|
|
21
21
|
into: { type: "string" },
|
|
22
|
+
full: { type: "boolean", default: false },
|
|
22
23
|
check: { type: "boolean" },
|
|
23
24
|
required: { type: "boolean" },
|
|
24
25
|
pins: { type: "string", default: join(root, "pins.json") },
|
|
@@ -30,7 +31,9 @@ async function main() {
|
|
|
30
31
|
if (pins.version !== version) throw new Error(`pins.json is for ${pins.version}, package is ${version}; run \`npm run pin\``);
|
|
31
32
|
const target = targets[`${process.platform}-${process.arch}`];
|
|
32
33
|
if (!target) throw new Error(`no diffr release for ${process.platform}-${process.arch}`);
|
|
33
|
-
const
|
|
34
|
+
const pin = values.full ? pins.full : pins;
|
|
35
|
+
if (!pin) throw new Error(`pins.json has no full edition for ${version}`);
|
|
36
|
+
const expected = pin.sha256?.[target];
|
|
34
37
|
if (typeof expected !== "string" || !/^[a-f0-9]{64}$/.test(expected)) {
|
|
35
38
|
throw new Error(`pins.json has no valid sha256 for ${target}`);
|
|
36
39
|
}
|
|
@@ -41,7 +44,8 @@ async function main() {
|
|
|
41
44
|
try {
|
|
42
45
|
const stamp = JSON.parse(readFileSync(stampPath, "utf8"));
|
|
43
46
|
const stat = lstatSync(binary);
|
|
44
|
-
installed = stat.isFile() && (stat.mode & 0o111) !== 0 && stamp.version === version && stamp.target === target
|
|
47
|
+
installed = stat.isFile() && (stat.mode & 0o111) !== 0 && stamp.version === version && stamp.target === target
|
|
48
|
+
&& Boolean(stamp.full) === values.full;
|
|
45
49
|
} catch { /* Missing or damaged installations are fetched again. */ }
|
|
46
50
|
if (installed) {
|
|
47
51
|
console.log(`diffr ${version} (${target}) already at ${binary}`);
|
|
@@ -49,8 +53,8 @@ async function main() {
|
|
|
49
53
|
}
|
|
50
54
|
if (values.check) throw new Error(`${binary} is missing or not diffr ${version} (${target})`);
|
|
51
55
|
|
|
52
|
-
const artifact = pins.artifact ?? "diffr";
|
|
53
|
-
if (!["diffr", "diffr-cli"].includes(artifact)) throw new Error(`unknown pinned artifact: ${artifact}`);
|
|
56
|
+
const artifact = values.full ? "diffr-cli-full" : pins.artifact ?? "diffr";
|
|
57
|
+
if (!["diffr", "diffr-cli", "diffr-cli-full"].includes(artifact)) throw new Error(`unknown pinned artifact: ${artifact}`);
|
|
54
58
|
const asset = `${artifact}-${version}-${target}.tar.gz`;
|
|
55
59
|
const url = `https://github.com/devdotfast/diffr/releases/download/${version}/${asset}`;
|
|
56
60
|
let bytes;
|
|
@@ -78,7 +82,7 @@ async function main() {
|
|
|
78
82
|
}
|
|
79
83
|
chmodSync(extracted, 0o755);
|
|
80
84
|
const stamp = join(staging, "stamp.json");
|
|
81
|
-
writeFileSync(stamp, `${JSON.stringify({ version, target }, null, 2)}\n`);
|
|
85
|
+
writeFileSync(stamp, `${JSON.stringify({ version, target, ...(values.full && { full: true }) }, null, 2)}\n`);
|
|
82
86
|
renameSync(extracted, binary);
|
|
83
87
|
renameSync(stamp, stampPath);
|
|
84
88
|
} finally {
|
package/package.json
CHANGED
package/pins.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.8",
|
|
3
3
|
"artifact": "diffr-cli",
|
|
4
4
|
"sha256": {
|
|
5
|
-
"aarch64-apple-darwin": "
|
|
6
|
-
"x86_64-apple-darwin": "
|
|
7
|
-
"x86_64-unknown-linux-gnu": "
|
|
8
|
-
"aarch64-unknown-linux-gnu": "
|
|
5
|
+
"aarch64-apple-darwin": "d2a7968a71651bc4644da3d0b2e4f47bbf24aa916ccf07ea44612429d08e3961",
|
|
6
|
+
"x86_64-apple-darwin": "43a77b8268d8131d1d11ab7bd5677d472978d0600490450f3b676038aae390c7",
|
|
7
|
+
"x86_64-unknown-linux-gnu": "a1a86e03f94fa55b501bdc1c8e8cd8f437067a95fe63e9c4491ac3b470fde41c",
|
|
8
|
+
"aarch64-unknown-linux-gnu": "9624581fdbb4c1a4109fa1ce634c7b9c8cb999086d377209763b804ecdeeb8d3"
|
|
9
|
+
},
|
|
10
|
+
"full": {
|
|
11
|
+
"sha256": {
|
|
12
|
+
"aarch64-apple-darwin": "3bf4bcd0dd646613f33c31ff2ddc945999767c6eace9f497c9c01930d8cb2330",
|
|
13
|
+
"x86_64-apple-darwin": "ef9ad4ee256b24673464f41ec6a1aad90441d23287cbccfebaa71f0dd4f6f755",
|
|
14
|
+
"x86_64-unknown-linux-gnu": "48906683b71f827c888ac6755e9c60c5497dd4e93ee720ab8902ed3691abb614",
|
|
15
|
+
"aarch64-unknown-linux-gnu": "d8546d68293716ac83d022e09af4f0189f9215b63c314e3dc46929652002c4c8"
|
|
16
|
+
}
|
|
9
17
|
}
|
|
10
18
|
}
|