mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-26 17:54:44 +10:00
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:
Vendored
+12
-6
@@ -21,17 +21,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
cache: "yarn"
|
cache: "pnpm"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --immutable --network-timeout 1000000
|
run: pnpm install
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Typecheck
|
||||||
run: yarn typecheck
|
run: pnpm run typecheck
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
@@ -42,14 +45,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
cache: "yarn"
|
cache: "pnpm"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --immutable --network-timeout 1000000
|
run: pnpm install
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: yarn lint
|
run: pnpm run lint
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
drop-base/
|
drop-base/
|
||||||
|
# file is fully managed by pnpm, no reason to break it
|
||||||
|
pnpm-lock.yaml
|
||||||
|
|||||||
+22
-17
@@ -1,40 +1,45 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# 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
|
### Unified deps builder
|
||||||
# FROM node:lts-alpine AS deps
|
FROM base AS deps
|
||||||
# WORKDIR /app
|
RUN pnpm install --frozen-lockfile --ignore-scripts
|
||||||
# COPY package.json yarn.lock ./
|
|
||||||
# RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --ignore-scripts
|
|
||||||
|
|
||||||
### Build for app
|
### Build for app
|
||||||
FROM node:lts-alpine AS build-system
|
FROM base AS build-system
|
||||||
# setup workdir - has to be the same filepath as app because fuckin' Prisma
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NUXT_TELEMETRY_DISABLED=1
|
ENV NUXT_TELEMETRY_DISABLED=1
|
||||||
# ENV YARN_CACHE_FOLDER=/root/.yarn
|
|
||||||
|
|
||||||
# add git so drop can determine its git ref at build
|
# add git so drop can determine its git ref at build
|
||||||
# pnpm for build
|
RUN apk add --no-cache git
|
||||||
RUN apk add --no-cache git pnpm
|
|
||||||
|
|
||||||
# copy deps and rest of project files
|
# copy deps and rest of project files
|
||||||
# COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
ARG BUILD_DROP_VERSION
|
ARG BUILD_DROP_VERSION
|
||||||
ARG BUILD_GIT_REF
|
ARG BUILD_GIT_REF
|
||||||
|
|
||||||
# build
|
# build
|
||||||
RUN pnpm import
|
RUN pnpm run postinstall && pnpm run build
|
||||||
RUN pnpm install --shamefully-hoist
|
|
||||||
RUN pnpm run build
|
|
||||||
# RUN --mount=type=cache,target=/root/.yarn yarn postinstall && yarn build
|
|
||||||
|
|
||||||
### create run environment for Drop
|
### create run environment for Drop
|
||||||
FROM node:lts-alpine AS run-system
|
FROM base AS run-system
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NUXT_TELEMETRY_DISABLED=1
|
ENV NUXT_TELEMETRY_DISABLED=1
|
||||||
|
|||||||
+3
-2
@@ -14,7 +14,7 @@
|
|||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview",
|
||||||
"postinstall": "nuxt prepare && prisma generate",
|
"postinstall": "nuxt prepare && prisma generate",
|
||||||
"typecheck": "nuxt typecheck",
|
"typecheck": "nuxt typecheck",
|
||||||
"lint": "yarn lint:eslint && yarn lint:prettier",
|
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
|
||||||
"lint:eslint": "eslint .",
|
"lint:eslint": "eslint .",
|
||||||
"lint:prettier": "prettier . --check",
|
"lint:prettier": "prettier . --check",
|
||||||
"lint:fix": "eslint . --fix && prettier --write --list-different ."
|
"lint:fix": "eslint . --fix && prettier --write --list-different ."
|
||||||
@@ -89,5 +89,6 @@
|
|||||||
},
|
},
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"schema": "./prisma"
|
"schema": "./prisma"
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+12256
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
|||||||
|
shamefullyHoist: true
|
||||||
@@ -306,7 +306,7 @@ export class MetadataHandler {
|
|||||||
result = await provider.fetchCompany({ query, createObject });
|
result = await provider.fetchCompany({ query, createObject });
|
||||||
if (result === undefined) {
|
if (result === undefined) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${provider.source()} failed to find a company for "${query}`,
|
`${provider.source()} failed to find a company for "${query}"`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user