mirror of
https://github.com/langgenius/dify.git
synced 2026-09-28 06:13:22 +08:00
chore: upgrade Node.js runtime to 24 LTS (#41573)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"nodeGypDependencies": true,
|
||||
"version": "lts"
|
||||
"version": "24.20.0"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/npm-package:1": {
|
||||
"package": "typescript",
|
||||
@@ -46,4 +46,4 @@
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ runs:
|
||||
- name: Setup Vite+
|
||||
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
node-version-file: package.json
|
||||
cache: true
|
||||
run-install: true
|
||||
|
||||
@@ -6,7 +6,6 @@ web:
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- '.nvmrc'
|
||||
|
||||
e2e:
|
||||
- changed-files:
|
||||
|
||||
@@ -82,7 +82,6 @@ jobs:
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'lint.config.ts'
|
||||
- '.npmrc'
|
||||
- '.nvmrc'
|
||||
- '.github/workflows/cli-tests.yml'
|
||||
- '.github/actions/setup-web/**'
|
||||
web:
|
||||
@@ -91,7 +90,6 @@ jobs:
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- '.nvmrc'
|
||||
- '.github/workflows/main-ci.yml'
|
||||
- '.github/workflows/web-tests.yml'
|
||||
- '.github/actions/setup-web/**'
|
||||
@@ -105,7 +103,6 @@ jobs:
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- '.nvmrc'
|
||||
- 'docker/docker-compose.middleware.yaml'
|
||||
- 'docker/envs/middleware.env.example'
|
||||
- '.github/workflows/web-e2e.yml'
|
||||
|
||||
@@ -39,7 +39,6 @@ jobs:
|
||||
- 'e2e/tsx-register.js'
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- '.nvmrc'
|
||||
- '.github/workflows/post-merge.yml'
|
||||
- '.github/workflows/web-e2e.yml'
|
||||
- '.github/actions/setup-web/**'
|
||||
|
||||
@@ -114,7 +114,6 @@ jobs:
|
||||
pnpm-workspace.yaml
|
||||
knip.config.ts
|
||||
scripts/check-web-production-unused-after-knip-fix.mjs
|
||||
.nvmrc
|
||||
.github/workflows/style.yml
|
||||
.github/actions/setup-web/**
|
||||
|
||||
@@ -170,7 +169,6 @@ jobs:
|
||||
package.json
|
||||
pnpm-lock.yaml
|
||||
pnpm-workspace.yaml
|
||||
.nvmrc
|
||||
vite.config.ts
|
||||
lint.config.ts
|
||||
eslint.config.mjs
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: 22
|
||||
node-version-file: package.json
|
||||
cache: ''
|
||||
cache-dependency-path: 'pnpm-lock.yaml'
|
||||
|
||||
|
||||
+3
-4
@@ -53,15 +53,14 @@ WORKDIR /app/api
|
||||
|
||||
# Create non-root user
|
||||
ARG dify_uid=1001
|
||||
ARG NODE_MAJOR=22
|
||||
ARG NODE_PACKAGE_VERSION=22.21.0-1nodesource1
|
||||
ARG NODE_PACKAGE_VERSION=24.20.0-1nodesource1
|
||||
ARG NODESOURCE_KEY_FPR=6F71F525282841EEDAF851B42F59B5F99B1BE0B4
|
||||
RUN groupadd -r -g ${dify_uid} dify && \
|
||||
useradd -r -u ${dify_uid} -g ${dify_uid} -s /bin/bash dify && \
|
||||
chown -R dify:dify /app
|
||||
|
||||
RUN \
|
||||
apt-get update \
|
||||
RUN NODE_MAJOR="${NODE_PACKAGE_VERSION%%.*}" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# AGENTS.md — difyctl (TypeScript CLI)
|
||||
|
||||
This package is the Node 22+, ESM TypeScript implementation of `difyctl`. Development also requires the Bun version pinned in `.bun-version`; command-tree generation and the `dev`, `test`, and `build` pre-scripts invoke it. Read [`ARD.md`] before adding a command or changing shared CLI infrastructure. Read `src/commands/AGENTS.md` for command-folder and registry rules.
|
||||
This package is the Node 24+, ESM TypeScript implementation of `difyctl`. Development also requires the Bun version pinned in `.bun-version`; command-tree generation and the `dev`, `test`, and `build` pre-scripts invoke it. Read [`ARD.md`] before adding a command or changing shared CLI infrastructure. Read `src/commands/AGENTS.md` for command-folder and registry rules.
|
||||
|
||||
## Architecture Boundaries
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
"vitest": "catalog:"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.22.1"
|
||||
"node": "^24.20.0"
|
||||
},
|
||||
"difyctl": {
|
||||
"channel": "stable",
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ export default defineConfig({
|
||||
sourcemap: true,
|
||||
treeshake: false,
|
||||
outDir: 'dist',
|
||||
target: 'node22',
|
||||
target: 'node24',
|
||||
define: {
|
||||
__DIFYCTL_VERSION__: JSON.stringify(buildInfo.version),
|
||||
__DIFYCTL_COMMIT__: JSON.stringify(buildInfo.commit),
|
||||
|
||||
@@ -43,7 +43,7 @@ export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
format: ['esm'],
|
||||
outDir: 'dist',
|
||||
target: 'node22',
|
||||
target: 'node24',
|
||||
define: {
|
||||
__DIFYCTL_VERSION__: JSON.stringify(buildInfo.version),
|
||||
__DIFYCTL_COMMIT__: JSON.stringify(buildInfo.commit),
|
||||
|
||||
@@ -20,7 +20,7 @@ RUN CGO_ENABLED=0 go build -o /bin/shellctl ./cmd/shellctl && \
|
||||
# ── Runtime stage ────────────────────────────────────────────────────────────
|
||||
FROM python:3.12-slim-bookworm AS production
|
||||
|
||||
ARG NODE_VERSION=22.22.1
|
||||
ARG NODE_VERSION=24.20.0
|
||||
ARG PNPM_VERSION=11.9.0
|
||||
ARG UV_VERSION=0.8.9
|
||||
|
||||
|
||||
+2
-2
@@ -56,12 +56,12 @@
|
||||
"devEngines": {
|
||||
"runtime": {
|
||||
"name": "node",
|
||||
"version": "^22.22.1",
|
||||
"version": "24.20.0",
|
||||
"onFail": "download"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.22.1"
|
||||
"node": "^24.20.0"
|
||||
},
|
||||
"packageManager": "pnpm@11.25.0"
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
"vitest": "catalog:"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.22.1"
|
||||
"node": "^24.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export default defineConfig({
|
||||
outDir: 'dist',
|
||||
platform: 'node',
|
||||
sourcemap: true,
|
||||
target: 'node22',
|
||||
target: 'node24',
|
||||
treeshake: true,
|
||||
},
|
||||
test: {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default defineConfig({
|
||||
outDir: 'dist',
|
||||
platform: 'node',
|
||||
sourcemap: true,
|
||||
target: 'node22',
|
||||
target: 'node24',
|
||||
treeshake: true,
|
||||
},
|
||||
})
|
||||
|
||||
Generated
+40
-50
@@ -730,8 +730,8 @@ importers:
|
||||
specifier: 'catalog:'
|
||||
version: 6.34.0
|
||||
node:
|
||||
specifier: runtime:^22.22.1
|
||||
version: runtime:22.23.2
|
||||
specifier: runtime:24.20.0
|
||||
version: runtime:24.20.0
|
||||
typescript:
|
||||
specifier: 'catalog:'
|
||||
version: '@typescript/typescript6@6.0.2'
|
||||
@@ -7398,7 +7398,7 @@ packages:
|
||||
resolution: {integrity: sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
node@runtime:22.23.2:
|
||||
node@runtime:24.20.0:
|
||||
resolution:
|
||||
type: variations
|
||||
variants:
|
||||
@@ -7406,9 +7406,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-d8YwMv1KuOmOCufbnXnjlmWeBK+Vpe344cqGnkJsBKU=
|
||||
integrity: sha256-FLW9etQKtfRxX7Ti+WSFjYINlCX+KR09ZfmJJua4nB4=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-aix-ppc64.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-aix-ppc64.tar.gz
|
||||
targets:
|
||||
- cpu: ppc64
|
||||
os: aix
|
||||
@@ -7416,9 +7416,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-YRMPOUwWMNIR3VCuzENT03lIDzbTrJE82F27oa7VhcY=
|
||||
integrity: sha256-QOVgfl7LPbkZJyN3baLXXZZiYPx0p6nnMcG9Z92pa8g=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-darwin-arm64.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-darwin-arm64.tar.gz
|
||||
targets:
|
||||
- cpu: arm64
|
||||
os: darwin
|
||||
@@ -7426,9 +7426,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-WOmQIsL/iTlVdsx/1NmM6iS7aAgUddX4i4Ae6HKfsCY=
|
||||
integrity: sha256-nlsmRM8Qe++2rvymdrltMpa8EBOAlvAi7TeNYjPtgfQ=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-darwin-x64.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-darwin-x64.tar.gz
|
||||
targets:
|
||||
- cpu: x64
|
||||
os: darwin
|
||||
@@ -7436,9 +7436,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-ATtZz9KBlwOm9KFKuJH8RvwqTj9bzZLeP7SSm0PjWzA=
|
||||
integrity: sha256-NRVgPiSHh5o5vHVxbxoq/9AnUAxkulDoRc9yyzMhkBM=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-arm64.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-arm64.tar.gz
|
||||
targets:
|
||||
- cpu: arm64
|
||||
os: linux
|
||||
@@ -7446,19 +7446,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-Ki9Z64/Z3sJ7O+4XxykTHR/T5tmUPUefEVbOOK+M1Zk=
|
||||
integrity: sha256-pzSzbI0dFs5FXA65wymwfdEhwshVQ1UGSphhvJbDrcw=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-armv7l.tar.gz
|
||||
targets:
|
||||
- cpu: armv7l
|
||||
os: linux
|
||||
- resolution:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-ZciqnmRxlvMNNWS7ayATBrG1IPcvDdMnjaMmAUoBg3k=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-ppc64le.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-ppc64le.tar.gz
|
||||
targets:
|
||||
- cpu: ppc64le
|
||||
os: linux
|
||||
@@ -7466,9 +7456,9 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-mGuEQbHRoBxw7XELqyAXQf0NGW0wKn5DOP79XhwQ5h4=
|
||||
integrity: sha256-2MIktG7wHweKUj2bfbeSgjBvrigemGoVotv/6UfFMB4=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-s390x.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-s390x.tar.gz
|
||||
targets:
|
||||
- cpu: s390x
|
||||
os: linux
|
||||
@@ -7476,9 +7466,20 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-spSlVuY51kM4gjkg5YZsIcAnQXQtLhUp7hoiXB7JJSo=
|
||||
integrity: sha256-1ubRu7mtSssW1YC4m+ipyafkkJJuk708MKINRuFSv4o=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-x64.tar.gz
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-x64-musl.tar.gz
|
||||
targets:
|
||||
- cpu: x64
|
||||
os: linux
|
||||
libc: musl
|
||||
- resolution:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-hV1YH4pOsagRfjQm3iX+AncFkv68+zE2mu4f+/7p6Ow=
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-x64.tar.gz
|
||||
targets:
|
||||
- cpu: x64
|
||||
os: linux
|
||||
@@ -7486,10 +7487,10 @@ packages:
|
||||
archive: zip
|
||||
bin:
|
||||
node: node.exe
|
||||
integrity: sha256-/sAlptoxdX47avhMWhYo6dOEQsqZohYQkdePL8+jXvM=
|
||||
prefix: node-v22.23.2-win-arm64
|
||||
integrity: sha256-McZ5l0TeilRgFkMJgEDGjDaX5WyU5AfWHQ5fpfNBkdc=
|
||||
prefix: node-v24.20.0-win-arm64
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-win-arm64.zip
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-win-arm64.zip
|
||||
targets:
|
||||
- cpu: arm64
|
||||
os: win32
|
||||
@@ -7497,31 +7498,20 @@ packages:
|
||||
archive: zip
|
||||
bin:
|
||||
node: node.exe
|
||||
integrity: sha256-EXe0E3ulrapWNUrkDxCAx0UOiuCc7LR9pFnRxSrJn5c=
|
||||
prefix: node-v22.23.2-win-x64
|
||||
integrity: sha256-bKyf+8qPakcJHktcdy4GBgScOHHLZ9kAwM7d5jDlRbo=
|
||||
prefix: node-v24.20.0-win-x64
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-win-x64.zip
|
||||
url: https://nodejs.org/download/release/v24.20.0/node-v24.20.0-win-x64.zip
|
||||
targets:
|
||||
- cpu: x64
|
||||
os: win32
|
||||
- resolution:
|
||||
archive: zip
|
||||
bin:
|
||||
node: node.exe
|
||||
integrity: sha256-clyeK90cIBa0HJlagfT6Ns5OLuVlt0Vdj4iRgnJ99kc=
|
||||
prefix: node-v22.23.2-win-x86
|
||||
type: binary
|
||||
url: https://nodejs.org/download/release/v22.23.2/node-v22.23.2-win-x86.zip
|
||||
targets:
|
||||
- cpu: x86
|
||||
os: win32
|
||||
- resolution:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-t6GiscfHbkdVDxd2RnaTmEDgpktNBL3TdaSsFLzKqNg=
|
||||
integrity: sha256-LIxQfMsPIIEtlSa6jKRUsWUqre9o/IutBvB/sRIt0e8=
|
||||
type: binary
|
||||
url: https://unofficial-builds.nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-arm64-musl.tar.gz
|
||||
url: https://unofficial-builds.nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-arm64-musl.tar.gz
|
||||
targets:
|
||||
- cpu: arm64
|
||||
os: linux
|
||||
@@ -7530,14 +7520,14 @@ packages:
|
||||
archive: tarball
|
||||
bin:
|
||||
node: bin/node
|
||||
integrity: sha256-OW4R7mCesuXLmQ8EXE0DeqR7LCR/POywHFwWLjP/qa8=
|
||||
integrity: sha256-muE5n+9L2JkOFXc84TJ7M2oguel9jHVJ9PQspzxD9WI=
|
||||
type: binary
|
||||
url: https://unofficial-builds.nodejs.org/download/release/v22.23.2/node-v22.23.2-linux-x64-musl.tar.gz
|
||||
url: https://unofficial-builds.nodejs.org/download/release/v24.20.0/node-v24.20.0-linux-x64-musl.tar.gz
|
||||
targets:
|
||||
- cpu: x64
|
||||
os: linux
|
||||
libc: musl
|
||||
version: 22.23.2
|
||||
version: 24.20.0
|
||||
hasBin: true
|
||||
|
||||
normalize-package-data@8.0.0:
|
||||
@@ -15043,7 +15033,7 @@ snapshots:
|
||||
|
||||
node-releases@2.0.54: {}
|
||||
|
||||
node@runtime:22.23.2: {}
|
||||
node@runtime:24.20.0: {}
|
||||
|
||||
normalize-package-data@8.0.0:
|
||||
dependencies:
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
# base image
|
||||
FROM node:22.22.1-alpine AS base
|
||||
ARG NODE_VERSION=24.20.0
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
LABEL maintainer="takatost@gmail.com"
|
||||
|
||||
# if you located in China, you can use aliyun mirror to speed up
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
!package.json
|
||||
!pnpm-lock.yaml
|
||||
!pnpm-workspace.yaml
|
||||
!.nvmrc
|
||||
!web/
|
||||
!web/**
|
||||
!e2e/
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ This is a [Next.js] application with [vinext] as the default local development s
|
||||
|
||||
### Run by source code
|
||||
|
||||
The required Node.js and pnpm versions are pinned by the repository root `.nvmrc` and `packageManager` field. [Vite+] is also available for repository checks and tests; use its official documentation as the installation reference.
|
||||
The required Node.js and pnpm versions are pinned by the repository root `devEngines.runtime` and `packageManager` fields. [Vite+] is also available for repository checks and tests; use its official documentation as the installation reference.
|
||||
|
||||
- [Node.js]
|
||||
- [pnpm]
|
||||
@@ -20,7 +20,7 @@ pnpm install
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> JavaScript dependencies are managed by the workspace files at the repository root: `package.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, and `.nvmrc`.
|
||||
> JavaScript dependencies are managed by the workspace files at the repository root: `package.json`, `pnpm-lock.yaml`, and `pnpm-workspace.yaml`.
|
||||
> Install dependencies and run the commands below from the repository root.
|
||||
|
||||
Then, configure the environment variables.
|
||||
|
||||
Reference in New Issue
Block a user