@substrat-run/model-view 0.2.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.
- package/LICENSE +202 -0
- package/README.md +50 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +315 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @substrat-run/model-view
|
|
2
|
+
|
|
3
|
+
Render an emitted Substrat `model.json` — entities, field schemas, parent edges, declared
|
|
4
|
+
lifecycles — as **one self-contained HTML page**: inline CSS, inline SVG, no script, no CDN,
|
|
5
|
+
no external reference of any kind. It is the pure rendering core shared by `substrat model
|
|
6
|
+
view` (the CLI, #756) and the dashboard's Model tab (#1214), which is why it lives apart
|
|
7
|
+
from both: no filesystem, no `node:*` imports, no DOM — the same function runs in a Node
|
|
8
|
+
CLI, a Cloudflare Worker, and a browser bundle.
|
|
9
|
+
|
|
10
|
+
It reads the **emitted artifact, never the TypeScript**. `model.json` is the artifact of
|
|
11
|
+
record (#697): `lint:model --check` gates it in CI, and everything downstream — this
|
|
12
|
+
renderer included — reads it rather than re-deriving from source.
|
|
13
|
+
|
|
14
|
+
## Using it
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { parseModel, renderModelHtml } from '@substrat-run/model-view';
|
|
18
|
+
|
|
19
|
+
// `raw` is a model.json you read yourself — a file, a manifest field, an HTTP body.
|
|
20
|
+
const model = parseModel(JSON.parse(raw), 'demos/todo/model.json');
|
|
21
|
+
const html = renderModelHtml(model, { source: 'demos/todo/model.json' });
|
|
22
|
+
// → a complete HTML document: write it to a file, serve it, or iframe-`srcdoc` it.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`parseModel` refuses anything that is not a model — with an error naming the artifact and
|
|
26
|
+
the malformed declaration — rather than rendering an empty or broken page. `source` is
|
|
27
|
+
display-only (a path in the CLI, a `slug@version` in the dashboard); pass `title` when the
|
|
28
|
+
default (the source path's parent directory) is not the right tab title.
|
|
29
|
+
|
|
30
|
+
## Caveats a user hits first
|
|
31
|
+
|
|
32
|
+
- **The page is static.** No script means no pan/zoom, no click-to-highlight, and no
|
|
33
|
+
overlay hooks. A surface that needs live overlays (per-entity row counts, #1214's
|
|
34
|
+
long-term shape) renders its own component — `layerDepths` is exported so such a
|
|
35
|
+
component can reuse the layout — rather than post-processing this HTML.
|
|
36
|
+
- **The diagram shows declared facts only.** An entity outside `defineEntities` does not
|
|
37
|
+
appear, and a `parents` edge pointing outside the model is drawn as no arrow (the entity
|
|
38
|
+
card still names it). A sparse diagram usually means thin registry adoption, not a bug.
|
|
39
|
+
- **Field order is the model's order.** The renderer never sorts; `emitModel` already
|
|
40
|
+
emits deterministically, and re-sorting here would misrepresent the artifact.
|
|
41
|
+
|
|
42
|
+
## What the tests prove — and don't
|
|
43
|
+
|
|
44
|
+
The suite proves the rendered page carries every reviewable fact (tables, parent edges,
|
|
45
|
+
composite keys, erasable marks, lifecycle edges), escapes hostile names, terminates on a
|
|
46
|
+
cyclic `parents` declaration, and references nothing external (no `http(s)://`, no
|
|
47
|
+
`<script>`, no `<link>`, no `src=`). It does **not** prove the page is legible for very
|
|
48
|
+
large models (wrapping is asserted structurally, not visually), and it does not validate
|
|
49
|
+
semantic coherence of the model — `emitModel`/`emitLifecycles` refused an incoherent
|
|
50
|
+
declaration at emit time; this package only refuses malformed *shape*.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { EmittedEntity, EmittedModel } from '@substrat-run/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* The emitted entity model, rendered as something a human can look at.
|
|
4
|
+
*
|
|
5
|
+
* This is the PURE half of `substrat model view` (#756), extracted so the dashboard's
|
|
6
|
+
* Model tab (#1214) renders the same page from the same artifact: it takes an already-read
|
|
7
|
+
* `model.json` — the artifact of record (#697), never the TypeScript — and returns one
|
|
8
|
+
* self-contained HTML string. No filesystem, no `node:*` imports, no DOM: it runs in the
|
|
9
|
+
* CLI, in a worker, and in a browser bundle unchanged.
|
|
10
|
+
*
|
|
11
|
+
* The output references NOTHING external: inline CSS, inline SVG, no script, no CDN.
|
|
12
|
+
* That is what makes it openable from a file path or an iframe `srcdoc` — with no server
|
|
13
|
+
* and no network — and the property is asserted by the suite.
|
|
14
|
+
*/
|
|
15
|
+
/** What `renderModelHtml` needs to say where a view came from. */
|
|
16
|
+
export interface ModelViewSource {
|
|
17
|
+
/** The `model.json` this was rendered from, as the caller wants it displayed —
|
|
18
|
+
* a file path in the CLI, a `slug@version` coordinate in the dashboard. */
|
|
19
|
+
readonly source: string;
|
|
20
|
+
/** The `<title>` subject. Defaults to the source path's parent directory name. */
|
|
21
|
+
readonly title?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validate a parsed `model.json`, refusing anything that is not one rather than rendering
|
|
25
|
+
* an empty page. `sourceLabel` prefixes every refusal so it names the artifact, not the
|
|
26
|
+
* renderer. Structural, mirroring the `emittedModel` schema in contracts — the renderer
|
|
27
|
+
* keeps its own copy because its error messages are the user-facing product here, and a
|
|
28
|
+
* malformed input that got past this would surface as a TypeError from inside the layout,
|
|
29
|
+
* which reads as a bug in the renderer instead of as a malformed input.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseModel(parsed: unknown, sourceLabel: string): EmittedModel;
|
|
32
|
+
/**
|
|
33
|
+
* Depth of each entity: 0 for one with no parents, else one past its deepest parent.
|
|
34
|
+
*
|
|
35
|
+
* `parents` is an allowlist and a diamond is normal (a reservation hangs off both a
|
|
36
|
+
* resource and a member), so this is a longest-path layering, not a tree. A cycle would
|
|
37
|
+
* make that non-terminating — the kernel does not forbid one — so a node already on the
|
|
38
|
+
* current path is treated as depth 0 and the layout stays a drawing rather than a hang.
|
|
39
|
+
*/
|
|
40
|
+
export declare function layerDepths(entities: Record<string, EmittedEntity>): Map<string, number>;
|
|
41
|
+
/** Render the whole view. Pure — reading and writing files is the caller's half. */
|
|
42
|
+
export declare function renderModelHtml(model: EmittedModel, opts: ModelViewSource): string;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE7F;;;;;;;;;;;;GAYG;AAEH,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B;gFAC4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,CA2D7E;AA+BD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxF;AAiND,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,CA8BlF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate a parsed `model.json`, refusing anything that is not one rather than rendering
|
|
3
|
+
* an empty page. `sourceLabel` prefixes every refusal so it names the artifact, not the
|
|
4
|
+
* renderer. Structural, mirroring the `emittedModel` schema in contracts — the renderer
|
|
5
|
+
* keeps its own copy because its error messages are the user-facing product here, and a
|
|
6
|
+
* malformed input that got past this would surface as a TypeError from inside the layout,
|
|
7
|
+
* which reads as a bug in the renderer instead of as a malformed input.
|
|
8
|
+
*/
|
|
9
|
+
export function parseModel(parsed, sourceLabel) {
|
|
10
|
+
const entities = parsed?.entities;
|
|
11
|
+
if (!entities || typeof entities !== 'object' || Array.isArray(entities)) {
|
|
12
|
+
throw new Error(`${sourceLabel} has no 'entities' object — is it a model.json?`);
|
|
13
|
+
}
|
|
14
|
+
for (const [name, entity] of Object.entries(entities)) {
|
|
15
|
+
if (!entity || typeof entity !== 'object' || typeof entity.table !== 'string') {
|
|
16
|
+
throw new Error(`${sourceLabel}: entity '${name}' declares no table — is it a model.json?`);
|
|
17
|
+
}
|
|
18
|
+
for (const listed of ['parents', 'primaryKey', 'key', 'erasable']) {
|
|
19
|
+
const value = entity[listed];
|
|
20
|
+
if (value === undefined)
|
|
21
|
+
continue;
|
|
22
|
+
if (!Array.isArray(value) || value.some((v) => typeof v !== 'string')) {
|
|
23
|
+
throw new Error(`${sourceLabel}: entity '${name}' declares '${listed}' as something other than a list of field names`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const lifecycles = parsed.lifecycles;
|
|
28
|
+
if (lifecycles !== undefined) {
|
|
29
|
+
if (!lifecycles || typeof lifecycles !== 'object' || Array.isArray(lifecycles)) {
|
|
30
|
+
throw new Error(`${sourceLabel}: 'lifecycles' is not an object keyed by entity`);
|
|
31
|
+
}
|
|
32
|
+
for (const [entity, lc] of Object.entries(lifecycles)) {
|
|
33
|
+
const states = lc?.states;
|
|
34
|
+
if (!lc || typeof lc !== 'object' || !states || typeof states !== 'object' || Array.isArray(states)) {
|
|
35
|
+
throw new Error(`${sourceLabel}: the lifecycle for '${entity}' declares no states map`);
|
|
36
|
+
}
|
|
37
|
+
for (const field of ['field', 'initial']) {
|
|
38
|
+
if (typeof lc[field] !== 'string') {
|
|
39
|
+
throw new Error(`${sourceLabel}: the lifecycle for '${entity}' declares '${field}' as something other than a name`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
for (const [state, def] of Object.entries(states)) {
|
|
43
|
+
if (!def || typeof def !== 'object' || Array.isArray(def)) {
|
|
44
|
+
throw new Error(`${sourceLabel}: state '${state}' of the '${entity}' lifecycle is not an object`);
|
|
45
|
+
}
|
|
46
|
+
const on = def.on;
|
|
47
|
+
if (on !== undefined) {
|
|
48
|
+
if (!on || typeof on !== 'object' || Array.isArray(on)) {
|
|
49
|
+
throw new Error(`${sourceLabel}: state '${state}' of the '${entity}' lifecycle declares 'on' as something other than a map`);
|
|
50
|
+
}
|
|
51
|
+
// The targets too, not only the container: a transition to `1` renders as a
|
|
52
|
+
// TypeError out of `escapeHtml`, which is the same failure one level down.
|
|
53
|
+
for (const [op, target] of Object.entries(on)) {
|
|
54
|
+
if (typeof target !== 'string') {
|
|
55
|
+
throw new Error(`${sourceLabel}: transition '${op}' from state '${state}' of the '${entity}' lifecycle names no target state`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return parsed;
|
|
63
|
+
}
|
|
64
|
+
const escapeHtml = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
65
|
+
/** The field names of an entity, in declaration order — the order the model reads in. */
|
|
66
|
+
function fieldNames(entity) {
|
|
67
|
+
const props = entity.fields?.properties;
|
|
68
|
+
return props ? Object.keys(props) : [];
|
|
69
|
+
}
|
|
70
|
+
/** A field's JSON-Schema type, rendered short. `string`, `number | null`, `object`. */
|
|
71
|
+
function fieldType(entity, field) {
|
|
72
|
+
const props = entity.fields?.properties ?? {};
|
|
73
|
+
const schema = props[field];
|
|
74
|
+
if (!schema)
|
|
75
|
+
return '';
|
|
76
|
+
const t = schema['type'];
|
|
77
|
+
if (typeof t === 'string')
|
|
78
|
+
return t;
|
|
79
|
+
if (Array.isArray(t))
|
|
80
|
+
return t.filter((x) => typeof x === 'string').join(' | ');
|
|
81
|
+
if (Array.isArray(schema['anyOf'])) {
|
|
82
|
+
const parts = schema['anyOf'].map((s) => typeof s['type'] === 'string' ? s['type'] : '…');
|
|
83
|
+
return [...new Set(parts)].join(' | ');
|
|
84
|
+
}
|
|
85
|
+
if (schema['enum'])
|
|
86
|
+
return 'enum';
|
|
87
|
+
return '';
|
|
88
|
+
}
|
|
89
|
+
const primaryKeyOf = (entity) => entity.primaryKey ?? ['id'];
|
|
90
|
+
/**
|
|
91
|
+
* Depth of each entity: 0 for one with no parents, else one past its deepest parent.
|
|
92
|
+
*
|
|
93
|
+
* `parents` is an allowlist and a diamond is normal (a reservation hangs off both a
|
|
94
|
+
* resource and a member), so this is a longest-path layering, not a tree. A cycle would
|
|
95
|
+
* make that non-terminating — the kernel does not forbid one — so a node already on the
|
|
96
|
+
* current path is treated as depth 0 and the layout stays a drawing rather than a hang.
|
|
97
|
+
*/
|
|
98
|
+
export function layerDepths(entities) {
|
|
99
|
+
const depths = new Map();
|
|
100
|
+
const walk = (name, path) => {
|
|
101
|
+
const cached = depths.get(name);
|
|
102
|
+
if (cached !== undefined)
|
|
103
|
+
return cached;
|
|
104
|
+
if (path.has(name))
|
|
105
|
+
return 0;
|
|
106
|
+
const parents = (entities[name]?.parents ?? []).filter((p) => p in entities);
|
|
107
|
+
const next = new Set([...path, name]);
|
|
108
|
+
const depth = parents.length === 0 ? 0 : Math.max(...parents.map((p) => walk(p, next))) + 1;
|
|
109
|
+
depths.set(name, depth);
|
|
110
|
+
return depth;
|
|
111
|
+
};
|
|
112
|
+
for (const name of Object.keys(entities))
|
|
113
|
+
walk(name, new Set());
|
|
114
|
+
return depths;
|
|
115
|
+
}
|
|
116
|
+
const BOX_H = 46;
|
|
117
|
+
const ROW_GAP = 104;
|
|
118
|
+
const COL_GAP = 28;
|
|
119
|
+
const PAD = 20;
|
|
120
|
+
/** Where a depth band wraps — near enough a laptop's window that the labels stay readable. */
|
|
121
|
+
const MAX_WIDTH = 1080;
|
|
122
|
+
/**
|
|
123
|
+
* The ER diagram, as inline SVG with no `xmlns` — inside HTML it is parsed as SVG already,
|
|
124
|
+
* and the attribute's value is a URL, which the "nothing external" assertion reads as a
|
|
125
|
+
* reference whether a browser would fetch it or not.
|
|
126
|
+
*/
|
|
127
|
+
function renderDiagram(entities) {
|
|
128
|
+
const names = Object.keys(entities);
|
|
129
|
+
if (names.length === 0)
|
|
130
|
+
return '<p class="empty">This model declares no entities.</p>';
|
|
131
|
+
const depths = layerDepths(entities);
|
|
132
|
+
const rows = [];
|
|
133
|
+
for (const name of names) {
|
|
134
|
+
const d = depths.get(name) ?? 0;
|
|
135
|
+
(rows[d] ??= []).push(name);
|
|
136
|
+
}
|
|
137
|
+
// A depth band wider than MAX_WIDTH wraps onto further lines rather than growing the
|
|
138
|
+
// canvas: the SVG is scaled to the page width, so one 20-entity row would render every
|
|
139
|
+
// label too small to read. A wrapped line stays inside its band, and depth strictly
|
|
140
|
+
// increases along a parent edge, so an arrow still always points at an earlier line.
|
|
141
|
+
const boxes = new Map();
|
|
142
|
+
let width = 0;
|
|
143
|
+
let line = 0;
|
|
144
|
+
rows.forEach((row) => {
|
|
145
|
+
let x = PAD;
|
|
146
|
+
row.forEach((name, i) => {
|
|
147
|
+
const label = Math.max(name.length, (entities[name]?.table ?? '').length);
|
|
148
|
+
const w = Math.max(132, label * 8 + 28);
|
|
149
|
+
if (i > 0 && x + w + PAD > MAX_WIDTH) {
|
|
150
|
+
line += 1;
|
|
151
|
+
x = PAD;
|
|
152
|
+
}
|
|
153
|
+
boxes.set(name, { name, table: entities[name]?.table ?? '', x, y: PAD + line * ROW_GAP, w, h: BOX_H });
|
|
154
|
+
x += w + COL_GAP;
|
|
155
|
+
width = Math.max(width, x - COL_GAP + PAD);
|
|
156
|
+
});
|
|
157
|
+
line += 1;
|
|
158
|
+
});
|
|
159
|
+
const height = PAD * 2 + (line - 1) * ROW_GAP + BOX_H;
|
|
160
|
+
const edges = [];
|
|
161
|
+
for (const name of names) {
|
|
162
|
+
const child = boxes.get(name);
|
|
163
|
+
if (!child)
|
|
164
|
+
continue;
|
|
165
|
+
for (const parentName of entities[name]?.parents ?? []) {
|
|
166
|
+
const parent = boxes.get(parentName);
|
|
167
|
+
if (!parent)
|
|
168
|
+
continue; // a parent outside this model — the entity list below still names it
|
|
169
|
+
const x1 = child.x + child.w / 2;
|
|
170
|
+
const y1 = child.y;
|
|
171
|
+
const x2 = parent.x + parent.w / 2;
|
|
172
|
+
const y2 = parent.y + parent.h;
|
|
173
|
+
const mid = (y1 + y2) / 2;
|
|
174
|
+
edges.push(`<path class="edge" d="M ${x1} ${y1} C ${x1} ${mid}, ${x2} ${mid}, ${x2} ${y2}" marker-end="url(#arrow)">` +
|
|
175
|
+
`<title>${escapeHtml(name)} hangs off ${escapeHtml(parentName)}</title></path>`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const nodes = [...boxes.values()].map((b) => `<g class="node"><rect x="${b.x}" y="${b.y}" width="${b.w}" height="${b.h}" rx="8" />` +
|
|
179
|
+
`<text class="node-name" x="${b.x + b.w / 2}" y="${b.y + 20}">${escapeHtml(b.name)}</text>` +
|
|
180
|
+
`<text class="node-table" x="${b.x + b.w / 2}" y="${b.y + 36}">${escapeHtml(b.table)}</text></g>`);
|
|
181
|
+
return (`<svg class="er" viewBox="0 0 ${width} ${height}" width="${width}" height="${height}" role="img" ` +
|
|
182
|
+
`aria-label="Entity relationship diagram">` +
|
|
183
|
+
`<defs><marker id="arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" ` +
|
|
184
|
+
`orient="auto-start-reverse"><path d="M 0 0 L 8 4 L 0 8 z" /></marker></defs>` +
|
|
185
|
+
`${edges.join('')}${nodes.join('')}</svg>`);
|
|
186
|
+
}
|
|
187
|
+
/** One entity's fields, with the primary key, the natural key and the erasable fields marked. */
|
|
188
|
+
function renderEntity(name, entity) {
|
|
189
|
+
const pk = new Set(primaryKeyOf(entity));
|
|
190
|
+
const key = new Set(entity.key ?? []);
|
|
191
|
+
const erasable = new Set(entity.erasable ?? []);
|
|
192
|
+
// `fields` is carried as opaque JSON Schema, so `required` is not shape-checked by
|
|
193
|
+
// `parseModel` the way the entity-level lists are — guard it here: a malformed value
|
|
194
|
+
// renders every field as optional rather than throwing from inside the renderer.
|
|
195
|
+
const requiredRaw = entity.fields?.required;
|
|
196
|
+
const required = new Set(Array.isArray(requiredRaw) ? requiredRaw.filter((f) => typeof f === 'string') : []);
|
|
197
|
+
const rows = fieldNames(entity).map((field) => {
|
|
198
|
+
const marks = [
|
|
199
|
+
pk.has(field) ? '<span class="mark pk" title="primary key">PK</span>' : '',
|
|
200
|
+
key.has(field) ? '<span class="mark key" title="natural key">KEY</span>' : '',
|
|
201
|
+
erasable.has(field) ? '<span class="mark erasable" title="reachable by an erasure">ERASABLE</span>' : '',
|
|
202
|
+
]
|
|
203
|
+
.filter(Boolean)
|
|
204
|
+
.join(' ');
|
|
205
|
+
return (`<tr><td class="field">${escapeHtml(field)}${required.has(field) ? '' : '<span class="opt">?</span>'}</td>` +
|
|
206
|
+
`<td class="type">${escapeHtml(fieldType(entity, field))}</td><td class="marks">${marks}</td></tr>`);
|
|
207
|
+
});
|
|
208
|
+
const parents = (entity.parents ?? []).map((p) => `<span class="pill">${escapeHtml(p)}</span>`).join(' ');
|
|
209
|
+
const meta = [
|
|
210
|
+
`<span class="meta-item">table <code>${escapeHtml(entity.table)}</code></span>`,
|
|
211
|
+
`<span class="meta-item">primary key <code>${escapeHtml(primaryKeyOf(entity).join(', '))}</code></span>`,
|
|
212
|
+
entity.key ? `<span class="meta-item">key <code>${escapeHtml(entity.key.join(', '))}</code></span>` : '',
|
|
213
|
+
parents ? `<span class="meta-item">hangs off ${parents}</span>` : '',
|
|
214
|
+
]
|
|
215
|
+
.filter(Boolean)
|
|
216
|
+
.join('');
|
|
217
|
+
return (`<section class="entity" id="entity-${escapeHtml(name)}"><h3>${escapeHtml(name)}</h3>` +
|
|
218
|
+
`<div class="meta">${meta}</div>` +
|
|
219
|
+
`<table class="fields"><tbody>${rows.join('')}</tbody></table></section>`);
|
|
220
|
+
}
|
|
221
|
+
/** The declared state machines, when the model carries any (#844). */
|
|
222
|
+
function renderLifecycles(lifecycles) {
|
|
223
|
+
const blocks = Object.entries(lifecycles).map(([entity, lc]) => {
|
|
224
|
+
const states = Object.entries(lc.states).map(([state, def]) => {
|
|
225
|
+
const edges = Object.entries(def.on ?? {}).map(([op, target]) => `<li><code>${escapeHtml(op)}</code> → ${escapeHtml(target)}</li>`);
|
|
226
|
+
const initial = state === lc.initial ? '<span class="mark pk" title="initial state">INITIAL</span>' : '';
|
|
227
|
+
return (`<div class="state"><h4>${escapeHtml(state)} ${initial}</h4>` +
|
|
228
|
+
`${edges.length ? `<ul>${edges.join('')}</ul>` : '<p class="empty">terminal</p>'}</div>`);
|
|
229
|
+
});
|
|
230
|
+
return (`<section class="entity"><h3>${escapeHtml(entity)}<span class="opt"> · ${escapeHtml(lc.field)}</span></h3>` +
|
|
231
|
+
`<div class="states">${states.join('')}</div></section>`);
|
|
232
|
+
});
|
|
233
|
+
return `<h2>Lifecycles</h2><div class="entities">${blocks.join('')}</div>`;
|
|
234
|
+
}
|
|
235
|
+
const STYLE = `
|
|
236
|
+
:root { color-scheme: light dark; --fg: #16181d; --dim: #5b6272; --line: #d7dbe3; --bg: #fbfbfd;
|
|
237
|
+
--card: #ffffff; --accent: #2f5bd7; --warn: #b2542b; }
|
|
238
|
+
@media (prefers-color-scheme: dark) {
|
|
239
|
+
:root { --fg: #e8eaf0; --dim: #9aa3b5; --line: #333844; --bg: #14161b; --card: #1b1e25;
|
|
240
|
+
--accent: #7fa2ff; --warn: #e2986a; }
|
|
241
|
+
}
|
|
242
|
+
* { box-sizing: border-box; }
|
|
243
|
+
body { margin: 0; padding: 32px; background: var(--bg); color: var(--fg);
|
|
244
|
+
font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
245
|
+
header { margin-bottom: 24px; }
|
|
246
|
+
h1 { margin: 0 0 4px; font-size: 22px; }
|
|
247
|
+
h2 { margin: 32px 0 12px; font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
|
|
248
|
+
h3 { margin: 0 0 8px; font-size: 15px; }
|
|
249
|
+
h4 { margin: 0 0 4px; font-size: 13px; }
|
|
250
|
+
.sub { color: var(--dim); font-size: 13px; }
|
|
251
|
+
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
252
|
+
.diagram { overflow-x: auto; padding: 8px 0; }
|
|
253
|
+
svg.er { max-width: 100%; height: auto; }
|
|
254
|
+
.er rect { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
|
|
255
|
+
.er text { text-anchor: middle; fill: var(--fg); font: 13px ui-sans-serif, system-ui, sans-serif; }
|
|
256
|
+
.er .node-table { fill: var(--dim); font: 11px ui-monospace, Menlo, monospace; }
|
|
257
|
+
.er .edge { fill: none; stroke: var(--accent); stroke-width: 1.5; }
|
|
258
|
+
.er marker path { fill: var(--accent); }
|
|
259
|
+
.entities { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
|
|
260
|
+
.entity { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
|
|
261
|
+
.meta { color: var(--dim); font-size: 12px; margin-bottom: 10px; }
|
|
262
|
+
.meta-item { display: inline-block; margin-right: 12px; }
|
|
263
|
+
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
|
|
264
|
+
table.fields { width: 100%; border-collapse: collapse; }
|
|
265
|
+
table.fields td { border-top: 1px solid var(--line); padding: 4px 0; vertical-align: top; }
|
|
266
|
+
td.field { font: 12px ui-monospace, Menlo, monospace; }
|
|
267
|
+
td.type { color: var(--dim); font: 12px ui-monospace, Menlo, monospace; width: 30%; }
|
|
268
|
+
td.marks { text-align: right; white-space: nowrap; }
|
|
269
|
+
.opt { color: var(--dim); }
|
|
270
|
+
.mark { font-size: 10px; letter-spacing: .06em; border-radius: 4px; padding: 1px 5px; margin-left: 4px;
|
|
271
|
+
border: 1px solid var(--line); color: var(--dim); }
|
|
272
|
+
.mark.pk { color: var(--accent); border-color: var(--accent); }
|
|
273
|
+
.mark.erasable { color: var(--warn); border-color: var(--warn); }
|
|
274
|
+
.states { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
|
|
275
|
+
.state ul { margin: 0; padding-left: 16px; }
|
|
276
|
+
.empty { color: var(--dim); }
|
|
277
|
+
footer { margin-top: 32px; color: var(--dim); font-size: 12px; }
|
|
278
|
+
`;
|
|
279
|
+
/** The default `<title>` subject: the source path's parent directory name, as the CLI shows it. */
|
|
280
|
+
function defaultTitle(source) {
|
|
281
|
+
const parts = source.split('/');
|
|
282
|
+
return parts.length >= 2 ? (parts[parts.length - 2] ?? '') : '';
|
|
283
|
+
}
|
|
284
|
+
/** Render the whole view. Pure — reading and writing files is the caller's half. */
|
|
285
|
+
export function renderModelHtml(model, opts) {
|
|
286
|
+
const entities = model.entities;
|
|
287
|
+
const names = Object.keys(entities);
|
|
288
|
+
const cards = names.map((name) => renderEntity(name, entities[name]));
|
|
289
|
+
const lifecycles = model.lifecycles && Object.keys(model.lifecycles).length ? renderLifecycles(model.lifecycles) : '';
|
|
290
|
+
const erasable = names.filter((n) => (entities[n]?.erasable ?? []).length > 0).length;
|
|
291
|
+
return `<!doctype html>
|
|
292
|
+
<html lang="en">
|
|
293
|
+
<head>
|
|
294
|
+
<meta charset="utf-8" />
|
|
295
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
296
|
+
<title>Entity model — ${escapeHtml(opts.title ?? (defaultTitle(opts.source) || 'substrat'))}</title>
|
|
297
|
+
<style>${STYLE}</style>
|
|
298
|
+
</head>
|
|
299
|
+
<body>
|
|
300
|
+
<!-- Rendered by @substrat-run/model-view from ${escapeHtml(opts.source)} — regenerate, do not edit. -->
|
|
301
|
+
<header>
|
|
302
|
+
<h1>Entity model</h1>
|
|
303
|
+
<p class="sub">${names.length} entities · ${erasable} with erasable fields · from <code>${escapeHtml(opts.source)}</code></p>
|
|
304
|
+
</header>
|
|
305
|
+
<div class="diagram">${renderDiagram(entities)}</div>
|
|
306
|
+
<h2>Entities</h2>
|
|
307
|
+
<div class="entities">${cards.join('')}</div>
|
|
308
|
+
${lifecycles}
|
|
309
|
+
<footer>An arrow points from an entity to a parent it may hang off — the allowlist <code>ctx.link</code> checks.
|
|
310
|
+
Marks: PK primary key · KEY natural key · ERASABLE reachable by an erasure. <code>?</code> marks an optional field.</footer>
|
|
311
|
+
</body>
|
|
312
|
+
</html>
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe,EAAE,WAAmB;IAC7D,MAAM,QAAQ,GAAI,MAAwC,EAAE,QAAQ,CAAC;IACrE,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,GAAG,WAAW,iDAAiD,CAAC,CAAC;IACnF,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAmC,CAAC,EAAE,CAAC;QACjF,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OA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MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IAEtF,OAAO;;;;;wBAKe,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC;SAClF,KAAK;;;iDAGmC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;;;iBAGvD,KAAK,CAAC,MAAM,eAAe,QAAQ,sCAAsC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;;uBAE1F,aAAa,CAAC,QAAQ,CAAC;;wBAEtB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;EACpC,UAAU;;;;;CAKX,CAAC;AACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@substrat-run/model-view",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Render an emitted Substrat model.json as one self-contained HTML page — the ER diagram, the entity cards, the declared lifecycles",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/substrat-run/substrat.git",
|
|
9
|
+
"directory": "packages/model-view"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://substrat.net/concepts/model",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
27
|
+
"test": "vitest run"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@substrat-run/contracts": "workspace:*"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "catalog:",
|
|
34
|
+
"typescript": "catalog:",
|
|
35
|
+
"vitest": "catalog:"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.5"
|
|
42
|
+
}
|
|
43
|
+
}
|