@jarenjs/studio 0.56.0 → 0.66.1
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/README.md +16 -0
- package/dist/types/assemble.d.ts +1 -1
- package/docs/PROJECT-FORMAT.md +6 -2
- package/package.json +8 -8
- package/src/assemble.js +5 -5
- package/src/component/host.js +2 -1
package/README.md
CHANGED
|
@@ -63,6 +63,22 @@ error with a JSON Pointer. There is deliberately no single composed
|
|
|
63
63
|
mega-schema; that is what lets a project mix an app, a store and a data
|
|
64
64
|
query at once. See [PROJECT-FORMAT.md](docs/PROJECT-FORMAT.md).
|
|
65
65
|
|
|
66
|
+
## Exports
|
|
67
|
+
|
|
68
|
+
Every subpath a consumer can import, derived from the manifest by
|
|
69
|
+
`npm run docs:derive` (`npm run docs:check` fails when the two drift):
|
|
70
|
+
|
|
71
|
+
<!--fact:exports.studio-->
|
|
72
|
+
| Import | Kind | Declarations |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `@jarenjs/studio` | JavaScript | declared |
|
|
75
|
+
| `@jarenjs/studio/component` | JavaScript | declared |
|
|
76
|
+
| `@jarenjs/studio/schemas/jaren-project.draft-07.schema.json` | schema | — |
|
|
77
|
+
| `@jarenjs/studio/schemas/jaren-project.schema.json` | schema | — |
|
|
78
|
+
| `@jarenjs/studio/styles/studio.css` | asset | — |
|
|
79
|
+
| `@jarenjs/studio/package.json` | metadata | — |
|
|
80
|
+
<!--/fact-->
|
|
81
|
+
|
|
66
82
|
## Install
|
|
67
83
|
|
|
68
84
|
```
|
package/dist/types/assemble.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* `classifyChange` is the load-bearing UX datum: a `state`-only edit must
|
|
14
14
|
* HOT-DISPATCH into a running app (no reboot, the user keeps scroll and
|
|
15
15
|
* inputs), while a `view`/`actions` change must reboot. It compares a
|
|
16
|
-
* STRUCTURAL key (an app
|
|
16
|
+
* STRUCTURAL key (an app's `view`, `actions` and `subs`) via the suite's own
|
|
17
17
|
* `semanticKey` — the collision-free identity, not the memo-grade
|
|
18
18
|
* `contentKey` fingerprint: a classification decides whether a running
|
|
19
19
|
* app reboots, so a fingerprint collision would read a changed document
|
package/docs/PROJECT-FORMAT.md
CHANGED
|
@@ -75,8 +75,12 @@ share link and the eject, so its shape is fixed at v0.1.
|
|
|
75
75
|
## `classifyChange` — reboot vs. hot-update
|
|
76
76
|
|
|
77
77
|
`classifyChange(prev, next)` reports, **per artifact**, whether a change
|
|
78
|
-
is `structural`, `state-only`, or `none`.
|
|
79
|
-
|
|
78
|
+
is `structural`, `state-only`, or `none`. A change of artifact kind is
|
|
79
|
+
structural even when the JSON text stays the same. It compares an app's
|
|
80
|
+
`view`, `actions` and `subs` (other artifacts' whole documents) via the
|
|
81
|
+
suite's collision-free `semanticKey`; a remaining document change is
|
|
82
|
+
`state-only`. Every filename, including `__proto__`, is an own member of
|
|
83
|
+
the result map.
|
|
80
84
|
An IDE reads it to decide: a `state-only` edit hot-dispatches into a
|
|
81
85
|
running app (the user keeps scroll and inputs); a `structural` edit
|
|
82
86
|
reboots. Keeping this datum in the tested engine, and the policy in the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarenjs/studio",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.66.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"prepack": "npm run build:types"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@jarenjs/core": "^0.
|
|
63
|
-
"@jarenjs/validate": "^0.
|
|
64
|
-
"@jarenjs/json": "^0.
|
|
65
|
-
"@jarenjs/app": "^0.
|
|
66
|
-
"@jarenjs/flow": "^0.
|
|
67
|
-
"@jarenjs/db": "^0.
|
|
68
|
-
"@jarenjs/contract": "^0.
|
|
62
|
+
"@jarenjs/core": "^0.66.1",
|
|
63
|
+
"@jarenjs/validate": "^0.66.1",
|
|
64
|
+
"@jarenjs/json": "^0.66.1",
|
|
65
|
+
"@jarenjs/app": "^0.66.1",
|
|
66
|
+
"@jarenjs/flow": "^0.66.1",
|
|
67
|
+
"@jarenjs/db": "^0.66.1",
|
|
68
|
+
"@jarenjs/contract": "^0.66.1"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/assemble.js
CHANGED
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* `classifyChange` is the load-bearing UX datum: a `state`-only edit must
|
|
15
15
|
* HOT-DISPATCH into a running app (no reboot, the user keeps scroll and
|
|
16
16
|
* inputs), while a `view`/`actions` change must reboot. It compares a
|
|
17
|
-
* STRUCTURAL key (an app
|
|
17
|
+
* STRUCTURAL key (an app's `view`, `actions` and `subs`) via the suite's own
|
|
18
18
|
* `semanticKey` — the collision-free identity, not the memo-grade
|
|
19
19
|
* `contentKey` fingerprint: a classification decides whether a running
|
|
20
20
|
* app reboots, so a fingerprint collision would read a changed document
|
|
21
21
|
* as unchanged. The artifacts are parsed JSON, so the identity is total.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { semanticKey } from '@jarenjs/core/object';
|
|
24
|
+
import { semanticKey, setObjectMember } from '@jarenjs/core/object';
|
|
25
25
|
import { validateFile } from './validate.js';
|
|
26
26
|
|
|
27
27
|
/** Kinds that are runnable artifacts on their own (vs. `state`/`data`
|
|
@@ -90,15 +90,15 @@ export function classifyChange(prevProject, nextProject) {
|
|
|
90
90
|
for (const [name, a] of next) {
|
|
91
91
|
const b = prev.get(name);
|
|
92
92
|
let c;
|
|
93
|
-
if (b === undefined) c = 'structural';
|
|
93
|
+
if (b === undefined || b.kind !== a.kind) c = 'structural';
|
|
94
94
|
else if (structuralKey(b) !== structuralKey(a)) c = 'structural';
|
|
95
95
|
else if (semanticKey(b.doc) !== semanticKey(a.doc)) c = 'state-only';
|
|
96
96
|
else c = 'none';
|
|
97
|
-
perArtifact
|
|
97
|
+
setObjectMember(perArtifact, name, c);
|
|
98
98
|
bump(c);
|
|
99
99
|
}
|
|
100
100
|
for (const name of prev.keys()) {
|
|
101
|
-
if (!next.has(name)) { perArtifact
|
|
101
|
+
if (!next.has(name)) { setObjectMember(perArtifact, name, 'structural'); bump('structural'); }
|
|
102
102
|
}
|
|
103
103
|
return { overall, perArtifact };
|
|
104
104
|
}
|
package/src/component/host.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* hidden write.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { setObjectMember } from '@jarenjs/core/object';
|
|
18
19
|
import { classifyChange } from '../assemble.js';
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -30,7 +31,7 @@ export function hostPolicy(prevProject, nextProject) {
|
|
|
30
31
|
/** @type {Record<string, 'reboot' | 'hot' | 'skip'>} */
|
|
31
32
|
const out = {};
|
|
32
33
|
for (const [name, change] of Object.entries(perArtifact)) {
|
|
33
|
-
out
|
|
34
|
+
setObjectMember(out, name, change === 'structural' ? 'reboot' : change === 'state-only' ? 'hot' : 'skip');
|
|
34
35
|
}
|
|
35
36
|
return out;
|
|
36
37
|
}
|