@akanjs/cli 3.0.0-alpha.7 → 3.0.0-alpha.70

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 (119) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
  5. package/{agent.command-pggr92jj.js → agent.command-964bf8qg.js} +9 -7
  6. package/{application.command-692yap1d.js → application.command-n45n18sc.js} +8 -6
  7. package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-af0wtspv.js} +19 -14
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
  9. package/buildBatch.proc.js +7 -5
  10. package/{capacitorApp-p0z5yab2.js → capacitorApp-vnvnvdhf.js} +29 -27
  11. package/{cloud.command-wqfsyzv2.js → cloud.command-kx1bh5yq.js} +12 -10
  12. package/{context.command-9bxtdn0w.js → context.command-g1a65x6j.js} +17 -15
  13. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  14. package/getDirname-ka11hm7e.js +8 -0
  15. package/{guideline.command-nfqahxex.js → guideline.command-xphyhvwh.js} +8 -6
  16. package/guidelines/agentRule/agentRule.generate.json +31 -0
  17. package/guidelines/agentRule/agentRule.instruction.md +525 -0
  18. package/guidelines/conventions/conventions.generate.json +25 -0
  19. package/guidelines/conventions/conventions.instruction.md +1020 -0
  20. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  21. package/guidelines/framework/framework.instruction.md +1 -0
  22. package/guidelines/mcpRule/mcpRule.generate.json +25 -0
  23. package/guidelines/mcpRule/mcpRule.instruction.md +220 -0
  24. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  25. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +638 -0
  26. package/incrementalBuilder.proc.js +8 -6
  27. package/{index-azv0xjb5.js → index-0ngvvgry.js} +8 -4
  28. package/index-1577bej2.js +7 -0
  29. package/{index-p3f4q532.js → index-4rw4qhe6.js} +14 -13
  30. package/{index-bjpxzr6s.js → index-5vy2jzar.js} +1 -1
  31. package/{index-js368gk9.js → index-8gybxemv.js} +6 -6
  32. package/{index-qb61h0k7.js → index-abyjt72y.js} +333 -540
  33. package/{index-4hek879p.js → index-bqqts262.js} +1 -1
  34. package/{index-6rhabeev.js → index-e31ghfp5.js} +5 -3
  35. package/index-f39512t6.js +255 -0
  36. package/{index-5pmx7bkg.js → index-fahkq20v.js} +3 -3
  37. package/{index-xhgtkekh.js → index-hee7egtm.js} +1 -1
  38. package/{index-7myvn0f0.js → index-j37qq1f2.js} +1 -1
  39. package/{index-5dw57f0d.js → index-mkn5qagt.js} +14 -14
  40. package/{index-ztpw544k.js → index-nj3w0r34.js} +3 -3
  41. package/{index-vg0sj9nc.js → index-nkwmnqwn.js} +257 -97
  42. package/{index-a1e0j63x.js → index-p681w089.js} +15 -7
  43. package/{index-j9cxndc0.js → index-qnv0aqmm.js} +9 -6
  44. package/{index-w6wbb612.js → index-qt4nfr0n.js} +13 -13
  45. package/{index-bz2sfzzt.js → index-rb65xnw9.js} +4 -4
  46. package/{index-gex7c8kd.js → index-rbnpe8cp.js} +37 -6
  47. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  48. package/{index-gmy45vz2.js → index-v5fdxdre.js} +4 -4
  49. package/{index-mssqn2sq.js → index-va15r8h5.js} +54 -15
  50. package/{index-vtj3zps1.js → index-yg3hxk2k.js} +8 -8
  51. package/{index-2c3e2xh8.js → index-ytaqtc04.js} +1 -1
  52. package/index.js +21 -19
  53. package/{library.command-md9715jz.js → library.command-rfpd27yv.js} +6 -4
  54. package/{localRegistry.command-exkbamyj.js → localRegistry.command-pyxfe0fs.js} +11 -9
  55. package/{module.command-w5aaddxk.js → module.command-qhaxad0p.js} +10 -8
  56. package/{package.command-yfkrcy0z.js → package.command-2k22q9nt.js} +6 -4
  57. package/package.json +4 -5
  58. package/{page.command-echbavp4.js → page.command-ymk9dqh4.js} +6 -4
  59. package/{primitive.command-9fbhspw2.js → primitive.command-9k45zpc1.js} +11 -9
  60. package/{quality.command-3pnt9yep.js → quality.command-bf6vkxe5.js} +192 -97
  61. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  62. package/{repair.command-carj4vax.js → repair.command-egvvm6xf.js} +8 -6
  63. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
  64. package/{scalar.command-51ryzypc.js → scalar.command-bt1facyj.js} +9 -7
  65. package/templates/app/env/env.client.debug.ts.template +1 -5
  66. package/templates/app/env/env.client.develop.ts.template +1 -5
  67. package/templates/app/env/env.client.local.ts.template +1 -5
  68. package/templates/app/env/env.client.main.ts.template +1 -5
  69. package/templates/app/env/env.client.testing.ts.template +1 -5
  70. package/templates/app/env/env.client.type.ts +2 -6
  71. package/templates/app/env/env.server.debug.ts.template +1 -5
  72. package/templates/app/env/env.server.develop.ts.template +1 -5
  73. package/templates/app/env/env.server.local.ts.template +1 -5
  74. package/templates/app/env/env.server.main.ts.template +1 -5
  75. package/templates/app/main.ts +3 -1
  76. package/templates/app/page/styles.css.template +3 -3
  77. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  78. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  79. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  80. package/templates/crudPages/new/page.tsx +1 -1
  81. package/templates/crudSinglePage/page.tsx +1 -1
  82. package/templates/env/_env.server.type.ts +7 -5
  83. package/templates/lib/db.ts +1 -1
  84. package/templates/lib/dict.ts +1 -1
  85. package/templates/lib/sig.ts +1 -1
  86. package/templates/lib/srv.ts +6 -2
  87. package/templates/module/__Model__.Util.tsx +1 -1
  88. package/templates/module/__Model__.Zone.tsx +3 -5
  89. package/templates/workspaceRoot/AGENTS.md.template +0 -972
  90. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  91. package/templates/workspaceRoot/biome.json.template +4 -244
  92. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
  93. package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
  94. package/templates/workspaceRoot/package.json.template +1 -1
  95. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  96. package/typecheck.proc.js +1 -1
  97. package/{workflow.command-91wmvm8k.js → workflow.command-v1n3wg7v.js} +16 -14
  98. package/{workspace.command-wa10mfd9.js → workspace.command-yvvqvhzz.js} +71 -52
  99. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  100. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -34
  101. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  102. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  103. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  104. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  105. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  106. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  107. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  108. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -19
  109. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -62
  110. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  111. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  112. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  113. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -99
  114. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  115. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  116. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  117. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  118. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  119. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-6rhabeev.js";
5
+ } from "./index-e31ghfp5.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -5,15 +5,17 @@ import {
5
5
  LibExecutor,
6
6
  ModuleExecutor,
7
7
  PkgExecutor,
8
- WorkspaceExecutor,
8
+ WorkspaceExecutor
9
+ } from "./index-nkwmnqwn.js";
10
+ import {
9
11
  getDirname
10
- } from "./index-vg0sj9nc.js";
12
+ } from "./index-1577bej2.js";
11
13
  import {
12
14
  FileSys
13
15
  } from "./index-67546d0j.js";
14
16
  import {
15
17
  __require
16
- } from "./index-r24hmh0q.js";
18
+ } from "./index-yb2wsc7f.js";
17
19
 
18
20
  // pkgs/@akanjs/devkit/commandDecorators/targetMeta.ts
19
21
  var COMMAND_META = Symbol("akan.command.meta");
@@ -0,0 +1,255 @@
1
+ // @bun
2
+ // pkgs/@akanjs/devkit/artifact/implicitRootLayout.ts
3
+ import { mkdir } from "fs/promises";
4
+ import path from "path";
5
+ var LAYOUT_KEY_RE = /^\.\/(.+\/)?_layout\.(tsx|ts|jsx|js)$/;
6
+ async function appHasStModule(appCwdPath) {
7
+ return Bun.file(path.join(appCwdPath, "lib", "st.ts")).exists();
8
+ }
9
+ var IMPLICIT_LAYOUT_DIR = path.join(".akan", "generated", "root-layouts");
10
+ var IMPLICIT_DICT_DIR = path.join(".akan", "generated", "dict");
11
+ var IMPLICIT_OVERRIDES_DIR = path.join(".akan", "generated", "overrides");
12
+ var OVERRIDES_KEY_RE = /^\.\/(.+\/)?_overrides\.(tsx|ts|jsx|js)$/;
13
+ async function writeGeneratedOverridesLayoutFile(opts) {
14
+ const filename = `${opts.key.replace(/^\.\//, "").replace(/[^a-zA-Z0-9]+/g, "_")}.tsx`;
15
+ const absPath = path.join(path.resolve(opts.appCwdPath), IMPLICIT_OVERRIDES_DIR, filename);
16
+ const userRel = path.relative(path.dirname(absPath), opts.userAbsPath).split(path.sep).join("/");
17
+ const userSpecifier = userRel.startsWith(".") ? userRel : `./${userRel}`;
18
+ const source = `"use client";
19
+ import { UiOverrideProvider } from "akanjs/ui";
20
+ import { createElement, type ReactNode } from "react";
21
+ import value from ${JSON.stringify(userSpecifier)};
22
+
23
+ export default function AkanUiOverridesLayout({ children }: { children?: ReactNode }) {
24
+ return createElement(UiOverrideProvider, { value }, children);
25
+ }
26
+ `;
27
+ await Bun.write(absPath, source);
28
+ return absPath;
29
+ }
30
+ function getRootBoundarySegments(key) {
31
+ const match = LAYOUT_KEY_RE.exec(key);
32
+ if (!match)
33
+ return null;
34
+ const prefix = match[1]?.replace(/\/$/, "");
35
+ if (!prefix)
36
+ return [];
37
+ return prefix.split("/").filter(Boolean);
38
+ }
39
+ function implicitRootLayoutKey(segments) {
40
+ return `./${[...segments, "__root_layout"].join("/")}.tsx`;
41
+ }
42
+ function implicitRootLayoutAbsPath(appCwdPath, segments) {
43
+ const filename = segments.length ? `${segments.join("__")}__root_layout.tsx` : "__root_layout.tsx";
44
+ return path.join(path.resolve(appCwdPath), IMPLICIT_LAYOUT_DIR, filename);
45
+ }
46
+ function implicitDictionaryMacroAbsPath(appCwdPath) {
47
+ return path.join(path.resolve(appCwdPath), IMPLICIT_DICT_DIR, "useDict.ts");
48
+ }
49
+ function isRootBoundarySegments(segments, basePaths) {
50
+ const firstVisibleIndex = segments.findIndex((segment) => !/^\(.+\)$/.test(segment));
51
+ if (firstVisibleIndex === -1)
52
+ return segments.length <= 1;
53
+ if (segments.slice(firstVisibleIndex + 1).some((segment) => /^\(.+\)$/.test(segment)))
54
+ return false;
55
+ const visible = segments.slice(firstVisibleIndex);
56
+ const allowedBasePaths = new Set([...basePaths].map((basePath) => basePath.trim()).filter(Boolean));
57
+ return visible.length === 1 && (firstVisibleIndex > 0 || allowedBasePaths.has(visible[0] ?? ""));
58
+ }
59
+ function findRootBoundaries(pageKeys, appCwdPath, basePaths) {
60
+ const boundaries = new Map;
61
+ for (const key of pageKeys) {
62
+ const segments = getRootBoundarySegments(key);
63
+ if (!segments)
64
+ continue;
65
+ if (!isRootBoundarySegments(segments, basePaths))
66
+ continue;
67
+ const id = segments.join("/");
68
+ boundaries.set(id, {
69
+ sourceKey: key,
70
+ sourceAbsPath: path.resolve(appCwdPath, "page", key.replace(/^\.\//, "")),
71
+ segments
72
+ });
73
+ }
74
+ const hasExplicitRootBoundary = [...boundaries.values()].some((boundary) => boundary.segments.length === 0);
75
+ if (!hasExplicitRootBoundary && boundaries.size === 0) {
76
+ boundaries.set("", { sourceKey: null, sourceAbsPath: null, segments: [] });
77
+ }
78
+ return [...boundaries.values()].sort((a, b) => a.segments.join("/").localeCompare(b.segments.join("/")));
79
+ }
80
+ function hasAncestorRootBoundary(boundary, boundaries) {
81
+ return boundaries.some((candidate) => candidate !== boundary && candidate.segments.length < boundary.segments.length && candidate.segments.every((segment, index) => boundary.segments[index] === segment));
82
+ }
83
+ function findExplicitRootLayoutAbsPath(pageKeys, appCwdPath) {
84
+ const rootLayoutKey = pageKeys.find((key) => {
85
+ const segments = getRootBoundarySegments(key);
86
+ return segments !== null && segments.length === 0;
87
+ });
88
+ return rootLayoutKey ? path.resolve(appCwdPath, "page", rootLayoutKey.replace(/^\.\//, "")) : null;
89
+ }
90
+ function routePrefixForSegments(segments) {
91
+ const visible = segments.filter((segment) => !/^\(.+\)$/.test(segment));
92
+ return visible[0] ?? null;
93
+ }
94
+ async function assertEnvClientConvention(appCwdPath, appName) {
95
+ const envPath = path.join(appCwdPath, "env", "env.client.ts");
96
+ if (!await Bun.file(envPath).exists()) {
97
+ throw new Error(`[route-convention] app "${appName}" must provide env/env.client.ts exporting "env" for generated System.Provider`);
98
+ }
99
+ }
100
+ async function writeGeneratedDictionaryMacroFile(appCwdPath, appName) {
101
+ const absPath = implicitDictionaryMacroAbsPath(appCwdPath);
102
+ await mkdir(path.dirname(absPath), { recursive: true });
103
+ await Bun.write(absPath, `import { getAllDictionary } from "@apps/${appName}/lib/dict" with { type: "macro" };
104
+
105
+ export const allDictionary = getAllDictionary();
106
+ `);
107
+ return absPath;
108
+ }
109
+ async function writeGeneratedRootLayoutFile(opts) {
110
+ await assertEnvClientConvention(opts.appCwdPath, opts.appName);
111
+ const dictMacroAbsPath = opts.includeSystemProvider ? await writeGeneratedDictionaryMacroFile(opts.appCwdPath, opts.appName) : null;
112
+ const absPath = implicitRootLayoutAbsPath(opts.appCwdPath, opts.boundary.segments);
113
+ await mkdir(path.dirname(absPath), { recursive: true });
114
+ const dictMacroRel = dictMacroAbsPath ? path.relative(path.dirname(absPath), dictMacroAbsPath).split(path.sep).join("/") : null;
115
+ const dictMacroSpecifier = dictMacroRel ? dictMacroRel.startsWith(".") ? dictMacroRel : `./${dictMacroRel}` : null;
116
+ const sourceRel = opts.boundary.sourceAbsPath ? path.relative(path.dirname(absPath), opts.boundary.sourceAbsPath).split(path.sep).join("/") : null;
117
+ const sourceSpecifier = sourceRel ? sourceRel.startsWith(".") ? sourceRel : `./${sourceRel}` : null;
118
+ const inheritedSourceAbsPath = opts.rootSourceAbsPath && opts.rootSourceAbsPath !== opts.boundary.sourceAbsPath ? opts.rootSourceAbsPath : null;
119
+ const inheritedSourceRel = inheritedSourceAbsPath ? path.relative(path.dirname(absPath), inheritedSourceAbsPath).split(path.sep).join("/") : null;
120
+ const inheritedSourceSpecifier = inheritedSourceRel ? inheritedSourceRel.startsWith(".") ? inheritedSourceRel : `./${inheritedSourceRel}` : null;
121
+ const clientImport = opts.includeStInit ? `import { st } from "@apps/${opts.appName}/client";
122
+ void st;
123
+ ` : `import "@apps/${opts.appName}/client";
124
+ `;
125
+ const inheritedImport = inheritedSourceSpecifier ? `import * as inheritedLayout from ${JSON.stringify(inheritedSourceSpecifier)};
126
+ ` : `const inheritedLayout = {};
127
+ `;
128
+ const prefix = routePrefixForSegments(opts.boundary.segments);
129
+ const userImport = sourceSpecifier ? `import UserLayout, * as userLayout from ${JSON.stringify(sourceSpecifier)};
130
+ ` : `const UserLayout = ({ children }) => children;
131
+ const userLayout = {};
132
+ `;
133
+ const source = opts.includeSystemProvider ? `import type { LayoutProps, PageProps } from "akanjs/client";
134
+ import { loadFonts } from "akanjs/client";
135
+ import { System } from "akanjs/ui";
136
+ import { env } from "@apps/${opts.appName}/env/env.client";
137
+ import { allDictionary } from ${JSON.stringify(dictMacroSpecifier)};
138
+ ${clientImport}${inheritedImport}${userImport}
139
+ const userFonts = userLayout.fonts ?? inheritedLayout.fonts ?? [];
140
+ const defaultFonts = userFonts.filter((font) => font.default);
141
+ if (defaultFonts.length > 1) throw new Error("[route-convention] only one default font is allowed per root layout");
142
+ const defaultFont = defaultFonts[0];
143
+ const defaultFontClassName = defaultFont ? (defaultFont.className ?? \`font-\${defaultFont.name}\`) : undefined;
144
+
145
+ export async function generateHead(props: PageProps) {
146
+ if (userLayout.generateHead) return userLayout.generateHead(props);
147
+ if (userLayout.head !== undefined) return userLayout.head;
148
+ if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
149
+ return inheritedLayout.head;
150
+ }
151
+
152
+ export async function generateMetadata(props: PageProps) {
153
+ if (userLayout.generateMetadata) return userLayout.generateMetadata(props);
154
+ if (userLayout.metadata !== undefined) return userLayout.metadata;
155
+ if (inheritedLayout.generateMetadata) return inheritedLayout.generateMetadata(props);
156
+ return inheritedLayout.metadata;
157
+ }
158
+
159
+ export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;
160
+ export const Error = userLayout.Error ?? inheritedLayout.Error;
161
+ export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;
162
+
163
+ export default function GeneratedLayout({ children, params, searchParams }: LayoutProps) {
164
+ return (
165
+ <System.Provider
166
+ of={GeneratedLayout as never}
167
+ appName=${JSON.stringify(opts.appName)}
168
+ ${prefix ? `prefix=${JSON.stringify(prefix)}
169
+ ` : ""}params={params}
170
+ manifest={userLayout.manifest ?? inheritedLayout.manifest}
171
+ env={env}
172
+ theme={userLayout.theme ?? inheritedLayout.theme}
173
+ fonts={loadFonts(userFonts)}
174
+ className={defaultFontClassName}
175
+ gaTrackingId={userLayout.gaTrackingId ?? inheritedLayout.gaTrackingId}
176
+ layoutStyle={userLayout.layoutStyle ?? inheritedLayout.layoutStyle}
177
+ reconnect={userLayout.reconnect ?? inheritedLayout.reconnect ?? false}
178
+ wsConnect={userLayout.wsConnect ?? inheritedLayout.wsConnect ?? true}
179
+ allDictionary={process.env.AKAN_PUBLIC_RENDER_ENV === "ssr" ? allDictionary : undefined}
180
+ >
181
+ <UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>
182
+ </System.Provider>
183
+ );
184
+ }
185
+ ` : `import type { LayoutProps, PageProps } from "akanjs/client";
186
+ ${inheritedImport}${userImport}
187
+ export async function generateHead(props: PageProps) {
188
+ if (userLayout.generateHead) return userLayout.generateHead(props);
189
+ if (userLayout.head !== undefined) return userLayout.head;
190
+ if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
191
+ return inheritedLayout.head;
192
+ }
193
+
194
+ export async function generateMetadata(props: PageProps) {
195
+ if (userLayout.generateMetadata) return userLayout.generateMetadata(props);
196
+ if (userLayout.metadata !== undefined) return userLayout.metadata;
197
+ if (inheritedLayout.generateMetadata) return inheritedLayout.generateMetadata(props);
198
+ return inheritedLayout.metadata;
199
+ }
200
+
201
+ export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;
202
+ export const Error = userLayout.Error ?? inheritedLayout.Error;
203
+ export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;
204
+
205
+ export default function GeneratedLayout({ children, params, searchParams }: LayoutProps) {
206
+ return <UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>;
207
+ }
208
+ `;
209
+ await Bun.write(absPath, source);
210
+ return absPath;
211
+ }
212
+ async function resolveSsrPageEntries(opts) {
213
+ const absPageDir = path.resolve(opts.appCwdPath, "page");
214
+ const hasSt = await appHasStModule(opts.appCwdPath);
215
+ const basePaths = opts.basePaths ?? [];
216
+ const rootSourceAbsPath = findExplicitRootLayoutAbsPath(opts.pageKeys, opts.appCwdPath);
217
+ const rootBoundaries = findRootBoundaries(opts.pageKeys, opts.appCwdPath, basePaths);
218
+ const rootLayoutKeys = new Set(opts.pageKeys.filter((key) => {
219
+ const segments = getRootBoundarySegments(key);
220
+ return segments !== null && isRootBoundarySegments(segments, basePaths);
221
+ }));
222
+ const base = await Promise.all(opts.pageKeys.filter((key) => !rootLayoutKeys.has(key)).map(async (key) => {
223
+ const userAbsPath = path.resolve(absPageDir, key);
224
+ if (OVERRIDES_KEY_RE.test(key)) {
225
+ const moduleAbsPath = await writeGeneratedOverridesLayoutFile({
226
+ appCwdPath: opts.appCwdPath,
227
+ key,
228
+ userAbsPath
229
+ });
230
+ return { key, moduleAbsPath, seedAbsPaths: [userAbsPath] };
231
+ }
232
+ return { key, moduleAbsPath: userAbsPath };
233
+ }));
234
+ const generated = await Promise.all(rootBoundaries.map(async (boundary) => ({
235
+ key: implicitRootLayoutKey(boundary.segments),
236
+ moduleAbsPath: await writeGeneratedRootLayoutFile({
237
+ appCwdPath: opts.appCwdPath,
238
+ appName: opts.appName,
239
+ boundary,
240
+ rootSourceAbsPath,
241
+ includeStInit: hasSt && boundary.segments.length === 0,
242
+ includeSystemProvider: !hasAncestorRootBoundary(boundary, rootBoundaries)
243
+ }),
244
+ seedAbsPaths: [...new Set([boundary.sourceAbsPath, rootSourceAbsPath].filter((absPath) => absPath !== null))]
245
+ })));
246
+ const entries = [...base, ...generated];
247
+ entries.sort((a, b) => a.key.localeCompare(b.key));
248
+ return entries;
249
+ }
250
+ async function resolveSsrPageEntriesForApp(app, pageKeys) {
251
+ const config = await app.getConfig();
252
+ return resolveSsrPageEntries({ appCwdPath: app.cwdPath, appName: app.name, pageKeys, basePaths: config.basePaths });
253
+ }
254
+
255
+ export { getRootBoundarySegments, isRootBoundarySegments, resolveSsrPageEntriesForApp };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-mssqn2sq.js";
4
+ } from "./index-va15r8h5.js";
5
5
  import {
6
6
  WorkflowExecutor,
7
7
  compactWorkflowInputs,
@@ -23,10 +23,10 @@ import {
23
23
  workflowCommandsForPlan,
24
24
  workflowPlanApproval,
25
25
  writeWorkflowRunArtifact
26
- } from "./index-2c3e2xh8.js";
26
+ } from "./index-ytaqtc04.js";
27
27
  import {
28
28
  runner
29
- } from "./index-6rhabeev.js";
29
+ } from "./index-e31ghfp5.js";
30
30
 
31
31
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
32
32
  import { mkdir, readFile, writeFile } from "fs/promises";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./index-76rn3g2c.js";
6
6
  import {
7
7
  CommandExecutionError
8
- } from "./index-vg0sj9nc.js";
8
+ } from "./index-nkwmnqwn.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/capacitorApp.ts
11
11
  import { cp, mkdir, readFile, rm, writeFile } from "fs/promises";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getDirname
4
- } from "./index-vg0sj9nc.js";
4
+ } from "./index-1577bej2.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/prompter.ts
7
7
  import fsPromise from "fs/promises";
@@ -1,27 +1,27 @@
1
1
  // @bun
2
+ import {
3
+ LibraryScript
4
+ } from "./index-p681w089.js";
2
5
  import {
3
6
  resolveMobileTargets
4
7
  } from "./index-76rn3g2c.js";
5
- import {
6
- LibraryScript
7
- } from "./index-a1e0j63x.js";
8
8
  import {
9
9
  runner,
10
10
  script
11
- } from "./index-6rhabeev.js";
11
+ } from "./index-e31ghfp5.js";
12
12
  import {
13
13
  HmrWatcher,
14
14
  WatchRootResolver
15
- } from "./index-bjpxzr6s.js";
15
+ } from "./index-5vy2jzar.js";
16
16
  import {
17
17
  AppExecutor,
18
18
  LibExecutor,
19
19
  PkgExecutor,
20
20
  WorkspaceExecutor
21
- } from "./index-vg0sj9nc.js";
21
+ } from "./index-nkwmnqwn.js";
22
22
  import {
23
23
  __require
24
- } from "./index-r24hmh0q.js";
24
+ } from "./index-yb2wsc7f.js";
25
25
 
26
26
  // pkgs/@akanjs/devkit/applicationBuildReporter.ts
27
27
  import { Logger } from "akanjs/common";
@@ -350,7 +350,7 @@ class IncrementalBuilderHost {
350
350
  return false;
351
351
  this.#recycleRequested = true;
352
352
  this.#status = "recycling";
353
- this.logger.info(`recycling builder pid=${proc.pid} (${reason})`);
353
+ this.logger.debug(`recycling builder pid=${proc.pid} (${reason})`);
354
354
  this.#recycleTimer = setTimeout(() => {
355
355
  this.#recycleTimer = null;
356
356
  if (this.#proc !== proc)
@@ -1898,10 +1898,10 @@ function openBrowser(url) {
1898
1898
  }
1899
1899
 
1900
1900
  // pkgs/@akanjs/cli/application/application.runner.ts
1901
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-ha3y8ew8.js")).ApplicationBuildRunner;
1902
- var loadReleasePackager = async () => (await import("./applicationReleasePackager-gg8ccbeh.js")).ApplicationReleasePackager;
1903
- var loadCapacitorApp = async () => (await import("./capacitorApp-p0z5yab2.js")).CapacitorApp;
1904
- var loadAbstractCompactor = async () => (await import("./abstractCompactor-e5yq60qz.js")).AbstractCompactor;
1901
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-af0wtspv.js")).ApplicationBuildRunner;
1902
+ var loadReleasePackager = async () => (await import("./applicationReleasePackager-93nzdfsy.js")).ApplicationReleasePackager;
1903
+ var loadCapacitorApp = async () => (await import("./capacitorApp-vnvnvdhf.js")).CapacitorApp;
1904
+ var loadAbstractCompactor = async () => (await import("./abstractCompactor-20e0cwbs.js")).AbstractCompactor;
1905
1905
  var loadPrompts = async () => await import("@inquirer/prompts");
1906
1906
 
1907
1907
  class ApplicationRunner extends runner("application") {
@@ -2528,7 +2528,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
2528
2528
  let stopping = false;
2529
2529
  process.on("SIGINT", () => {
2530
2530
  if (stopping) {
2531
- Logger5.rawLog("Abandoning the local database teardown; containers are left running.", undefined, "warn");
2531
+ Logger5.rawLog("Abandoning the local database teardown; containers are left running.", undefined, "error");
2532
2532
  process.exit(130);
2533
2533
  }
2534
2534
  stopping = true;
@@ -2542,7 +2542,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
2542
2542
  }), timeout]);
2543
2543
  if (result !== "timeout")
2544
2544
  return;
2545
- Logger5.rawLog(`Local database did not stop within ${ApplicationScript.dbShutdownTimeoutMs}ms; run \`akan dbdown\` once Docker responds.`, undefined, "warn");
2545
+ Logger5.rawLog(`Local database did not stop within ${ApplicationScript.dbShutdownTimeoutMs}ms; run \`akan dbdown\` once Docker responds.`, undefined, "error");
2546
2546
  }
2547
2547
  async testSys(sys) {
2548
2548
  if (sys.type === "app")
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-mssqn2sq.js";
4
+ } from "./index-va15r8h5.js";
5
5
  import {
6
6
  createRepairReport,
7
7
  generatedFilePathsForTarget,
8
8
  renderRepairReport,
9
9
  writeGeneratedSyncState,
10
10
  writeWorkflowRunArtifact
11
- } from "./index-2c3e2xh8.js";
11
+ } from "./index-ytaqtc04.js";
12
12
  import {
13
13
  runner
14
- } from "./index-6rhabeev.js";
14
+ } from "./index-e31ghfp5.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;