@akanjs/cli 3.0.0-alpha.79 → 3.0.0-alpha.80

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 (76) hide show
  1. package/.build-stamp +1 -1
  2. package/{abstractCompactor-8yjc9sj4.js → abstractCompactor-pwc6d6yk.js} +3 -5
  3. package/{agent.command-q2rgd8jz.js → agent.command-180hh0ye.js} +11 -14
  4. package/{application.command-kd5zj0k9.js → application.command-gmcgen9y.js} +29 -34
  5. package/{applicationBuildRunner-8tqhxjd0.js → applicationBuildRunner-tavpx3fv.js} +9 -12
  6. package/{applicationReleasePackager-0jf6ejr4.js → applicationReleasePackager-ktjt0erc.js} +6 -7
  7. package/buildBatch.proc.js +12 -15
  8. package/capacitorApp-kwa67kzs.js +12 -0
  9. package/{cloud.command-v60xnfdx.js → cloud.command-gpq7qxrc.js} +15 -21
  10. package/{context.command-hac3x83c.js → context.command-dk2m2sjx.js} +19 -24
  11. package/dependencyScanner-c64m6fxp.js +8 -0
  12. package/{fleet.command-jv24wcae.js → fleet.command-3bkyyd3a.js} +67 -24
  13. package/getDirname-dr3jz1xg.js +7 -0
  14. package/{guideline.command-85x1tvjb.js → guideline.command-w6ddv13r.js} +16 -19
  15. package/incrementalBuilder.proc.js +17 -20
  16. package/{index-yz8988we.js → index-1kzsn94d.js} +1 -1
  17. package/{index-dz1q44m8.js → index-3c9n3nt8.js} +21 -21
  18. package/{index-76rn3g2c.js → index-47pj3aee.js} +4 -4
  19. package/{index-dfn0kqj7.js → index-5n0hf8r9.js} +19 -19
  20. package/{index-w0g7hcr7.js → index-5y7qba1c.js} +19 -19
  21. package/{index-1577bej2.js → index-6wwzs1bc.js} +2 -2
  22. package/{index-94hdqqka.js → index-92zztqy1.js} +6 -6
  23. package/{index-ffrhjdwd.js → index-a8h184wr.js} +7 -7
  24. package/{index-67546d0j.js → index-ayy5ecax.js} +1 -1
  25. package/{index-zec5gcx0.js → index-b2nt0w0k.js} +7 -7
  26. package/{index-xys926f2.js → index-by5gpp8x.js} +4 -4
  27. package/{index-47zynjx7.js → index-cd5x18qh.js} +32 -32
  28. package/{index-pzsryyjv.js → index-dq6wq1tv.js} +39 -39
  29. package/{index-psx0z6hb.js → index-ee8z8adx.js} +13 -13
  30. package/{index-zp0cmfgd.js → index-f7wewj2v.js} +22 -25
  31. package/{index-1szrbtj9.js → index-ft1sfjz0.js} +20 -23
  32. package/{index-k7731a4v.js → index-h7yw2z9n.js} +3 -3
  33. package/{index-egng0kc4.js → index-j9vnq8tr.js} +18 -18
  34. package/{index-zkrzv21w.js → index-k1n0h7dk.js} +519 -123
  35. package/{index-pj3hk9kt.js → index-k86zc21w.js} +57 -57
  36. package/{index-h5sr2nnj.js → index-mfm35dhh.js} +5 -5
  37. package/{index-qwfwk8be.js → index-qcracvc9.js} +8 -8
  38. package/{index-6w77v5df.js → index-saheq2bs.js} +4 -4
  39. package/{index-ta1mk0xh.js → index-v0s24t8j.js} +15 -15
  40. package/{index-safgeq9a.js → index-wet2ytnr.js} +8 -8
  41. package/{index-jn9b717k.js → index-xnhf8tr9.js} +1 -1
  42. package/{index-7605ykh6.js → index-xxe90kqy.js} +6 -6
  43. package/{index-25qfm3at.js → index-z3c9mmw4.js} +14 -16
  44. package/index.js +22 -27
  45. package/{library.command-nvp0wetm.js → library.command-wpedct6c.js} +7 -11
  46. package/{localRegistry.command-dnefn893.js → localRegistry.command-pjdxa01g.js} +20 -26
  47. package/{module.command-xs6ded4j.js → module.command-8n4kct3e.js} +13 -17
  48. package/{package.command-af8sxhff.js → package.command-fcbd0b1d.js} +8 -11
  49. package/package.json +2 -2
  50. package/{page.command-gr6rbz17.js → page.command-x4379grq.js} +7 -10
  51. package/{primitive.command-qjf4mbth.js → primitive.command-8etmnqhq.js} +13 -17
  52. package/{quality.command-9xhaxzm1.js → quality.command-hfx7z8yr.js} +11 -14
  53. package/recipeScanner-fpagtgc1.js +11 -0
  54. package/{repair.command-a2z4d5a0.js → repair.command-j0fs5qkz.js} +12 -15
  55. package/{routeSourceValidator-7fycdqyv.js → routeSourceValidator-ze6x894c.js} +0 -2
  56. package/{scalar.command-ax8taqh1.js → scalar.command-2emk89eh.js} +11 -15
  57. package/templates/workspaceRoot/package.json.template +1 -3
  58. package/typeChecker-3xgrzc2v.js +7 -0
  59. package/typecheck.proc.js +4 -5
  60. package/{workflow.command-gwkw0jae.js → workflow.command-cvpmzwjg.js} +22 -26
  61. package/{workspace.command-53qpkgzp.js → workspace.command-mbb5s3wx.js} +57 -64
  62. package/capacitorApp-szqr3cxr.js +0 -62
  63. package/dependencyScanner-aqg3dkks.js +0 -9
  64. package/getDirname-ka11hm7e.js +0 -8
  65. package/index-dp66vwr6.js +0 -348
  66. package/index-mxvakhsm.js +0 -66
  67. package/index-yb2wsc7f.js +0 -4
  68. package/recipeScanner-zrzev25x.js +0 -12
  69. package/typeChecker-yhs4eht8.js +0 -8
  70. /package/{index-19nz5chq.js → index-3d9y066c.js} +0 -0
  71. /package/{index-ynf37b66.js → index-a5vmm6x4.js} +0 -0
  72. /package/{index-5vy2jzar.js → index-ctphds8v.js} +0 -0
  73. /package/{index-0wae5ebk.js → index-meh558jy.js} +0 -0
  74. /package/{index-scemmfpj.js → index-n68jx79w.js} +0 -0
  75. /package/{index-ss469dec.js → index-nz8prx9g.js} +0 -0
  76. /package/{index-jcm6zr20.js → index-x23688ar.js} +0 -0
package/index-dp66vwr6.js DELETED
@@ -1,348 +0,0 @@
1
- // @bun
2
- import {
3
- __require
4
- } from "./index-yb2wsc7f.js";
5
-
6
- // pkgs/@akanjs/devkit/artifact/implicitRootLayout.ts
7
- import { mkdir } from "fs/promises";
8
- import path2 from "path";
9
-
10
- // pkgs/@akanjs/devkit/transforms/asyncDefaultExportDetector.ts
11
- import fs from "fs";
12
- import path from "path";
13
-
14
- class AsyncDefaultExportDetector {
15
- static #typescriptLoad;
16
- static #loadTypescript() {
17
- AsyncDefaultExportDetector.#typescriptLoad ??= import("typescript").then((mod) => mod.default ?? mod);
18
- return AsyncDefaultExportDetector.#typescriptLoad;
19
- }
20
- static async detect(moduleAbsPath) {
21
- try {
22
- const typescript = await AsyncDefaultExportDetector.#loadTypescript();
23
- const source = fs.readFileSync(path.resolve(moduleAbsPath), "utf8");
24
- const sourceFile = typescript.createSourceFile(moduleAbsPath, source, typescript.ScriptTarget.Latest, true, AsyncDefaultExportDetector.#scriptKind(typescript, moduleAbsPath));
25
- return new AsyncDefaultExportDetector(typescript).detectInSourceFile(sourceFile);
26
- } catch {
27
- return false;
28
- }
29
- }
30
- #ts;
31
- constructor(typescript) {
32
- this.#ts = typescript;
33
- }
34
- detectInSourceFile(sourceFile) {
35
- const ts = this.#ts;
36
- const asyncBindings = new Map;
37
- let defaultIdentifier = null;
38
- for (const statement of sourceFile.statements) {
39
- if (ts.isFunctionDeclaration(statement)) {
40
- if (this.#hasModifier(statement, ts.SyntaxKind.DefaultKeyword)) {
41
- return this.#hasModifier(statement, ts.SyntaxKind.AsyncKeyword);
42
- }
43
- if (statement.name) {
44
- asyncBindings.set(statement.name.text, this.#hasModifier(statement, ts.SyntaxKind.AsyncKeyword));
45
- }
46
- continue;
47
- }
48
- if (ts.isVariableStatement(statement)) {
49
- for (const declaration of statement.declarationList.declarations) {
50
- if (!ts.isIdentifier(declaration.name))
51
- continue;
52
- asyncBindings.set(declaration.name.text, this.#isAsyncFunctionExpression(declaration.initializer));
53
- }
54
- continue;
55
- }
56
- if (ts.isExportAssignment(statement)) {
57
- if (this.#isAsyncFunctionExpression(statement.expression))
58
- return true;
59
- if (ts.isIdentifier(statement.expression))
60
- defaultIdentifier = statement.expression.text;
61
- continue;
62
- }
63
- if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {
64
- const exportClause = statement.exportClause;
65
- for (const specifier of exportClause.elements) {
66
- if (specifier.name.text !== "default")
67
- continue;
68
- defaultIdentifier = specifier.propertyName?.text ?? specifier.name.text;
69
- }
70
- }
71
- }
72
- return defaultIdentifier ? asyncBindings.get(defaultIdentifier) === true : false;
73
- }
74
- #hasModifier(node, kind) {
75
- const ts = this.#ts;
76
- return ts.canHaveModifiers(node) && (ts.getModifiers(node)?.some((modifier) => modifier.kind === kind) ?? false);
77
- }
78
- #isAsyncFunctionExpression(node) {
79
- const ts = this.#ts;
80
- return Boolean(node && (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) && this.#hasModifier(node, ts.SyntaxKind.AsyncKeyword));
81
- }
82
- static #scriptKind(typescript, moduleAbsPath) {
83
- return moduleAbsPath.endsWith(".tsx") || moduleAbsPath.endsWith(".jsx") ? typescript.ScriptKind.TSX : typescript.ScriptKind.TS;
84
- }
85
- }
86
-
87
- // pkgs/@akanjs/devkit/artifact/implicitRootLayout.ts
88
- var LAYOUT_KEY_RE = /^\.\/(.+\/)?_layout\.(tsx|ts|jsx|js)$/;
89
- async function appHasStModule(appCwdPath) {
90
- return Bun.file(path2.join(appCwdPath, "lib", "st.ts")).exists();
91
- }
92
- var IMPLICIT_LAYOUT_DIR = path2.join(".akan", "generated", "root-layouts");
93
- var IMPLICIT_DICT_DIR = path2.join(".akan", "generated", "dict");
94
- var IMPLICIT_OVERRIDES_DIR = path2.join(".akan", "generated", "overrides");
95
- var OVERRIDES_KEY_RE = /^\.\/(.+\/)?_overrides\.(tsx|ts|jsx|js)$/;
96
- async function writeGeneratedOverridesLayoutFile(opts) {
97
- const filename = `${opts.key.replace(/^\.\//, "").replace(/[^a-zA-Z0-9]+/g, "_")}.tsx`;
98
- const absPath = path2.join(path2.resolve(opts.appCwdPath), IMPLICIT_OVERRIDES_DIR, filename);
99
- const userRel = path2.relative(path2.dirname(absPath), opts.userAbsPath).split(path2.sep).join("/");
100
- const userSpecifier = userRel.startsWith(".") ? userRel : `./${userRel}`;
101
- const source = `"use client";
102
- import { UiOverrideProvider } from "akanjs/ui";
103
- import { createElement, type ReactNode } from "react";
104
- import value from ${JSON.stringify(userSpecifier)};
105
-
106
- export default function AkanUiOverridesLayout({ children }: { children?: ReactNode }) {
107
- return createElement(UiOverrideProvider, { value }, children);
108
- }
109
- `;
110
- await Bun.write(absPath, source);
111
- return absPath;
112
- }
113
- function getRootBoundarySegments(key) {
114
- const match = LAYOUT_KEY_RE.exec(key);
115
- if (!match)
116
- return null;
117
- const prefix = match[1]?.replace(/\/$/, "");
118
- if (!prefix)
119
- return [];
120
- return prefix.split("/").filter(Boolean);
121
- }
122
- function implicitRootLayoutKey(segments) {
123
- return `./${[...segments, "__root_layout"].join("/")}.tsx`;
124
- }
125
- function implicitRootLayoutAbsPath(appCwdPath, segments) {
126
- const filename = segments.length ? `${segments.join("__")}__root_layout.tsx` : "__root_layout.tsx";
127
- return path2.join(path2.resolve(appCwdPath), IMPLICIT_LAYOUT_DIR, filename);
128
- }
129
- function implicitDictionaryMacroAbsPath(appCwdPath) {
130
- return path2.join(path2.resolve(appCwdPath), IMPLICIT_DICT_DIR, "useDict.ts");
131
- }
132
- function isRootBoundarySegments(segments, basePaths) {
133
- const firstVisibleIndex = segments.findIndex((segment) => !/^\(.+\)$/.test(segment));
134
- if (firstVisibleIndex === -1)
135
- return segments.length <= 1;
136
- if (segments.slice(firstVisibleIndex + 1).some((segment) => /^\(.+\)$/.test(segment)))
137
- return false;
138
- const visible = segments.slice(firstVisibleIndex);
139
- const allowedBasePaths = new Set([...basePaths].map((basePath) => basePath.trim()).filter(Boolean));
140
- return visible.length === 1 && (firstVisibleIndex > 0 || allowedBasePaths.has(visible[0] ?? ""));
141
- }
142
- function findRootBoundaries(pageKeys, appCwdPath, basePaths) {
143
- const boundaries = new Map;
144
- for (const key of pageKeys) {
145
- const segments = getRootBoundarySegments(key);
146
- if (!segments)
147
- continue;
148
- if (!isRootBoundarySegments(segments, basePaths))
149
- continue;
150
- const id = segments.join("/");
151
- boundaries.set(id, {
152
- sourceKey: key,
153
- sourceAbsPath: path2.resolve(appCwdPath, "page", key.replace(/^\.\//, "")),
154
- segments
155
- });
156
- }
157
- const hasExplicitRootBoundary = [...boundaries.values()].some((boundary) => boundary.segments.length === 0);
158
- if (!hasExplicitRootBoundary && boundaries.size === 0) {
159
- boundaries.set("", { sourceKey: null, sourceAbsPath: null, segments: [] });
160
- }
161
- return [...boundaries.values()].sort((a, b) => a.segments.join("/").localeCompare(b.segments.join("/")));
162
- }
163
- function hasAncestorRootBoundary(boundary, boundaries) {
164
- return boundaries.some((candidate) => candidate !== boundary && candidate.segments.length < boundary.segments.length && candidate.segments.every((segment, index) => boundary.segments[index] === segment));
165
- }
166
- function findExplicitRootLayoutAbsPath(pageKeys, appCwdPath) {
167
- const rootLayoutKey = pageKeys.find((key) => {
168
- const segments = getRootBoundarySegments(key);
169
- return segments !== null && segments.length === 0;
170
- });
171
- return rootLayoutKey ? path2.resolve(appCwdPath, "page", rootLayoutKey.replace(/^\.\//, "")) : null;
172
- }
173
- function routePrefixForSegments(segments) {
174
- const visible = segments.filter((segment) => !/^\(.+\)$/.test(segment));
175
- return visible[0] ?? null;
176
- }
177
- async function assertEnvClientConvention(appCwdPath, appName) {
178
- const envPath = path2.join(appCwdPath, "env", "env.client.ts");
179
- if (!await Bun.file(envPath).exists()) {
180
- throw new Error(`[route-convention] app "${appName}" must provide env/env.client.ts exporting "env" for generated System.Provider`);
181
- }
182
- }
183
- async function writeGeneratedDictionaryMacroFile(appCwdPath, appName) {
184
- const absPath = implicitDictionaryMacroAbsPath(appCwdPath);
185
- await mkdir(path2.dirname(absPath), { recursive: true });
186
- await Bun.write(absPath, `import { getAllDictionary } from "@apps/${appName}/lib/dict" with { type: "macro" };
187
-
188
- export const allDictionary = getAllDictionary();
189
- `);
190
- return absPath;
191
- }
192
- async function writeGeneratedRootLayoutFile(opts) {
193
- await assertEnvClientConvention(opts.appCwdPath, opts.appName);
194
- const dictMacroAbsPath = opts.includeSystemProvider ? await writeGeneratedDictionaryMacroFile(opts.appCwdPath, opts.appName) : null;
195
- const absPath = implicitRootLayoutAbsPath(opts.appCwdPath, opts.boundary.segments);
196
- await mkdir(path2.dirname(absPath), { recursive: true });
197
- const dictMacroRel = dictMacroAbsPath ? path2.relative(path2.dirname(absPath), dictMacroAbsPath).split(path2.sep).join("/") : null;
198
- const dictMacroSpecifier = dictMacroRel ? dictMacroRel.startsWith(".") ? dictMacroRel : `./${dictMacroRel}` : null;
199
- const sourceRel = opts.boundary.sourceAbsPath ? path2.relative(path2.dirname(absPath), opts.boundary.sourceAbsPath).split(path2.sep).join("/") : null;
200
- const sourceSpecifier = sourceRel ? sourceRel.startsWith(".") ? sourceRel : `./${sourceRel}` : null;
201
- const inheritedSourceAbsPath = opts.rootSourceAbsPath && opts.rootSourceAbsPath !== opts.boundary.sourceAbsPath ? opts.rootSourceAbsPath : null;
202
- const inheritedSourceRel = inheritedSourceAbsPath ? path2.relative(path2.dirname(absPath), inheritedSourceAbsPath).split(path2.sep).join("/") : null;
203
- const inheritedSourceSpecifier = inheritedSourceRel ? inheritedSourceRel.startsWith(".") ? inheritedSourceRel : `./${inheritedSourceRel}` : null;
204
- const clientImport = opts.includeStInit ? `import { st } from "@apps/${opts.appName}/client";
205
- void st;
206
- ` : `import "@apps/${opts.appName}/client";
207
- `;
208
- const inheritedImport = inheritedSourceSpecifier ? `import * as inheritedLayout from ${JSON.stringify(inheritedSourceSpecifier)};
209
- ` : `const inheritedLayout = {};
210
- `;
211
- const prefix = routePrefixForSegments(opts.boundary.segments);
212
- const userImport = sourceSpecifier ? `import UserLayout, * as userLayout from ${JSON.stringify(sourceSpecifier)};
213
- ` : `const UserLayout = ({ children }) => children;
214
- const userLayout = {};
215
- `;
216
- const isAsyncUserLayout = opts.boundary.sourceAbsPath ? await AsyncDefaultExportDetector.detect(opts.boundary.sourceAbsPath) : false;
217
- const userLayoutElement = "<UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>";
218
- const layoutSignature = isAsyncUserLayout ? "export default async function GeneratedLayout" : "export default function GeneratedLayout";
219
- const layoutBinding = isAsyncUserLayout ? ` const layout =
220
- process.env.AKAN_PUBLIC_RENDER_ENV === "csr"
221
- ? await UserLayout({ params, searchParams, children })
222
- : ${userLayoutElement};
223
- ` : "";
224
- const layoutChild = isAsyncUserLayout ? "{layout}" : userLayoutElement;
225
- const layoutReturn = isAsyncUserLayout ? "layout" : userLayoutElement;
226
- const source = opts.includeSystemProvider ? `import type { LayoutProps, PageProps } from "akanjs/client";
227
- import { loadFonts } from "akanjs/client";
228
- import { System } from "akanjs/ui";
229
- import { env } from "@apps/${opts.appName}/env/env.client";
230
- import { allDictionary } from ${JSON.stringify(dictMacroSpecifier)};
231
- ${clientImport}${inheritedImport}${userImport}
232
- const userFonts = userLayout.fonts ?? inheritedLayout.fonts ?? [];
233
- const defaultFonts = userFonts.filter((font) => font.default);
234
- if (defaultFonts.length > 1) throw new Error("[route-convention] only one default font is allowed per root layout");
235
- const defaultFont = defaultFonts[0];
236
- const defaultFontClassName = defaultFont ? (defaultFont.className ?? \`font-\${defaultFont.name}\`) : undefined;
237
-
238
- export async function generateHead(props: PageProps) {
239
- if (userLayout.generateHead) return userLayout.generateHead(props);
240
- if (userLayout.head !== undefined) return userLayout.head;
241
- if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
242
- return inheritedLayout.head;
243
- }
244
-
245
- export async function generateMetadata(props: PageProps) {
246
- if (userLayout.generateMetadata) return userLayout.generateMetadata(props);
247
- if (userLayout.metadata !== undefined) return userLayout.metadata;
248
- if (inheritedLayout.generateMetadata) return inheritedLayout.generateMetadata(props);
249
- return inheritedLayout.metadata;
250
- }
251
-
252
- export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;
253
- export const Error = userLayout.Error ?? inheritedLayout.Error;
254
- export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;
255
-
256
- ${layoutSignature}({ children, params, searchParams }: LayoutProps) {
257
- ${layoutBinding} return (
258
- <System.Provider
259
- of={GeneratedLayout as never}
260
- appName=${JSON.stringify(opts.appName)}
261
- ${prefix ? `prefix=${JSON.stringify(prefix)}
262
- ` : ""}params={params}
263
- manifest={userLayout.manifest ?? inheritedLayout.manifest}
264
- env={env}
265
- theme={userLayout.theme ?? inheritedLayout.theme}
266
- fonts={loadFonts(userFonts)}
267
- className={defaultFontClassName}
268
- gaTrackingId={userLayout.gaTrackingId ?? inheritedLayout.gaTrackingId}
269
- layoutStyle={userLayout.layoutStyle ?? inheritedLayout.layoutStyle}
270
- reconnect={userLayout.reconnect ?? inheritedLayout.reconnect ?? false}
271
- wsConnect={userLayout.wsConnect ?? inheritedLayout.wsConnect ?? true}
272
- allDictionary={process.env.AKAN_PUBLIC_RENDER_ENV === "ssr" ? allDictionary : undefined}
273
- >
274
- ${layoutChild}
275
- </System.Provider>
276
- );
277
- }
278
- ` : `import type { LayoutProps, PageProps } from "akanjs/client";
279
- ${inheritedImport}${userImport}
280
- export async function generateHead(props: PageProps) {
281
- if (userLayout.generateHead) return userLayout.generateHead(props);
282
- if (userLayout.head !== undefined) return userLayout.head;
283
- if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
284
- return inheritedLayout.head;
285
- }
286
-
287
- export async function generateMetadata(props: PageProps) {
288
- if (userLayout.generateMetadata) return userLayout.generateMetadata(props);
289
- if (userLayout.metadata !== undefined) return userLayout.metadata;
290
- if (inheritedLayout.generateMetadata) return inheritedLayout.generateMetadata(props);
291
- return inheritedLayout.metadata;
292
- }
293
-
294
- export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;
295
- export const Error = userLayout.Error ?? inheritedLayout.Error;
296
- export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;
297
-
298
- ${layoutSignature}({ children, params, searchParams }: LayoutProps) {
299
- ${layoutBinding} return ${layoutReturn};
300
- }
301
- `;
302
- await Bun.write(absPath, source);
303
- return absPath;
304
- }
305
- async function resolveSsrPageEntries(opts) {
306
- const absPageDir = path2.resolve(opts.appCwdPath, "page");
307
- const hasSt = await appHasStModule(opts.appCwdPath);
308
- const basePaths = opts.basePaths ?? [];
309
- const rootSourceAbsPath = findExplicitRootLayoutAbsPath(opts.pageKeys, opts.appCwdPath);
310
- const rootBoundaries = findRootBoundaries(opts.pageKeys, opts.appCwdPath, basePaths);
311
- const rootLayoutKeys = new Set(opts.pageKeys.filter((key) => {
312
- const segments = getRootBoundarySegments(key);
313
- return segments !== null && isRootBoundarySegments(segments, basePaths);
314
- }));
315
- const base = await Promise.all(opts.pageKeys.filter((key) => !rootLayoutKeys.has(key)).map(async (key) => {
316
- const userAbsPath = path2.resolve(absPageDir, key);
317
- if (OVERRIDES_KEY_RE.test(key)) {
318
- const moduleAbsPath = await writeGeneratedOverridesLayoutFile({
319
- appCwdPath: opts.appCwdPath,
320
- key,
321
- userAbsPath
322
- });
323
- return { key, moduleAbsPath, seedAbsPaths: [userAbsPath] };
324
- }
325
- return { key, moduleAbsPath: userAbsPath };
326
- }));
327
- const generated = await Promise.all(rootBoundaries.map(async (boundary) => ({
328
- key: implicitRootLayoutKey(boundary.segments),
329
- moduleAbsPath: await writeGeneratedRootLayoutFile({
330
- appCwdPath: opts.appCwdPath,
331
- appName: opts.appName,
332
- boundary,
333
- rootSourceAbsPath,
334
- includeStInit: hasSt && boundary.segments.length === 0,
335
- includeSystemProvider: !hasAncestorRootBoundary(boundary, rootBoundaries)
336
- }),
337
- seedAbsPaths: [...new Set([boundary.sourceAbsPath, rootSourceAbsPath].filter((absPath) => absPath !== null))]
338
- })));
339
- const entries = [...base, ...generated];
340
- entries.sort((a, b) => a.key.localeCompare(b.key));
341
- return entries;
342
- }
343
- async function resolveSsrPageEntriesForApp(app, pageKeys) {
344
- const config = await app.getConfig();
345
- return resolveSsrPageEntries({ appCwdPath: app.cwdPath, appName: app.name, pageKeys, basePaths: config.basePaths });
346
- }
347
-
348
- export { AsyncDefaultExportDetector, getRootBoundarySegments, isRootBoundarySegments, resolveSsrPageEntriesForApp };
package/index-mxvakhsm.js DELETED
@@ -1,66 +0,0 @@
1
- // @bun
2
- // pkgs/@akanjs/devkit/spinner.ts
3
- import ora from "ora";
4
-
5
- class Spinner {
6
- static padding = 12;
7
- static oraOptions = { discardStdin: false };
8
- static canAnimate(stream = process.stderr) {
9
- return !stream.isTTY || stream.columns > 0;
10
- }
11
- spinner;
12
- stopWatch = null;
13
- startAt = new Date;
14
- prefix;
15
- message;
16
- enableSpin;
17
- constructor(message, { prefix = "", indent = 0, enableSpin = true } = {}) {
18
- Spinner.padding = Math.max(Spinner.padding, prefix.length);
19
- this.prefix = prefix;
20
- this.message = message;
21
- this.spinner = ora({ ...Spinner.oraOptions, text: message });
22
- this.spinner.prefixText = prefix.padStart(Spinner.padding, " ");
23
- this.spinner.indent = indent;
24
- this.enableSpin = enableSpin && Spinner.canAnimate();
25
- }
26
- start() {
27
- this.startAt = new Date;
28
- if (this.enableSpin) {
29
- this.spinner.start();
30
- this.stopWatch = setInterval(() => {
31
- this.spinner.prefixText = this.prefix.padStart(Spinner.padding, " ");
32
- this.spinner.text = `${this.message} (${this.#getElapsedTimeStr({ floor: true })})`;
33
- }, 1000);
34
- } else
35
- this.spinner.info();
36
- return this;
37
- }
38
- succeed(message) {
39
- this.spinner.succeed(`${message} (${this.#getElapsedTimeStr()})`);
40
- this.#reset();
41
- }
42
- fail(message) {
43
- this.spinner.fail(`${message} (${this.#getElapsedTimeStr()})`);
44
- this.#reset();
45
- }
46
- isSpinning() {
47
- return this.spinner.isSpinning;
48
- }
49
- #reset() {
50
- if (this.stopWatch)
51
- clearInterval(this.stopWatch);
52
- this.stopWatch = null;
53
- }
54
- #getElapsedTimeStr({ floor = false } = {}) {
55
- const ms = Date.now() - this.startAt.getTime();
56
- if (ms < 1000)
57
- return `${ms}ms`;
58
- const s = Math.floor(ms / 1000);
59
- if (s < 60)
60
- return `${floor ? Math.floor(ms / 1000) : Math.floor(ms / 100) / 10}s`;
61
- const m = Math.floor(s / 60);
62
- return `${m}m ${s % 60}s`;
63
- }
64
- }
65
-
66
- export { Spinner };
package/index-yb2wsc7f.js DELETED
@@ -1,4 +0,0 @@
1
- // @bun
2
- var __require = import.meta.require;
3
-
4
- export { __require };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- collectRecipeSources,
4
- findInlineRecipeDuplicates,
5
- scanRecipes
6
- } from "./index-xys926f2.js";
7
- import"./index-yb2wsc7f.js";
8
- export {
9
- collectRecipeSources,
10
- findInlineRecipeDuplicates,
11
- scanRecipes
12
- };
@@ -1,8 +0,0 @@
1
- // @bun
2
- import {
3
- TypeChecker
4
- } from "./index-94hdqqka.js";
5
- import"./index-yb2wsc7f.js";
6
- export {
7
- TypeChecker
8
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes