@ankhorage/studio 0.0.21 → 0.1.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 (188) hide show
  1. package/README.md +1 -2
  2. package/dist/cli/index.d.ts +4 -4
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +81 -66
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/hooks/useProjects.js +1 -1
  7. package/dist/hooks/useProjects.js.map +1 -1
  8. package/dist/host/createStudioHost.d.ts +13 -0
  9. package/dist/host/createStudioHost.d.ts.map +1 -0
  10. package/dist/host/createStudioHost.js +16 -0
  11. package/dist/host/createStudioHost.js.map +1 -0
  12. package/dist/host/http/security.d.ts +2 -0
  13. package/dist/host/http/security.d.ts.map +1 -0
  14. package/dist/host/http/security.js +55 -0
  15. package/dist/host/http/security.js.map +1 -0
  16. package/dist/host/http/server.d.ts +16 -0
  17. package/dist/host/http/server.d.ts.map +1 -0
  18. package/dist/host/http/server.js +549 -0
  19. package/dist/host/http/server.js.map +1 -0
  20. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +38 -0
  21. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -0
  22. package/dist/host/layout/auth/resolveAuthLayoutPlan.js +262 -0
  23. package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -0
  24. package/dist/host/layout/layoutGenerator.d.ts +19 -0
  25. package/dist/host/layout/layoutGenerator.d.ts.map +1 -0
  26. package/dist/host/layout/layoutGenerator.js +418 -0
  27. package/dist/host/layout/layoutGenerator.js.map +1 -0
  28. package/dist/host/layout/templates/auth/adapter.d.ts +6 -0
  29. package/dist/host/layout/templates/auth/adapter.d.ts.map +1 -0
  30. package/dist/host/layout/templates/auth/adapter.js +94 -0
  31. package/dist/host/layout/templates/auth/adapter.js.map +1 -0
  32. package/dist/host/layout/templates/auth/screen.d.ts +12 -0
  33. package/dist/host/layout/templates/auth/screen.d.ts.map +1 -0
  34. package/dist/host/layout/templates/auth/screen.js +648 -0
  35. package/dist/host/layout/templates/auth/screen.js.map +1 -0
  36. package/dist/host/layout/templates/auth/session.d.ts +2 -0
  37. package/dist/host/layout/templates/auth/session.d.ts.map +1 -0
  38. package/dist/host/layout/templates/auth/session.js +326 -0
  39. package/dist/host/layout/templates/auth/session.js.map +1 -0
  40. package/dist/host/layout/templates/auth/signOut.d.ts +2 -0
  41. package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -0
  42. package/dist/host/layout/templates/auth/signOut.js +43 -0
  43. package/dist/host/layout/templates/auth/signOut.js.map +1 -0
  44. package/dist/host/layout/templates/index.d.ts +11 -0
  45. package/dist/host/layout/templates/index.d.ts.map +1 -0
  46. package/dist/host/layout/templates/index.js +10 -0
  47. package/dist/host/layout/templates/index.js.map +1 -0
  48. package/dist/host/layout/templates/navigation.d.ts +16 -0
  49. package/dist/host/layout/templates/navigation.d.ts.map +1 -0
  50. package/dist/host/layout/templates/navigation.js +332 -0
  51. package/dist/host/layout/templates/navigation.js.map +1 -0
  52. package/dist/host/layout/templates/nestedLayout.d.ts +7 -0
  53. package/dist/host/layout/templates/nestedLayout.d.ts.map +1 -0
  54. package/dist/host/layout/templates/nestedLayout.js +56 -0
  55. package/dist/host/layout/templates/nestedLayout.js.map +1 -0
  56. package/dist/host/layout/templates/redirect.d.ts +2 -0
  57. package/dist/host/layout/templates/redirect.d.ts.map +1 -0
  58. package/dist/host/layout/templates/redirect.js +10 -0
  59. package/dist/host/layout/templates/redirect.js.map +1 -0
  60. package/dist/host/layout/templates/rootLayout.d.ts +28 -0
  61. package/dist/host/layout/templates/rootLayout.d.ts.map +1 -0
  62. package/dist/host/layout/templates/rootLayout.js +507 -0
  63. package/dist/host/layout/templates/rootLayout.js.map +1 -0
  64. package/dist/host/layout/templates/screen.d.ts +6 -0
  65. package/dist/host/layout/templates/screen.d.ts.map +1 -0
  66. package/dist/host/layout/templates/screen.js +94 -0
  67. package/dist/host/layout/templates/screen.js.map +1 -0
  68. package/dist/host/layout/templates/utils/routes.d.ts +3 -0
  69. package/dist/host/layout/templates/utils/routes.d.ts.map +1 -0
  70. package/dist/host/layout/templates/utils/routes.js +15 -0
  71. package/dist/host/layout/templates/utils/routes.js.map +1 -0
  72. package/dist/host/layout/templates/utils/strings.d.ts +3 -0
  73. package/dist/host/layout/templates/utils/strings.d.ts.map +1 -0
  74. package/dist/host/layout/templates/utils/strings.js +7 -0
  75. package/dist/host/layout/templates/utils/strings.js.map +1 -0
  76. package/dist/host/layout/utils/escapeStringLiteral.d.ts +2 -0
  77. package/dist/host/layout/utils/escapeStringLiteral.d.ts.map +1 -0
  78. package/dist/host/layout/utils/escapeStringLiteral.js +8 -0
  79. package/dist/host/layout/utils/escapeStringLiteral.js.map +1 -0
  80. package/dist/host/manifestSystem/auth/index.d.ts +2 -0
  81. package/dist/host/manifestSystem/auth/index.d.ts.map +1 -0
  82. package/dist/host/manifestSystem/auth/index.js +2 -0
  83. package/dist/host/manifestSystem/auth/index.js.map +1 -0
  84. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts +4 -0
  85. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts.map +1 -0
  86. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +7 -0
  87. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -0
  88. package/dist/host/manifestSystem/auth/shared/index.d.ts +3 -0
  89. package/dist/host/manifestSystem/auth/shared/index.d.ts.map +1 -0
  90. package/dist/host/manifestSystem/auth/shared/index.js +8 -0
  91. package/dist/host/manifestSystem/auth/shared/index.js.map +1 -0
  92. package/dist/host/manifestSystem/index.d.ts +5 -0
  93. package/dist/host/manifestSystem/index.d.ts.map +1 -0
  94. package/dist/host/manifestSystem/index.js +23 -0
  95. package/dist/host/manifestSystem/index.js.map +1 -0
  96. package/dist/host/manifestSystem/types.d.ts +8 -0
  97. package/dist/host/manifestSystem/types.d.ts.map +1 -0
  98. package/dist/host/manifestSystem/types.js +2 -0
  99. package/dist/host/manifestSystem/types.js.map +1 -0
  100. package/dist/host/modules/catalog.d.ts +40 -0
  101. package/dist/host/modules/catalog.d.ts.map +1 -0
  102. package/dist/host/modules/catalog.js +112 -0
  103. package/dist/host/modules/catalog.js.map +1 -0
  104. package/dist/host/modules/layout.d.ts +7 -0
  105. package/dist/host/modules/layout.d.ts.map +1 -0
  106. package/dist/host/modules/layout.js +2 -0
  107. package/dist/host/modules/layout.js.map +1 -0
  108. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts +34 -0
  109. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts.map +1 -0
  110. package/dist/host/modules/runtime/LocalFsTargetAdapter.js +85 -0
  111. package/dist/host/modules/runtime/LocalFsTargetAdapter.js.map +1 -0
  112. package/dist/host/orchestrator/generatedAppFiles.d.ts +8 -0
  113. package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -0
  114. package/dist/host/orchestrator/generatedAppFiles.js +125 -0
  115. package/dist/host/orchestrator/generatedAppFiles.js.map +1 -0
  116. package/dist/host/orchestrator/generatedRouteCleanup.d.ts +5 -0
  117. package/dist/host/orchestrator/generatedRouteCleanup.d.ts.map +1 -0
  118. package/dist/host/orchestrator/generatedRouteCleanup.js +117 -0
  119. package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -0
  120. package/dist/host/orchestrator/infraGenerator.d.ts +35 -0
  121. package/dist/host/orchestrator/infraGenerator.d.ts.map +1 -0
  122. package/dist/host/orchestrator/infraGenerator.js +135 -0
  123. package/dist/host/orchestrator/infraGenerator.js.map +1 -0
  124. package/dist/host/orchestrator/infraRuntime.d.ts +38 -0
  125. package/dist/host/orchestrator/infraRuntime.d.ts.map +1 -0
  126. package/dist/host/orchestrator/infraRuntime.js +227 -0
  127. package/dist/host/orchestrator/infraRuntime.js.map +1 -0
  128. package/dist/host/orchestrator/infraValidation.d.ts +3 -0
  129. package/dist/host/orchestrator/infraValidation.d.ts.map +1 -0
  130. package/dist/host/orchestrator/infraValidation.js +59 -0
  131. package/dist/host/orchestrator/infraValidation.js.map +1 -0
  132. package/dist/host/orchestrator/moduleManager.d.ts +86 -0
  133. package/dist/host/orchestrator/moduleManager.d.ts.map +1 -0
  134. package/dist/host/orchestrator/moduleManager.js +312 -0
  135. package/dist/host/orchestrator/moduleManager.js.map +1 -0
  136. package/dist/host/orchestrator/projectDeletion.d.ts +27 -0
  137. package/dist/host/orchestrator/projectDeletion.d.ts.map +1 -0
  138. package/dist/host/orchestrator/projectDeletion.js +242 -0
  139. package/dist/host/orchestrator/projectDeletion.js.map +1 -0
  140. package/dist/host/orchestrator/projectManager.d.ts +87 -0
  141. package/dist/host/orchestrator/projectManager.d.ts.map +1 -0
  142. package/dist/host/orchestrator/projectManager.js +371 -0
  143. package/dist/host/orchestrator/projectManager.js.map +1 -0
  144. package/dist/host/orchestrator/projectPaths.d.ts +4 -0
  145. package/dist/host/orchestrator/projectPaths.d.ts.map +1 -0
  146. package/dist/host/orchestrator/projectPaths.js +25 -0
  147. package/dist/host/orchestrator/projectPaths.js.map +1 -0
  148. package/dist/host/orchestrator/projectStore.d.ts +24 -0
  149. package/dist/host/orchestrator/projectStore.d.ts.map +1 -0
  150. package/dist/host/orchestrator/projectStore.js +155 -0
  151. package/dist/host/orchestrator/projectStore.js.map +1 -0
  152. package/dist/host/orchestrator/resolveMutations.d.ts +3 -0
  153. package/dist/host/orchestrator/resolveMutations.d.ts.map +1 -0
  154. package/dist/host/orchestrator/resolveMutations.js +12 -0
  155. package/dist/host/orchestrator/resolveMutations.js.map +1 -0
  156. package/dist/host/orchestrator/scaffolder.d.ts +33 -0
  157. package/dist/host/orchestrator/scaffolder.d.ts.map +1 -0
  158. package/dist/host/orchestrator/scaffolder.js +246 -0
  159. package/dist/host/orchestrator/scaffolder.js.map +1 -0
  160. package/dist/host/orchestrator/templates.d.ts +83 -0
  161. package/dist/host/orchestrator/templates.d.ts.map +1 -0
  162. package/dist/host/orchestrator/templates.js +355 -0
  163. package/dist/host/orchestrator/templates.js.map +1 -0
  164. package/dist/host/orchestrator/workspaceRuntime.d.ts +2 -0
  165. package/dist/host/orchestrator/workspaceRuntime.d.ts.map +1 -0
  166. package/dist/host/orchestrator/workspaceRuntime.js +82 -0
  167. package/dist/host/orchestrator/workspaceRuntime.js.map +1 -0
  168. package/dist/host/templateRegistry/index.d.ts +16 -0
  169. package/dist/host/templateRegistry/index.d.ts.map +1 -0
  170. package/dist/host/templateRegistry/index.js +74 -0
  171. package/dist/host/templateRegistry/index.js.map +1 -0
  172. package/dist/host/utils/requirementsInference.d.ts +4 -0
  173. package/dist/host/utils/requirementsInference.d.ts.map +1 -0
  174. package/dist/host/utils/requirementsInference.js +49 -0
  175. package/dist/host/utils/requirementsInference.js.map +1 -0
  176. package/dist/host/utils/trimOutput.d.ts +7 -0
  177. package/dist/host/utils/trimOutput.d.ts.map +1 -0
  178. package/dist/host/utils/trimOutput.js +32 -0
  179. package/dist/host/utils/trimOutput.js.map +1 -0
  180. package/dist/host/utils/workspaceRoot.d.ts +2 -0
  181. package/dist/host/utils/workspaceRoot.d.ts.map +1 -0
  182. package/dist/host/utils/workspaceRoot.js +33 -0
  183. package/dist/host/utils/workspaceRoot.js.map +1 -0
  184. package/dist/host/zoraExtensions/index.d.ts +11 -0
  185. package/dist/host/zoraExtensions/index.d.ts.map +1 -0
  186. package/dist/host/zoraExtensions/index.js +54 -0
  187. package/dist/host/zoraExtensions/index.js.map +1 -0
  188. package/package.json +16 -3
@@ -0,0 +1,32 @@
1
+ export function trimOutputForApi(text, maxChars) {
2
+ if (maxChars <= 0) {
3
+ return {
4
+ text: '',
5
+ truncated: text.length > 0,
6
+ originalLength: text.length,
7
+ };
8
+ }
9
+ if (text.length <= maxChars) {
10
+ return {
11
+ text,
12
+ truncated: false,
13
+ originalLength: text.length,
14
+ };
15
+ }
16
+ const omitted = text.length - maxChars;
17
+ const marker = `\n...[truncated ${omitted} chars]`;
18
+ if (marker.length >= maxChars) {
19
+ return {
20
+ text: marker.slice(0, maxChars),
21
+ truncated: true,
22
+ originalLength: text.length,
23
+ };
24
+ }
25
+ const keep = maxChars - marker.length;
26
+ return {
27
+ text: `${text.slice(0, keep)}${marker}`,
28
+ truncated: true,
29
+ originalLength: text.length,
30
+ };
31
+ }
32
+ //# sourceMappingURL=trimOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trimOutput.js","sourceRoot":"","sources":["../../../src/host/utils/trimOutput.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,QAAgB;IAC7D,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC;YAC1B,cAAc,EAAE,IAAI,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC5B,OAAO;YACL,IAAI;YACJ,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,IAAI,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;IACvC,MAAM,MAAM,GAAG,mBAAmB,OAAO,SAAS,CAAC;IAEnD,IAAI,MAAM,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC;YAC/B,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,OAAO;QACL,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE;QACvC,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,IAAI,CAAC,MAAM;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function resolveWorkspaceRoot(fromDir: string, cwd?: string): string;
2
+ //# sourceMappingURL=workspaceRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceRoot.d.ts","sourceRoot":"","sources":["../../../src/host/utils/workspaceRoot.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAgB,UASxE"}
@@ -0,0 +1,33 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ const STUDIO_PACKAGE_NAME = '@ankhorage/studio';
4
+ export function resolveWorkspaceRoot(fromDir, cwd = process.cwd()) {
5
+ const candidates = [fromDir, cwd];
6
+ for (const candidate of candidates) {
7
+ const resolved = findStudioWorkspaceRoot(candidate);
8
+ if (resolved !== null)
9
+ return resolved;
10
+ }
11
+ throw new Error(`Could not resolve an ${STUDIO_PACKAGE_NAME} workspace from ${path.resolve(fromDir)} or ${path.resolve(cwd)}.`);
12
+ }
13
+ function findStudioWorkspaceRoot(startPath) {
14
+ let current = path.resolve(startPath);
15
+ for (;;) {
16
+ const packageJsonPath = path.join(current, 'package.json');
17
+ if (existsSync(packageJsonPath) && existsSync(path.join(current, 'apps'))) {
18
+ try {
19
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
20
+ if (packageJson.name === STUDIO_PACKAGE_NAME)
21
+ return current;
22
+ }
23
+ catch {
24
+ // Continue walking when a parent package.json is not valid JSON.
25
+ }
26
+ }
27
+ const parent = path.dirname(current);
28
+ if (parent === current)
29
+ return null;
30
+ current = parent;
31
+ }
32
+ }
33
+ //# sourceMappingURL=workspaceRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceRoot.js","sourceRoot":"","sources":["../../../src/host/utils/workspaceRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEhD,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IACvE,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAClC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAC;IACzC,CAAC;IACD,MAAM,IAAI,KAAK,CACb,wBAAwB,mBAAmB,mBAAmB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAC/G,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAiB;IAChD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,SAAS,CAAC;QACR,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,IAAI,UAAU,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YAC1E,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAuB,CAAC;gBAC5F,IAAI,WAAW,CAAC,IAAI,KAAK,mBAAmB;oBAAE,OAAO,OAAO,CAAC;YAC/D,CAAC;YAAC,MAAM,CAAC;gBACP,iEAAiE;YACnE,CAAC;QACH,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ProjectTemplateSelection } from '../templateRegistry';
2
+ export interface ZoraExtensionDefinition {
3
+ packageName: string;
4
+ components: Record<string, string>;
5
+ dependencies?: Record<string, string>;
6
+ }
7
+ export declare function resolveZoraExtensionsForTemplateSelection(selection: ProjectTemplateSelection): readonly ZoraExtensionDefinition[];
8
+ export declare function resolveZoraExtensionsFromDependencies(dependencies: Readonly<Record<string, string>>): readonly ZoraExtensionDefinition[];
9
+ export declare function mergeZoraExtensions(...extensionLists: readonly (readonly ZoraExtensionDefinition[])[]): readonly ZoraExtensionDefinition[];
10
+ export declare function collectZoraExtensionDependencies(extensions: readonly ZoraExtensionDefinition[]): Record<string, string>;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/zoraExtensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AA6BD,wBAAgB,yCAAyC,CACvD,SAAS,EAAE,wBAAwB,GAClC,SAAS,uBAAuB,EAAE,CAUpC;AAED,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC7C,SAAS,uBAAuB,EAAE,CAEpC;AAED,wBAAgB,mBAAmB,CACjC,GAAG,cAAc,EAAE,SAAS,CAAC,SAAS,uBAAuB,EAAE,CAAC,EAAE,GACjE,SAAS,uBAAuB,EAAE,CAUpC;AAED,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,SAAS,uBAAuB,EAAE,GAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB"}
@@ -0,0 +1,54 @@
1
+ const ZORA_CHESS_EXTENSION = {
2
+ packageName: '@ankhorage/zora-chess',
3
+ components: {
4
+ ChessBoard: 'ChessBoard',
5
+ OpeningBook: 'OpeningBook',
6
+ },
7
+ dependencies: {
8
+ '@ankhorage/zora-chess': 'latest',
9
+ },
10
+ };
11
+ const ZORA_TABLETOP_EXTENSION = {
12
+ packageName: '@ankhorage/zora-tabletop',
13
+ components: {
14
+ TabletopTable: 'TabletopTable',
15
+ Table: 'TabletopTable',
16
+ 'zora-tabletop/Table': 'TabletopTable',
17
+ '@ankhorage/zora-tabletop/Table': 'TabletopTable',
18
+ },
19
+ dependencies: {
20
+ '@ankhorage/zora-tabletop': 'latest',
21
+ },
22
+ };
23
+ const KNOWN_ZORA_EXTENSIONS = [ZORA_CHESS_EXTENSION, ZORA_TABLETOP_EXTENSION];
24
+ const TABLETOP_TEMPLATE_IDS = new Set(['card-trainer', 'card_trainer', 'poker']);
25
+ export function resolveZoraExtensionsForTemplateSelection(selection) {
26
+ if (selection.category === 'games' && selection.templateId === 'chess') {
27
+ return [ZORA_CHESS_EXTENSION];
28
+ }
29
+ if (selection.category === 'games' && TABLETOP_TEMPLATE_IDS.has(selection.templateId)) {
30
+ return [ZORA_TABLETOP_EXTENSION];
31
+ }
32
+ return [];
33
+ }
34
+ export function resolveZoraExtensionsFromDependencies(dependencies) {
35
+ return KNOWN_ZORA_EXTENSIONS.filter((extension) => extension.packageName in dependencies);
36
+ }
37
+ export function mergeZoraExtensions(...extensionLists) {
38
+ const extensions = new Map();
39
+ for (const extensionList of extensionLists) {
40
+ for (const extension of extensionList) {
41
+ extensions.set(extension.packageName, extension);
42
+ }
43
+ }
44
+ return [...extensions.values()];
45
+ }
46
+ export function collectZoraExtensionDependencies(extensions) {
47
+ return extensions.reduce((dependencies, extension) => {
48
+ return {
49
+ ...dependencies,
50
+ ...(extension.dependencies ?? {}),
51
+ };
52
+ }, {});
53
+ }
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/zoraExtensions/index.ts"],"names":[],"mappings":"AAQA,MAAM,oBAAoB,GAAG;IAC3B,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE;QACV,UAAU,EAAE,YAAY;QACxB,WAAW,EAAE,aAAa;KAC3B;IACD,YAAY,EAAE;QACZ,uBAAuB,EAAE,QAAQ;KAClC;CACgC,CAAC;AAEpC,MAAM,uBAAuB,GAAG;IAC9B,WAAW,EAAE,0BAA0B;IACvC,UAAU,EAAE;QACV,aAAa,EAAE,eAAe;QAC9B,KAAK,EAAE,eAAe;QACtB,qBAAqB,EAAE,eAAe;QACtC,gCAAgC,EAAE,eAAe;KAClD;IACD,YAAY,EAAE;QACZ,0BAA0B,EAAE,QAAQ;KACrC;CACgC,CAAC;AAEpC,MAAM,qBAAqB,GAAG,CAAC,oBAAoB,EAAE,uBAAuB,CAAU,CAAC;AACvF,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjF,MAAM,UAAU,yCAAyC,CACvD,SAAmC;IAEnC,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,IAAI,SAAS,CAAC,UAAU,KAAK,OAAO,EAAE,CAAC;QACvE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,IAAI,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACtF,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,YAA8C;IAE9C,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,IAAI,YAAY,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,GAAG,cAA+D;IAElE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmC,CAAC;IAE9D,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,KAAK,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC;YACtC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,UAA8C;IAE9C,OAAO,UAAU,CAAC,MAAM,CAAyB,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE;QAC3E,OAAO;YACL,GAAG,YAAY;YACf,GAAG,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC;SAClC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/studio",
3
- "version": "0.0.21",
3
+ "version": "0.1.0",
4
4
  "description": "Studio authoring package for Ankhorage apps",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ankhorage/studio#readme",
@@ -163,6 +163,10 @@
163
163
  "./studioSelectionModel": {
164
164
  "types": "./dist/studioSelectionModel.d.ts",
165
165
  "import": "./dist/studioSelectionModel.js"
166
+ },
167
+ "./host": {
168
+ "types": "./dist/host/index.d.ts",
169
+ "import": "./dist/host/index.js"
166
170
  }
167
171
  },
168
172
  "ankh": {
@@ -192,7 +196,9 @@
192
196
  "docs": "paradox",
193
197
  "changeset": "changeset",
194
198
  "changeset:status": "changeset status --since=origin/main",
195
- "version-packages": "changeset version"
199
+ "version-packages": "changeset version",
200
+ "dev:host": "bun src/host/http/standalone.ts",
201
+ "test:host-smoke": "bun test src/host/hostLifecycle.smoke.test.ts"
196
202
  },
197
203
  "keywords": [
198
204
  "ankhorage",
@@ -208,7 +214,14 @@
208
214
  "@ankhorage/runtime": "^0.2.1",
209
215
  "@ankhorage/zora": "^2.8.1",
210
216
  "@ankhorage/zora-chess": "^0.1.2",
211
- "@ankhorage/zora-tabletop": "^0.0.5"
217
+ "@ankhorage/zora-tabletop": "^0.0.5",
218
+ "@ankhorage/infra": "^0.3.1",
219
+ "@ankhorage/orchestrator": "^0.2.4",
220
+ "@ankhorage/orchestrator-module-expo-google-fonts": "^0.1.2",
221
+ "@ankhorage/orchestrator-module-expo-localization": "^0.1.5",
222
+ "@ankhorage/templates": "^1.9.2",
223
+ "@fastify/cors": "^11.2.0",
224
+ "fastify": "^5.7.4"
212
225
  },
213
226
  "peerDependencies": {
214
227
  "@expo/vector-icons": "^15.0.3",