Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

docs: mark NETWORK error code reserved and pin config url resolution

Tw9365b7a0e1e3cd
diff --git a/docs/cli-usage.md b/docs/cli-usage.md
index 619f0498..15ef1c84 100644
--- a/docs/cli-usage.md
+++ b/docs/cli-usage.md
@@ -605,7 +605,7 @@ Enable developer tools and detailed logging for debugging.
#### [config]
-Load options from a declarative JSON config file instead of assembling flags. Fields are the camelCase CLI option names plus `url`; the published schema is [schema/pake.schema.json](../schema/pake.schema.json). An explicit CLI flag always wins over a config field. Unknown fields and wrong types fail fast. Invocation flags (`--json`, `--config`, `--version`) are CLI-only and rejected inside the file.
+Load options from a declarative JSON config file instead of assembling flags. Fields are the camelCase CLI option names plus `url`; the published schema is [schema/pake.schema.json](../schema/pake.schema.json). An explicit CLI flag always wins over a config field. Unknown fields, wrong types, and out-of-range numbers fail fast. A relative `url` path resolves against the current working directory, not the config file's location. Invocation flags (`--json`, `--config`, `--version`) are CLI-only and rejected inside the file.
```shell
--config <path>
@@ -637,7 +637,7 @@ Machine-readable mode for scripts and AI agents. All logs move to stderr and std
# {"ok":false, ..., "error":{"code":"ENV_MISSING","message":"...","hint":"..."}}
```
-Exit codes: `0` success, `2` invalid input, `3` build failure, `4` missing environment or dependency setup failure (e.g. Rust not installed, package install failed), `1` unexpected error. Error codes: `INVALID_INPUT`, `ENV_MISSING`, `BUILD_FAILED`, `NETWORK`, `UNEXPECTED`.
+Exit codes: `0` success, `2` invalid input, `3` build failure, `4` missing environment or dependency setup failure (e.g. Rust not installed, package install failed), `1` unexpected error. Error codes: `INVALID_INPUT`, `ENV_MISSING`, `BUILD_FAILED`, `UNEXPECTED`, plus `NETWORK` (reserved; current versions report network failures under the phase code).
On Linux multi-target builds (e.g. `--targets deb,appimage`), `ok` can be true with fewer `outputs` than requested: a target that fails while others succeed is reported in `warnings`, not as a failure. Check `outputs[].format` against the formats you asked for.
diff --git a/docs/cli-usage_CN.md b/docs/cli-usage_CN.md
index 65ba2fe1..b0fd4362 100644
--- a/docs/cli-usage_CN.md
+++ b/docs/cli-usage_CN.md
@@ -603,7 +603,7 @@ pake ./my-app/index.html --name "my-app" --use-local-file
#### [config]
-用声明式 JSON 配置文件代替拼接命令行参数。字段名是 camelCase 的 CLI 选项名,外加 `url`;schema 见 [schema/pake.schema.json](../schema/pake.schema.json)。显式 CLI 参数始终优先于配置文件字段。未知字段与类型错误会立即报错。调用参数(`--json`、`--config`、`--version`)不允许写进配置文件。
+用声明式 JSON 配置文件代替拼接命令行参数。字段名是 camelCase 的 CLI 选项名,外加 `url`;schema 见 [schema/pake.schema.json](../schema/pake.schema.json)。显式 CLI 参数始终优先于配置文件字段。未知字段、类型错误与超出范围的数值会立即报错。相对路径形式的 `url` 相对当前工作目录解析,而非配置文件所在目录。调用参数(`--json`、`--config`、`--version`)不允许写进配置文件。
```shell
--config <path>
@@ -635,7 +635,7 @@ pake --config app.json
# {"ok":false, ..., "error":{"code":"ENV_MISSING","message":"...","hint":"..."}}
```
-退出码:`0` 成功、`2` 输入非法、`3` 构建失败、`4` 环境缺失或依赖安装失败(如未安装 Rust、依赖安装出错)、`1` 未预期错误。错误码:`INVALID_INPUT`、`ENV_MISSING`、`BUILD_FAILED`、`NETWORK`、`UNEXPECTED`。
+退出码:`0` 成功、`2` 输入非法、`3` 构建失败、`4` 环境缺失或依赖安装失败(如未安装 Rust、依赖安装出错)、`1` 未预期错误。错误码:`INVALID_INPUT`、`ENV_MISSING`、`BUILD_FAILED`、`UNEXPECTED`,另有 `NETWORK`(预留,当前版本的网络失败会按所处阶段归入 `ENV_MISSING` 或 `BUILD_FAILED`)。
Linux 多 target 构建(如 `--targets deb,appimage`)时,`ok` 为 true 不代表全部格式成功:单个 target 失败而其余成功会记入 `warnings`。请用 `outputs[].format` 核对拿到的格式是否齐全。
diff --git a/llms.txt b/llms.txt
index da73acd2..690d229a 100644
--- a/llms.txt
+++ b/llms.txt
@@ -13,8 +13,8 @@
- Always pass `--json` in automation: stdout carries exactly one JSON object `{ok, name, platform, arch, outputs: [{path, sizeBytes, format}], warnings, error: {code, message, hint} | null}`; all logs go to stderr; interactive prompts are disabled.
- Exit codes: 0 success, 2 invalid input, 3 build failure, 4 missing environment or dependency setup failure, 1 unexpected.
- On Linux multi-target builds, ok:true can carry fewer outputs than requested formats; failed targets land in warnings. Check outputs[].format.
-- Error codes: INVALID_INPUT, ENV_MISSING, BUILD_FAILED, NETWORK, UNEXPECTED. `error.hint` states how to fix.
-- Declarative config: `pake --config app.json --json`; fields are camelCase CLI option names plus `url`. Explicit CLI flags win over config fields. Unknown fields fail fast.
+- Error codes: INVALID_INPUT, ENV_MISSING, BUILD_FAILED, UNEXPECTED, plus NETWORK (reserved; current versions report network failures under the phase code, e.g. ENV_MISSING or BUILD_FAILED). `error.hint` states how to fix.
+- Declarative config: `pake --config app.json --json`; fields are camelCase CLI option names plus `url`. Explicit CLI flags win over config fields. Unknown fields fail fast. A relative `url` path resolves against the process working directory, not the config file's directory.
- Config schema: https://raw.githubusercontent.com/tw93/Pake/main/schema/pake.schema.json
## Docs
diff --git a/plugins/pake/skills/pake/SKILL.md b/plugins/pake/skills/pake/SKILL.md
index 24271a9f..3673111e 100644
--- a/plugins/pake/skills/pake/SKILL.md
+++ b/plugins/pake/skills/pake/SKILL.md
@@ -40,7 +40,7 @@ Exit codes: `0` success, `2` invalid input, `3` build failure, `4` missing envir
| `INVALID_INPUT` | Fix the flag, name, or config field named in `message`; `hint` states the accepted form |
| `ENV_MISSING` | Environment setup needed (usually Rust); relay `hint` to the user, or install and rerun |
| `BUILD_FAILED` | Rerun once with `--debug` for verbose logs; check platform notes below before changing anything |
-| `NETWORK` | Retry once; if it persists, ask about proxy/network before touching build options |
+| `NETWORK` | Reserved, not emitted today; network failures arrive as `ENV_MISSING` or `BUILD_FAILED` instead |
| `UNEXPECTED` | Report the message upstream; do not loop on retries |
On success, report `outputs[].path` to the user; that is the installer/bundle they need. On Linux multi-target builds, `ok: true` can carry fewer outputs than requested formats (failed targets land in `warnings`); check `outputs[].format` before declaring all formats built.