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

Pnpm #1076

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Pnpm #1076

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
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }}
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: pnpm ci
- name: jest
run: echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs npx jest --maxWorkers=2
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: npm ci
run: pnpm ci
- uses: oke-py/npm-audit-action@v2
with:
audit_level: moderate
github_token: ${{ secrets.GITHUB_TOKEN }}
create_issues: false
create_issues: false
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20
FROM node:20-slim
WORKDIR /thinky_app

ENV NEXT_TELEMETRY_DISABLED=1
Expand All @@ -9,24 +9,24 @@ ARG NEW_RELIC_APP_NAME=dummy
# avoid using the db when building pages
ARG OFFLINE_BUILD=true

RUN npm config set fund false
RUN npm install -g pnpm && pnpm config set fund false

WORKDIR /thinky_app

# ts-node / tspath is needed for other scripts right now. module-alias is used for socket server production
# ideally all would use package module alias and we would not need ts-node / tspath. but that's a TODO
RUN npm install -g ts-node typescript module-alias
RUN pnpm install -g ts-node typescript module-alias

COPY --chown=node:node package*.json ./

RUN npm install --platform=linux --arch=x64 sharp
RUN npm install --platform=linuxmusl
RUN pnpm install --platform=linux --arch=x64 sharp
RUN pnpm install --platform=linuxmusl
#RUN chown -R node:node node_modules/

COPY --chown=node:node . .

# for web app
RUN npm run build --omit=dev
RUN pnpm run build --omit=dev
# we may need the following to prevent `Failed to write image to cache` errors
RUN chown -R node:node .next/

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20
FROM node:20-slim

ENV NEXT_TELEMETRY_DISABLED=1

Expand All @@ -7,11 +7,11 @@ WORKDIR /thinky_app
COPY --chown=node:node package*.json tsconfig-socket.json ./


RUN npm install
RUN pnpm install

# ts-node / tspath is needed for other scripts right now. module-alias is used for socket server production
# ideally all would use package module alias and we would not need ts-node / tspath. but that's a TODO
RUN npm install -g typescript ts-node tspath
RUN pnpm install -g typescript ts-node tspath

COPY --chown=node:node . .

Expand All @@ -24,4 +24,4 @@ COPY --chown=node:node . .
# USER node


CMD ["npm","run", "dev"]
CMD ["pnpm","run", "dev"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thinky is a platform dedicated to high-quality puzzle games. Solve and optimize
## Dev Environment

### Local install
- Run `npm install`
- Run `pnpm install`
- Create a `.env` file in the root directory containing the following:
```
JWT_SECRET=anything
Expand All @@ -18,14 +18,14 @@ NEW_RELIC_APP_NAME=dummy
NEW_RELIC_LICENSE_KEY=dummy
REVALIDATE_SECRET=whatever
```
- Run `npm run dev` to test changes locally
- Run `pnpm run dev` to test changes locally

### Containerized setup
*Required: Docker installed and running locally.*
- Run `bash startDevEnv.sh` in the root directory

## Tests
- Run `npm test` to run jest tests
- Run `pnpm test` to run jest tests

## Contributing

Expand Down
Loading
Loading