Skip to content

Commit

Permalink
migrate to pnpm (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Mar 14, 2024
1 parent 9d01480 commit 29ef5a4
Show file tree
Hide file tree
Showing 10 changed files with 8,872 additions and 7,864 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
4 changes: 2 additions & 2 deletions examples/01_typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"dependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"react": "experimental",
"react-dom": "experimental",
"react": "canary",
"react-dom": "canary",
"react-scripts": "latest",
"typescript": "latest",
"use-valtio": "latest",
Expand Down
4 changes: 2 additions & 2 deletions examples/02_suspense/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"dependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"react": "experimental",
"react-dom": "experimental",
"react": "canary",
"react-dom": "canary",
"react-scripts": "latest",
"typescript": "latest",
"use-valtio": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/02_suspense/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="react/experimental" />
/// <reference types="react/canary" />

import React, { Suspense, use, useTransition } from 'react';

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"suspense"
],
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@types/jest": "^29.2.6",
"@types/node": "^20.11.27",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.48.2",
Expand All @@ -66,8 +66,8 @@
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.3",
"react": "^0.0.0-experimental-ee8509801-20230117",
"react-dom": "^0.0.0-experimental-ee8509801-20230117",
"react": "18.3.0-canary-bb0944fe5-20240313",
"react-dom": "18.3.0-canary-bb0944fe5-20240313",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.4",
Expand Down
Loading

0 comments on commit 29ef5a4

Please sign in to comment.