Skip to content

Commit

Permalink
refactor: Move to pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Dec 16, 2024
1 parent e9678e5 commit 082a596
Show file tree
Hide file tree
Showing 11 changed files with 6,764 additions and 11,055 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Dockerfile
.dockerignore
.git
.env
node_modules
2 changes: 1 addition & 1 deletion .github/deny_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set -e

# Check for files not intented to be present
declare -a denyfiles=("yarn.lock" "pnpm-lock.yaml")
declare -a denyfiles=("yarn.lock" "package-lock.json")
declare -a denyextensions=("png" "jpg" "jpeg" "tiff")

for file in "${denyfiles[@]}"; do
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,28 @@ jobs:
- name: Checkout source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: pnpm-setup
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: 📦 Install constrained dependencies
shell: bash
run: |
npm ci
cache: 'pnpm'

- name: 🔄 Check for outdated dependencies
- name: 📦 Install dependencies
shell: bash
run: |
npm outdated || echo "::warning title=Outdated dependencies::Some dependencies are outdated and need to be updated"
pnpm i
- name: Run linting
shell: bash
run: |
npm run lint
pnpm lint
- name: Run build
shell: bash
run: |
npm run build
pnpm build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ next-env.d.ts

# Other Lock files
yarn.lock
pnpm-lock.yaml
package-lock.yaml

# Aria
.hintrc
Expand Down
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
pnpm run lint
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ header:
- .husky
- '.github/**'
- 'cypress/fixtures/**'
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"

comment: on-failure

Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@
# SPDX-License-Identifier: EPL-2.0
# License-Filename: LICENSE

ARG VARIANT=22-alpine
ARG VARIANT=22-slim
FROM node:${VARIANT} as build

ENV PNPM_HOME="/pnm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /frontend

# Prepare the build environment
COPY package.json .
RUN npm install
COPY . .
RUN npm run build --production
RUN pnpm install && pnpm build

# Runtime
ARG VARIANT=20-alpine
ARG VARIANT=22-slim
FROM node:${VARIANT}
WORKDIR /frontend

COPY --from=build /frontend/package.json .
COPY --from=build /frontend/package-lock.json .
COPY --from=build /frontend/next.config.js .
COPY --from=build /frontend/public ./public
COPY --from=build /frontend/.next/standalone ./
Expand Down
Loading

0 comments on commit 082a596

Please sign in to comment.