mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 03:13:46 +00:00
build: move from pnpm to npm
Replace pnpm-lock.yaml with package-lock.json. allowBuilds for esbuild becomes package.json#allowScripts. The Dockerfile installs with npm ci --omit=dev and no longer prepares pnpm through corepack; .npmrc keeps engine-strict, which npm honours natively. minimumReleaseAgeExclude is dropped rather than translated: pnpm's minimumReleaseAge was never set, so the 30-entry exclusion list had nothing to exclude from. Direct dependency versions resolve identically to the pnpm lockfile.
This commit is contained in:
1 parent
ffe9fb22e3
commit
f475a5cb46
11 files changed
+5374
-3507
No files matched your search
Vendored
+8
-11
@@ -10,17 +10,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 11.9.0
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: pnpm
|
cache: npm
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: npm ci
|
||||||
- run: pnpm lint
|
- run: npm run lint
|
||||||
- run: pnpm typecheck
|
- run: npm run typecheck
|
||||||
- run: pnpm test
|
- run: npm test
|
||||||
- name: Install Remotion browser runtime libraries
|
- name: Install Remotion browser runtime libraries
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -32,6 +29,6 @@ jobs:
|
|||||||
libasound2t64 \
|
libasound2t64 \
|
||||||
libxshmfence1 \
|
libxshmfence1 \
|
||||||
fonts-noto
|
fonts-noto
|
||||||
- run: pnpm browser:ensure
|
- run: npm run browser:ensure
|
||||||
- run: pnpm render:smoke
|
- run: npm run render:smoke
|
||||||
- run: pnpm api:smoke
|
- run: npm run api:smoke
|
||||||
+3
-3
@@ -9,11 +9,11 @@ animated wheel-of-names GIFs with Remotion.
|
|||||||
|
|
||||||
- Use JavaScript and JSDoc. Do not add TypeScript source files.
|
- Use JavaScript and JSDoc. Do not add TypeScript source files.
|
||||||
- Keep public API routes under `/api`.
|
- Keep public API routes under `/api`.
|
||||||
- Run `pnpm lint`, `pnpm typecheck`, and `pnpm test` before committing code
|
- Run `npm run lint`, `npm run typecheck`, and `npm test` before committing code
|
||||||
changes.
|
changes.
|
||||||
- Run `pnpm render:smoke` when renderer, Remotion composition, Docker runtime,
|
- Run `npm run render:smoke` when renderer, Remotion composition, Docker runtime,
|
||||||
or GIF output behavior changes.
|
or GIF output behavior changes.
|
||||||
- Run `pnpm api:smoke` when API render behavior, bundle warm-up, or production
|
- Run `npm run api:smoke` when API render behavior, bundle warm-up, or production
|
||||||
render flow changes.
|
render flow changes.
|
||||||
- Do not commit `.env`, generated GIFs, tokens, secrets, or temporary render
|
- Do not commit `.env`, generated GIFs, tokens, secrets, or temporary render
|
||||||
artifacts.
|
artifacts.
|
||||||
|
|||||||
+4
-6
@@ -35,14 +35,12 @@ RUN apt-get update \
|
|||||||
xdg-utils \
|
xdg-utils \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
COPY package.json package-lock.json ./
|
||||||
COPY scripts/ensure-browser.js ./scripts/ensure-browser.js
|
COPY scripts/ensure-browser.js ./scripts/ensure-browser.js
|
||||||
RUN corepack enable \
|
RUN npm ci --omit=dev \
|
||||||
&& corepack prepare [email protected] --activate \
|
&& npm run browser:ensure
|
||||||
&& pnpm install --prod --frozen-lockfile \
|
|
||||||
&& pnpm browser:ensure
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["pnpm", "start"]
|
CMD ["npm", "start"]
|
||||||
+12
-12
@@ -36,14 +36,14 @@ Response is `image/gif` with winner metadata headers:
|
|||||||
Install dependencies and Chromium once:
|
Install dependencies and Chromium once:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm install
|
npm install
|
||||||
pnpm browser:ensure
|
npm run browser:ensure
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the local API:
|
Start the local API:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Generate GIF files locally
|
### Generate GIF files locally
|
||||||
@@ -52,20 +52,20 @@ Generate the quick smoke fixture at the git-ignored path
|
|||||||
`fixtures/smoke.gif`:
|
`fixtures/smoke.gif`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm render:smoke
|
npm run render:smoke
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate the complete fixture set at `fixtures/smoke.gif`,
|
Generate the complete fixture set at `fixtures/smoke.gif`,
|
||||||
`fixtures/vietnamese.gif`, and `fixtures/sixteen-options.gif`:
|
`fixtures/vietnamese.gif`, and `fixtures/sixteen-options.gif`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm render:fixtures
|
npm run render:fixtures
|
||||||
```
|
```
|
||||||
|
|
||||||
Render a custom GIF directly without starting the API server:
|
Render a custom GIF directly without starting the API server:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
pnpm render:local -- `
|
npm run render:local -- `
|
||||||
--output wheel.gif `
|
--output wheel.gif `
|
||||||
--option "Chiều nay uống CraneTea" `
|
--option "Chiều nay uống CraneTea" `
|
||||||
--option "Chiều nay uống CraneTea" `
|
--option "Chiều nay uống CraneTea" `
|
||||||
@@ -76,7 +76,7 @@ pnpm render:local -- `
|
|||||||
macOS, Linux, or Git Bash:
|
macOS, Linux, or Git Bash:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm render:local -- \
|
npm run render:local -- \
|
||||||
--output wheel.gif \
|
--output wheel.gif \
|
||||||
--option "Chiều nay uống CraneTea" \
|
--option "Chiều nay uống CraneTea" \
|
||||||
--option "Chiều nay uống CraneTea" \
|
--option "Chiều nay uống CraneTea" \
|
||||||
@@ -85,7 +85,7 @@ pnpm render:local -- \
|
|||||||
```
|
```
|
||||||
|
|
||||||
`--winner` is a zero-based index and is random when omitted. Run
|
`--winner` is a zero-based index and is random when omitted. Run
|
||||||
`pnpm render:local -- --help` for duration, hold, FPS, size, theme, and timeout
|
`npm run render:local -- --help` for duration, hold, FPS, size, theme, and timeout
|
||||||
options. The documented root `wheel.gif` and `fixtures/*.gif` outputs are
|
options. The documented root `wheel.gif` and `fixtures/*.gif` outputs are
|
||||||
git-ignored and safe to delete; custom output paths may need their own ignore
|
git-ignored and safe to delete; custom output paths may need their own ignore
|
||||||
rule.
|
rule.
|
||||||
@@ -95,10 +95,10 @@ rule.
|
|||||||
Run the API smoke test and quality gates:
|
Run the API smoke test and quality gates:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm api:smoke
|
npm run api:smoke
|
||||||
pnpm lint
|
npm run lint
|
||||||
pnpm typecheck
|
npm run typecheck
|
||||||
pnpm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ the service is CPU-bound or concurrency-limited.
|
|||||||
|
|
||||||
Local non-Docker render smoke requires Chrome Headless Shell shared libraries,
|
Local non-Docker render smoke requires Chrome Headless Shell shared libraries,
|
||||||
including `libnspr4` and `libnss3`. Prefer Docker for consistent verification.
|
including `libnspr4` and `libnss3`. Prefer Docker for consistent verification.
|
||||||
The Docker image runs `pnpm browser:ensure` during build so production requests
|
The Docker image runs `npm run browser:ensure` during build so production requests
|
||||||
do not need to download Chrome Headless Shell on first render.
|
do not need to download Chrome Headless Shell on first render.
|
||||||
|
|
||||||
`RENDER_TIMEOUT_MS` is a total render timeout. Values below `7000` are raised to
|
`RENDER_TIMEOUT_MS` is a total render timeout. Values below `7000` are raised to
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Fill this after running:
|
Fill this after running:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm render:fixtures
|
npm run render:fixtures
|
||||||
```
|
```
|
||||||
|
|
||||||
| Fixture | Size | FPS | Duration | Bytes | Render Time | Notes |
|
| Fixture | Size | FPS | Duration | Bytes | Render Time | Notes |
|
||||||
|
|||||||
Generated
+5341
File diff suppressed because it is too large.
Load diff
@@ -38,5 +38,8 @@
|
|||||||
"prettier": "3.9.4",
|
"prettier": "3.9.4",
|
||||||
"typescript": "6.0.3",
|
"typescript": "6.0.3",
|
||||||
"vitest": "4.1.10"
|
"vitest": "4.1.10"
|
||||||
|
},
|
||||||
|
"allowScripts": {
|
||||||
|
"esbuild": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
-3438
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,7 @@ import {renderWheelGif} from '../src/render/render-gif.js';
|
|||||||
import {parseRenderLocalArgs} from './render-local-args.js';
|
import {parseRenderLocalArgs} from './render-local-args.js';
|
||||||
|
|
||||||
const usage = `Usage:
|
const usage = `Usage:
|
||||||
pnpm render:local -- --option <text> --option <text> [options]
|
npm run render:local -- --option <text> --option <text> [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-o, --output <path> Output file (default: wheel.gif)
|
-o, --output <path> Output file (default: wheel.gif)
|
||||||
|
|||||||
Reference in new issue
Block a user