make-app-runtime
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemake-app-runtime
make-app-runtime
Use this skill for Make App runtime and packaging contracts. These rules are intentionally strict because platform image entrypoints and publish artifacts should not vary per POC.
This skill owns project runtime structure, workspace manifests, build outputs, Service start entry, Service port baseline, runtime config file location, Docker/K8s runtime entry alignment, publish-readiness script guidance, and publish-readiness checks.
It does not own UI layout (), authentication implementation (), single-app permission logic (), Make adapter environment variable semantics (), DSL modeling (), Make resource deployment (), or canvas-table behavior ().
makeuimake-app-authmake-app-permissionmake-app-servicemakedslmakeclicanvas-table-integration本技能用于处理Make App运行时与打包约定。这些规则刻意保持严格,因为平台镜像入口点和发布产物不应因每个POC而有所不同。
本技能负责项目运行时结构、工作区清单、构建产物、Service启动入口、Service端口基线、运行时配置文件位置、Docker/K8s运行时入口对齐、发布就绪脚本指导以及发布就绪检查。
本技能不负责UI布局()、认证实现()、单应用权限逻辑()、Make适配器环境变量语义()、DSL建模()、Make资源部署()或canvas-table行为()。
makeuimake-app-authmake-app-permissionmake-app-servicemakedslmakeclicanvas-table-integrationQuick start
快速开始
- Identify whether the task touches ,
apps/,apps/service, package scripts, Docker/K8s, image entrypoints, publish readiness, or a runtime error such asapps/ui/dist.Cannot find module '/app/apps/service/dist/server.js' - Preserve the platform image contract unless the user explicitly says the platform contract itself is changing.
- For a new App or an explicit runtime migration, verify the runtime baseline in : it must declare
apps/package.jsonand"packageManager": "pnpm@10.20.0". Existing Make Apps keep their declared runtime during unrelated work; change it only after the user requests an explicit runtime migration."engines": { "node": "22.20.0", "pnpm": "10.20.0" } - For a new or explicitly migrated App, run package commands through Corepack (), not an ambient
corepack pnpmbinary. For an existing App without a runtime migration, use its compatible declared package manager, lockfile, and established workspace workflow.pnpm - For a new or explicitly reorganized App, verify workspace manifests: ,
apps/package.json,apps/pnpm-workspace.yaml, andapps/ui/package.json. For a legacy App, first identify its actual workspace structure without rewriting it.apps/service/package.json - Verify build artifacts before declaring ready: frontend and the Service entry selected by the actual platform image (
apps/ui/distfor the default contract).apps/service/dist/server.js - Add or preserve a contract test for the Service runtime entry.
- 确认任务是否涉及、
apps/、apps/service、包脚本、Docker/K8s、镜像入口点、发布就绪,或类似apps/ui/dist的运行时错误。Cannot find module '/app/apps/service/dist/server.js' - 保留平台镜像约定,除非用户明确说明平台约定本身需要变更。
- 对于新应用或明确的运行时迁移,需验证中的运行时基线:必须声明
apps/package.json和"packageManager": "pnpm@10.20.0"。现有Make App在非相关工作中应保留其声明的运行时;仅在用户明确请求运行时迁移时才可修改。"engines": { "node": "22.20.0", "pnpm": "10.20.0" } - 对于新应用或已明确迁移的应用,通过Corepack()运行包命令,而非环境中的
corepack pnpm二进制文件。对于未进行运行时迁移的现有应用,使用其兼容的已声明包管理器、锁文件和既定工作区工作流。pnpm - 对于新应用或已明确重组的应用,验证工作区清单:、
apps/package.json、apps/pnpm-workspace.yaml和apps/ui/package.json。对于遗留应用,首先确认其实际工作区结构,不要重写。apps/service/package.json - 在声明就绪前验证构建产物:前端以及实际平台镜像选用的Service入口(默认约定下为
apps/ui/dist)。apps/service/dist/server.js - 添加或保留针对Service运行时入口的约定测试。
Workspace contract
工作区契约
Newly generated or explicitly runtime-reorganized Make App projects use:
apps/uiapps/serviceapps/dslapps/docs- when shared packages are needed
apps/packages/*
Required workspace files:
apps/package.jsonapps/pnpm-workspace.yamlapps/ui/package.jsonapps/service/package.json
apps/pnpm-workspace.yamlyaml
packages:
- "ui"
- "service"
- "packages/*"新生成的或已明确进行运行时重组的Make App项目使用以下结构:
apps/uiapps/serviceapps/dslapps/docs- 需要共享包时使用
apps/packages/*
必需的工作区文件:
apps/package.jsonapps/pnpm-workspace.yamlapps/ui/package.jsonapps/service/package.json
apps/pnpm-workspace.yamlyaml
packages:
- "ui"
- "service"
- "packages/*"Package manager contract
包管理器契约
All newly generated Make App React workspaces, and existing Apps undergoing an explicit runtime migration, use the fixed runtime triple: Node.js 22.20.0, its bundled Corepack 0.34.0, and pnpm 10.20.0. The workspace root () must declare the exact Node and pnpm versions:
apps/package.jsonjson
{
"packageManager": "pnpm@10.20.0",
"engines": {
"node": "22.20.0",
"pnpm": "10.20.0"
}
}Each executable workspace package, including and , must declare . The project field rejects unsupported runtimes. Do not add solely for this runtime baseline: it also enforces dependency engine declarations and requires a repository-specific compatibility decision.
apps/ui/package.jsonapps/service/package.json"engines": { "node": "22.20.0" }engines.nodeengineStrictThe repository must also contain a with exactly , and CI or the Make build image must select exactly Node.js . is a compatibility guard; it does not select the Node binary used by a build environment.
.nvmrc22.20.022.20.0enginesExisting Make Apps retain their declared Node and package-manager versions during UI, auth, filtering, Service, or DSL work. That includes compatible npm and Yarn projects: preserve their existing or , workspace install target, and CI workflow. Do not rewrite , , lockfiles, or Node-selection files unless the user explicitly requests an explicit runtime migration. Perform that migration in a dedicated change with the project's tests and a Beta deployment. If the manager declaration, lockfile, workspace/CI workflow, or target platform build requirement conflicts, stop and report the compatibility blocker under ; do not generate a second lockfile or silently convert the App to pnpm.
package-lock.jsonyarn.lockpackageManagerenginesmake-app-runtimeFor new or explicitly migrated pnpm Apps, enable Corepack before project work and run installation, tests, builds, package additions, and publish gates as . Corepack reads the project declaration; a globally installed , including a newer major version, must not be used for these Apps. For an existing compatible pnpm App, use its declared pnpm version through Corepack. For an existing npm or Yarn App without migration, use the repository's established commands and lockfile; do not introduce Corepack or pnpm solely for an unrelated change. Child workspace manifests must not declare a conflicting package-manager version.
corepack pnpm ...pnpmFor a new or explicitly migrated pnpm App, must provide runnable scripts such as , , , , and . targets must match the actual package names, including scoped names. A legacy App keeps its established equivalent scripts and workspace targets.
apps/package.jsonapp:uiapp:servicedevtestbuildcorepack pnpm --filtermake-app-runtimeapps/package.jsonmakecli app deployTreat as a code deployment boundary unless the target makecli version is proven to run a stricter publish gate. Do not report a generated App as publish-ready merely because deploy succeeded.
makecli app deployWhen preparing a new or explicitly migrated App for publish, provide enough project-local scripts and documentation for the agent or CI to run publish-readiness checks before deploy:
- enable Corepack and install dependencies for with
appscorepack pnpm install --frozen-lockfile - verify Node.js is exactly and Corepack is exactly
22.20.00.34.0 - run the workspace build
- run the published contract audit for Service-fronted Apps
make-app-auth - run the Trace audit and behavior tests for every new Make App, whether direct-gateway or Service-fronted
make-app-observability - run the contract audit when single-app permission enforcement is enabled or required by a repository-local delivery baseline
make-app-permission - run Service gateway-mode contract tests proving local preview and published upstream scopes are separated
- verify and
apps/ui/distapps/service/dist/server.js - run Service contract tests, including auth callback proxy behavior, when tests exist
For a new or explicitly migrated pnpm Service-fronted App, prefer a project-local script that runs the publish gate in one command. Keep for build/artifact checks, but do not make it the only release gate. Add for every new App. When single-app permission enforcement is enabled or locally required, add to that command; do not make unrelated Apps depend on a missing permission runtime. A legacy App uses its existing release command with the equivalent applicable checks.
verify:publishcheck:publishtrace:auditpermission:auditRecommended workspace scripts for a new or explicitly migrated pnpm App. Before adding these to , copy or wrap the audit utilities into project-local ; do not write user-specific skill install paths into generated projects. Do not copy these pnpm-specific scripts into a legacy npm/Yarn App without an explicit runtime migration.
package.jsonscripts/json
{
"scripts": {
"check:runtime": "node -e \"if (process.versions.node !== '22.20.0') throw new Error(`Make Apps require Node.js 22.20.0; got ${process.versions.node}`)\" && test \"$(corepack --version)\" = \"0.34.0\"",
"auth:audit": "node scripts/audit-auth-contract.mjs . --mode service-fronted --published",
"trace:audit": "node scripts/audit-trace-contract.mjs . --mode service-fronted",
"schema:diff": "cd .. && makecli diff -f apps/dsl --output=json",
"check:publish": "corepack pnpm run build && test -f service/dist/server.js && test -d ui/dist",
"verify:publish": "corepack pnpm run check:runtime && corepack pnpm run test && corepack pnpm run auth:audit && corepack pnpm run trace:audit && corepack pnpm run check:publish && corepack pnpm run schema:diff"
}
}For an App with single-app permission enforcement, add and append to .
"permission:audit": "node scripts/audit-make-app-permission.mjs ."&& corepack pnpm run permission:auditverify:publishFor a direct-gateway App, use in and keep the same default Trace requirement. The Trace contract itself belongs to ; this Skill only ensures its checks run before deployment.
--mode directtrace:auditmake-app-observabilityDo not describe as a universal makecli hook unless the target makecli version supports it. It is a project-local quality gate to run before .
verify:publishmakecli app deployDo not pass backend-context flags through . For a new or explicitly migrated pnpm App, run the gate as ; a compatible legacy App uses its established equivalent gate and package manager. Then deploy code to Beta with . Follow the skill for the Beta completion guide and, after explicit user authorization, publish that Beta version to Prod with . Keep the same backend context/profile throughout; promotion uses the deployed Beta version and does not push local code. If a project-local Node wrapper must accept flags through , normalize argv by dropping a standalone before parsing because can expose that separator to the script.
verify:publishcorepack pnpm run verify:publishmakecli app deploy --context <context> --profile <profile> --waitmakeclimakecli app promote --context <context> --profile <profile> --yes --waitcorepack pnpm run--corepack pnpm run <script> -- --flagFor Service-fronted Apps, the Service test suite (run via the project's declared package manager; for a new/migrated pnpm App) must include the gateway-mode contract:
corepack pnpm run test- : Service uses
MAKE_APP_LOCAL_PREVIEW=truefieldmakecli configure resolve --target local-preview --output=jsonandmake_api_origin./api/make/** - published mode, where the flag is absent or false: Service uses the deployed k8s-internal gateway origin and .
/make/** - The local-preview token branch is unreachable in published mode.
所有新生成的Make App React工作区,以及正在进行明确运行时迁移的现有应用,均使用固定的运行时三件套:Node.js 22.20.0、其捆绑的Corepack 0.34.0以及pnpm 10.20.0。工作区根目录()必须声明确切的Node和pnpm版本:
apps/package.jsonjson
{
"packageManager": "pnpm@10.20.0",
"engines": {
"node": "22.20.0",
"pnpm": "10.20.0"
}
}每个可执行的工作区包,包括和,都必须声明。项目的字段会拒绝不受支持的运行时。不要仅为此运行时基线添加:它还会强制执行依赖项的引擎声明,需要根据仓库具体情况做出兼容性决策。
apps/ui/package.jsonapps/service/package.json"engines": { "node": "22.20.0" }engines.nodeengineStrict仓库还必须包含一个内容恰好为的文件,且CI或Make构建镜像必须选用Node.js 版本。是兼容性防护机制;它不会选择构建环境使用的Node二进制文件。
22.20.0.nvmrc22.20.0engines现有Make App在进行UI、认证、过滤、Service或DSL相关工作时,应保留其声明的Node和包管理器版本。这包括兼容的npm和Yarn项目:保留其现有的或、工作区安装目标和CI工作流。除非用户明确请求运行时迁移,否则不要重写、、锁文件或Node版本选择文件。迁移应在独立的变更中进行,并包含项目测试和Beta部署。如果管理器声明、锁文件、工作区/CI工作流或目标平台构建要求存在冲突,停止操作并在下报告兼容性阻塞问题;不要生成第二个锁文件,也不要静默将应用转换为pnpm。
package-lock.jsonyarn.lockpackageManagerenginesmake-app-runtime对于新的或已明确迁移的pnpm应用,在项目工作前启用Corepack,并使用命令运行安装、测试、构建、添加包和发布门禁等操作。Corepack会读取项目声明;全局安装的(包括更新的主版本)不得用于这些应用。对于现有的兼容pnpm应用,通过Corepack使用其声明的pnpm版本。对于未迁移的现有npm或Yarn应用,使用仓库既定的命令和锁文件;不要仅为非相关变更引入Corepack或pnpm。子工作区清单不得声明存在冲突的包管理器版本。
corepack pnpm ...pnpm对于新的或已明确迁移的pnpm应用,必须提供可运行的脚本,例如、、、和。的目标必须与实际包名(包括作用域名)匹配。遗留应用保留其既定的等效脚本和工作区目标。
apps/package.jsonapp:uiapp:servicedevtestbuildcorepack pnpm --filtermake-app-runtimeapps/package.jsonmakecli app deploy将视为代码部署边界,除非目标makecli版本被证明运行更严格的发布门禁。不要仅因为部署成功就声称生成的应用已就绪可发布。
makecli app deploy在准备新的或已明确迁移的应用发布时,提供足够的项目本地脚本和文档,以便Agent或CI在部署前运行发布就绪检查:
- 启用Corepack,并使用为
corepack pnpm install --frozen-lockfile安装依赖apps - 验证Node.js版本恰好为,Corepack版本恰好为
22.20.00.34.0 - 运行工作区构建
- 对于Service前置的应用,运行已发布的契约审计
make-app-auth - 对于每个新的Make App,无论是直连网关还是Service前置,都运行Trace审计和行为测试
make-app-observability - 当启用单应用权限强制执行或仓库本地交付基线要求时,运行契约审计
make-app-permission - 运行Service网关模式契约测试,证明本地预览和已发布的上游作用域是分离的
- 验证和
apps/ui/distapps/service/dist/server.js - 当存在测试时,运行Service契约测试,包括认证回调代理行为
对于新的或已明确迁移的pnpm Service前置应用,优先使用项目本地的脚本,通过一条命令运行发布门禁。保留用于构建/产物检查,但不要将其作为唯一的发布门禁。为每个新应用添加。当启用单应用权限强制执行或本地要求时,向该命令添加;不要让非相关应用依赖缺失的权限运行时。遗留应用使用其现有的发布命令,并执行等效的适用检查。
verify:publishcheck:publishtrace:auditpermission:audit针对新的或已明确迁移的pnpm应用的推荐工作区脚本。在将这些添加到之前,将审计工具复制或封装到项目本地的目录中;不要将用户特定的技能安装路径写入生成的项目中。在没有明确运行时迁移的情况下,不要将这些pnpm专属脚本复制到遗留的npm/Yarn应用中。
package.jsonscripts/json
{
"scripts": {
"check:runtime": "node -e \"if (process.versions.node !== '22.20.0') throw new Error(`Make Apps require Node.js 22.20.0; got ${process.versions.node}`)\" && test \"$(corepack --version)\" = \"0.34.0\"",
"auth:audit": "node scripts/audit-auth-contract.mjs . --mode service-fronted --published",
"trace:audit": "node scripts/audit-trace-contract.mjs . --mode service-fronted",
"schema:diff": "cd .. && makecli diff -f apps/dsl --output=json",
"check:publish": "corepack pnpm run build && test -f service/dist/server.js && test -d ui/dist",
"verify:publish": "corepack pnpm run check:runtime && corepack pnpm run test && corepack pnpm run auth:audit && corepack pnpm run trace:audit && corepack pnpm run check:publish && corepack pnpm run schema:diff"
}
}对于启用了单应用权限强制执行的应用,添加,并在后追加。
"permission:audit": "node scripts/audit-make-app-permission.mjs ."verify:publish&& corepack pnpm run permission:audit对于直连网关应用,在中使用,并保持相同的默认Trace要求。Trace契约本身属于;本技能仅确保其检查在部署前运行。
trace:audit--mode directmake-app-observability不要将描述为通用的makecli钩子,除非目标makecli版本支持它。它是在之前运行的项目本地质量门禁。
verify:publishmakecli app deploy不要通过传递后端上下文标志。对于新的或已明确迁移的pnpm应用,使用运行门禁;兼容的遗留应用使用其既定的等效门禁和包管理器。然后使用将代码部署到Beta。遵循技能的Beta完成指南,并在获得用户明确授权后,使用将该Beta版本发布到生产环境。全程保持相同的后端上下文/配置文件;升级使用已部署的Beta版本,不会推送本地代码。如果项目本地的Node包装器必须通过接受标志,请在解析前通过移除独立的来规范化argv,因为可能会将该分隔符暴露给脚本。
verify:publishcorepack pnpm run verify:publishmakecli app deploy --context <context> --profile <profile> --waitmakeclimakecli app promote --context <context> --profile <profile> --yes --waitcorepack pnpm run--corepack pnpm run <script> -- --flag对于Service前置应用,Service测试套件(通过项目声明的包管理器运行;新的/已迁移的pnpm应用使用)必须包含网关模式契约:
corepack pnpm run test- :Service使用
MAKE_APP_LOCAL_PREVIEW=true的makecli configure resolve --target local-preview --output=json字段和make_api_origin路径。/api/make/** - 发布模式(标志不存在或为false):Service使用已部署的k8s内部网关源和路径。
/make/** - 本地预览令牌分支在发布模式下不可达。
Frontend build contract
前端构建契约
Frontend publish artifacts live in .
apps/ui/distGenerated or updated Vite config should set:
build.outDir: "dist"build.emptyOutDir: true
Do not publish or configure static asset discovery against root or .
distapps/dist前端发布产物位于。
apps/ui/dist生成或更新的Vite配置应设置:
build.outDir: "dist"build.emptyOutDir: true
不要针对根目录或发布或配置静态资源发现。
distapps/distService runtime contract
Service运行时契约
The platform image default Service entry is:
text
/app/apps/service/dist/server.jsTherefore the default TypeScript Service contract is:
- source entry:
apps/service/src/server.ts - compiled entry:
apps/service/dist/server.js - production start script:
node dist/server.js - dev script may use , but production start must not use
tsx watch src/server.tstsx - Service HTTP port:
3000 - centralized runtime config entry:
apps/service/src/config.ts
apps/service/tsconfig.jsonjson
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts", "test", "dist"]
}For a new or explicitly migrated pnpm App, must include the Node engine and scripts equivalent to:
apps/service/package.jsonjson
{
"engines": {
"node": "22.20.0"
},
"scripts": {
"dev": "tsx watch src/server.ts",
"build": "tsc -p tsconfig.json",
"start": "node dist/server.js",
"test": "vitest run"
}
}Do not leave Docker, K8s, makecli, package scripts, or docs pointing at unless the project's declared build workflow creates (for a new or migrated pnpm App, ).
/app/apps/service/dist/server.jsapps/service/dist/server.jscorepack pnpm --filter <service-package> buildIf a legacy project intentionally uses a different Service entry or build tool, keep it only when all runtime references agree: Docker/K8s entrypoint, package , docs, build output, and readiness tests.
start平台镜像的默认Service入口为:
text
/app/apps/service/dist/server.js因此默认的TypeScript Service契约为:
- 源码入口:
apps/service/src/server.ts - 编译后入口:
apps/service/dist/server.js - 生产环境启动脚本:
node dist/server.js - 开发脚本可以使用,但生产环境启动不得使用
tsx watch src/server.tstsx - Service HTTP端口:
3000 - 集中式运行时配置入口:
apps/service/src/config.ts
apps/service/tsconfig.jsonjson
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts", "test", "dist"]
}对于新的或已明确迁移的pnpm应用,必须包含等效的Node引擎和脚本:
apps/service/package.jsonjson
{
"engines": {
"node": "22.20.0"
},
"scripts": {
"dev": "tsx watch src/server.ts",
"build": "tsc -p tsconfig.json",
"start": "node dist/server.js",
"test": "vitest run"
}
}不要让Docker、K8s、makecli、包脚本或文档指向,除非项目声明的构建工作流会生成(对于新的或已迁移的pnpm应用,使用)。
/app/apps/service/dist/server.jsapps/service/dist/server.jscorepack pnpm --filter <service-package> build如果遗留项目有意使用不同的Service入口或构建工具,仅当所有运行时引用(Docker/K8s入口点、包脚本、文档、构建产物和就绪检查)都一致时才保留。
startService build contract test
Service构建契约测试
Service-backed Apps should include a test that protects the runtime entry contract. The test may live in or the project's established test location. The fixed-version assertions below apply only to new or explicitly migrated pnpm Apps; legacy Apps assert their own declared runtime and lockfile without changing them.
apps/service/test/service-build-contract.test.tsIt should assert:
- declares
apps/package.jsonpackageManager: "pnpm@10.20.0" - declares
apps/package.jsonandengines.node: "22.20.0"engines.pnpm: "10.20.0" - contains
.nvmrc, and the CI or Make build image uses Node.js22.20.022.20.0 - and
apps/ui/package.jsoneach declareapps/service/package.jsonengines.node: "22.20.0" - has a
apps/service/package.jsonscriptbuild - production start points to
apps/service/package.jsonwhen the platform image uses that entrynode dist/server.js - uses
apps/service/tsconfig.jsonandrootDir: "src"outDir: "dist" - after build, exists
apps/service/dist/server.js
Run the Service build before relying on that artifact. For a new or explicitly migrated pnpm App:
bash
corepack pnpm --filter <service-package-name> build
test -f apps/service/dist/server.jsFor a legacy App, use its established package-manager build command and verify the actual production entry artifact instead.
Service支撑的应用应包含一个保护运行时入口契约的测试。该测试可位于或项目既定的测试位置。以下固定版本断言仅适用于新的或已明确迁移的pnpm应用;遗留应用应断言其自身声明的运行时和锁文件,不得更改。
apps/service/test/service-build-contract.test.ts测试应断言:
- 声明了
apps/package.jsonpackageManager: "pnpm@10.20.0" - 声明了
apps/package.json和engines.node: "22.20.0"engines.pnpm: "10.20.0" - 包含
.nvmrc,且CI或Make构建镜像使用Node.js22.20.022.20.0 - 和
apps/ui/package.json各自声明了apps/service/package.jsonengines.node: "22.20.0" - 包含
apps/service/package.json脚本build - 当平台镜像使用该入口时,的生产环境启动指向
apps/service/package.jsonnode dist/server.js - 使用
apps/service/tsconfig.json和rootDir: "src"outDir: "dist" - 构建后,存在
apps/service/dist/server.js
在依赖该产物之前运行Service构建。对于新的或已明确迁移的pnpm应用:
bash
corepack pnpm --filter <service-package-name> build
test -f apps/service/dist/server.js对于遗留应用,使用其既定的包管理器构建命令,并验证实际的生产环境入口产物。
Runtime config location and port
运行时配置位置与端口
Service runtime environment reads are centralized in for new projects. This skill only requires the config entry location and fixed port handling needed by runtime/startup. Make adapter variables such as , , , and belong to .
apps/service/src/config.tsMAKE_API_BASE_URLMAKE_SERVER_URLMAKE_AUTH_BASE_URLMAKE_BUSINESS_BASE_URLmake-app-serviceService HTTP port is fixed to . Generated or refactored Service code, , docs, health checks, tests, CORS, and UI local Service base URL examples must align to .
3000.env.example3000If local is occupied during development, report the conflict. Do not silently change the Service contract port.
3000make-app-runtime新项目的Service运行时环境读取集中在中。本技能仅要求运行时/启动所需的配置入口位置和固定端口处理。Make适配器变量(如、、和)属于。
apps/service/src/config.tsMAKE_API_BASE_URLMAKE_SERVER_URLMAKE_AUTH_BASE_URLMAKE_BUSINESS_BASE_URLmake-app-serviceService HTTP端口固定为。生成或重构的Service代码、、文档、健康检查、测试、CORS以及UI本地Service基础URL示例都必须与对齐。
3000.env.example3000如果开发期间本地端口被占用,报告冲突。不要静默更改Service契约端口。
3000make-app-runtimeForwarded request headers
转发请求头
When Service forwards requests to a Make gateway and that gateway needs request-origin context, preserve or set standard forwarded headers:
X-Forwarded-HostX-Forwarded-Proto
Do not hard-code environment domains in generated Service code. Use the incoming request context or the host runtime proxy contract.
当Service将请求转发到Make网关且该网关需要请求源上下文时,保留或设置标准的转发请求头:
X-Forwarded-HostX-Forwarded-Proto
不要在生成的Service代码中硬编码环境域名。使用传入的请求上下文或主机运行时代理契约。
Readiness checks
就绪检查
Before reporting a Service-backed App as ready to publish or ready for user-domain access, distinguish a new/explicitly migrated pnpm App from a legacy App. For the former:
- Verify reports
node --versionandv22.20.0reportscorepack --version. Then run0.34.0and verifycd apps && corepack pnpm install --frozen-lockfilereportscorepack pnpm --version.10.20.0 - Run when the project provides it.
cd apps && corepack pnpm run verify:publish - Otherwise, run the workspace build that produces .
apps/ui/dist - Run the Service build.
- Verify exists when the runtime entry points there.
apps/service/dist/server.js - Run the Service contract test and the make-app-auth published audit for Service-fronted Apps.
- For Service-fronted Apps, verify the Service contract test covers both local-preview and published gateway modes. Published upstream requests must not use ; local preview must consume makecli resolve
/api/make/**and must not use k8s-internalmake_api_origin./make/** - If a start smoke is available, start the built Service with the production start script and verify it reaches the expected health or root response, then stop it.
For an existing App without runtime migration, first verify that its declared Node/package manager, lockfile, workspace and CI/install workflow agree with the target platform build image. Use that App's established frozen/clean install, test, build and release commands, then perform the same applicable auth, permission, gateway-mode, artifact and start checks above. Do not require the / triple, , or merely because an unrelated UI feature changed. If the platform actually requires a runtime the legacy App cannot meet, report a publish blocker and request an explicit migration; a successful local build alone is not release readiness.
22.20.010.20.0pnpm-workspace.yamlcorepack pnpm run verify:publishDo not mark a Service-backed App ready based only on successful local development startup.
tsx src/server.ts在报告Service支撑的应用已就绪可发布或可用于用户域访问之前,需区分新的/已明确迁移的pnpm应用与遗留应用。对于前者:
- 验证输出
node --version,v22.20.0输出corepack --version。然后运行0.34.0,并验证cd apps && corepack pnpm install --frozen-lockfile输出corepack pnpm --version。10.20.0 - 如果项目提供了脚本,运行
verify:publish。cd apps && corepack pnpm run verify:publish - 否则,运行工作区构建以生成。
apps/ui/dist - 运行Service构建。
- 当运行时入口指向该路径时,验证存在。
apps/service/dist/server.js - 对于Service前置应用,运行Service契约测试和make-app-auth已发布审计。
- 对于Service前置应用,验证Service契约测试同时覆盖本地预览和发布网关模式。已发布的上游请求不得使用;本地预览必须使用makecli resolve返回的
/api/make/**,且不得使用k8s内部的make_api_origin。/make/** - 如果有启动冒烟测试,使用生产环境启动脚本启动构建后的Service,验证其返回预期的健康检查或根路径响应,然后停止。
对于未进行运行时迁移的现有应用,首先验证其声明的Node/包管理器、锁文件、工作区和CI/安装工作流与目标平台构建镜像一致。使用该应用既定的冻结/干净安装、测试、构建和发布命令,然后执行上述相同的适用认证、权限、网关模式、产物和启动检查。不要仅因为非相关的UI功能变更,就要求使用/三件套、或。如果平台实际要求的运行时遗留应用无法满足,报告发布阻塞问题并请求明确迁移;仅本地构建成功并不代表发布就绪。
22.20.010.20.0pnpm-workspace.yamlcorepack pnpm run verify:publish不要仅基于本地开发启动成功,就将Service支撑的应用标记为就绪。
tsx src/server.tsCommon failure diagnosis
常见故障诊断
Error:
text
Cannot find module '/app/apps/service/dist/server.js'Treat it as a runtime contract failure:
- build did not run, or
- was missing, or
src/server.ts - emitted somewhere else, or
tsconfig - package / image entry points to a file the build does not create.
start
Fix the build/start contract. Do not work around it by changing UI code or auth behavior.
错误:
text
Cannot find module '/app/apps/service/dist/server.js'将其视为运行时契约失败:
- 构建未运行,或
- 缺失,或
src/server.ts - 输出到了其他位置,或
tsconfig - 包脚本/镜像入口指向了构建不会生成的文件。
start
修复构建/启动契约。不要通过修改UI代码或认证行为来规避此问题。