Skip to content

Commit

Permalink
migrate to pnpm and simplify configs
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Jan 9, 2024
1 parent 2f153cb commit b03d70b
Show file tree
Hide file tree
Showing 7 changed files with 8,756 additions and 7,854 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"buildCommand": "compile",
"sandboxes": ["new", "react-typescript-react-ts"],
"node": "14"
"node": "18"
}
41 changes: 12 additions & 29 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,19 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache dependencies
uses: actions/cache@v1
version: 8.2.0
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Test
run: yarn test

- name: Compile
run: yarn run compile

- name: Publish
run: npm publish
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: npm test
- run: npm run compile
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 9 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
node-version: '14.x'

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache dependencies
uses: actions/cache@v1
version: 8.2.0
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Test
run: yarn test
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"cache"
],
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/node": "^20.10.6",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.50.0",
Expand Down
Loading

0 comments on commit b03d70b

Please sign in to comment.