Skip to content

Commit

Permalink
do clean installs
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed May 8, 2023
1 parent e8cfad5 commit 2ac51de
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 13 deletions.
17 changes: 17 additions & 0 deletions gdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ export class GDF {
get packagerInstall() {
let install = `${this.packager} install`

const packageFiles = this.packageFiles

// clean install
if (this.packager === 'npm' && packageFiles.includes('package-lock.json')) {
install = 'npm ci'
} else if (packageFiles.includes('yarn.lock')) {
if (this.yarnVersion.startsWith('1.')) {
install += ' --frozen-lockfile'
} else {
install += ' --immutable --immutable-cache --check-cache'
}
} else if (packageFiles.includes('pnpm-lock.yaml')) {
install += ' --frozen-lockfile'
}

// optionally include dev dependencies
if (this.devDependencies && !this.pnpm) {
if (this.yarn) {
install += ' --production=false'
Expand All @@ -137,6 +153,7 @@ export class GDF {
}
}

// optionally include legacy peer dependencies
if (this.options.legacyPeerDeps) {
if (this.npm) {
install += ' --legacy-peer-deps'
Expand Down
4 changes: 2 additions & 2 deletions test/express/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1.4

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=20.0.0
ARG NODE_VERSION=xxx
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="Node.js"
Expand All @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install
RUN npm ci

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/fastify/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install --include=dev
RUN npm ci --include=dev

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/gatsby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install
RUN npm ci

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/legacy-peer-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install --include=dev --legacy-peer-deps
RUN npm ci --include=dev --legacy-peer-deps

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/nest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install --include=dev
RUN npm ci --include=dev

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/next-npm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install
RUN npm ci

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/next-pnpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json pnpm-lock.yaml ./
RUN pnpm install
RUN pnpm install --frozen-lockfile

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/next-yarn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install
RUN yarn install --frozen-lockfile

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/nuxt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install --production=false
RUN yarn install --frozen-lockfile --production=false

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/remix-indie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install --include=dev
RUN npm ci --include=dev

# Generate Prisma Client
COPY --link prisma .
Expand Down
2 changes: 1 addition & 1 deletion test/swap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install
RUN npm ci

# Copy application code
COPY --link . .
Expand Down
2 changes: 1 addition & 1 deletion test/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -qq && \

# Install node modules
COPY --link package.json package-lock.json ./
RUN npm install --include=dev
RUN npm ci --include=dev

# Generate Prisma Client
COPY --link prisma .
Expand Down

0 comments on commit 2ac51de

Please sign in to comment.