Skip to content

Commit edd8e35

Browse files
committed
chore: use pnpm
1 parent 0393ef1 commit edd8e35

25 files changed

+7062
-12226
lines changed

.all-contributorsrc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"projectName": "prettier-plugin-embed",
33
"projectOwner": "Sec-ant",
4-
"files": [
5-
"README.md"
6-
],
4+
"files": ["README.md"],
75
"commitType": "docs",
86
"commitConvention": "angular",
97
"contributorsPerLine": 7,
@@ -13,19 +11,14 @@
1311
"name": "Karl Horky",
1412
"avatar_url": "https://avatars.githubusercontent.com/u/1935696?v=4",
1513
"profile": "https://upleveled.io",
16-
"contributions": [
17-
"code",
18-
"doc"
19-
]
14+
"contributions": ["code", "doc"]
2015
},
2116
{
2217
"login": "kelvinsjk",
2318
"name": "Kelvin Soh",
2419
"avatar_url": "https://avatars.githubusercontent.com/u/64682375?v=4",
2520
"profile": "https://math-atlas.vercel.app",
26-
"contributions": [
27-
"code"
28-
]
21+
"contributions": ["code"]
2922
}
3023
]
3124
}

.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.
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/*

0 commit comments

Comments
 (0)