@voxgig/sdkgen 4.16.0 → 4.17.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 +8 -0
- package/bin/voxgig-sdkgen +2 -2
- package/dist/action/action.js +2 -2
- package/dist/action/action.js.map +1 -1
- package/dist/action/check.js +9 -8
- package/dist/action/check.js.map +1 -1
- package/dist/action/dispatch.js +4 -4
- package/dist/action/dispatch.js.map +1 -1
- package/dist/action/doctor.js +16 -15
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/edition.d.ts +4 -0
- package/dist/action/{docs.js → edition.js} +57 -54
- package/dist/action/edition.js.map +1 -0
- package/dist/action/kind.d.ts +1 -2
- package/dist/action/kind.js +22 -38
- package/dist/action/kind.js.map +1 -1
- package/dist/action/package.js +17 -16
- package/dist/action/package.js.map +1 -1
- package/dist/action/resolve.d.ts +3 -1
- package/dist/action/resolve.js +29 -11
- package/dist/action/resolve.js.map +1 -1
- package/dist/admin/status.d.ts +43 -0
- package/dist/admin/status.js +161 -0
- package/dist/admin/status.js.map +1 -0
- package/dist/cmp/Test.js +11 -0
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/kindCollection.d.ts +1 -0
- package/dist/helpers/kindCollection.js +14 -0
- package/dist/helpers/kindCollection.js.map +1 -0
- package/dist/helpers/modelcheck.d.ts +1 -1
- package/dist/helpers/modelcheck.js +13 -3
- package/dist/helpers/modelcheck.js.map +1 -1
- package/dist/helpers/shipped.js +2 -3
- package/dist/helpers/shipped.js.map +1 -1
- package/dist/helpers/testPolicy.d.ts +1 -1
- package/dist/helpers/testPolicy.js +6 -37
- package/dist/helpers/testPolicy.js.map +1 -1
- package/dist/sdkgen.d.ts +1 -1
- package/dist/sdkgen.js +22 -89
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.js +9 -1
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aon +5 -52
- package/package.json +1 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +4 -4
- package/project/.sdk/src/cmp/go/utility_go.ts +10 -2
- package/project/.sdk/src/cmp/js/Package_js.ts +5 -1
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +11 -7
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +16 -2
- package/project/.sdk/src/cmp/js/TestLive_js.ts +32 -0
- package/project/.sdk/src/cmp/js/Test_js.ts +2 -0
- package/project/.sdk/src/cmp/js/fragment/Direct.test.fragment.js +1 -1
- package/project/.sdk/src/cmp/js/fragment/Entity.test.fragment.js +4 -2
- package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +30 -9
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +8 -3
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +5 -4
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +2 -2
- package/project/.sdk/src/cmp/ts/Package_ts.ts +5 -1
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +5 -0
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +15 -11
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +13 -16
- package/project/.sdk/src/cmp/ts/TestLive_ts.ts +32 -0
- package/project/.sdk/src/cmp/ts/Test_ts.ts +2 -0
- package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +1 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -0
- package/project/.sdk/tm/c/Makefile +16 -11
- package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +3 -3
- package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +9 -2
- package/project/.sdk/tm/js/test/live-contract.js +183 -0
- package/project/.sdk/tm/js/test/live-entity.js +169 -0
- package/project/.sdk/tm/js/test/live-runner.js +129 -0
- package/project/.sdk/tm/js/test/live-scenarios.js +142 -0
- package/project/.sdk/tm/js/test/utility.js +84 -0
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +22 -20
- package/project/.sdk/tm/ts/test/live-contract.ts +104 -0
- package/project/.sdk/tm/ts/test/live-entity.ts +142 -0
- package/project/.sdk/tm/ts/test/live-runner.ts +166 -0
- package/project/.sdk/tm/ts/test/live-scenarios.ts +112 -0
- package/project/.sdk/tm/ts/test/utility.ts +1 -2
- package/project/sdkgen-package.json +1 -1
- package/src/action/action.ts +2 -2
- package/src/action/check.ts +3 -2
- package/src/action/dispatch.ts +4 -4
- package/src/action/doctor.ts +10 -9
- package/src/action/{docs.ts → edition.ts} +56 -53
- package/src/action/kind.ts +12 -33
- package/src/action/package.ts +4 -3
- package/src/action/resolve.ts +26 -2
- package/src/admin/status.ts +124 -0
- package/src/cmp/Test.ts +13 -1
- package/src/helpers/kindCollection.ts +11 -0
- package/src/helpers/modelcheck.ts +10 -3
- package/src/helpers/shipped.ts +2 -3
- package/src/helpers/testPolicy.ts +7 -45
- package/src/sdkgen.ts +15 -94
- package/src/utility.ts +8 -2
- package/dist/action/docs.d.ts +0 -4
- package/dist/action/docs.js.map +0 -1
- package/dist/cmp/Docs.d.ts +0 -4
- package/dist/cmp/Docs.js +0 -98
- package/dist/cmp/Docs.js.map +0 -1
- package/dist/cmp/ExternalDocs.d.ts +0 -2
- package/dist/cmp/ExternalDocs.js +0 -43
- package/dist/cmp/ExternalDocs.js.map +0 -1
- package/src/cmp/Docs.ts +0 -125
- package/src/cmp/ExternalDocs.ts +0 -54
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
// project's own file, not the package's.
|
|
34
34
|
|
|
35
35
|
import { Aontu } from 'aontu'
|
|
36
|
+
import { createRequire } from 'node:module'
|
|
37
|
+
import Path from 'node:path'
|
|
36
38
|
|
|
37
39
|
import { schemaFile } from './shipped'
|
|
38
40
|
|
|
@@ -112,8 +114,8 @@ function slashComments(text: string): { line: number, text: string }[] {
|
|
|
112
114
|
// A FRESH INSTANCE each time: the option call mutates the instance's jsonic,
|
|
113
115
|
// so a cached one would leak its configuration into the bare compile that is
|
|
114
116
|
// deliberately paired with it.
|
|
115
|
-
function strictAontu(): any {
|
|
116
|
-
const aontu: any = new Aontu()
|
|
117
|
+
function strictAontu(options?: any): any {
|
|
118
|
+
const aontu: any = new Aontu(options)
|
|
117
119
|
aontu.lang.jsonic.options({ comment: { def: { slash: null, multi: null } } })
|
|
118
120
|
return aontu
|
|
119
121
|
}
|
|
@@ -186,7 +188,12 @@ function compileModel(
|
|
|
186
188
|
includeLine(schemaFile()) + '\n' + src : src
|
|
187
189
|
|
|
188
190
|
try {
|
|
189
|
-
|
|
191
|
+
// Resolve package includes from the model being checked, including native
|
|
192
|
+
// package self-references. The SDK toolchain's dependencies are unrelated.
|
|
193
|
+
const localRequire = Object.assign(createRequire(Path.resolve(path)), { main: require.main })
|
|
194
|
+
// Aontu forwards this runtime resolver option to Lang; its public type omits it.
|
|
195
|
+
const options: any = { require: localRequire }
|
|
196
|
+
const aontu = false === opts?.strict ? new Aontu(options) : strictAontu(options)
|
|
190
197
|
const model = aontu.generate(text, { path, errs })
|
|
191
198
|
|
|
192
199
|
return {
|
package/src/helpers/shipped.ts
CHANGED
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
// installation doing the checking, which is this one.
|
|
10
10
|
//
|
|
11
11
|
// `__dirname` is `dist/helpers` in the shipped package, so the package root is
|
|
12
|
-
// two levels up.
|
|
13
|
-
//
|
|
14
|
-
// fails on drift).
|
|
12
|
+
// two levels up. The authoritative schema lives directly in its model/
|
|
13
|
+
// directory, in both a checkout and an installed package.
|
|
15
14
|
|
|
16
15
|
import Path from 'node:path'
|
|
17
16
|
|
|
@@ -1,52 +1,14 @@
|
|
|
1
|
-
// How strict the generated LIVE tests are.
|
|
2
|
-
//
|
|
3
|
-
// WHY THIS IS A MODEL DECISION
|
|
4
|
-
//
|
|
5
|
-
// The generated direct tests are deliberately lenient in live mode:
|
|
6
|
-
//
|
|
7
|
-
// if (setup.live) {
|
|
8
|
-
// // Live mode is lenient: synthetic IDs frequently 4xx.
|
|
9
|
-
// if (!result.ok || result.status < 200 || result.status >= 300) {
|
|
10
|
-
// return // <-- passes
|
|
11
|
-
// }
|
|
12
|
-
// } else {
|
|
13
|
-
// assert(result.ok === true)
|
|
14
|
-
// ...
|
|
15
|
-
// }
|
|
16
|
-
//
|
|
17
|
-
// That is CORRECT for sdkgen's default case — a fleet SDK generated against
|
|
18
|
-
// an arbitrary third-party public API, where synthetic IDs 4xx constantly and
|
|
19
|
-
// list response shapes vary wildly. Asserting there would mean permanent red.
|
|
20
|
-
//
|
|
21
|
-
// It is WRONG for a project that owns the server it tests against, and those
|
|
22
|
-
// projects had no way to say so. Measured on voxgig-solardemo-sdk: the live
|
|
23
|
-
// TypeScript suite reports 186 pass / 0 fail against the local test app —
|
|
24
|
-
// and 184 pass / 2 fail with the server STOPPED. Only the two entity `basic`
|
|
25
|
-
// flows noticed. A green live run said almost nothing.
|
|
26
|
-
//
|
|
27
|
-
// Gaps that announce themselves as a passing test suite are worse than the
|
|
28
|
-
// ones that break a build.
|
|
29
|
-
|
|
30
1
|
import { KIT } from '../types'
|
|
31
2
|
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
// main: kit: test: live: strict: true
|
|
37
|
-
// main: kit: target: go: test: live: strict: true
|
|
3
|
+
// Live requests assert success by default. This never enables fail-fast:
|
|
4
|
+
// independent tests continue and their framework aggregates the failures.
|
|
5
|
+
// An explicit false preserves the legacy exploratory policy for callers
|
|
6
|
+
// migrating a fleet; it must not be confused with full live verification.
|
|
38
7
|
function liveStrict(model: any, target?: string): boolean {
|
|
39
8
|
const perTarget = null == target ? undefined :
|
|
40
9
|
model?.main?.[KIT]?.target?.[target]?.test?.live?.strict
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return true === perTarget
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return true === model?.main?.[KIT]?.test?.live?.strict
|
|
10
|
+
const configured = perTarget ?? model?.main?.[KIT]?.test?.live?.strict
|
|
11
|
+
return false !== configured
|
|
47
12
|
}
|
|
48
13
|
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
liveStrict,
|
|
52
|
-
}
|
|
14
|
+
export { liveStrict }
|
package/src/sdkgen.ts
CHANGED
|
@@ -24,8 +24,6 @@ import { SdkGenError, requirePath, isAuthActive, resolveAuthPrefix, isHttpBasicA
|
|
|
24
24
|
import { Main } from './cmp/Main'
|
|
25
25
|
import { featureApplies, targetFeatures, featureTags, unknownTags, TAGS } from './helpers/applicability'
|
|
26
26
|
import { ExternalTarget } from './cmp/ExternalTarget'
|
|
27
|
-
import { Docs, DocsItem } from './cmp/Docs'
|
|
28
|
-
import { ExternalDocs } from './cmp/ExternalDocs'
|
|
29
27
|
|
|
30
28
|
import { KIT } from '@voxgig/apidef'
|
|
31
29
|
import { Deploy } from './cmp/Deploy'
|
|
@@ -150,7 +148,7 @@ import {
|
|
|
150
148
|
|
|
151
149
|
import { cmd_package_check } from './action/check'
|
|
152
150
|
|
|
153
|
-
import {
|
|
151
|
+
import { edition_add } from './action/edition'
|
|
154
152
|
|
|
155
153
|
// The verbs, built from the kind registry — see action/dispatch.
|
|
156
154
|
import { ACTION_MAP, actionNames, needsModel } from './action/dispatch'
|
|
@@ -350,7 +348,7 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
350
348
|
// if it appeared between those checks, the pass could write into content
|
|
351
349
|
// that was never ownership-validated.
|
|
352
350
|
const external: ExternalPlan[] =
|
|
353
|
-
externalItems(model, root, ['target'
|
|
351
|
+
externalItems(model, root, ['target'], externalOverride)
|
|
354
352
|
.map((ext) => ({ ...ext, skip: externalSkipReason(ext, fs) }))
|
|
355
353
|
|
|
356
354
|
// Before ANY file is written, in-tree included: a destination that turns
|
|
@@ -363,74 +361,13 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
363
361
|
|
|
364
362
|
showChanges(jopts.log, 'generate-result', jres, Path.dirname(process.cwd()))
|
|
365
363
|
|
|
366
|
-
//
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
// before `docs add` did anything. A second pass costs one more changes
|
|
372
|
-
// report and makes the kind work in projects that predate it, which is
|
|
373
|
-
// the whole point of putting the destinations in packages.
|
|
374
|
-
//
|
|
375
|
-
// Items with `output: path` are excluded here and generated by the loop
|
|
376
|
-
// below, exactly as out-of-tree targets are.
|
|
377
|
-
const intreedocs = Object.keys(model?.main?.[KIT]?.docs ?? {})
|
|
378
|
-
.filter((name: string) => {
|
|
379
|
-
const item = model.main[KIT].docs[name]
|
|
380
|
-
const path = item?.output?.path
|
|
381
|
-
return false !== item?.active && (null == path || '' === path)
|
|
364
|
+
// Docgen owns editions, destinations, templates, text QA and deployment.
|
|
365
|
+
if (model?.main?.[KIT]?.doc?.active !== false && Object.values(model?.main?.[KIT]?.doc?.edition ?? {})
|
|
366
|
+
.some((item: any) => item.active !== false)) {
|
|
367
|
+
const docgenPath = require.resolve('@voxgig/docgen', {
|
|
368
|
+
paths: [Path.join(root, '.sdk')],
|
|
382
369
|
})
|
|
383
|
-
|
|
384
|
-
// AN IN-TREE DOCS ITEM AND A TARGET CANNOT SHARE A NAME.
|
|
385
|
-
//
|
|
386
|
-
// `docs` and `target` are separate namespaces — deliberately, so an item
|
|
387
|
-
// of each may be called `api` — and their `.sdk` trees are nested apart
|
|
388
|
-
// (`src/cmp/docs/<n>` vs `src/cmp/<n>`), so installing both is fine.
|
|
389
|
-
//
|
|
390
|
-
// Their GENERATED destinations are not separate. Both render into
|
|
391
|
-
// `<sdk-repo>/<name>/`, the docs pass runs second, and jostraca is
|
|
392
|
-
// last-write-wins — so a docs item named `go` would quietly overwrite the
|
|
393
|
-
// Go SDK's README, and whatever else the two have in common, leaving a
|
|
394
|
-
// corrupt SDK and a green run.
|
|
395
|
-
//
|
|
396
|
-
// Refused rather than reordered, and refused BEFORE the docs pass writes
|
|
397
|
-
// anything: this is the in-tree half of the rule `checkExternalFolders`
|
|
398
|
-
// enforces for out-of-tree destinations, and the fix is the same either
|
|
399
|
-
// way — give one of them `output: path`, or rename it.
|
|
400
|
-
const targets: any = model?.main?.[KIT]?.target ?? {}
|
|
401
|
-
|
|
402
|
-
for (const name of intreedocs) {
|
|
403
|
-
const target = targets[name]
|
|
404
|
-
|
|
405
|
-
if (null == target || false === target.active) {
|
|
406
|
-
continue
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
const tpath = target.output?.path
|
|
410
|
-
|
|
411
|
-
if (null != tpath && '' !== tpath) {
|
|
412
|
-
continue
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
throw new SdkGenError(
|
|
416
|
-
'Docs item "' + name + '" and target "' + name + '" would both ' +
|
|
417
|
-
'generate into <sdk-project>/' + name + '/.\n' +
|
|
418
|
-
' They are separate kinds, so sharing a name is legal — but they ' +
|
|
419
|
-
'share one output folder, and the docs pass runs second, so it ' +
|
|
420
|
-
'would overwrite the SDK.\n' +
|
|
421
|
-
' Give one of them `output: path`, or rename it.')
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if (0 < intreedocs.length) {
|
|
425
|
-
log.info({
|
|
426
|
-
point: 'generate-docs-start', docs: intreedocs,
|
|
427
|
-
note: intreedocs.join(', ')
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
const dres = await jostraca.generate(jopts, () => Docs({ model }))
|
|
431
|
-
|
|
432
|
-
showChanges(jopts.log, 'generate-docs-result', dres,
|
|
433
|
-
Path.dirname(process.cwd()))
|
|
370
|
+
await require(docgenPath).generate({ ...jopts, folder: root, model })
|
|
434
371
|
}
|
|
435
372
|
|
|
436
373
|
for (const ext of external) {
|
|
@@ -462,12 +399,7 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
462
399
|
|
|
463
400
|
const sdkrelpath = externalSdkRel(ext, root, log)
|
|
464
401
|
|
|
465
|
-
const eres =
|
|
466
|
-
await jostraca.generate(
|
|
467
|
-
{ ...jopts, folder: ext.folder },
|
|
468
|
-
() => ExternalDocs({
|
|
469
|
-
model, item: ext.target, cmpfolder: folder, sdkrelpath,
|
|
470
|
-
})) :
|
|
402
|
+
const eres =
|
|
471
403
|
await jostraca.generate(
|
|
472
404
|
{ ...jopts, folder: ext.folder },
|
|
473
405
|
() => ExternalTarget({
|
|
@@ -628,10 +560,10 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
628
560
|
|
|
629
561
|
// The third kind. sdkgen ships no docs items, so every ref here is a path
|
|
630
562
|
// into a package — see action/docs.
|
|
631
|
-
const
|
|
563
|
+
const edition = {
|
|
632
564
|
add: async (items: string[]): Promise<ActionResult> => {
|
|
633
565
|
const ctx = resolveActionContext()
|
|
634
|
-
return
|
|
566
|
+
return edition_add(items, ctx)
|
|
635
567
|
}
|
|
636
568
|
}
|
|
637
569
|
|
|
@@ -680,7 +612,7 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
680
612
|
generate,
|
|
681
613
|
action,
|
|
682
614
|
check,
|
|
683
|
-
|
|
615
|
+
edition,
|
|
684
616
|
target,
|
|
685
617
|
feature,
|
|
686
618
|
|
|
@@ -822,16 +754,8 @@ function resolveExternalOverride(
|
|
|
822
754
|
}
|
|
823
755
|
|
|
824
756
|
|
|
825
|
-
//
|
|
826
|
-
//
|
|
827
|
-
// Keyed by kind because `docs` needs exactly this and a second copy of it
|
|
828
|
-
// would drift: the out-of-tree rules — a destination must be outside the
|
|
829
|
-
// project, unclaimed, and either empty or previously generated into — are
|
|
830
|
-
// properties of WRITING SOMEWHERE ELSE, not of being a target.
|
|
831
|
-
//
|
|
832
|
-
// The claim map spanning kinds is the load-bearing part: a docs item and a
|
|
833
|
-
// target pointed at the same folder would otherwise silently overwrite each
|
|
834
|
-
// other, in whatever order the passes happen to run.
|
|
757
|
+
// SDK targets can generate into separately owned repositories. Documentation
|
|
758
|
+
// editions are confined to this SDK repository and are handled by docgen.
|
|
835
759
|
function externalItems(
|
|
836
760
|
model: any, folder: string, kinds: string[],
|
|
837
761
|
override: Record<string, ExternalOverride>,
|
|
@@ -841,10 +765,7 @@ function externalItems(
|
|
|
841
765
|
|
|
842
766
|
return Object.keys(items).sort()
|
|
843
767
|
.map((name: string) => {
|
|
844
|
-
//
|
|
845
|
-
// name share an override. They already share an output folder if both
|
|
846
|
-
// are pointed at one (the claim map refuses that), so a name that
|
|
847
|
-
// means two things is a problem before it reaches here.
|
|
768
|
+
// Overrides are keyed by installed target name.
|
|
848
769
|
const ov = override[name] || {}
|
|
849
770
|
|
|
850
771
|
// A SHALLOW CLONE, so the override never writes back into the model.
|
package/src/utility.ts
CHANGED
|
@@ -381,8 +381,14 @@ function withPointParts(op: any): any {
|
|
|
381
381
|
each(op, (o: any, opname: string) => {
|
|
382
382
|
out[opname] = null == o || null == o.points ? o : {
|
|
383
383
|
...o,
|
|
384
|
-
points: each(o.points).map((pt: any) =>
|
|
385
|
-
null == pt
|
|
384
|
+
points: each(o.points).map((pt: any) => {
|
|
385
|
+
if (null == pt) return pt
|
|
386
|
+
// Contracts feed test generation directly from the model. Keeping
|
|
387
|
+
// them in every runtime entity also retains entire request/response
|
|
388
|
+
// schemas in clones and debug output, exhausting large SDKs' memory.
|
|
389
|
+
const { contract, ...runtimePoint } = pt
|
|
390
|
+
return { ...runtimePoint, parts: pointParts(pt) }
|
|
391
|
+
}),
|
|
386
392
|
}
|
|
387
393
|
})
|
|
388
394
|
|
package/dist/action/docs.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ActionContext, ActionResult } from '../types';
|
|
2
|
-
declare function action_docs(args: string[], actx: ActionContext): Promise<ActionResult>;
|
|
3
|
-
declare function docs_add(docs: string[], actx: ActionContext): Promise<ActionResult>;
|
|
4
|
-
export { action_docs, docs_add, };
|
package/dist/action/docs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/action/docs.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,EAAE;AACF,sBAAsB;AACtB,EAAE;AACF,8EAA8E;A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A0E;IAC1E,2EAA2E;IAC3E,2CAA2C;IAC3C,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,IAAI,MAAM,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/D,IAAA,qBAAY,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAC9D,OAAO,EAAE,CAAC,CAAA;QACZ,OAAM;IACR,CAAC;IAED,IAAA,iBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;QAC/B,IAAA,eAAI,EAAC;YACH,IAAI;YACJ,8DAA8D;YAC9D,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC/B,EAAE,OAAO,EAAE,IAAA,6BAAoB,EAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnE,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/cmp/Docs.d.ts
DELETED
package/dist/cmp/Docs.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// GENERATING A DOCS ITEM. See docs/design/sdkgen-packages.md §20.3.
|
|
3
|
-
//
|
|
4
|
-
// A docs item is dispatched by the same convention a target is —
|
|
5
|
-
// `cmp/docs/<n>/Main_<n>` — so an item's package supplies the emitter and
|
|
6
|
-
// sdkgen supplies only the call.
|
|
7
|
-
//
|
|
8
|
-
// WHY THIS IS NOT RENDERED BY THE CONSUMER'S Root.ts
|
|
9
|
-
//
|
|
10
|
-
// A project's `Root.ts` is written once, by create-sdkgen, and is never
|
|
11
|
-
// touched again (doctor has an `unwired` category precisely because of it).
|
|
12
|
-
// So a kind introduced later can reach generation in one of two ways: every
|
|
13
|
-
// existing project edits its Root, or sdkgen runs the kind's own pass. The
|
|
14
|
-
// second is what happens here — `docs add` in a project scaffolded years ago
|
|
15
|
-
// generates with no scaffold change at all, which is the whole point of
|
|
16
|
-
// putting the destinations in packages.
|
|
17
|
-
//
|
|
18
|
-
// The cost is honest and small: a second `generate()` call over the same
|
|
19
|
-
// root, so the changes report arrives in two parts.
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.DocsItem = exports.Docs = void 0;
|
|
22
|
-
exports.prepareModel = prepareModel;
|
|
23
|
-
const jostraca_1 = require("jostraca");
|
|
24
|
-
const utility_1 = require("../utility");
|
|
25
|
-
const stdrep_1 = require("../helpers/stdrep");
|
|
26
|
-
const types_1 = require("../types");
|
|
27
|
-
// The model preamble every pass performs before rendering: the case-variant
|
|
28
|
-
// name constants (`Name`, `NAME`, …) and the ProjectName replacement map that
|
|
29
|
-
// template substitution reads.
|
|
30
|
-
//
|
|
31
|
-
// Done HERE rather than relied upon, because a docs pass does NOT go through
|
|
32
|
-
// the consumer's Root — nothing else has set `ctx$.model`, and when there are
|
|
33
|
-
// out-of-tree items the Root was handed a FILTERED COPY, so the preamble it
|
|
34
|
-
// performed did not touch this object at all.
|
|
35
|
-
function prepareModel(model, ctx$) {
|
|
36
|
-
ctx$.model = model;
|
|
37
|
-
model.const = model.const || { name: model.name };
|
|
38
|
-
(0, jostraca_1.names)(model.const, model.name);
|
|
39
|
-
if (null == model.const.year) {
|
|
40
|
-
model.const.year = new Date().getFullYear();
|
|
41
|
-
}
|
|
42
|
-
(0, jostraca_1.names)(model, model.name);
|
|
43
|
-
ctx$.stdrep = ctx$.stdrep || {};
|
|
44
|
-
(0, jostraca_1.names)(ctx$.stdrep, model.Name, 'Project' + 'Name');
|
|
45
|
-
}
|
|
46
|
-
// One item: its emitter, called with the item and the shared replace map.
|
|
47
|
-
//
|
|
48
|
-
// No Folder here — WHERE it lands is the caller's business, because that is
|
|
49
|
-
// exactly what differs between the two passes: in-tree the item owns
|
|
50
|
-
// `<sdk-repo>/<name>/`, out-of-tree the destination IS the item's root.
|
|
51
|
-
const DocsItem = (0, jostraca_1.cmp)(function DocsItem(props) {
|
|
52
|
-
const { item, ctx$ } = props;
|
|
53
|
-
const log = ctx$.log;
|
|
54
|
-
const model = props.model ?? ctx$.model;
|
|
55
|
-
const stdrep = (0, stdrep_1.ensureStdrep)(ctx$);
|
|
56
|
-
// The MODEL KEY is the fallback, and it is not paranoia: `name` comes from
|
|
57
|
-
// the base schema's `name: key()`, so an item whose project has not
|
|
58
|
-
// included that schema — or whose own definition omits it — reached
|
|
59
|
-
// `require('cmp/docs/undefined/Main_undefined')`, a message naming nothing
|
|
60
|
-
// the author wrote. Seen in the first real install of a docs package.
|
|
61
|
-
const name = item.name ?? item.key$;
|
|
62
|
-
if (null == name || '' === name) {
|
|
63
|
-
throw new Error('Docs item has no name and no model key, so its component cannot be ' +
|
|
64
|
-
'located: ' + JSON.stringify(Object.keys(item ?? {})));
|
|
65
|
-
}
|
|
66
|
-
const Main_docs = (0, utility_1.requirePath)(ctx$, `cmp/docs/${name}/Main_${name}`);
|
|
67
|
-
Main_docs['Main']({ model, docs: item, stdrep });
|
|
68
|
-
log.info({
|
|
69
|
-
point: 'generate-docs', docs: name, note: 'docs:' + name
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
exports.DocsItem = DocsItem;
|
|
73
|
-
// Every IN-TREE docs item, each in its own folder.
|
|
74
|
-
//
|
|
75
|
-
// Items with `output: path` are excluded: they get their own pass rooted at
|
|
76
|
-
// that path, and rendering them here as well would ALSO write them into
|
|
77
|
-
// `<sdk-repo>/<name>/` — the same reason `withoutExternal` exists for
|
|
78
|
-
// targets.
|
|
79
|
-
const Docs = (0, jostraca_1.cmp)(function Docs(props) {
|
|
80
|
-
const { ctx$ } = props;
|
|
81
|
-
const model = props.model ?? ctx$.model;
|
|
82
|
-
prepareModel(model, ctx$);
|
|
83
|
-
const items = model?.main?.[types_1.KIT]?.docs ?? {};
|
|
84
|
-
(0, jostraca_1.each)(items, (item) => {
|
|
85
|
-
if (false === item.active) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const path = item.output?.path;
|
|
89
|
-
if (null != path && '' !== path) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const name = item.name ?? item.key$;
|
|
93
|
-
(0, jostraca_1.names)(item, name);
|
|
94
|
-
(0, jostraca_1.Folder)({ name }, () => DocsItem({ item }));
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
exports.Docs = Docs;
|
|
98
|
-
//# sourceMappingURL=Docs.js.map
|
package/dist/cmp/Docs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Docs.js","sourceRoot":"","sources":["../../src/cmp/Docs.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,iCAAiC;AACjC,EAAE;AACF,qDAAqD;AACrD,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,wEAAwE;AACxE,wCAAwC;AACxC,EAAE;AACF,yEAAyE;AACzE,oDAAoD;;;QA0GlD,YAAY;AAxGd,uCAAmD;AAEnD,wCAAwC;AAExC,8CAAgD;AAEhD,oCAA8B;AAG9B,4EAA4E;AAC5E,8EAA8E;AAC9E,+BAA+B;AAC/B,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,8CAA8C;AAC9C,SAAS,YAAY,CAAC,KAAU,EAAE,IAAS;IACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IAElB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;IACjD,IAAA,gBAAK,EAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,IAAI,IAAI,KA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;IAC5C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;QAIA,IAAI"}
|
package/dist/cmp/ExternalDocs.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// The Root for a DOCS item that generates outside the SDK repo
|
|
3
|
-
// (`main: kit: docs: <n>: output: path`).
|
|
4
|
-
//
|
|
5
|
-
// Out of tree is the NORMAL case for a docs item, not the exception it is for
|
|
6
|
-
// a target: a documentation site usually has its own repo, and in-tree it
|
|
7
|
-
// would collide with the SDK repo's own README and CI workflows.
|
|
8
|
-
//
|
|
9
|
-
// The two facts that make this a separate `generate()` pass rather than a
|
|
10
|
-
// folder are the ones `ExternalTarget` documents at length: jostraca's
|
|
11
|
-
// `FileHandler.validName` refuses a `..` segment in a folder name (the guard
|
|
12
|
-
// that keeps generation inside the tree it was pointed at, not an oversight
|
|
13
|
-
// to route around), and the output root is `jopts.folder` PER CALL — so
|
|
14
|
-
// writing somewhere else means another call.
|
|
15
|
-
//
|
|
16
|
-
// No Folder wraps the item: the destination IS the site, so its files go at
|
|
17
|
-
// the root of the output path.
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ExternalDocs = void 0;
|
|
20
|
-
const jostraca_1 = require("jostraca");
|
|
21
|
-
const Docs_1 = require("./Docs");
|
|
22
|
-
const ExternalDocs = (0, jostraca_1.cmp)(function ExternalDocs(props) {
|
|
23
|
-
const { model, item, cmpfolder, sdkrelpath } = props;
|
|
24
|
-
const ctx$ = props.ctx$;
|
|
25
|
-
// Components live in the PROJECT, not in the repo being written to. This
|
|
26
|
-
// pass has retargeted jostraca's output folder, which is what requirePath
|
|
27
|
-
// otherwise resolves against — see utility.resolvePath. Losing this line
|
|
28
|
-
// makes the pass look for components under the DESTINATION.
|
|
29
|
-
ctx$.cmpfolder = cmpfolder;
|
|
30
|
-
// The path from the destination back to the SDK project, for a site that
|
|
31
|
-
// sits beside the SDK in a known layout and needs to name it.
|
|
32
|
-
ctx$.sdkrelpath = sdkrelpath;
|
|
33
|
-
// The same preamble the in-tree pass performs — one definition, both
|
|
34
|
-
// callers, because a project whose ONLY docs item is out of tree must
|
|
35
|
-
// generate exactly as one with both.
|
|
36
|
-
(0, Docs_1.prepareModel)(model, ctx$);
|
|
37
|
-
(0, jostraca_1.Project)({}, () => {
|
|
38
|
-
(0, jostraca_1.names)(item, item.name ?? item.key$);
|
|
39
|
-
(0, Docs_1.DocsItem)({ item });
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
exports.ExternalDocs = ExternalDocs;
|
|
43
|
-
//# sourceMappingURL=ExternalDocs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalDocs.js","sourceRoot":"","sources":["../../src/cmp/ExternalDocs.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,0CAA0C;AAC1C,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,iEAAiE;AACjE,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,6EAA6E;AAC7E,4EAA4E;AAC5E,wEAAwE;AACxE,6CAA6C;AAC7C,EAAE;AACF,4EAA4E;AAC5E,+BAA+B;;;AAE/B,uCAA8C;AAI9C,iCAA+C;AAG/C,MAAM,YAAY,GAAG,IAAA,cAAG,EAAC,SAAS,YAAY,CAAC,KAAU;IACvD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;IAEvB,yEAAyE;IACzE,0EAA0E;IAC1E,yEAAyE;IACzE,4DAA4D;IAC5D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAE1B,yEAAyE;IACzE,8DAA8D;IAC9D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAE5B,qEAAqE;IACrE,sEAAsE;IACtE,qCAAqC;IACrC,IAAA,mBAAY,EAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAEzB,IAAA,kBAAO,EAAC,EAAE,EAAE,GAAG,EAAE;QACf,IAAA,gBAAK,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;QAEnC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,CAAC,CAAA;IACpB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;QAIA,YAAY"}
|
package/src/cmp/Docs.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
// GENERATING A DOCS ITEM. See docs/design/sdkgen-packages.md §20.3.
|
|
2
|
-
//
|
|
3
|
-
// A docs item is dispatched by the same convention a target is —
|
|
4
|
-
// `cmp/docs/<n>/Main_<n>` — so an item's package supplies the emitter and
|
|
5
|
-
// sdkgen supplies only the call.
|
|
6
|
-
//
|
|
7
|
-
// WHY THIS IS NOT RENDERED BY THE CONSUMER'S Root.ts
|
|
8
|
-
//
|
|
9
|
-
// A project's `Root.ts` is written once, by create-sdkgen, and is never
|
|
10
|
-
// touched again (doctor has an `unwired` category precisely because of it).
|
|
11
|
-
// So a kind introduced later can reach generation in one of two ways: every
|
|
12
|
-
// existing project edits its Root, or sdkgen runs the kind's own pass. The
|
|
13
|
-
// second is what happens here — `docs add` in a project scaffolded years ago
|
|
14
|
-
// generates with no scaffold change at all, which is the whole point of
|
|
15
|
-
// putting the destinations in packages.
|
|
16
|
-
//
|
|
17
|
-
// The cost is honest and small: a second `generate()` call over the same
|
|
18
|
-
// root, so the changes report arrives in two parts.
|
|
19
|
-
|
|
20
|
-
import { cmp, each, names, Folder } from 'jostraca'
|
|
21
|
-
|
|
22
|
-
import { requirePath } from '../utility'
|
|
23
|
-
|
|
24
|
-
import { ensureStdrep } from '../helpers/stdrep'
|
|
25
|
-
|
|
26
|
-
import { KIT } from '../types'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// The model preamble every pass performs before rendering: the case-variant
|
|
30
|
-
// name constants (`Name`, `NAME`, …) and the ProjectName replacement map that
|
|
31
|
-
// template substitution reads.
|
|
32
|
-
//
|
|
33
|
-
// Done HERE rather than relied upon, because a docs pass does NOT go through
|
|
34
|
-
// the consumer's Root — nothing else has set `ctx$.model`, and when there are
|
|
35
|
-
// out-of-tree items the Root was handed a FILTERED COPY, so the preamble it
|
|
36
|
-
// performed did not touch this object at all.
|
|
37
|
-
function prepareModel(model: any, ctx$: any) {
|
|
38
|
-
ctx$.model = model
|
|
39
|
-
|
|
40
|
-
model.const = model.const || { name: model.name }
|
|
41
|
-
names(model.const, model.name)
|
|
42
|
-
if (null == model.const.year) {
|
|
43
|
-
model.const.year = new Date().getFullYear()
|
|
44
|
-
}
|
|
45
|
-
names(model, model.name)
|
|
46
|
-
|
|
47
|
-
ctx$.stdrep = ctx$.stdrep || {}
|
|
48
|
-
names(ctx$.stdrep, model.Name, 'Project' + 'Name')
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// One item: its emitter, called with the item and the shared replace map.
|
|
53
|
-
//
|
|
54
|
-
// No Folder here — WHERE it lands is the caller's business, because that is
|
|
55
|
-
// exactly what differs between the two passes: in-tree the item owns
|
|
56
|
-
// `<sdk-repo>/<name>/`, out-of-tree the destination IS the item's root.
|
|
57
|
-
const DocsItem = cmp(function DocsItem(props: any) {
|
|
58
|
-
const { item, ctx$ } = props
|
|
59
|
-
const log = ctx$.log
|
|
60
|
-
const model = props.model ?? ctx$.model
|
|
61
|
-
|
|
62
|
-
const stdrep = ensureStdrep(ctx$)
|
|
63
|
-
|
|
64
|
-
// The MODEL KEY is the fallback, and it is not paranoia: `name` comes from
|
|
65
|
-
// the base schema's `name: key()`, so an item whose project has not
|
|
66
|
-
// included that schema — or whose own definition omits it — reached
|
|
67
|
-
// `require('cmp/docs/undefined/Main_undefined')`, a message naming nothing
|
|
68
|
-
// the author wrote. Seen in the first real install of a docs package.
|
|
69
|
-
const name = item.name ?? item.key$
|
|
70
|
-
|
|
71
|
-
if (null == name || '' === name) {
|
|
72
|
-
throw new Error(
|
|
73
|
-
'Docs item has no name and no model key, so its component cannot be ' +
|
|
74
|
-
'located: ' + JSON.stringify(Object.keys(item ?? {})))
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const Main_docs = requirePath(ctx$, `cmp/docs/${name}/Main_${name}`)
|
|
78
|
-
|
|
79
|
-
Main_docs['Main']({ model, docs: item, stdrep })
|
|
80
|
-
|
|
81
|
-
log.info({
|
|
82
|
-
point: 'generate-docs', docs: name, note: 'docs:' + name
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Every IN-TREE docs item, each in its own folder.
|
|
88
|
-
//
|
|
89
|
-
// Items with `output: path` are excluded: they get their own pass rooted at
|
|
90
|
-
// that path, and rendering them here as well would ALSO write them into
|
|
91
|
-
// `<sdk-repo>/<name>/` — the same reason `withoutExternal` exists for
|
|
92
|
-
// targets.
|
|
93
|
-
const Docs = cmp(function Docs(props: any) {
|
|
94
|
-
const { ctx$ } = props
|
|
95
|
-
const model = props.model ?? ctx$.model
|
|
96
|
-
|
|
97
|
-
prepareModel(model, ctx$)
|
|
98
|
-
|
|
99
|
-
const items = model?.main?.[KIT]?.docs ?? {}
|
|
100
|
-
|
|
101
|
-
each(items, (item: any) => {
|
|
102
|
-
if (false === item.active) {
|
|
103
|
-
return
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const path = item.output?.path
|
|
107
|
-
|
|
108
|
-
if (null != path && '' !== path) {
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const name = item.name ?? item.key$
|
|
113
|
-
|
|
114
|
-
names(item, name)
|
|
115
|
-
|
|
116
|
-
Folder({ name }, () => DocsItem({ item }))
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
Docs,
|
|
123
|
-
DocsItem,
|
|
124
|
-
prepareModel,
|
|
125
|
-
}
|