@topogram/starter-web-api 0.1.10 → 0.1.12
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/implementation/README.md +3 -3
- package/implementation/index.js +8 -3
- package/package.json +3 -3
- package/topogram/projections/proj-api.tg +4 -4
- package/topogram/projections/{proj-ui-shared.tg → proj-ui-contract.tg} +24 -6
- package/topogram/projections/{proj-ui-web.tg → proj-web-surface.tg} +5 -5
- package/topogram/widgets/widget-greeting-table.tg +23 -0
- package/topogram-template.json +1 -1
- package/topogram.project.json +6 -6
package/implementation/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Starter Implementation
|
|
2
2
|
|
|
3
|
-
This folder holds the small implementation provider copied by the
|
|
4
|
-
`web-api`
|
|
5
|
-
product examples belong in external template packs.
|
|
3
|
+
This folder holds the small implementation provider copied by the local
|
|
4
|
+
`web-api` template fixture. It intentionally avoids product-specific domain
|
|
5
|
+
logic; richer product examples belong in external template packs.
|
package/implementation/index.js
CHANGED
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
renderHelloRoutes
|
|
20
20
|
} from "./web/renderers.js";
|
|
21
21
|
|
|
22
|
-
export const
|
|
23
|
-
exampleId: "web-api-template",
|
|
22
|
+
export const WEB_API_DB_IMPLEMENTATION = {
|
|
23
|
+
exampleId: "web-api-db-template",
|
|
24
24
|
exampleRoot: "/topogram",
|
|
25
25
|
backend: {
|
|
26
26
|
reference: HELLO_BACKEND_REFERENCE,
|
|
@@ -50,4 +50,9 @@ export const WEB_API_IMPLEMENTATION = {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
export
|
|
53
|
+
export const WEB_API_IMPLEMENTATION = {
|
|
54
|
+
...WEB_API_DB_IMPLEMENTATION,
|
|
55
|
+
exampleId: "web-api-template"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default WEB_API_DB_IMPLEMENTATION;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topogram/starter-web-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "React and Express Topogram starter.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@topogram/generator-express-api": "0.1.
|
|
22
|
-
"@topogram/generator-react-web": "0.1.
|
|
21
|
+
"@topogram/generator-express-api": "0.1.4",
|
|
22
|
+
"@topogram/generator-react-web": "0.1.7"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"registry": "https://registry.npmjs.org",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
projection proj_api {
|
|
2
2
|
name "Starter API"
|
|
3
3
|
description "HTTP API realization for the neutral starter"
|
|
4
|
-
|
|
4
|
+
type api_contract
|
|
5
5
|
|
|
6
6
|
realizes [cap_create_greeting, cap_get_greeting, cap_list_greetings, cap_update_greeting]
|
|
7
7
|
outputs [database_schema, entity_models, request_contracts, response_contracts, endpoints]
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
endpoints {
|
|
10
10
|
cap_create_greeting method POST path /greetings success 201 auth none request body
|
|
11
11
|
cap_get_greeting method GET path /greetings/:id success 200 auth none request path
|
|
12
12
|
cap_list_greetings method GET path /greetings success 200 auth none request query
|
|
13
13
|
cap_update_greeting method PATCH path /greetings/:id success 200 auth none request body
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
wire_fields {
|
|
17
17
|
cap_get_greeting input greeting_id in path as id
|
|
18
18
|
cap_update_greeting input greeting_id in path as id
|
|
19
19
|
cap_update_greeting input message in body
|
|
@@ -21,7 +21,7 @@ projection proj_api {
|
|
|
21
21
|
cap_list_greetings input limit in query
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
responses {
|
|
25
25
|
cap_list_greetings mode cursor item shape_output_greeting_detail cursor request_after after response_next next_cursor limit field limit default 25 max 100 sort by created_at direction desc total included false
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
projection
|
|
1
|
+
projection proj_ui_contract {
|
|
2
2
|
name "Starter Shared UI"
|
|
3
3
|
description "Platform-neutral UI semantics for the neutral starter"
|
|
4
|
-
|
|
4
|
+
type ui_contract
|
|
5
5
|
|
|
6
6
|
realizes [cap_list_greetings, cap_get_greeting, cap_create_greeting, cap_update_greeting]
|
|
7
7
|
outputs [ui_contract]
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
app_shell {
|
|
10
10
|
brand "Topogram Starter"
|
|
11
11
|
shell topbar
|
|
12
12
|
global_search false
|
|
@@ -15,24 +15,42 @@ projection proj_ui_shared {
|
|
|
15
15
|
footer none
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
design_tokens {
|
|
19
|
+
density compact
|
|
20
|
+
tone operational
|
|
21
|
+
radius_scale medium
|
|
22
|
+
color_role primary accent
|
|
23
|
+
color_role danger critical
|
|
24
|
+
typography_role body readable
|
|
25
|
+
typography_role heading prominent
|
|
26
|
+
action_role primary prominent
|
|
27
|
+
action_role destructive danger
|
|
28
|
+
accessibility contrast aa
|
|
29
|
+
accessibility focus visible
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
screens {
|
|
19
33
|
screen greeting_list kind list title "Greetings" load cap_list_greetings item_shape shape_output_greeting_card detail_capability cap_get_greeting primary_action cap_create_greeting empty_title "No greetings yet" empty_body "Create a greeting to verify the generated stack" loading_state skeleton error_state inline
|
|
20
34
|
screen greeting_detail kind detail title "Greeting Details" load cap_get_greeting view_shape shape_output_greeting_detail primary_action cap_update_greeting loading_state skeleton
|
|
21
35
|
screen greeting_create kind form title "Create Greeting" input_shape shape_input_create_greeting submit cap_create_greeting success_navigate greeting_detail success_state banner
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
|
|
38
|
+
navigation {
|
|
25
39
|
group starter label "Starter" placement primary pattern primary
|
|
26
40
|
screen greeting_list group starter label "Greetings" order 10 visible true default true sitemap include pattern primary
|
|
27
41
|
screen greeting_create group starter label "Create" order 20 visible true sitemap include pattern primary
|
|
28
42
|
screen greeting_detail group starter label "Greeting Details" visible false breadcrumb greeting_list sitemap exclude pattern stack_navigation
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
screen_regions {
|
|
32
46
|
screen greeting_list region hero pattern summary_stats placement primary
|
|
33
47
|
screen greeting_list region results pattern resource_table placement primary
|
|
34
48
|
screen greeting_detail region summary pattern detail_panel placement primary
|
|
35
49
|
}
|
|
36
50
|
|
|
51
|
+
widget_bindings {
|
|
52
|
+
screen greeting_list region results widget widget_greeting_table data rows from cap_list_greetings event row_select navigate greeting_detail
|
|
53
|
+
}
|
|
54
|
+
|
|
37
55
|
status active
|
|
38
56
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
projection
|
|
1
|
+
projection proj_web_surface {
|
|
2
2
|
name "Starter Web UI"
|
|
3
3
|
description "Web realization for the neutral starter using a React profile"
|
|
4
|
-
|
|
4
|
+
type web_surface
|
|
5
5
|
|
|
6
|
-
realizes [
|
|
6
|
+
realizes [proj_ui_contract, cap_list_greetings, cap_get_greeting, cap_create_greeting, cap_update_greeting]
|
|
7
7
|
outputs [ui_contract, web_app]
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
screen_routes {
|
|
10
10
|
screen greeting_list path /greetings
|
|
11
11
|
screen greeting_detail path /greetings/:id
|
|
12
12
|
screen greeting_create path /greetings/new
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
web_hints {
|
|
16
16
|
screen greeting_list shell topbar
|
|
17
17
|
screen greeting_list layout responsive_collection
|
|
18
18
|
screen greeting_list desktop_variant table
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
widget widget_greeting_table {
|
|
2
|
+
name "Greeting Table"
|
|
3
|
+
description "Reusable table display for greeting rows"
|
|
4
|
+
category collection
|
|
5
|
+
|
|
6
|
+
props {
|
|
7
|
+
rows array required
|
|
8
|
+
loading boolean optional default false
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
events {
|
|
12
|
+
row_select shape_output_greeting_card
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
slots {
|
|
16
|
+
empty_state "Empty-state content"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
patterns [resource_table, data_grid_view]
|
|
20
|
+
regions [results]
|
|
21
|
+
version "1.0"
|
|
22
|
+
status active
|
|
23
|
+
}
|
package/topogram-template.json
CHANGED
package/topogram.project.json
CHANGED
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"topology": {
|
|
15
|
-
"
|
|
15
|
+
"runtimes": [
|
|
16
16
|
{
|
|
17
17
|
"id": "app_api",
|
|
18
|
-
"type": "api",
|
|
19
18
|
"projection": "proj_api",
|
|
20
19
|
"generator": {
|
|
21
20
|
"id": "@topogram/generator-express-api",
|
|
22
21
|
"version": "1",
|
|
23
22
|
"package": "@topogram/generator-express-api"
|
|
24
23
|
},
|
|
25
|
-
"port": 3000
|
|
24
|
+
"port": 3000,
|
|
25
|
+
"kind": "api_service"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"id": "app_react",
|
|
29
|
-
"
|
|
30
|
-
"projection": "proj_ui_web",
|
|
29
|
+
"projection": "proj_web_surface",
|
|
31
30
|
"generator": {
|
|
32
31
|
"id": "@topogram/generator-react-web",
|
|
33
32
|
"version": "1",
|
|
34
33
|
"package": "@topogram/generator-react-web"
|
|
35
34
|
},
|
|
36
35
|
"port": 5173,
|
|
37
|
-
"
|
|
36
|
+
"kind": "web_surface",
|
|
37
|
+
"uses_api": "app_api"
|
|
38
38
|
}
|
|
39
39
|
]
|
|
40
40
|
}
|