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

chore(security): Update to node22 + pnpm build #764

Open
wants to merge 11 commits 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
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

22 changes: 14 additions & 8 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Node.js
uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: "18"
cache: "yarn"

version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Run build
run: yarn build
run: pnpm build
24 changes: 15 additions & 9 deletions .github/workflows/npmPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Node.js
uses: actions/setup-node@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: "18"
cache: "yarn"
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Install tsx
run: npm install -g tsx
run: pnpm install -g tsx

- name: Install dependencies
working-directory: ./sdk
run: yarn install
run: pnpm install

- name: Get version from package.json
id: package_version
Expand All @@ -36,7 +42,7 @@ jobs:
run: echo "SDK version is $PACKAGE_VERSION"

- name: Build
run: yarn generate:sdk
run: pnpm generate:sdk

- name: Push to npm
working-directory: ./sdk
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"source.organizeImports": "explicit",
"source.eslint.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ COPY . .
# Install dependencies for both development and production (May need devDependencies to build)
# Build the project
# Prune dev dependencies from the packages
RUN yarn install --frozen-lockfile --production=false --network-timeout 1000000 && \
yarn build && \
yarn copy-files && \
yarn install --frozen-lockfile --production=true --network-timeout 1000000
RUN pnpm install --frozen-lockfile --production=false --network-timeout 1000000 && \
pnpm build && \
pnpm copy-files && \
pnpm install --frozen-lockfile --production=true --network-timeout 1000000

##############################
##############################
Expand All @@ -68,4 +68,4 @@ COPY --from=build /app/dist ./dist
# Replace the schema path in the package.json file
RUN sed -i 's_"schema": "./src/prisma/schema.prisma"_"schema": "./dist/prisma/schema.prisma"_g' package.json

ENTRYPOINT [ "yarn", "start"]
ENTRYPOINT [ "pnpm", "start"]
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For OSS contributions, we use a [Forking Workflow](https://www.atlassian.com/git
1. Install the dependencies:

```bash
yarn install
pnpm install
```

1. Make changes on your branch.
Expand All @@ -28,7 +28,7 @@ For OSS contributions, we use a [Forking Workflow](https://www.atlassian.com/git
Please run Engine locally to test your changes.

```bash
yarn dev
pnpm dev
```

You should be able to make requests to Engine locally and import it to the [thirdweb dashboard](https://thirdweb.com/dashboard/engine).
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ services:
limits:
cpus: "1"
memory: 1024M
# entrypoint: "yarn start:dev"
# entrypoint: "pnpm start:dev"
# volumes:
# - ./:/app
# - node_modules:/app/node_modules
Expand Down
62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,41 @@
"main": "src/server/index.ts",
"author": "thirdweb engineering <[email protected]>",
"type": "module",
"engines": {
"node": "^22",
"pnpm": "^9"
},
"scripts": {
"dev": "yarn dev:infra && yarn dev:db && yarn dev:run",
"dev": "pnpm dev:infra && pnpm dev:db && pnpm dev:run",
"dev:infra": "docker compose -f ./docker-compose.yml up -d",
"dev:db": "yarn prisma:setup:dev",
"dev:run": "npx nodemon --watch 'src/**/*.ts' --exec 'npx tsx ./src/index.ts' --files src/index.ts",
"dev:db": "pnpm prisma:setup:dev",
"dev:run": "tsx watch ./src/index.ts",
"build": "rm -rf dist && tsc -p ./tsconfig.json --outDir dist",
"build:docker": "docker build . -f Dockerfile -t prod",
"generate:sdk": "npx tsx ./src/scripts/generate-sdk && cd ./sdk && yarn build",
"generate:sdk": "npx tsx ./src/scripts/generate-sdk && cd ./sdk && pnpm build",
"prisma:setup:dev": "npx tsx ./src/scripts/setup-db.ts",
"prisma:setup:prod": "npx tsx ./dist/scripts/setup-db.js",
"start": "yarn prisma:setup:prod && yarn start:migrations && yarn start:run",
"start": "pnpm prisma:setup:prod && pnpm start:migrations && pnpm start:run",
"start:migrations": "npx tsx ./dist/scripts/apply-migrations.js",
"start:run": "node --experimental-specifier-resolution=node ./dist/index.js",
"start:run": "node ./dist/index.js",
"start:docker": "docker compose --profile engine --env-file ./.env up --remove-orphans",
"start:docker-force-build": "docker compose --profile engine --env-file ./.env up --remove-orphans --build",
"lint:fix": "eslint --fix 'src/**/*.ts'",
"test:unit": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "biome ci ./src/*",
"copy-files": "cp -r ./src/prisma ./dist/"
},
"dependencies": {
"@aws-sdk/client-kms": "^3.679.0",
"@bull-board/api": "^5.23.0",
"@bull-board/fastify": "^5.23.0",
"@cloud-cryptographic-wallet/cloud-kms-signer": "^0.1.2",
"@cloud-cryptographic-wallet/signer": "^0.0.5",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/json-wallets": "^5.7.0",
"@fastify/basic-auth": "^5.1.1",
"@fastify/swagger": "^8.9.0",
"@fastify/type-provider-typebox": "^3.2.0",
"@fastify/type-provider-typebox": "^3.6.0",
"@fastify/websocket": "^8.2.0",
"@google-cloud/kms": "^4.4.0",
"@prisma/client": "5.17.0",
Expand All @@ -44,12 +50,12 @@
"@thirdweb-dev/chains": "^0.1.77",
"@thirdweb-dev/sdk": "^4.0.89",
"@thirdweb-dev/service-utils": "^0.4.28",
"@thirdweb-dev/wallets": "^2.5.39",
"@types/base-64": "^1.0.2",
"aws-kms-signer": "^0.5.3",
"base-64": "^1.0.0",
"bullmq": "^5.11.0",
"cron-parser": "^4.9.0",
"crypto": "^1.0.1",
"crypto-js": "^4.2.0",
"dd-trace": "^5.23.0",
"dotenv": "^16.0.3",
Expand All @@ -71,47 +77,41 @@
"superjson": "^2.2.1",
"thirdweb": "5.61.3",
"uuid": "^9.0.1",
"viem": "^2.21.41",
"winston": "^3.14.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@types/cli-progress": "^3.11.3",
"@types/crypto-js": "^4.2.2",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^18.15.4",
"@types/node-cron": "^3.0.8",
"@types/pg": "^8.6.6",
"@types/uuid": "^9.0.1",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@vitest/coverage-v8": "^2.0.3",
"eslint": "^9.3.0",
"eslint-config-prettier": "^8.7.0",
"openapi-typescript-codegen": "^0.25.0",
"prettier": "^2.8.7",
"tsx": "^4.19.2",
"typescript": "^5.1.3",
"vitest": "^2.0.3"
},
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix",
"*.{js,ts,md}": "prettier --write"
},
"prisma": {
"schema": "./src/prisma/schema.prisma"
},
"resolutions": {
"@thirdweb-dev/auth/**/axios": ">=1.7.4",
"@thirdweb-dev/auth/**/web3-utils": ">=4.2.1",
"ethers-gcp-kms-signer/**/protobufjs": ">=7.2.5",
"fastify/**/find-my-way": ">=8.2.2",
"@grpc/grpc-js": ">=1.8.22",
"body-parser": ">=1.20.3",
"cookie": ">=0.7.0",
"elliptic": ">=6.6.0",
"micromatch": ">=4.0.8",
"secp256k1": ">=4.0.4",
"ws": ">=8.17.1"
"pnpm": {
"overrides": {
"axios": ">=1.7.4",
"web3-utils": ">=4.2.1",
"protobufjs": ">=7.2.5",
"find-my-way": ">=8.2.2",
"@grpc/grpc-js": ">=1.8.22",
"body-parser": ">=1.20.3",
"cookie": ">=0.7.0",
"elliptic": ">=6.6.0",
"micromatch": ">=4.0.8",
"secp256k1": ">=4.0.4",
"ws": ">=8.17.1"
}
}
}
Loading
Loading