Skip to content

Commit e16f7d9

Browse files
committed
Add bilingual docs structure and CI checks
Reorganized documentation into locale-specific trees (`docs/en` and `docs/zh-Hans`), added a new English documentation set, and moved existing Chinese docs under `zh-Hans` with cross-language switch links. Updated root READMEs and `docs/README.md` to point to native CLI docs and separate legacy Dart CLI docs. Added a documentation GitHub Actions workflow plus `scripts/check_docs.py` to enforce locale parity, validate local markdown links, and require language-switch links in each page header.
1 parent 338f484 commit e16f7d9

69 files changed

Lines changed: 2416 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
paths:
7+
- "docs/**"
8+
- "README.md"
9+
- "README-ZH.md"
10+
- "scripts/check_docs.py"
11+
- ".github/workflows/docs.yml"
12+
pull_request:
13+
branches: [main, dev]
14+
paths:
15+
- "docs/**"
16+
- "README.md"
17+
- "README-ZH.md"
18+
- "scripts/check_docs.py"
19+
- ".github/workflows/docs.yml"
20+
21+
jobs:
22+
check:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Check localized documentation
27+
run: python3 scripts/check_docs.py

README-ZH.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
## 文档
3131

32-
完整文档请访问 [fastforge.dev](https://fastforge.dev/zh)
32+
- [Fastforge 原生 CLI 文档](docs/zh-Hans/README.md)
33+
- [旧版 Dart CLI 文档](https://fastforge.dev/zh)
3334

3435
## 主要特性
3536

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ English | [简体中文](./README-ZH.md)
3535

3636
## Documentation
3737

38-
Complete documentation is available at [fastforge.dev](https://fastforge.dev/).
38+
- [Native Fastforge CLI documentation](docs/en/README.md)
39+
- [Legacy Dart CLI documentation](https://fastforge.dev/)
3940

4041
## Key Features
4142

docs/README.md

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,6 @@
1-
# Fastforge CLI 文档
1+
# Fastforge CLI Documentation / Fastforge CLI 文档
22

3-
本目录记录 Fastforge 当前 CLI 的实际用法,内容以仓库中的命令实现、核心模块和安装脚本为准。
3+
Choose a language / 选择语言:
44

5-
旧版文档继续保留在 [`apps/docs`](../apps/docs/);本目录不会替换或修改旧版文档。
6-
7-
> [!IMPORTANT]
8-
> 当前 CLI 仍在持续完善。文档会区分“已经实现”和“暂未实现”的能力。若命令帮助与文档不一致,以 `fastforge <command> --help` 为准。
9-
10-
## 文档导航
11-
12-
### 指南
13-
14-
- [安装](installation.md):安装原生二进制、从源码安装和环境要求
15-
- [快速开始](getting-started.md):验证安装、打包项目和分析产物
16-
- [构建](building.md):构建命令、构建结果和构建器边界
17-
- [打包](packaging.md):打包流程、构建阶段和生命周期钩子
18-
- [发布](publishing.md):发布目标、参数和凭证
19-
- [本地工作流](workflows.md):发现、校验和运行 `.fastforge/workflows`
20-
- [CLI 参考](cli.md):顶层命令及参数速查
21-
22-
### 构建器
23-
24-
- [构建器总览](builders/README.md)
25-
- [Gradle](builders/gradle.md) · [Xcode](builders/xcode.md)
26-
- [Flutter Builder](builders/flutter.md) · [Custom Builder](builders/custom.md)
27-
28-
### 打包器
29-
30-
- [打包器总览](packagers/README.md)
31-
- [Android](packagers/android.md)[APK](packagers/android.md#apk) · [AAB](packagers/android.md#aab)
32-
- [iOS](packagers/ios.md)[IPA](packagers/ios.md#ipa)
33-
- [macOS](packagers/macos.md)[DMG](packagers/macos.md#dmg) · [PKG](packagers/macos.md#pkg) · [ZIP](packagers/macos.md#zip)
34-
35-
### 发布目标
36-
37-
- [发布器总览](publishers/README.md)
38-
- [S3 兼容存储](publishers/s3.md) · [fir.im](publishers/fir.md) · [Firebase](publishers/firebase.md)
39-
- [GitHub](publishers/github.md) · [App Store](publishers/appstore.md) · [AppGallery](publishers/appgallery.md)
40-
- [Vercel](publishers/vercel.md) · [Custom](publishers/custom.md)
41-
42-
### 商店与工具
43-
44-
- [商店管理](stores/README.md):App Store Connect、Google Play 和 catalog 同步
45-
- [应用包分析](tools/analyze.md):APK、AAB、IPA、DMG 与 `.app`
46-
47-
## 当前能力概览
48-
49-
| 能力 | 状态 | 入口 |
50-
| ------------------------ | -------------- | ----------------------------------- |
51-
| 应用包分析 | 已实现 | [Analyze](tools/analyze.md) |
52-
| Android、iOS、macOS 打包 | 部分实现 | [打包器总览](packagers/README.md) |
53-
| 构建器 | 部分实现 | [构建器总览](builders/README.md) |
54-
| 产物发布 | 已实现多个目标 | [发布器总览](publishers/README.md) |
55-
| 本地工作流 | 已实现 | [本地工作流](workflows.md) |
56-
| App Store Connect | 已实现 | [App Store](stores/appstore.md) |
57-
| Google Play Console | 已实现 | [Google Play](stores/googleplay.md) |
58-
| 多商店 catalog 同步 | 已实现 | [Catalog](stores/catalog.md) |
59-
| 自动升级 | 尚未实现 | `fastforge upgrade` 当前为空操作 |
60-
| 在线版本检查 | 尚未实现 | `version-check` 当前只打印本地版本 |
61-
62-
## 获取当前版本信息
63-
64-
```bash
65-
fastforge --version
66-
fastforge --help
67-
fastforge version-check --current-only
68-
```
5+
- [English](en/README.md)
6+
- [简体中文](zh-Hans/README.md)

docs/en/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Fastforge CLI Documentation
2+
3+
English | [简体中文](../zh-Hans/README.md)
4+
5+
This directory documents the actual behavior of the current Fastforge CLI. Its contents follow the command implementations, core modules, and installation scripts in this repository.
6+
7+
The legacy documentation remains in [`apps/docs`](../../apps/docs/). This directory does not replace or modify the legacy documentation.
8+
9+
> [!IMPORTANT]
10+
> The current CLI is still under active development. The documentation distinguishes between implemented and not-yet-implemented features. If the command help differs from the documentation, follow `fastforge <command> --help`.
11+
12+
## Documentation
13+
14+
### Guides
15+
16+
- [Installation](installation.md): install the native binary, build from source, and review environment requirements
17+
- [Getting Started](getting-started.md): verify the installation, package a project, and analyze artifacts
18+
- [Building](building.md): build commands, build results, and builder boundaries
19+
- [Packaging](packaging.md): the packaging process, build stage, and lifecycle hooks
20+
- [Publishing](publishing.md): publishing targets, parameters, and credentials
21+
- [Local Workflows](workflows.md): discover, validate, and run `.fastforge/workflows`
22+
- [CLI Reference](cli.md): top-level commands and options
23+
24+
### Builders
25+
26+
- [Builder overview](builders/README.md)
27+
- [Gradle](builders/gradle.md) · [Xcode](builders/xcode.md)
28+
- [Flutter Builder](builders/flutter.md) · [Custom Builder](builders/custom.md)
29+
30+
### Packagers
31+
32+
- [Packager overview](packagers/README.md)
33+
- [Android](packagers/android.md): [APK](packagers/android.md#apk) · [AAB](packagers/android.md#aab)
34+
- [iOS](packagers/ios.md): [IPA](packagers/ios.md#ipa)
35+
- [macOS](packagers/macos.md): [DMG](packagers/macos.md#dmg) · [PKG](packagers/macos.md#pkg) · [ZIP](packagers/macos.md#zip)
36+
37+
### Publishing Targets
38+
39+
- [Publisher overview](publishers/README.md)
40+
- [S3-compatible storage](publishers/s3.md) · [fir.im](publishers/fir.md) · [Firebase](publishers/firebase.md)
41+
- [GitHub](publishers/github.md) · [App Store](publishers/appstore.md) · [AppGallery](publishers/appgallery.md)
42+
- [Vercel](publishers/vercel.md) · [Custom](publishers/custom.md)
43+
44+
### Stores and Tools
45+
46+
- [Store management](stores/README.md): App Store Connect, Google Play, and catalog synchronization
47+
- [App package analysis](tools/analyze.md): APK, AAB, IPA, DMG, and `.app`
48+
49+
## Current Capabilities
50+
51+
| Capability | Status | Entry point |
52+
| ----------------------------- | ---------------------------- | ------------------------------------------------------- |
53+
| App package analysis | Implemented | [Analyze](tools/analyze.md) |
54+
| Android, iOS, macOS packaging | Partially implemented | [Packager overview](packagers/README.md) |
55+
| Builders | Partially implemented | [Builder overview](builders/README.md) |
56+
| Artifact publishing | Multiple targets implemented | [Publisher overview](publishers/README.md) |
57+
| Local workflows | Implemented | [Local workflows](workflows.md) |
58+
| App Store Connect | Implemented | [App Store](stores/appstore.md) |
59+
| Google Play Console | Implemented | [Google Play](stores/googleplay.md) |
60+
| Multi-store catalog sync | Implemented | [Catalog](stores/catalog.md) |
61+
| Automatic upgrades | Not implemented | `fastforge upgrade` is currently a no-op |
62+
| Online version checks | Not implemented | `version-check` currently prints only the local version |
63+
64+
## Get Current Version Information
65+
66+
```bash
67+
fastforge --version
68+
fastforge --help
69+
fastforge version-check --current-only
70+
```

docs/en/builders/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Builders
2+
3+
English | [简体中文](../../zh-Hans/builders/README.md)
4+
5+
Builders select a project's build tool, run the build command, and locate generated artifacts. Packagers consume build results; the two have distinct responsibilities.
6+
7+
## Current Builders
8+
9+
| Builder | Platforms or targets | CLI integration | Documentation |
10+
| -------------------- | ----------------------------------------------------- | ---------------------------------------------- | ----------------------------------------- |
11+
| Gradle Android | Android APK, AAB | Connected through `package` | [Gradle](gradle.md) |
12+
| Gradle Multiplatform | Android, desktop, iOS framework | No top-level CLI integration | [Gradle](gradle.md#multiplatform-builder) |
13+
| Xcode | iOS IPA, macOS `.app` | Connected to the `package` action | [Xcode](xcode.md) |
14+
| Flutter | Android, iOS, macOS, Windows, Linux, Web, OpenHarmony | Connected to `build`; `package` for macOS only | [Flutter Builder](flutter.md) |
15+
| Custom | User-defined commands and artifact rules | No top-level CLI integration | [Custom Builder](custom.md) |
16+
17+
“Implemented” and “connected to the CLI” are different states. A builder without a top-level entry point cannot be selected directly through `fastforge build`.
18+
19+
## Current Routing
20+
21+
`fastforge package` and the `fastforge/package` action select a build path based on the presence of `pubspec.yaml` in the project root and the value of `--platform`:
22+
23+
1. No `pubspec.yaml`, and the platform is `macos` or `ios`: select Xcode Builder.
24+
2. No `pubspec.yaml`, and the platform is `android`: select Gradle Builder.
25+
3. Otherwise, including every Flutter project with `pubspec.yaml`: select Flutter Builder.
26+
27+
> [!IMPORTANT]
28+
> The Flutter Builder path is currently connected only to the macOS `dmg`, `pkg`, and `zip` packagers. Running `fastforge package --platform android` or `--platform ios` in a Flutter project completes the build, then fails because the corresponding packager is not connected. Use `fastforge build` to generate the raw artifact instead.
29+
30+
The current detection rules are intentionally simple. Run commands from the actual project root to avoid selecting the wrong builder.
31+
32+
## Choosing an Entry Point
33+
34+
- Native Android Gradle projects: use `fastforge package` or the workflow package action.
35+
- Native iOS / macOS Xcode projects: use the workflow package action and pass project arguments through `build-args`.
36+
- Flutter projects packaging macOS formats: use `fastforge package`; for other platforms, generate raw artifacts with `fastforge build`.
37+
- Builders without CLI integration: continue to use the project's own build commands; do not assume the Fastforge CLI supports them yet.
38+
39+
See [Building](../building.md) for build commands and the result structure.

docs/en/builders/custom.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Custom Builder
2+
3+
English | [简体中文](../../zh-Hans/builders/custom.md)
4+
5+
Custom Builder runs any command and collects artifacts with glob rules. The module is implemented, but it is not yet connected to `fastforge build`, `fastforge package`, or a built-in workflow action.
6+
7+
## Builder Model
8+
9+
A custom build requires the following information:
10+
11+
| Parameter | Required | Description |
12+
| ------------------- | :------: | ------------------------------------------------------- |
13+
| `command` | Yes | Program or script to run |
14+
| `args` | No | A string or an array of strings |
15+
| `output-directory` | Yes | Artifact root directory |
16+
| `artifact-patterns` | Yes | Glob string or array relative to the artifact directory |
17+
18+
The build fails if the command returns a nonzero exit status or if it succeeds without matching any artifacts.
19+
20+
## Current Recommendation
21+
22+
Until the top-level CLI integration is complete, run custom builds as ordinary shell steps in a local workflow, then pass the artifact path to `fastforge publish`. Do not try to use a nonexistent `--platform custom` option.

docs/en/builders/flutter.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Flutter Builder
2+
3+
English | [简体中文](../../zh-Hans/builders/flutter.md)
4+
5+
Flutter Builder invokes the Flutter CLI from the project environment, builds for a platform, locates raw artifacts, and returns a normalized build result. The top-level `fastforge build` command currently uses this builder directly.
6+
7+
## Project Requirements
8+
9+
- Run from the root of a project containing `pubspec.yaml`
10+
- Install the Flutter SDK and make `flutter` available in `PATH`
11+
- Prepare the target platform SDK, signing configuration, and build tools
12+
13+
The builder reads `version` from `pubspec.yaml` and passes the version name and build number through `FLUTTER_BUILD_NAME` and `FLUTTER_BUILD_NUMBER` respectively.
14+
15+
## Platforms and Targets
16+
17+
| Platform | Target | Output |
18+
| --------- | ---------------- | -------------- |
19+
| `android` | `apk` | APK |
20+
| `android` | `aab` | AAB |
21+
| `ios` | `ipa` or omitted | IPA |
22+
| `macos` | May be omitted | `.app` |
23+
| `windows` | May be omitted | Windows bundle |
24+
| `linux` | May be omitted | Linux bundle |
25+
| `web` | May be omitted | Web directory |
26+
| `ohos` | `hap`, `app` | HAP or APP |
27+
28+
## Common Commands
29+
30+
```bash
31+
fastforge build --platform android --target apk
32+
fastforge build --platform web
33+
fastforge build --platform macos
34+
```
35+
36+
An iOS IPA requires export configuration:
37+
38+
```bash
39+
fastforge build --platform ios --target ipa \
40+
--build-export-options-plist ios/ExportOptions.plist
41+
```
42+
43+
You can also use `--build-export-method`.
44+
45+
## Build Options
46+
47+
| Fastforge option | Effect |
48+
| ------------------------------- | -------------------------------------- |
49+
| `--clean` | Clean before building |
50+
| `--build-target` | Use a custom entry point |
51+
| `--build-flavor` | Select a flavor |
52+
| `--build-target-platform` | Select target architectures |
53+
| `--build-export-options-plist` | Provide iOS export configuration |
54+
| `--build-export-method` | Select an iOS export method |
55+
| `--build-dart-define KEY=VALUE` | Compile-time variable; repeatable |
56+
| `--build-obfuscate` | Enable obfuscation |
57+
| `--build-split-debug-info` | Set the debug-symbol output directory |
58+
| `--build-tree-shake-icons` | Enable icon tree shaking |
59+
| `--build-profile` | Use Profile mode |
60+
| `--flutter-build-args` | Other build arguments, comma-separated |
61+
62+
Within `--flutter-build-args`, entries without an equals sign are treated as boolean switches, while `key=value` entries become key-value arguments. Do not use this option when a value itself contains a comma.
63+
64+
## Artifact Locations
65+
66+
| Platform | Default search location |
67+
| --------------- | --------------------------------------------- |
68+
| Android APK | `build/app/outputs/flutter-apk/` |
69+
| Android AAB | `build/app/outputs/bundle/` |
70+
| iOS | `build/ios/ipa/` |
71+
| macOS | `build/macos/Build/Products/` |
72+
| Windows | `build/windows/<arch>/runner/<mode>/` |
73+
| Linux | `build/linux/<arch>/<mode>/bundle/` |
74+
| Web | `build/web/` |
75+
| OpenHarmony HAP | `ohos/entry/build/<flavor>/outputs/<flavor>/` |
76+
| OpenHarmony APP | `ohos/build/outputs/<flavor>/` |
77+
78+
Fastforge reports a failure if the build command succeeds but no artifact is found in the expected directory.
79+
80+
## Relationship to Packagers
81+
82+
Flutter Builder can build all platforms listed above, but `fastforge package` currently connects only its macOS DMG, PKG, and ZIP paths. When a Flutter project runs `fastforge package` for another platform, the build completes normally and then fails with `Unsupported package target` because the matching packager is not connected. Use `fastforge build` to generate the raw artifact first.
83+
84+
## Host Restrictions
85+
86+
- iOS and macOS builds run only on macOS.
87+
- Windows builds run only on Windows.
88+
- Linux builds run only on Linux.
89+
- Android, Web, and OpenHarmony builders do not enforce a fixed host, but still require the relevant platform toolchains.

0 commit comments

Comments
 (0)