Skip to content

Commit

Permalink
refactor: migrate to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Dec 22, 2023
1 parent 9a343a7 commit 64f0661
Show file tree
Hide file tree
Showing 11 changed files with 12,274 additions and 853 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
9 changes: 0 additions & 9 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
"no-empty-source": null,
"number-max-precision": 2,
"color-no-hex": true,
"block-opening-brace-newline-before": null,
"block-closing-brace-newline-before": "always-multi-line",
"block-opening-brace-space-before": "always",
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-duplicate-custom-properties": true,
"custom-property-empty-line-before": null,
"declaration-block-no-duplicate-properties": true,
"declaration-colon-newline-after": null,
"value-list-comma-newline-after": null,
"value-list-comma-newline-before": null,
"hue-degree-notation": "angle",
"function-calc-no-unspaced-operator": true,
"font-family-name-quotes": "always-unless-keyword",
Expand All @@ -39,9 +33,6 @@
"selector-no-vendor-prefix": null,
"media-feature-name-no-vendor-prefix": null,
"at-rule-no-vendor-prefix": null,
"string-quotes": "single",
"indentation": null,
"selector-descendant-combinator-no-non-space": null,
"selector-class-pattern": null,
"string-no-newline": null,
"selector-pseudo-class-no-unknown": [
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"prettier.prettierPath": "./node_modules/prettier"
"prettier.prettierPath": "./node_modules/prettier",
"stylelint.stylelintPath": "./node_modules/stylelint"
}
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-after-install.cjs

This file was deleted.

807 changes: 0 additions & 807 deletions .yarn/releases/yarn-3.3.0.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarnrc.yml

This file was deleted.

16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ RUN mkdir -p /app

WORKDIR /app

COPY package.json .yarnrc.yml yarn.lock ./
COPY package.json pnpm-lock.yaml ./
COPY patches ./patches

COPY .yarn .yarn

RUN corepack enable && yarn --frozen-lockfile
RUN corepack enable && pnpm i --frozen-lockfile

COPY . .

Expand All @@ -33,14 +32,14 @@ RUN apk add git && \
PUBLIC_GTM_ID=${GTM_ID} PUBLIC_GA_ID=${GA_ID} SENTRY_ORG=${SENTRY_ORG} PUBLIC_USE_ACCOUNT=${USE_ACCOUNT} \
PUBLIC_SENTRY_ENV=${SENTRY_ENV} PUBLIC_SENTRY_DSN=${SENTRY_DSN} SENTRY_ORG=${SENTRY_ORG} SENTRY_PROJECT=${SENTRY_PROJECT} \
SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} PUBLIC_SENTRY_RELEASE=$(git rev-parse --short HEAD) \
SENTRY_URL=${SENTRY_URL} yarn build && \
SENTRY_URL=${SENTRY_URL} pnpm build && \
mv static/~partytown build/client/~partytown

RUN apk add jq

RUN cat package.json | jq 'del(.devDependencies) | del(.resolutions) | del(.scripts)' | tee package.json

RUN yarn pack
RUN pnpm pack && mv adofai-gg-*.tgz package.tgz

FROM node:18-alpine AS runner

Expand All @@ -50,10 +49,9 @@ RUN tar xvzf package.tgz && \
rm package.tgz && \
mv package app && \
cd app && \
echo "nodeLinker: pnpm" >> .yarnrc.yml && \
corepack enable && \
yarn
pnpm i --production

WORKDIR /app

CMD ["yarn", "node", "server.js"]
CMD ["node", "server.js"]
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "adofai-gg",
"version": "0.0.1",
"scripts": {
"dev": "yarn prebuild && vite dev",
"build": "yarn prebuild && vite build",
"dev": "pnpm prebuild && vite dev",
"build": "pnpm prebuild && vite build",
"package": "vite package",
"preview": "vite preview",
"test": "yarn build && playwright test",
"test": "pnpm build && playwright test",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --plugin-search-dir=. . && eslint --max-warnings=0 .",
Expand All @@ -26,7 +26,7 @@
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@fluent/bundle": "^0.18.0",
"@fontsource/m-plus-rounded-1c": "^5.0.11",
"@fontsource/m-plus-rounded-1c": "4.5.10",
"@fontsource/quicksand": "^5.0.16",
"@fontsource/roboto-mono": "^5.0.16",
"@playwright/test": "^1.40.1",
Expand Down Expand Up @@ -129,8 +129,10 @@
"*.{js,ts,jsx,tsx,svelte}": "eslint --cache --fix",
"*.{js,ts,jsx,tsx,svelte,css,scss,md}": "prettier --ignore-path .gitignore --write"
},
"packageManager": "[email protected]",
"resolutions": {
"@fontsource/[email protected]": "patch:@fontsource/m-plus-rounded-1c@npm%3A4.5.10#./.yarn/patches/@fontsource-m-plus-rounded-1c-npm-4.5.10-3cae002275.patch"
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
"@fontsource/[email protected]": "patches/@[email protected]"
}
}
}
File renamed without changes.
Loading

0 comments on commit 64f0661

Please sign in to comment.