mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
Migrate from yarn to pnpm
This comprehensive migration includes: ### Configuration Updates - Updated root package.json with pnpm workspace configuration - Added packageManager field and pnpm overrides for graphql version - Updated GitHub Actions workflows (.github/workflows/ci.yml, code-size.yml) - Updated Netlify configuration (netlify.toml) - Updated deployment script (deploy.sh) ### Documentation Updates - Updated all README files to use pnpm instead of yarn - Updated installation and build instructions across packages: - packages/webamp/README.md - packages/webamp-modern/README.md - packages/webamp-docs/README.md - packages/ani-cursor/README.md - packages/webamp/demo/readme.md ### Lock File Migration - Removed yarn.lock - Generated pnpm-lock.yaml preserving exact dependency versions - Moved resolutions from skin-database package.json to root pnpm overrides - Created pnpm-workspace.yaml for optimized workspace configuration ### CI/CD Updates - Updated all yarn commands to use pnpm equivalents - Changed yarn workspace commands to pnpm --filter syntax - Updated cache keys to use pnpm-lock.yaml instead of yarn.lock - Added pnpm/action-setup for GitHub Actions ### Validation - Tested builds for webamp, webamp-modern, ani-cursor, webamp-docs - Tested installation and linting for skin-database - Verified dependency resolution consistency - Confirmed all scripts work with pnpm All package versions remain identical to yarn.lock, ensuring no breaking changes.
This commit is contained in:
parent
bcaa8dfdc6
commit
0d53884fde
15 changed files with 32840 additions and 26212 deletions
68
.github/workflows/ci.yml
vendored
68
.github/workflows/ci.yml
vendored
|
|
@ -20,14 +20,18 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- name: Generate cache key
|
||||
id: cache-key
|
||||
run: echo "key=node-modules-${{ hashFiles('**/yarn.lock') }}" >> $GITHUB_OUTPUT
|
||||
run: echo "key=node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}" >> $GITHUB_OUTPUT
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# Build job - Vite build for demo site
|
||||
build:
|
||||
|
|
@ -39,15 +43,19 @@ jobs:
|
|||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Build Vite Demo
|
||||
run: |
|
||||
# Set CI environment variable for optimized builds
|
||||
export CI=true
|
||||
yarn workspace ani-cursor build
|
||||
yarn workspace webamp build
|
||||
pnpm --filter ani-cursor build
|
||||
pnpm --filter webamp build
|
||||
env:
|
||||
NODE_ENV: production
|
||||
- name: Cache build artifacts
|
||||
|
|
@ -68,15 +76,19 @@ jobs:
|
|||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Build Library Bundles
|
||||
run: |
|
||||
# Set CI environment variable for optimized builds
|
||||
export CI=true
|
||||
yarn workspace ani-cursor build
|
||||
yarn workspace webamp build-library
|
||||
pnpm --filter ani-cursor build
|
||||
pnpm --filter webamp build-library
|
||||
env:
|
||||
NODE_ENV: production
|
||||
- name: Cache library artifacts
|
||||
|
|
@ -99,13 +111,17 @@ jobs:
|
|||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Lint
|
||||
run: |
|
||||
yarn lint
|
||||
yarn workspace webamp type-check
|
||||
pnpm lint
|
||||
pnpm --filter webamp type-check
|
||||
|
||||
# Test job - runs in parallel
|
||||
test:
|
||||
|
|
@ -117,16 +133,20 @@ jobs:
|
|||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
touch packages/skin-database/config.js
|
||||
# Run tests with optimizations for CI
|
||||
export CI=true
|
||||
yarn test --maxWorkers=2
|
||||
yarn workspace webamp test --maxWorkers=2
|
||||
pnpm test -- --maxWorkers=2
|
||||
pnpm --filter webamp test -- --maxWorkers=2
|
||||
env:
|
||||
NODE_ENV: test
|
||||
# - name: Run Integration Tests
|
||||
|
|
@ -160,9 +180,13 @@ jobs:
|
|||
with:
|
||||
node-version: 20.x
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Restore build artifacts
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
|
@ -185,7 +209,7 @@ jobs:
|
|||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
echo "Setting version to 0.0.0-next-${RELEASE_COMMIT_SHA::7}"
|
||||
yarn workspace webamp version --new-version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
|
||||
pnpm --filter webamp version --new-version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
|
||||
env:
|
||||
RELEASE_COMMIT_SHA: ${{ github.sha }}
|
||||
- name: Build release version
|
||||
|
|
|
|||
4
.github/workflows/code-size.yml
vendored
4
.github/workflows/code-size.yml
vendored
|
|
@ -9,6 +9,10 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
yarn workspace ani-cursor build
|
||||
yarn workspace webamp build
|
||||
yarn workspace webamp build-library
|
||||
yarn workspace webamp-modern build
|
||||
pnpm --filter ani-cursor build
|
||||
pnpm --filter webamp build
|
||||
pnpm --filter webamp build-library
|
||||
pnpm --filter webamp-modern build
|
||||
mv packages/webamp-modern/build packages/webamp/dist/demo-site/modern
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
[build]
|
||||
command = "yarn deploy"
|
||||
command = "pnpm deploy"
|
||||
publish = "packages/webamp/dist/demo-site/"
|
||||
|
||||
# A short URL for listeners of https://changelog.com/podcast/291
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@
|
|||
"packages/*",
|
||||
"examples/*"
|
||||
],
|
||||
"packageManager": "pnpm@8.0.0",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"graphql": "16.8.1"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,12 +8,6 @@ I wrote a blog post about this library which you can find [here](https://jordane
|
|||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
yarn add ani-cursor
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
npm install ani-cursor
|
||||
```
|
||||
|
|
@ -41,4 +35,4 @@ document.body.appendChild(h1);
|
|||
applyCursor("#pizza", "https://archive.org/cors/tucows_169906_Pizza_cursor/pizza.ani");
|
||||
```
|
||||
|
||||
Try the [Live Demo on CodeSandbox](https://codesandbox.io/s/jolly-thunder-9jkio?file=/src/index.js).
|
||||
Try the [Live Demo on CodeSandbox](https://codesandbox.io/s/jolly-thunder-9jkio?file=/src/index.js).
|
||||
|
|
|
|||
|
|
@ -69,8 +69,5 @@
|
|||
"@typescript-eslint/parser": "^7.1.0",
|
||||
"grats": "^0.0.31",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"graphql": "16.8.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
|
|||
## Installation
|
||||
|
||||
```bash
|
||||
yarn
|
||||
pnpm
|
||||
```
|
||||
|
||||
## Local Development
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
pnpm start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
|
@ -19,7 +19,7 @@ This command starts a local development server and opens up a browser window. Mo
|
|||
## Build
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
|
@ -29,13 +29,13 @@ This command generates static content into the `build` directory and can be serv
|
|||
Using SSH:
|
||||
|
||||
```bash
|
||||
USE_SSH=true yarn deploy
|
||||
USE_SSH=true pnpm deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```bash
|
||||
GIT_USER=<Your GitHub username> yarn deploy
|
||||
GIT_USER=<Your GitHub username> pnpm deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
## Running locally
|
||||
|
||||
Assuming you have [Yarn](https://yarnpkg.com/) installed:
|
||||
Assuming you have [pnpm](https://pnpm.io/) installed:
|
||||
|
||||
```bash
|
||||
cd packages/webamp-modern
|
||||
yarn
|
||||
yarn start
|
||||
pnpm
|
||||
pnpm start
|
||||
```
|
||||
|
||||
## Performance Improvements
|
||||
|
|
|
|||
|
|
@ -8,32 +8,32 @@ I do most development by starting the demo site in dev mode and iterating that w
|
|||
cd webamp
|
||||
# Change into the NPM module's sub directory
|
||||
cd packages/webamp
|
||||
# __Note:__ Please use yarn over npm, since yarn will respect our `yarn.lock` file
|
||||
yarn install
|
||||
yarn start
|
||||
# __Note:__ Please use pnpm over npm/yarn, since pnpm will respect our `pnpm-lock.yaml` file
|
||||
pnpm install
|
||||
pnpm start
|
||||
|
||||
`http://localhost:8080/` should automatically open in your browser.
|
||||
|
||||
# Run tests and lint checks
|
||||
yarn test
|
||||
pnpm test
|
||||
|
||||
## Building
|
||||
|
||||
The NPM module is built separately from the demo site. To build it run:
|
||||
|
||||
yarn run build-library
|
||||
pnpm run build-library
|
||||
|
||||
This will write files to `./built`.
|
||||
|
||||
## Testing
|
||||
|
||||
yarn test
|
||||
pnpm test
|
||||
|
||||
This will run the tests the linter and the type checker.
|
||||
|
||||
To update snapshots run
|
||||
|
||||
yarn test -u
|
||||
pnpm test -u
|
||||
|
||||
## Cutting a Release
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ Additionally, it makes use of some private Webamp APIs to add the following func
|
|||
|
||||
To do an optimized build of the demo site, you can run:
|
||||
|
||||
yarn run build
|
||||
pnpm run build
|
||||
|
||||
If you wish to test this build locally, run:
|
||||
|
||||
yarn run serve
|
||||
pnpm run serve
|
||||
|
||||
Then open the local ip/port that is output to the console in your browser.
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
"build": "vite build --emptyOutDir",
|
||||
"build-library": "node ./scripts/rollup.mjs",
|
||||
"prepublishOnly": "npm run build-library && npm run type-check",
|
||||
"publish-next": "yarn publish --new-version=\"0.0.0-next-$(git rev-parse --short HEAD)\" --tag next",
|
||||
"publish-next": "pnpm publish --new-version=\"0.0.0-next-$(git rev-parse --short HEAD)\" --tag next",
|
||||
"serve": "http-server ./dist/demo-site",
|
||||
"start": "vite",
|
||||
"test": "jest --config=config/jest.unit.js",
|
||||
|
|
|
|||
32757
pnpm-lock.yaml
generated
Normal file
32757
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
3
pnpm-workspace.yaml
Normal file
3
pnpm-workspace.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
packages:
|
||||
- 'packages/*'
|
||||
- 'examples/*'
|
||||
Loading…
Add table
Add a link
Reference in a new issue