Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn を pnpm に移行する #250

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: preactjs/compressed-size-action@v2
with:
build-script: 'build'
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/docs-hosting-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ jobs:
# url: TODO: Edit after

steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
# charcoal packages
- run: yarn install --immutable
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm build
# docs
- run: yarn add ../packages/react
- run: pnpm add ../packages/react
working-directory: ./docs
- run: yarn install
- run: pnpm install
working-directory: ./docs
- run: yarn build
- run: pnpm build
working-directory: ./docs

- id: auth
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/docs-hosting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,25 @@ jobs:
url: ${{ steps.preview_deploy.outputs.details_url }}

steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory path
id: pnpm-cache-dir-path
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
# charcoal packages
- run: yarn install --immutable
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm build
# docs
- run: yarn add ../packages/react
- run: pnpm add ../packages/react
working-directory: ./docs
- run: yarn install
- run: pnpm install
working-directory: ./docs
- run: yarn build
- run: pnpm build
working-directory: ./docs

- id: auth
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- name: Prepare deps
run: |
yarn install --immutable --inline-builds
yarn build
pnpm install --frozen-lockfile
pnpm build

- name: Output files
run: |
yarn storybook:build -o public-pages --quiet
pnpm storybook:build -o public-pages --quiet
cp .storybook/badge.svg public-pages/storybook-badge.svg
mv pages public-pages/docs

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,28 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- name: Prepare deps
run: |
yarn install --immutable --inline-builds
yarn workspaces foreach -vptR --from @charcoal-ui/icons-cli run build
pnpm install --frozen-lockfile
pnpm run build --recursive --resume-from @charcoal-ui/icons-cli

- name: Export
env:
FIGMA_FILE_URL: ${{ secrets.FIGMA_FILE_URL }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
run: yarn icons-cli figma:export
run: pnpm icons-cli figma:export

- name: Optimize
run: yarn icons-cli svg:optimize --ignoreFile ./misc/icons-cli-denylist
run: pnpm icons-cli svg:optimize --ignoreFile ./misc/icons-cli-denylist

- name: Generate source
run: yarn icons-cli files:generate
run: pnpm icons-cli files:generate

- name: Generate github token
id: generate_token
Expand All @@ -50,4 +51,4 @@ jobs:
GITHUB_REPO_OWNER: pixiv
GITHUB_REPO_NAME: charcoal
GITHUB_DEFAULT_BRANCH: main
run: yarn icons-cli github:pr
run: pnpm icons-cli github:pr
48 changes: 27 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,82 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm build

build-storybook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: yarn build
- run: yarn storybook:build
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm storybook:build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: pnpm install --frozen-lockfile
- run: |
yarn test
yarn storyshots
pnpm test
pnpm storyshots
env:
CI: 'true'

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: yarn lint
- run: pnpm install --frozen-lockfile
- run: pnpm lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: yarn build
- run: yarn typecheck
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm typecheck

typecheck-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- run: yarn install --immutable --inline-builds
- run: yarn typecheck:config
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck:config
53 changes: 53 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: version

on:
pull_request_review:
types: [submitted]

jobs:
version:
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == github.event.repository.default_branch

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: pnpm

- name: Prepare deps
run: |
pnpm install --frozen-lockfile
pnpm build

- name: Get comment body
id: get-comment-body
run: |
pnpm lerna version --conventional-commits --no-changelog --no-git-tag-version --no-push --yes > body.txt

body=$(cat body.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"

echo ::set-output name=body::$body

- name: Comment to Pull Request
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
This pull request will bump these packages as follows
(Created by https://github.com/peter-evans/create-or-update-comment )

`pnpm lerna version --conventional-commits --no-changelog --no-git-tag-version --no-push --yes`

```
${{ steps.get-comment-body.outputs.body }}
```
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.npmrc
*.tsbuildinfo

# editor
.vscode
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=true
strict-peer-dependencies=true
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __snapshots__/
/coverage/
.next/
lerna.json
pnpm-lock.yaml

LICENSE
/packages/theme/theme.json
Expand Down
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
return config
},
// 実験的にviteをpreviewビルドでviteを利用する
// CLIENT_PORT=443 yarn storybook:experimental-vite -p 6007 --no-manager-cache
// CLIENT_PORT=443 pnpm storybook:experimental-vite -p 6007 --no-manager-cache
...(process.env.USE_VITE === '1'
? {
framework: {
Expand Down
2 changes: 1 addition & 1 deletion .storybook/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { light, dark } = require('@charcoal-ui/theme')
const { createTailwindConfig } = require('@charcoal-ui/tailwind-config')

/**
* @type {import('tailwindcss/tailwind-config').TailwindConfig}
* @type {import('tailwindcss/tailwind-config').Config}
*/
module.exports = {
darkMode: false,
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"eslint.packageManager": "pnpm",
"npm.packageManager": "pnpm"
}
Loading
Loading