@appthen/cli 1.2.10 → 1.2.11
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/.gitignore +1 -0
- package/bin/main.js +45 -0
- package/dist/index.js +1108 -267
- package/package.json +1 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1406 -0
- package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +1060 -0
- package/tests/test-app/.appthen/space-config.json +8 -0
- package/tests/test-app/docs/AI-Workflow.flow +112 -0
- package/tests/test-app/docs/Logic-1.flow +16 -0
- package/tests/test-app/docs/Logic.flow +16 -0
- package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
- package/tests/test-app/docs/Project-Blueprint.flow +119 -0
- package/tests/test-app/docs/README.md +3 -0
- package/tests/test-app/docs/claude.md +194 -0
- package/tests/test-app/docs/page_requirement_analysis.md +149 -0
- package/tests/test-app/docs//345/267/245/345/215/225/347/256/241/347/220/206/347/263/273/347/273/237/350/257/246/347/273/206/350/256/276/350/256/241.md +377 -0
- package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
- package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
- package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
- package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
- package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
- package/tests/test-app/src/app.css +15 -0
- package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
- package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
- package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
- package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
- package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
- package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
- package/tests/test-app/src/components/Button.js +11 -0
- package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
- package/tests/test-app/src/components/Timeline.tsx +145 -0
- package/tests/test-app/src/index.ts +2 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
- package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/344/272/247/345/223/201/350/256/276/350/256/241/346/226/207/346/241/243.md +301 -0
- package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/345/274/200/345/217/221/344/273/273/345/212/241/345/210/206/345/267/245/346/226/207/346/241/243.md +345 -0
- package/tests/test-app/src/pages/SLAManagement.tsx +668 -0
- package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
- package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
- package/tests/test-app/src/pages/TicketList.tsx +27 -0
- package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
- package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
- package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
- package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
- package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
- package/tests/test-app/src/pages/cover.tsx +42 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
- package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
- package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
- package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
- package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
- package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
- package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
- package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
- package/tests/test-app/src/pages/testPage.css +3 -0
- package/tests/test-app/src/pages/testPage.tsx +158 -0
- package/tests/test-app/src/pages/web_version/website.css +205 -0
- package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
- package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
- package/tests/test-app/src/project.json +1120 -0
- package/tests/test-app/src/store/global.store.ts +10 -0
- package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
- package/tests/test-app/src/types/SLAPolicy.ts +50 -0
- package/tests/test-app/src/types/Ticket.ts +68 -0
- package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
- package/tests/test-app/src/types/TicketComment.m.ts +59 -0
- package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
- package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
- package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
- package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
- package/tests/test-app/src/types/TicketRecord.ts +47 -0
- package/tests/test-app/src/types/TrainDoor.ts +284 -0
- package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
- package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
- package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
- package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spaceId": "test-app-e99876b1",
|
|
3
|
+
"projectRoot": "/Users/huanglei/Documents/work/ruoqing/editor/packages/cli/tests/test-app",
|
|
4
|
+
"projectId": "66123f22b93b36e6a40dbcb9",
|
|
5
|
+
"userId": 100001,
|
|
6
|
+
"createdAt": "2026-01-27T03:47:59.733Z",
|
|
7
|
+
"lastAccess": "2026-01-27T03:47:59.733Z"
|
|
8
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nodes": [
|
|
3
|
+
{
|
|
4
|
+
"id": "n-txt",
|
|
5
|
+
"type": "text",
|
|
6
|
+
"position": {
|
|
7
|
+
"x": 50,
|
|
8
|
+
"y": 50
|
|
9
|
+
},
|
|
10
|
+
"data": {
|
|
11
|
+
"text": "请分析视频中的人物情绪变化。"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "n-vid",
|
|
16
|
+
"type": "video",
|
|
17
|
+
"position": {
|
|
18
|
+
"x": 50,
|
|
19
|
+
"y": 320
|
|
20
|
+
},
|
|
21
|
+
"data": {
|
|
22
|
+
"url": "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=400"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "c-1",
|
|
27
|
+
"type": "connector",
|
|
28
|
+
"position": {
|
|
29
|
+
"x": 420,
|
|
30
|
+
"y": 220
|
|
31
|
+
},
|
|
32
|
+
"data": {}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "n-analysis",
|
|
36
|
+
"type": "analysis",
|
|
37
|
+
"position": {
|
|
38
|
+
"x": 580,
|
|
39
|
+
"y": 80
|
|
40
|
+
},
|
|
41
|
+
"data": {}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "n-extract",
|
|
45
|
+
"type": "extractor",
|
|
46
|
+
"position": {
|
|
47
|
+
"x": 580,
|
|
48
|
+
"y": 480
|
|
49
|
+
},
|
|
50
|
+
"data": {}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "n-crop",
|
|
54
|
+
"type": "image_crop",
|
|
55
|
+
"position": {
|
|
56
|
+
"x": 920,
|
|
57
|
+
"y": 350
|
|
58
|
+
},
|
|
59
|
+
"data": {}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"edges": [
|
|
63
|
+
{
|
|
64
|
+
"id": "e1",
|
|
65
|
+
"source": "n-txt",
|
|
66
|
+
"target": "c-1",
|
|
67
|
+
"animated": true,
|
|
68
|
+
"style": {
|
|
69
|
+
"strokeWidth": 2,
|
|
70
|
+
"stroke": "#3b82f6"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "e2",
|
|
75
|
+
"source": "n-vid",
|
|
76
|
+
"target": "c-1",
|
|
77
|
+
"animated": true,
|
|
78
|
+
"style": {
|
|
79
|
+
"strokeWidth": 2,
|
|
80
|
+
"stroke": "#a855f7"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "e3",
|
|
85
|
+
"source": "c-1",
|
|
86
|
+
"target": "n-analysis",
|
|
87
|
+
"targetHandle": "video",
|
|
88
|
+
"style": {
|
|
89
|
+
"strokeWidth": 2,
|
|
90
|
+
"stroke": "#a855f7"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "e4",
|
|
95
|
+
"source": "n-vid",
|
|
96
|
+
"target": "n-extract",
|
|
97
|
+
"style": {
|
|
98
|
+
"strokeWidth": 2,
|
|
99
|
+
"stroke": "#a855f7"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "e5",
|
|
104
|
+
"source": "n-extract",
|
|
105
|
+
"target": "n-crop",
|
|
106
|
+
"style": {
|
|
107
|
+
"strokeWidth": 2,
|
|
108
|
+
"stroke": "#fb923c"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nodes": [
|
|
3
|
+
{
|
|
4
|
+
"id": "j1",
|
|
5
|
+
"type": "journey",
|
|
6
|
+
"position": {
|
|
7
|
+
"x": 50,
|
|
8
|
+
"y": 150
|
|
9
|
+
},
|
|
10
|
+
"data": {
|
|
11
|
+
"label": "用户登录流程",
|
|
12
|
+
"config": {
|
|
13
|
+
"desc": "用户输入账号密码后进入首页"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "s1",
|
|
19
|
+
"type": "screen",
|
|
20
|
+
"position": {
|
|
21
|
+
"x": 350,
|
|
22
|
+
"y": 50
|
|
23
|
+
},
|
|
24
|
+
"data": {
|
|
25
|
+
"label": "登录页 (Design)",
|
|
26
|
+
"config": {
|
|
27
|
+
"previewUrl": "https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=400"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "s2",
|
|
33
|
+
"type": "screen",
|
|
34
|
+
"position": {
|
|
35
|
+
"x": 350,
|
|
36
|
+
"y": 250
|
|
37
|
+
},
|
|
38
|
+
"data": {
|
|
39
|
+
"label": "工作台 (Design)",
|
|
40
|
+
"config": {
|
|
41
|
+
"previewUrl": "https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "c1",
|
|
47
|
+
"type": "ui_comp",
|
|
48
|
+
"position": {
|
|
49
|
+
"x": 650,
|
|
50
|
+
"y": 50
|
|
51
|
+
},
|
|
52
|
+
"data": {
|
|
53
|
+
"label": "LoginForm 组件",
|
|
54
|
+
"config": {
|
|
55
|
+
"path": "@/components/auth/LoginForm.tsx",
|
|
56
|
+
"props": [
|
|
57
|
+
"onSubmit",
|
|
58
|
+
"initialValues"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "a1",
|
|
65
|
+
"type": "api_node",
|
|
66
|
+
"position": {
|
|
67
|
+
"x": 950,
|
|
68
|
+
"y": 150
|
|
69
|
+
},
|
|
70
|
+
"data": {
|
|
71
|
+
"label": "Login API",
|
|
72
|
+
"state": "ready",
|
|
73
|
+
"config": {
|
|
74
|
+
"method": "POST",
|
|
75
|
+
"path": "/api/v1/auth/login"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"edges": [
|
|
81
|
+
{
|
|
82
|
+
"id": "e1",
|
|
83
|
+
"source": "j1",
|
|
84
|
+
"target": "s1",
|
|
85
|
+
"animated": true,
|
|
86
|
+
"style": {
|
|
87
|
+
"stroke": "#fbbf24"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "e2",
|
|
92
|
+
"source": "j1",
|
|
93
|
+
"target": "s2",
|
|
94
|
+
"animated": true,
|
|
95
|
+
"style": {
|
|
96
|
+
"stroke": "#fbbf24"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "e3",
|
|
101
|
+
"source": "s1",
|
|
102
|
+
"target": "c1",
|
|
103
|
+
"animated": true,
|
|
104
|
+
"style": {
|
|
105
|
+
"stroke": "#60a5fa"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "e4",
|
|
110
|
+
"source": "c1",
|
|
111
|
+
"target": "a1",
|
|
112
|
+
"animated": true,
|
|
113
|
+
"style": {
|
|
114
|
+
"stroke": "#34d399",
|
|
115
|
+
"strokeWidth": 3
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nodes": [
|
|
3
|
+
{
|
|
4
|
+
"id": "j1",
|
|
5
|
+
"type": "journey",
|
|
6
|
+
"position": {
|
|
7
|
+
"x": 50,
|
|
8
|
+
"y": 150
|
|
9
|
+
},
|
|
10
|
+
"data": {
|
|
11
|
+
"label": "用户登录流程",
|
|
12
|
+
"config": {
|
|
13
|
+
"desc": "用户输入账号密码后进入首页"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "s1",
|
|
19
|
+
"type": "screen",
|
|
20
|
+
"position": {
|
|
21
|
+
"x": 350,
|
|
22
|
+
"y": 50
|
|
23
|
+
},
|
|
24
|
+
"data": {
|
|
25
|
+
"label": "登录页 (Design)",
|
|
26
|
+
"config": {
|
|
27
|
+
"previewUrl": "https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=400"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "s2",
|
|
33
|
+
"type": "screen",
|
|
34
|
+
"position": {
|
|
35
|
+
"x": 350,
|
|
36
|
+
"y": 250
|
|
37
|
+
},
|
|
38
|
+
"data": {
|
|
39
|
+
"label": "工作台 (Design)",
|
|
40
|
+
"config": {
|
|
41
|
+
"previewUrl": "https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "c1",
|
|
47
|
+
"type": "ui_comp",
|
|
48
|
+
"position": {
|
|
49
|
+
"x": 650,
|
|
50
|
+
"y": 50
|
|
51
|
+
},
|
|
52
|
+
"data": {
|
|
53
|
+
"label": "LoginForm 组件",
|
|
54
|
+
"config": {
|
|
55
|
+
"path": "@/components/auth/LoginForm.tsx",
|
|
56
|
+
"props": [
|
|
57
|
+
"onSubmit",
|
|
58
|
+
"initialValues"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "a1",
|
|
65
|
+
"type": "api_node",
|
|
66
|
+
"position": {
|
|
67
|
+
"x": 950,
|
|
68
|
+
"y": 150
|
|
69
|
+
},
|
|
70
|
+
"data": {
|
|
71
|
+
"label": "Login API",
|
|
72
|
+
"state": "ready",
|
|
73
|
+
"config": {
|
|
74
|
+
"method": "POST",
|
|
75
|
+
"path": "/api/v1/auth/login"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"edges": [
|
|
81
|
+
{
|
|
82
|
+
"id": "e1",
|
|
83
|
+
"source": "j1",
|
|
84
|
+
"target": "s1",
|
|
85
|
+
"animated": true,
|
|
86
|
+
"style": {
|
|
87
|
+
"stroke": "#fbbf24"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "e2",
|
|
92
|
+
"source": "j1",
|
|
93
|
+
"target": "s2",
|
|
94
|
+
"animated": true,
|
|
95
|
+
"style": {
|
|
96
|
+
"stroke": "#fbbf24"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "e3",
|
|
101
|
+
"source": "s1",
|
|
102
|
+
"target": "c1",
|
|
103
|
+
"animated": true,
|
|
104
|
+
"style": {
|
|
105
|
+
"stroke": "#60a5fa"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "e4",
|
|
110
|
+
"source": "c1",
|
|
111
|
+
"target": "a1",
|
|
112
|
+
"animated": true,
|
|
113
|
+
"style": {
|
|
114
|
+
"stroke": "#34d399",
|
|
115
|
+
"strokeWidth": 3
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Appthen 项目 - Claude Code 自定义指令
|
|
2
|
+
|
|
3
|
+
## 🎯 项目概述
|
|
4
|
+
|
|
5
|
+
这是一个 **Appthen 低代码平台**项目,支持用高代码开发低代码系统中的 React 页面和组件。
|
|
6
|
+
|
|
7
|
+
**关键特性:**
|
|
8
|
+
- 使用特殊规范的 TSX 语法
|
|
9
|
+
- 代码会被低代码系统解析和导入
|
|
10
|
+
- 必须严格遵守规范,否则无法导入
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🚨 重要:开发 TSX 文件的强制要求
|
|
15
|
+
|
|
16
|
+
### 必须遵守的规范
|
|
17
|
+
|
|
18
|
+
在开发任何 TSX 文件(页面或组件)时,**必须严格遵守**以下规范:
|
|
19
|
+
|
|
20
|
+
1. **阅读规范文档**
|
|
21
|
+
- 查看 `.appthen/prompts/tsx-generation.md` 了解完整规范
|
|
22
|
+
- 查看 `.appthen/prompts/decision-tree.md` 了解决策流程
|
|
23
|
+
- 查看 `.appthen/prompts/validation-checklist.md` 了解验证清单
|
|
24
|
+
|
|
25
|
+
2. **render() 方法约束**(零容忍)
|
|
26
|
+
- ❌ 不能有任何变量声明(const/let/var)
|
|
27
|
+
- ❌ 不能有任何解构赋值
|
|
28
|
+
- ❌ 不能有任何逻辑语句(if/for/while)
|
|
29
|
+
- ❌ 不能有任何函数调用(除了 this.state/this.props 访问)
|
|
30
|
+
- ✅ 第一行必须是 `return (`
|
|
31
|
+
- ✅ 只能直接访问 `this.state.xxx` 和 `this.props.xxx`
|
|
32
|
+
|
|
33
|
+
3. **TypeScript 语法限制**
|
|
34
|
+
- ❌ 方法不能有参数类型注解
|
|
35
|
+
- ❌ 方法不能有返回类型注解
|
|
36
|
+
- ❌ 变量不能有类型注解
|
|
37
|
+
- ❌ 不能使用泛型(除了 React.Component<IProps, IState>)
|
|
38
|
+
- ✅ 只在 IProps/IState 中使用类型定义
|
|
39
|
+
|
|
40
|
+
4. **JSX 位置限制**
|
|
41
|
+
- ✅ 只有 render() 方法可以包含 JSX
|
|
42
|
+
- ❌ 其他方法不能包含 JSX
|
|
43
|
+
- ❌ 类属性不能包含 JSX
|
|
44
|
+
|
|
45
|
+
5. **对象访问安全**
|
|
46
|
+
- ✅ 嵌套对象必须使用可选链:`this.state.user?.name`
|
|
47
|
+
- ✅ 数组访问必须使用可选链:`this.state.items?.map(...)`
|
|
48
|
+
|
|
49
|
+
### 验证要求
|
|
50
|
+
|
|
51
|
+
**每次修改 TSX 文件后,必须运行验证:**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
appthen check-tsx -f "app/src/pages/YourPage.tsx"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**如果验证失败,必须修正后才能提交!**
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🚫 禁止的操作
|
|
62
|
+
|
|
63
|
+
### 绝对不要执行以下命令:
|
|
64
|
+
|
|
65
|
+
- ❌ `eslint` 或 `eslint --fix`(针对 .tsx 文件)
|
|
66
|
+
- ❌ `prettier` 格式化命令(针对 .tsx 文件)
|
|
67
|
+
- ❌ `tsc --noEmit` 或任何 tsc 命令
|
|
68
|
+
- ❌ 任何 TypeScript 语法检查工具
|
|
69
|
+
- ❌ 任何自动格式化工具
|
|
70
|
+
|
|
71
|
+
**原因:** 这些工具会破坏我们的特殊 TSX 语法!
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 📚 快速参考
|
|
76
|
+
|
|
77
|
+
### 正确的 TSX 文件结构
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
/**
|
|
81
|
+
* 页面标题
|
|
82
|
+
* @type Page|Component
|
|
83
|
+
*/
|
|
84
|
+
import React from 'react';
|
|
85
|
+
|
|
86
|
+
interface IProps {
|
|
87
|
+
title?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class IState {
|
|
91
|
+
count?: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
class Document extends React.Component<IProps, IState> {
|
|
95
|
+
static defaultProps = {
|
|
96
|
+
title: 'Default'
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
state = {
|
|
100
|
+
count: 0
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
handleClick() {
|
|
104
|
+
this.setState({ count: this.state.count + 1 });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
render() {
|
|
108
|
+
return (
|
|
109
|
+
<div>
|
|
110
|
+
<h1>{this.props.title}</h1>
|
|
111
|
+
<p>{this.state.count}</p>
|
|
112
|
+
<button onClick={() => this.handleClick()}>Click</button>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export default Document;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 常见错误示例
|
|
122
|
+
|
|
123
|
+
❌ **错误:render() 中的变量声明**
|
|
124
|
+
```typescript
|
|
125
|
+
render() {
|
|
126
|
+
const data = this.state.data; // ❌ 不允许
|
|
127
|
+
return <div>{data}</div>;
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
✅ **正确:直接访问**
|
|
132
|
+
```typescript
|
|
133
|
+
render() {
|
|
134
|
+
return <div>{this.state.data}</div>;
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
❌ **错误:方法中的类型注解**
|
|
139
|
+
```typescript
|
|
140
|
+
handleClick(e: Event) { // ❌ 不允许
|
|
141
|
+
this.setState({ clicked: true });
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
✅ **正确:无类型注解**
|
|
146
|
+
```typescript
|
|
147
|
+
handleClick(e) { // ✅ 正确
|
|
148
|
+
this.setState({ clicked: true });
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 🎯 开发流程
|
|
155
|
+
|
|
156
|
+
### 创建新页面/组件
|
|
157
|
+
|
|
158
|
+
1. 查看规范文档:`.appthen/prompts/tsx-generation.md`
|
|
159
|
+
2. 生成代码(遵守所有约束)
|
|
160
|
+
3. 验证语法:`appthen check-tsx -f "path/to/file.tsx"`
|
|
161
|
+
4. 修正错误(如果有)
|
|
162
|
+
5. 在低代码系统中导入测试
|
|
163
|
+
|
|
164
|
+
### 修改现有页面/组件
|
|
165
|
+
|
|
166
|
+
1. 查看现有代码结构
|
|
167
|
+
2. 修改代码(遵守所有约束)
|
|
168
|
+
3. 验证语法:`appthen check-tsx -f "path/to/file.tsx"`
|
|
169
|
+
4. 修正错误(如果有)
|
|
170
|
+
5. 测试功能
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 💡 自定义命令
|
|
175
|
+
|
|
176
|
+
你可以使用以下自定义命令(在 `.claude/commands/` 目录中):
|
|
177
|
+
|
|
178
|
+
- `$check-tsx` - 验证 TSX 文件语法
|
|
179
|
+
- `$review-tsx` - 审查 TSX 代码质量
|
|
180
|
+
- `$create-page` - 创建新页面(遵守规范)
|
|
181
|
+
- `$create-component` - 创建新组件(遵守规范)
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📖 更多信息
|
|
186
|
+
|
|
187
|
+
- **完整规范**:`.appthen/prompts/tsx-generation.md`
|
|
188
|
+
- **决策树**:`.appthen/prompts/decision-tree.md`
|
|
189
|
+
- **验证清单**:`.appthen/prompts/validation-checklist.md`
|
|
190
|
+
- **项目指南**:`.appthen/prompts/project-guide.md`
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
**记住:遵守规范是成功的关键!违反规范的代码无法在低代码系统中使用。** 🎯
|