openxiangda 1.0.189 → 1.0.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +24 -0
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +25 -0
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +26 -0
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +37 -0
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +29 -0
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +34 -0
- package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/forms/** — Use openxiangda-form skill
|
|
3
|
+
globs: src/forms/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Form Files
|
|
8
|
+
|
|
9
|
+
Editing `src/forms/<formCode>/`. Use the **`openxiangda-form`** skill.
|
|
10
|
+
|
|
11
|
+
- Keep field/schema rules in `schema.ts` and presentation in `page.tsx`.
|
|
12
|
+
- Prefer OpenXiangda platform fields, then `antd` / `antd-mobile`; do not use native inputs, hand-written uploaders, pickers, or user/department selectors.
|
|
13
|
+
- Option fields require non-empty `options`; linked data uses `SelectField` with `optionSource.type: "linkedForm"`.
|
|
14
|
+
- Top-level `schema.rules` is only for `FormEffect[]`; validation belongs to field `rules`.
|
|
15
|
+
- Do not recreate platform system fields. Use `behavior: "HIDDEN"` + `valueSync` for derived or permission keys.
|
|
16
|
+
|
|
17
|
+
Release with exact scope:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
openxiangda resource plan form-setting --only <formCode> --profile <name>
|
|
21
|
+
openxiangda resource publish form-setting --only <formCode> --change <change> --profile <name>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Managed production activation only occurs through candidate → preproduction deploy/test → promotion of the same candidate.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/pages/** — Use openxiangda-page skill
|
|
3
|
+
globs: src/pages/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Page Files
|
|
8
|
+
|
|
9
|
+
Editing `src/pages/`. Use the **`openxiangda-page`** skill.
|
|
10
|
+
|
|
11
|
+
- Keep routes in `src/app/router.tsx` and navigation in `src/app/navigation.ts`.
|
|
12
|
+
- Split complex pages into thin views, `domain/`, `shared/{services,hooks}/`, `components/`, and styles.
|
|
13
|
+
- Use server pagination and structured `filterGroup`; never fetch an oversized page and filter in the browser.
|
|
14
|
+
- Prefer OpenXiangda platform components for platform data fields and `antd` / `antd-mobile` for ordinary UI.
|
|
15
|
+
- Do not use native form controls, hand-written pickers/uploaders, or frontend-only authorization.
|
|
16
|
+
|
|
17
|
+
Build and stage:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm typecheck
|
|
21
|
+
pnpm build
|
|
22
|
+
openxiangda runtime deploy --no-activate --change <change> --profile <name>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Managed production activation only occurs through candidate → preproduction deploy/test → promotion of the same candidate.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/{workflows,automations,js-code-nodes,functions}/** — Use openxiangda-workflow-automation skill
|
|
3
|
+
globs: src/{workflows,automations,js-code-nodes,functions}/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Workflow / Automation / Function Files
|
|
8
|
+
|
|
9
|
+
Use the **`openxiangda-workflow-automation`** skill for workflows, automations, JS_CODE, and App Functions.
|
|
10
|
+
|
|
11
|
+
- Ordinary lifecycle state changes use a status field, domain state machine, and automation; create workflows only for real approval semantics.
|
|
12
|
+
- Prefer App Functions for reusable backend logic. JS_CODE is for cross-form, batch, process, platform API, external HTTP, and complex orchestration.
|
|
13
|
+
- Keep UI interactions, normal validation, and display logic in React.
|
|
14
|
+
- Log important backend steps with `ctx.logger`; obtain third-party credentials only through declared `secretRefs`.
|
|
15
|
+
- Never copy workflow, automation, or function IDs across profiles.
|
|
16
|
+
|
|
17
|
+
Build and release with exact scope:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm typecheck:js-code
|
|
21
|
+
pnpm build-js-code --script <code>
|
|
22
|
+
openxiangda resource plan <workflow|automation|function> --only <code> --profile <name>
|
|
23
|
+
openxiangda resource publish <workflow|automation|function> --only <code> --change <change> --profile <name>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Managed production activation only occurs through candidate → preproduction deploy/test → promotion of the same candidate.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/forms/** glob — 精准引导到 openxiangda-form skill
|
|
3
|
+
glob: src/forms/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Form Files
|
|
8
|
+
|
|
9
|
+
You are editing files under `src/forms/<formCode>/`. Use the **`openxiangda-form`** skill.
|
|
10
|
+
|
|
11
|
+
## Required structure
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
src/forms/<formCode>/
|
|
15
|
+
├── schema.ts # defineFormSchema() default export
|
|
16
|
+
└── page.tsx # presentation only
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Common pitfalls
|
|
20
|
+
|
|
21
|
+
- 平台字段组件优先于 `antd` / `antd-mobile` 包装和自定义业务组件。
|
|
22
|
+
- `schema.ts` 定义字段、选项、规则与行为;`page.tsx` 只负责展示。
|
|
23
|
+
- 禁止直接写原生 `<input>` / `<select>` / `<textarea>` / file input,禁止手写人员、部门、上传和 picker 组件。
|
|
24
|
+
- 选项字段必须提供非空 `options`;跨表数据使用 `SelectField` + `optionSource.type: "linkedForm"`。
|
|
25
|
+
- 顶层 `schema.rules` 只用于 `FormEffect[]`;字段校验放字段自己的 `rules`。
|
|
26
|
+
- 平台系统字段由平台维护,不要重复创建。
|
|
27
|
+
- 派生键和隐式权限键使用 `behavior: "HIDDEN"` + `valueSync`。
|
|
28
|
+
|
|
29
|
+
## Release
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openxiangda resource validate form-setting --only <formCode> --profile <name>
|
|
33
|
+
openxiangda resource plan form-setting --only <formCode> --profile <name>
|
|
34
|
+
openxiangda resource publish form-setting --only <formCode> --change <change> --profile <name>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
正式环境托管发布仍必须走 candidate → preproduction deploy/test → 同 candidate promotion,禁止直接激活生产资源。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/pages/** glob — 精准引导到 openxiangda-page skill
|
|
3
|
+
glob: src/pages/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Page Files
|
|
8
|
+
|
|
9
|
+
You are editing files under `src/pages/`. Use the **`openxiangda-page`** skill.
|
|
10
|
+
|
|
11
|
+
## Strong defaults
|
|
12
|
+
|
|
13
|
+
- 路由集中维护在 `src/app/router.tsx`,应用导航维护在 `src/app/navigation.ts`。
|
|
14
|
+
- 复杂页面拆分为薄视图、`domain/`、`shared/{services,hooks}/`、`components/` 和样式文件。
|
|
15
|
+
- 默认使用原生 Tailwind utilities,不使用未配置的 shadcn token。
|
|
16
|
+
- 列表必须服务端分页并使用结构化 `filterGroup`;禁止抓取超大页后在浏览器过滤。
|
|
17
|
+
- 平台数据字段优先使用 OpenXiangda 平台组件;普通 UI 使用 `antd` / `antd-mobile`。
|
|
18
|
+
- 禁止原生表单控件、手写 picker/uploader/人员部门选择器。
|
|
19
|
+
- 后端权限、公开访问 grants 与 App Function 检查才是授权依据;前端只做展示保护。
|
|
20
|
+
|
|
21
|
+
## Release
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm typecheck
|
|
25
|
+
pnpm build
|
|
26
|
+
openxiangda runtime deploy --no-activate --change <change> --profile <name>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Runtime 只暂存到候选发布;正式环境托管发布必须走 candidate → preproduction deploy/test → 同 candidate promotion。
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: src/{workflows,automations,js-code-nodes,functions}/** glob — 精准引导到 openxiangda-workflow-automation skill
|
|
3
|
+
glob: src/{workflows,automations,js-code-nodes,functions}/**/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OpenXiangda React SPA Workflow / Automation / Function Files
|
|
8
|
+
|
|
9
|
+
Use the **`openxiangda-workflow-automation`** skill when editing:
|
|
10
|
+
|
|
11
|
+
- `src/workflows/<code>/workflow.ts`
|
|
12
|
+
- `src/automations/<code>/index.ts`
|
|
13
|
+
- `src/js-code-nodes/<code>/index.ts`
|
|
14
|
+
- `src/functions/<code>/index.ts`
|
|
15
|
+
|
|
16
|
+
## Boundaries
|
|
17
|
+
|
|
18
|
+
- 普通 `pending → processing → resolved → closed` 使用状态字段、领域状态机与 automation;只有真实审批语义才创建 workflow。
|
|
19
|
+
- 复用后端业务逻辑优先 App Function;JS_CODE 用于跨表、批量、流程、平台 API、外部 HTTP 与复杂编排。
|
|
20
|
+
- UI 交互、普通表单校验和展示逻辑留在 React 代码,不放进 JS_CODE。
|
|
21
|
+
- 每个关键步骤使用 `ctx.logger.debug/info/warn/error`;第三方凭据只通过 `secretRefs` 与 `ctx.secrets.get()` 获取。
|
|
22
|
+
- workflowId / automationId / functionId 不得跨 profile 复制。
|
|
23
|
+
|
|
24
|
+
## Build and release
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm typecheck:js-code
|
|
28
|
+
pnpm build-js-code --script <code>
|
|
29
|
+
openxiangda resource validate <workflow|automation|function> --only <code> --profile <name>
|
|
30
|
+
openxiangda resource plan <workflow|automation|function> --only <code> --profile <name>
|
|
31
|
+
openxiangda resource publish <workflow|automation|function> --only <code> --change <change> --profile <name>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
资源发布只生成候选子版本;正式环境托管发布必须走 candidate → preproduction deploy/test → 同 candidate promotion。
|
|
@@ -9,7 +9,7 @@ const lines = [
|
|
|
9
9
|
' openxiangda resource publish <type> --only <codes> --change <change> --profile <name>',
|
|
10
10
|
' openxiangda runtime deploy --no-activate --change <change> --profile <name>',
|
|
11
11
|
'',
|
|
12
|
-
'
|
|
12
|
+
'发布前必须先把批准的提交合并并 push 到权威主线;激活后直接执行 release integration-status 与 release end。',
|
|
13
13
|
'',
|
|
14
14
|
'legacy lowcode-workspace publish-all 只用于旧 classic workspace 的兼容流程。',
|
|
15
15
|
'',
|