@pygmalionjs/pygmalion 0.9.0 → 0.11.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/README.md +34 -0
- package/dist-lib/{CameraLayer-BdOko8XE.js → CameraLayer-BZ8HgrUG.js} +1 -1
- package/dist-lib/pygmalion.js +10813 -10529
- package/dist-lib/{runtime-Dxb-IaLN.js → runtime-Bxn8116i.js} +1825 -1798
- package/dist-lib/testing.js +15 -15
- package/dist-lib/types/binding/duplicateMetadata.d.ts +8 -0
- package/dist-lib/types/binding/index.d.ts +1 -0
- package/dist-lib/types/document/contracts.d.ts +10 -0
- package/dist-lib/types/document/prototype.d.ts +26 -5
- package/dist-lib/types/document/prototypeOccurrence.d.ts +18 -0
- package/dist-lib/types/lib.d.ts +6 -2
- package/dist-lib/types/token-library/valueResolver.d.ts +19 -0
- package/dist-lib/types/workspace/configuration.d.ts +8 -0
- package/dist-lib/types/workspace/edit/projection.d.ts +1 -1
- package/dist-lib/types/workspace/edit/prototypeProjection.d.ts +7 -0
- package/dist-lib/types/workspace/view/PrototypePlayer.d.ts +4 -3
- package/dist-lib/types/workspace/view/prototypePlayback.d.ts +2 -2
- package/host-runtime.d.ts +73 -0
- package/jsx-source-reconciler.d.ts +35 -0
- package/node/host-runtime.mjs +4 -0
- package/node/jsx-source-reconciler.mjs +155 -0
- package/node/revision-catalog-resolver.mjs +159 -0
- package/node/source-archive-runtime.mjs +63 -0
- package/node/source-module.mjs +17 -0
- package/node/source-service-inputs.mjs +81 -0
- package/node/source-service-plugin.mjs +57 -0
- package/node/source-service.mjs +4 -0
- package/node/token-source-service.mjs +151 -0
- package/node/workspace-draft-entry.mjs +52 -0
- package/node/workspace-draft-preview.mjs +3 -2
- package/node/workspace-draft-process.mjs +129 -0
- package/node/workspace-draft-runtime.mjs +67 -0
- package/node/workspace-source-session.mjs +187 -0
- package/package.json +40 -2
- package/source-module.d.ts +16 -0
- package/source-service.d.ts +92 -0
- package/workspace-draft-entry.d.ts +15 -0
package/README.md
CHANGED
|
@@ -442,6 +442,40 @@ Shared edits update detailed active frames and lightweight inactive frames in
|
|
|
442
442
|
the same render cycle. A frame does not need to be activated before it reflects
|
|
443
443
|
a shared change.
|
|
444
444
|
|
|
445
|
+
### Connect source adapters to SDK services
|
|
446
|
+
|
|
447
|
+
The host supplies screen declarations, source mappings, authentication or mock
|
|
448
|
+
setup, and build commands. Pygmalion owns reusable execution, revision caching,
|
|
449
|
+
source review, and cancellation. Keep SDK implementation and regression tests
|
|
450
|
+
in Pygmalion; host tests continue to cover the product's own behavior.
|
|
451
|
+
|
|
452
|
+
| Package subpath | Responsibility |
|
|
453
|
+
| --- | --- |
|
|
454
|
+
| `./host-runtime` | Process-group cleanup, revision catalog queues and caches, isolated source roots, and lockfile-matched dependencies. |
|
|
455
|
+
| `./source-service` | Source and token review receipts, apply validation, reconciliation sessions, and local JSON transport. |
|
|
456
|
+
| `./source-reconciler` | Reconcile draft structure with external source edits using host-supplied source identity mappings. |
|
|
457
|
+
| `./draft-entry` | Generate a browser entry that applies the declared draft recipe and reports readiness or failure. |
|
|
458
|
+
| `./source-module` | Evaluate a trusted declaration bundle using the host's bundler configuration. |
|
|
459
|
+
|
|
460
|
+
For example, declare a build command in the host and let the SDK wait for its
|
|
461
|
+
process group to stop before an archive can be removed:
|
|
462
|
+
|
|
463
|
+
```js
|
|
464
|
+
import { executeWorkspaceDraftProcess } from '@pygmalionjs/pygmalion/host-runtime';
|
|
465
|
+
|
|
466
|
+
export function buildPreview({ cwd, signal }) {
|
|
467
|
+
return executeWorkspaceDraftProcess(process.execPath, ['scripts/build-preview.mjs'], {
|
|
468
|
+
cwd,
|
|
469
|
+
signal,
|
|
470
|
+
timeout: 120_000,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
Process-group cleanup supports macOS and Linux. Catalog generation callbacks
|
|
476
|
+
receive an isolated archive for the exact requested commit; cancelling one
|
|
477
|
+
catalog request does not cancel generation shared with another caller.
|
|
478
|
+
|
|
445
479
|
## Local development
|
|
446
480
|
|
|
447
481
|
```bash
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { j as g, R as C, aI as P,
|
|
2
|
+
import { j as g, R as C, aI as P, cf as R, cg as E, U as I, ch as k, a3 as m, a0 as b } from "./runtime-Bxn8116i.js";
|
|
3
3
|
import { useRef as L, useLayoutEffect as h } from "react";
|
|
4
4
|
function f(n) {
|
|
5
5
|
return `translate(${n.panX}px, ${n.panY}px) scale(${n.zoom})`;
|