openyida 2026.8.3 → 2026.8.5
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/README.md +10 -16
- package/bin/yida.js +11 -7
- package/docs/capabilities.md +2 -3
- package/lib/app/canvas-compile.js +237 -0
- package/lib/app/create-form.js +14 -228
- package/lib/app/form-detail-link-guard.js +200 -0
- package/lib/app/form-detail-style.js +476 -0
- package/lib/app/form-open-guard.js +222 -0
- package/lib/app/form-theme-action.js +439 -0
- package/lib/app/jsx-text-guard.js +69 -0
- package/lib/app/page-linter.js +69 -5
- package/lib/app/page-richness-guard.js +108 -0
- package/lib/app/services/canvas-page-schema-builder.js +82 -2
- package/lib/app/services/form-compiler.js +11 -0
- package/lib/auth/oauth-loopback.js +95 -19
- package/lib/bridge/bridge.js +3 -3
- package/lib/core/agent-capabilities.js +35 -35
- package/lib/core/command-manifest.js +20 -14
- package/lib/core/locales/en.js +13 -6
- package/lib/core/locales/zh.js +14 -7
- package/lib/core/sample.js +3 -34
- package/lib/integration/integration-process-builder.js +1 -1
- package/lib/integration/integration-spec-builder.js +2 -2
- package/lib/integration/integration-view-builder.js +1 -1
- package/lib/samples/yida-create-app/ipd-app-template.js +1 -1
- package/package.json +1 -1
- package/scripts/build-skills-package.js +16 -34
- package/scripts/postinstall.js +13 -12
- package/yida-skills/SKILL.md +30 -28
- package/yida-skills/references/development-rules.md +5 -4
- package/yida-skills/references/field-and-url-reference.md +5 -3
- package/yida-skills/references/task-retrospective.md +28 -28
- package/yida-skills/skills/yida-app/SKILL.md +113 -108
- package/yida-skills/skills/yida-app/references/app-build-contract.md +61 -179
- package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +40 -102
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-authoring-examples.md +4 -3
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-style-implementation-guide.md +421 -0
- package/yida-skills/skills/yida-canvas-custom-page/references/component-library-guide.md +37 -18
- package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +29 -11
- package/yida-skills/skills/yida-canvas-custom-page/references/dependencies-and-cdn.md +1 -0
- package/yida-skills/skills/yida-canvas-custom-page/references/native-components-bridge.md +2 -11
- package/yida-skills/skills/yida-canvas-custom-page/references/navigation-and-entry-guide.md +166 -13
- package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +114 -43
- package/yida-skills/skills/yida-canvas-custom-page/references/theme-runtime-helpers.md +177 -0
- package/yida-skills/skills/yida-canvas-data-binding/SKILL.md +52 -46
- package/yida-skills/skills/yida-canvas-table-form/SKILL.md +5 -6
- package/yida-skills/skills/yida-canvas-upgrade/SKILL.md +1 -1
- package/yida-skills/skills/yida-chart/SKILL.md +2 -2
- package/yida-skills/skills/yida-chart/references/echarts-code-template.md +1 -1
- package/yida-skills/skills/yida-create-app/SKILL.md +13 -20
- package/yida-skills/skills/yida-create-form-page/SKILL.md +15 -7
- package/yida-skills/skills/yida-create-form-page/references/form-field-properties.md +3 -3
- package/yida-skills/skills/yida-create-page/SKILL.md +2 -2
- package/yida-skills/skills/yida-custom-page/SKILL.md +28 -35
- package/yida-skills/skills/yida-custom-page/references/assets-guide.md +6 -22
- package/yida-skills/skills/yida-custom-page/references/attachment-upload-guide.md +1 -1
- package/yida-skills/skills/yida-custom-page/references/coding-guide.md +55 -4
- package/yida-skills/skills/yida-custom-page/references/design-system.md +22 -38
- package/yida-skills/skills/yida-dashboard/SKILL.md +10 -13
- package/yida-skills/skills/yida-dashboard/references/structure-and-layout.md +2 -2
- package/yida-skills/skills/yida-dashboard/references/theme-presets.md +1 -1
- package/yida-skills/skills/yida-data-management/SKILL.md +16 -6
- package/yida-skills/skills/yida-density/SKILL.md +2 -2
- package/yida-skills/skills/yida-design/SKILL.md +98 -0
- package/yida-skills/skills/yida-design/references/app/blueprint.md +61 -0
- package/yida-skills/skills/{yida-page-uiux → yida-design}/references/asset-workflow.md +16 -16
- package/yida-skills/skills/yida-design/references/page-quality-gates.md +125 -0
- package/yida-skills/skills/yida-design/references/style-design-selection.md +118 -0
- package/yida-skills/skills/yida-design/references/style-designs/_design-md-template.md +185 -0
- package/yida-skills/skills/yida-design/references/style-designs/aqua-service-progress-dashboard.md +242 -0
- package/yida-skills/skills/yida-design/references/style-designs/blue-insight-operations-dashboard.md +243 -0
- package/yida-skills/skills/yida-design/references/style-designs/blue-productivity-insight-workbench.md +242 -0
- package/yida-skills/skills/yida-design/references/style-designs/command-filter-card-console.md +304 -0
- package/yida-skills/skills/yida-design/references/style-designs/contrast-command-analytics-workbench.md +261 -0
- package/yida-skills/skills/yida-design/references/style-designs/dark-stage-analytic-dashboard.md +369 -0
- package/yida-skills/skills/yida-design/references/style-designs/filterable-card-catalog.md +354 -0
- package/yida-skills/skills/yida-design/references/style-designs/green-timeline-progress-workbench.md +250 -0
- package/yida-skills/skills/yida-design/references/style-designs/registry.md +91 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-analytic-workbench.md +348 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-blue-grid-analytic-dashboard.md +658 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-bordered-analytic-workbench.md +385 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-curated-filter-gallery.md +300 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-modular-analytic-workbench.md +404 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-progress-analytics-workbench.md +382 -0
- package/yida-skills/skills/yida-design/references/style-designs/soft-timeline-analytics-workbench.md +367 -0
- package/yida-skills/skills/yida-design/references/style-designs/teal-rail-analytics-workbench.md +341 -0
- package/yida-skills/skills/yida-design/references/theme/theme-token-presets.md +394 -0
- package/yida-skills/skills/{yida-page-uiux → yida-design}/references/visual-decision-engine.md +7 -7
- package/yida-skills/skills/yida-design/references/visual-scaffold-recipes.md +191 -0
- package/yida-skills/skills/yida-design/sub_skill/page-design/SKILL.md +57 -0
- package/yida-skills/skills/yida-design/workflow/output-design.md +391 -0
- package/yida-skills/skills/yida-design/workflow/output-prd.md +178 -0
- package/yida-skills/skills/yida-design/workflow/step-1-positioning.md +58 -0
- package/yida-skills/skills/yida-design/workflow/step-2-theme-system.md +111 -0
- package/yida-skills/skills/yida-design/workflow/step-3-information-architecture.md +70 -0
- package/yida-skills/skills/yida-design/workflow/step-4-wireframe-interaction.md +52 -0
- package/yida-skills/skills/yida-design/workflow/step-5-visual-states.md +118 -0
- package/yida-skills/skills/yida-design/workflow/step-6-handoff.md +62 -0
- package/yida-skills/skills/yida-flash-note-to-prd/SKILL.md +8 -8
- package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prd-template.md +1 -1
- package/yida-skills/skills/yida-form-detail/SKILL.md +35 -36
- package/yida-skills/skills/yida-form-detail/references/injection-guide.md +43 -121
- package/yida-skills/skills/yida-get-schema/SKILL.md +1 -1
- package/yida-skills/skills/yida-integration/references/integration-node-schemas.md +1 -1
- package/yida-skills/skills/yida-nav-group/SKILL.md +5 -4
- package/yida-skills/skills/yida-nav-shell/SKILL.md +2 -2
- package/yida-skills/skills/yida-nav-shell/references/nav-shell-patterns.md +3 -3
- package/yida-skills/skills/yida-ppt-slider/references/dark-tech-theme.md +1 -1
- package/yida-skills/skills/yida-process-rule/references/examples.md +6 -6
- package/yida-skills/skills/yida-process-rule/references/process-ai-rules.md +3 -3
- package/yida-skills/skills/yida-publish-page/SKILL.md +2 -2
- package/yida-skills/skills/yida-rechart/SKILL.md +5 -8
- package/yida-skills/skills/yida-report/SKILL.md +6 -6
- package/yida-skills/skills/yida-table-form/SKILL.md +2 -15
- package/yida-skills/skills-index.json +106 -97
- package/lib/app/generate-page.js +0 -819
- package/lib/app/page-ir.js +0 -1680
- package/lib/samples/yida-canvas-custom-page/business-list.canvas.jsx +0 -741
- package/lib/samples/yida-canvas-custom-page/dashboard-overview.canvas.jsx +0 -782
- package/lib/samples/yida-canvas-custom-page/dashboard-starter.canvas.jsx +0 -389
- package/lib/samples/yida-canvas-custom-page/data-management.canvas.jsx +0 -1397
- package/lib/samples/yida-canvas-custom-page/data-screen.canvas.jsx +0 -1117
- package/lib/samples/yida-canvas-custom-page/detail-profile.canvas.jsx +0 -421
- package/lib/samples/yida-canvas-custom-page/native-components-smoke.canvas.jsx +0 -786
- package/lib/samples/yida-canvas-custom-page/official-homepage.canvas.jsx +0 -936
- package/lib/samples/yida-canvas-custom-page/portal-native-components.canvas.jsx +0 -1273
- package/lib/samples/yida-canvas-custom-page/portal-shell-home.canvas.jsx +0 -489
- package/lib/samples/yida-canvas-custom-page/product-homepage.canvas.jsx +0 -777
- package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +0 -616
- package/lib/samples/yida-canvas-custom-page/todo-mvc.canvas.jsx +0 -614
- package/lib/samples/yida-canvas-custom-page/workbench-home.canvas.jsx +0 -692
- package/lib/samples/yida-custom-page/business-list.oyd.jsx +0 -443
- package/lib/samples/yida-custom-page/custom-page-template.js +0 -842
- package/lib/samples/yida-custom-page/dashboard-overview.oyd.jsx +0 -327
- package/lib/samples/yida-custom-page/data-management.oyd.jsx +0 -274
- package/lib/samples/yida-custom-page/data-screen.oyd.jsx +0 -348
- package/lib/samples/yida-custom-page/design-tokens.js +0 -262
- package/lib/samples/yida-custom-page/detail-profile.oyd.jsx +0 -241
- package/lib/samples/yida-custom-page/official-homepage.oyd.jsx +0 -218
- package/lib/samples/yida-custom-page/portal-shell-home.oyd.jsx +0 -268
- package/lib/samples/yida-custom-page/product-homepage.jsx +0 -752
- package/lib/samples/yida-custom-page/split-pane-detail.oyd.jsx +0 -245
- package/lib/samples/yida-custom-page/todo-mvc.oyd.jsx +0 -901
- package/lib/samples/yida-custom-page/workbench-home.oyd.jsx +0 -707
- package/project/prd/demo-birthday-game.md +0 -48
- package/project/prd/demo-crm.md +0 -463
- package/project/prd/demo-dingtalk-ai-solution-center.md +0 -425
- package/project/prd/demo-future-vision-2026.md +0 -78
- package/project/prd/demo-salary-calculator.md +0 -101
- package/yida-skills/skills/yida-app/references/ui-guidance-by-mode.md +0 -77
- package/yida-skills/skills/yida-app-uiux/SKILL.md +0 -97
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-design-system.md +0 -276
- package/yida-skills/skills/yida-page-uiux/SKILL.md +0 -154
- package/yida-skills/skills/yida-page-uiux/references/app/blueprint.md +0 -20
- package/yida-skills/skills/yida-page-uiux/references/dashboard/app-blueprint.md +0 -18
- package/yida-skills/skills/yida-page-uiux/references/dashboard/chart-contracts.md +0 -17
- package/yida-skills/skills/yida-page-uiux/references/dashboard/component-contracts.md +0 -18
- package/yida-skills/skills/yida-page-uiux/references/dashboard/layout-patterns.md +0 -31
- package/yida-skills/skills/yida-page-uiux/references/dashboard/theme-recipes.md +0 -23
- package/yida-skills/skills/yida-page-uiux/references/detail/object-narrative.md +0 -18
- package/yida-skills/skills/yida-page-uiux/references/detail/section-patterns.md +0 -15
- package/yida-skills/skills/yida-page-uiux/references/detail/timeline-and-related.md +0 -17
- package/yida-skills/skills/yida-page-uiux/references/landing/assets-workflow.md +0 -25
- package/yida-skills/skills/yida-page-uiux/references/landing/industry-playbooks.md +0 -25
- package/yida-skills/skills/yida-page-uiux/references/landing/realistic-brand-homepage.md +0 -82
- package/yida-skills/skills/yida-page-uiux/references/landing/research-levels.md +0 -10
- package/yida-skills/skills/yida-page-uiux/references/landing/section-patterns.md +0 -16
- package/yida-skills/skills/yida-page-uiux/references/list/drawer-detail.md +0 -18
- package/yida-skills/skills/yida-page-uiux/references/list/empty-loading-error.md +0 -17
- package/yida-skills/skills/yida-page-uiux/references/list/filter-patterns.md +0 -15
- package/yida-skills/skills/yida-page-uiux/references/list/table-patterns.md +0 -13
- package/yida-skills/skills/yida-page-uiux/references/scenes/dashboard.md +0 -128
- package/yida-skills/skills/yida-page-uiux/references/scenes/detail.md +0 -79
- package/yida-skills/skills/yida-page-uiux/references/scenes/landing.md +0 -112
- package/yida-skills/skills/yida-page-uiux/references/scenes/list.md +0 -78
- package/yida-skills/skills/yida-page-uiux/references/scenes/screen.md +0 -36
- package/yida-skills/skills/yida-page-uiux/references/scenes/workbench.md +0 -77
- package/yida-skills/skills/yida-page-uiux/references/workbench/entry-patterns.md +0 -20
- package/yida-skills/skills/yida-page-uiux/references/workbench/portal-layouts.md +0 -19
- package/yida-skills/skills/yida-page-uiux/references/workbench/task-feed.md +0 -20
- package/yida-skills/skills/yida-page-uiux/workflow/output-decision-block.md +0 -111
- package/yida-skills/skills/yida-page-uiux/workflow/step-0-nav-shape.md +0 -43
- package/yida-skills/skills/yida-page-uiux/workflow/step-1-page-type.md +0 -42
- package/yida-skills/skills/yida-page-uiux/workflow/step-2-intent-decode.md +0 -25
- package/yida-skills/skills/yida-page-uiux/workflow/step-3-scene-routing.md +0 -49
- package/yida-skills/skills/yida-page-uiux/workflow/step-4-visual-decision.md +0 -56
- package/yida-skills/skills/yida-page-uiux/workflow/step-5-icon-and-assets.md +0 -36
- package/yida-skills/skills/yida-page-uiux/workflow/step-6-deai-selfcheck.md +0 -40
- package/yida-skills/skills/yida-theme/SKILL.md +0 -232
- package/yida-skills/skills/yida-theme/references/theme-token-presets.md +0 -135
- /package/yida-skills/skills/{yida-page-uiux → yida-design}/references/app/navigation-patterns.md +0 -0
- /package/yida-skills/skills/{yida-page-uiux → yida-design}/references/app/role-journey.md +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
OpenYida connects AI coding agents with Yida's low-code platform, so developers can create apps, forms, workflows, custom pages, reports, integrations, and deployment configuration from a normal chat-driven development workflow.
|
|
10
10
|
|
|
11
|
-
[Quick Start](#quick-start) · [Capabilities](#capabilities) · [Full Capability List](./docs/capabilities.md) · [CLI Reference](#cli-reference) · [Examples](#examples) · [Contributing](./CONTRIBUTING.md) · [Changelog](./CHANGELOG.md)
|
|
11
|
+
[Quick Start](#quick-start) · [Help Center](https://xmtrf1.aliwork.com/o/openyida/help?lang=en) · [Capabilities](#capabilities) · [Full Capability List](./docs/capabilities.md) · [CLI Reference](#cli-reference) · [Examples](#examples) · [Contributing](./CONTRIBUTING.md) · [Changelog](./CHANGELOG.md)
|
|
12
12
|
|
|
13
13
|
[](https://www.npmjs.com/package/openyida)
|
|
14
14
|
[](https://www.npmjs.com/package/openyida)
|
|
@@ -16,7 +16,7 @@ OpenYida connects AI coding agents with Yida's low-code platform, so developers
|
|
|
16
16
|
[](./LICENSE)
|
|
17
17
|
[](https://nodejs.org)
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
**Help Center:** [简体中文](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh) · [繁體中文(中國台灣)](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh-Hant) · [繁體中文(中國香港)](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh-HK) · [English](https://xmtrf1.aliwork.com/o/openyida/help?lang=en) · [日本語](https://xmtrf1.aliwork.com/o/openyida/help?lang=ja) · [한국어](https://xmtrf1.aliwork.com/o/openyida/help?lang=ko) · [Tiếng Việt](https://xmtrf1.aliwork.com/o/openyida/help?lang=vi) · [ไทย](https://xmtrf1.aliwork.com/o/openyida/help?lang=th) · [Bahasa Indonesia](https://xmtrf1.aliwork.com/o/openyida/help?lang=id) · [Bahasa Melayu](https://xmtrf1.aliwork.com/o/openyida/help?lang=ms) · [Français](https://xmtrf1.aliwork.com/o/openyida/help?lang=fr) · [Português](https://xmtrf1.aliwork.com/o/openyida/help?lang=pt) · [Türkçe](https://xmtrf1.aliwork.com/o/openyida/help?lang=tr) · [Español](https://xmtrf1.aliwork.com/o/openyida/help?lang=es) · [Русский](https://xmtrf1.aliwork.com/o/openyida/help?lang=ru)
|
|
20
20
|
|
|
21
21
|
[English README](./README.md) · [简体中文 README](./README_zhCN.md)
|
|
22
22
|
|
|
@@ -155,7 +155,7 @@ openyida/
|
|
|
155
155
|
│ ├── core/ # Environment detection, i18n, diagnostics, data commands
|
|
156
156
|
│ ├── process/ # Process form creation, configuration, preview
|
|
157
157
|
│ ├── report/ # Yida report and chart generation
|
|
158
|
-
│ └── samples/ #
|
|
158
|
+
│ └── samples/ # Sample skeletons emitted by openyida sample
|
|
159
159
|
├── project/ # Default workspace template for generated Yida projects
|
|
160
160
|
├── yida-skills/ # Source skill docs and Yida API references
|
|
161
161
|
└── scripts/ # CI, packaging, and installation helpers
|
|
@@ -185,22 +185,14 @@ Form definitions support 19 business field types plus verified presentation/layo
|
|
|
185
185
|
|
|
186
186
|
```bash
|
|
187
187
|
openyida create-page APP_XXX "Dashboard" --mode dashboard
|
|
188
|
-
openyida
|
|
189
|
-
openyida
|
|
190
|
-
openyida generate-page data-screen --theme-profile yida-app-theme --output pages/src/data-screen.canvas.jsx --compile
|
|
191
|
-
openyida generate-page split-pane-detail --theme-profile yida-app-theme --output pages/src/split-pane-detail.canvas.jsx --compile
|
|
192
|
-
openyida generate-page portal-shell-home --theme-profile yida-app-theme --output pages/src/portal-shell-home.canvas.jsx --compile
|
|
193
|
-
openyida sample yida-canvas-custom-page dashboard-starter --output pages/src/dashboard-starter.canvas.jsx
|
|
194
|
-
openyida sample yida-canvas-custom-page native-components-smoke --output pages/src/native-components-smoke.canvas.jsx
|
|
195
|
-
openyida sample yida-canvas-custom-page portal-native-components --output pages/src/portal-native-components.canvas.jsx
|
|
196
|
-
openyida generate-page todo-mvc --output pages/src/todo-mvc.canvas.jsx --compile
|
|
188
|
+
openyida check-page pages/src/home.canvas.jsx --json
|
|
189
|
+
openyida compile pages/src/home.canvas.jsx
|
|
197
190
|
openyida publish pages/src/home.canvas.jsx APP_XXX FORM_XXX
|
|
198
191
|
```
|
|
199
192
|
|
|
200
|
-
|
|
201
|
-
Built-in templates currently include `official-homepage` for brand/law-firm/product official sites, `data-screen` for immersive monitoring screens, `dashboard-overview` for business dashboards, `workbench-home` for task/entry workbenches, `business-list` for list management pages, `detail-profile` for single-object detail pages, `split-pane-detail` for left-list/right-detail processing consoles, `portal-shell-home` for in-page portal shells, `native-components-smoke` for runtime probing existing Yida host components through `window.Deep` / `window.DeepYida`, `portal-native-components` for runtime-bridged portal, member, department, and upload components, `product-homepage` for legacy workbench-style pages, and `todo-mvc` for a full interaction smoke page covering events, custom state, list rendering, editing, filtering, and localStorage persistence.
|
|
193
|
+
Custom page source is authored directly from PRD and design guidance. Code Canvas is the default output (`.canvas.jsx`); use `.oyd.jsx` only when the page must use the 普通自定义页面 JSX/Jsx 组件链路.
|
|
202
194
|
|
|
203
|
-
For member, department, attachment, and image upload components, choose the page chain first. Code Canvas pages should
|
|
195
|
+
For member, department, attachment, and image upload components, choose the page chain first. Code Canvas pages should follow `yida-canvas-custom-page/references/native-components-bridge.md` for feature detection, fallback, and value normalization. 普通自定义页面 JSX/Jsx pages should use `.oyd.jsx`, read `yida-custom-page/references/component-jsx-guide.md`, and read `attachment-upload-guide.md` when upload fields are involved.
|
|
204
196
|
|
|
205
197
|
### Workflow, Data, and Permissions
|
|
206
198
|
|
|
@@ -401,13 +393,15 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
401
393
|
| `openyida get-schema <appType> <formUuid\|--all> [--summary-json\|--field-map-json]` | Get one form Schema or all form Schemas |
|
|
402
394
|
| `openyida er <appType> [--format mermaid\|json] [--output file] [--include-system] [--include-pages]` | Export app entity relationship diagram |
|
|
403
395
|
| `openyida create-page <appType> "<name>" [--mode dashboard] [--hide-nav] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a custom display page |
|
|
404
|
-
| `openyida generate-page <template>` | Generate page from curated template |
|
|
405
396
|
| `openyida build-page <sourceFile> [--output file\|--write]` | Build Yida-compatible page source |
|
|
406
397
|
| `openyida check-page <src> [--compat]` | Check custom page standards |
|
|
407
398
|
| `openyida compile <src>` | Compile custom page locally |
|
|
408
399
|
| `openyida publish <src> <appType> <formUuid> [--health-check] [--force] [--canvas] [--auto-nav-order] [--open\|--no-open]` | Compile and publish custom page |
|
|
409
400
|
| `openyida update-form-config <appType> ...` | Update form configuration |
|
|
410
401
|
| `openyida get-form-config <appType> <formUuid> [--json]` | Query form configuration |
|
|
402
|
+
| `openyida form-detail-style apply <appType> <formUuid> [--css file\|--preset clean-card] [--json]` | Manage form detail page style |
|
|
403
|
+
| `openyida form-detail-style remove <appType> <formUuid> [--json]` | Manage form detail page style |
|
|
404
|
+
| `openyida form-detail-style check <appType> <formUuid> [--json]` | Manage form detail page style |
|
|
411
405
|
|
|
412
406
|
### Data & Permissions
|
|
413
407
|
|
package/bin/yida.js
CHANGED
|
@@ -35,11 +35,15 @@ function isAgentEnvironment(env) {
|
|
|
35
35
|
env.QODER_IDE ||
|
|
36
36
|
env.QODER_AGENT ||
|
|
37
37
|
env.QODERCLI_INTEGRATION_MODE ||
|
|
38
|
+
env.QWENWORK_INTEGRATION_MODE ||
|
|
39
|
+
env.QWENWORKCN_INTEGRATION_MODE ||
|
|
38
40
|
env.CURSOR_TRACE_ID ||
|
|
39
41
|
env.AGENT_WORK_ROOT ||
|
|
40
42
|
env.OPENYIDA_AGENT_MODE ||
|
|
41
43
|
(env.__CFBundleIdentifier || '').toLowerCase().includes('codex') ||
|
|
42
|
-
(env.__CFBundleIdentifier || '').toLowerCase().includes('qoder')
|
|
44
|
+
(env.__CFBundleIdentifier || '').toLowerCase().includes('qoder') ||
|
|
45
|
+
(env.__CFBundleIdentifier || '').toLowerCase().includes('qwenwork') ||
|
|
46
|
+
(env.__CFBundleIdentifier || '').toLowerCase().includes('qwen-work')
|
|
43
47
|
);
|
|
44
48
|
}
|
|
45
49
|
|
|
@@ -746,12 +750,6 @@ async function main() {
|
|
|
746
750
|
break;
|
|
747
751
|
}
|
|
748
752
|
|
|
749
|
-
case 'generate-page': {
|
|
750
|
-
const { run } = require('../lib/app/generate-page');
|
|
751
|
-
await run(args);
|
|
752
|
-
break;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
753
|
case 'build-page': {
|
|
756
754
|
const { run } = require('../lib/app/build-page');
|
|
757
755
|
await run(args);
|
|
@@ -828,6 +826,12 @@ async function main() {
|
|
|
828
826
|
break;
|
|
829
827
|
}
|
|
830
828
|
|
|
829
|
+
case 'form-detail-style': {
|
|
830
|
+
const { run: runFormDetailStyle } = require('../lib/app/form-detail-style');
|
|
831
|
+
await runFormDetailStyle(args);
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
|
|
831
835
|
case 'update-app': {
|
|
832
836
|
if (args.length < 2) {
|
|
833
837
|
throwCliUsage(t('cli.update_app_usage'), t('cli.update_app_example'));
|
package/docs/capabilities.md
CHANGED
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
|---|---|
|
|
63
63
|
| 创建自定义页面 | `openyida create-page <appType> "<页面名称>"` |
|
|
64
64
|
| 创建看板页 | `openyida create-page <appType> "<页面名称>" --mode dashboard` |
|
|
65
|
-
| 从模板生成页面源码 | `openyida generate-page <template>` |
|
|
66
65
|
| 构建宜搭兼容页面源码 | `openyida build-page <sourceFile> [--output file\|--write]` |
|
|
67
66
|
| 检查普通自定义页面 JSX 规范 | `openyida check-page <src> [--compat]` |
|
|
68
67
|
| 本地编译普通自定义页面 JSX | `openyida compile <src>` |
|
|
@@ -73,8 +72,8 @@
|
|
|
73
72
|
| 更新页面/表单配置 | `openyida update-form-config <appType> ...` |
|
|
74
73
|
| 查询页面/表单配置 | `openyida get-form-config <appType> <formUuid> [--json]` |
|
|
75
74
|
| 开发高级自定义页面、看板、图表或幻灯片 | 默认优先使用 Code Canvas 链路;明确要求普通自定义页面 JSX/Jsx,或强依赖普通自定义页实例桥时使用 `.oyd.jsx` + `check-page` / `compile` / `publish` |
|
|
76
|
-
| Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 | `
|
|
77
|
-
| Code Canvas 门户 +
|
|
75
|
+
| Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 | 使用 `yida-canvas-custom-page`,参考 `yida-canvas-custom-page/references/native-components-bridge.md` 做运行态组件探测、fallback 和值归一化 |
|
|
76
|
+
| Code Canvas 门户 + 成员/部门/上传组件 | 使用 `yida-canvas-custom-page`,按业务页面结构接入运行态组件桥 |
|
|
78
77
|
| 普通自定义页面 JSX/Jsx 使用成员/部门组件 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/component-jsx-guide.md` |
|
|
79
78
|
| 普通自定义页面 JSX/Jsx 使用附件/图片上传 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/attachment-upload-guide.md` |
|
|
80
79
|
|
|
@@ -34,6 +34,22 @@ const {
|
|
|
34
34
|
assertNoEmojiInText,
|
|
35
35
|
} = require('../core/no-emoji-guard');
|
|
36
36
|
const { CliError, isCliError } = require('../core/cli-error');
|
|
37
|
+
const {
|
|
38
|
+
findBareCjkJsxTextIdentifiers,
|
|
39
|
+
formatBareCjkJsxTextMessage,
|
|
40
|
+
} = require('./jsx-text-guard');
|
|
41
|
+
const {
|
|
42
|
+
findDirectFormOpenIssues,
|
|
43
|
+
formatDirectFormOpenMessage,
|
|
44
|
+
} = require('./form-open-guard');
|
|
45
|
+
const {
|
|
46
|
+
findFormDetailLinkIssues,
|
|
47
|
+
formatFormDetailLinkMessage,
|
|
48
|
+
} = require('./form-detail-link-guard');
|
|
49
|
+
const {
|
|
50
|
+
findPageRichnessIssues,
|
|
51
|
+
formatPageRichnessMessage,
|
|
52
|
+
} = require('./page-richness-guard');
|
|
37
53
|
|
|
38
54
|
/**
|
|
39
55
|
* 依赖 → window 别名白名单,用于把 import 改写到运行时全局对象。
|
|
@@ -58,6 +74,68 @@ const MODULE_ALIAS_MAP = {
|
|
|
58
74
|
'framer-motion': 'FramerMotion',
|
|
59
75
|
};
|
|
60
76
|
|
|
77
|
+
const MANUAL_DEPENDENCY_GLOBALS = Object.freeze({
|
|
78
|
+
React: 'react',
|
|
79
|
+
antd: 'antd',
|
|
80
|
+
icons: '@ant-design/icons',
|
|
81
|
+
ahooks: 'ahooks',
|
|
82
|
+
d3: 'd3',
|
|
83
|
+
dayjs: 'dayjs',
|
|
84
|
+
Recharts: 'recharts',
|
|
85
|
+
Radix: '@radix-ui/themes',
|
|
86
|
+
DynamicIcon: 'lucide-react',
|
|
87
|
+
LucideReact: 'lucide-react',
|
|
88
|
+
FramerMotion: 'framer-motion',
|
|
89
|
+
YidaMarkdown: 'yida-plugin-markdown',
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const BARE_DEPENDENCY_GLOBALS = Object.freeze({
|
|
93
|
+
antd: {
|
|
94
|
+
packageName: 'antd',
|
|
95
|
+
importExample: "import { Button, Drawer, ConfigProvider } from 'antd';",
|
|
96
|
+
},
|
|
97
|
+
icons: {
|
|
98
|
+
packageName: '@ant-design/icons',
|
|
99
|
+
importExample: "import { SearchOutlined, PlusOutlined } from '@ant-design/icons';",
|
|
100
|
+
},
|
|
101
|
+
lucideReact: {
|
|
102
|
+
packageName: 'lucide-react',
|
|
103
|
+
importExample: "import { Search, Plus, RefreshCw } from 'lucide-react';",
|
|
104
|
+
},
|
|
105
|
+
LucideReact: {
|
|
106
|
+
packageName: 'lucide-react',
|
|
107
|
+
importExample: "import { Search, Plus, RefreshCw } from 'lucide-react';",
|
|
108
|
+
},
|
|
109
|
+
DynamicIcon: {
|
|
110
|
+
packageName: 'lucide-react',
|
|
111
|
+
importExample: "import { DynamicIcon, Search } from 'lucide-react';",
|
|
112
|
+
},
|
|
113
|
+
ahooks: {
|
|
114
|
+
packageName: 'ahooks',
|
|
115
|
+
importExample: "import { useMemoizedFn } from 'ahooks';",
|
|
116
|
+
},
|
|
117
|
+
dayjs: {
|
|
118
|
+
packageName: 'dayjs',
|
|
119
|
+
importExample: "import dayjs from 'dayjs';",
|
|
120
|
+
},
|
|
121
|
+
Recharts: {
|
|
122
|
+
packageName: 'recharts',
|
|
123
|
+
importExample: "import { LineChart, Line } from 'recharts';",
|
|
124
|
+
},
|
|
125
|
+
FramerMotion: {
|
|
126
|
+
packageName: 'framer-motion',
|
|
127
|
+
importExample: "import { motion } from 'framer-motion';",
|
|
128
|
+
},
|
|
129
|
+
Radix: {
|
|
130
|
+
packageName: '@radix-ui/themes',
|
|
131
|
+
importExample: "import { Button } from '@radix-ui/themes';",
|
|
132
|
+
},
|
|
133
|
+
YidaMarkdown: {
|
|
134
|
+
packageName: 'yida-plugin-markdown',
|
|
135
|
+
importExample: "import Markdown from 'yida-plugin-markdown';",
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
61
139
|
const LUCIDE_REACT_PACKAGE = 'lucide-react';
|
|
62
140
|
const LUCIDE_DYNAMIC_ICON_ALIAS = 'DynamicIcon';
|
|
63
141
|
const LUCIDE_MODULE_ALIAS = 'LucideReact';
|
|
@@ -91,6 +169,108 @@ function stripJsComments(code) {
|
|
|
91
169
|
.replace(/(^|[^:])\/\/.*$/gm, '$1');
|
|
92
170
|
}
|
|
93
171
|
|
|
172
|
+
function assertNoManualDependencyGlobals(source, options = {}) {
|
|
173
|
+
const stripped = stripJsComments(source);
|
|
174
|
+
const globals = Object.keys(MANUAL_DEPENDENCY_GLOBALS);
|
|
175
|
+
const pattern = new RegExp(`\\bwindow\\.(${globals.join('|')})\\b`);
|
|
176
|
+
const match = pattern.exec(stripped);
|
|
177
|
+
if (!match) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const globalName = match[1];
|
|
181
|
+
const pkg = MANUAL_DEPENDENCY_GLOBALS[globalName];
|
|
182
|
+
throw new CliError(
|
|
183
|
+
`Code Canvas 源码不能直接读取 window.${globalName}。请使用标准 import 从 "${pkg}" 引入,`
|
|
184
|
+
+ '让编译器把依赖写入 importedModules;否则运行时不会加载该资源,页面会出现 window 依赖 undefined。',
|
|
185
|
+
{
|
|
186
|
+
code: 'OPENYIDA_CANVAS_MANUAL_DEPENDENCY_GLOBAL',
|
|
187
|
+
details: {
|
|
188
|
+
stage: 'canvas_compile',
|
|
189
|
+
sourcePath: options.sourcePath,
|
|
190
|
+
globalName,
|
|
191
|
+
packageName: pkg,
|
|
192
|
+
},
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function findBareDependencyGlobalIssues(source) {
|
|
198
|
+
const issues = [];
|
|
199
|
+
const names = new Set(Object.keys(BARE_DEPENDENCY_GLOBALS));
|
|
200
|
+
|
|
201
|
+
const guardPlugin = ({ types: t }) => ({
|
|
202
|
+
name: 'yida-bare-dependency-global-guard',
|
|
203
|
+
visitor: {
|
|
204
|
+
ReferencedIdentifier(path) {
|
|
205
|
+
const name = path.node.name;
|
|
206
|
+
if (!names.has(name)) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (path.scope.hasBinding(name)) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (
|
|
213
|
+
path.parentPath &&
|
|
214
|
+
path.parentPath.isMemberExpression() &&
|
|
215
|
+
path.parent.object === path.node &&
|
|
216
|
+
t.isIdentifier(path.parent.property, { name: 'then' })
|
|
217
|
+
) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const config = BARE_DEPENDENCY_GLOBALS[name];
|
|
221
|
+
issues.push({
|
|
222
|
+
name,
|
|
223
|
+
packageName: config.packageName,
|
|
224
|
+
importExample: config.importExample,
|
|
225
|
+
line: path.node.loc && path.node.loc.start ? path.node.loc.start.line : 0,
|
|
226
|
+
column: path.node.loc && path.node.loc.start ? path.node.loc.start.column : 0,
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
Babel.transform(source, {
|
|
233
|
+
filename: 'canvas.tsx',
|
|
234
|
+
presets: [
|
|
235
|
+
['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
|
|
236
|
+
['react', { runtime: 'classic' }],
|
|
237
|
+
],
|
|
238
|
+
plugins: [guardPlugin],
|
|
239
|
+
sourceType: 'module',
|
|
240
|
+
compact: false,
|
|
241
|
+
babelrc: false,
|
|
242
|
+
configFile: false,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
return issues;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function formatBareDependencyGlobalMessage(issue) {
|
|
249
|
+
return `Code Canvas 源码不能直接使用未声明的依赖全局变量 ${issue.name}。`
|
|
250
|
+
+ `请改用标准 import 从 "${issue.packageName}" 引入,例如:${issue.importExample} `
|
|
251
|
+
+ '编译器会自动写入 importedModules 并映射到正确运行时资源;否则线上会出现 '
|
|
252
|
+
+ `${issue.name} is not defined。`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function assertNoBareDependencyGlobals(source, options = {}) {
|
|
256
|
+
const issues = findBareDependencyGlobalIssues(source);
|
|
257
|
+
if (issues.length === 0) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const firstIssue = issues[0];
|
|
261
|
+
throw new CliError(formatBareDependencyGlobalMessage(firstIssue), {
|
|
262
|
+
code: 'OPENYIDA_CANVAS_BARE_DEPENDENCY_GLOBAL',
|
|
263
|
+
details: {
|
|
264
|
+
stage: 'canvas_compile',
|
|
265
|
+
sourcePath: options.sourcePath || '',
|
|
266
|
+
line: firstIssue.line,
|
|
267
|
+
column: firstIssue.column,
|
|
268
|
+
globalName: firstIssue.name,
|
|
269
|
+
packageName: firstIssue.packageName,
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
94
274
|
/**
|
|
95
275
|
* 从源码里正则抽取裸包名(过滤相对/绝对路径),去重排序。
|
|
96
276
|
* 对齐画布运行时的依赖抽取行为。
|
|
@@ -402,6 +582,62 @@ function compileCanvasLocal(source, options = {}) {
|
|
|
402
582
|
artifact: options.sourcePath || 'Code Canvas source',
|
|
403
583
|
code: 'OPENYIDA_CANVAS_SOURCE_EMOJI_FORBIDDEN',
|
|
404
584
|
});
|
|
585
|
+
const jsxTextIssues = findBareCjkJsxTextIdentifiers(source);
|
|
586
|
+
if (jsxTextIssues.length > 0) {
|
|
587
|
+
const firstIssue = jsxTextIssues[0];
|
|
588
|
+
throw new CliError(formatBareCjkJsxTextMessage(firstIssue.name), {
|
|
589
|
+
code: 'OPENYIDA_CANVAS_JSX_TEXT_IDENTIFIER',
|
|
590
|
+
details: {
|
|
591
|
+
stage: 'canvas_compile',
|
|
592
|
+
sourcePath: options.sourcePath || '',
|
|
593
|
+
line: firstIssue.line,
|
|
594
|
+
identifier: firstIssue.name,
|
|
595
|
+
},
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
const directFormOpenIssues = findDirectFormOpenIssues(source);
|
|
599
|
+
if (directFormOpenIssues.length > 0) {
|
|
600
|
+
const firstIssue = directFormOpenIssues[0];
|
|
601
|
+
throw new CliError(formatDirectFormOpenMessage(), {
|
|
602
|
+
code: 'OPENYIDA_CANVAS_FORM_OPEN_CONTAINER_REQUIRED',
|
|
603
|
+
details: {
|
|
604
|
+
stage: 'canvas_compile',
|
|
605
|
+
sourcePath: options.sourcePath || '',
|
|
606
|
+
line: firstIssue.line,
|
|
607
|
+
callee: firstIssue.callee,
|
|
608
|
+
},
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
const formDetailLinkIssues = findFormDetailLinkIssues(source);
|
|
612
|
+
if (formDetailLinkIssues.length > 0) {
|
|
613
|
+
const firstIssue = formDetailLinkIssues[0];
|
|
614
|
+
throw new CliError(formatFormDetailLinkMessage(firstIssue), {
|
|
615
|
+
code: 'OPENYIDA_CANVAS_FORM_DETAIL_LINK_INVALID',
|
|
616
|
+
details: {
|
|
617
|
+
stage: 'canvas_compile',
|
|
618
|
+
sourcePath: options.sourcePath || '',
|
|
619
|
+
line: firstIssue.line,
|
|
620
|
+
issueType: firstIssue.type,
|
|
621
|
+
},
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
const richnessIssues = findPageRichnessIssues(source);
|
|
625
|
+
if (richnessIssues.length > 0) {
|
|
626
|
+
const firstIssue = richnessIssues[0];
|
|
627
|
+
throw new CliError(formatPageRichnessMessage(firstIssue), {
|
|
628
|
+
code: 'OPENYIDA_CANVAS_CONTENT_BLOCKS_TOO_FEW',
|
|
629
|
+
details: {
|
|
630
|
+
stage: 'canvas_compile',
|
|
631
|
+
sourcePath: options.sourcePath || '',
|
|
632
|
+
line: firstIssue.line,
|
|
633
|
+
scene: firstIssue.scene,
|
|
634
|
+
count: firstIssue.count,
|
|
635
|
+
min: firstIssue.min,
|
|
636
|
+
},
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
assertNoBareDependencyGlobals(source, options);
|
|
640
|
+
assertNoManualDependencyGlobals(source, options);
|
|
405
641
|
|
|
406
642
|
const importedModules = extractImportedModules(source);
|
|
407
643
|
|
|
@@ -517,5 +753,6 @@ module.exports = {
|
|
|
517
753
|
resolveWindowAlias,
|
|
518
754
|
shouldAllowUnsupportedBareImports,
|
|
519
755
|
assertCanvasRuntimeParseable,
|
|
756
|
+
findBareDependencyGlobalIssues,
|
|
520
757
|
MODULE_ALIAS_MAP,
|
|
521
758
|
};
|