Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,31 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.1.0
- uses: actions/setup-node@v6.5.0
with:
node-version: 24
package-manager-cache: false

- name: Enable Corepack
run: corepack enable && corepack prepare yarn@4.18.0 --activate

- uses: calcit-lang/setup-calcit@704b3f5cd6f9ce3bd1e0c926dbdd1d181adb8180 # v1
- uses: calcit-lang/setup-calcit@v1.5.0
with:
tools: calcit,caps
caps-version: '0.1.1'
deps-file: deps.cirru

- name: Install dependencies
run: |
test ! -e compact.cirru
test ! -e package.cirru
caps --strict --ci
yarn install --immutable

Expand All @@ -36,13 +46,29 @@ jobs:
run: |
calcit calcit.cirru edit format
git diff --exit-code -- calcit.cirru
calcit calcit.cirru --check-only
calcit calcit.cirru analyze dynamic-methods --summary-only --format json | jq -e '.data.summary.findings == 0'
calcit --check-only --all-defs --format json
calcit --check-only --ns app.main --ns app.config --ns app.schema --ns app.updater --format json
calcit fix --workflow strict --verify --format json | jq -e '.data.workflow.status == "passed" and .diagnostics == []'
calcit analyze weak-types --only dynamic-method --summary-only --format json | jq -e '.data.summary.findings == 0'
calcit analyze weak-types --only deprecated-call --summary-only --format json | jq -e '.data.summary.calls == 0'

- name: Compile and build web app
env:
VITE_BASE_URL: ${{ github.event_name == 'pull_request' && './' || format('https://cos-sh.tiye.me/{0}/', github.repository) }}
run: |
calcit calcit.cirru js
yarn vite build --base=./
yarn build

- name: Upload and verify frontend resources on COS
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: worktools/cos-upload-action@v1.2.0
with:
source-dir: dist/assets
bucket: ${{ secrets.COS_BUCKET }}
region: ap-shanghai
prefix: ${{ github.repository }}/assets/
public-base-url: https://cos-sh.tiye.me/${{ github.repository }}/assets/
secret-id: ${{ secrets.COS_SECRET_ID }}
secret-key: ${{ secrets.COS_SECRET_KEY }}

- name: Install verified rsync
run: |
Expand Down Expand Up @@ -104,6 +130,17 @@ jobs:
- name: mdbook build
run: mdbook build && mv -v book/html/index.html book/html/mdbook.html

- name: Preserve PR preview for browser acceptance
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7.0.2
with:
name: respo-guidebook-preview
path: |
dist
book/html
if-no-files-found: error
retention-days: 7

- name: Deploy mdBook
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ book/

.DS_Store
.yarn/install-state.gz
.calcit/
2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
nodeLinker: node-modules
npmPreapprovedPackages:
- "@calcit/procs@0.20.0"
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@

## Calcit Guide Book
# Respo Guidebook

配对正式 Calcit CLI / `@calcit/procs` 0.30.1,以及已发布的 Docs Workflow 0.0.37、
Respo 0.16.124、Reel 0.6.41、UI 0.8.0 和 JS-FFI 0.2.5。升级后重新安装依赖并完整
刷新页面,不混用旧 CLI/alpha runtime。UI 0.8 基础样式可能影响外观。源码仅使用
`calcit.cirru` 与 `deps.cirru`,不生成 compact/package.cirru。

Guide 说明当前 Ref/watch、Option、widget/app dispatch、名义 Store 和宿主边界。
旧 Beginner Guide/API 仍有历史片段,尚未全部迁移或独立执行;站点构建通过不代表
所有旧示例都可用于当前版本。新应用以维护中的模板和已发布接口为准。

## 开发与验收

Node 24、Yarn 4.18.0、正式 0.30.1 CLI:

```bash
corepack enable
caps --strict --ci
yarn install --immutable
caps verify --toolchain
calcit --check-only --all-defs
calcit fix --workflow strict --verify
yarn dev
```

`yarn build` 默认使用相对资源路径,`VITE_BASE_URL` 可指定前端 CDN 根路径。CI
检查所有定义、公开 namespace、完整 strict、旧调用与动态方法,构建 SPA/mdBook
并保存 PR 预览。原项目没有定义附带测试,零个测试不等于业务覆盖;浏览器导航、
搜索与刷新需另行验收。页面 `hud!` 错误展示保留。

## 部署边界

生产 SPA 引用 `https://cos-sh.tiye.me/Respo/guidebook/` 下的静态 assets,COS 只用
action 内置校验,不新增脚本。原 SPA/mdBook 的 rsync 目录均保持
`/web-assets/repo/Respo/guidebook`,无服务端部署。本 PR 不自动合并或发版。
组织级 COS secrets 需要授权本仓库;PR 不读取部署凭据、不运行 COS 或 rsync。
原 SHA256 校验的 rsync/mdBook 安装、SSH 主机校验和 main 部署条件保留。

```bash
cargo install mdbook
cargo install mdbook-linkcheck

mdbook serve
mdbook build
```

### License
## License

MIT
2 changes: 1 addition & 1 deletion assets/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

@import url("@calcit/docs-workflow/assets/main.css");
@import url("../.calcit/modules/docs-workflow/assets/main.css");

p img {
max-width: 100%;
Expand Down
Loading