switch to pnpm

This commit is contained in:
mrjvs 2023-10-28 21:21:10 +02:00
parent 542591342b
commit c0d137b4b4
10 changed files with 2829 additions and 4780 deletions

View File

@ -5,3 +5,4 @@ dist
.git
.vscode
.docker
.pnpm-store

View File

@ -15,18 +15,22 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'
- name: Install Yarn packages
run: yarn install
- name: Install packages
run: pnpm i
- name: Run ESLint
run: yarn lint
run: pnpm run lint
building:
name: Build project
@ -35,18 +39,22 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'
- name: Install Yarn packages
run: yarn install
- name: Install packages
run: pnpm install
- name: Build Project
run: yarn build
run: pnpm build
docker:
name: Build docker

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ node_modules
.env
config.json
dist
.pnpm-store

1
.npmrc Normal file
View File

@ -0,0 +1 @@
shamefully-hoist=true

View File

@ -1,16 +1,21 @@
FROM node:20-alpine
WORKDIR /app
# install dependencies
COPY package*.json ./
RUN npm ci
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# install packages
COPY package.json ./
COPY pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# build source
COPY . ./
RUN npm run build
RUN pnpm run build
# start server
EXPOSE 80
ENV MWB_SERVER__PORT=80
ENV NODE_ENV=production
CMD ["npm", "run", "start"]
CMD ["pnpm", "run", "start"]

View File

@ -20,7 +20,7 @@ Backend for movie-web
- [ ] user count
- [ ] provider metrics
- [ ] ratelimits (stored in redis)
- [ ] switch to pnpm
- [X] switch to pnpm
- [ ] think of privacy centric method of auth
- [ ] Register
- [ ] Login

View File

@ -5,5 +5,7 @@ WORKDIR /app
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN chmod +x /wait
RUN npm i -g pnpm
VOLUME [ "/app" ]
CMD npm i && /wait && npm run dev
CMD pnpm i && /wait && pnpm dev

4762
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,8 @@
"lint": "eslint --ext .ts,.js,.json,.tsx src/",
"lint:fix": "eslint --fix --ext .ts,.js,.json,.tsx src/",
"build:pre": "rimraf dist/",
"build:compile": "tsc && tsc-alias"
"build:compile": "tsc && tsc-alias",
"preinstall": "npx -y only-allow pnpm"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.4",

2792
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff