Skip to content

Commit

Permalink
chore: corepack を導入する (#4643)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-sasaki-0529 authored May 15, 2024
1 parent 3b6e5f8 commit 9d34b5a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
15 changes: 5 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ commands:
- dependencies-test-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
# fallback to using the latest cache if no exact match is found
- modules-cache-
- run: pnpm install
- run: |
sudo corepack enable
sudo corepack prepare
pnpm ui install
- save_cache:
paths:
- node_modules
Expand All @@ -44,16 +47,7 @@ commands:
- run: pnpm ui test:build-assets
run-a11y-test:
steps:
- checkout
- restore_cache:
keys:
- pnpm-packages-reg-{{ checksum "pnpm-lock.yaml" }}
- run: pnpm ui install
- run: pnpm ui exec playwright install
- save_cache:
paths:
- ~/.cache/pnpm
key: pnpm-packages-reg-{{ checksum "pnpm-lock.yaml" }}
- run:
command: pnpm ui build-storybook
- run:
Expand Down Expand Up @@ -103,6 +97,7 @@ jobs:
working_directory: ~/repo
resource_class: medium+
steps:
- setup-for-test
- install-noto-sans-cjk-jp
- run-a11y-test
chromatic-deployment:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ jobs:
browser: [chrome]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: run
run: |
pnpm install
corepack enable
corepack prepare
pnpm ui install
pnpm ui e2e
env:
TESTCAFE_BROWSER: ${{ matrix.browser }}
9 changes: 5 additions & 4 deletions .github/workflows/publishRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
with:
ref: release-candidate
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
Expand All @@ -28,7 +25,11 @@ jobs:
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- run: pnpm install
- name: pnpm install
run: |
corepack enable
corepack prepare
pnpm ui install
- run: pnpm ui release
if: ${{ env.IS_PRERELEASE == 'false' }}
- run: pnpm ui release --prerelease
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/startRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
BASE_TAG=v$(cat ./packages/smarthr-ui/package.json | grep "\"version\"" | cut -d "\"" -f 4)
git checkout $BASE_TAG
git merge --no-edit ${{ github.ref }}
- run: pnpm install
- run: pnpm ui install
- name: release dry run
if: ${{ env.IS_PRERELEASE == 'false' }}
run: pnpm ui release:dryrun > ${{ env.RESULT_PATH }}
Expand Down
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ Thank you for reading this!
We use `pnpm` for the package manager.

```sh
$ pnpm
$ corepack enable
$ corepack prepare
$ pnpm install
```

## Test

```sh
$ pnpm test
$ pnpm ui test
```

`smarthr-ui` uses Jest's snapshot testing.

If the test results are what you expect, you can update the snapshot with the following command.

```sh
$ pnpm test:update-snapshot
$ pnpm ui test:update-snapshot
```

## Commit
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"commitmsg": "commitlint -e $GIT_PARAMS",
"prepare": "husky"
},
"packageManager": "[email protected]+sha256.691fe176eea9a8a80df20e4976f3dfb44a04841ceb885638fe2a26174f81e65e",
"pnpm": {
"overrides": {
"@babel/helper-compilation-targets": "^7.23.6",
Expand Down

0 comments on commit 9d34b5a

Please sign in to comment.