openxiangda 1.0.20 → 1.0.21

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.
@@ -0,0 +1,66 @@
1
+ # App Shell Code Page Entries
2
+
3
+ Use this pattern for formal user-facing entries such as admin consoles, PC
4
+ portals, and mobile portals.
5
+
6
+ ## Required Page Config
7
+
8
+ `page.config.ts` must declare app-shell entry metadata:
9
+
10
+ ```ts
11
+ export default {
12
+ code: "instrument_admin",
13
+ name: "Instrument Admin",
14
+ route: { pathKey: "instrument_admin" },
15
+ entry: {
16
+ mode: "app-shell",
17
+ hidePlatformNav: true,
18
+ defaultRoute: "dashboard",
19
+ },
20
+ };
21
+ ```
22
+
23
+ Rules:
24
+
25
+ - `entry.mode` is `"app-shell"` for formal product entries.
26
+ - `entry.hidePlatformNav` is `true` unless the page is explicitly a debugging or maintenance page.
27
+ - `entry.defaultRoute` is required and must point at the shell home route.
28
+ - Plain one-off custom pages may omit `entry` or use `mode: "plain-page"`.
29
+
30
+ ## Expected File Shape
31
+
32
+ Prefer this layout for app-shell pages:
33
+
34
+ ```text
35
+ src/pages/<pageCode>/
36
+ page.config.ts
37
+ index.tsx
38
+ <Feature>Shell.tsx
39
+ routes.ts
40
+ modules/
41
+ __tests__/
42
+ ```
43
+
44
+ `routes.ts` should export the route registry, default route, route parser, and
45
+ route builder. Page components should navigate through that helper or
46
+ `openxiangda/runtime` navigation.
47
+
48
+ ## Navigation Rules
49
+
50
+ - Use the standard query key `route` for shell routes.
51
+ - Use `navigation.pushRoute(route, query?)` and
52
+ `navigation.replaceRoute(route, query?)` for same-page shell navigation.
53
+ - Do not scatter hardcoded `/view/...&isRenderNav=false` URLs through page code.
54
+ - Menu links should bind the formal app-shell code page only. Native forms,
55
+ workflows, and view pages can stay as development resources or permission
56
+ targets, but should not become the product navigation shell.
57
+
58
+ ## Tests
59
+
60
+ Add focused contract tests for:
61
+
62
+ - `page.config.ts` includes `entry.mode: "app-shell"`.
63
+ - default route fallback.
64
+ - unknown route fallback.
65
+ - preserving and deleting business query values.
66
+ - preserving hidden platform nav when the route helper updates the URL.
@@ -40,6 +40,7 @@ openxiangda page publish dashboard \
40
40
  Read these references only when editing page code:
41
41
 
42
42
  - `../../references/pages/workspace-structure.md`
43
+ - `../../references/pages/app-shell.md` — formal backend / PC portal / mobile portal entry pattern. Read before creating any user-facing main entry or admin console.
43
44
  - `../../references/pages/page-sdk.md`
44
45
  - `../../references/pages/publish-flow.md`
45
46
  - `../../references/style-system.md` — three-layer style architecture, CSS namespace, and the no-hardcoded-color rule. Read before writing any page CSS or Tailwind class.
@@ -50,11 +51,14 @@ Read these references only when editing page code:
50
51
  ## Rules
51
52
 
52
53
  - Keep `pageCode` stable and use it as the local logical key.
54
+ - Formal user-facing entries such as admin consoles, PC portals, and mobile portals must be app-shell code pages. Declare `entry: { mode: "app-shell", hidePlatformNav: true, defaultRoute: "<home-route>" }` in `page.config.ts`.
53
55
  - Store live `pageId`, `routeKey`, and `legacyFormUuid` under the current profile only.
54
56
  - Use `openxiangda/runtime` for platform data access instead of hardcoding backend URLs in page code.
55
57
  - Named imports from `@ant-design/icons` are supported by the `openxiangda` workspace build proxy, which enumerates icon module exports at runtime.
56
58
  - Publish through `openxiangda workspace publish --profile <name>` unless there is a specific repair reason to call `page publish` directly.
57
59
  - Do not create custom code pages by writing platform schema directly. The source is React workspace code plus `page.config.ts`.
60
+ - Do not scatter hardcoded `/view/...&isRenderNav=false` URLs through page code. Use the runtime navigation API or the local route helper generated for the app shell.
61
+ - Platform menus should bind only the formal app-shell code page for user-facing entry points. Original forms, workflows, and native view pages may remain as development / maintenance resources or permission targets, but should not become the product navigation shell.
58
62
  - For prod, explicitly run with `--profile prod`; never rely on the current profile for release operations.
59
63
  - Follow the style system in `../../references/style-system.md`: never hardcode colors, fonts, spacing, or radii — use the platform CSS variables and the page CSS namespace.
60
64
  - For list / detail / CRUD pages, follow `../../references/architecture-patterns.md` (e.g. `DataManagementList`) before writing custom data-fetching loops.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {