Skip to content

Commit

Permalink
build: use npm rather than pnpm
Browse files Browse the repository at this point in the history
Most PL Typescript repos use `pnpm` but so far we've been using `npm`
and that's fine with me: all I care about is that the requirement is
codified.
  • Loading branch information
conorsch committed Oct 22, 2024
1 parent 63f4954 commit 77808f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10,643 deletions.
11 changes: 7 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Provide specific arg for setting the version of nodejs to use.
# Should match what's in .nvmrc for development.
ARG NODE_MAJOR_VERSION=18.20
# Should match what's in flake.nix for development.
ARG NODE_MAJOR_VERSION=20
FROM docker.io/node:${NODE_MAJOR_VERSION}-alpine AS base
# Install dependencies only when needed
FROM base AS deps
Expand All @@ -9,8 +9,11 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies
COPY package.json package-lock.json pnpm-lock.yaml* ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile
COPY package.json package-lock.json ./
# Right now the repo prefers `npm` rather than `pnpm`
# COPY package.json pnpm-lock.yaml* ./
# RUN corepack enable pnpm && pnpm install --frozen-lockfile
RUN npm install --frozen-lockfile

# Rebuild the source code only when needed
FROM base AS builder
Expand Down
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
file
jq
just
pnpm
# pnpm
nodejs_20
postgresql
];
};
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

# run the app locally with live reload, via pnpm
dev:
pnpm install
pnpm dev
npm install
npm run dev

# build container image
container:
Expand Down
Loading

0 comments on commit 77808f8

Please sign in to comment.