chore(build): change to pnpm from yarn (#919)

* flip to npm

* try pnpm

* nothing good started with p anyway

* I want to go outside.

* Split out deps and build

* 30 seconds on the fetch, reintroduce the p

* lock it in

* flip lock file to pnpm

* nuke yarn.lock

* kirby no longer has yarn

* flip goreleaser to v4, was using node12.

* snapshots don't have tags

* Update README.md

* pin offline dockerfile

* Delete .yarnrc.yml

* Delete web/.yarn directory

* fix: update scripts

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Kyle Sanderson 2023-05-08 11:28:43 -07:00 committed by GitHub
parent ac61334f93
commit 762a0bb36b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 5248 additions and 8137 deletions

View file

@ -23,17 +23,24 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Node - name: Set up Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
cache: 'yarn' cache: 'pnpm'
cache-dependency-path: web/yarn.lock cache-dependency-path: web/pnpm-lock.yaml
- name: Build web - name: Fetch web dependencies
run: | working-directory: web
cd web && yarn install --frozen-lockfile run: pnpm install --frozen-lockfile
CI= yarn build
- name: Build web frontend
working-directory: web
run: CI= pnpm run build
- name: Upload web production build - name: Upload web production build
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -85,11 +92,11 @@ jobs:
cache: true cache: true
- name: Run GoReleaser build - name: Run GoReleaser build
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v4
with: with:
distribution: goreleaser distribution: goreleaser
version: latest version: latest
args: release --clean --skip-publish args: release --clean --skip-validate --skip-publish
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -124,7 +131,7 @@ jobs:
cache: true cache: true
- name: Run GoReleaser build and publish tags - name: Run GoReleaser build and publish tags
uses: goreleaser/goreleaser-action@v3 uses: goreleaser/goreleaser-action@v4
with: with:
distribution: goreleaser distribution: goreleaser
version: latest version: latest

View file

@ -1,11 +1,10 @@
# build web # build web
FROM node:18.7.0-alpine3.16 AS web-builder FROM node:18.7.0-alpine3.16 AS web-builder
COPY . ./
WORKDIR /web WORKDIR /web
COPY web/package.json web/yarn.lock web/.yarnrc.yml ./ RUN npm install -g pnpm && \
COPY web/.yarn/releases/ ./.yarn/releases/ pnpm install --frozen-lockfile && \
RUN yarn install --network-timeout 120000 pnpm run build
COPY web .
RUN yarn build
# build app # build app
FROM golang:1.20-alpine3.16 AS app-builder FROM golang:1.20-alpine3.16 AS app-builder

File diff suppressed because one or more lines are too long

View file

@ -1,3 +0,0 @@
yarnPath: .yarn/releases/yarn-3.2.2.cjs
nodeLinker: node-modules
enableGlobalCache: true

View file

@ -6,7 +6,7 @@ This project uses React built with Vite.
In the project directory, you can run: In the project directory, you can run:
### `yarn start` ### `pnpm start`
Runs the app in the development mode.\ Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
@ -14,7 +14,7 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\ The page will reload if you make edits.\
You will also see any lint errors in the console. You will also see any lint errors in the console.
### `yarn build` ### `pnpm run build`
Builds the app for production to the `dist` folder.\ Builds the app for production to the `dist` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance. It correctly bundles React in production mode and optimizes the build for the best performance.

View file

@ -41,7 +41,7 @@
"build": "tsc && vite build", "build": "tsc && vite build",
"serve": "vite preview", "serve": "vite preview",
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx --color", "lint": "eslint src/ --ext .js,.jsx,.ts,.tsx --color",
"lint:watch": "npm run lint -- --watch" "lint:watch": "pnpm run lint -- --watch"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -77,6 +77,5 @@
"tailwindcss": "^3.1.3", "tailwindcss": "^3.1.3",
"typescript": "^4.7.3", "typescript": "^4.7.3",
"vite": "^4.2.1" "vite": "^4.2.1"
}, }
"packageManager": "yarn@3.2.2"
} }

5222
web/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff