From 1eeda6867fb91659d83863c7ed522f4e76833a43 Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:03:55 +0800 Subject: [PATCH 1/6] Run test on Bun --- .github/workflows/continuous-integration.yml | 28 +++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 914dd6f..e9f503b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -17,14 +17,16 @@ jobs: - "ubuntu-latest" - "macos-latest" - "windows-latest" - node_version: - - "22" - - "20" - - "18" + runtime: + - ["Node.js", "24"] + - ["Node.js", "22"] + - ["Node.js", "20"] + - ["Node.js", "18"] + - ["Bun", "latest"] # exclude: # - os: "macos-latest" # node_version: "12" - name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} + name: ${{matrix.runtime[0]}} ${{ matrix.runtime[1] }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} env: YARN_ENABLE_IMMUTABLE_INSTALLS: false @@ -34,15 +36,27 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 + if: ${{matrix.runtime[0] == 'Node.js'}} with: - node-version: ${{ matrix.node_version }} + node-version: ${{ matrix.runtime[1] }} + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + if: ${{matrix.runtime[0] == 'Bun'}} + with: + bun-version: ${{ matrix.runtime[1] }} - name: Install Dependencies run: yarn - - name: Run Test + - name: Run Test (${{matrix.runtime[0]}}) + if: ${{matrix.runtime[0] == 'Node.js'}} run: yarn test-coverage + - name: Run Test + if: ${{matrix.runtime[0] == 'Bun'}} + run: c8 bun test + - uses: codecov/codecov-action@v5 with: fail_ci_if_error: true From 72812d3a1136d75bc48e0e82a25e26c1993fdd52 Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:06:16 +0800 Subject: [PATCH 2/6] Fix --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e9f503b..925a113 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -53,9 +53,9 @@ jobs: if: ${{matrix.runtime[0] == 'Node.js'}} run: yarn test-coverage - - name: Run Test + - name: Run Test (${{matrix.runtime[0]}}) if: ${{matrix.runtime[0] == 'Bun'}} - run: c8 bun test + run: c8 bun test ./test.js - uses: codecov/codecov-action@v5 with: From f4feb7ccec2b40622c3c4853ff9400a865d9c502 Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:09:03 +0800 Subject: [PATCH 3/6] Assert --- .github/workflows/continuous-integration.yml | 3 ++- test.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 925a113..febb1d4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -30,6 +30,7 @@ jobs: runs-on: ${{ matrix.os }} env: YARN_ENABLE_IMMUTABLE_INSTALLS: false + TEST_RUNTIME: ${{matrix.runtime[0]}} steps: - name: Checkout uses: actions/checkout@v4 @@ -55,7 +56,7 @@ jobs: - name: Run Test (${{matrix.runtime[0]}}) if: ${{matrix.runtime[0] == 'Bun'}} - run: c8 bun test ./test.js + run: bun test-coverage - uses: codecov/codecov-action@v5 with: diff --git a/test.js b/test.js index 4e36598..92ec845 100644 --- a/test.js +++ b/test.js @@ -8,6 +8,10 @@ import fakePrettier from "./a-fake-prettier-to-test.cjs"; const code = await fs.readFile("./index.cjs", "utf8"); +if (process.env.TEST_RUNTIME === 'Bun') { + assert(typeof Bun !== 'undefined') +} + test("format", async () => { const formatOptions = { parser: "meriyah" }; const formattedBySynchronizedPrettier = synchronizedPrettier.format( From 4d02e1a580700e7c79f7a8648b53124df1a4d5e1 Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:09:56 +0800 Subject: [PATCH 4/6] Fix --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index 92ec845..74af0e4 100644 --- a/test.js +++ b/test.js @@ -8,8 +8,8 @@ import fakePrettier from "./a-fake-prettier-to-test.cjs"; const code = await fs.readFile("./index.cjs", "utf8"); -if (process.env.TEST_RUNTIME === 'Bun') { - assert(typeof Bun !== 'undefined') +if (process.env.TEST_RUNTIME === "Bun") { + assert(typeof Bun !== "undefined"); } test("format", async () => { From 175eae72371adf621470627ade6360b8140938fc Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:11:14 +0800 Subject: [PATCH 5/6] Update `make-synchronized` --- .release-it.json | 9 +++++++++ package.json | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .release-it.json diff --git a/.release-it.json b/.release-it.json new file mode 100644 index 0000000..819467b --- /dev/null +++ b/.release-it.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://unpkg.com/release-it@19/schema/release-it.json", + "git": { + "commitMessage": "chore: release v${version}" + }, + "github": { + "release": true + } +} diff --git a/package.json b/package.json index 5f24884..d993f4d 100644 --- a/package.json +++ b/package.json @@ -46,11 +46,11 @@ "prettier": "*" }, "devDependencies": { - "@types/node": "22.13.13", + "@types/node": "22.15.30", "c8": "10.1.3", "npm-run-all": "4.1.5", "prettier": "3.5.3", - "release-it": "18.1.2" + "release-it": "19.0.3" }, "packageManager": "yarn@4.7.0", "publishConfig": { @@ -58,6 +58,6 @@ "registry": "https://registry.npmjs.org/" }, "dependencies": { - "make-synchronized": "^0.4.2" + "make-synchronized": "^0.8.0" } } From 333c28b95ebb92677b06689cc0df25f6b9d3816d Mon Sep 17 00:00:00 2001 From: fisker Date: Sun, 8 Jun 2025 22:13:08 +0800 Subject: [PATCH 6/6] Fix --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index febb1d4..ca5d75f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -56,7 +56,7 @@ jobs: - name: Run Test (${{matrix.runtime[0]}}) if: ${{matrix.runtime[0] == 'Bun'}} - run: bun test-coverage + run: bun c8 bun test ./test.js - uses: codecov/codecov-action@v5 with: