@abide/abide 0.102.0 → 0.104.0
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/CHANGELOG.md +23 -0
- package/bin/abide.ts +31 -28
- package/docs/REGISTRY.md +40 -36
- package/docs/RULEBOOK.md +113 -92
- package/docs/abide.md +788 -554
- package/package.json +2 -1
- package/scaffold/AGENTS.md +13 -6
- package/src/compiler/TypeSession.ts +108 -35
- package/src/compiler/appMap.ts +91 -0
- package/src/compiler/argsSchemaOf.ts +1 -1
- package/src/compiler/checkApp.ts +35 -18
- package/src/compiler/checkedShadow.ts +40 -7
- package/src/compiler/compileApp.ts +271 -76
- package/src/compiler/compiledEntry.ts +10 -6
- package/src/compiler/componentGraph.ts +6 -7
- package/src/compiler/declaredExports.ts +3 -3
- package/src/compiler/emitClient.ts +3 -3
- package/src/compiler/emitComponent.ts +9 -9
- package/src/compiler/emitSource.ts +5 -9
- package/src/compiler/handlersUnder.ts +114 -73
- package/src/compiler/hooksCalled.ts +35 -0
- package/src/compiler/mountsOf.ts +30 -18
- package/src/compiler/parseAbide.ts +12 -12
- package/src/compiler/projectShadow.ts +71 -46
- package/src/compiler/readsIn.ts +2 -2
- package/src/compiler/scaffold.ts +24 -21
- package/src/compiler/serveLanguage.ts +0 -24
- package/src/compiler/sharedModuleWrites.ts +2 -2
- package/src/compiler/splitImports.ts +4 -4
- package/src/compiler/writeDefaultProject.ts +28 -1
- package/src/server/MODULE_QUERIES.ts +12 -3
- package/src/server/abideModules.ts +156 -53
- package/src/server/answerRequest.ts +9 -4
- package/src/server/answerRpc.ts +18 -16
- package/src/server/appTree.ts +92 -25
- package/src/server/commands.ts +5 -4
- package/src/server/componentModules.d.ts +1 -2
- package/src/server/createApp.ts +23 -11
- package/src/server/devWorker.ts +5 -1
- package/src/server/fenceServer.ts +36 -13
- package/src/server/generatedSurfaces.ts +12 -53
- package/src/server/hooks.ts +17 -4
- package/src/server/index.ts +1 -0
- package/src/server/installSourceMaps.ts +6 -1
- package/src/server/launcherOptions.ts +12 -13
- package/src/server/launcherPage.ts +2 -2
- package/src/server/nativeMenu.ts +3 -3
- package/src/server/preload.ts +13 -0
- package/src/server/runDesktop.ts +11 -16
- package/src/server/serveDev.ts +8 -2
- package/src/server/surfaceOf.ts +2 -0
- package/src/server/versionOf.ts +1 -2
- package/src/server/withAbideSources.ts +1 -1
- package/src/shared/ADDRESSES.ts +3 -0
- package/src/shared/LAUNCHER_FILES.ts +9 -0
- package/src/shared/RESERVED_DIRECTORIES.ts +19 -4
- package/src/shared/index.ts +2 -1
- package/src/{ui → shared}/menuBridge.ts +1 -1
- package/src/shared/menuItem.ts +2 -2
- package/src/shared/onMenu.ts +58 -0
- package/src/shared/reactive/Cursor.ts +66 -123
- package/src/shared/reactive/Reactive.ts +74 -28
- package/src/shared/reactive/callLoad.ts +4 -18
- package/src/shared/reactive/chunksOfStream.ts +10 -34
- package/src/{ui → shared}/reportMenu.ts +7 -9
- package/src/shared/routePattern.ts +74 -23
- package/src/shared/rpc.ts +1 -1
- package/src/ui/Router.ts +0 -6
- package/src/compiler/syncTypes.ts +0 -32
- package/src/compiler/writeTypes.ts +0 -82
- package/src/server/LAUNCHER_FILES.ts +0 -9
- /package/scaffold/src/{page.abide → index.abide} +0 -0
- /package/src/{compiler → shared}/SPECIFIERS.ts +0 -0
package/docs/RULEBOOK.md
CHANGED
|
@@ -68,6 +68,9 @@ REGISTRY.md because none of them is a name an app author writes.
|
|
|
68
68
|
| sink | What 35.7 defines. |
|
|
69
69
|
| implementation | Anything claiming conformance to this document. |
|
|
70
70
|
| dependency's `.abide` | A `.abide` file under a `node_modules` directory or outside the app's root. |
|
|
71
|
+
| fence | A `server`, `public`, `lib` or `tests` directory. |
|
|
72
|
+
| handler file | A `.ts` of the app's own, neither a `.d.ts` nor a `.test.ts`, directly in a directory under no fence. |
|
|
73
|
+
| private handler | A handler a `<script server>` declares. |
|
|
71
74
|
|
|
72
75
|
RFC 2119 keywords are used as that document defines them: **MUST**, **MUST NOT**, **SHALL**,
|
|
73
76
|
**SHOULD**, **SHOULD NOT**, **MAY**.
|
|
@@ -103,11 +106,11 @@ second.
|
|
|
103
106
|
|
|
104
107
|
2.4 A failed revalidation MUST NOT cause a read to throw.
|
|
105
108
|
|
|
106
|
-
2.5 `s[Symbol.asyncIterator]` MUST
|
|
107
|
-
|
|
109
|
+
2.5 On a value that is not a streaming producer, `s[Symbol.asyncIterator]` MUST settle as `s.then`
|
|
110
|
+
does, yielding once what it resolves with.
|
|
108
111
|
|
|
109
|
-
2.6 On a
|
|
110
|
-
|
|
112
|
+
2.6 On a streaming producer, `s[Symbol.asyncIterator]` MUST yield the chunks of the run being served
|
|
113
|
+
from its first, and MUST end when that run closes.
|
|
111
114
|
|
|
112
115
|
2.7 `s.then` MUST resolve with the value where `s.busy` becomes false and 2.2 would not throw.
|
|
113
116
|
|
|
@@ -267,9 +270,7 @@ the production it serves.
|
|
|
267
270
|
|
|
268
271
|
6.9 An expiry MUST NOT report `s.busy` true.
|
|
269
272
|
|
|
270
|
-
6.10 A
|
|
271
|
-
|
|
272
|
-
6.11 A streaming producer's `ttl` MUST run from its run's close, and MUST NOT reach the run in
|
|
273
|
+
6.10 A streaming producer's `ttl` MUST run from its run's close, and MUST NOT reach the run in
|
|
273
274
|
flight.
|
|
274
275
|
|
|
275
276
|
# 7. Triggers
|
|
@@ -393,6 +394,11 @@ made by one (11.61) MUST end with it.
|
|
|
393
394
|
9.14 A subscriber's copy of a wired `Reactive` MUST report `s.busy` true until the first production
|
|
394
395
|
arrives.
|
|
395
396
|
|
|
397
|
+
9.15 A cursor over a streaming producer MUST throw, once it has yielded every chunk, the failure its
|
|
398
|
+
run ended on.
|
|
399
|
+
|
|
400
|
+
9.16 A cursor over a streaming producer MUST end where a new run replaces the one it was reading.
|
|
401
|
+
|
|
396
402
|
# 10. Sharing
|
|
397
403
|
|
|
398
404
|
10.1 `reactive.share` MUST get or create in one call.
|
|
@@ -775,8 +781,8 @@ states otherwise.
|
|
|
775
781
|
|
|
776
782
|
16.1 A handler MUST be a `reactive`, a plain function, or a value.
|
|
777
783
|
|
|
778
|
-
16.2 `GET`, `POST`, `PUT`, `PATCH` and `DELETE` MUST give
|
|
779
|
-
|
|
784
|
+
16.2 `GET`, `POST`, `PUT`, `PATCH` and `DELETE` MUST give the handler a handler file exports as its
|
|
785
|
+
default an address over http: that file's route, per 23.14.
|
|
780
786
|
|
|
781
787
|
16.3 An `Rpc` MUST hand back the same `Reactive` shape the handler had, `Produced` included.
|
|
782
788
|
|
|
@@ -845,7 +851,7 @@ read it.
|
|
|
845
851
|
16.27 A `schema` MUST run where its `Reactive` lives.
|
|
846
852
|
|
|
847
853
|
16.28 A browser MUST receive a generated `Rpc` wrapper carrying the method, the mount-relative address and
|
|
848
|
-
the description, and MUST NOT receive the `<script server>` that declared it.
|
|
854
|
+
the description, and MUST NOT receive the handler file or the `<script server>` that declared it.
|
|
849
855
|
|
|
850
856
|
16.29 Importing a module under a `server` directory from the client graph MUST be a compile error,
|
|
851
857
|
and MUST NOT be a silent stub.
|
|
@@ -945,7 +951,7 @@ answer `aborted` at 499, and MUST NOT report the throw as unexpected.
|
|
|
945
951
|
|
|
946
952
|
16.64 An `Rpc` over a plain function MUST NOT run that function before the first call reaches it.
|
|
947
953
|
|
|
948
|
-
16.65 Each parameter of the route a handler
|
|
954
|
+
16.65 Each parameter of the route a handler file answers at MUST reach its handler's `Args` from the
|
|
949
955
|
path.
|
|
950
956
|
|
|
951
957
|
16.66 A request naming a parameter of its route in its query or its body as well as its path MUST be
|
|
@@ -961,6 +967,23 @@ Details — and a reader MUST refuse with it after the chunks before it.
|
|
|
961
967
|
16.69 A `[...rest]` segment MUST take the most parts of an address the segments after it leave, so
|
|
962
968
|
a handler declared under one MUST answer at its own name.
|
|
963
969
|
|
|
970
|
+
16.70 A private handler MUST have an address below `/__abide/handlers/`, named by its file's path
|
|
971
|
+
below the root, a segment's brackets and dots dropped, and then its binding's name, and MUST NOT
|
|
972
|
+
take a parameter from the path.
|
|
973
|
+
|
|
974
|
+
16.71 A private handler MUST NOT be listed on `/__abide/mcp`, on `/__abide/openapi.json` or by the
|
|
975
|
+
command line.
|
|
976
|
+
|
|
977
|
+
16.72 A private handler MUST run under the `middleware` and `onError` filed at the route 37.1 files
|
|
978
|
+
its file's hooks at.
|
|
979
|
+
|
|
980
|
+
16.73 A handler file's default export MUST be declared by a call of abide's `GET`, `POST`, `PUT`,
|
|
981
|
+
`PATCH` or `DELETE`, and any other export, however the language spells it, MUST be a build error
|
|
982
|
+
naming it.
|
|
983
|
+
|
|
984
|
+
16.74 A module of the client graph importing a handler file MUST receive the wrapper 16.28 states as
|
|
985
|
+
that file's default.
|
|
986
|
+
|
|
964
987
|
# 17. Response helpers
|
|
965
988
|
|
|
966
989
|
17.1 Every body helper MUST take `Values<T>`.
|
|
@@ -1074,7 +1097,7 @@ their parameters' names being one route.
|
|
|
1074
1097
|
19.3 An implementation MUST NOT accept a predicate as a `Schema`.
|
|
1075
1098
|
|
|
1076
1099
|
19.4 The plain-function `Schema` form MUST throw what it refuses, and that throw MUST be caught where
|
|
1077
|
-
the schema runs and become the `''` entry of `Issues<T>`, or the whole of it per 19.
|
|
1100
|
+
the schema runs and become the `''` entry of `Issues<T>`, or the whole of it per 19.19.
|
|
1078
1101
|
|
|
1079
1102
|
19.5 `Paths<T>` MUST be dot-joined, MUST be depth-limited, and MUST widen to `string` past the limit.
|
|
1080
1103
|
|
|
@@ -1102,30 +1125,24 @@ optional.
|
|
|
1102
1125
|
19.14 A `JsonSchema` given as a `Schema` without `jsonSchema` MUST be refused, naming
|
|
1103
1126
|
`jsonSchema`.
|
|
1104
1127
|
|
|
1105
|
-
19.15
|
|
1106
|
-
`GET`, `POST`, `PUT`, `PATCH` or `DELETE` — however the language spells the export, the call or its
|
|
1107
|
-
import — and an export that is not MUST be a build error naming it.
|
|
1108
|
-
|
|
1109
|
-
19.16 A default in a keyed body's parameter or a handler's parameter that is not a literal MUST
|
|
1128
|
+
19.15 A default in a keyed body's parameter or a handler's parameter that is not a literal MUST
|
|
1110
1129
|
be refused at construction, naming its `Args` member, and the build MUST refuse one on a handler.
|
|
1111
1130
|
|
|
1112
|
-
19.
|
|
1131
|
+
19.16 `route.url` MUST hold the address a page is served at, the path `APP_URL` names included, on
|
|
1113
1132
|
the server as in the browser.
|
|
1114
1133
|
|
|
1115
|
-
19.
|
|
1134
|
+
19.17 A request for the path `APP_URL` names, without its trailing `/`, MUST be redirected 308 to
|
|
1116
1135
|
that path with one, by path alone.
|
|
1117
1136
|
|
|
1118
|
-
19.
|
|
1137
|
+
19.18 A `Schema` derived per 19.9 MUST refuse a member its type does not declare, wherever the type
|
|
1119
1138
|
carries no index signature.
|
|
1120
1139
|
|
|
1121
|
-
19.
|
|
1140
|
+
19.19 An `Issues<T>` over a value that is not an object MUST be the bare list of messages, not a
|
|
1122
1141
|
record keyed by `''`.
|
|
1123
1142
|
|
|
1124
|
-
19.
|
|
1143
|
+
19.20 A request MUST be answered by the most specific route answering its method, ranked as 30.9
|
|
1125
1144
|
ranks routes for `navigate`.
|
|
1126
1145
|
|
|
1127
|
-
19.22 A `<script server>` that re-exports with `export * from` MUST be a build error naming its file.
|
|
1128
|
-
|
|
1129
1146
|
# 20. Generated surfaces
|
|
1130
1147
|
|
|
1131
1148
|
20.1 Every surface `Clients` names MUST be derived from the route table, and MUST NOT be authored
|
|
@@ -1150,8 +1167,8 @@ lists a handler for it. What a closed one answers is 36.7.
|
|
|
1150
1167
|
|
|
1151
1168
|
20.8 Every `/__abide/**` address MUST run inside the app's own middleware.
|
|
1152
1169
|
|
|
1153
|
-
20.9 `/__abide/mcp` MUST publish
|
|
1154
|
-
|
|
1170
|
+
20.9 `/__abide/mcp` MUST publish every handler it lists as a tool, a `GET` taking no args included,
|
|
1171
|
+
and MUST NOT publish one as a resource.
|
|
1155
1172
|
|
|
1156
1173
|
20.10 A handler whose own `Middleware` rung would refuse a caller MUST still be listed, and MUST
|
|
1157
1174
|
still be refused on the call.
|
|
@@ -1251,7 +1268,7 @@ composite.
|
|
|
1251
1268
|
|
|
1252
1269
|
23.2 `route.url` MUST be one `URL` instance per navigation, built when the route resolves.
|
|
1253
1270
|
|
|
1254
|
-
23.3 A page route MUST be created where a
|
|
1271
|
+
23.3 A page route MUST be created where a `.abide` 23.21 makes a page has a template or a head.
|
|
1255
1272
|
|
|
1256
1273
|
23.4 A page route's file path MUST determine its `route.url`.
|
|
1257
1274
|
|
|
@@ -1275,25 +1292,32 @@ segment a page below it adds.
|
|
|
1275
1292
|
|
|
1276
1293
|
23.13 `reachable` MUST ask a host that names no scheme over https, and an origin as written.
|
|
1277
1294
|
|
|
1278
|
-
23.14 A route MUST be the path of its file
|
|
1295
|
+
23.14 A route MUST be the path of its file below the app's `--root` without its extension, and an
|
|
1296
|
+
`index.abide`'s, a `layout.abide`'s and an `error.abide`'s MUST be its directory's.
|
|
1279
1297
|
|
|
1280
|
-
23.15 A file under a
|
|
1298
|
+
23.15 A file under a fence MUST NOT have a route.
|
|
1281
1299
|
|
|
1282
|
-
23.16 A
|
|
1283
|
-
|
|
1300
|
+
23.16 A fence under a fence MUST be a build error naming both, save a `server` directory under a
|
|
1301
|
+
`lib` or a `tests` directory.
|
|
1284
1302
|
|
|
1285
1303
|
23.17 A route whose first segment is `__abide` MUST be a build error.
|
|
1286
1304
|
|
|
1287
|
-
23.18
|
|
1288
|
-
MUST be a build error.
|
|
1305
|
+
23.18 An `index.abide`, a `layout.abide` or an `error.abide` under a fence MUST be a build error.
|
|
1289
1306
|
|
|
1290
1307
|
23.19 An `import '…' with { type: 'routes' }` in an app's `.abide` MUST place every `.abide` under the
|
|
1291
|
-
directory it names at the importing file's directory, routed by its path
|
|
1292
|
-
as 23.14 routes the app's own, and a specifier naming no directory MUST be a build error.
|
|
1308
|
+
directory it names, and every handler file, at the importing file's directory, routed by its path
|
|
1309
|
+
below the named directory as 23.14 routes the app's own, and a specifier naming no directory MUST be a build error.
|
|
1293
1310
|
|
|
1294
1311
|
23.20 A directory two `type: 'routes'` imports name, or one that is the app's own, MUST be a build
|
|
1295
1312
|
error naming the mount.
|
|
1296
1313
|
|
|
1314
|
+
23.21 A `.abide` of the app's own directly in a directory under no fence MUST be a page, save a
|
|
1315
|
+
`layout.abide`, an `error.abide` and the root's `launcher.abide`.
|
|
1316
|
+
|
|
1317
|
+
23.22 A file of the app's own directly in a directory under no fence that is neither a `.abide` nor
|
|
1318
|
+
a handler file MUST be a build error naming the file and a `lib` directory, save one beside the
|
|
1319
|
+
`package.json` of a root that holds it, nor a `.ts`.
|
|
1320
|
+
|
|
1297
1321
|
# 24. Tracing
|
|
1298
1322
|
|
|
1299
1323
|
24.1 `trace` MUST be built on first ask and held for the request.
|
|
@@ -1412,7 +1436,7 @@ module ran is not the one served after it.
|
|
|
1412
1436
|
27.12 `Config` MUST admit a field an app declares on it, of any type.
|
|
1413
1437
|
|
|
1414
1438
|
27.13 `abide check` and `abide lsp` MUST type `Config` with what the defaults of every `onConfig`
|
|
1415
|
-
called as a statement at the top of a `<script server>` return, and a union return with the keys
|
|
1439
|
+
called as a statement at the top of a `<script server>` or a handler file return, and a union return with the keys
|
|
1416
1440
|
every member of it has.
|
|
1417
1441
|
|
|
1418
1442
|
# 28. Logging
|
|
@@ -1492,7 +1516,7 @@ segment.
|
|
|
1492
1516
|
30.7 `navigate` MUST navigate, and MUST NOT reload the document.
|
|
1493
1517
|
|
|
1494
1518
|
30.8 A route `url` and `navigate` take MUST be a page route, per 23.14, and MUST NOT be a handler
|
|
1495
|
-
|
|
1519
|
+
file's.
|
|
1496
1520
|
|
|
1497
1521
|
30.9 `navigate` MUST match the most specific route, ranking a static segment above a required
|
|
1498
1522
|
one, a required above an optional, and an optional above a rest, and where one route ends, its end
|
|
@@ -1878,64 +1902,46 @@ compiles to, as a static import of it does.
|
|
|
1878
1902
|
34.16 A `.abide` file a server module imports MUST resolve to a function that binds its props and
|
|
1879
1903
|
answers a `Component`, under `abide dev`, `abide start` and `abide compile` alike.
|
|
1880
1904
|
|
|
1881
|
-
34.17
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
34.18 A `<script>` that exports MUST be a compile error.
|
|
1905
|
+
34.17 An `export` in any script block of a `.abide`, however the language spells it, MUST be a compile
|
|
1906
|
+
error.
|
|
1885
1907
|
|
|
1886
|
-
34.
|
|
1908
|
+
34.18 A write a `<script>` makes outside any function to a `let` or `var` its file's
|
|
1887
1909
|
`<script module>` declares, holding no `Reactive`, MUST be warned on.
|
|
1888
1910
|
|
|
1889
|
-
34.
|
|
1911
|
+
34.19 A `<script server>` block MUST be module scope run on a server alone, and the module a browser
|
|
1890
1912
|
loads MUST NOT carry it.
|
|
1891
1913
|
|
|
1892
|
-
34.
|
|
1914
|
+
34.20 A `<script server>` in a `.abide` file of the app's own under a `server` or `public` directory
|
|
1893
1915
|
MUST be a compile error.
|
|
1894
1916
|
|
|
1895
|
-
34.
|
|
1896
|
-
|
|
1897
|
-
34.23 A handler a `<script server>` exports MUST be exported from the module a browser loads as the
|
|
1898
|
-
wrapper 16.28 states, under the same name.
|
|
1899
|
-
|
|
1900
|
-
34.24 `abide sync`, `abide check`, `abide dev` and `abide build` MUST write, for every `.abide`
|
|
1901
|
-
under the root, a module typing what its `<script module>` and `<script server>` export, below
|
|
1902
|
-
`.abide/types` at the path the file has below the directory above the root, and MUST remove one whose
|
|
1903
|
-
`.abide` is gone; `abide lsp` MUST write an open file's as the editor holds it, and the scaffold MUST
|
|
1904
|
-
run `abide sync` on install without failing the install where it fails. A file `abide sync` or
|
|
1905
|
-
`abide check` refuses MUST be named, and MUST NOT stop the others being typed.
|
|
1906
|
-
|
|
1907
|
-
34.25 A file a script block imports `with { type: 'text' }`, a `.abide` among them, MUST be imported
|
|
1917
|
+
34.21 A file a script block imports `with { type: 'text' }`, a `.abide` among them, MUST be imported
|
|
1908
1918
|
as its text and typed a `string`, on a server, in a browser and to the checker alike.
|
|
1909
1919
|
|
|
1910
|
-
34.
|
|
1920
|
+
34.22 A binding a `<script server>` imports that its file's `<script module>` or `<script>` imports
|
|
1911
1921
|
from the same specifier under the same name MUST compile as that one binding, a value wherever any
|
|
1912
1922
|
of them imports it as one. Where that binding is a `.abide`'s default or namespace imported as a
|
|
1913
1923
|
value by both, it MUST be a compile error, since the server block's is the bound function (34.16)
|
|
1914
1924
|
and the other's the module (32.17).
|
|
1915
1925
|
|
|
1916
|
-
34.
|
|
1926
|
+
34.23 A `.abide` file any script block imports MUST be compiled with the app that imports it,
|
|
1917
1927
|
wherever it lies.
|
|
1918
1928
|
|
|
1919
|
-
34.
|
|
1929
|
+
34.24 A dependency's `.abide` MUST be a component, and MUST NOT be an address, save where a mount
|
|
1920
1930
|
places it (23.19).
|
|
1921
1931
|
|
|
1922
|
-
34.
|
|
1923
|
-
|
|
1924
|
-
34.30 A dependency's `.abide` MUST run on the abide that the app's root resolves.
|
|
1932
|
+
34.25 A dependency's `.abide` MUST be typed by the project of the app that imports it.
|
|
1925
1933
|
|
|
1926
|
-
34.
|
|
1927
|
-
save the one a mount places it at (23.19).
|
|
1934
|
+
34.26 A dependency's `.abide` MUST run on the abide that the app's root resolves.
|
|
1928
1935
|
|
|
1929
|
-
34.
|
|
1930
|
-
|
|
1931
|
-
NOT be read by evaluating the module during a build.
|
|
1936
|
+
34.27 A dependency's `.ts` MUST NOT give a handler an address, save the one a mount places it at
|
|
1937
|
+
(23.19).
|
|
1932
1938
|
|
|
1933
|
-
34.
|
|
1939
|
+
34.28 A `<script>` carrying a `server` attribute with a value, or beside any other attribute, MUST be
|
|
1934
1940
|
a compile error.
|
|
1935
1941
|
|
|
1936
|
-
34.
|
|
1942
|
+
34.29 A `</script>` that closes no `<script>` MUST be a compile error.
|
|
1937
1943
|
|
|
1938
|
-
34.
|
|
1944
|
+
34.30 A `</script>` inside a string, a template, a comment or a regular expression in a `<script>`,
|
|
1939
1945
|
`<script module>` or `<script server>` block MUST be a compile error.
|
|
1940
1946
|
|
|
1941
1947
|
# 35. Pages, rendering and sinks
|
|
@@ -2037,8 +2043,9 @@ answered per 41.12.
|
|
|
2037
2043
|
|
|
2038
2044
|
# 37. Lifecycle hooks
|
|
2039
2045
|
|
|
2040
|
-
37.1 A lifecycle hook MUST be
|
|
2041
|
-
|
|
2046
|
+
37.1 A lifecycle hook MUST be filed at the route of the `.abide` or the handler file that called it,
|
|
2047
|
+
one under a `lib` or a `tests` directory at the route of the directory holding that one, and at the
|
|
2048
|
+
root route where neither did.
|
|
2042
2049
|
|
|
2043
2050
|
37.2 `middleware` filed below the root route MUST run after routing, over a request its route or a
|
|
2044
2051
|
route below it answers, outermost route first.
|
|
@@ -2075,6 +2082,9 @@ through `App.stop`, and the process MUST then exit with 0.
|
|
|
2075
2082
|
|
|
2076
2083
|
37.12 A second `SIGTERM` or `SIGINT` while the app is stopping MUST end the process at once.
|
|
2077
2084
|
|
|
2085
|
+
37.13 A lifecycle hook called in a module of the app's own that is neither a `.abide` nor a handler
|
|
2086
|
+
file MUST be a build error naming the module and the hook.
|
|
2087
|
+
|
|
2078
2088
|
# 38. Commands
|
|
2079
2089
|
|
|
2080
2090
|
38.1 `abide scaffold` MUST write a starter project, and MUST skip a step already done.
|
|
@@ -2217,7 +2227,7 @@ and open 38.7's shell on it.
|
|
|
2217
2227
|
38.55 Input that ends MUST NOT stop the app `abide` serves under 38.53.
|
|
2218
2228
|
|
|
2219
2229
|
38.56 A script the executable's `run` imports MUST resolve `abide`'s entries and the app's handler
|
|
2220
|
-
|
|
2230
|
+
files to the ones the executable holds.
|
|
2221
2231
|
|
|
2222
2232
|
38.57 `abide run` and the executable's `run` MUST resolve the configuration under the app's identity.
|
|
2223
2233
|
|
|
@@ -2283,18 +2293,18 @@ as 38.46 names the executable.
|
|
|
2283
2293
|
38.79 `abide bundle` MUST give the `.app` the icon the public file answered at `/icon.icns` holds,
|
|
2284
2294
|
or one drawn at every size from the one at `/icon.png` where there is no `.icns`.
|
|
2285
2295
|
|
|
2286
|
-
38.80 The desktop app MUST read the `
|
|
2287
|
-
|
|
2288
|
-
|
|
2296
|
+
38.80 The desktop app MUST read what the `onLauncher` `src/launcher.abide` calls answers as it
|
|
2297
|
+
launches, and MUST refuse to launch on a key it does not take, or a value of a type the key does not
|
|
2298
|
+
take.
|
|
2289
2299
|
|
|
2290
2300
|
38.81 `LauncherOptions` MUST NOT admit turning off both `start` and `connect`, and the desktop app
|
|
2291
|
-
MUST refuse to launch on
|
|
2301
|
+
MUST refuse to launch on an `onLauncher` answer that does.
|
|
2292
2302
|
|
|
2293
2303
|
38.82 Where the app's `src/launcher.abide` has markup of its own, the launcher MUST render it
|
|
2294
2304
|
through `render`, bound to the `Launch` it would show, in place of its own page; one holding script
|
|
2295
2305
|
blocks alone MUST leave the launcher's own page standing.
|
|
2296
2306
|
|
|
2297
|
-
38.83 A form
|
|
2307
|
+
38.83 A form `onLauncher` turns off MUST have no address in `Launch`, MUST NOT be
|
|
2298
2308
|
answered, and MUST NOT be done again at launch, and turning `connect` off MUST take the `connect`
|
|
2299
2309
|
item out of the default menu bar.
|
|
2300
2310
|
|
|
@@ -2304,28 +2314,29 @@ document it renders into.
|
|
|
2304
2314
|
38.85 A `src/launcher.abide` that fails to render MUST reach `onError`, and the launcher MUST
|
|
2305
2315
|
show its own page in its place.
|
|
2306
2316
|
|
|
2307
|
-
38.86 The window MUST open at the `
|
|
2317
|
+
38.86 The window MUST open at the `width` and `height` `onLauncher` answers where no launch
|
|
2308
2318
|
before it left a size, and MUST NOT be resized below its `minWidth` and `minHeight`.
|
|
2309
2319
|
|
|
2310
2320
|
38.87 The app's package name, as 38.46 names the executable, MUST name the app in its bundle, its
|
|
2311
2321
|
menu bar and its `Launch`.
|
|
2312
2322
|
|
|
2313
2323
|
38.88 The desktop app's menu bar MUST be the application, File, Edit, View and Window menus, with
|
|
2314
|
-
the `
|
|
2315
|
-
|
|
2324
|
+
the items every `onMenu` filed by the layouts and the page the window shows answers, outermost
|
|
2325
|
+
first: a menu whose `label` names one already standing appends its
|
|
2316
2326
|
items to that one, and any other stands before Window.
|
|
2317
2327
|
|
|
2318
2328
|
38.89 A `MenuItem` whose `MenuRole` AppKit answers MUST be sent down the responder chain, and MUST
|
|
2319
2329
|
be disabled where nothing in the chain answers it.
|
|
2320
2330
|
|
|
2321
|
-
38.90 Picking a `MenuItem` with an `href` MUST `navigate` to it in the page that
|
|
2331
|
+
38.90 Picking a `MenuItem` with an `href` MUST `navigate` to it in the page that filed it.
|
|
2322
2332
|
|
|
2323
|
-
38.91 Picking a `menuItem` MUST run every function its `on` filed, in the page that
|
|
2333
|
+
38.91 Picking a `menuItem` MUST run every function its `on` filed, in the page that filed it,
|
|
2324
2334
|
whether the launcher serves that app or connected to it, and a throw from one MUST NOT stop the
|
|
2325
2335
|
rest.
|
|
2326
2336
|
|
|
2327
|
-
38.92 The menu bar MUST be told again after every navigation the page makes
|
|
2328
|
-
|
|
2337
|
+
38.92 The menu bar MUST be told again after every navigation the page makes and after every change
|
|
2338
|
+
to what an `onMenu` it filed read, and MUST be the default alone from each load the launcher starts
|
|
2339
|
+
until the page loaded tells it its route's menus.
|
|
2329
2340
|
|
|
2330
2341
|
38.93 The executable `abide compile` writes MUST carry the app's code as bytecode, and MUST still
|
|
2331
2342
|
report an error at its source line.
|
|
@@ -2355,8 +2366,8 @@ last checked holds there, as 38.39 answers a hover.
|
|
|
2355
2366
|
`abide bundle` runs, and the platform's own accent where the icon gives none; `Launch` MUST carry
|
|
2356
2367
|
the accent and the icon to `src/launcher.abide`.
|
|
2357
2368
|
|
|
2358
|
-
38.102 The launcher's own page MUST show the app's icon, its name and a button for each form
|
|
2359
|
-
`
|
|
2369
|
+
38.102 The launcher's own page MUST show the app's icon, its name and a button for each form
|
|
2370
|
+
`onLauncher` leaves on. A button whose form asks for anything MUST open it in a modal dialog,
|
|
2360
2371
|
a start that asks for nothing MUST start at once, a refused start or connect MUST show its dialog
|
|
2361
2372
|
open on the refusal, and the `connect` menu role MUST show the connect dialog open.
|
|
2362
2373
|
|
|
@@ -2371,6 +2382,15 @@ published package holds.
|
|
|
2371
2382
|
38.106 The documentation the instructions `abide scaffold` writes name (38.104) MUST be every page
|
|
2372
2383
|
as one markdown file, in reading order.
|
|
2373
2384
|
|
|
2385
|
+
38.107 `onLauncher` called anywhere but `src/launcher.abide` MUST be a build error naming that file.
|
|
2386
|
+
|
|
2387
|
+
38.108 `abide routes` MUST print every route with each method it answers and the file answering
|
|
2388
|
+
it, every private handler with its address and its file, and every hook with the file that filed it;
|
|
2389
|
+
with `--json` it MUST print the same as one JSON document.
|
|
2390
|
+
|
|
2391
|
+
38.109 Under `bun test` with `@abide/abide/test` preloaded, a test MUST import a `.abide` of the app as
|
|
2392
|
+
the module it compiles to, whether or not `createApp` has run.
|
|
2393
|
+
|
|
2374
2394
|
# 39. Head and view transitions
|
|
2375
2395
|
|
|
2376
2396
|
39.1 A `<head>` element in a `.abide` file MUST contribute its children to the document head.
|
|
@@ -2496,13 +2516,14 @@ forms, the options they share, and a link to its reference page.
|
|
|
2496
2516
|
|
|
2497
2517
|
40.32 A page reporting the build's own results MUST NOT be listed in `SITE`.
|
|
2498
2518
|
|
|
2499
|
-
40.33 A documentation page MUST be
|
|
2519
|
+
40.33 A documentation page MUST be an `index.abide` written by hand at its route, and its title, nav
|
|
2500
2520
|
label, intent, lead, app and `covers` MUST be its `SITE` entry's alone.
|
|
2501
2521
|
|
|
2502
|
-
40.34 An `<Example>` MUST render a component in the directory
|
|
2503
|
-
component's handlers, hooks and data MUST be in its own file, save a file the example is
|
|
2522
|
+
40.34 An `<Example>` MUST render a component in the `lib` directory beside the page that embeds it,
|
|
2523
|
+
and that component's handlers, hooks and data MUST be in its own file, save a file the example is
|
|
2524
|
+
about.
|
|
2504
2525
|
|
|
2505
|
-
40.35 A page's `.md` twin MUST be derived from what its `
|
|
2526
|
+
40.35 A page's `.md` twin MUST be derived from what its `index.abide` renders.
|
|
2506
2527
|
|
|
2507
2528
|
# 41. Rendering and hydration
|
|
2508
2529
|
|