Skip to content

Commit

Permalink
Replace yarn with npm
Browse files Browse the repository at this point in the history
package.json had "packageManager": "[email protected]" but docker images are using yarn 1.22

In recent years npm introduced package-lock.json, making yarn,
& thus having to deal with yarn v1/v2/v3, less necesssary
  • Loading branch information
serprex committed Nov 3, 2023
1 parent b2c9686 commit a362489
Show file tree
Hide file tree
Showing 8 changed files with 20,277 additions and 11,032 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:

- name: Install Node.js dependencies
working-directory: ui
run: yarn install --frozen-lockfile
run: npm ci

- name: Build
working-directory: ui
run: yarn build
run: npm run build
2 changes: 1 addition & 1 deletion .github/workflows/ui-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Install Node.js dependencies
working-directory: ui
run: yarn install --frozen-lockfile
run: npm ci

- name: lint
uses: wearerequired/lint-action@v2
Expand Down
12 changes: 6 additions & 6 deletions stacks/peerdb-ui.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# syntax=docker/dockerfile:1.2

# Base stage
FROM node:18-bookworm-slim AS base
FROM node:20-bookworm-slim AS base
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
RUN apt-get update && apt-get install -y openssl
WORKDIR /app

# Dependencies stage
FROM base AS deps
WORKDIR /app
# Copy package.json and yarn.lock from ui folder to current directory in image
COPY ui/package.json ui/yarn.lock* ui/.yarnrc.yml ./
RUN yarn --frozen-lockfile
COPY ui/package.json ui/package-lock.json ./
RUN npm ci

FROM base AS builder
WORKDIR /app
Expand All @@ -19,10 +19,10 @@ COPY --from=deps /app/node_modules ./node_modules
COPY ui/ ./

# Prisma
RUN yarn prisma generate
RUN npx prisma generate

ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build
RUN npm run build

# Builder stage
FROM base AS runner
Expand Down
5 changes: 0 additions & 5 deletions ui/.yarnrc.yml

This file was deleted.

9 changes: 3 additions & 6 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ PeerDB Cloud Template
## Prerequisites

- [NodeJS](https://nodejs.org/en): `18.17.1`
- [yarn](https://yarnpkg.com/) package manager: `3.6.1`

## Getting Started

Install dependencies using [yarn](https://classic.yarnpkg.com/en/)

```bash
yarn
npm ci
```

### Start the example project

Start the NextJS dev server that runs the example project.

```bash
yarn dev
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Expand All @@ -30,7 +27,7 @@ The example project files resides inside the `app` folder.
Every UI component has a [Storybook](https://storybook.js.org/) story attached to it. To run and view the Storybook for the project run the following

```bash
yarn storybook
npm run storybook
```

Open [http://localhost:6000](http://localhost:6000) with your browser to see the result.
Expand Down
Loading

0 comments on commit a362489

Please sign in to comment.