archidocs 1.3.3 → 1.4.0-beta.2

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.
Files changed (47) hide show
  1. package/dist/cli/dev.js +4 -1
  2. package/dist/core/load.js +7 -1
  3. package/dist/core/rules.js +2 -2
  4. package/dist/core/views/deployment.d.ts +4 -0
  5. package/dist/core/views/deployment.js +15 -1
  6. package/dist/core/views/generated.d.ts +3 -1
  7. package/dist/core/views/generated.js +9 -2
  8. package/dist/core/views/index.d.ts +1 -0
  9. package/dist/core/views/index.js +1 -0
  10. package/dist/core/views/resolve.js +3 -3
  11. package/dist/core/views/save-as-view.d.ts +8 -3
  12. package/dist/core/views/save-as-view.js +16 -6
  13. package/dist/core/views/types.d.ts +9 -1
  14. package/dist/mcp/server.js +8 -4
  15. package/dist/mcp/writes.js +4 -1
  16. package/dist/render/index.d.ts +1 -1
  17. package/dist/render/index.js +1 -1
  18. package/dist/render/layout.d.ts +3 -1
  19. package/dist/render/layout.js +6 -1
  20. package/dist/render/sequence.d.ts +6 -3
  21. package/dist/render/sequence.js +7 -4
  22. package/dist/render/svg.d.ts +3 -1
  23. package/dist/render/svg.js +48 -10
  24. package/dist/render/tokens.d.ts +8 -0
  25. package/dist/render/tokens.js +12 -0
  26. package/dist/schema/bundle.d.ts +8 -0
  27. package/dist/schema/bundle.js +2 -0
  28. package/dist/schema/workspace.d.ts +17 -0
  29. package/dist/schema/workspace.js +19 -1
  30. package/dist/viewer/assets/font-BEgf3E5J.js +1 -0
  31. package/dist/viewer/assets/index-CzXU8F_3.css +1 -0
  32. package/dist/viewer/assets/index-DmVLe9LK.js +75 -0
  33. package/dist/viewer/assets/layout.worker-ueOYAv7N.js +63 -0
  34. package/dist/viewer/assets/png-D-pNKY71.js +1 -0
  35. package/dist/viewer/assets/rolldown-runtime-pP25SEvz.js +1 -0
  36. package/dist/viewer/assets/sequence-svg-BtEmwvN4.js +2 -0
  37. package/dist/viewer/assets/svg-DXIkkkSu.js +2 -0
  38. package/dist/viewer/assets/teams-N-WbqOXA.js +66 -0
  39. package/dist/viewer/index.html +5 -2
  40. package/guide/topics/deployments.md +17 -3
  41. package/package.json +1 -1
  42. package/schemas/model.schema.json +35 -1
  43. package/dist/viewer/assets/index-BhiW2o_9.js +0 -138
  44. package/dist/viewer/assets/index-YFA-pYjQ.css +0 -1
  45. package/dist/viewer/assets/layout.worker-BRHAGJrD.js +0 -26
  46. package/dist/viewer/assets/png-CJovcggr.js +0 -1
  47. package/dist/viewer/assets/svg-Cg6M1xWg.js +0 -2
@@ -44,8 +44,11 @@
44
44
  });
45
45
  })();
46
46
  </script>
47
- <script type="module" crossorigin src="./assets/index-BhiW2o_9.js"></script>
48
- <link rel="stylesheet" crossorigin href="./assets/index-YFA-pYjQ.css">
47
+ <script type="module" crossorigin src="./assets/index-DmVLe9LK.js"></script>
48
+ <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-pP25SEvz.js">
49
+ <link rel="modulepreload" crossorigin href="./assets/font-BEgf3E5J.js">
50
+ <link rel="modulepreload" crossorigin href="./assets/teams-N-WbqOXA.js">
51
+ <link rel="stylesheet" crossorigin href="./assets/index-CzXU8F_3.css">
49
52
  </head>
50
53
  <body>
51
54
  <div id="root"></div>
@@ -6,14 +6,23 @@ A **Deployment Target** is where Services run (a region, a cluster in it, a name
6
6
 
7
7
  1. **Environment.** `list_environments`. Environments are defined once in `workspace.yaml`; add a missing one with `upsert_environment(id, fields: {name})` only after the user confirms it, because every Project shares it.
8
8
  2. **Targets.** `upsert_target(project, id, fields, parent?, file?)`:
9
- - `fields`: `name`, `kind` (required: `region`, `cluster`, `namespace`, `platform`, ...), `description`, `owner`, `tags`, `links`.
9
+ - `fields`: `name`, `kind` (required), `description`, `owner`, `tags`, `links`.
10
+ - `kind` is printed as written in the Target's header, so use a short form: `region`, `az`, `vnet`, `snet`, `vm`, `aks`, `ns`, `asp`. Not `availability-zone`, `subnet` or `app-service-plan`.
10
11
  - `parent` nests it in the parent's file. A Target can't be moved; remove it and add it again.
11
12
  - Target ids share the Project's id namespace with Elements. Reuse a Target from another Project as `project:id`, resolved with `search_elements` or `get_deployments`.
12
13
  3. **Deployment.** `upsert_deployment(project, service, environment, target, fields, file?)`:
13
- - `fields`: `url` (the Service's main URL in that Environment) and `endpoints` (`[{name, url}]` for further named URLs: admin, health, gRPC).
14
+ - `fields`: `url` (the Service's main URL in that Environment), `endpoints` (`[{name, url}]` for further named URLs: admin, health, gRPC) and `instances` (see Scaling).
14
15
  - A new Deployment goes beside the Project's other Deployments unless `file` is given.
15
16
  4. **Finish** the edit loop.
16
17
 
18
+ ## Scaling
19
+
20
+ `instances` says how many copies of the Service run on the Target: a whole number for a fixed count, `{min, max}` for an autoscale range. Leave it out for one. A scaled Deployment draws as a stack with a `×3` or `2–10` chip.
21
+
22
+ - **Use `instances`** for interchangeable copies on one Target: an App Service plan running N workers, a Kubernetes Deployment with N replicas, an autoscaling group.
23
+ - **Use separate Deployments** when where each copy runs is the point: one per availability zone, one per named VM, the members of a Solr or ZooKeeper ensemble. Give each its own Target, so the View shows the placement.
24
+ - Don't put the count in the Target's name ("autoscale 2–10"): one Target can host Deployments that scale differently.
25
+
17
26
  ## Example
18
27
 
19
28
  ```yaml
@@ -24,13 +33,18 @@ targets:
24
33
  targets:
25
34
  eks-main:
26
35
  name: Main EKS
27
- kind: cluster
36
+ kind: eks
28
37
  deployments:
29
38
  - service: cart
30
39
  environment: prod
31
40
  target: eks-main
32
41
  url: https://cart.example.com
42
+ instances: 3 # fixed: three interchangeable copies
33
43
  endpoints:
34
44
  - name: health
35
45
  url: https://cart.example.com/healthz
46
+ - service: search
47
+ environment: prod
48
+ target: eks-main
49
+ instances: { min: 2, max: 10 } # autoscale range
36
50
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archidocs",
3
- "version": "1.3.3",
3
+ "version": "1.4.0-beta.2",
4
4
  "description": "Git-native architecture as code: check and bundle a Workspace of Projects.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -107,6 +107,40 @@
107
107
  "additionalProperties": false,
108
108
  "description": "A further named URL of the Service in this Environment."
109
109
  }
110
+ },
111
+ "instances": {
112
+ "anyOf": [
113
+ {
114
+ "type": "integer",
115
+ "minimum": 1,
116
+ "maximum": 9007199254740991,
117
+ "description": "A fixed number of instances, such as `3`."
118
+ },
119
+ {
120
+ "type": "object",
121
+ "properties": {
122
+ "min": {
123
+ "type": "integer",
124
+ "minimum": 1,
125
+ "maximum": 9007199254740991,
126
+ "description": "The fewest instances the autoscaler runs."
127
+ },
128
+ "max": {
129
+ "type": "integer",
130
+ "minimum": 1,
131
+ "maximum": 9007199254740991,
132
+ "description": "The most instances the autoscaler runs. At least `min`."
133
+ }
134
+ },
135
+ "required": [
136
+ "min",
137
+ "max"
138
+ ],
139
+ "additionalProperties": false,
140
+ "description": "An autoscale range, such as `{ min: 2, max: 10 }`."
141
+ }
142
+ ],
143
+ "description": "How many interchangeable copies of the Service run on this Deployment Target: a whole number for a fixed count, such as `3`, or `{ min, max }` for an autoscale range, such as `{ min: 2, max: 10 }`. Use it for identical workers on one Target, such as an App Service plan running N instances. When where each copy runs matters, such as one per availability zone or VM, declare separate Deployments on separate Targets instead. Default: 1."
110
144
  }
111
145
  },
112
146
  "required": [
@@ -637,7 +671,7 @@
637
671
  },
638
672
  "kind": {
639
673
  "type": "string",
640
- "description": "What the Deployment Target is, in a word you choose, such as `region`, `cluster`, `namespace` or `platform`."
674
+ "description": "What the Deployment Target is, in a short word you choose, printed as written in its header: prefer short forms such as `region`, `az`, `vnet`, `snet`, `vm`, `aks`, `ns` or `asp` over long names like `availability-zone` or `subnet`."
641
675
  },
642
676
  "description": {
643
677
  "description": "What the Deployment Target is, in a sentence or two.",