@stacksjs/defaults 0.75.360 → 0.75.362
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/ai/skills/stacks-ai/SKILL.md +22 -0
- package/ai/skills/stacks-native/CATALOG.md +4 -4
- package/ai/skills/stacks-payments/SKILL.md +28 -0
- package/ai/skills/stacks-technical-diagrams/LICENSE +202 -22
- package/ai/skills/stacks-technical-diagrams/LICENSE-MIT +22 -0
- package/ai/skills/stacks-technical-diagrams/NOTICE +26 -0
- package/ai/skills/stacks-technical-diagrams/SKILL.md +106 -266
- package/ai/skills/stacks-technical-diagrams/THIRD_PARTY_NOTICES.md +11 -2
- package/ai/skills/stacks-technical-diagrams/UPSTREAM.json +12 -0
- package/ai/skills/stacks-technical-diagrams/agents/openai.yaml +2 -2
- package/ai/skills/stacks-technical-diagrams/assets/template.html +3655 -3798
- package/ai/skills/stacks-technical-diagrams/bin/archify.mjs +7290 -0
- package/ai/skills/stacks-technical-diagrams/bin/delivery-update.mjs +7 -0
- package/ai/skills/stacks-technical-diagrams/bin/diagrams +1 -0
- package/ai/skills/stacks-technical-diagrams/bin/finalize.mjs +1056 -0
- package/ai/skills/stacks-technical-diagrams/bin/open-artifact.mjs +72 -12
- package/ai/skills/stacks-technical-diagrams/bin/preview.mjs +348 -31
- package/ai/skills/stacks-technical-diagrams/bin/recover-output.mjs +41 -0
- package/ai/skills/stacks-technical-diagrams/bin/technical-diagrams.mjs +3 -2097
- package/ai/skills/stacks-technical-diagrams/bin/visual-check.mjs +2142 -157
- package/ai/skills/stacks-technical-diagrams/brand-marks/README.md +3 -3
- package/ai/skills/stacks-technical-diagrams/delta/architecture-delta.mjs +130 -33
- package/ai/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json +25 -30
- package/ai/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json +0 -20
- package/ai/skills/stacks-technical-diagrams/examples/archify-dev-activity.timeline.json +176 -0
- package/ai/skills/stacks-technical-diagrams/examples/archify-repository.tree.json +197 -0
- package/ai/skills/stacks-technical-diagrams/examples/async-job-roundtrip.sequence.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/brand-aware-delivery.architecture.json +3 -16
- package/ai/skills/stacks-technical-diagrams/examples/cache-miss-request.sequence.json +2 -7
- package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.base.architecture.json +2 -1
- package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.head.architecture.json +2 -1
- package/ai/skills/stacks-technical-diagrams/examples/checkout-request.waterfall.json +20 -0
- package/ai/skills/stacks-technical-diagrams/examples/class-payment-processors-rendered.html +14987 -0
- package/ai/skills/stacks-technical-diagrams/examples/class-payments-rendered.html +14787 -0
- package/ai/skills/stacks-technical-diagrams/examples/dataflow-product-analytics.html +14880 -0
- package/ai/skills/stacks-technical-diagrams/examples/delivery.explainer.json +155 -0
- package/ai/skills/stacks-technical-diagrams/examples/deployment-release.lifecycle.json +57 -34
- package/ai/skills/stacks-technical-diagrams/examples/erd-orders-rendered.html +15112 -0
- package/ai/skills/stacks-technical-diagrams/examples/event-stream.dataflow.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/example-rebuild.waterfall.json +212 -0
- package/ai/skills/stacks-technical-diagrams/examples/holiday-planning.workflow.json +143 -0
- package/ai/skills/stacks-technical-diagrams/examples/incident-response.workflow.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/lifecycle-agent-run.html +14892 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/de.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/fr.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/fr.partial.json +22 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/it.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/ja.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/pt.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/locales/ru.json +463 -0
- package/ai/skills/stacks-technical-diagrams/examples/orders.erd.json +337 -0
- package/ai/skills/stacks-technical-diagrams/examples/payment-incident.timeline.json +24 -0
- package/ai/skills/stacks-technical-diagrams/examples/payment-platform.tree.json +22 -0
- package/ai/skills/stacks-technical-diagrams/examples/payment-processors.class.json +177 -0
- package/ai/skills/stacks-technical-diagrams/examples/payments.class.json +85 -0
- package/ai/skills/stacks-technical-diagrams/examples/product-analytics.dataflow.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/production-deployment.architecture.json +3 -23
- package/ai/skills/stacks-technical-diagrams/examples/release-delivery.workflow.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/sequence-cache-miss-request.html +14895 -0
- package/ai/skills/stacks-technical-diagrams/examples/subscription-billing-rendered.html +15369 -0
- package/ai/skills/stacks-technical-diagrams/examples/subscription-billing.erd.json +548 -0
- package/ai/skills/stacks-technical-diagrams/examples/timeline-archify-dev-activity-rendered.html +15002 -0
- package/ai/skills/stacks-technical-diagrams/examples/timeline-payment-incident-rendered.html +14772 -0
- package/ai/skills/stacks-technical-diagrams/examples/tree-archify-repository-rendered.html +15071 -0
- package/ai/skills/stacks-technical-diagrams/examples/tree-payment-platform-rendered.html +14810 -0
- package/ai/skills/stacks-technical-diagrams/examples/waterfall-checkout-request-rendered.html +14754 -0
- package/ai/skills/stacks-technical-diagrams/examples/waterfall-example-rebuild-rendered.html +14940 -0
- package/ai/skills/stacks-technical-diagrams/examples/web-app-rendered.html +14889 -0
- package/ai/skills/stacks-technical-diagrams/examples/web-app.architecture.json +1 -6
- package/ai/skills/stacks-technical-diagrams/examples/workflow-agent-tool-call-rendered.html +14907 -0
- package/ai/skills/stacks-technical-diagrams/explainer/browser-check.mjs +208 -0
- package/ai/skills/stacks-technical-diagrams/explainer/charts.mjs +70 -0
- package/ai/skills/stacks-technical-diagrams/explainer/check.mjs +168 -0
- package/ai/skills/stacks-technical-diagrams/explainer/diagrams.mjs +518 -0
- package/ai/skills/stacks-technical-diagrams/explainer/diff.mjs +124 -0
- package/ai/skills/stacks-technical-diagrams/explainer/inline.mjs +155 -0
- package/ai/skills/stacks-technical-diagrams/explainer/layout.mjs +35 -0
- package/ai/skills/stacks-technical-diagrams/explainer/page-bundle.mjs +16 -0
- package/ai/skills/stacks-technical-diagrams/explainer/parse.mjs +300 -0
- package/ai/skills/stacks-technical-diagrams/explainer/patch.mjs +117 -0
- package/ai/skills/stacks-technical-diagrams/explainer/prepare.mjs +131 -0
- package/ai/skills/stacks-technical-diagrams/explainer/reader.css +472 -0
- package/ai/skills/stacks-technical-diagrams/explainer/reader.js +667 -0
- package/ai/skills/stacks-technical-diagrams/explainer/render.mjs +224 -0
- package/ai/skills/stacks-technical-diagrams/explainer/revision.mjs +20 -0
- package/ai/skills/stacks-technical-diagrams/explainer/sources.mjs +318 -0
- package/ai/skills/stacks-technical-diagrams/explainer/validate.mjs +138 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/LICENSE +40 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/README.md +5 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/42UTT654.js +3 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/core.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/pie.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/radar.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/sankey.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/venn.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/xychart.js +1 -0
- package/ai/skills/stacks-technical-diagrams/explainer/writing.mjs +139 -0
- package/ai/skills/stacks-technical-diagrams/locales/README.md +40 -0
- package/ai/skills/stacks-technical-diagrams/locales/ar.json +488 -0
- package/ai/skills/stacks-technical-diagrams/locales/en.json +488 -0
- package/ai/skills/stacks-technical-diagrams/locales/es.json +488 -0
- package/ai/skills/stacks-technical-diagrams/locales/ko.json +488 -0
- package/ai/skills/stacks-technical-diagrams/locales/manifest.json +10 -0
- package/ai/skills/stacks-technical-diagrams/locales/zh-CN.json +488 -0
- package/ai/skills/stacks-technical-diagrams/locales/zh-TW.json +488 -0
- package/ai/skills/stacks-technical-diagrams/migrations/workflow-v2.mjs +1 -0
- package/ai/skills/stacks-technical-diagrams/recipes/scenarios.mjs +115 -51
- package/ai/skills/stacks-technical-diagrams/references/architecture-layout-repair.md +18 -0
- package/ai/skills/stacks-technical-diagrams/references/authoring-contract.md +453 -51
- package/ai/skills/stacks-technical-diagrams/references/authoring-defaults.md +57 -0
- package/ai/skills/stacks-technical-diagrams/references/brand-marks.md +57 -3
- package/ai/skills/stacks-technical-diagrams/references/delivery-contract.md +603 -58
- package/ai/skills/stacks-technical-diagrams/references/explainer-authoring.md +274 -0
- package/ai/skills/stacks-technical-diagrams/references/repository-authoring.md +126 -0
- package/ai/skills/stacks-technical-diagrams/references/update-awareness.md +13 -0
- package/ai/skills/stacks-technical-diagrams/references/viewer-runtime.md +18 -11
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/grid.mjs +1 -1
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/labels.mjs +2 -0
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/render-architecture.mjs +550 -424
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/routing.mjs +1469 -0
- package/ai/skills/stacks-technical-diagrams/renderers/class/README.md +129 -0
- package/ai/skills/stacks-technical-diagrams/renderers/class/render-class.mjs +1095 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/README.md +89 -17
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/dataflow-compiler.mjs +1605 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/joint-label-routing.mjs +165 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/label-capacity.mjs +81 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/render-dataflow.mjs +14 -474
- package/ai/skills/stacks-technical-diagrams/renderers/erd/README.md +246 -0
- package/ai/skills/stacks-technical-diagrams/renderers/erd/grid.mjs +150 -0
- package/ai/skills/stacks-technical-diagrams/renderers/erd/render-erd.mjs +1588 -0
- package/ai/skills/stacks-technical-diagrams/renderers/explainer/render-explainer.mjs +42 -0
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/README.md +83 -94
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs +990 -417
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/README.md +49 -17
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/render-sequence.mjs +735 -94
- package/ai/skills/stacks-technical-diagrams/renderers/shared/atomic-output.mjs +1982 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/automatic-labels.mjs +290 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/brand-marks.mjs +169 -26
- package/ai/skills/stacks-technical-diagrams/renderers/shared/cli.mjs +266 -54
- package/ai/skills/stacks-technical-diagrams/renderers/shared/desktop-readability.mjs +106 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/diagnostics.mjs +0 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-validators.mjs +268 -2
- package/ai/skills/stacks-technical-diagrams/renderers/shared/geometry.mjs +774 -124
- package/ai/skills/stacks-technical-diagrams/renderers/shared/i18n.mjs +289 -556
- package/ai/skills/stacks-technical-diagrams/renderers/shared/layout-report.mjs +18 -1
- package/ai/skills/stacks-technical-diagrams/renderers/shared/legend.mjs +16 -6
- package/ai/skills/stacks-technical-diagrams/renderers/shared/node-card-style.mjs +32 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/output-path.mjs +329 -229
- package/ai/skills/stacks-technical-diagrams/renderers/shared/owned-temp-directory.mjs +82 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/path-semantics.mjs +1017 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/portable-path.mjs +408 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-evidence.mjs +235 -79
- package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-location.mjs +17 -4
- package/ai/skills/stacks-technical-diagrams/renderers/shared/route-quality.mjs +670 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/sidecar-path.mjs +38 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/software-notices.mjs +6 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/spatial-grid.mjs +66 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/svg-path-analysis.mjs +135 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/text-fit.mjs +59 -3
- package/ai/skills/stacks-technical-diagrams/renderers/shared/utils.mjs +63 -35
- package/ai/skills/stacks-technical-diagrams/renderers/shared/validator.mjs +2 -5
- package/ai/skills/stacks-technical-diagrams/renderers/timeline/README.md +76 -0
- package/ai/skills/stacks-technical-diagrams/renderers/timeline/render-timeline.mjs +576 -0
- package/ai/skills/stacks-technical-diagrams/renderers/tree/README.md +96 -0
- package/ai/skills/stacks-technical-diagrams/renderers/tree/render-tree.mjs +573 -0
- package/ai/skills/stacks-technical-diagrams/renderers/waterfall/README.md +73 -0
- package/ai/skills/stacks-technical-diagrams/renderers/waterfall/render-waterfall.mjs +413 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/README.md +137 -23
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs +18 -6
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-compiler.mjs +2230 -710
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-migration-geometry.mjs +17 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-placement-repair.mjs +94 -0
- package/ai/skills/stacks-technical-diagrams/schemas/README.md +87 -40
- package/ai/skills/stacks-technical-diagrams/schemas/architecture.schema.json +7 -33
- package/ai/skills/stacks-technical-diagrams/schemas/class.schema.json +345 -0
- package/ai/skills/stacks-technical-diagrams/schemas/common.schema.json +68 -2
- package/ai/skills/stacks-technical-diagrams/schemas/dataflow.schema.json +14 -3
- package/ai/skills/stacks-technical-diagrams/schemas/erd.schema.json +381 -0
- package/ai/skills/stacks-technical-diagrams/schemas/explainer.schema.json +927 -0
- package/ai/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json +23 -110
- package/ai/skills/stacks-technical-diagrams/schemas/sequence.schema.json +15 -4
- package/ai/skills/stacks-technical-diagrams/schemas/timeline.schema.json +160 -0
- package/ai/skills/stacks-technical-diagrams/schemas/tree.schema.json +141 -0
- package/ai/skills/stacks-technical-diagrams/schemas/waterfall.schema.json +147 -0
- package/ai/skills/stacks-technical-diagrams/schemas/workflow.schema.json +14 -3
- package/ai/skills/stacks-technical-diagrams/scripts/check-render-output.mjs +876 -243
- package/ai/skills/stacks-technical-diagrams/scripts/check-update.mjs +1717 -0
- package/ai/skills/stacks-technical-diagrams/scripts/delivery-update-child.mjs +26 -0
- package/ai/skills/stacks-technical-diagrams/scripts/generate-brand-marks.mjs +141 -0
- package/ai/skills/stacks-technical-diagrams/scripts/generate-validators.mjs +105 -0
- package/ai/skills/stacks-technical-diagrams/scripts/render-examples.mjs +11 -1
- package/ai/skills/stacks-technical-diagrams/scripts/update-contract.mjs +187 -0
- package/ai/skills/stacks-technical-diagrams/skill-release.json +10 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { randomUUID, createHash } from 'node:crypto';
|
|
4
|
+
import { installRendererDiagnosticBoundary, throwDiagnosticError } from '../shared/diagnostics.mjs';
|
|
5
|
+
import { resolveOutputPath } from '../shared/output-path.mjs';
|
|
6
|
+
import { captureAtomicOutput, captureRegularFileBinding, publishRegularFileBinding, releaseRegularFileBinding, removeOwnedRegularFile } from '../shared/atomic-output.mjs';
|
|
7
|
+
import { prepareExplainer, readPreparedBundle, assertPreparedDependencies } from '../../explainer/prepare.mjs';
|
|
8
|
+
import { renderExplainer } from '../../explainer/render.mjs';
|
|
9
|
+
installRendererDiagnosticBoundary();
|
|
10
|
+
const inputPath = path.resolve(process.argv[2]);
|
|
11
|
+
const sourceText = fs.readFileSync(inputPath, 'utf8');
|
|
12
|
+
const bundle = process.env.ARCHIFY_EXPLAINER_PREPARED
|
|
13
|
+
? readPreparedBundle(process.env.ARCHIFY_EXPLAINER_PREPARED, sourceText, inputPath, { expectedInputPath: process.env.ARCHIFY_EXPLAINER_SNAPSHOT_INPUT || inputPath })
|
|
14
|
+
: await prepareExplainer(sourceText, { inputPath, repoRoot: process.env.ARCHIFY_REPO_ROOT, quality: process.env.ARCHIFY_QUALITY_PROFILE });
|
|
15
|
+
const request = { requestedOutput: process.argv[3], authoredOutput: bundle.document.meta.output, defaultOutput: 'explainer.html', inputPaths: [inputPath, bundle.sourcePath] };
|
|
16
|
+
const { outputPath } = resolveOutputPath(request);
|
|
17
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
18
|
+
const capture = captureAtomicOutput(outputPath, { requestedEntryPolicy: 'regular-or-absent' });
|
|
19
|
+
if (capture.status !== 'captured') throwDiagnosticError('Could not capture explainer output safely.', [{code:'output/target-indeterminate',message:'Could not capture explainer output safely.',subject:{output:outputPath},evidence:{reason:capture.reason},supportedFixes:[]}]);
|
|
20
|
+
let html;
|
|
21
|
+
try { html = renderExplainer(bundle.document, { ...bundle, preparedBundle: bundle, pageDirectory: process.env.ARCHIFY_EXPLAINER_PAGE_DIR || path.dirname(outputPath) }); }
|
|
22
|
+
catch (error) { if (error.diagnostics) error.archifyDiagnostics = error.diagnostics; throw error; }
|
|
23
|
+
const bytes = Buffer.from(html);
|
|
24
|
+
const candidate = path.join(path.dirname(capture.commitPath), `.archify-explainer-${randomUUID()}.html`);
|
|
25
|
+
let binding;
|
|
26
|
+
let owned;
|
|
27
|
+
try {
|
|
28
|
+
fs.writeFileSync(candidate, bytes, { flag: 'wx', ...(capture.mode === null ? {} : {mode:capture.mode}) });
|
|
29
|
+
const stat = fs.lstatSync(candidate, {bigint:true});
|
|
30
|
+
owned = {device:stat.dev,inode:stat.ino};
|
|
31
|
+
if (capture.mode !== null) fs.chmodSync(candidate,capture.mode);
|
|
32
|
+
const staged = captureRegularFileBinding(candidate,{expectedIdentity:owned,expectedSha256:createHash('sha256').update(bytes).digest('hex'),expectedBytes:bytes.length});
|
|
33
|
+
if (staged.status !== 'captured') throw new Error('Could not bind explainer candidate.');
|
|
34
|
+
binding = staged.binding;
|
|
35
|
+
assertPreparedDependencies(bundle);
|
|
36
|
+
resolveOutputPath(request);
|
|
37
|
+
const result = publishRegularFileBinding(binding,candidate,capture.snapshot,{subject:'explainer-output'});
|
|
38
|
+
if (!['committed','committed-with-warning'].includes(result.status)) throw new Error(`Could not publish explainer output (${result.reason?.code || result.status}).`);
|
|
39
|
+
} finally {
|
|
40
|
+
if(binding) releaseRegularFileBinding(binding);
|
|
41
|
+
if(owned) removeOwnedRegularFile(candidate,owned,{subject:'explainer-output'});
|
|
42
|
+
}
|
|
@@ -1,115 +1,104 @@
|
|
|
1
1
|
# Lifecycle Renderer
|
|
2
2
|
|
|
3
|
-
Render `diagram_type: "lifecycle"` JSON files into the
|
|
3
|
+
Render `diagram_type: "lifecycle"` JSON files into the standard Archify HTML
|
|
4
4
|
template.
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
node
|
|
7
|
+
node archify/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json output.html
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
The renderer validates input against
|
|
10
|
+
The renderer validates input against `archify/schemas/lifecycle.schema.json`
|
|
11
11
|
with the bundled standalone validator. No dependency installation is required.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
or falls back to `lifecycle.html` in the current working directory.
|
|
12
|
+
If `output.html` is omitted, the renderer uses the required `meta.output` value
|
|
13
|
+
from the JSON file.
|
|
15
14
|
|
|
16
15
|
## Input
|
|
17
16
|
|
|
18
|
-
Lifecycle JSON files must set:
|
|
19
|
-
|
|
20
17
|
```json
|
|
21
18
|
{
|
|
22
|
-
"schema_version":
|
|
19
|
+
"schema_version": 3,
|
|
23
20
|
"diagram_type": "lifecycle",
|
|
24
|
-
"meta": {
|
|
25
|
-
|
|
26
|
-
"viewBox": [980, 660]
|
|
27
|
-
},
|
|
28
|
-
"lanes": [],
|
|
21
|
+
"meta": { "title": "Deployment Release Lifecycle", "output": "deployment-release.html" },
|
|
22
|
+
"mainPath": ["queued", "building", "verifying", "ready", "live"],
|
|
29
23
|
"states": [],
|
|
30
24
|
"transitions": [],
|
|
31
25
|
"cards": []
|
|
32
26
|
}
|
|
33
27
|
```
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
`.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
The
|
|
29
|
+
A complete example lives at `archify/examples/deployment-release.lifecycle.json`.
|
|
30
|
+
|
|
31
|
+
- `mainPath` is the happy path from the initial state. Every consecutive pair
|
|
32
|
+
needs a transition; the first such transition is drawn as the main row.
|
|
33
|
+
- `states[]` carry meaning only: `id`, `type`, `label`, optional `sublabel`,
|
|
34
|
+
`tag`, `step`, `icon`, `brand` and `sources`.
|
|
35
|
+
- `transitions[]` carry `from`, `to`, optional `id`, `label`, `note` and
|
|
36
|
+
`variant`. There are no routing or label-position controls.
|
|
37
|
+
|
|
38
|
+
## Layout
|
|
39
|
+
|
|
40
|
+
The geometry follows from the structure alone:
|
|
41
|
+
|
|
42
|
+
| Element | Placement |
|
|
43
|
+
|---------|-----------|
|
|
44
|
+
| Main path | One left-to-right row. Each gap fits its transition label. The first state receives the UML initial marker. |
|
|
45
|
+
| Loops and skips | A transition between two non-consecutive main-path states (or back to an earlier one, or a self-transition) is an arc above the row. Shorter arcs nest inside longer ones; ports order so an outer riser never crosses an inner arc. |
|
|
46
|
+
| Other states | One row per distance from the main path. A state starts under the states it connects to in the row above; overlapping states pack side by side. |
|
|
47
|
+
| Between rows | Orthogonal routes through a shared gap. Horizontal runs take separate tracks, chosen to minimise crossings; near-vertical routes snap straight or widen to a readable jog. |
|
|
48
|
+
| Shared exits | A target with exactly one group of identical label, note and variant from at least two main-path phases shares an exit: consecutive phases receive a dashed composite frame, as in a UML superstate; non-consecutive phases share a bus with junction dots. Other exits keep separate connectors and their own labels. If several groups qualify for the same target, all exits stay separate. |
|
|
49
|
+
| Same lower row | Neighbours connect side to side, parallel transitions fanning out around the shared edge (at most five per pair of states). Dense parallel labels and notes increase their lane spacing and the height of that lower row to keep clear; other pairs loop under the row. |
|
|
50
|
+
| Labels | Above main-path arrows, on arc and loop runs, otherwise beside the segment next to the lower state. Every label keeps clear of other routes, states and labels; if one cannot, lower-row and route spacing grow and layout repeats, for at most five rounds. Main-path gaps stop growing before their minimum row width exceeds the text readability budget; gaps still fit their transition text. |
|
|
51
|
+
|
|
52
|
+
Every route carries a crossover halo, so an unavoidable crossing (for example,
|
|
53
|
+
two overlapping loops) stays legible. Lines are orthogonal with rounded corners.
|
|
54
|
+
Keep a distinct note on its original transition. Do not remove or copy notes to
|
|
55
|
+
make different exits qualify for sharing. The final width and label-clearance
|
|
56
|
+
checks still apply after layout retries.
|
|
57
|
+
|
|
58
|
+
## Legend and state marks
|
|
59
|
+
|
|
60
|
+
State color follows `states[].type`: active and start are cyan, waiting amber,
|
|
61
|
+
decision purple, success green, failure rose, neutral and external slate. The
|
|
62
|
+
first main-path state carries the initial marker; a state with no outgoing
|
|
63
|
+
transition gets a double border as a final state. The default legend derives
|
|
64
|
+
kinds from the rendered states, always lists the initial marker, and adds a
|
|
65
|
+
non-interactive `final` entry when a final state exists. Supported
|
|
51
66
|
`meta.legend.entries` keys, in stable order, are `start`, `active`, `waiting`,
|
|
52
|
-
`decision`, `success`, `failure`, `neutral`, and `external`.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
- Use `
|
|
89
|
-
|
|
90
|
-
- Keep transition labels out of the main SVG unless the label is essential;
|
|
91
|
-
prefer node labels, tags, legend entries, and summary cards.
|
|
92
|
-
- Avoid diagonal and crossing lines. Terminal exits should drop vertically from
|
|
93
|
-
their source event whenever possible.
|
|
94
|
-
- Use `success` for completion, `failure` for failure/terminal exits,
|
|
95
|
-
`waiting` for pauses, and `decision` for quality gates.
|
|
96
|
-
|
|
97
|
-
Schema violations exit non-zero with path-prefixed messages annotated with the
|
|
98
|
-
element's id or label. The renderer additionally fails when it can detect
|
|
99
|
-
layout problems, including a missing `main` lane, duplicate state IDs, unknown
|
|
100
|
-
lanes, unknown transition endpoints, states outside the lifecycle area,
|
|
101
|
-
overlapping states (including across lanes), labels colliding with states or
|
|
102
|
-
other labels, labels wider than their state, unreadably short transitions, or
|
|
103
|
-
transitions crossing unrelated states (2px Clean Flow clearance). Lifecycle
|
|
104
|
-
bands remain intentional pass-through containers.
|
|
105
|
-
Text width is estimated CJK-aware: fullwidth glyphs count as two units.
|
|
106
|
-
|
|
107
|
-
Set `meta.quality_profile` to `showcase` for polished delivery. Unrelated proper
|
|
108
|
-
X crossings then fail with `composition/proper-crossing`; default `standard`
|
|
109
|
-
keeps them as artifact-receipt warnings. The final artifact check samples
|
|
110
|
-
rounded `Q` corners. Collinear corridors remain outside the proper-X rule, but
|
|
111
|
-
a separate gate warns in `standard` and fails in `showcase` when unrelated
|
|
112
|
-
transitions overlap for at least 8px. Shared semantic endpoints, point touches,
|
|
113
|
-
and shorter overlaps remain valid. Showcase also rejects any route segment
|
|
114
|
-
below 8px and any interior turn segment below 16px; ordinary 8-15px endpoint
|
|
115
|
-
stubs remain valid.
|
|
67
|
+
`decision`, `success`, `failure`, `neutral`, and `external`.
|
|
68
|
+
|
|
69
|
+
State decorations share one top rail: the type sigil and `step` on the left and
|
|
70
|
+
the brand mark at the right corner. Only states a reader should notice get a
|
|
71
|
+
default sigil: `waiting` (hourglass), `decision` (diamond), `success` (check),
|
|
72
|
+
`failure` (cross) and `external`; `start`, `active` and `neutral` states have
|
|
73
|
+
none unless `icon` sets one, except as a final state, which gets a stop sigil
|
|
74
|
+
so every outcome is marked. State width grows from 140px to 220px to fit its
|
|
75
|
+
text at the preferred size (12px label, 9px sublabel, 8px tag) before the text
|
|
76
|
+
shrinks.
|
|
77
|
+
|
|
78
|
+
## Validation
|
|
79
|
+
|
|
80
|
+
Schema violations exit non-zero with path-prefixed messages. The renderer also
|
|
81
|
+
rejects duplicate state ids, unknown or repeated `mainPath` states, a
|
|
82
|
+
`mainPath` step without a transition, unknown transition endpoints, state text
|
|
83
|
+
that cannot fit the widest state, a canvas wider than its smallest text allows
|
|
84
|
+
on a desktop (`lifecycle/too-wide`), and a label that cannot be placed after the
|
|
85
|
+
spacing rounds (`lifecycle/label-unplaced`), and more than five parallel
|
|
86
|
+
transitions between two neighbouring states
|
|
87
|
+
(`lifecycle/crowded-side-transitions`). Each failure is a typed diagnostic
|
|
88
|
+
with supported fixes.
|
|
89
|
+
|
|
90
|
+
The final artifact check applies the shared composition gates (orthogonal
|
|
91
|
+
segments, crossings, corridors, label clearance and route rhythm). Routes of one
|
|
92
|
+
shared-exit bus declare `data-composition-junction`; they may share only that
|
|
93
|
+
horizontal bus, the identical first tick from the same source port, and, when
|
|
94
|
+
they end at the same state, the merged drop into it. Internal vertical runs
|
|
95
|
+
remain subject to the corridor check.
|
|
96
|
+
|
|
97
|
+
## Design rules
|
|
98
|
+
|
|
99
|
+
- Treat the main path as the story: about six phases at most.
|
|
100
|
+
- Put interruptions, waits and exits off the main path; the renderer places them.
|
|
101
|
+
- Give an exit shared by several phases one label, such as “cancel”.
|
|
102
|
+
- A recoverable failure needs a real transition back.
|
|
103
|
+
- Use `success` for completion, `failure` for failure exits, `waiting` for
|
|
104
|
+
pauses, and `decision` for quality gates.
|