Skip to content

Commit 117c552

Browse files
committed
Merge remote-tracking branch 'origin/main' into temp-branch-strategy
2 parents 9b026b5 + aa60c37 commit 117c552

24 files changed

Lines changed: 1607 additions & 3520 deletions

.eslintrc.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.github/** @Andarist @bluwy
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup CI
2+
description: Setup CI
3+
4+
inputs:
5+
node-version:
6+
description: Node.js version
7+
required: false
8+
default: 24
9+
skip-cache:
10+
description: "Whether to skip the cache"
11+
required: false
12+
default: "false"
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- name: Set up pnpm
18+
uses: pnpm/action-setup@91ab88e2619ed1f46221f0ba42d1492c02baf788 # v6.0.6
19+
20+
- name: Set up Node.js ${{ inputs.node-version }}
21+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
22+
with:
23+
node-version: ${{ inputs.node-version }}
24+
package-manager-cache: ${{ inputs.skip-cache != 'true' }}
25+
cache: ${{ inputs.skip-cache != 'true' && 'pnpm' || '' }}
26+
27+
- name: Install dependencies
28+
shell: bash
29+
run: pnpm install --frozen-lockfile

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
cooldown:
13+
default-days: 7

.github/workflows/ci.yml

Lines changed: 77 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,92 @@
1-
name: CI Checks
1+
name: CI
2+
23
on:
34
pull_request:
4-
push:
5+
# merge queue is required so all commits on target branches trigger this workflow
6+
# despite lack of the push event trigger here
7+
merge_group:
58
branches:
69
- main
710

811
permissions:
9-
contents: write
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.sha }}
16+
cancel-in-progress: true
1017

1118
jobs:
12-
ci-checks:
19+
build:
20+
name: Build
1321
runs-on: ubuntu-latest
1422
steps:
15-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Check out repo
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1625
with:
17-
fetch-depth: 2
18-
- name: Use Node.js
19-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
26+
persist-credentials: false
27+
28+
- uses: ./.github/actions/ci-setup
29+
30+
- name: Build
31+
run: pnpm build
32+
33+
lint:
34+
name: Lint
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Check out repo
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2039
with:
21-
node-version: 24.x
22-
- name: Extract pnpm version and install
23-
run: |
24-
VERSION=$(cat package.json | grep '"packageManager": "pnpm@' | sed 's/.*"pnpm@\([^"]*\)".*/\1/')
25-
npm install -g pnpm@$VERSION
26-
- uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
40+
persist-credentials: false
41+
42+
- uses: ./.github/actions/ci-setup
43+
44+
- name: Codegen
45+
run: pnpm codegen:github
46+
47+
- name: Lint
48+
run: pnpm lint
49+
50+
- name: Format
51+
run: pnpm format:check
52+
53+
test:
54+
name: Test
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 20
57+
# Integration tests push to the repo, which requires a token with write
58+
# access. Fork PRs only get a read-only GITHUB_TOKEN, so skip them here
59+
# and rely on merge_group to gate the merge.
60+
if: >-
61+
github.event_name != 'pull_request' ||
62+
github.event.pull_request.head.repo.full_name == github.repository
63+
permissions:
64+
contents: write # integration tests create and push temporary branches
65+
steps:
66+
- name: Check out repo
67+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
68+
with:
69+
fetch-depth: 2 # integration tests read the two most recent local commits
70+
persist-credentials: false
71+
72+
- uses: ./.github/actions/ci-setup
2773
with:
28-
path: ~/.pnpm-store
29-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
30-
- run: pnpm install --frozen-lockfile
31-
- run: pnpm build
32-
- run: pnpm lint
33-
- run: pnpm format:check
34-
- run: pnpm test:integration
74+
skip-cache: true # avoid cache poisoning from this only job with write access, just in case
75+
76+
- name: Build
77+
run: pnpm build
78+
79+
- name: Integration tests
80+
run: pnpm test:integration
3581
env:
3682
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
HEAD_OID: ${{ github.base_ref }}
83+
84+
ci-ok:
85+
name: CI OK
86+
runs-on: ubuntu-latest
87+
if: always()
88+
needs: [build, lint, test]
89+
steps:
90+
- name: Exit with error if some jobs are not successful
91+
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
92+
run: exit 1

.github/workflows/publish.yml

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,66 @@
1-
name: Release & Publish
1+
name: Publish
22

33
on:
44
push:
55
branches:
66
- main
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
id-token: write
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: false
11+
queue: max
12+
13+
permissions: {}
1214

1315
jobs:
14-
release-and-publish:
16+
version:
17+
name: Version
1518
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
outputs:
21+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
22+
permissions:
23+
contents: write # to create version commits (changesets/action)
24+
pull-requests: write # to create pull request (changesets/action)
1625
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
- name: Check out repo
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
30+
31+
- uses: ./.github/actions/ci-setup
1832
with:
19-
token: ${{ secrets.GITHUB_TOKEN }}
20-
- name: Use Node.js
21-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
33+
skip-cache: true # avoid cache poisoning attacks
34+
35+
- name: Create or update release pull request
36+
id: changesets
37+
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
38+
39+
publish:
40+
name: Publish
41+
if: needs.version.outputs.hasChangesets == 'false'
42+
needs: version
43+
runs-on: ubuntu-latest
44+
environment: npm
45+
timeout-minutes: 10
46+
permissions:
47+
contents: write # to create release (changesets/action)
48+
id-token: write # to use OpenID Connect token for trusted publishing (changesets/action)
49+
steps:
50+
- name: Check out repo
51+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2252
with:
23-
node-version: 24.x
24-
- name: Extract pnpm version and install
25-
run: |
26-
VERSION=$(cat package.json | grep '"packageManager": "pnpm@' | sed 's/.*"pnpm@\([^"]*\)".*/\1/')
27-
npm install -g pnpm@$VERSION
28-
- name: Cache pnpm modules
29-
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
53+
persist-credentials: false
54+
55+
- uses: ./.github/actions/ci-setup
3056
with:
31-
path: ~/.pnpm-store
32-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
33-
- run: pnpm install --frozen-lockfile
34-
- run: pnpm build
35-
- name: Run Changeset Workflow
36-
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
skip-cache: true # avoid cache poisoning attacks
58+
59+
- name: Build
60+
run: pnpm build
61+
62+
- name: Publish to npm
63+
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
3964
with:
4065
publish: pnpm changeset publish
4166
commitMode: github-api

.oxlintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"options": {
4+
"typeAware": true,
5+
"typeCheck": true,
6+
"maxWarnings": 0
7+
},
8+
"plugins": [
9+
"eslint",
10+
"typescript",
11+
"unicorn",
12+
"oxc",
13+
"import",
14+
"node",
15+
"vitest"
16+
],
17+
"rules": {
18+
"vitest/expect-expect": "off"
19+
}
20+
}

jest.integration.config.cjs

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)