Skip to content

Commit 71bc54d

Browse files
committed
Run prettier in github build workflow
1 parent 785c0d2 commit 71bc54d

9 files changed

Lines changed: 46 additions & 42 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,22 @@ jobs:
4040
node-version: 22
4141
cache: npm
4242

43-
- name: Install
43+
- name: Install Node.js dependencies
44+
run: npm ci
45+
46+
- name: Install Rust dependencies
4447
uses: dtolnay/rust-toolchain@stable
4548
with:
4649
components: clippy, rustfmt
4750

51+
- name: Lint Rust code
52+
run: cargo clippy
53+
4854
- name: Format Rust code
4955
run: cargo fmt -- --check
5056

51-
- name: Lint Rust code
52-
run: cargo clippy
57+
- name: Format Node.js code
58+
run: npm run format:prettier
5359

5460
check-package-json-files:
5561
name: Check package.json files

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ npm i @alphahydrae/exec
4343

4444
| OS & Architecture | Node.js 18 | Node.js 20 | Node.js 22 |
4545
| :---------------- | :--------: | :--------: | :--------: |
46-
| macOS x64 | | | |
47-
| macOS arm64 | | | |
48-
| Linux x64 gnu | | | |
49-
| Linux x64 musl | | | |
50-
| Linux arm64 gnu | | | |
51-
| Linux arm64 musl | | | |
52-
| Linux arm gnu | | | |
53-
| Android arm64 | | | |
54-
| Android armv7 | | | |
55-
| FreeBSD x64 | | | |
56-
| Windows x64 | | | |
57-
| Windows x32 | | | |
58-
| Windows arm64 | | | |
46+
| macOS x64 ||||
47+
| macOS arm64 ||||
48+
| Linux x64 gnu ||||
49+
| Linux x64 musl ||||
50+
| Linux arm64 gnu ||||
51+
| Linux arm64 musl ||||
52+
| Linux arm gnu ||||
53+
| Android arm64 ||||
54+
| Android armv7 ||||
55+
| FreeBSD x64 ||||
56+
| Windows x64 ||||
57+
| Windows x32 ||||
58+
| Windows arm64 ||||
5959

6060
> The `exec` family of functions is part of the
6161
> [POSIX](https://en.wikipedia.org/wiki/POSIX) operating system API, so it will
@@ -73,4 +73,4 @@ following conversations:
7373
Also a big thank you to the following Rust projects for making it easy:
7474

7575
- [NAPI-RS](https://napi.rs) (build pre-compiled Node.js addons in Rust)
76-
- [nix](https://docs.rs/nix) (Rust-friendly bindings to the various *nix system functions)
76+
- [nix](https://docs.rs/nix) (Rust-friendly bindings to the various \*nix system functions)

npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"engines": {
2626
"node": "^18 || ^20 || ^22"
2727
}
28-
}
28+
}

npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"engines": {
2626
"node": "^18 || ^20 || ^22"
2727
}
28-
}
28+
}

npm/linux-arm64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"engines": {
2929
"node": "^18 || ^20 || ^22"
3030
}
31-
}
31+
}

npm/linux-arm64-musl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"engines": {
2929
"node": "^18 || ^20 || ^22"
3030
}
31-
}
31+
}

npm/linux-x64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"engines": {
2929
"node": "^18 || ^20 || ^22"
3030
}
31-
}
31+
}

npm/linux-x64-musl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"engines": {
2929
"node": "^18 || ^20 || ^22"
3030
}
31-
}
31+
}

scripts/build-packages.mjs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@ await Promise.all(
1414
.filter(part => part !== undefined)
1515
.join('-');
1616
const nativeBindingFile = `exec.${variantName}.node`;
17+
const variantPackageJson = {
18+
name: `${packageJson.name}-${variantName}`,
19+
version: packageJson.version,
20+
description: packageJson.description,
21+
author: packageJson.author,
22+
keywords: packageJson.keywords,
23+
license: packageJson.license,
24+
repository: packageJson.repository,
25+
main: nativeBindingFile,
26+
files: [nativeBindingFile],
27+
os: toArray(variant.os),
28+
cpu: toArray(variant.cpu),
29+
libc: toArray(variant.libc),
30+
engines: packageJson.engines
31+
};
32+
1733
await writeFile(
1834
path.join(root, 'npm', variantName, 'package.json'),
19-
JSON.stringify(
20-
{
21-
name: `${packageJson.name}-${variantName}`,
22-
version: packageJson.version,
23-
description: packageJson.description,
24-
author: packageJson.author,
25-
keywords: packageJson.keywords,
26-
license: packageJson.license,
27-
repository: packageJson.repository,
28-
main: nativeBindingFile,
29-
files: [nativeBindingFile],
30-
os: toArray(variant.os),
31-
cpu: toArray(variant.cpu),
32-
libc: toArray(variant.libc),
33-
engines: packageJson.engines
34-
},
35-
undefined,
36-
2
37-
),
35+
`${JSON.stringify(variantPackageJson, undefined, 2)}\n`,
3836
'utf8'
3937
);
4038
})

0 commit comments

Comments
 (0)