Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: switch from yarn to pnpm #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
/.pnp
.pnp.js

# logs
*.log

# testing
/coverage

Expand All @@ -17,24 +20,16 @@

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# caches
.eslintcache
.prettiercache
.stylelintcache
*.tsbuildinfo

Expand Down
12 changes: 3 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/.pnp
.pnp.js

# logs
*.log

# testing
/coverage

Expand All @@ -15,22 +18,13 @@

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# caches
.eslintcache
.stylelintcache
Expand Down
6 changes: 2 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn run dev"
"command": "pnpm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "pwa-chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn run dev",
"console": "integratedTerminal",
"command": "pnpm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
Expand Down
13 changes: 0 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,8 @@
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
"eslint.enable": true,
"eslint.validate": ["javascript", "typescript", "typescriptreact"],
"files.exclude": {
"**/node_modules": true,
"**/coverage": true,
".eslintcache": true,
".stylelintcache": true,
"**/*.tsbuildinfo": true,
".next": true,
"out": true,
"storybook-build": true
},
"less.validate": false,
"scss.validate": false,
"search.exclude": {
"yarn.lock": true
},
"stylelint.enable": true,
"tailwindCSS.validate": false,
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# base
FROM node:22-slim AS base

RUN corepack enable

RUN mkdir /app && chown -R node:node /app
WORKDIR /app

USER node

COPY --chown=node:node package.json yarn.lock ./
COPY --chown=node:node package.json pnpm-lock.yaml ./

# cannot use `--ignore-scripts` for `sharp` to compile
RUN yarn install --frozen-lockfile --silent --production && yarn cache clean
RUN pnpm install --frozen-lockfile

# build
FROM base AS build

RUN yarn install --frozen-lockfile --ignore-scripts --silent --prefer-offline
RUN pnpm install --frozen-lockfile --ignore-scripts --offline

COPY --chown=node:node tsconfig.json app.d.ts next-env.d.ts next.config.mjs ./
COPY --chown=node:node scripts ./scripts
Expand Down Expand Up @@ -42,7 +44,7 @@ ARG NEXT_PUBLIC_GITHUB_REPOSITORY_BRANCH
USER root
RUN --mount=type=secret,id=github_token \
export GITHUB_TOKEN="$(cat /run/secrets/github_token)" && \
yarn build && \
pnpm build && \
unset GITHUB_TOKEN
USER node

Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "sshoc-marketplace-frontend",
"private": true,
"license": "Apache-2.0",
"engines": {
"node": "22.x",
"pnpm": "9.x"
},
"packageManager": "[email protected]",
"scripts": {
"analyze-bundle": "cross-env BUNDLE_ANALYZER=enabled next build",
"build": "next build",
Expand All @@ -10,45 +15,39 @@
"cypress": "cypress open --config-file cypress/cypress.config.json",
"cypress:headless": "cypress run --config-file cypress/cypress.config.json",
"dev": "next dev",
"docker:dev": "docker run --rm --init -u `id -u`:`id -g` -v `pwd`:/app -w /app -p 3000:3000 node:14-slim yarn dev",
"format": "prettier . \"!**/*.mdx\" --list-different --ignore-path .gitignore",
"format:fix": "yarn run format --write",
"format:fix": "pnpm run format --write",
"generate:favicons": "ts-script scripts/generate-favicons.ts",
"generate:route-manifest": "ts-script scripts/generate-route-manifest.ts",
"lint": "run-p lint:*:check",
"lint:fix": "run-p lint:*:fix",
"lint": "run-p \"lint:*:check\"",
"lint:fix": "run-p \"lint:*:fix\"",
"lint:code:check": "next lint --dir . --ignore-path .gitignore",
"lint:code:fix": "yarn run lint:code:check --fix",
"lint:code:fix": "pnpm run lint:code:check --fix",
"lint:md:check": "remark . --ext md --quiet --frail",
"lint:md:fix": "yarn run lint:md:check --output",
"lint:md:fix": "pnpm run lint:md:check --output",
"lint:mdx:check": "remark . --ext mdx --use mdx --quiet --frail",
"lint:mdx:fix": "yarn run lint:mdx:check --output",
"lint:styles:check": "stylelint '**/*.css' --cache --cache-location .next/cache/stylelint/ --ignore-path .gitignore",
"lint:styles:fix": "yarn run lint:styles:check --fix",
"postbuild": "yarn run generate:favicons",
"lint:mdx:fix": "pnpm run lint:mdx:check --output",
"lint:styles:check": "stylelint \"**/*.css\" --cache --cache-location .next/cache/stylelint/ --ignore-path .gitignore",
"lint:styles:fix": "pnpm run lint:styles:check --fix",
"postbuild": "pnpm run generate:favicons",
"postinstall": "patch-package",
"prebuild": "yarn run generate:route-manifest",
"prebuild": "pnpm run generate:route-manifest",
"prepare": "simple-git-hooks || true",
"start": "next start",
"stories:build": "build-storybook --config-dir stories --quiet",
"stories:build:docs": "yarn run stories:build --docs",
"stories:build:docs": "pnpm run stories:build --docs",
"stories:dev": "start-storybook --config-dir stories --port 6006 --no-open",
"stories:dev:docs": "yarn run stories:dev --docs",
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --config ./test/jest.config.js",
"test:ci": "yarn run test --ci",
"test:coverage": "yarn run test --coverage",
"test:watch": "yarn run test --watch",
"stories:dev:docs": "pnpm run stories:dev --docs",
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --config ./test/jest.config.js",
"test:ci": "pnpm run test --ci",
"test:coverage": "pnpm run test --coverage",
"test:watch": "pnpm run test --watch",
"test:e2e": "start-server-and-test start :3000 cypress",
"test:e2e:headless": "start-server-and-test start :3000 cypress:headless",
"test:e2e:dev": "cross-env NEXT_PUBLIC_MOCK_API=disabled start-server-and-test dev :3000 cypress",
"test:e2e:dev:headless": "cross-env NEXT_PUBLIC_MOCK_API=disabled start-server-and-test dev :3000 cypress:headless",
"typecheck": "tsc -p tsconfig.json --noEmit",
"validate": "yarn run format && yarn run lint && yarn run typecheck && yarn run test"
},
"packageManager": "[email protected]",
"engines": {
"node": "22.x",
"yarn": "1.x"
"validate": "pnpm run format && pnpm run lint && pnpm run typecheck && pnpm run test"
},
"dependencies": {
"@mdx-js/loader": "^2.1.0",
Expand Down Expand Up @@ -161,6 +160,7 @@
"sharp": "^0.30.3",
"shiki": "^0.10.0",
"strip-markdown": "^5.0.0",
"to-vfile": "7",
"unified": "^10.1.1",
"unist-util-visit": "^4.1.0",
"use-composed-ref": "^1.2.1",
Expand Down Expand Up @@ -359,8 +359,8 @@
]
},
"simple-git-hooks": {
"commit-msg": "yarn commitlint --edit",
"pre-commit": "yarn lint-staged"
"commit-msg": "pnpm exec commitlint --edit",
"pre-commit": "pnpm exec lint-staged"
},
"stylelint": {
"extends": "@stefanprobst/stylelint-config",
Expand Down
Loading