Skip to content

Commit 0935722

Browse files
authored
chore: use pnpm (#141)
* chore: use pnpm * chore: restore tsconfig types
1 parent 0393ef1 commit 0935722

23 files changed

+7059
-12215
lines changed

.codesandbox/ci.json

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

.github/actions/setup/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Setup
2+
description: Setup the environment
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup PNPM
8+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
9+
10+
- name: Setup Node.js
11+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
12+
with:
13+
node-version-file: .node-version
14+
cache: pnpm
15+
16+
- name: Install Dependencies
17+
shell: bash
18+
run: pnpm i

.github/dependabot.yml

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

.github/workflows/dependabot-auto-merge.yml

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

.github/workflows/preview-release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Preview Release
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
preview-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Setup
17+
uses: ./.github/actions/setup
18+
19+
- name: Bump Version
20+
run: pnpm -s changeset version
21+
22+
- name: Build
23+
run: pnpm -s prepublishOnly
24+
25+
- name: Publish Preview Release
26+
run: pnpx pkg-pr-new publish --compact

.github/workflows/release.yml

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- channel/*
89

910
permissions:
1011
contents: write
@@ -24,74 +25,24 @@ jobs:
2425
runs-on: ubuntu-latest
2526
steps:
2627
- name: Checkout Repo
27-
uses: actions/checkout@v4
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2829

29-
- name: Setup Node.js
30-
uses: actions/setup-node@v4
31-
with:
32-
node-version-file: ".nvmrc"
33-
34-
- name: Install Dependencies
35-
run: npm ci
36-
37-
- name: Get Commit ID
38-
if: ${{ github.event_name == 'workflow_dispatch' }}
39-
id: get-commit-id
40-
run: |
41-
echo "short-commit-id=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
42-
echo "commit-id=$(git rev-parse $GITHUB_SHA)" >> $GITHUB_OUTPUT
30+
- name: Setup
31+
uses: ./.github/actions/setup
4332

44-
- name: Get Package Name
45-
if: ${{ github.event_name == 'workflow_dispatch' }}
46-
id: get-package-name
47-
run: echo "package-name=$(npm pkg get name | jq -r)" >> $GITHUB_OUTPUT
48-
49-
- name: Get Normalized Package Name
50-
if: ${{ github.event_name == 'workflow_dispatch' }}
51-
id: get-normalized-package-name
52-
uses: frabert/replace-string-action@v2
53-
with:
54-
pattern: "^.*?([^/]+)$"
55-
string: ${{ steps.get-package-name.outputs.package-name }}
56-
replace-with: "$1"
57-
58-
- name: Patch package.json
59-
if: ${{ github.event_name == 'workflow_dispatch' }}
60-
run: npm pkg set version=${{ steps.get-commit-id.outputs.short-commit-id }}
61-
62-
- name: Build and Pack
63-
if: ${{ github.event_name == 'workflow_dispatch' }}
64-
run: |
65-
npm run prepublishOnly
66-
npm pack
67-
68-
- name: Draft Release
69-
if: ${{ github.event_name == 'workflow_dispatch' }}
70-
uses: ncipollo/release-action@v1
71-
with:
72-
allowUpdates: true
73-
artifacts: "${{ steps.get-normalized-package-name.outputs.replaced }}-${{ steps.get-commit-id.outputs.short-commit-id }}.tgz"
74-
artifactContentType: application/gzip
75-
body: "This is a draft release of ${{ steps.get-package-name.outputs.package-name }}: ${{ steps.get-commit-id.outputs.short-commit-id }}."
76-
commit: ${{ steps.get-commit-id.outputs.commit-id }}
77-
tag: "draft"
78-
draft: true
79-
name: "draft"
80-
removeArtifacts: true
33+
- name: Test
34+
run: pnpm -s test
8135

8236
- name: Get Next Package Version
83-
if: ${{ github.event_name != 'workflow_dispatch' }}
8437
id: package-version
85-
run: echo "version=$(npx changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
38+
run: echo "version=$(pnpm -s changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
8639

8740
- name: Create Release Pull Request or Publish to NPM
88-
if: ${{ github.event_name != 'workflow_dispatch' }}
8941
id: changesets
90-
uses: changesets/action@v1
42+
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
9143
with:
92-
version: npm run bump
93-
publish: npx changeset publish
44+
publish: pnpm -s changeset publish
9445
commit: "chore(release): v${{ steps.package-version.outputs.version }}"
9546
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
9748
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Setup
17+
uses: ./.github/actions/setup
18+
19+
- name: Test
20+
run: pnpm -s test

.lintstagedrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"*.{js,ts,cjs,mjs,cts,mts,d.cts,d.mts,jsx,tsx,json,jsonc}": [
3-
"biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true"
3+
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
44
],
55
"*.{md,yml,yaml,css,html}": ["prettier --write"]
66
}

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public-hoist-pattern[]=@changesets/config
2+
public-hoist-pattern[]=sh-syntax
3+
public-hoist-pattern[]=sql-formatter
4+
public-hoist-pattern[]=sql-parser-cst

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.simple-git-hooks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"pre-commit": "npx lint-staged"
2+
"pre-commit": "pnpm -s lint-staged"
33
}

biome.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"files": {
4-
"ignore": ["./tests/code/**/*"],
4+
"ignore": ["./tests/**/fixtures/**/*"],
55
"ignoreUnknown": true
66
},
77
"organizeImports": {
@@ -38,6 +38,14 @@
3838
"allowTrailingCommas": true
3939
}
4040
}
41+
},
42+
{
43+
"include": ["package.json", ".all-contributorsrc"],
44+
"json": {
45+
"formatter": {
46+
"lineWidth": 1
47+
}
48+
}
4149
}
4250
]
4351
}

0 commit comments

Comments
 (0)