Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
pull_request:
paths:
- 'packages/render/**'
- 'package.json'
- 'bun.lock'
- 'docs/90-99-views/90-architecture-views/**'
- '.github/workflows/render.yml'
push:
branches: [main]
paths:
- 'packages/render/**'
- 'package.json'
- 'bun.lock'
- 'docs/90-99-views/90-architecture-views/**'
- '.github/workflows/render.yml'
permissions:
Expand All @@ -31,22 +35,23 @@ jobs:
with:
bun-version: 1.3.11
- run: bun install --frozen-lockfile
working-directory: packages/render
- run: bunx playwright install --with-deps chromium
working-directory: packages/render
- run: bun run typecheck
working-directory: packages/render
- run: bun test ./test
working-directory: packages/render
- run: bun run test
- run: bun run test:export
working-directory: packages/render
- run: bun test ./examples/test
working-directory: packages/render
- run: bun run test:examples
- run: bun run example:case
working-directory: packages/render
- run: bun run example:compare
working-directory: packages/render
- run: bun run example:overviews
working-directory: packages/render
- run: bun run example:design
working-directory: packages/render
- name: Consume the reviewed Git package through Bun
env:
RENDER_REVISION: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
render_version=$(bun -e 'import metadata from "./package.json"; process.stdout.write(metadata.version)')
export RENDER_EXPECTED_VERSION="$render_version"
render_consumer=$(mktemp -d)
cd "$render_consumer"
bun init -y
bun add "@deterministic-engineering/render@git+https://github.com/hardenedlinux/deterministic-engineering.git#$RENDER_REVISION"
bun -e 'import metadata from "@deterministic-engineering/render/package.json"; import {compileModel} from "@deterministic-engineering/render"; if(metadata.version!==process.env.RENDER_EXPECTED_VERSION)throw new Error("Wrong Git package version"); const compiled=await compileModel({"consumer.d2":"Library -> Consumer"},"consumer.d2"); if(compiled.model.relations.length!==1)throw new Error("Git-installed worker did not compile the consumer model");'
File renamed without changes.
70 changes: 70 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@deterministic-engineering/render",
"private": false,
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit -p packages/render/tsconfig.json",
"test": "bun test ./packages/render/test",
"test:export": "playwright test --config packages/render/playwright.config.ts",
"test:examples": "bun test ./packages/render/examples/test",
"example:case": "bun packages/render/examples/library-case.ts",
"example:compare": "bun packages/render/examples/comparison.ts",
"example:overviews": "bun packages/render/examples/overviews.ts",
"example:design": "bun packages/render/examples/design-choices.ts"
},
"dependencies": {
"@fontsource/inter": "5.3.0",
"@fontsource/kalam": "5.3.0",
"@terrastruct/d2": "0.1.33",
"@xyflow/system": "0.0.83",
"elkjs": "0.12.1",
"parse5": "8.0.1",
"roughjs": "4.6.6",
"valibot": "1.2.0",
"web-worker": "1.5.0"
},
"devDependencies": {
"@openmbee/opensysml": "0.11.0",
"@types/bun": "1.4.4",
"fast-check": "4.10.2",
"playwright": "1.64.1",
"typescript": "7.0.2"
},
"version": "1.0.1",
"exports": {
".": "./packages/render/src/index.ts",
"./opensysml": "./packages/render/src/opensysml.ts",
"./presentation-theme": "./packages/render/src/presentation-theme.ts",
"./icons": "./packages/render/src/icons.ts",
"./export": "./packages/render/src/export.ts",
"./palettes": "./packages/render/src/palettes.ts",
"./layouts": "./packages/render/src/layouts.ts",
"./design": "./packages/render/src/design.ts",
"./taste": "./packages/render/src/taste.ts",
"./package.json": "./package.json"
},
"files": [
"packages/render/src",
"packages/render/README.org",
"packages/render/LICENSE.OFL-1.1",
"packages/render/THIRD-PARTY.org",
"LICENSES/LGPL-2.1-or-later.txt",
"package.json.license"
],
"license": "LGPL-2.1-or-later",
"engines": {
"bun": ">=1.3.11"
},
"peerDependencies": {
"@openmbee/opensysml": "0.11.0",
"playwright": "1.64.1"
},
"peerDependenciesMeta": {
"@openmbee/opensysml": {
"optional": true
},
"playwright": {
"optional": true
}
}
}
File renamed without changes.
18 changes: 16 additions & 2 deletions packages/render/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The current formation source still reports =capture-blocked / capture = #f=.
bun install --frozen-lockfile
bunx playwright install chromium
bun run typecheck
bun test ./test
bun run test
bun run test:export
# Package-owned examples (same installation):
bun run test:examples
Expand Down Expand Up @@ -236,7 +236,7 @@ relation IDs and heading boxes. Internal scene edges and child frames must remai
inside their display scopes; crossing edges are distinguished by an attribute
for project/theme styling. ELK remains the placement/routing owner.

Run =bun run example:design= from this package for the real Library/Profile/Scenario
Run =bun run example:design= from the repository root for the real Library/Profile/Scenario
comparison. See [[../../docs/10-19-design/10-architecture/10.145-design-taste-public-contracts.org][10.145 contracts, tradeoffs and controls]].

* Taste before composition and artifact rights
Expand All @@ -259,3 +259,17 @@ the publishing host. It inserts comment notices before HTML/SVG fingerprints.
No project copyright is assigned to downstream output by default. See
[[file:THIRD-PARTY.org][asset notices]] and the bundled LICENSE and LICENSE.OFL-1.1 texts. This repository
uses official REUSE lint/CI; binary and strict JSON files use standard sidecars.


* Git dependency and package ownership
The repository-root =package.json= is the sole TypeScript package manifest and
version source. Implementation, examples and tests remain under =packages/render=.
The root exports point directly to those sources; no forwarding implementation,
installer hook or duplicated dependency list is maintained.

Downstream Bun consumers install the repository Git URL at a reviewed revision:
#+begin_src sh
bun add @deterministic-engineering/render@git+https://github.com/hardenedlinux/deterministic-engineering.git#<commit>
#+end_src
Bun owns Git fetching and the lockfile. A Git install needs no committed package
archive. Release tags are created only after the package/consumer checks pass.
18 changes: 16 additions & 2 deletions packages/render/examples/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

These maintained cases belong to =packages/render=. They use its public exports,
dependencies, typecheck and Bun commands. There is no nested package or
self-dependency. From =packages/render= run:
self-dependency. From the repository root run:

#+begin_src sh
bun install --frozen-lockfile
Expand Down Expand Up @@ -54,5 +54,19 @@ through an example self-dependency. See [[../../../docs/10-19-design/10-architec
=design-case.ts= is the pure graph/matrix composition and Case-specific space rule.
=design-choices.ts= reads 90.138, uses existing variants, exports three candidates,
binds Taste to each output and writes their comparison. Run =bun run example:design=
from =packages/render=. The source supplies audiences, reasons and tradeoffs.
from the repository root. The source supplies audiences, reasons and tradeoffs.
The Library supplies Design decoding, reference/Scope checks and pure Taste review.


* Git dependency and package ownership
The repository-root =package.json= is the sole TypeScript package manifest and
version source. Implementation, examples and tests remain under =packages/render=.
The root exports point directly to those sources; no forwarding implementation,
installer hook or duplicated dependency list is maintained.

Downstream Bun consumers install the repository Git URL at a reviewed revision:
#+begin_src sh
bun add @deterministic-engineering/render@git+https://github.com/hardenedlinux/deterministic-engineering.git#<commit>
#+end_src
Bun owns Git fetching and the lockfile. A Git install needs no committed package
archive. Release tags are created only after the package/consumer checks pass.
2 changes: 1 addition & 1 deletion packages/render/examples/design-choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {designCase,designTaste} from './design-case';
import {attributionFor} from './attribution';
const root=fileURLToPath(new URL('../../../',import.meta.url)),file='docs/90-99-views/90-architecture-views/90.138-library-design-taste-choices.d2';
const input=await compileFigureSource({[file]:await readFile(path.join(root,file),'utf8')},file);
const files=[...new Set([...Object.values(input.references),'packages/render/examples/design-choices.ts','packages/render/examples/design-case.ts','packages/render/examples/attribution.ts',...['design','taste','taste-selection','taste-policies','model-view','figure','diagram','export','scene-export'].map(name=>'packages/render/src/'+name+'.ts'),'packages/render/package.json'])];
const files=[...new Set([...Object.values(input.references),'packages/render/examples/design-choices.ts','packages/render/examples/design-case.ts','packages/render/examples/attribution.ts',...['design','taste','taste-selection','taste-policies','model-view','figure','diagram','export','scene-export'].map(name=>'packages/render/src/'+name+'.ts'),'package.json'])];
const sources=Object.fromEntries(await Promise.all(files.map(async file=>[file,await readFile(path.join(root,file),'utf8')])));
const directory=path.join(root,'.cache/render/design-choices');await mkdir(directory,{recursive:true});
const candidates=input.variants?.length?input.variants.map(variant=>({name:variant.name,input:selectFigureVariant(input,variant.name)})):[{name:'selected',input}];
Expand Down
68 changes: 0 additions & 68 deletions packages/render/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/render/src/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {layoutScenes, extractSceneSVGs, type SceneLayoutReceipt} from './scene-export';
import {getSmoothStepPath, Position} from '@xyflow/system';
import rough from 'roughjs';
import packageInfo from '../package.json' with {type: 'json'};
import packageInfo from '../../../package.json' with {type: 'json'};
import { readFile } from 'node:fs/promises';
import type { Browser } from 'playwright';
import type {RenderObservation} from './taste';
Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/figure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {bindDesign,type Design} from './design';
import {deepFreeze} from './immutable';
import {parseFragment, type DefaultTreeAdapterTypes} from 'parse5';
import type { Shape, Connection, SQLColumn, Text, Class } from '@terrastruct/d2';
import packageInfo from '../package.json' with {type: 'json'};
import packageInfo from '../../../package.json' with {type: 'json'};
import { digest, relativeSource } from './source/catalog';
import { validatePurposeKind, type QuestionRef, type ViewSelection } from './source/types';
import { defaultIcons, type IconAsset } from './icons';
Expand Down
Loading