Switch to pnpm (#162)

* fix: metadata provider log

* feat: fully switch to pnpm

* ci: prettier ignore pnpm lock

* chore: dedupe lockfile

* chore: update pnpm
This commit is contained in:
Husky
2025-08-30 19:45:30 -04:00
committed by DecDuck
parent bfeacbbdfe
commit aa1de921ee
7 changed files with 12298 additions and 27 deletions

View File

@ -21,17 +21,20 @@ jobs:
with:
submodules: true
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "yarn"
cache: "pnpm"
- name: Install dependencies
run: yarn install --immutable --network-timeout 1000000
run: pnpm install
- name: Typecheck
run: yarn typecheck
run: pnpm run typecheck
lint:
name: Lint
@ -42,14 +45,17 @@ jobs:
with:
submodules: true
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "yarn"
cache: "pnpm"
- name: Install dependencies
run: yarn install --immutable --network-timeout 1000000
run: pnpm install
- name: Lint
run: yarn lint
run: pnpm run lint

View File

@ -1 +1,3 @@
drop-base/
drop-base/
# file is fully managed by pnpm, no reason to break it
pnpm-lock.yaml

View File

@ -1,40 +1,45 @@
# syntax=docker/dockerfile:1
FROM node:lts-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# so corepack knows pnpm's version
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# prevent prompt to download
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
# setup for offline
RUN corepack pack
# don't call out to network anymore
ENV COREPACK_ENABLE_NETWORK=0
### Unified deps builder
# FROM node:lts-alpine AS deps
# WORKDIR /app
# COPY package.json yarn.lock ./
# RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --ignore-scripts
FROM base AS deps
RUN pnpm install --frozen-lockfile --ignore-scripts
### Build for app
FROM node:lts-alpine AS build-system
# setup workdir - has to be the same filepath as app because fuckin' Prisma
WORKDIR /app
FROM base AS build-system
ENV NODE_ENV=production
ENV NUXT_TELEMETRY_DISABLED=1
# ENV YARN_CACHE_FOLDER=/root/.yarn
# add git so drop can determine its git ref at build
# pnpm for build
RUN apk add --no-cache git pnpm
RUN apk add --no-cache git
# copy deps and rest of project files
# COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ARG BUILD_DROP_VERSION
ARG BUILD_GIT_REF
# build
RUN pnpm import
RUN pnpm install --shamefully-hoist
RUN pnpm run build
# RUN --mount=type=cache,target=/root/.yarn yarn postinstall && yarn build
RUN pnpm run postinstall && pnpm run build
### create run environment for Drop
FROM node:lts-alpine AS run-system
WORKDIR /app
FROM base AS run-system
ENV NODE_ENV=production
ENV NUXT_TELEMETRY_DISABLED=1

View File

@ -14,7 +14,7 @@
"preview": "nuxt preview",
"postinstall": "nuxt prepare && prisma generate",
"typecheck": "nuxt typecheck",
"lint": "yarn lint:eslint && yarn lint:prettier",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
"lint:eslint": "eslint .",
"lint:prettier": "prettier . --check",
"lint:fix": "eslint . --fix && prettier --write --list-different ."
@ -89,5 +89,6 @@
},
"prisma": {
"schema": "./prisma"
}
},
"packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b"
}

12256
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

1
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1 @@
shamefullyHoist: true

View File

@ -306,7 +306,7 @@ export class MetadataHandler {
result = await provider.fetchCompany({ query, createObject });
if (result === undefined) {
throw new Error(
`${provider.source()} failed to find a company for "${query}`,
`${provider.source()} failed to find a company for "${query}"`,
);
}
} catch (e) {