@flighthq/registry-codegen 0.5.1-next.820.97b3830 → 0.5.1-next.903.f434bc2

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 CHANGED
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/registry-codegen`. T
13
13
  This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
14
14
 
15
15
  - [Flight project](https://github.com/flighthq/flight)
16
- - [Source for @flighthq/registry-codegen@0.5.1-next.820.97b3830](https://github.com/flighthq/flight/tree/97b3830e843209d92da169e02a52c0574efe5c09/packages/registry-codegen)
17
- - [License](https://github.com/flighthq/flight/blob/97b3830e843209d92da169e02a52c0574efe5c09/LICENSE.md)
16
+ - [Source for @flighthq/registry-codegen@0.5.1-next.903.f434bc2](https://github.com/flighthq/flight/tree/f434bc233778d75aeea61995df3a8cfaec459a85/packages/registry-codegen)
17
+ - [License](https://github.com/flighthq/flight/blob/f434bc233778d75aeea61995df3a8cfaec459a85/LICENSE.md)
@@ -1,2 +1,3 @@
1
1
  export * from './registryCodegen';
2
+ export { initializeRegistryCodegenPlan } from './registryCodegen';
2
3
  //# sourceMappingURL=contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/contract.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './registryCodegen';
2
+ export { initializeRegistryCodegenPlan } from './registryCodegen';
2
3
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,3 +1,4 @@
1
- import type { Entity, RegistryCatalog, RegistryCodegenPlan, RequirementSet } from '@flighthq/types/contract';
1
+ import type { Entity, EntityConstruction, RegistryCatalog, RegistryCodegenPlan, RequirementSet } from '@flighthq/types/contract';
2
2
  export declare function createRegistryCodegenPlan(catalog: Readonly<RegistryCatalog>, requirements: Readonly<RequirementSet>, backend: string): RegistryCodegenPlan & Entity;
3
+ export declare function initializeRegistryCodegenPlan(out: EntityConstruction<RegistryCodegenPlan & Entity>, catalog: Readonly<RegistryCatalog>, requirements: Readonly<RequirementSet>, backend: string): void;
3
4
  //# sourceMappingURL=registryCodegen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registryCodegen.d.ts","sourceRoot":"","sources":["../src/registryCodegen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EAEf,mBAAmB,EAEnB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAIlC,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,EAClC,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,EACtC,OAAO,EAAE,MAAM,GACd,mBAAmB,GAAG,MAAM,CAmB9B"}
1
+ {"version":3,"file":"registryCodegen.d.ts","sourceRoot":"","sources":["../src/registryCodegen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,eAAe,EAEf,mBAAmB,EAEnB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,EAClC,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,EACtC,OAAO,EAAE,MAAM,GACd,mBAAmB,GAAG,MAAM,CAI9B;AAID,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,kBAAkB,CAAC,mBAAmB,GAAG,MAAM,CAAC,EACrD,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,EAClC,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,EACtC,OAAO,EAAE,MAAM,GACd,IAAI,CAkBN"}
@@ -1,8 +1,13 @@
1
- import { createEntity } from '@flighthq/entity/contract';
1
+ import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
2
  import { findRegistryCatalogEntries } from '@flighthq/registry-catalog/contract';
3
+ export function createRegistryCodegenPlan(catalog, requirements, backend) {
4
+ const out = allocateEntity();
5
+ initializeRegistryCodegenPlan(out, catalog, requirements, backend);
6
+ return finishEntity(out);
7
+ }
3
8
  // Resolve only facts here. A later emitter may choose how a row becomes source after the ownership lane
4
9
  // is ruled; this kernel cannot encode that decision accidentally because it returns no source text.
5
- export function createRegistryCodegenPlan(catalog, requirements, backend) {
10
+ export function initializeRegistryCodegenPlan(out, catalog, requirements, backend) {
6
11
  const entries = [];
7
12
  const unresolved = [];
8
13
  const seen = new Set();
@@ -19,7 +24,9 @@ export function createRegistryCodegenPlan(catalog, requirements, backend) {
19
24
  entries.push(...matches);
20
25
  }
21
26
  }
22
- return createEntity({ backend, entries, unresolved });
27
+ out.backend = backend;
28
+ out.entries = entries;
29
+ out.unresolved = unresolved;
23
30
  }
24
31
  function requirementIdentity(requirement) {
25
32
  return `${requirement.facet}\0${requirement.key}`;
@@ -1 +1 @@
1
- {"version":3,"file":"registryCodegen.js","sourceRoot":"","sources":["../src/registryCodegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAUjF,wGAAwG;AACxG,oGAAoG;AACpG,MAAM,UAAU,yBAAyB,CACvC,OAAkC,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C,KAAK,KAAK,WAAW,CAAC,GAAG,EAAE,CAAC;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/registry-codegen",
3
- "version": "0.5.1-next.820.97b3830",
3
+ "version": "0.5.1-next.903.f434bc2",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,9 +38,9 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/entity": "0.5.1-next.820.97b3830",
42
- "@flighthq/registry-catalog": "0.5.1-next.820.97b3830",
43
- "@flighthq/types": "0.5.1-next.820.97b3830"
41
+ "@flighthq/entity": "0.5.1-next.903.f434bc2",
42
+ "@flighthq/registry-catalog": "0.5.1-next.903.f434bc2",
43
+ "@flighthq/types": "0.5.1-next.903.f434bc2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "typescript": "^5.3.0"
@@ -1,4 +1,4 @@
1
- import { createEntity } from '@flighthq/entity/contract';
1
+ import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
2
2
  import { createRegistryCatalog } from '@flighthq/registry-catalog/contract';
3
3
  import type { RegistryCatalogEntry, RequirementSet } from '@flighthq/types/contract';
4
4
  import { EntityRuntimeKey, RequirementFacet } from '@flighthq/types/contract';
@@ -24,13 +24,15 @@ const shapeCommands: RegistryCatalogEntry = {
24
24
  describe('createRegistryCodegenPlan', () => {
25
25
  it('selects the matching backend rows in requirement and catalog order', () => {
26
26
  const catalog = createRegistryCatalog([shapeRenderer, shapeCommands, { ...shapeRenderer, backend: 'webgpu' }]);
27
- const requirements: RequirementSet = createEntity({
28
- covers: [RequirementFacet.SceneNodeKind],
29
- requirements: [
27
+ const requirements = (() => {
28
+ const out = allocateEntity<RequirementSet>();
29
+ out.covers = [RequirementFacet.SceneNodeKind];
30
+ out.requirements = [
30
31
  { facet: RequirementFacet.SceneNodeKind, key: 'Shape' },
31
32
  { facet: RequirementFacet.SceneNodeKind, key: 'Sprite' },
32
- ],
33
- });
33
+ ];
34
+ return finishEntity(out);
35
+ })();
34
36
 
35
37
  const plan = createRegistryCodegenPlan(catalog, requirements, 'webgl');
36
38
  expect(EntityRuntimeKey in plan).toBe(true);
@@ -44,10 +46,12 @@ describe('createRegistryCodegenPlan', () => {
44
46
  it('deduplicates repeated positive requirements without treating covers as requests', () => {
45
47
  const catalog = createRegistryCatalog([shapeRenderer]);
46
48
  const requirement = { facet: RequirementFacet.SceneNodeKind, key: 'Shape' } as const;
47
- const requirements: RequirementSet = createEntity({
48
- covers: [RequirementFacet.SceneNodeKind, RequirementFacet.SceneShapeCommand],
49
- requirements: [requirement, requirement],
50
- });
49
+ const requirements = (() => {
50
+ const out = allocateEntity<RequirementSet>();
51
+ out.covers = [RequirementFacet.SceneNodeKind, RequirementFacet.SceneShapeCommand];
52
+ out.requirements = [requirement, requirement];
53
+ return finishEntity(out);
54
+ })();
51
55
 
52
56
  expect(createRegistryCodegenPlan(catalog, requirements, 'webgl')).toMatchObject({
53
57
  backend: 'webgl',
@@ -58,7 +62,16 @@ describe('createRegistryCodegenPlan', () => {
58
62
 
59
63
  it('returns an empty plan for empty catalog contents and requirements', () => {
60
64
  expect(
61
- createRegistryCodegenPlan(createRegistryCatalog(), createEntity({ covers: [], requirements: [] }), 'webgl'),
65
+ createRegistryCodegenPlan(
66
+ createRegistryCatalog(),
67
+ (() => {
68
+ const out = allocateEntity<any>();
69
+ out.covers = [];
70
+ out.requirements = [];
71
+ return finishEntity(out);
72
+ })(),
73
+ 'webgl',
74
+ ),
62
75
  ).toMatchObject({
63
76
  backend: 'webgl',
64
77
  entries: [],