Skip to content

Migrate from npm to pnpm #3694

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
75 changes: 12 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -13,86 +13,35 @@ env:
NODE_VERSION: 18.x

jobs:
install:
CI:
runs-on: ubuntu-latest

steps:
- name: Begin CI...
uses: actions/checkout@v4
- name: Use Node ${{ env.NODE_VERSION }}
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
env:
CI: true

lint:
runs-on: ubuntu-latest
needs: [install]
cache: 'pnpm'

steps:
- name: Begin CI...
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Lint
run: npm run lint
- name: Install dependencies
run: pnpm install
env:
CI: true

test:
runs-on: ubuntu-latest
needs: [install]

steps:
- name: Begin CI...
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Test
run: |
npm run test || npm run test || npm run test || exit 1
run: pnpm run test || pnpm run test || pnpm run test || exit 1
env:
CI: true

build:
runs-on: ubuntu-latest
needs: [install]

steps:
- name: Begin CI...
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Build
run: npm run build
run: pnpm run build
env:
CI: true

check-types:
runs-on: ubuntu-latest
needs: [build]

steps:
- name: Begin CI...
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Check Types
run: npm run lint-types
- name: Lint
run: pnpm lint
env:
CI: true
11,971 changes: 0 additions & 11,971 deletions package-lock.json

This file was deleted.

40 changes: 13 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -6,35 +6,23 @@
"repository": "https://github.com/tailwindlabs/headlessui",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*",
"playgrounds/*"
],
"scripts": {
"react": "npm run --workspace=@headlessui/react",
"react-playground": "npm run --workspace=playground-react dev",
"playground-react": "npm run --workspace=playground-react dev",
"vue": "npm run --workspace=@headlessui/vue",
"playground-vue": "npm run --workspace=playground-vue dev",
"vue-playground": "npm run --workspace=playground-vue dev",
"clean": "npm run clean --workspaces --if-present",
"build": "npm-run-all -p 'react build' 'vue build'",
"react": "pnpm --filter @headlessui/react",
"react-playground": "pnpm --filter playground-react dev",
"playground-react": "pnpm --filter playground-react dev",
"build:react": "pnpm --filter @headlessui/react build",
"vue": "pnpm --filter @headlessui/vue",
"playground-vue": "pnpm --filter playground-vue dev",
"vue-playground": "pnpm --filter playground-vue dev",
"build:vue": "pnpm --filter @headlessui/vue build",
"clean": "pnpm --recursive run clean",
"build": "pnpm run '/^build:.+/'",
"test": "./scripts/test.sh",
"lint": "./scripts/lint.sh",
"lint-check": "CI=true ./scripts/lint.sh",
"lint-types": "CI=true npm run lint-types --workspaces --if-present",
"lint": "pnpm --recursive run lint",
"release-channel": "node ./scripts/release-channel.js",
"release-notes": "node ./scripts/release-notes.js",
"package-path": "node ./scripts/package-path.js"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*": "npm run lint"
},
"prettier": {
"printWidth": 100,
"semi": false,
@@ -54,16 +42,14 @@
"@types/node": "^14.14.22",
"esbuild": "^0.17.8",
"fast-glob": "^3.2.11",
"husky": "^4.3.8",
"jest": "26",
"lint-staged": "^12.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.0",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.7",
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^3.0.2",
"tslib": "^2.3.1",
"typescript": "^5.4.3"
}
},
"packageManager": "pnpm@9.6.0"
}
5 changes: 2 additions & 3 deletions packages/@headlessui-react/package.json
Original file line number Diff line number Diff line change
@@ -36,9 +36,8 @@
"build": "../../scripts/build.sh --external:react --external:react-dom --external:use-sync-external-store",
"watch": "../../scripts/watch.sh --external:react --external:react-dom --external:use-sync-external-store",
"test": "../../scripts/test.sh",
"lint": "../../scripts/lint.sh",
"lint-types": "npm run attw -P --workspaces --if-present",
"playground": "npm run dev --workspace=playground-react",
"lint": "pnpm attw --pack",
"playground": "pnpm run dev --filter=playground-react",
"clean": "rimraf ./dist"
},
"peerDependencies": {
4 changes: 1 addition & 3 deletions packages/@headlessui-tailwindcss/package.json
Original file line number Diff line number Diff line change
@@ -32,12 +32,10 @@
"access": "public"
},
"scripts": {
"prepublishOnly": "npm run build",
"prepublishOnly": "pnpm build",
"build": "../../scripts/build.sh --external:tailwindcss && node ./scripts/fix-types.cjs",
"watch": "../../scripts/watch.sh --external:tailwindcss",
"test": "../../scripts/test.sh",
"lint": "../../scripts/lint.sh",
"lint-types": "npm run attw -P --workspaces --if-present",
"clean": "rimraf ./dist"
},
"peerDependencies": {
7 changes: 3 additions & 4 deletions packages/@headlessui-vue/package.json
Original file line number Diff line number Diff line change
@@ -32,13 +32,12 @@
"access": "public"
},
"scripts": {
"prepublishOnly": "npm run build",
"prepublishOnly": "pnpm build",
"build": "../../scripts/build.sh --external:vue",
"watch": "../../scripts/watch.sh --external:vue",
"test": "../../scripts/test.sh",
"lint": "../../scripts/lint.sh",
"lint-types": "npm run attw -P --workspaces --if-present",
"playground": "npm run dev --workspace=playground-vue",
"lint": "pnpm attw --pack",
"playground": "pnpm dev --filter=playground-vue",
"clean": "rimraf ./dist"
},
"peerDependencies": {
14 changes: 5 additions & 9 deletions playgrounds/react/package.json
Original file line number Diff line number Diff line change
@@ -3,15 +3,14 @@
"private": true,
"version": "0.0.0",
"scripts": {
"prebuild": "npm run build --workspace=@headlessui/react && npm run build --workspace=@headlessui/tailwindcss",
"predev": "npm run build --workspace=@headlessui/react && npm run build --workspace=@headlessui/tailwindcss",
"dev:tailwindcss": "npm run watch --workspace=@headlessui/tailwindcss",
"dev:headlessui": "npm run watch --workspace=@headlessui/react",
"prebuild": "pnpm --filter=@headlessui/{react,tailwindcss} build",
"predev": "pnpm --filter=@headlessui/{react,tailwindcss} build",
"dev:tailwindcss": "pnpm --filter=@headlessui/tailwindcss watch",
"dev:headlessui": "pnpm --filter=@headlessui/react watch",
"dev:next": "next dev",
"dev": "npm-run-all -p dev:*",
"dev": "pnpm run '/^dev:.+/'",
"build": "next build",
"start": "next start",
"lint-types": "echo",
"clean": "rimraf ./.next"
},
"dependencies": {
@@ -33,8 +32,5 @@
},
"devDependencies": {
"@floating-ui/react": "^0.24.8"
},
"resolutions": {
"next/@swc/helpers": "0.4.36"
}
}
11 changes: 5 additions & 6 deletions playgrounds/vue/package.json
Original file line number Diff line number Diff line change
@@ -6,14 +6,13 @@
"example": "examples"
},
"scripts": {
"prebuild": "npm run build --workspace=@headlessui/vue && npm run build --workspace=@headlessui/tailwindcss",
"predev": "npm run build --workspace=@headlessui/vue && npm run build --workspace=@headlessui/tailwindcss",
"dev:tailwindcss": "npm run watch --workspace=@headlessui/tailwindcss",
"dev:headlessui": "npm run watch --workspace=@headlessui/vue",
"prebuild": "pnpm --filter=@headlessui/{vue,tailwindcss} build",
"predev": "pnpm --filter=@headlessui/{vue,tailwindcss} build",
"dev:tailwindcss": "pnpm --filter=@headlessui/tailwindcss watch",
"dev:headlessui": "pnpm --filter=@headlessui/vue watch",
"dev:next": "vite serve",
"dev": "npm-run-all -p dev:*",
"dev": "pnpm run '/^dev:.+/'",
"build": "NODE_ENV=production vite build",
"lint-types": "echo",
"clean": "rimraf ./dist"
},
"dependencies": {
8,344 changes: 8,344 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
- 'packages/*'
- 'playgrounds/*'
35 changes: 0 additions & 35 deletions scripts/lint.sh

This file was deleted.