@flisk-sh/flisk-export

中文文档
0.10.0发布于 2026/11/04MITES Module构建来源已验证近 30 天下载 4705

Write a Render Blueprint (render.yaml), a Cloudflare wrangler.toml or a standalone docker-compose.yml from Flisk service.json files. Never deploys.

原始使用文档
文档目录6 节
  1. Use
  2. render
  3. wrangler
  4. Develop
  5. Compose
  6. License

flisk-export

Write a Render Blueprint (render.yaml) or a Cloudflare wrangler.toml from the service.json files of a Flisk project.

It writes files only. It never deploys, never creates DNS records, never calls a cloud API, and writes environment variable names, never values. The Flisk CLI runs it at a pinned version as flisk export.

Use

npx @flisk-sh/flisk-export render [dir] [--resource <name>] [--out <dir>] [--dry-run] [--force]
npx @flisk-sh/flisk-export wrangler [dir] --resource <name> [--route <host>] [--out <dir>] [--allow-non-worker] [--dry-run] [--force]

Or, from a Flisk project: flisk export render --dry-run.

render

  • Exports every resource whose appType is backend, frontend, agent, mcp or bring-your-own (a resource with no appType is not exported), or one with --resource.
  • A resource with a Dockerfile becomes runtime: docker; one with a package.json becomes runtime: node.
  • The service.json port is written as PORT, because Render routes traffic to $PORT.
  • Every other env name is written with sync: false, so Render asks for the value. Names that are not valid variable names are left out with a warning.
  • healthCheckPath comes from service.json (default /health).
  • Paths are relative to the git repository root, which is where Render reads them, and the file is written there by default. --out moves the file but not the paths.
  • Two resources that become the same service name (api_v1 and api-v1) are refused.

wrangler

  • One resource. main comes from package.json main, or the first of src/index.ts, src/index.js, src/worker.ts, src/worker.js, index.ts, index.js.
  • A resource with a Dockerfile, or without a wrangler, @cloudflare/workers-types or hono dependency, is refused unless --allow-non-worker.
  • --route api.example.com writes a Custom Domain route. Wildcards are refused: Custom Domains do not accept them.
  • Env names are listed in a comment for wrangler secret put.

Develop

npm install
npm run typecheck && npm run lint && npm run build && npm test

Compose

flisk-export compose            # writes .autogenerated/docker-compose.yml
flisk-export compose --check    # exit 1 when that file is out of date (for CI)

Writes a standalone docker-compose.yml from the bring-your-own service.json files (image or dockerfile, env, secrets.required, envFile, profiles, models, volumes, extraPorts, dependsOn, healthCheck, sidecarOf, container). It runs without Flisk (docker compose --env-file .env -f .autogenerated/docker-compose.yml up -d from the project root, since Compose looks for .env next to the file it reads): no external networks, no FLISK_* variables, no generated secrets. ${VAR} references in env, and every name in secrets.required, pass through as ${NAME} for Compose to read from .env. A volume's name (the Docker volume an install already has) is kept, and the project is named after its stack (or, when .flisk/project.json has composeProjectNames.<stack> from flisk-import, the Compose project name it had before, such as pl_mail), so docker compose up finds the same data as before. An image with Compose variables (postgres:${POSTGRES_VERSION:-18}-alpine) is written as it is, for Compose to resolve; restart: "on-failure:N" keeps N. From container: stopGracePeriod becomes stop_grace_period, networkAliases become networks: { default: { aliases } } (not on a sidecarOf service, which has no network of its own), extraHosts become extra_hosts and ulimits stay ulimits. Each value is checked so it cannot add YAML keys; one that does not fit is an error. healthCheck.command becomes a Compose healthcheck (with startPeriod as start_period); a service that lists a checked service in dependsOn waits for service_healthy (only when that healthcheck is written: a service with only healthCheckPath, or enabled: false, is waited for with service_started), and a dependsOn entry written as { name, condition } (flisk#2983) keeps its condition. buildArgs become build.args, logging stays logging, a bind source ${NAME:-./path} keeps reading NAME with its default rewritten for this file, selinux becomes the :z/:Z mount option, and an image may use ${NAME:?message} (Flisk 1.4.28 fields). container.command and container.entrypoint (Flisk 1.4.31) become Compose command: and entrypoint: lists as written ($$ and ${VAR} stay, an empty entrypoint drops the image's ENTRYPOINT). A service with no restart gets none (Compose's default), as the project's own Compose file had it. and one that lists a restart: "no" job waits for service_completed_successfully. Other resource types and command (native) services are not exported. The file is generated: change service.json and run it again with --force. It never starts a container or calls an API.

License

MIT

版本与发布记录

@flisk-sh/flisk-export 共发布 14 个版本,首次发布于 2026/10/31;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.10.0latest2026/11/0412 天前
0.9.02026/11/0114 天前
0.8.02026/11/0114 天前
0.7.02026/11/0114 天前
0.6.02026/11/0114 天前
0.5.02026/11/0114 天前

关于 @flisk-sh/flisk-export 的常见问题

@flisk-sh/flisk-export 是什么?

Write a Render Blueprint (render.yaml), a Cloudflare wrangler.toml or a standalone docker-compose.yml from Flisk service.json files. Never deploys.

如何安装 @flisk-sh/flisk-export?

在项目目录运行 npm install @flisk-sh/flisk-export,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 flisk-export,可以用 npx flisk-export 直接运行。

@flisk-sh/flisk-export 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/flisk-sh__flisk-export 是否存在。

@flisk-sh/flisk-export 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@flisk-sh/flisk-export 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@flisk-sh/flisk-export 可以商用吗?

@flisk-sh/flisk-export 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@flisk-sh/flisk-export 的下载量有多少?

根据 npm 官方下载统计,@flisk-sh/flisk-export 在 2026/10/15 – 2026/11/13 这 30 天内被下载 4,705 次,日均约 157 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@flisk-sh/flisk-export 还在维护吗?

最新版本 0.10.0 发布于 2026/11/04(12 天前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/10/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。