clang-format-node 1.0.1 → 1.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/README.md +63 -16
- package/build/bin/darwin-x64/clang-format +0 -0
- package/build/bin/linux-arm/clang-format +0 -0
- package/build/bin/linux-arm64/clang-format +0 -0
- package/build/bin/linux-ppc64/clang-format +0 -0
- package/build/bin/linux-s390x/clang-format +0 -0
- package/build/bin/linux-x64/clang-format +0 -0
- package/build/bin/win32-x64/clang-format.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,32 +10,38 @@ Node repackaging(wrapping) of the `clang-format` native binary inspired by ['ang
|
|
|
10
10
|
|
|
11
11
|
This package intends to release a new npm package for every **latest** release of the `clang-format`. It **checks** for the latest LLVM release every week, builds `clang-format` using its own pipeline, and makes a **pull request**. All processes are run automatically. If you are interested in build process, take a look at [`.github/workflows/llvm-build-bump-pr.yml`](/.github/workflows/llvm-build-bump-pr.yml)
|
|
12
12
|
|
|
13
|
+
> [!IMPORTANT]
|
|
14
|
+
>
|
|
15
|
+
> Please participate in the issue regarding the introduction of a **glob pattern**. Click [here](https://github.com/lumirlumir/npm-clang-format-node/issues/14).
|
|
16
|
+
|
|
13
17
|
## Why I started this project
|
|
14
18
|
|
|
15
19
|
['angular/clang-format'](https://github.com/angular/clang-format) is no longer maintained. (See [#79](https://github.com/angular/clang-format/issues/79) [#82](https://github.com/angular/clang-format/issues/82) [#83](https://github.com/angular/clang-format/pull/83)) Nevertheless, new versions of `clang-format` continue to be released. Bugs are fixed, and new features are added. However, using `clang-format` directly in a Node.js environment without any support can be somewhat cumbersome. So I decided to make a **new**, **maintained** one.
|
|
16
20
|
|
|
17
21
|
Note that some feautures from 'angular/clang-format' are not included in this package. Specifically `check-clang-format` and `git-clang-format` are not used. There are a few reasons for this. Both commands **rely on Python**, so if you haven't installed Python, they cannot be executed. Many people would prefer if this package worked without dependencies beyond Node.js. **So, this package relies only on Node.js.** See the [Migration](#migration-from-angularclang-format) for alternative methods to `check-clang-format` and `git-clang-format`.
|
|
18
22
|
|
|
19
|
-
## Supported
|
|
23
|
+
## Supported
|
|
24
|
+
|
|
25
|
+
### OS Platforms and Architectures
|
|
20
26
|
|
|
21
27
|
It supports **ALL** [**Tier1**](https://github.com/nodejs/node/blob/main/BUILDING.md#strategy) and some [**Tier2**](https://github.com/nodejs/node/blob/main/BUILDING.md#strategy) platforms of Node.js. *Note that the functionality cannot be guaranteed on platforms which is not mentioned below*.
|
|
22
28
|
|
|
23
29
|
(To see the full list of platforms supported by Node.js, click [here](<https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list>).)
|
|
24
30
|
|
|
25
|
-
<br> | Operating System | Architectures |
|
|
26
|
-
---- | ---------------- | ---------------- |
|
|
27
|
-
1 | macOS | arm64 |
|
|
28
|
-
2 | macOS | x64 |
|
|
29
|
-
3 | GNU/Linux | armv7 |
|
|
30
|
-
4 | GNU/Linux | arm64 |
|
|
31
|
-
5 | GNU/Linux | ppc64le >=power8 |
|
|
32
|
-
6 | GNU/Linux | s390x |
|
|
33
|
-
7 | GNU/Linux | x64 |
|
|
34
|
-
8 | Windows | x64 |
|
|
31
|
+
<br> | Operating System | Architectures | Support Type |
|
|
32
|
+
---- | ---------------- | ---------------- | ------------ |
|
|
33
|
+
1 | macOS | arm64 | Tier 1 |
|
|
34
|
+
2 | macOS | x64 | Tier 1 |
|
|
35
|
+
3 | GNU/Linux | armv7 | Tier 1 |
|
|
36
|
+
4 | GNU/Linux | arm64 | Tier 1 |
|
|
37
|
+
5 | GNU/Linux | ppc64le >=power8 | Tier 2 |
|
|
38
|
+
6 | GNU/Linux | s390x | Tier 2 |
|
|
39
|
+
7 | GNU/Linux | x64 | Tier 1 |
|
|
40
|
+
8 | Windows | x64 | Tier 1 |
|
|
35
41
|
|
|
36
42
|
> [!TIP]
|
|
37
43
|
>
|
|
38
|
-
> 1. If your platform isn't yet supported, you can build the `clang-format` native binary from the latest upstream clang sources. Refer to [`docs/llvm-build-linux.sh`](/docs/llvm-build-linux.sh) and [
|
|
44
|
+
> 1. If your platform isn't yet supported, you can build the `clang-format` native binary from the latest upstream clang sources. Refer to [`docs/llvm-build-linux.sh`](/docs/llvm-build-linux.sh) and [`.github/workflows/llvm-build-bump-pr.yml`](/.github/workflows/llvm-build-bump-pr.yml) for the build scripts for **Linux Shell** and **GitHub Actions**, respectively.
|
|
39
45
|
>
|
|
40
46
|
> 1. Or you can download `clang-format` native binary from [LLVM release assets](https://github.com/llvm/llvm-project/releases) that match your operating system platform and architecture like the lists below.
|
|
41
47
|
>
|
|
@@ -45,6 +51,47 @@ It supports **ALL** [**Tier1**](https://github.com/nodejs/node/blob/main/BUILDIN
|
|
|
45
51
|
> - `clang+llvm-18.1.7-x86_64-pc-windows-msvc.tar.xz`
|
|
46
52
|
> - `and more...`
|
|
47
53
|
|
|
54
|
+
### [GitHub Actions Runner Images](https://github.com/actions/runner-images?tab=readme-ov-file#available-images)
|
|
55
|
+
|
|
56
|
+
If you want to use `clang-format-node` in continuous integration (CI), You can use **GitHub Actions**. The following basic runner images are compatible(available) with `clang-format-node`.
|
|
57
|
+
|
|
58
|
+
Image | YAML Label | Included Software |
|
|
59
|
+
---------------------------- | ---------------------------------------------------------------------- | ----------------- |
|
|
60
|
+
macOS 14 | `macos-latest-large` or `macos-14-large` | [macOS-14] |
|
|
61
|
+
macOS 14 Arm64 | `macos-latest`, `macos-14`, `macos-latest-xlarge` or `macos-14-xlarge` | [macOS-14-arm64] |
|
|
62
|
+
macOS 13 | `macos-13` or `macos-13-large` | [macOS-13] |
|
|
63
|
+
macOS 13 Arm64 | `macos-13-xlarge` | [macOS-13-arm64] |
|
|
64
|
+
macOS 12 | `macos-12` or `macos-12-large` | [macOS-12] |
|
|
65
|
+
Ubuntu 24.04 <sup>beta</sup> | `ubuntu-24.04` | [ubuntu-24.04] |
|
|
66
|
+
Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | [ubuntu-22.04] |
|
|
67
|
+
Windows Server 2022 | `windows-latest` or `windows-2022` | [windows-2022] |
|
|
68
|
+
|
|
69
|
+
However, the following basic runner images are **NOT** compatible(available) with `clang-format-node`. It's because the ***dependencies*** for LLVM's latest release version are not compatible with the following images.
|
|
70
|
+
|
|
71
|
+
Image | YAML Label | Included Software |
|
|
72
|
+
----------------------- | -------------- | ----------------- |
|
|
73
|
+
~~Ubuntu 20.04~~ | `ubuntu-20.04` | [ubuntu-20.04] |
|
|
74
|
+
~~Windows Server 2019~~ | `windows-2019` | [windows-2019] |
|
|
75
|
+
|
|
76
|
+
### Docker(Build) Images
|
|
77
|
+
|
|
78
|
+
I used the following Images to build `clang-format` excuatable binaries.
|
|
79
|
+
|
|
80
|
+
> [!TIP]
|
|
81
|
+
>
|
|
82
|
+
> If you want to see which software is included in **GitHub Actions runner**, click [here](https://github.com/actions/runner-images?tab=readme-ov-file#available-images) and refer to the 'Included Software' column.
|
|
83
|
+
|
|
84
|
+
binary folder name | Build(Docker) Image |
|
|
85
|
+
------------------ | ------------------------------------------------------------------ |
|
|
86
|
+
`darwin-arm64` | GitHub Actions runner `macos-14` |
|
|
87
|
+
`darwin-x64` | GitHub Actions runner `macos-12` |
|
|
88
|
+
`linux-arm` | [`arm32v7/ubuntu:22.04`](https://hub.docker.com/r/arm32v7/ubuntu/) |
|
|
89
|
+
`linux-arm64` | [`arm64v8/ubuntu:22.04`](https://hub.docker.com/r/arm64v8/ubuntu/) |
|
|
90
|
+
`linux-ppc64` | [`ppc64le/ubuntu:22.04`](https://hub.docker.com/r/ppc64le/ubuntu/) |
|
|
91
|
+
`linux-s390x` | [`s390x/ubuntu:22.04`](https://hub.docker.com/r/s390x/ubuntu/) |
|
|
92
|
+
`linux-x64` | GitHub Actions runner `ubuntu-22.04` |
|
|
93
|
+
`win32-x64` | GitHub Actions runner `windows-2022` |
|
|
94
|
+
|
|
48
95
|
## Installation
|
|
49
96
|
|
|
50
97
|
### global
|
|
@@ -321,7 +368,7 @@ I recommend you to read the guides on [LLVM and clang-format mentioned in issues
|
|
|
321
368
|
|
|
322
369
|
The return value is equivalent to `process.platform`.
|
|
323
370
|
|
|
324
|
-
OS | return value of `os.platform()`
|
|
371
|
+
OS | return value of `os.platform()` |
|
|
325
372
|
------- | ---------------------------------- |
|
|
326
373
|
macOS | `darwin` |
|
|
327
374
|
Linux | `linux` |
|
|
@@ -331,7 +378,7 @@ Windows | `win32` |
|
|
|
331
378
|
|
|
332
379
|
The return value is equivalent to `process.arch`.
|
|
333
380
|
|
|
334
|
-
Architecture | return value of `os.arch()`
|
|
381
|
+
Architecture | return value of `os.arch()` | LLVM | Docker Platform | Docker Ubuntu Image |
|
|
335
382
|
------------------ | ------------------------------ | --------- | --------------- | ------------------- |
|
|
336
383
|
arm(armv7, armv7l) | `arm` | `ARM` | `arm/v7` | `arm32v7` |
|
|
337
384
|
arm64 | `arm64` | `AArch64` | `arm64/v8` | `arm64v8` |
|
|
@@ -343,9 +390,9 @@ x64 | `x64` | `X86` | `amd64`
|
|
|
343
390
|
|
|
344
391
|
### Build process
|
|
345
392
|
|
|
346
|
-
Some packages for **cross-compilation** have been deprecated, making it difficult to make build processes directly, so **cross-compilation** is not used.
|
|
393
|
+
Some packages for **cross-compilation** have been deprecated, making it difficult to make build processes directly, so **cross-compilation** is not used. Instead, I utilize **QEMU** and **Docker** to build cross-compiled binaries.
|
|
347
394
|
|
|
348
|
-
|
|
395
|
+
If you want to learn more about the images I used, see [Docker(Build) Images](#dockerbuild-images)
|
|
349
396
|
|
|
350
397
|
## Versioning
|
|
351
398
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|