Skip to content

Commit

Permalink
Merge pull request #211 from mkobayashime/pnpm
Browse files Browse the repository at this point in the history
chore: use pnpm instead of yarn
  • Loading branch information
mkobayashime authored Sep 20, 2024
2 parents bfa0b44 + 3760254 commit 0ce9909
Show file tree
Hide file tree
Showing 7 changed files with 3,413 additions and 2,907 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ on: push

name: CI

env:
MAKE_YARN_FROZEN_LOCKFILE: 1

jobs:
lint:
name: Lint
Expand All @@ -13,30 +10,28 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
- name: Lint
run: make lint
- name: Typecheck
run: make typecheck
- name: Depcheck
run: yarn run depcheck --ignore-bin-package
cache: "pnpm"
- run: make node_modules
- run: make lint
- run: make typecheck
- run: pnpm exec depcheck --ignore-bin-package
- uses: wagoid/commitlint-github-action@v6
- name: Build
run: make build
- run: make build
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
cache: "pnpm"
- run: make node_modules
- name: Simple test
run: make test
- name: Build for E2E
Expand All @@ -48,8 +43,9 @@ jobs:
- name: E2E
working-directory: ./repo-bookmarklets
run: >
corepack enable &&
make node_modules &&
yarn add -D ../ &&
pnpm add -D ../ && make format &&
git config user.email 'email' && git config user.name 'name' &&
git add . && git commit -m 'Use local cli' &&
make build &&
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
branches-ignore:
- "**"

env:
MAKE_YARN_FROZEN_LOCKFILE: 1

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -18,10 +15,11 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- run: make node_modules
- run: make build
Expand Down
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
biome = yarn run biome
rollup = yarn run rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript

node_modules: package.json yarn.lock
ifeq ($(MAKE_YARN_FROZEN_LOCKFILE), 1)
yarn install --frozen-lockfile
else
yarn install
endif
biome = pnpm exec biome
rollup = pnpm exec rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
tsc = pnpm exec tsc
vitest = pnpm exec vitest

node_modules: package.json pnpm-*.yaml
pnpm install
@touch node_modules

lint: node_modules PHONY
Expand All @@ -16,16 +14,16 @@ lint.fix: node_modules PHONY
$(biome) check --fix .

typecheck: node_modules PHONY
yarn tsc --noEmit
$(tsc) --noEmit

typecheck.watch: node_modules PHONY
yarn tsc --noEmit --watch
$(tsc) --noEmit --watch

test: node_modules PHONY
yarn run vitest run
$(vitest) run

test.watch: node_modules PHONY
yarn run vitest watch
$(vitest) watch

dev: node_modules PHONY
$(rollup) --watch
Expand Down
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit-msg:
commands:
commitlint:
run: yarn run commitlint --edit
run: pnpm exec commitlint --edit
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "bookmarklets-cli",
"version": "1.0.3",
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
"author": "Masaki Kobayashi",
"license": "MIT",
"private": false,
Expand Down
Loading

0 comments on commit 0ce9909

Please sign in to comment.