@swarm.ing/pieui 2.0.24 → 2.0.26

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.
Files changed (99) hide show
  1. package/dist/__tests__/step6-card-add-from.test.d.cts +2 -0
  2. package/dist/__tests__/step6-card-add-from.test.d.cts.map +1 -0
  3. package/dist/__tests__/step7-storybook.test.d.cts +2 -0
  4. package/dist/__tests__/step7-storybook.test.d.cts.map +1 -0
  5. package/dist/cli.js +5268 -3015
  6. package/dist/code/args.d.ts.map +1 -1
  7. package/dist/code/commands/add.d.ts.map +1 -1
  8. package/dist/code/commands/addEvent.d.ts.map +1 -1
  9. package/dist/code/commands/cardAddFromMeta.d.ts +4 -0
  10. package/dist/code/commands/cardAddFromMeta.d.ts.map +1 -0
  11. package/dist/code/commands/cardAddStory.d.ts +2 -0
  12. package/dist/code/commands/cardAddStory.d.ts.map +1 -0
  13. package/dist/code/commands/cardCheckSync.d.ts +12 -0
  14. package/dist/code/commands/cardCheckSync.d.ts.map +1 -0
  15. package/dist/code/commands/cardDumpMetadata.d.ts +45 -0
  16. package/dist/code/commands/cardDumpMetadata.d.ts.map +1 -0
  17. package/dist/code/commands/cardPull.d.ts.map +1 -1
  18. package/dist/code/commands/cardRemote/history.d.ts.map +1 -1
  19. package/dist/code/commands/cardRemote/public.d.ts.map +1 -1
  20. package/dist/code/commands/cardRemote/push.d.ts.map +1 -1
  21. package/dist/code/commands/cardView.d.ts.map +1 -1
  22. package/dist/code/commands/create.d.ts.map +1 -1
  23. package/dist/code/commands/createPieApp.d.ts.map +1 -1
  24. package/dist/code/commands/init.d.ts.map +1 -1
  25. package/dist/code/commands/login.d.ts.map +1 -1
  26. package/dist/code/commands/pageAdd.d.ts.map +1 -1
  27. package/dist/code/commands/pageAjax.d.ts.map +1 -1
  28. package/dist/code/commands/remove.d.ts.map +1 -1
  29. package/dist/code/commands/selfUpgrade.d.ts.map +1 -1
  30. package/dist/code/introspection/cardMetadata.d.ts.map +1 -0
  31. package/dist/code/introspection/collectFiles.d.ts +27 -0
  32. package/dist/code/introspection/collectFiles.d.ts.map +1 -0
  33. package/dist/code/introspection/compare.d.ts +29 -0
  34. package/dist/code/introspection/compare.d.ts.map +1 -0
  35. package/dist/code/introspection/errors.d.ts +32 -0
  36. package/dist/code/introspection/errors.d.ts.map +1 -0
  37. package/dist/code/introspection/extractEvents.d.ts +33 -0
  38. package/dist/code/introspection/extractEvents.d.ts.map +1 -0
  39. package/dist/code/introspection/extractEventsPayloads.d.ts +119 -0
  40. package/dist/code/introspection/extractEventsPayloads.d.ts.map +1 -0
  41. package/dist/code/introspection/extractImports.d.ts +46 -0
  42. package/dist/code/introspection/extractImports.d.ts.map +1 -0
  43. package/dist/code/introspection/findDataType.d.ts +59 -0
  44. package/dist/code/introspection/findDataType.d.ts.map +1 -0
  45. package/dist/code/introspection/findInputType.d.ts +42 -0
  46. package/dist/code/introspection/findInputType.d.ts.map +1 -0
  47. package/dist/code/introspection/index.d.ts +51 -0
  48. package/dist/code/introspection/index.d.ts.map +1 -0
  49. package/dist/code/{scan.d.ts → introspection/scan.d.ts} +1 -1
  50. package/dist/code/introspection/scan.d.ts.map +1 -0
  51. package/dist/code/introspection/schemaContext.d.ts +69 -0
  52. package/dist/code/introspection/schemaContext.d.ts.map +1 -0
  53. package/dist/code/{schema.d.ts → introspection/schemaPatch.d.ts} +1 -1
  54. package/dist/code/introspection/schemaPatch.d.ts.map +1 -0
  55. package/dist/code/introspection/typeToSchema.d.ts +38 -0
  56. package/dist/code/introspection/typeToSchema.d.ts.map +1 -0
  57. package/dist/code/jsonSchemaToTs.d.ts +4 -0
  58. package/dist/code/jsonSchemaToTs.d.ts.map +1 -0
  59. package/dist/code/patchPieCardForwarding.d.ts +22 -0
  60. package/dist/code/patchPieCardForwarding.d.ts.map +1 -0
  61. package/dist/code/printRequirements.d.ts +11 -0
  62. package/dist/code/printRequirements.d.ts.map +1 -0
  63. package/dist/code/services/models.d.ts.map +1 -1
  64. package/dist/code/services/projectLinks.d.ts +30 -0
  65. package/dist/code/services/projectLinks.d.ts.map +1 -0
  66. package/dist/code/services/storage.d.ts.map +1 -1
  67. package/dist/code/storybookIntegration.d.ts +28 -0
  68. package/dist/code/storybookIntegration.d.ts.map +1 -0
  69. package/dist/code/types.d.ts +26 -1
  70. package/dist/code/types.d.ts.map +1 -1
  71. package/dist/index.d.ts +5 -0
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.esm.js +2 -2
  74. package/dist/index.js +2 -2
  75. package/dist/storybook/addon/Panel.d.ts +5 -0
  76. package/dist/storybook/addon/Panel.d.ts.map +1 -0
  77. package/dist/storybook/addon/constants.d.ts +22 -0
  78. package/dist/storybook/addon/constants.d.ts.map +1 -0
  79. package/dist/storybook/addon/index.d.ts +11 -0
  80. package/dist/storybook/addon/index.d.ts.map +1 -0
  81. package/dist/storybook/addon/index.esm.js +2 -0
  82. package/dist/storybook/addon/index.js +2 -0
  83. package/dist/storybook/addon/manager.d.ts +2 -0
  84. package/dist/storybook/addon/manager.d.ts.map +1 -0
  85. package/dist/storybook/addon/manager.esm.js +3 -0
  86. package/dist/storybook/addon/manager.js +3 -0
  87. package/dist/storybook/addon/preset.d.cts +2 -0
  88. package/dist/storybook/addon/preset.d.cts.map +1 -0
  89. package/dist/storybook/addon/preset.js +20 -0
  90. package/dist/storybook/index.d.ts +29 -0
  91. package/dist/storybook/index.d.ts.map +1 -0
  92. package/dist/storybook/index.esm.js +2 -0
  93. package/dist/storybook/index.js +2 -0
  94. package/dist/util/ajaxCommonUtils.d.ts.map +1 -1
  95. package/package.json +25 -3
  96. package/dist/code/cardMetadata.d.ts.map +0 -1
  97. package/dist/code/scan.d.ts.map +0 -1
  98. package/dist/code/schema.d.ts.map +0 -1
  99. /package/dist/code/{cardMetadata.d.ts → introspection/cardMetadata.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/code/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOR,UAAU,EACb,MAAM,SAAS,CAAA;AAoJhB,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAG,UA+H1C,CAAA;AAED,MAAM,MAAM,SAAS,GACf,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,WAAW,GACX,MAAM,GACN,aAAa,GACb,MAAM,GACN,cAAc,CAAA;AAEpB,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,KAAG,SAAS,GAAG,IAmB5D,CAAA;AAyLD,eAAO,MAAM,UAAU,GAAI,QAAO,SAAiB,SAwBlD,CAAA"}
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/code/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOR,UAAU,EACb,MAAM,SAAS,CAAA;AA+JhB,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAG,UAyI1C,CAAA;AAED,MAAM,MAAM,SAAS,GACf,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,WAAW,GACX,MAAM,GACN,aAAa,GACb,MAAM,GACN,cAAc,CAAA;AAEpB,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,KAAG,SAAS,GAAG,IAe5D,CAAA;AAsMD,eAAO,MAAM,UAAU,GAAI,QAAO,SAAiB,SAwBlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/code/commands/add.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AA0C7D,eAAO,MAAM,UAAU,GACnB,eAAe,MAAM,EACrB,gBAAe,aAAmC,EAClD,UAAS,mBAAwB,SAmGpC,CAAA"}
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/code/commands/add.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AA2C7D,eAAO,MAAM,UAAU,GACnB,eAAe,MAAM,EACrB,gBAAe,aAAmC,EAClD,UAAS,mBAAwB,SAqGpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../src/code/commands/addEvent.ts"],"names":[],"mappings":"AAqFA,eAAO,MAAM,eAAe,GACxB,QAAQ,MAAM,EACd,eAAe,MAAM,EACrB,WAAW,MAAM,SA+IpB,CAAA"}
1
+ {"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../src/code/commands/addEvent.ts"],"names":[],"mappings":"AAyFA,eAAO,MAAM,eAAe,GACxB,QAAQ,MAAM,EACd,eAAe,MAAM,EACrB,WAAW,MAAM,SAiJpB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from '../types';
2
+ export declare const hasBackendSourceFor: (componentName: string) => boolean;
3
+ export declare const cardAddFromMetaCommand: (componentName: string, componentType: ComponentType, fromRaw: string | undefined) => void;
4
+ //# sourceMappingURL=cardAddFromMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardAddFromMeta.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardAddFromMeta.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAA2B,MAAM,UAAU,CAAA;AA8StE,eAAO,MAAM,mBAAmB,GAAI,eAAe,MAAM,KAAG,OAU3D,CAAA;AAED,eAAO,MAAM,sBAAsB,GAC/B,eAAe,MAAM,EACrB,eAAe,aAAa,EAC5B,SAAS,MAAM,GAAG,SAAS,KAC5B,IA8FF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const cardAddStoryCommand: (componentName: string) => void;
2
+ //# sourceMappingURL=cardAddStory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardAddStory.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardAddStory.ts"],"names":[],"mappings":"AA+HA,eAAO,MAAM,mBAAmB,GAAI,eAAe,MAAM,KAAG,IAyF3D,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * TS check-sync delegates the comparison to `pie card check-sync`,
3
+ * because the comparator must read both sides and TS code is forbidden
4
+ * from reading `{python: …}` envelopes. The pie side orchestrates:
5
+ * - reads its own `{python}` data via `build_card_metadata`
6
+ * - spawns `pieui card dump-metadata`, unwraps `{typescript: …}`,
7
+ * and runs `compare_metadata` on both.
8
+ *
9
+ * On TS side we just relay stdout/stderr and exit code.
10
+ */
11
+ export declare const cardCheckSyncCommand: (componentName: string) => Promise<number>;
12
+ //# sourceMappingURL=cardCheckSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardCheckSync.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardCheckSync.ts"],"names":[],"mappings":"AAkHA;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAC7B,eAAe,MAAM,KACtB,OAAO,CAAC,MAAM,CAoChB,CAAA"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * `pieui card dump-metadata <Name>` — emit PieMetadata JSON.
3
+ *
4
+ * This module is the orchestration layer. All introspection algorithms
5
+ * live in `code/introspection/` — see that package's JSDoc for inputs,
6
+ * outputs, and algorithmic assumptions of each piece.
7
+ */
8
+ import type { PieMetadata } from '../types';
9
+ /**
10
+ * Build the PieMetadata object for a component.
11
+ *
12
+ * INPUTS:
13
+ * - `componentName`: the PascalCase card name. Must correspond to a
14
+ * directory `<settings.componentsDir>/<componentName>/`.
15
+ *
16
+ * RETURNS: full PieMetadata object (see `types.ts`).
17
+ *
18
+ * ASSUMPTIONS:
19
+ * - The component's data type follows naming convention
20
+ * `<Name>Data` / `I<Name>Data` / `<Name>Props` (see findDataType).
21
+ * - `<PieCard>` JSX usage is the source of truth for events; methods
22
+ * must be an inline object literal (see extractEvents).
23
+ * - Input variant is detected ONLY via `<PieCard stored={X}/>`
24
+ * (see findInputType — policy decision in spec discussion).
25
+ *
26
+ * PIPELINE:
27
+ * 1. Glob component files (collectComponentFiles).
28
+ * 2. Build TS program/checker context (createSchemaContext).
29
+ * 3. Find props data type via naming convention.
30
+ * 4. Extract events strictly from `<PieCard methods={…}>`.
31
+ * 5. Recover each event handler's payload type.
32
+ * 6. Find input type via `<PieCard stored={X}/>`.
33
+ * 7. Split imports into packages / relativeImports.
34
+ */
35
+ export declare const buildCardMetadata: (componentName: string) => PieMetadata;
36
+ export declare const stringifyPieMetadata: (meta: PieMetadata) => string;
37
+ /**
38
+ * Top-level wrap envelope. Each CLI side wraps its metadata under
39
+ * `typescript` / `python` so a consumer can combine both ecosystems
40
+ * into one document for cross-side comparison.
41
+ */
42
+ export declare const DUMP_METADATA_ENVELOPE_KEY: "typescript";
43
+ /** CLI entry point. Builds metadata, writes to `outFile` or stdout. */
44
+ export declare const cardDumpMetadataCommand: (componentName: string, outFile: string | undefined) => void;
45
+ //# sourceMappingURL=cardDumpMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardDumpMetadata.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardDumpMetadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH,OAAO,KAAK,EAA4B,WAAW,EAAE,MAAM,UAAU,CAAA;AAwBrE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,iBAAiB,GAAI,eAAe,MAAM,KAAG,WAmEzD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,MAAM,WAAW,KAAG,MAChC,CAAA;AAEzB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAG,YAAqB,CAAA;AAqC/D,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,GAChC,eAAe,MAAM,EACrB,SAAS,MAAM,GAAG,SAAS,KAC5B,IAeF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cardPull.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardPull.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAEnE,CAAA"}
1
+ {"version":3,"file":"cardPull.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardPull.ts"],"names":[],"mappings":"AAiHA,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAmBnE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/history.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,wBAAwB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAkDD,eAAO,MAAM,wBAAwB,GACjC,SAAS,wBAAwB,KAClC,OAAO,CAAC,IAAI,CAgDd,CAAA"}
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/history.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,wBAAwB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAgDD,eAAO,MAAM,wBAAwB,GACjC,SAAS,wBAAwB,KAClC,OAAO,CAAC,IAAI,CAgDd,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/public.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,GAChC,eAAe,MAAM,KACtB,OAAO,CAAC,IAAI,CA0Bd,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/public.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,GAChC,eAAe,MAAM,KACtB,OAAO,CAAC,IAAI,CAwBd,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/push.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,GAC9B,SAAS,MAAM,KAChB,OAAO,CAAC,IAAI,CAoEd,CAAA"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../../src/code/commands/cardRemote/push.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,qBAAqB,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAoEzE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cardView.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardView.ts"],"names":[],"mappings":"AA0DA,eAAO,MAAM,eAAe,GAAI,eAAe,MAAM,KAAG,IA6EvD,CAAA"}
1
+ {"version":3,"file":"cardView.d.ts","sourceRoot":"","sources":["../../../src/code/commands/cardView.ts"],"names":[],"mappings":"AA4DA,eAAO,MAAM,eAAe,GAAI,eAAe,MAAM,KAAG,IAuFvD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/code/commands/create.ts"],"names":[],"mappings":"AA4FA,eAAO,MAAM,aAAa,GAAU,SAAS,MAAM,kBA+ClD,CAAA"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/code/commands/create.ts"],"names":[],"mappings":"AA8FA,eAAO,MAAM,aAAa,GAAU,SAAS,MAAM,kBA4DlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createPieApp.d.ts","sourceRoot":"","sources":["../../../src/code/commands/createPieApp.ts"],"names":[],"mappings":"AAmOA,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,SAuElD,CAAA"}
1
+ {"version":3,"file":"createPieApp.d.ts","sourceRoot":"","sources":["../../../src/code/commands/createPieApp.ts"],"names":[],"mappings":"AAoOA,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,SAyElD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/code/commands/init.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,GAAU,QAAQ,MAAM,kBAkH/C,CAAA"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/code/commands/init.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,WAAW,GAAU,QAAQ,MAAM,kBAsI/C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/code/commands/login.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,oCAAoC,CAAA;AAC7D,eAAO,MAAM,eAAe,yDAC8B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,6BAA6B,CAAA;AAC1D,eAAO,MAAM,mBAAmB,gCAAgC,CAAA;AAyEhE,MAAM,MAAM,mBAAmB,GAAG;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5C,CAAA;AAED,wBAAsB,YAAY,CAC9B,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAmFf"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/code/commands/login.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,oCAAoC,CAAA;AAC7D,eAAO,MAAM,eAAe,yDAC8B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,6BAA6B,CAAA;AAC1D,eAAO,MAAM,mBAAmB,gCAAgC,CAAA;AAyEhE,MAAM,MAAM,mBAAmB,GAAG;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5C,CAAA;AAED,wBAAsB,YAAY,CAC9B,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAkGf"}
@@ -1 +1 @@
1
- {"version":3,"file":"pageAdd.d.ts","sourceRoot":"","sources":["../../../src/code/commands/pageAdd.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,SAoB9C,CAAA"}
1
+ {"version":3,"file":"pageAdd.d.ts","sourceRoot":"","sources":["../../../src/code/commands/pageAdd.ts"],"names":[],"mappings":"AAqDA,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,SAsB9C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pageAjax.d.ts","sourceRoot":"","sources":["../../../src/code/commands/pageAjax.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA6B9C,eAAO,MAAM,eAAe,GACxB,UAAU,MAAM,EAChB,QAAQ,cAAc,EACtB,aAAa,MAAM,KACpB,IA8BF,CAAA"}
1
+ {"version":3,"file":"pageAjax.d.ts","sourceRoot":"","sources":["../../../src/code/commands/pageAjax.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA2B9C,eAAO,MAAM,eAAe,GACxB,UAAU,MAAM,EAChB,QAAQ,cAAc,EACtB,aAAa,MAAM,KACpB,IA+BF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/code/commands/remove.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,GAAI,eAAe,MAAM,SAsDlD,CAAA"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/code/commands/remove.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,GAAI,eAAe,MAAM,SAwDlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"selfUpgrade.d.ts","sourceRoot":"","sources":["../../../src/code/commands/selfUpgrade.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,kBAAkB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAwCxE,CAAA"}
1
+ {"version":3,"file":"selfUpgrade.d.ts","sourceRoot":"","sources":["../../../src/code/commands/selfUpgrade.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,kBAAkB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAwCxE,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardMetadata.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/cardMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,OAAO,CAAA;CACd,CAAA;AAeD,eAAO,MAAM,mBAAmB,GAC5B,eAAe,MAAM,EACrB,QAAQ,MAAM,GAAG,SAAS,KAC3B,YAeF,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,MAAM,YAAY,KAAG,UAM1D,CAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Glob a component directory for source files relevant to introspection.
3
+ *
4
+ * Excludes everything that's not "real" component code: tests, snapshots,
5
+ * Storybook stories, mocks.
6
+ */
7
+ /**
8
+ * Return absolute paths of `.ts`/`.tsx`/`.css` files belonging to a
9
+ * component, sorted, deduplicated.
10
+ *
11
+ * ASSUMES: `componentDir` is the absolute directory containing the
12
+ * component (e.g. `<cwd>/piecomponents/<Name>`).
13
+ *
14
+ * RETURNS: sorted absolute paths. Empty array if nothing matches.
15
+ *
16
+ * EXCLUDED:
17
+ * - `**​/__tests__/**` / `**​/__snapshots__/**` / `**​/__mocks__/**`
18
+ * - `*.test.{ts,tsx}` / `*.spec.{ts,tsx}`
19
+ * - `*.stories.{ts,tsx}` (Storybook)
20
+ *
21
+ * EDGE CASES:
22
+ * - Files outside `componentDir` are never included.
23
+ * - `.css` files are listed but not parsed by downstream introspection
24
+ * (they go into `files` for completeness).
25
+ */
26
+ export declare const collectComponentFiles: (componentDir: string) => string[];
27
+ //# sourceMappingURL=collectFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectFiles.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/collectFiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,KAAG,MAAM,EAwBlE,CAAA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Compare two PieMetadata blobs (Python ↔ TS) and report divergences.
3
+ * Mirror of pie/code/metadata_compare.py.
4
+ *
5
+ * Policies (per spec discussion):
6
+ * A. `required` may differ if base types match modulo nullability.
7
+ * Flag only true type/nullability mismatches.
8
+ * B. Framework-internal fields (`content`) are excluded server-side
9
+ * before serializing — comparison is symmetric.
10
+ * C. inputProps: Python ⇒ class extends InputCard; TS ⇒ `<PieCard stored={…}>`.
11
+ * Both must be present or both absent.
12
+ * D. IO-mixin fields must be declared on both sides (no special-case).
13
+ */
14
+ export type PieMetadataLike = {
15
+ name?: string;
16
+ events?: string[];
17
+ ajaxList?: string[];
18
+ propsSchema?: Record<string, unknown> | null;
19
+ inputPropsCode?: string | null;
20
+ inputPropsSchema?: Record<string, unknown> | null;
21
+ };
22
+ export type Finding = {
23
+ kind: string;
24
+ message: string;
25
+ [key: string]: unknown;
26
+ };
27
+ export declare const compareMetadata: (py: PieMetadataLike, ts: PieMetadataLike) => Finding[];
28
+ export declare const formatFindings: (componentName: string, findings: Finding[]) => string;
29
+ //# sourceMappingURL=compare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/compare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,CAAA;AAkJD,eAAO,MAAM,eAAe,GACxB,IAAI,eAAe,EACnB,IAAI,eAAe,KACpB,OAAO,EAoFT,CAAA;AAED,eAAO,MAAM,cAAc,GACvB,eAAe,MAAM,EACrB,UAAU,OAAO,EAAE,KACpB,MAUF,CAAA"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Errors raised by TS introspection.
3
+ *
4
+ * Each error carries:
5
+ * - the file being analysed (`sourceFile`)
6
+ * - line/column when available
7
+ * - a stack of contexts describing the location in the structure
8
+ * - actionable hint about how to fix the source
9
+ *
10
+ * These propagate to the CLI without being caught — the whole point
11
+ * of the strict model is to surface unknown shapes loudly.
12
+ */
13
+ export type IntrospectionErrorOptions = {
14
+ sourceFile?: string;
15
+ line?: number;
16
+ column?: number;
17
+ context?: string[];
18
+ hint?: string;
19
+ };
20
+ export declare class IntrospectionError extends Error {
21
+ sourceFile?: string;
22
+ line?: number;
23
+ column?: number;
24
+ context: string[];
25
+ hint?: string;
26
+ constructor(message: string, opts?: IntrospectionErrorOptions);
27
+ /** Push a context frame and return self (for try/catch rethrow). */
28
+ withContext(frame: string): IntrospectionError;
29
+ private bareMessage;
30
+ }
31
+ export declare const errorOptsFromNode: (sourceFile: any, node: any) => IntrospectionErrorOptions;
32
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,yBAAyB,GAAG;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;gBAED,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,yBAA8B;IAyBjE,oEAAoE;IACpE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB;IAc9C,OAAO,CAAC,WAAW;CAWtB;AAoBD,eAAO,MAAM,iBAAiB,GAC1B,YAAY,GAAG,EACf,MAAM,GAAG,KACV,yBAGD,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Strict extraction of event names from `<PieCard methods={…}>` JSX.
3
+ *
4
+ * The contract is intentionally STRICT (asymmetric to the lenient
5
+ * Python side): `methods={…}` MUST be an inline object literal with
6
+ * static keys. Spread, variable references, computed keys → throws.
7
+ *
8
+ * Rationale: TS authors who pass `methods={pieMethods}` (a hook return)
9
+ * have no way for static analysis to know the event surface. We force
10
+ * the call site to spell out the keys so the registry is observable.
11
+ *
12
+ * Use case: produces the `events` field of PieMetadata.
13
+ */
14
+ /**
15
+ * Extract the union of event names declared via `<PieCard methods={…}>`
16
+ * across the given files.
17
+ *
18
+ * ASSUMES: `files` are absolute paths to `.ts`/`.tsx` source files.
19
+ *
20
+ * RETURNS: sorted array of unique event names (object-literal keys).
21
+ *
22
+ * THROWS: Error with file:line if `methods={…}` is anything other than
23
+ * a plain inline object literal with static keys. Specifically:
24
+ * - `methods={spread}` (Identifier initializer) — throws.
25
+ * - `methods={{ ...other }}` (spread element) — throws.
26
+ * - `methods={{ [key]: handler }}` (computed key) — throws.
27
+ * - `methods={{ click: fn }}` (PropertyAssignment) — OK.
28
+ * - `methods={{ click }}` (Shorthand) — OK, key is `"click"`.
29
+ *
30
+ * Strings ARE accepted as keys (`methods={{ "click-x": fn }}`).
31
+ */
32
+ export declare const extractEvents: (files: string[]) => string[];
33
+ //# sourceMappingURL=extractEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractEvents.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/extractEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiGH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,KAAG,MAAM,EA2DrD,CAAA"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Recover the TS type of each event handler's first parameter, then
3
+ * produce `eventsPropsCode` (source text) and `eventsPropsSchema` (JSON
4
+ * Schema) for use in PieMetadata.
5
+ *
6
+ * Event handlers can be declared in three forms — all are handled here:
7
+ *
8
+ * 1. Inline arrow / function expression:
9
+ * methods={{ click: (e: ClickEvt) => doIt(e) }}
10
+ *
11
+ * 2. Shorthand property whose name matches a variable in scope:
12
+ * const click = (e: ClickEvt) => doIt(e)
13
+ * methods={{ click }}
14
+ *
15
+ * 3. Method declaration:
16
+ * methods={{ click(e: ClickEvt) { doIt(e) } }}
17
+ *
18
+ * In all three the parameter's type annotation is the source of truth.
19
+ */
20
+ import { type SchemaContext } from './schemaContext';
21
+ import type { JSONSchema } from '../types';
22
+ /**
23
+ * Follow a JSX shorthand or identifier reference back to the function
24
+ * declaration and return its first parameter node.
25
+ *
26
+ * ASSUMES: `identifier` is an AST `Identifier` node.
27
+ *
28
+ * RETURNS: the `Parameter` AST node, or `null` if:
29
+ * - the symbol can't be resolved by the checker.
30
+ * - the declaration isn't a function-like form we recognize even
31
+ * after unwrapping known wrappers.
32
+ *
33
+ * RESOLVES:
34
+ * - `FunctionDeclaration` — `function foo(p) {}`
35
+ * - `VariableDeclaration` initializer reducible to ArrowFunction /
36
+ * FunctionExpr via `unwrapToFunctionExpression`. That covers:
37
+ * const f = (e) => ...
38
+ * const f = useCallback((e) => ..., [])
39
+ * const f = ((e) => ...) as Handler
40
+ * const f = ((e) => ...) satisfies Handler
41
+ * const f = (<Handler>((e) => ...))
42
+ * - `MethodDeclaration` / `MethodSignature`
43
+ * - Alias symbols (re-exports) are unwrapped via `getAliasedSymbol`.
44
+ */
45
+ /**
46
+ * Result of resolving a handler reference to its declared function shape.
47
+ *
48
+ * - `{ kind: 'parameter', node }` — function has at least one parameter;
49
+ * `node` is the first one (we use its type as the event payload type).
50
+ * - `{ kind: 'no-payload' }` — function takes zero parameters; the event
51
+ * is legitimate but has no payload (schema = empty object).
52
+ * - `null` — couldn't resolve the reference back to a function shape
53
+ * we recognize (the caller decides whether to error).
54
+ */
55
+ export type HandlerResolution = {
56
+ kind: 'parameter';
57
+ node: any;
58
+ } | {
59
+ kind: 'no-payload';
60
+ } | null;
61
+ /**
62
+ * Follow an identifier (shorthand or initializer reference) back to the
63
+ * declaring function and report its handler shape.
64
+ *
65
+ * `shorthandParent` should be the `ShorthandPropertyAssignment` itself
66
+ * when the identifier comes from a `{ name }` shorthand — required for
67
+ * `getShorthandAssignmentValueSymbol` to resolve the variable.
68
+ */
69
+ export declare const followIdentifierToFunction: (ctx: SchemaContext, identifier: any, shorthandParent?: any) => HandlerResolution;
70
+ /**
71
+ * Render a function parameter as `{ code, schema }`.
72
+ *
73
+ * ASSUMES: `parameter` is an AST `Parameter` node; `sourceFile` is the
74
+ * `SourceFile` containing it (for `getText` to return original text).
75
+ *
76
+ * RETURNS:
77
+ * - `code`: the explicit type annotation if present (e.g.
78
+ * `"{ tab: string }"`), or the checker-inferred type as a string
79
+ * when the parameter is untyped.
80
+ * - `schema`: JSON Schema. Strategy:
81
+ * 1. If annotation is a `TypeReferenceNode` (`Foo`) — try
82
+ * `buildSchemaForType(ctx, "Foo")` (via typescript-json-schema).
83
+ * 2. Otherwise — fall back to `typeToSchema(checker.getTypeAtLocation(typeNode))`
84
+ * which walks the TS Type directly (handles inline literals).
85
+ * - `null` schema when neither path produces a result.
86
+ */
87
+ export declare const schemaForParameter: (ctx: SchemaContext, parameter: any, sourceFile: any) => {
88
+ code: string;
89
+ schema: JSONSchema | null;
90
+ };
91
+ /**
92
+ * Walk `<PieCard methods={…}>` JSX literals in every file, restrict to
93
+ * the previously-extracted `events` set, and recover each handler's
94
+ * parameter type as `{ code, schema }`.
95
+ *
96
+ * ASSUMES:
97
+ * - `events` is the list of event-name strings already discovered by
98
+ * `extractEvents` (which itself enforces the inline-object-literal
99
+ * rule). This pass tolerates the same shape — anything else is
100
+ * skipped without throwing.
101
+ * - `ctx` includes all `files` (so `getSourceFile()` succeeds).
102
+ *
103
+ * RETURNS:
104
+ * - `code`: `{ eventName: typeText }`. May be empty for events whose
105
+ * handler can't be statically resolved (e.g. `useCallback`-wrapped).
106
+ * - `schema`: `{ eventName: JSONSchema }`. Same caveat.
107
+ *
108
+ * EDGE CASES:
109
+ * - Spread / variable `methods={…}` is silently skipped here
110
+ * (because `extractEvents` already strictly rejected those, the
111
+ * unreachable case is defensive).
112
+ * - Events listed in `events[]` but not present as keys in the JSX
113
+ * are absent from the result (no synthetic entry).
114
+ */
115
+ export declare const extractEventsPayloads: (ctx: SchemaContext, files: string[], events: string[]) => {
116
+ code: Record<string, string>;
117
+ schema: Record<string, JSONSchema>;
118
+ };
119
+ //# sourceMappingURL=extractEventsPayloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractEventsPayloads.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/extractEventsPayloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAgF1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB,IAAI,CAAA;AAOV;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACnC,KAAK,aAAa,EAClB,YAAY,GAAG,EACf,kBAAiB,GAAU,KAC5B,iBA+BF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,GAC3B,KAAK,aAAa,EAClB,WAAW,GAAG,EACd,YAAY,GAAG,KAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;CAsB3C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,qBAAqB,GAC9B,KAAK,aAAa,EAClB,OAAO,MAAM,EAAE,EACf,QAAQ,MAAM,EAAE,KACjB;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAwHpE,CAAA"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Split a component's import graph into `relativeImports` (project-local
3
+ * file paths) and `packages` (third-party deps with version specs from
4
+ * package.json).
5
+ *
6
+ * Resolution strategy:
7
+ * 1. `ts.resolveModuleName` with a ts.sys-backed host.
8
+ * 2. Manual fallback through `tsconfig.json` paths aliases for cases
9
+ * where Bundler resolution doesn't match (e.g. `@/components/*`).
10
+ *
11
+ * Output classification:
12
+ * - resolved path INSIDE cwd AND NOT under any `node_modules/` →
13
+ * `relativeImports`.
14
+ * - everything else → `packages`, with version copied verbatim from
15
+ * `package.json` deps (dev/peer/optional included) when known.
16
+ */
17
+ export type ImportSplit = {
18
+ relativeImports: string[];
19
+ packages: string[];
20
+ };
21
+ /**
22
+ * Walk imports in each file and classify them.
23
+ *
24
+ * ASSUMES:
25
+ * - `files` are absolute paths.
26
+ * - `cwd` (default: `process.cwd()`) is the project root containing
27
+ * `tsconfig.json` and `package.json`.
28
+ *
29
+ * RETURNS:
30
+ * - `relativeImports`: sorted absolute paths to project-local files.
31
+ * `node_modules` paths are excluded — they're classified as packages.
32
+ * - `packages`: sorted strings ready for `bun add` / `npm install`.
33
+ * Format is either `name` (no version found) or `name@<spec>`
34
+ * where `<spec>` is the verbatim entry from package.json.
35
+ *
36
+ * EDGE CASES:
37
+ * - Symlinks INSIDE cwd → followed to realpath; if realpath is still
38
+ * inside cwd, kept as relativeImport; if outside, dropped as package.
39
+ * - Path-aliased imports (`@/x`) when `paths` is in tsconfig.json:
40
+ * resolved via `resolveByTsconfigPaths` if `ts.resolveModuleName`
41
+ * fails.
42
+ * - Bare specs starting with `.` or `/` that don't resolve to a real
43
+ * file → silently dropped (consumer can't add a missing file).
44
+ */
45
+ export declare const extractImports: (files: string[], cwd?: string) => ImportSplit;
46
+ //# sourceMappingURL=extractImports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractImports.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/extractImports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoNH,MAAM,MAAM,WAAW,GAAG;IACtB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc,GACvB,OAAO,MAAM,EAAE,EACf,MAAK,MAAsB,KAC5B,WA6DF,CAAA"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Locate the TypeScript `<Name>Data` declaration that defines a card's
3
+ * props shape, and the `pathname*` field names within it (ajaxList).
4
+ *
5
+ * The pieui convention: a card named `Foo` has its props described by
6
+ * `interface FooData { ... }`. Alternatives `IFooData` and `FooProps`
7
+ * are also recognized to accommodate older conventions.
8
+ */
9
+ import { type SchemaContext } from './schemaContext';
10
+ /**
11
+ * Try to find the card's data type by naming convention.
12
+ *
13
+ * ASSUMES: `componentName` is the PascalCase card name (e.g. `BoxCard`).
14
+ *
15
+ * RETURNS: `{ typeName, declaration }` for the first match, or `null`.
16
+ *
17
+ * TYPE NAME CANDIDATES, in priority order:
18
+ * 1. `<componentName>Data` — canonical pattern
19
+ * 2. `I<componentName>Data` — Hungarian variant
20
+ * 3. `<componentName>Props` — older code uses this for the data shape
21
+ *
22
+ * USAGE: pass the returned `declaration` to `getText()` for `propsCode`
23
+ * and `extractAjaxList()` for the `ajaxList` field.
24
+ */
25
+ export declare const findComponentDataTypeForName: (ctx: SchemaContext, componentName: string) => {
26
+ typeName: string;
27
+ declaration: any;
28
+ };
29
+ /**
30
+ * Extract ajax-pathname field names directly declared on the props
31
+ * interface or type alias.
32
+ *
33
+ * ASSUMES: `declaration` is an `InterfaceDeclaration` or
34
+ * `TypeAliasDeclaration` (typically the one returned by
35
+ * `findComponentDataTypeForName`).
36
+ *
37
+ * RETURNS: sorted unique field names whose identifier starts with
38
+ * `pathname`. Includes `pathname` itself plus camelCase variants
39
+ * (`pathnameClick`, `pathnameDelete`, ...).
40
+ *
41
+ * EDGE CASE: NESTED property signatures are also walked via
42
+ * `ts.forEachChild`. Future improvement could restrict to direct
43
+ * children of the type body to avoid bleed-through from anonymous
44
+ * inline types (cf. Python side which already limits to direct fields).
45
+ */
46
+ /**
47
+ * Direct members of the props type that start with `pathname`.
48
+ *
49
+ * Restricted to DIRECT members of the type body — nested object types
50
+ * with their own `pathname*` keys are NOT included to avoid spurious
51
+ * ajax fields bleeding from inner shapes.
52
+ *
53
+ * For interface declarations: walks `members`.
54
+ * For type aliases of TypeLiteral: walks `members`.
55
+ * For type aliases of union/intersection/other: returns []. To declare
56
+ * ajax fields, the props type must have a literal object shape.
57
+ */
58
+ export declare const extractAjaxList: (declaration: any) => string[];
59
+ //# sourceMappingURL=findDataType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findDataType.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/findDataType.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEzE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,GACrC,KAAK,aAAa,EAClB,eAAe,MAAM,KACtB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,GAAG,CAAA;CAmBtC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,aAAa,GAAG,KAAG,MAAM,EAwBxD,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Locate the type passed to `<PieCard stored={X} />` in JSX.
3
+ *
4
+ * Policy decision (per Policy C in the spec discussion): the TS side
5
+ * recognises an Input variant ONLY through the `stored` prop. No
6
+ * naming-convention fallback. If the card uses a hidden `<input>` element
7
+ * instead of `stored`, that's intentional and the metadata reports no
8
+ * input shape.
9
+ */
10
+ import type { SchemaContext } from './schemaContext';
11
+ /**
12
+ * Walk JSX `<PieCard stored={X}/>` attributes and recover the type of `X`.
13
+ *
14
+ * ASSUMES:
15
+ * - `ctx` was built with files that include `<PieCard>` JSX usage.
16
+ * - `files` is the list of files to scan (typically the component's
17
+ * own source files).
18
+ *
19
+ * RETURNS:
20
+ * - `{ typeName, declaration }` of the type alias / interface that
21
+ * types the `stored` expression, on first hit.
22
+ * - `null` if no `<PieCard stored=…>` is found in any file, or if the
23
+ * stored expression has no resolvable named type.
24
+ *
25
+ * ALGORITHM:
26
+ * 1. For each JSX `<PieCard>` element, look at attribute `stored`.
27
+ * 2. If its initializer is `{expr}`, ask the checker for `expr`'s
28
+ * type, then for that type's alias symbol or value symbol.
29
+ * 3. Take the first declaration that's an Interface/TypeAlias.
30
+ *
31
+ * EDGE CASES:
32
+ * - `<PieCard stored={anonymousObject}/>` where the inline object has
33
+ * no named type → returns `null`. Use a named interface or
34
+ * `as InputXxx` for the metadata to pick it up.
35
+ * - PieCard imported as a different name (`import { PieCard as Foo }`)
36
+ * → not detected. The tag-name check is strict on `"PieCard"`.
37
+ */
38
+ export declare const findStoredAttributeType: (ctx: SchemaContext, files: string[]) => {
39
+ typeName: string;
40
+ declaration: any;
41
+ } | null;
42
+ //# sourceMappingURL=findInputType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findInputType.d.ts","sourceRoot":"","sources":["../../../src/code/introspection/findInputType.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAKpD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,uBAAuB,GAChC,KAAK,aAAa,EAClB,OAAO,MAAM,EAAE,KAChB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,GAAG,CAAA;CAAE,GAAG,IAgE3C,CAAA"}