clang-format-node 1.0.1 → 1.0.3

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 CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![lint](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/lint.yml/badge.svg)](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/lint.yml)
4
4
  [![test](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/test.yml/badge.svg)](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/test.yml)
5
+ [![test-cross-platform](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/test-cross-platform.yml/badge.svg)](https://github.com/lumirlumir/npm-clang-format-node/actions/workflows/test-cross-platform.yml)
5
6
  [![codecov](https://codecov.io/gh/lumirlumir/npm-clang-format-node/graph/badge.svg?token=69BF05THA2)](https://codecov.io/gh/lumirlumir/npm-clang-format-node)
6
7
  [![NPM Version](https://img.shields.io/npm/v/clang-format-node)](https://www.npmjs.com/package/clang-format-node)
7
8
  ![GitHub Release](https://img.shields.io/github/v/release/lumirlumir/npm-clang-format-node?label=release%20(LLVM%20version)&color=violet&display_name=release)
@@ -10,32 +11,38 @@ Node repackaging(wrapping) of the `clang-format` native binary inspired by ['ang
10
11
 
11
12
  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
13
 
14
+ > [!IMPORTANT]
15
+ >
16
+ > Please participate in the issue regarding the introduction of a **glob pattern**. Click [here](https://github.com/lumirlumir/npm-clang-format-node/issues/14).
17
+
13
18
  ## Why I started this project
14
19
 
15
20
  ['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
21
 
17
22
  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
23
 
19
- ## Supported OS platforms and architectures
24
+ ## Supported
25
+
26
+ ### OS Platforms and Architectures
20
27
 
21
28
  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
29
 
23
30
  (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
31
 
25
- <br> | Operating System | Architectures | Versions | Support Type |
26
- ---- | ---------------- | ---------------- | --------------------------------- | ------------ |
27
- 1 | macOS | arm64 | >= 11.0 | Tier 1 |
28
- 2 | macOS | x64 | >= 11.0 | Tier 1 |
29
- 3 | GNU/Linux | armv7 | kernel >= 4.18, glibc >= 2.28 | Tier 1 |
30
- 4 | GNU/Linux | arm64 | kernel >= 4.18, glibc >= 2.28 | Tier 1 |
31
- 5 | GNU/Linux | ppc64le >=power8 | kernel >= 4.18, glibc >= 2.28 | Tier 2 |
32
- 6 | GNU/Linux | s390x | kernel >= 4.18, glibc >= 2.28 | Tier 2 |
33
- 7 | GNU/Linux | x64 | kernel >= 4.18, glibc >= 2.28 | Tier 1 |
34
- 8 | Windows | x64 | >= Windows 10/Server 2016 | Tier 1 |
32
+ <br> | Operating System | Architectures | Support Type |
33
+ ---- | ---------------- | ---------------- | ------------ |
34
+ 1 | macOS | arm64 | Tier 1 |
35
+ 2 | macOS | x64 | Tier 1 |
36
+ 3 | GNU/Linux | armv7 | Tier 1 |
37
+ 4 | GNU/Linux | arm64 | Tier 1 |
38
+ 5 | GNU/Linux | ppc64le >=power8 | Tier 2 |
39
+ 6 | GNU/Linux | s390x | Tier 2 |
40
+ 7 | GNU/Linux | x64 | Tier 1 |
41
+ 8 | Windows | x64 | Tier 1 |
35
42
 
36
43
  > [!TIP]
37
44
  >
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 [`docs/llvm-build-linux-x64.yml`](/docs/llvm-build-linux-x64.yml) for the Linux build scripts for **Shell** and **GitHub Actions**, respectively.
45
+ > 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
46
  >
40
47
  > 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
48
  >
@@ -45,6 +52,47 @@ It supports **ALL** [**Tier1**](https://github.com/nodejs/node/blob/main/BUILDIN
45
52
  > - `clang+llvm-18.1.7-x86_64-pc-windows-msvc.tar.xz`
46
53
  > - `and more...`
47
54
 
55
+ ### [GitHub Actions Runner Images](https://github.com/actions/runner-images?tab=readme-ov-file#available-images)
56
+
57
+ 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`.
58
+
59
+ Image | YAML Label | Included Software |
60
+ ---------------------------- | ---------------------------------------------------------------------- | ----------------- |
61
+ macOS 14 | `macos-latest-large` or `macos-14-large` | [macOS-14] |
62
+ macOS 14 Arm64 | `macos-latest`, `macos-14`, `macos-latest-xlarge` or `macos-14-xlarge` | [macOS-14-arm64] |
63
+ macOS 13 | `macos-13` or `macos-13-large` | [macOS-13] |
64
+ macOS 13 Arm64 | `macos-13-xlarge` | [macOS-13-arm64] |
65
+ macOS 12 | `macos-12` or `macos-12-large` | [macOS-12] |
66
+ Ubuntu 24.04 <sup>beta</sup> | `ubuntu-24.04` | [ubuntu-24.04] |
67
+ Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | [ubuntu-22.04] |
68
+ Windows Server 2022 | `windows-latest` or `windows-2022` | [windows-2022] |
69
+
70
+ 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.
71
+
72
+ Image | YAML Label | Included Software |
73
+ ----------------------- | -------------- | ----------------- |
74
+ ~~Ubuntu 20.04~~ | `ubuntu-20.04` | [ubuntu-20.04] |
75
+ ~~Windows Server 2019~~ | `windows-2019` | [windows-2019] |
76
+
77
+ ### Docker(Build) Images
78
+
79
+ I used the following Images to build `clang-format` excuatable binaries.
80
+
81
+ > [!TIP]
82
+ >
83
+ > 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.
84
+
85
+ Binary Folder Name | Docker(Build) Image |
86
+ ------------------ | ------------------------------------------------------------------ |
87
+ `darwin-arm64` | GitHub Actions runner `macos-14` |
88
+ `darwin-x64` | GitHub Actions runner `macos-12` |
89
+ `linux-arm` | [`arm32v7/ubuntu:22.04`](https://hub.docker.com/r/arm32v7/ubuntu/) |
90
+ `linux-arm64` | [`arm64v8/ubuntu:22.04`](https://hub.docker.com/r/arm64v8/ubuntu/) |
91
+ `linux-ppc64` | [`ppc64le/ubuntu:22.04`](https://hub.docker.com/r/ppc64le/ubuntu/) |
92
+ `linux-s390x` | [`s390x/ubuntu:22.04`](https://hub.docker.com/r/s390x/ubuntu/) |
93
+ `linux-x64` | GitHub Actions runner `ubuntu-22.04` |
94
+ `win32-x64` | GitHub Actions runner `windows-2022` |
95
+
48
96
  ## Installation
49
97
 
50
98
  ### global
@@ -321,7 +369,7 @@ I recommend you to read the guides on [LLVM and clang-format mentioned in issues
321
369
 
322
370
  The return value is equivalent to `process.platform`.
323
371
 
324
- OS | return value of `os.platform()` |
372
+ OS | Return value of `os.platform()` |
325
373
  ------- | ---------------------------------- |
326
374
  macOS | `darwin` |
327
375
  Linux | `linux` |
@@ -331,7 +379,7 @@ Windows | `win32` |
331
379
 
332
380
  The return value is equivalent to `process.arch`.
333
381
 
334
- Architecture | return value of `os.arch()` | LLVM | Docker Platform | Docker Ubuntu Image |
382
+ Architecture | Return value of `os.arch()` | LLVM | Docker Platform | Docker Ubuntu Image |
335
383
  ------------------ | ------------------------------ | --------- | --------------- | ------------------- |
336
384
  arm(armv7, armv7l) | `arm` | `ARM` | `arm/v7` | `arm32v7` |
337
385
  arm64 | `arm64` | `AArch64` | `arm64/v8` | `arm64v8` |
@@ -343,9 +391,9 @@ x64 | `x64` | `X86` | `amd64`
343
391
 
344
392
  ### Build process
345
393
 
346
- Some packages for **cross-compilation** have been deprecated, making it difficult to make build processes directly, so **cross-compilation** is not used.
394
+ 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
395
 
348
- **Linux** is built using QEMU and Docker. **macOS** and **Windows** are built using the `macos-13`, `macos-14`, and `windows-latest` runners on GitHub Actions.
396
+ If you want to learn more about the images I used, see [Docker(Build) Images](#dockerbuild-images)
349
397
 
350
398
  ## Versioning
351
399
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clang-format-node",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Node repackaging of the clang-format native binary inspired by angular/clang-format.🐉",
5
5
  "main": "build/index.js",
6
6
  "files": [
@@ -57,7 +57,7 @@
57
57
  "@babel/cli": "^7.24.8",
58
58
  "@babel/core": "^7.25.2",
59
59
  "@babel/preset-env": "^7.25.3",
60
- "concurrently": "^8.2.2",
60
+ "concurrently": "^9.0.0",
61
61
  "editorconfig-checker": "^5.1.8",
62
62
  "eslint": "^8.57.0",
63
63
  "eslint-config-airbnb-base": "^15.0.0",