@hexagen-monaco/sync 0.5.2 → 0.6.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.
Files changed (104) hide show
  1. package/dist/cli.js +1191 -389
  2. package/dist/cli.js.map +1 -1
  3. package/dist/config.d.ts +7 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/fs-utils.d.ts +13 -0
  6. package/dist/fs-utils.d.ts.map +1 -1
  7. package/dist/generators/apps-framework-templates.d.ts +2 -1
  8. package/dist/generators/apps-framework-templates.d.ts.map +1 -1
  9. package/dist/generators/apps.d.ts.map +1 -1
  10. package/dist/generators/architecture-files.d.ts.map +1 -1
  11. package/dist/generators/barrels/recursive.d.ts.map +1 -1
  12. package/dist/generators/cross-context.d.ts +5 -0
  13. package/dist/generators/cross-context.d.ts.map +1 -0
  14. package/dist/generators/eslint.d.ts +3 -1
  15. package/dist/generators/eslint.d.ts.map +1 -1
  16. package/dist/generators/layer-folders.d.ts.map +1 -1
  17. package/dist/generators/port-analyzer.d.ts +38 -4
  18. package/dist/generators/port-analyzer.d.ts.map +1 -1
  19. package/dist/generators/root-file-templates.d.ts +3 -3
  20. package/dist/generators/root-file-templates.d.ts.map +1 -1
  21. package/dist/generators/shared-kernel.d.ts +23 -0
  22. package/dist/generators/shared-kernel.d.ts.map +1 -0
  23. package/dist/generators/stubs.d.ts +13 -0
  24. package/dist/generators/stubs.d.ts.map +1 -1
  25. package/dist/index.js +950 -172
  26. package/dist/index.js.map +1 -1
  27. package/dist/scope-filter.d.ts +35 -0
  28. package/dist/scope-filter.d.ts.map +1 -0
  29. package/dist/sync-engine.d.ts.map +1 -1
  30. package/dist/templates/adobe-creative-production/manifest.json +2 -0
  31. package/dist/templates/adobe-express/manifest.json +2 -0
  32. package/dist/templates/adobe-firefly-composite/manifest.json +2 -0
  33. package/dist/templates/adobe-firefly-content-tagging/manifest.json +2 -0
  34. package/dist/templates/adobe-firefly-core/manifest.json +2 -0
  35. package/dist/templates/adobe-firefly-custom-models/manifest.json +2 -0
  36. package/dist/templates/adobe-firefly-generate/manifest.json +2 -0
  37. package/dist/templates/adobe-firefly-media/manifest.json +2 -0
  38. package/dist/templates/adobe-firefly-storage-azure/manifest.json +2 -0
  39. package/dist/templates/adobe-firefly-storage-gcs/manifest.json +2 -0
  40. package/dist/templates/adobe-firefly-storage-s3/manifest.json +2 -0
  41. package/dist/templates/adobe-firefly-upscale/manifest.json +2 -0
  42. package/dist/templates/adobe-illustrator/manifest.json +2 -0
  43. package/dist/templates/adobe-ims-spa/manifest.json +2 -0
  44. package/dist/templates/adobe-indesign/manifest.json +2 -0
  45. package/dist/templates/adobe-lightroom/manifest.json +2 -0
  46. package/dist/templates/adobe-photoshop/manifest.json +2 -0
  47. package/dist/templates/adobe-substance-3d/manifest.json +2 -0
  48. package/dist/templates/auth-mock/manifest.json +2 -0
  49. package/dist/templates/bedrock-agentcore-runtime/manifest.json +10 -2
  50. package/dist/templates/bedrock-agentcore-services/manifest.json +38 -9
  51. package/dist/templates/better-auth/manifest.json +2 -0
  52. package/dist/templates/bullmq/manifest.json +2 -0
  53. package/dist/templates/ci-github-actions/README.md +7 -0
  54. package/dist/templates/ci-github-actions/files/.github/dependabot.yml +16 -4
  55. package/dist/templates/ci-github-actions/files/.github/workflows/ci.yml +7 -3
  56. package/dist/templates/ci-github-actions/files/.github/workflows/preview.yml +20 -2
  57. package/dist/templates/ci-github-actions/manifest.json +26 -6
  58. package/dist/templates/clerk/manifest.json +2 -0
  59. package/dist/templates/design-system/manifest.json +14 -3
  60. package/dist/templates/docker/manifest.json +2 -0
  61. package/dist/templates/error-handling/manifest.json +2 -0
  62. package/dist/templates/eslint-no-console/manifest.json +2 -0
  63. package/dist/templates/github-oauth/manifest.json +2 -0
  64. package/dist/templates/google-oauth/manifest.json +2 -0
  65. package/dist/templates/langgraph/manifest.json +62 -15
  66. package/dist/templates/llm-adapter/manifest.json +2 -0
  67. package/dist/templates/magic-link/manifest.json +2 -0
  68. package/dist/templates/mcp-server/README.md +49 -0
  69. package/dist/templates/mcp-server/files/.env.mcp.example +6 -0
  70. package/dist/templates/mcp-server/files/.mcp.json.example +8 -0
  71. package/dist/templates/mcp-server/files/bin/cli.ts +15 -0
  72. package/dist/templates/mcp-server/files/src/infrastructure/mcp/prompts/example.prompt.ts +32 -0
  73. package/dist/templates/mcp-server/files/src/infrastructure/mcp/registry/register-all.ts +11 -0
  74. package/dist/templates/mcp-server/files/src/infrastructure/mcp/registry/tool-registry.test.ts +67 -0
  75. package/dist/templates/mcp-server/files/src/infrastructure/mcp/registry/tool-registry.ts +45 -0
  76. package/dist/templates/mcp-server/files/src/infrastructure/mcp/resources/example.resource.ts +28 -0
  77. package/dist/templates/mcp-server/files/src/infrastructure/mcp/sdk.ts +41 -0
  78. package/dist/templates/mcp-server/files/src/infrastructure/mcp/server.ts +52 -0
  79. package/dist/templates/mcp-server/files/src/infrastructure/mcp/tools/example.tool.test.ts +31 -0
  80. package/dist/templates/mcp-server/files/src/infrastructure/mcp/tools/example.tool.ts +74 -0
  81. package/dist/templates/mcp-server/files/src/infrastructure/mcp/transport/register-transports.ts +15 -0
  82. package/dist/templates/mcp-server/files/src/infrastructure/mcp/transport/stdio.ts +14 -0
  83. package/dist/templates/mcp-server/manifest.json +68 -0
  84. package/dist/templates/mcp-server-http/README.md +98 -0
  85. package/dist/templates/mcp-server-http/files/.env.mcp-http.example +22 -0
  86. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/bearer.test.ts +54 -0
  87. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/bearer.ts +49 -0
  88. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/oauth.test.ts +50 -0
  89. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/oauth.ts +53 -0
  90. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/guard.test.ts +75 -0
  91. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/guard.ts +26 -0
  92. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/transport/http.ts +94 -0
  93. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/transport/register-transports.ts +15 -0
  94. package/dist/templates/mcp-server-http/manifest.json +56 -0
  95. package/dist/templates/microsoft-entra/manifest.json +2 -0
  96. package/dist/templates/nextauth/manifest.json +2 -0
  97. package/dist/templates/observability/manifest.json +10 -2
  98. package/dist/templates/rate-limiting/manifest.json +2 -0
  99. package/dist/templates/shared-types/manifest.json +2 -0
  100. package/dist/templates/supabase/manifest.json +2 -0
  101. package/dist/templates/supabase-auth/manifest.json +2 -0
  102. package/dist/types/manifest/apps.d.ts +12 -1
  103. package/dist/types/manifest/apps.d.ts.map +1 -1
  104. package/package.json +1 -1
package/dist/config.d.ts CHANGED
@@ -9,6 +9,13 @@ export interface SyncFlags {
9
9
  strict: boolean;
10
10
  /** Mode is set programmatically (not via CLI). Use 'self-regen' for CLI, 'external' for API-driven generation */
11
11
  mode: "self-regen" | "external";
12
+ /**
13
+ * Optional `--only` scope patterns. When non-empty, the engine writes only
14
+ * files whose workspace-relative path matches one of these (see
15
+ * {@link matchesScope}); all others are skipped. Conservative direct-targets
16
+ * semantics — no dependency fan-out. Undefined/empty means "no filter".
17
+ */
18
+ only?: string[];
12
19
  logger: LoggerPort;
13
20
  }
14
21
  export interface SyncConfig extends SyncFlags {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAY,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAgEzC,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,iHAAiH;IACjH,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC;CACpB;AAGD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAgDtD"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAY,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAgEzC,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,iHAAiH;IACjH,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;CACpB;AAGD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CA2DtD"}
@@ -8,6 +8,19 @@ export declare function isGeneratedFile(content: string): boolean;
8
8
  * Check if a path points to a protected root file.
9
9
  */
10
10
  export declare function isProtectedRoot(filePath: string, config: SyncConfig): boolean;
11
+ /**
12
+ * Whether `filePath` is permitted by the active `--only` scope (or there is no
13
+ * scope filter). `safeWriteFileAtomic` enforces this for the write itself, but
14
+ * several generators create parent directories (and, in external mode, the
15
+ * bootstrap manifest) on their own BEFORE calling it — they must consult this
16
+ * first so an out-of-scope target produces no filesystem side effects at all,
17
+ * honouring the "skipped without being read or written" contract.
18
+ *
19
+ * Note: guarding a *redundant* pre-mkdir can never break an in-scope write —
20
+ * `safeWriteFileAtomic` recreates the parent directory (after its own scope
21
+ * check) anyway — so callers may guard liberally.
22
+ */
23
+ export declare function isInScope(filePath: string, config: SyncConfig): boolean;
11
24
  /**
12
25
  * Atomic, idempotent file writer.
13
26
  * Returns one of: created, updated, unchanged, skipped, protected.
@@ -1 +1 @@
1
- {"version":3,"file":"fs-utils.d.ts","sourceRoot":"","sources":["../src/fs-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAW9C,eAAO,MAAM,cAAc,aAiBzB,CAAC;AASH;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAY7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,EAC5E,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,CAuFxE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,CAQxE"}
1
+ {"version":3,"file":"fs-utils.d.ts","sourceRoot":"","sources":["../src/fs-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAY9C,eAAO,MAAM,cAAc,aAiBzB,CAAC;AASH;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAY7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAIvE;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,EAC5E,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,CAyGxE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,CAQxE"}
@@ -1,4 +1,5 @@
1
1
  import type { AppFramework, AppFrameworkConfig } from "../types/manifest.js";
2
- declare const BUILTIN_FRAMEWORK_TEMPLATES: Partial<Record<AppFramework, Required<AppFrameworkConfig>>>;
2
+ type BuiltinFrameworkTemplate = Required<Pick<AppFrameworkConfig, "packageJson" | "tsConfig" | "entryPoint">> & Pick<AppFrameworkConfig, "extraFiles">;
3
+ declare const BUILTIN_FRAMEWORK_TEMPLATES: Partial<Record<AppFramework, BuiltinFrameworkTemplate>>;
3
4
  export { BUILTIN_FRAMEWORK_TEMPLATES };
4
5
  //# sourceMappingURL=apps-framework-templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apps-framework-templates.d.ts","sourceRoot":"","sources":["../../src/generators/apps-framework-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAwI9B,QAAA,MAAM,2BAA2B,EAAE,OAAO,CACxC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CA0BnD,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"apps-framework-templates.d.ts","sourceRoot":"","sources":["../../src/generators/apps-framework-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AA8M9B,KAAK,wBAAwB,GAAG,QAAQ,CACtC,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,UAAU,GAAG,YAAY,CAAC,CACpE,GACC,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AAEzC,QAAA,MAAM,2BAA2B,EAAE,OAAO,CACxC,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAmC/C,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/generators/apps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AASxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAqDzD,wBAAsB,YAAY,CAChC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA2K1B"}
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/generators/apps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAUxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAyIzD,wBAAsB,YAAY,CAChC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAuO1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"architecture-files.d.ts","sourceRoot":"","sources":["../../src/generators/architecture-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAsKzD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA8E1B"}
1
+ {"version":3,"file":"architecture-files.d.ts","sourceRoot":"","sources":["../../src/generators/architecture-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA+KzD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA8E1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"recursive.d.ts","sourceRoot":"","sources":["../../../src/generators/barrels/recursive.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAa3E;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,KAAK,EAAE,MAAM,EAAE;gBAAf,KAAK,EAAE,MAAM,EAAE;CAI5C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC5E,OAAO,CAAC,eAAe,CAAC,CAiF1B"}
1
+ {"version":3,"file":"recursive.d.ts","sourceRoot":"","sources":["../../../src/generators/barrels/recursive.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAa3E;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,KAAK,EAAE,MAAM,EAAE;gBAAf,KAAK,EAAE,MAAM,EAAE;CAI5C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC5E,OAAO,CAAC,eAAe,CAAC,CA8H1B"}
@@ -0,0 +1,5 @@
1
+ import type { SyncConfig } from "../config.js";
2
+ import { type GeneratorResult } from "../results.js";
3
+ import type { ReportRecorder } from "../domain/types.js";
4
+ export declare function generateCrossContext(config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
5
+ //# sourceMappingURL=cross-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-context.d.ts","sourceRoot":"","sources":["../../src/generators/cross-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA0UzD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAoK1B"}
@@ -43,5 +43,7 @@ import type { ReportRecorder } from "../domain/types.js";
43
43
  * @returns A {@link GeneratorResult} with the single `eslint.config.js` path
44
44
  * categorised into `created` / `updated` / `skipped`.
45
45
  */
46
- export declare function generateEslintConfig(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
46
+ export declare function generateEslintConfig(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder, options?: {
47
+ usePerContextOverride?: boolean;
48
+ }): Promise<GeneratorResult>;
47
49
  //# sourceMappingURL=eslint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/generators/eslint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAsGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA+D1B"}
1
+ {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../src/generators/eslint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA4GzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,EACvB,OAAO,GAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAO,GAChD,OAAO,CAAC,eAAe,CAAC,CAmE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"layer-folders.d.ts","sourceRoot":"","sources":["../../src/generators/layer-folders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAMxE,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA6DD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC5E,OAAO,CAAC,eAAe,CAAC,CAsF1B"}
1
+ {"version":3,"file":"layer-folders.d.ts","sourceRoot":"","sources":["../../src/generators/layer-folders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAMxE,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA6DD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC5E,OAAO,CAAC,eAAe,CAAC,CAqG1B"}
@@ -1,3 +1,19 @@
1
+ /**
2
+ * Module specifier for importing `toFile` from `fromFile`, as an ESM-style
3
+ * relative path with a `.js` extension (e.g. an adapter in
4
+ * `infrastructure/adapters/` importing its port in `application/ports/out/`
5
+ * yields `../../application/ports/out/x.out-port.js`). Used so a generated
6
+ * adapter/use-case can import the port interface it implements.
7
+ */
8
+ export declare function relativeImportSpecifier(fromFile: string, toFile: string): string;
9
+ /**
10
+ * Rewrite a module specifier copied from `fromFile` so it still resolves from
11
+ * `toFile`. Bare/package specifiers (not starting with `.`) pass through; only
12
+ * RELATIVE ones are recomputed — a port's own `./dto.js` import is correct from
13
+ * the port's directory but breaks once copied verbatim into a generated
14
+ * adapter/use-case that lives in a different directory (#251 review).
15
+ */
16
+ export declare function rewriteRelativeSpecifier(specifier: string, fromFile: string, toFile: string): string;
1
17
  /**
2
18
  * Represents a method signature extracted from a port interface
3
19
  */
@@ -43,14 +59,32 @@ export declare function analyzePortFile(portFilePath: string): PortAnalysisResul
43
59
  * @param adapterName - Name of the adapter class
44
60
  * @returns TypeScript code for the adapter implementation
45
61
  */
46
- export declare function generateAdapterFromPort(analysis: PortAnalysisResult, adapterName: string): string;
62
+ export declare function generateAdapterFromPort(analysis: PortAnalysisResult, adapterName: string, portImportSpecifier?: string, outputFilePath?: string): string;
63
+ /**
64
+ * A single out-port dependency injected into a use-case's constructor. The
65
+ * caller pre-resolves these from the manifest + naming conventions because the
66
+ * out-port stub files may not exist yet when the use-case is emitted (use_cases
67
+ * are emitted before ports.out) — so they can't be analyzed from disk here.
68
+ */
69
+ export interface UseCaseOutPort {
70
+ /** The out-port interface type, e.g. `OrderRepoPort`. */
71
+ interfaceName: string;
72
+ /** The constructor parameter name, e.g. `orderRepo`. */
73
+ paramName: string;
74
+ /** ESM relative specifier to the out-port, e.g. `../ports/out/OrderRepo.out-port.js`. */
75
+ importSpecifier: string;
76
+ }
47
77
  /**
48
78
  * Generate a use case implementation scaffold from port analysis
49
79
  *
50
- * @param analysis - Port analysis result
80
+ * @param analysis - Port analysis result (the in-port the use-case fulfils)
51
81
  * @param useCaseName - Name of the use case class
52
- * @param outPorts - Array of out-port names this use case depends on
82
+ * @param outPorts - Resolved out-port dependencies (interface + import + param name)
83
+ * @param portImportSpecifier - Module specifier for the in-port interface, as seen
84
+ * from the use-case file (so `implements <interfaceName>` resolves)
85
+ * @param outputFilePath - Absolute path the use-case will be written to (used to
86
+ * rewrite the in-port's own relative imports so they resolve from here)
53
87
  * @returns TypeScript code for the use case implementation
54
88
  */
55
- export declare function generateUseCaseFromPort(analysis: PortAnalysisResult, useCaseName: string, outPorts: string[]): string;
89
+ export declare function generateUseCaseFromPort(analysis: PortAnalysisResult, useCaseName: string, outPorts: UseCaseOutPort[], portImportSpecifier?: string, outputFilePath?: string): string;
56
90
  //# sourceMappingURL=port-analyzer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"port-analyzer.d.ts","sourceRoot":"","sources":["../../src/generators/port-analyzer.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,GACnB,kBAAkB,GAAG,IAAI,CAwC3B;AA2ED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,GAClB,MAAM,CA6CR;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CA8DR"}
1
+ {"version":3,"file":"port-analyzer.d.ts","sourceRoot":"","sources":["../../src/generators/port-analyzer.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CASR;AA8DD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,GACnB,kBAAkB,GAAG,IAAI,CAwC3B;AA2ED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,EACnB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CAgER;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,cAAc,EAAE,EAC1B,mBAAmB,CAAC,EAAE,MAAM,EAC5B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CA+GR"}
@@ -1,7 +1,7 @@
1
1
  declare const BUILTIN_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"{system}\",\n \"private\": true,\n \"type\": \"module\",\n \"packageManager\": \"{packageManager}\",\n \"workspaces\": {workspaces},\n \"scripts\": {\n \"build\": \"turbo build\",\n \"dev\": \"turbo dev\",\n \"lint\": \"turbo lint\",\n \"typecheck\": \"turbo typecheck\",\n \"test\": \"turbo test\",\n \"clean\": \"turbo clean\",\n \"sync\": \"hexagen sync\",\n \"sync:dry\": \"hexagen sync --dry-run\",\n \"sync:force\": \"hexagen sync --force\",\n \"lint:arch\": \"hexagen arch validate\",\n \"templates:add\": \"hexagen add\",\n \"templates:validate\": \"hexagen validate-templates\",\n \"format\": \"prettier --write \\\"**/*.{ts,tsx,md}\\\"\"\n },\n \"devDependencies\": {\n \"turbo\": \"^2.0.0\",\n \"typescript\": \"^5.5.4\",\n \"eslint\": \"^9.0.0\",\n \"prettier\": \"^3.0.0\",\n \"@hexagen-monaco/sync\": \"^0.4.0\",\n \"@hexagen-monaco/arch-linter\": \"^0.4.0\"\n }\n}";
2
- declare const BUILTIN_TSCONFIG_BASE_TEMPLATE = "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"composite\": true,\n \"declaration\": true,\n \"emitDeclarationOnly\": true,\n \"paths\": {\n \"@{scope}/*\": [\n \"./packages/*/src/index.ts\"\n ]\n }\n }\n}";
3
- declare const BUILTIN_TURBO_TEMPLATE = "{\n \"$schema\": \"https://turbo.build/schema.json\",\n \"tasks\": {\n \"build\": {\n \"dependsOn\": [\n \"^build\"\n ],\n \"outputs\": [\n \"dist/**\"\n ]\n },\n \"dev\": {\n \"cache\": false,\n \"persistent\": true\n },\n \"lint\": {\n \"dependsOn\": [\n \"^build\"\n ]\n },\n \"typecheck\": {\n \"outputs\": [],\n \"cache\": true\n },\n \"test\": {\n \"dependsOn\": [\n \"^build\"\n ]\n }\n }\n}";
4
- declare const BUILTIN_GITIGNORE_TEMPLATE = "# Dependencies\nnode_modules/\n.yarn/cache\n.yarn/install-state.gz\n.pnp.*\n\n# Build output\ndist/\n.turbo/\n.next/\nout/\n\n# Test / coverage\ncoverage/\n\n# Environment\n.env\n.env.*\n!.env.example\n\n# Logs & OS\n*.log\n.DS_Store\n";
2
+ declare const BUILTIN_TSCONFIG_BASE_TEMPLATE = "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"skipLibCheck\": true,\n \"composite\": true,\n \"declaration\": true,\n \"emitDeclarationOnly\": true,\n \"paths\": {\n \"@{scope}/*\": [\n \"./packages/*/src/index.ts\"\n ]\n }\n }\n}";
3
+ declare const BUILTIN_TURBO_TEMPLATE = "{\n \"$schema\": \"https://turbo.build/schema.json\",\n \"tasks\": {\n \"build\": {\n \"dependsOn\": [\n \"^build\"\n ],\n \"outputs\": [\n \"dist/**\"\n ]\n },\n \"dev\": {\n \"cache\": false,\n \"persistent\": true\n },\n \"lint\": {\n \"dependsOn\": [\n \"^build\"\n ]\n },\n \"typecheck\": {\n \"dependsOn\": [\n \"^build\"\n ],\n \"outputs\": [],\n \"cache\": true\n },\n \"test\": {\n \"dependsOn\": [\n \"^build\"\n ]\n }\n }\n}";
4
+ declare const BUILTIN_GITIGNORE_TEMPLATE = "# Dependencies\nnode_modules/\n.yarn/cache\n.yarn/install-state.gz\n.pnp.*\n\n# Build output\ndist/\n.turbo/\n.next/\n.nitro/\n.output/\n\n# Next.js static export \u2014 anchored to apps so a bare `out/` can't shadow a\n# bounded context's hexagonal `src/application/ports/out/` source (which a\n# pattern without a leading path matches at any depth).\napps/*/out/\n\n# Test / coverage\ncoverage/\n\n# Environment\n.env\n.env.*\n!.env.example\n\n# Logs & OS\n*.log\n.DS_Store\n";
5
5
  declare const BUILTIN_YARNRC_TEMPLATE = "# Generated by hexagen. Corepack reads `packageManager` in package.json to\n# select the Yarn version; the node-modules linker keeps installs conventional.\nnodeLinker: node-modules\n";
6
6
  declare const BUILTIN_SETUP_MD_TEMPLATE = "# Setup\n\nThis project was scaffolded by hexagen. Before your first push:\n\n```bash\ncorepack enable # activate the pinned package manager\nyarn install # resolves dependencies, writes yarn.lock\ngit add yarn.lock && git commit -m \"chore: add lockfile\"\ngit push\n```\n\nOnce `yarn.lock` is committed, you can switch CI to a reproducible install by\nadding `--immutable` to the `yarn install` step in\n`.github/workflows/ci.yml` (npm: `npm ci`; pnpm: `pnpm install --frozen-lockfile`).\n\n**Notes**\n\n- CI reads your package-manager version from `package.json` (`packageManager`)\n via Corepack, so bumping it stays in sync automatically \u2014 nothing to edit in\n `ci.yml`.\n- **This file is a one-time bootstrap doc \u2014 delete it after your first push.**\n Its pre-lockfile guidance goes stale once `yarn.lock` is committed. (Run\n `hexagen sync` won't bring it back \u2014 it's a protected root file.)\n";
7
7
  export { BUILTIN_PACKAGE_JSON_TEMPLATE, BUILTIN_TSCONFIG_BASE_TEMPLATE, BUILTIN_TURBO_TEMPLATE, BUILTIN_GITIGNORE_TEMPLATE, BUILTIN_YARNRC_TEMPLATE, BUILTIN_SETUP_MD_TEMPLATE, };
@@ -1 +1 @@
1
- {"version":3,"file":"root-file-templates.d.ts","sourceRoot":"","sources":["../../src/generators/root-file-templates.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,6BAA6B,s8BA6BjC,CAAC;AAEH,QAAA,MAAM,8BAA8B,6VAelC,CAAC;AAEH,QAAA,MAAM,sBAAsB,4gBA8B1B,CAAC;AAEH,QAAA,MAAM,0BAA0B,gPAuB/B,CAAC;AAEF,QAAA,MAAM,uBAAuB,4LAG5B,CAAC;AAIF,QAAA,MAAM,yBAAyB,+7BAuB9B,CAAC;AAEF,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,GAC1B,CAAC"}
1
+ {"version":3,"file":"root-file-templates.d.ts","sourceRoot":"","sources":["../../src/generators/root-file-templates.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,6BAA6B,s8BA6BjC,CAAC;AAEH,QAAA,MAAM,8BAA8B,0XAgBlC,CAAC;AAEH,QAAA,MAAM,sBAAsB,kkBAiC1B,CAAC;AAEH,QAAA,MAAM,0BAA0B,keA6B/B,CAAC;AAEF,QAAA,MAAM,uBAAuB,4LAG5B,CAAC;AAIF,QAAA,MAAM,yBAAyB,+7BAuB9B,CAAC;AAEF,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,GAC1B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { SyncConfig } from "../config.js";
2
+ import { type GeneratorResult } from "../results.js";
3
+ import type { ReportRecorder } from "../domain/types.js";
4
+ /**
5
+ * Ensure the scaffolded `shared` package exports a `Result` type (#246).
6
+ *
7
+ * The generic use-case stub imports `Result` from `@{scope}/shared`; without a
8
+ * matching export the generated project fails to typecheck (TS2305 — the package
9
+ * resolves via the package-root barrel since #249, but has no `Result`). The
10
+ * kernel is written under the `domain` layer so the recursive package-root barrel
11
+ * (external mode) re-exports it automatically.
12
+ *
13
+ * EXTERNAL (API-driven) generation only. In `self-regen` (this monorepo) the
14
+ * `shared` package is hand-maintained and already provides `Result` (from
15
+ * `errors/result.ts`); writing a second `domain/result.ts` would re-export
16
+ * `Result` twice and break the build (TS2308) — the same two-worlds hazard as the
17
+ * package-root barrel (#249/#250). Only runs when a `shared` bounded context
18
+ * exists (the convention the use-case import assumes; `wizardToManifest` always
19
+ * emits one). Write-if-absent so a user's customized Result survives re-sync.
20
+ * Must run before the pass-2 barrels.
21
+ */
22
+ export declare function generateSharedKernel(config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
23
+ //# sourceMappingURL=shared-kernel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-kernel.d.ts","sourceRoot":"","sources":["../../src/generators/shared-kernel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAuBzD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAsD1B"}
@@ -1,5 +1,18 @@
1
1
  import type { SyncConfig } from "../config.js";
2
2
  import { type GeneratorResult } from "../results.js";
3
3
  import type { ReportRecorder } from "../domain/types.js";
4
+ /**
5
+ * Normalize a manifest layer name into a clean base used as BOTH the stub's file
6
+ * stem and its TS identifier (#242). Manifest producers vary: some emit a bare
7
+ * name (`OrderRepository`), some already append the kind extension
8
+ * (`rest-controller.in-port.ts`, from the wizard's getInboundPortName), and the
9
+ * port-type vocabulary is kebab-case (`relational-db`). Strip the kind's own
10
+ * extension if the value already carries it (so the naming template adds it
11
+ * exactly once instead of `…in-port.ts.in-port.ts`), then PascalCase — so the
12
+ * content template's `{name}Port`/`{name}Adapter` is a valid identifier rather
13
+ * than `interface rest-controller.in-port.tsPort`. A no-op for names that are
14
+ * already clean PascalCase. Mirrors what `architecture-files.ts` already does.
15
+ */
16
+ export declare function normalizeStubName(rawName: string, namingTemplate: string): string;
4
17
  export declare function generateStubs(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
5
18
  //# sourceMappingURL=stubs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/generators/stubs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwFzD,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA2F1B"}
1
+ {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/generators/stubs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAkBxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgHzD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,MAAM,CAmBR;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAuJ1B"}