@ankhorage/studio 0.0.21 → 0.1.1

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 (196) 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/index.d.ts +10 -0
  21. package/dist/host/index.d.ts.map +1 -0
  22. package/dist/host/index.js +10 -0
  23. package/dist/host/index.js.map +1 -0
  24. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +38 -0
  25. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -0
  26. package/dist/host/layout/auth/resolveAuthLayoutPlan.js +262 -0
  27. package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -0
  28. package/dist/host/layout/layoutGenerator.d.ts +19 -0
  29. package/dist/host/layout/layoutGenerator.d.ts.map +1 -0
  30. package/dist/host/layout/layoutGenerator.js +418 -0
  31. package/dist/host/layout/layoutGenerator.js.map +1 -0
  32. package/dist/host/layout/templates/auth/adapter.d.ts +6 -0
  33. package/dist/host/layout/templates/auth/adapter.d.ts.map +1 -0
  34. package/dist/host/layout/templates/auth/adapter.js +94 -0
  35. package/dist/host/layout/templates/auth/adapter.js.map +1 -0
  36. package/dist/host/layout/templates/auth/screen.d.ts +12 -0
  37. package/dist/host/layout/templates/auth/screen.d.ts.map +1 -0
  38. package/dist/host/layout/templates/auth/screen.js +648 -0
  39. package/dist/host/layout/templates/auth/screen.js.map +1 -0
  40. package/dist/host/layout/templates/auth/session.d.ts +2 -0
  41. package/dist/host/layout/templates/auth/session.d.ts.map +1 -0
  42. package/dist/host/layout/templates/auth/session.js +326 -0
  43. package/dist/host/layout/templates/auth/session.js.map +1 -0
  44. package/dist/host/layout/templates/auth/signOut.d.ts +2 -0
  45. package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -0
  46. package/dist/host/layout/templates/auth/signOut.js +43 -0
  47. package/dist/host/layout/templates/auth/signOut.js.map +1 -0
  48. package/dist/host/layout/templates/index.d.ts +11 -0
  49. package/dist/host/layout/templates/index.d.ts.map +1 -0
  50. package/dist/host/layout/templates/index.js +10 -0
  51. package/dist/host/layout/templates/index.js.map +1 -0
  52. package/dist/host/layout/templates/navigation.d.ts +16 -0
  53. package/dist/host/layout/templates/navigation.d.ts.map +1 -0
  54. package/dist/host/layout/templates/navigation.js +332 -0
  55. package/dist/host/layout/templates/navigation.js.map +1 -0
  56. package/dist/host/layout/templates/nestedLayout.d.ts +7 -0
  57. package/dist/host/layout/templates/nestedLayout.d.ts.map +1 -0
  58. package/dist/host/layout/templates/nestedLayout.js +56 -0
  59. package/dist/host/layout/templates/nestedLayout.js.map +1 -0
  60. package/dist/host/layout/templates/redirect.d.ts +2 -0
  61. package/dist/host/layout/templates/redirect.d.ts.map +1 -0
  62. package/dist/host/layout/templates/redirect.js +10 -0
  63. package/dist/host/layout/templates/redirect.js.map +1 -0
  64. package/dist/host/layout/templates/rootLayout.d.ts +28 -0
  65. package/dist/host/layout/templates/rootLayout.d.ts.map +1 -0
  66. package/dist/host/layout/templates/rootLayout.js +507 -0
  67. package/dist/host/layout/templates/rootLayout.js.map +1 -0
  68. package/dist/host/layout/templates/screen.d.ts +6 -0
  69. package/dist/host/layout/templates/screen.d.ts.map +1 -0
  70. package/dist/host/layout/templates/screen.js +94 -0
  71. package/dist/host/layout/templates/screen.js.map +1 -0
  72. package/dist/host/layout/templates/utils/routes.d.ts +3 -0
  73. package/dist/host/layout/templates/utils/routes.d.ts.map +1 -0
  74. package/dist/host/layout/templates/utils/routes.js +15 -0
  75. package/dist/host/layout/templates/utils/routes.js.map +1 -0
  76. package/dist/host/layout/templates/utils/strings.d.ts +3 -0
  77. package/dist/host/layout/templates/utils/strings.d.ts.map +1 -0
  78. package/dist/host/layout/templates/utils/strings.js +7 -0
  79. package/dist/host/layout/templates/utils/strings.js.map +1 -0
  80. package/dist/host/layout/utils/escapeStringLiteral.d.ts +2 -0
  81. package/dist/host/layout/utils/escapeStringLiteral.d.ts.map +1 -0
  82. package/dist/host/layout/utils/escapeStringLiteral.js +8 -0
  83. package/dist/host/layout/utils/escapeStringLiteral.js.map +1 -0
  84. package/dist/host/manifestSystem/auth/index.d.ts +2 -0
  85. package/dist/host/manifestSystem/auth/index.d.ts.map +1 -0
  86. package/dist/host/manifestSystem/auth/index.js +2 -0
  87. package/dist/host/manifestSystem/auth/index.js.map +1 -0
  88. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts +4 -0
  89. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts.map +1 -0
  90. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +7 -0
  91. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -0
  92. package/dist/host/manifestSystem/auth/shared/index.d.ts +3 -0
  93. package/dist/host/manifestSystem/auth/shared/index.d.ts.map +1 -0
  94. package/dist/host/manifestSystem/auth/shared/index.js +8 -0
  95. package/dist/host/manifestSystem/auth/shared/index.js.map +1 -0
  96. package/dist/host/manifestSystem/index.d.ts +5 -0
  97. package/dist/host/manifestSystem/index.d.ts.map +1 -0
  98. package/dist/host/manifestSystem/index.js +23 -0
  99. package/dist/host/manifestSystem/index.js.map +1 -0
  100. package/dist/host/manifestSystem/types.d.ts +8 -0
  101. package/dist/host/manifestSystem/types.d.ts.map +1 -0
  102. package/dist/host/manifestSystem/types.js +2 -0
  103. package/dist/host/manifestSystem/types.js.map +1 -0
  104. package/dist/host/modules/catalog.d.ts +40 -0
  105. package/dist/host/modules/catalog.d.ts.map +1 -0
  106. package/dist/host/modules/catalog.js +112 -0
  107. package/dist/host/modules/catalog.js.map +1 -0
  108. package/dist/host/modules/layout.d.ts +7 -0
  109. package/dist/host/modules/layout.d.ts.map +1 -0
  110. package/dist/host/modules/layout.js +2 -0
  111. package/dist/host/modules/layout.js.map +1 -0
  112. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts +34 -0
  113. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts.map +1 -0
  114. package/dist/host/modules/runtime/LocalFsTargetAdapter.js +85 -0
  115. package/dist/host/modules/runtime/LocalFsTargetAdapter.js.map +1 -0
  116. package/dist/host/orchestrator/generatedAppFiles.d.ts +8 -0
  117. package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -0
  118. package/dist/host/orchestrator/generatedAppFiles.js +125 -0
  119. package/dist/host/orchestrator/generatedAppFiles.js.map +1 -0
  120. package/dist/host/orchestrator/generatedRouteCleanup.d.ts +5 -0
  121. package/dist/host/orchestrator/generatedRouteCleanup.d.ts.map +1 -0
  122. package/dist/host/orchestrator/generatedRouteCleanup.js +117 -0
  123. package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -0
  124. package/dist/host/orchestrator/infraGenerator.d.ts +35 -0
  125. package/dist/host/orchestrator/infraGenerator.d.ts.map +1 -0
  126. package/dist/host/orchestrator/infraGenerator.js +135 -0
  127. package/dist/host/orchestrator/infraGenerator.js.map +1 -0
  128. package/dist/host/orchestrator/infraRuntime.d.ts +38 -0
  129. package/dist/host/orchestrator/infraRuntime.d.ts.map +1 -0
  130. package/dist/host/orchestrator/infraRuntime.js +227 -0
  131. package/dist/host/orchestrator/infraRuntime.js.map +1 -0
  132. package/dist/host/orchestrator/infraValidation.d.ts +3 -0
  133. package/dist/host/orchestrator/infraValidation.d.ts.map +1 -0
  134. package/dist/host/orchestrator/infraValidation.js +59 -0
  135. package/dist/host/orchestrator/infraValidation.js.map +1 -0
  136. package/dist/host/orchestrator/moduleManager.d.ts +86 -0
  137. package/dist/host/orchestrator/moduleManager.d.ts.map +1 -0
  138. package/dist/host/orchestrator/moduleManager.js +312 -0
  139. package/dist/host/orchestrator/moduleManager.js.map +1 -0
  140. package/dist/host/orchestrator/projectDeletion.d.ts +27 -0
  141. package/dist/host/orchestrator/projectDeletion.d.ts.map +1 -0
  142. package/dist/host/orchestrator/projectDeletion.js +242 -0
  143. package/dist/host/orchestrator/projectDeletion.js.map +1 -0
  144. package/dist/host/orchestrator/projectManager.d.ts +87 -0
  145. package/dist/host/orchestrator/projectManager.d.ts.map +1 -0
  146. package/dist/host/orchestrator/projectManager.js +371 -0
  147. package/dist/host/orchestrator/projectManager.js.map +1 -0
  148. package/dist/host/orchestrator/projectPaths.d.ts +4 -0
  149. package/dist/host/orchestrator/projectPaths.d.ts.map +1 -0
  150. package/dist/host/orchestrator/projectPaths.js +25 -0
  151. package/dist/host/orchestrator/projectPaths.js.map +1 -0
  152. package/dist/host/orchestrator/projectStore.d.ts +24 -0
  153. package/dist/host/orchestrator/projectStore.d.ts.map +1 -0
  154. package/dist/host/orchestrator/projectStore.js +155 -0
  155. package/dist/host/orchestrator/projectStore.js.map +1 -0
  156. package/dist/host/orchestrator/resolveMutations.d.ts +3 -0
  157. package/dist/host/orchestrator/resolveMutations.d.ts.map +1 -0
  158. package/dist/host/orchestrator/resolveMutations.js +12 -0
  159. package/dist/host/orchestrator/resolveMutations.js.map +1 -0
  160. package/dist/host/orchestrator/scaffolder.d.ts +33 -0
  161. package/dist/host/orchestrator/scaffolder.d.ts.map +1 -0
  162. package/dist/host/orchestrator/scaffolder.js +246 -0
  163. package/dist/host/orchestrator/scaffolder.js.map +1 -0
  164. package/dist/host/orchestrator/templates.d.ts +83 -0
  165. package/dist/host/orchestrator/templates.d.ts.map +1 -0
  166. package/dist/host/orchestrator/templates.js +355 -0
  167. package/dist/host/orchestrator/templates.js.map +1 -0
  168. package/dist/host/orchestrator/workspaceRuntime.d.ts +2 -0
  169. package/dist/host/orchestrator/workspaceRuntime.d.ts.map +1 -0
  170. package/dist/host/orchestrator/workspaceRuntime.js +82 -0
  171. package/dist/host/orchestrator/workspaceRuntime.js.map +1 -0
  172. package/dist/host/templateRegistry/index.d.ts +16 -0
  173. package/dist/host/templateRegistry/index.d.ts.map +1 -0
  174. package/dist/host/templateRegistry/index.js +74 -0
  175. package/dist/host/templateRegistry/index.js.map +1 -0
  176. package/dist/host/utils/requirementsInference.d.ts +4 -0
  177. package/dist/host/utils/requirementsInference.d.ts.map +1 -0
  178. package/dist/host/utils/requirementsInference.js +49 -0
  179. package/dist/host/utils/requirementsInference.js.map +1 -0
  180. package/dist/host/utils/trimOutput.d.ts +7 -0
  181. package/dist/host/utils/trimOutput.d.ts.map +1 -0
  182. package/dist/host/utils/trimOutput.js +32 -0
  183. package/dist/host/utils/trimOutput.js.map +1 -0
  184. package/dist/host/utils/workspaceRoot.d.ts +2 -0
  185. package/dist/host/utils/workspaceRoot.d.ts.map +1 -0
  186. package/dist/host/utils/workspaceRoot.js +33 -0
  187. package/dist/host/utils/workspaceRoot.js.map +1 -0
  188. package/dist/host/zoraExtensions/index.d.ts +11 -0
  189. package/dist/host/zoraExtensions/index.d.ts.map +1 -0
  190. package/dist/host/zoraExtensions/index.js +54 -0
  191. package/dist/host/zoraExtensions/index.js.map +1 -0
  192. package/dist/root.d.ts +3 -0
  193. package/dist/root.d.ts.map +1 -0
  194. package/dist/root.js +3 -0
  195. package/dist/root.js.map +1 -0
  196. package/package.json +16 -3
@@ -0,0 +1,33 @@
1
+ import type { AppManifest, SplashScreenSpec } from '@ankhorage/contracts';
2
+ import type { ExpoRuntimePlan } from '@ankhorage/expo-runtime';
3
+ import { type ProjectTemplateSelection } from '../templateRegistry';
4
+ import { type ZoraExtensionDefinition } from '../zoraExtensions';
5
+ import { type GeneratedAuthProvider, type GeneratedStorageProvider } from './templates';
6
+ interface ScaffoldProjectOptions {
7
+ includeStudio?: boolean;
8
+ authProvider?: GeneratedAuthProvider;
9
+ storageProvider?: GeneratedStorageProvider;
10
+ splashScreen?: SplashScreenSpec | null;
11
+ zoraExtensions?: readonly ZoraExtensionDefinition[];
12
+ runtimePlan?: ExpoRuntimePlan;
13
+ }
14
+ export declare class ProjectScaffolder {
15
+ private readonly rootPath;
16
+ constructor(rootPath: string);
17
+ scaffoldProject(projectPath: string, appName: string, slug: string, options?: ScaffoldProjectOptions): Promise<void>;
18
+ syncProjectScaffold(projectPath: string, appName: string, slug: string, options?: ScaffoldProjectOptions): Promise<void>;
19
+ getTemplate(selection: ProjectTemplateSelection): AppManifest;
20
+ finalizeManifest(projectPath: string, templateData: AppManifest, appName: string, slug: string): Promise<AppManifest>;
21
+ private writeAppConfig;
22
+ private writeMetroConfig;
23
+ private writeBabelConfig;
24
+ private writeIndex;
25
+ private writePackageJson;
26
+ private readPackageJson;
27
+ private writeTsConfig;
28
+ private writeEslintConfig;
29
+ private writePrettierConfig;
30
+ private copyDefaultAssets;
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=scaffolder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffolder.d.ts","sourceRoot":"","sources":["../../../src/host/orchestrator/scaffolder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK/D,OAAO,EAAsB,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAS9B,MAAM,aAAa,CAAC;AAErB,UAAU,sBAAsB;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACpD,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAYD,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAEvC,eAAe,CACnB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B;IAsChC,mBAAmB,CACvB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B;IAqDtC,WAAW,CAAC,SAAS,EAAE,wBAAwB,GAAG,WAAW;IAIvD,gBAAgB,CACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM;YAsBA,cAAc;YAed,gBAAgB;YAIhB,gBAAgB;YAIhB,UAAU;YAIV,gBAAgB;YA0BhB,eAAe;YAaf,aAAa;YAIb,iBAAiB;YAIjB,mBAAmB;YAInB,iBAAiB;CA4ChC"}
@@ -0,0 +1,246 @@
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+ import { applySystemTemplates } from '../manifestSystem';
4
+ import { getProjectTemplate } from '../templateRegistry';
5
+ import { collectZoraExtensionDependencies, mergeZoraExtensions, resolveZoraExtensionsFromDependencies, } from '../zoraExtensions';
6
+ import { syncGeneratedAppFiles } from './generatedAppFiles';
7
+ import { getAppConfigTs, getBabelConfigJs, getEslintConfigMjs, getIndexJs, getMetroConfigJs, getPackageJson, getPrettierRcJs, getTsConfigJson, } from './templates';
8
+ const MANAGED_SCRIPT_NAMES = ['lint', 'lint:fix', 'format', 'format:check'];
9
+ const LEGACY_MANAGED_DEV_DEPENDENCIES = ['eslint', 'prettier'];
10
+ export class ProjectScaffolder {
11
+ rootPath;
12
+ constructor(rootPath) {
13
+ this.rootPath = rootPath;
14
+ }
15
+ async scaffoldProject(projectPath, appName, slug, options = {}) {
16
+ const { includeStudio = true, authProvider = null, storageProvider = null, splashScreen = null, zoraExtensions = [], runtimePlan, } = options;
17
+ await fs.mkdir(projectPath, { recursive: true });
18
+ await fs.mkdir(path.join(projectPath, 'assets'), { recursive: true });
19
+ await fs.mkdir(path.join(projectPath, 'src/app'), { recursive: true });
20
+ await this.writePackageJson(projectPath, slug, includeStudio, authProvider, storageProvider, zoraExtensions, runtimePlan);
21
+ await this.writeAppConfig(projectPath, appName, slug, splashScreen, runtimePlan);
22
+ await this.writeTsConfig(projectPath);
23
+ await this.writeEslintConfig(projectPath);
24
+ await this.writePrettierConfig(projectPath);
25
+ await this.writeMetroConfig(projectPath);
26
+ await this.writeBabelConfig(projectPath);
27
+ await this.writeIndex(projectPath);
28
+ await syncGeneratedAppFiles(projectPath, {
29
+ runtimePlan,
30
+ zoraExtensions,
31
+ });
32
+ await this.copyDefaultAssets(projectPath);
33
+ }
34
+ async syncProjectScaffold(projectPath, appName, slug, options = {}) {
35
+ const { includeStudio = true, authProvider = null, storageProvider = null, splashScreen = null, runtimePlan, } = options;
36
+ await fs.mkdir(projectPath, { recursive: true });
37
+ await fs.mkdir(path.join(projectPath, 'assets'), { recursive: true });
38
+ await fs.mkdir(path.join(projectPath, 'src/app'), { recursive: true });
39
+ const packageJsonPath = path.join(projectPath, 'package.json');
40
+ const existingPackageJson = await this.readPackageJson(packageJsonPath);
41
+ const existingZoraExtensions = resolveZoraExtensionsFromDependencies(existingPackageJson?.dependencies ?? {});
42
+ const zoraExtensions = mergeZoraExtensions(options.zoraExtensions ?? [], existingZoraExtensions);
43
+ const templatePackageJson = withZoraExtensionDependencies(getPackageJson({
44
+ name: existingPackageJson?.name ?? slug,
45
+ includeStudio,
46
+ authProvider,
47
+ storageProvider,
48
+ runtimePlan,
49
+ }), zoraExtensions);
50
+ const nextPackageJson = mergePackageJson(existingPackageJson, templatePackageJson, includeStudio);
51
+ await fs.writeFile(packageJsonPath, JSON.stringify(nextPackageJson, null, 2), 'utf8');
52
+ await this.writeAppConfig(projectPath, appName, slug, splashScreen, runtimePlan);
53
+ await this.writeTsConfig(projectPath);
54
+ await this.writeEslintConfig(projectPath);
55
+ await this.writePrettierConfig(projectPath);
56
+ await this.writeMetroConfig(projectPath);
57
+ await this.writeBabelConfig(projectPath);
58
+ await this.writeIndex(projectPath);
59
+ await syncGeneratedAppFiles(projectPath, {
60
+ runtimePlan,
61
+ zoraExtensions,
62
+ });
63
+ }
64
+ getTemplate(selection) {
65
+ return getProjectTemplate(selection);
66
+ }
67
+ async finalizeManifest(projectPath, templateData, appName, slug) {
68
+ const manifest = applySystemTemplates({
69
+ ...templateData,
70
+ metadata: {
71
+ ...templateData.metadata,
72
+ name: appName,
73
+ slug,
74
+ created: new Date().toISOString(),
75
+ updated: new Date().toISOString(),
76
+ },
77
+ });
78
+ await fs.writeFile(path.join(projectPath, 'ankh.config.json'), JSON.stringify(manifest, null, 2), 'utf8');
79
+ return manifest;
80
+ }
81
+ async writeAppConfig(dir, name, slug, splashScreen, runtimePlan) {
82
+ const bundleSuffix = slug.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
83
+ await fs.writeFile(path.join(dir, 'app.config.ts'), getAppConfigTs({ name, slug, bundleSuffix, splashScreen, runtimePlan }), 'utf8');
84
+ }
85
+ async writeMetroConfig(dir) {
86
+ await fs.writeFile(path.join(dir, 'metro.config.js'), getMetroConfigJs(), 'utf8');
87
+ }
88
+ async writeBabelConfig(dir) {
89
+ await fs.writeFile(path.join(dir, 'babel.config.js'), getBabelConfigJs(), 'utf8');
90
+ }
91
+ async writeIndex(dir) {
92
+ await fs.writeFile(path.join(dir, 'index.js'), getIndexJs(), 'utf8');
93
+ }
94
+ async writePackageJson(dir, slug, includeStudio, authProvider, storageProvider, zoraExtensions, runtimePlan) {
95
+ const packageJson = withZoraExtensionDependencies(getPackageJson({
96
+ name: slug,
97
+ includeStudio,
98
+ authProvider,
99
+ storageProvider,
100
+ runtimePlan,
101
+ }), zoraExtensions);
102
+ await fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(packageJson, null, 2), 'utf8');
103
+ }
104
+ async readPackageJson(packageJsonPath) {
105
+ if (!(await exists(packageJsonPath))) {
106
+ return null;
107
+ }
108
+ const content = await fs.readFile(packageJsonPath, 'utf8');
109
+ const parsed = JSON.parse(content);
110
+ return {
111
+ ...parsed,
112
+ dependencies: parsed.dependencies,
113
+ };
114
+ }
115
+ async writeTsConfig(dir) {
116
+ await fs.writeFile(path.join(dir, 'tsconfig.json'), getTsConfigJson(), 'utf8');
117
+ }
118
+ async writeEslintConfig(dir) {
119
+ await fs.writeFile(path.join(dir, 'eslint.config.mjs'), getEslintConfigMjs(), 'utf8');
120
+ }
121
+ async writePrettierConfig(dir) {
122
+ await fs.writeFile(path.join(dir, '.prettierrc.js'), getPrettierRcJs(), 'utf8');
123
+ }
124
+ async copyDefaultAssets(targetProjectPath) {
125
+ const templateAssetsPath = path.join(this.rootPath, 'packages/cli/templates/assets');
126
+ const targetAssetsPath = path.join(targetProjectPath, 'assets');
127
+ const splashAssetsPath = path.join(targetAssetsPath, 'splash');
128
+ const assets = ['icon.png', 'splash.png', 'adaptive-icon.png', 'favicon.png'];
129
+ const splashAssets = ['icon.png', 'icon-dark.png'];
130
+ await fs.mkdir(targetAssetsPath, { recursive: true });
131
+ await fs.mkdir(splashAssetsPath, { recursive: true });
132
+ const templateExists = await exists(templateAssetsPath);
133
+ if (!templateExists) {
134
+ const png1x1 = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=', 'base64');
135
+ for (const f of assets) {
136
+ await fs.writeFile(path.join(targetAssetsPath, f), png1x1);
137
+ }
138
+ for (const f of splashAssets) {
139
+ await fs.writeFile(path.join(splashAssetsPath, f), png1x1);
140
+ }
141
+ return;
142
+ }
143
+ for (const asset of assets) {
144
+ const src = path.join(templateAssetsPath, asset);
145
+ const dest = path.join(targetProjectPath, 'assets', asset);
146
+ if (await exists(src)) {
147
+ await fs.copyFile(src, dest);
148
+ }
149
+ }
150
+ for (const asset of splashAssets) {
151
+ const src = path.join(templateAssetsPath, asset);
152
+ const fallbackSrc = path.join(templateAssetsPath, 'splash.png');
153
+ const dest = path.join(splashAssetsPath, asset);
154
+ if (await exists(src)) {
155
+ await fs.copyFile(src, dest);
156
+ }
157
+ else if (await exists(fallbackSrc)) {
158
+ await fs.copyFile(fallbackSrc, dest);
159
+ }
160
+ }
161
+ }
162
+ }
163
+ async function exists(filePath) {
164
+ try {
165
+ await fs.access(filePath);
166
+ return true;
167
+ }
168
+ catch {
169
+ return false;
170
+ }
171
+ }
172
+ function withZoraExtensionDependencies(packageJson, zoraExtensions) {
173
+ return {
174
+ ...packageJson,
175
+ dependencies: {
176
+ ...packageJson.dependencies,
177
+ ...collectZoraExtensionDependencies(zoraExtensions),
178
+ },
179
+ };
180
+ }
181
+ function mergePackageJson(existing, template, includeStudio) {
182
+ const baseTemplate = getPackageJson({ name: template.name, includeStudio: false });
183
+ const studioTemplate = getPackageJson({ name: template.name, includeStudio: true });
184
+ const supabaseBaseTemplate = getPackageJson({
185
+ name: template.name,
186
+ includeStudio: false,
187
+ authProvider: 'supabase',
188
+ storageProvider: 'supabase',
189
+ });
190
+ const supabaseStudioTemplate = getPackageJson({
191
+ name: template.name,
192
+ includeStudio: true,
193
+ authProvider: 'supabase',
194
+ storageProvider: 'supabase',
195
+ });
196
+ const managedDependencies = new Set([
197
+ ...Object.keys(baseTemplate.dependencies),
198
+ ...Object.keys(studioTemplate.dependencies),
199
+ ...Object.keys(supabaseBaseTemplate.dependencies),
200
+ ...Object.keys(supabaseStudioTemplate.dependencies),
201
+ ...Object.keys(template.dependencies),
202
+ ]);
203
+ const managedDevDependencies = new Set([
204
+ ...Object.keys(baseTemplate.devDependencies),
205
+ ...Object.keys(studioTemplate.devDependencies),
206
+ '@expo/metro-config',
207
+ ...LEGACY_MANAGED_DEV_DEPENDENCIES,
208
+ ]);
209
+ const mergedDependencies = {
210
+ ...(existing?.dependencies ?? {}),
211
+ };
212
+ for (const dependencyName of managedDependencies) {
213
+ delete mergedDependencies[dependencyName];
214
+ }
215
+ Object.assign(mergedDependencies, template.dependencies);
216
+ if (!includeStudio) {
217
+ delete mergedDependencies['@expo/vector-icons'];
218
+ delete mergedDependencies['@react-native-picker/picker'];
219
+ }
220
+ const mergedDevDependencies = {
221
+ ...(existing?.devDependencies ?? {}),
222
+ };
223
+ for (const dependencyName of managedDevDependencies) {
224
+ delete mergedDevDependencies[dependencyName];
225
+ }
226
+ Object.assign(mergedDevDependencies, template.devDependencies);
227
+ return {
228
+ ...(existing ?? {}),
229
+ ...template,
230
+ name: existing?.name ?? template.name,
231
+ scripts: mergeScripts(existing?.scripts ?? {}, template.scripts),
232
+ dependencies: mergedDependencies,
233
+ devDependencies: mergedDevDependencies,
234
+ };
235
+ }
236
+ function mergeScripts(existingScripts, templateScripts) {
237
+ const mergedScripts = {
238
+ ...templateScripts,
239
+ ...existingScripts,
240
+ };
241
+ for (const scriptName of MANAGED_SCRIPT_NAMES) {
242
+ mergedScripts[scriptName] = templateScripts[scriptName];
243
+ }
244
+ return mergedScripts;
245
+ }
246
+ //# sourceMappingURL=scaffolder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffolder.js","sourceRoot":"","sources":["../../../src/host/orchestrator/scaffolder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB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,qBAAqB,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE/D,OAAO;QACL,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;QACnB,GAAG,QAAQ;QACX,IAAI,EAAE,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI;QACrC,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC;QAChE,YAAY,EAAE,kBAAkB;QAChC,eAAe,EAAE,qBAAqB;KACvC,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,eAAsC,EACtC,eAA+B;IAE/B,MAAM,aAAa,GAAmB;QACpC,GAAG,eAAe;QAClB,GAAG,eAAe;KACnB,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,oBAAoB,EAAE,CAAC;QAC9C,aAAa,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import type { SplashScreenSpec } from '@ankhorage/contracts';
2
+ import { type ExpoRuntimePlan } from '@ankhorage/expo-runtime/planning';
3
+ export type GeneratedAuthProvider = 'supabase' | null;
4
+ export type GeneratedStorageProvider = 'supabase' | null;
5
+ export declare function getAppConfigTs({ name, slug, bundleSuffix, splashScreen, runtimePlan, }: {
6
+ name: string;
7
+ slug: string;
8
+ bundleSuffix: string;
9
+ splashScreen?: SplashScreenSpec | null;
10
+ runtimePlan?: ExpoRuntimePlan;
11
+ }): string;
12
+ export declare function getMetroConfigJs(): string;
13
+ export declare function getBabelConfigJs(): string;
14
+ export declare function getPackageJson(args: {
15
+ name: string;
16
+ includeStudio?: boolean;
17
+ authProvider?: GeneratedAuthProvider;
18
+ storageProvider?: GeneratedStorageProvider;
19
+ runtimePlan?: ExpoRuntimePlan;
20
+ }): {
21
+ name: string;
22
+ main: string;
23
+ packageManager: string;
24
+ version: string;
25
+ scripts: {
26
+ start: string;
27
+ android: string;
28
+ ios: string;
29
+ web: string;
30
+ lint: string;
31
+ 'lint:fix': string;
32
+ format: string;
33
+ 'format:check': string;
34
+ };
35
+ dependencies: {
36
+ '@react-navigation/bottom-tabs': string;
37
+ '@react-navigation/drawer': string;
38
+ 'babel-preset-expo': string;
39
+ expo: string;
40
+ 'expo-constants': string;
41
+ 'expo-font': string;
42
+ 'expo-linear-gradient': string;
43
+ 'expo-linking': string;
44
+ 'expo-modules-core': string;
45
+ 'expo-router': string;
46
+ 'expo-splash-screen': string;
47
+ 'expo-status-bar': string;
48
+ 'expo-updates': string;
49
+ react: string;
50
+ 'react-dom': string;
51
+ 'react-native': string;
52
+ 'react-native-gesture-handler': string;
53
+ 'react-native-reanimated': string;
54
+ 'react-native-safe-area-context': string;
55
+ 'react-native-screens': string;
56
+ 'react-native-svg': string;
57
+ 'react-native-web': string;
58
+ 'react-native-worklets': string;
59
+ 'reanimated-color-picker': string;
60
+ '@expo/vector-icons'?: string | undefined;
61
+ '@react-native-picker/picker'?: string | undefined;
62
+ '@ankhorage/zora': string;
63
+ '@ankhorage/supabase-storage'?: string | undefined;
64
+ '@ankhorage/supabase-auth'?: string | undefined;
65
+ '@ankhorage/contracts': string;
66
+ '@ankhorage/data-sources': string;
67
+ '@ankhorage/runtime': string;
68
+ '@ankhorage/studio': string;
69
+ };
70
+ devDependencies: {
71
+ '@ankhorage/devtools': string;
72
+ '@types/node': string;
73
+ '@types/react': string;
74
+ '@types/culori': string;
75
+ 'babel-plugin-module-resolver': string;
76
+ typescript: string;
77
+ };
78
+ };
79
+ export declare function getEslintConfigMjs(): string;
80
+ export declare function getPrettierRcJs(): string;
81
+ export declare function getIndexJs(): string;
82
+ export declare function getTsConfigJson(): string;
83
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/host/orchestrator/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,IAAI,CAAC;AAgNzD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,YAAmB,EACnB,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,UAsBA;AAED,wBAAgB,gBAAgB,WAM/B;AAED,wBAAgB,gBAAgB,WAsB/B;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EA;AAED,wBAAgB,kBAAkB,WAsBjC;AAED,wBAAgB,eAAe,WAG9B;AAED,wBAAgB,UAAU,WAazB;AAED,wBAAgB,eAAe,WAqB9B"}