@akanjs/cli 3.0.0-alpha.102 → 3.0.0-alpha.104
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.
- package/.build-stamp +1 -1
- package/{abstractCompactor-byytxs22.js → abstractCompactor-mjh5ppsq.js} +1 -1
- package/{agent.command-v1a4746v.js → agent.command-d2gfxfck.js} +5 -5
- package/{application.command-fzdcnzhg.js → application.command-xgphqs7k.js} +5 -5
- package/{applicationBuildRunner-s4gsk728.js → applicationBuildRunner-3d5q1yn7.js} +2 -2
- package/{applicationReleasePackager-28v9vbzk.js → applicationReleasePackager-4yasxwv9.js} +1 -1
- package/buildBatch.proc.js +2 -2
- package/{capacitorApp-8d6d4zkm.js → capacitorApp-36rbr858.js} +2 -2
- package/{cloud.command-wygy2z05.js → cloud.command-abgkk73f.js} +9 -9
- package/{context.command-4vdt1aqq.js → context.command-ez8a0zyz.js} +13 -13
- package/{devTui-qnf1txdz.js → devTui-70cjjtaw.js} +1 -1
- package/{devTuiView-yzct2cq6.js → devTuiView-71wnkjft.js} +1 -1
- package/{guideline.command-p92dq6ts.js → guideline.command-xmqwx8zm.js} +11 -7
- package/guidelines/agentRule/agentRule.instruction.md +22 -24
- package/guidelines/conventions/conventions.instruction.md +40 -25
- package/guidelines/mcpRule/mcpRule.instruction.md +61 -39
- package/guidelines/ssrRule/ssrRule.instruction.md +15 -13
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +4 -3
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +68 -3
- package/incrementalBuilder.proc.js +1 -1
- package/{index-p5neav9b.js → index-0vh9rgxz.js} +1 -1
- package/{index-gq44bqjt.js → index-259dsnz3.js} +2 -2
- package/{index-qsq3q8fy.js → index-2tv3fdx4.js} +21 -10
- package/{index-yks023mb.js → index-4c9ykbfq.js} +6 -6
- package/{index-qkk27bk6.js → index-4edzf1gr.js} +4 -4
- package/{index-yza7zkpt.js → index-600zhnve.js} +10 -10
- package/{index-srdssqj7.js → index-7737gxcp.js} +3 -3
- package/{index-zmjppp25.js → index-8pm30m73.js} +5 -5
- package/{index-0amdxycf.js → index-fz5q3gd7.js} +3 -3
- package/{index-fc1bh0a7.js → index-gyd220p2.js} +1 -1
- package/{index-5svjba73.js → index-j9yhg404.js} +1 -1
- package/{index-c69j78kk.js → index-kn1h7p1x.js} +1 -1
- package/{index-gtmz74tj.js → index-ktb5njgy.js} +2 -2
- package/{index-znynzt5w.js → index-mak3cd28.js} +1 -1
- package/{index-29sxqfaw.js → index-ne2qy0nk.js} +3 -3
- package/{index-hyywke0f.js → index-pnqbkf5p.js} +1 -1
- package/{index-8p8p0cf8.js → index-rwg2aa4f.js} +3 -3
- package/{index-7d6vny25.js → index-ws5e0j51.js} +2 -2
- package/{index-1yxtbmbj.js → index-wt7qrtd4.js} +1 -1
- package/{index-zz5jyd94.js → index-yecdrt9a.js} +9 -9
- package/{index-zxgr3s8s.js → index-yw4xj7pa.js} +4 -4
- package/index.js +19 -19
- package/{library.command-s4fszngs.js → library.command-nbsky672.js} +3 -3
- package/{localRegistry.command-gyw4da9z.js → localRegistry.command-namg61k1.js} +8 -8
- package/{module.command-6n7dwvav.js → module.command-29vqzrh8.js} +6 -6
- package/{package.command-gr82ypnr.js → package.command-axv0abmn.js} +3 -3
- package/package.json +2 -2
- package/{page.command-7gvgb3jb.js → page.command-vs9s3zrh.js} +3 -3
- package/{primitive.command-tk5ckw38.js → primitive.command-cbxmqbtc.js} +7 -7
- package/{quality.command-38v81baf.js → quality.command-gmbs7nws.js} +2 -2
- package/{repair.command-5xbwvsxp.js → repair.command-bqsjptsj.js} +5 -5
- package/{routeSourceValidator-ze6x894c.js → routeSourceValidator-apyqw7wk.js} +90 -17
- package/{scalar.command-0epwcr5k.js → scalar.command-6k1vhe9s.js} +5 -5
- package/{subspace.command-e2t36xb2.js → subspace.command-35a3t6vv.js} +3 -3
- package/templates/app/page/_index.tsx +3 -3
- package/templates/app/page/_layout.tsx +31 -32
- package/templates/appSample/page/task/[taskId]/_index.tsx +22 -27
- package/templates/appSample/page/task/[taskId]/edit.tsx +25 -30
- package/templates/appSample/page/task/_index.tsx +3 -7
- package/templates/appSample/page/task/_layout.tsx +4 -15
- package/templates/appSample/page/task/new.tsx +4 -10
- package/templates/crudPages/[__model__Id]/edit/page.tsx +26 -28
- package/templates/crudPages/[__model__Id]/page.tsx +20 -25
- package/templates/crudPages/new/page.tsx +24 -23
- package/templates/crudPages/page.tsx +25 -24
- package/templates/crudSinglePage/page.tsx +25 -24
- package/{workflow.command-kphbr7eh.js → workflow.command-nwpcdc8p.js} +10 -10
- package/{workspace.command-j1gatz3d.js → workspace.command-kah5jgg5.js} +20 -20
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isScannedRootEntry,
|
|
8
8
|
AppExecutor,
|
|
9
9
|
LibExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-2tv3fdx4.js";
|
|
11
11
|
import {
|
|
12
12
|
FileSys
|
|
13
13
|
} from "./index-q0y2jq9j.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
workflowRunArtifactPath,
|
|
21
21
|
workflowSyncDir
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-gyd220p2.js";
|
|
23
23
|
|
|
24
24
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
25
25
|
import { readdir } from "fs/promises";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_BLOCK_START,
|
|
8
8
|
AGENT_BLOCK_END,
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
CLAUDE_COMMENT_RULE,
|
|
14
14
|
AppExecutor,
|
|
15
15
|
LibExecutor
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-2tv3fdx4.js";
|
|
17
17
|
import {
|
|
18
18
|
collectRecipeSources2,
|
|
19
19
|
scanRecipes2
|
|
20
20
|
} from "./index-by5gpp8x.js";
|
|
21
21
|
import {
|
|
22
22
|
AkanContextAnalyzer
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-ktb5njgy.js";
|
|
24
24
|
import {
|
|
25
25
|
Prompter
|
|
26
26
|
} from "./index-h7yw2z9n.js";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-gyd220p2.js";
|
|
11
11
|
import {
|
|
12
12
|
AiSession
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-kn1h7p1x.js";
|
|
14
14
|
import {
|
|
15
15
|
Prompter
|
|
16
16
|
} from "./index-h7yw2z9n.js";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys
|
|
8
8
|
} from "./index-q0y2jq9j.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2tv3fdx4.js";
|
|
12
12
|
import {
|
|
13
13
|
TypeScriptDependencyScanner2
|
|
14
14
|
} from "./index-kcxmv48c.js";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import {
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor,
|
|
9
9
|
LibExecutor,
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2tv3fdx4.js";
|
|
12
12
|
import {
|
|
13
13
|
LibraryScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-259dsnz3.js";
|
|
15
15
|
import {
|
|
16
16
|
HmrWatcher,
|
|
17
17
|
WatchRootResolver
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
SlicePlanner,
|
|
21
21
|
formatSlicePlan
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-j9yhg404.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveMobileTargets
|
|
25
25
|
} from "./index-47pj3aee.js";
|
|
@@ -2049,10 +2049,10 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
|
|
|
2049
2049
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
2050
2050
|
import { Logger as Logger4 } from "akanjs/common";
|
|
2051
2051
|
import ora from "ora";
|
|
2052
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
2053
|
-
var loadReleasePackager = async () => (await import("./applicationReleasePackager-
|
|
2054
|
-
var loadCapacitorApp = async () => (await import("./capacitorApp-
|
|
2055
|
-
var loadAbstractCompactor = async () => (await import("./abstractCompactor-
|
|
2052
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-3d5q1yn7.js")).ApplicationBuildRunner;
|
|
2053
|
+
var loadReleasePackager = async () => (await import("./applicationReleasePackager-4yasxwv9.js")).ApplicationReleasePackager;
|
|
2054
|
+
var loadCapacitorApp = async () => (await import("./capacitorApp-36rbr858.js")).CapacitorApp;
|
|
2055
|
+
var loadAbstractCompactor = async () => (await import("./abstractCompactor-mjh5ppsq.js")).AbstractCompactor;
|
|
2056
2056
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
2057
2057
|
|
|
2058
2058
|
class ApplicationRunner extends runner("application") {
|
|
@@ -3283,7 +3283,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
3283
3283
|
throw new Error("No app selected to start");
|
|
3284
3284
|
const startedDatabase = dbup ? await this.#prepareSharedDatabase(apps) : false;
|
|
3285
3285
|
const supervisor = new DevSupervisor({ apps, mode, concurrency, open, write });
|
|
3286
|
-
const view = mode === "tui" ? await (await import("./devTuiView-
|
|
3286
|
+
const view = mode === "tui" ? await (await import("./devTuiView-71wnkjft.js")).createDevTuiView(supervisor) : new DevStreamView(apps.map((app) => app.name));
|
|
3287
3287
|
await supervisor.run(view);
|
|
3288
3288
|
if (startedDatabase)
|
|
3289
3289
|
await this.#stopDatabase(workspace);
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
GlobalConfig,
|
|
5
5
|
CloudApi,
|
|
6
6
|
AiSession
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-kn1h7p1x.js";
|
|
8
8
|
import {
|
|
9
9
|
WorkspaceExecutor,
|
|
10
10
|
AppExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2tv3fdx4.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-mak3cd28.js";
|
|
15
15
|
import {
|
|
16
16
|
openBrowser
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-yecdrt9a.js";
|
|
18
18
|
|
|
19
19
|
// pkgs/@akanjs/cli/npmRegistry.ts
|
|
20
20
|
var defaultNpmRegistry = "https://registry.npmjs.org";
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getTargetMetas,
|
|
5
5
|
getTargetCommandNames,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mak3cd28.js";
|
|
8
8
|
import"./index-q0y2jq9j.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-2tv3fdx4.js";
|
|
10
10
|
import"./index-6wwzs1bc.js";
|
|
11
11
|
|
|
12
12
|
// pkgs/@akanjs/cli/commandManifest.ts
|
|
@@ -14,23 +14,23 @@ import path from "path";
|
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
16
16
|
var commandModules = {
|
|
17
|
-
workspace: async () => (await import("./workspace.command-
|
|
18
|
-
agent: async () => (await import("./agent.command-
|
|
19
|
-
application: async () => (await import("./application.command-
|
|
20
|
-
library: async () => (await import("./library.command-
|
|
21
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
22
|
-
package: async () => (await import("./package.command-
|
|
23
|
-
module: async () => (await import("./module.command-
|
|
24
|
-
page: async () => (await import("./page.command-
|
|
25
|
-
context: async () => (await import("./context.command-
|
|
26
|
-
cloud: async () => (await import("./cloud.command-
|
|
27
|
-
subspace: async () => (await import("./subspace.command-
|
|
28
|
-
guideline: async () => (await import("./guideline.command-
|
|
29
|
-
scalar: async () => (await import("./scalar.command-
|
|
30
|
-
primitive: async () => (await import("./primitive.command-
|
|
31
|
-
quality: async () => (await import("./quality.command-
|
|
32
|
-
repair: async () => (await import("./repair.command-
|
|
33
|
-
workflow: async () => (await import("./workflow.command-
|
|
17
|
+
workspace: async () => (await import("./workspace.command-kah5jgg5.js")).WorkspaceCommand,
|
|
18
|
+
agent: async () => (await import("./agent.command-d2gfxfck.js")).AgentCommand,
|
|
19
|
+
application: async () => (await import("./application.command-xgphqs7k.js")).ApplicationCommand,
|
|
20
|
+
library: async () => (await import("./library.command-nbsky672.js")).LibraryCommand,
|
|
21
|
+
localRegistry: async () => (await import("./localRegistry.command-namg61k1.js")).LocalRegistryCommand,
|
|
22
|
+
package: async () => (await import("./package.command-axv0abmn.js")).PackageCommand,
|
|
23
|
+
module: async () => (await import("./module.command-29vqzrh8.js")).ModuleCommand,
|
|
24
|
+
page: async () => (await import("./page.command-vs9s3zrh.js")).PageCommand,
|
|
25
|
+
context: async () => (await import("./context.command-ez8a0zyz.js")).ContextCommand,
|
|
26
|
+
cloud: async () => (await import("./cloud.command-abgkk73f.js")).CloudCommand,
|
|
27
|
+
subspace: async () => (await import("./subspace.command-35a3t6vv.js")).SubspaceCommand,
|
|
28
|
+
guideline: async () => (await import("./guideline.command-xmqwx8zm.js")).GuidelineCommand,
|
|
29
|
+
scalar: async () => (await import("./scalar.command-6k1vhe9s.js")).ScalarCommand,
|
|
30
|
+
primitive: async () => (await import("./primitive.command-cbxmqbtc.js")).PrimitiveCommand,
|
|
31
|
+
quality: async () => (await import("./quality.command-gmbs7nws.js")).QualityCommand,
|
|
32
|
+
repair: async () => (await import("./repair.command-bqsjptsj.js")).RepairCommand,
|
|
33
|
+
workflow: async () => (await import("./workflow.command-nwpcdc8p.js")).WorkflowCommand
|
|
34
34
|
};
|
|
35
35
|
var commandModuleIds = Object.keys(commandModules);
|
|
36
36
|
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
Lib,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-mak3cd28.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2tv3fdx4.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import {
|
|
11
11
|
LibraryScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-259dsnz3.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
15
15
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mak3cd28.js";
|
|
8
8
|
import"./index-q0y2jq9j.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2tv3fdx4.js";
|
|
12
12
|
import"./index-6wwzs1bc.js";
|
|
13
13
|
import {
|
|
14
14
|
ApplicationScript
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
} from "./index-yecdrt9a.js";
|
|
16
|
+
import"./index-259dsnz3.js";
|
|
17
17
|
import"./index-hwkygn9s.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-kn1h7p1x.js";
|
|
19
19
|
import {
|
|
20
20
|
getNpmRegistryUrl,
|
|
21
21
|
CloudRunner
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-yw4xj7pa.js";
|
|
23
23
|
import"./index-kcxmv48c.js";
|
|
24
24
|
import {
|
|
25
25
|
PackageScript
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-ws5e0j51.js";
|
|
27
|
+
import"./index-j9yhg404.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|
|
30
30
|
import { mkdir, rm } from "fs/promises";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
Sys,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-mak3cd28.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2tv3fdx4.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import {
|
|
11
11
|
renderPrimitiveReport
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
} from "./index-gyd220p2.js";
|
|
13
|
+
import"./index-kn1h7p1x.js";
|
|
14
14
|
import {
|
|
15
15
|
ModuleScript
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-8pm30m73.js";
|
|
17
|
+
import"./index-pnqbkf5p.js";
|
|
18
18
|
import"./index-h7yw2z9n.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/cli/module/module.command.ts
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
Pkg,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-mak3cd28.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2tv3fdx4.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import"./index-kcxmv48c.js";
|
|
11
11
|
import {
|
|
12
12
|
PackageScript
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-ws5e0j51.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/package/package.command.ts
|
|
16
16
|
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.104",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@langchain/openai": "^1.4.6",
|
|
34
34
|
"@tailwindcss/node": "^4.3.0",
|
|
35
35
|
"@trapezedev/project": "^7.1.4",
|
|
36
|
-
"akanjs": "3.0.0-alpha.
|
|
36
|
+
"akanjs": "3.0.0-alpha.104",
|
|
37
37
|
"chalk": "^5.6.2",
|
|
38
38
|
"commander": "^14.0.3",
|
|
39
39
|
"dayjs": "^1.11.20",
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-mak3cd28.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2tv3fdx4.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import {
|
|
11
11
|
PageScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-pnqbkf5p.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/page/page.command.ts
|
|
15
15
|
class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import"./index-q0y2jq9j.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-2tv3fdx4.js";
|
|
8
8
|
import"./index-6wwzs1bc.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
11
|
+
} from "./index-gyd220p2.js";
|
|
12
|
+
import"./index-kn1h7p1x.js";
|
|
13
|
+
import"./index-8pm30m73.js";
|
|
14
|
+
import"./index-pnqbkf5p.js";
|
|
15
15
|
import"./index-h7yw2z9n.js";
|
|
16
16
|
import {
|
|
17
17
|
PrimitiveScript
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-4edzf1gr.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/cli/primitive/primitive.command.ts
|
|
21
21
|
import { Logger } from "akanjs/common";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mak3cd28.js";
|
|
8
8
|
import"./index-q0y2jq9j.js";
|
|
9
9
|
import {
|
|
10
10
|
rootAllowedFiles,
|
|
11
11
|
rootAllowedDirs,
|
|
12
12
|
isAllowedLibFacetRootFile
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-2tv3fdx4.js";
|
|
14
14
|
import"./index-6wwzs1bc.js";
|
|
15
15
|
import {
|
|
16
16
|
AbstractDoc
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-mak3cd28.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2tv3fdx4.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import"./index-by5gpp8x.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
import"./index-gyd220p2.js";
|
|
12
|
+
import"./index-ktb5njgy.js";
|
|
13
13
|
import {
|
|
14
14
|
RepairRunner
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-fz5q3gd7.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/repair/repair.script.ts
|
|
18
18
|
import { Logger } from "akanjs/common";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// pkgs/@akanjs/devkit/routeSourceValidator.ts
|
|
3
3
|
import { getRouteExports } from "akanjs/common";
|
|
4
4
|
import ts from "typescript";
|
|
5
|
+
var chainRoots = new Set(["page", "layout", "rootLayout"]);
|
|
5
6
|
|
|
6
7
|
class RouteSourceValidator {
|
|
7
8
|
static validateRouteSourceExports(source, filePath, kind, options = {}) {
|
|
@@ -62,7 +63,74 @@ class RouteSourceValidator {
|
|
|
62
63
|
if (exported.has("metadata") && exported.has("generateMetadata")) {
|
|
63
64
|
throw new Error(`[route-convention] metadata and generateMetadata cannot both be exported in ${filePath}`);
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
const chain = RouteSourceValidator.#readChain(sourceFile, filePath);
|
|
67
|
+
if (!chain)
|
|
68
|
+
return { devOnly: RouteSourceValidator.#readDevOnly(sourceFile, filePath) };
|
|
69
|
+
const named = [...exported].filter((name) => name !== "default");
|
|
70
|
+
if (named.length)
|
|
71
|
+
throw new Error(`[route-convention] ${filePath} exports ${named.join(", ")} beside its ${chain.kind}() chain \u2014 every route setting is a stage of the chain`);
|
|
72
|
+
if (kind === "page" && chain.kind !== "page")
|
|
73
|
+
throw new Error(`[route-convention] ${filePath} is a page file but exports ${chain.kind}()`);
|
|
74
|
+
if (kind === "layout" && chain.kind === "page")
|
|
75
|
+
throw new Error(`[route-convention] ${filePath} is a layout file but exports page()`);
|
|
76
|
+
if (options.pattern)
|
|
77
|
+
RouteSourceValidator.#assertChainParams(chain, options.pattern, filePath);
|
|
78
|
+
return {
|
|
79
|
+
devOnly: chain.devOnly,
|
|
80
|
+
chain: { kind: chain.kind, params: chain.params, ...chain.prompt ? { prompt: chain.prompt } : {} }
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
static #readChain(sourceFile, filePath) {
|
|
84
|
+
for (const statement of sourceFile.statements) {
|
|
85
|
+
if (!ts.isExportAssignment(statement) || statement.isExportEquals)
|
|
86
|
+
continue;
|
|
87
|
+
let node = RouteSourceValidator.#unwrapExpression(statement.expression);
|
|
88
|
+
const stages = [];
|
|
89
|
+
while (node && ts.isCallExpression(node)) {
|
|
90
|
+
const callee = node.expression;
|
|
91
|
+
if (ts.isPropertyAccessExpression(callee)) {
|
|
92
|
+
stages.unshift({ name: callee.name.text, args: node.arguments });
|
|
93
|
+
node = callee.expression;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (ts.isIdentifier(callee) && chainRoots.has(callee.text))
|
|
97
|
+
return RouteSourceValidator.#chainOf(callee.text, stages, filePath);
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
static #chainOf(kind, stages, filePath) {
|
|
105
|
+
const params = [];
|
|
106
|
+
let prompt;
|
|
107
|
+
let devOnly = false;
|
|
108
|
+
const literal = (stage) => {
|
|
109
|
+
const first = stage.args[0];
|
|
110
|
+
if (!first || !ts.isStringLiteralLike(first))
|
|
111
|
+
throw new Error(`[route-convention] .${stage.name}() takes a string literal first in ${filePath} \u2014 the build reads it without evaluating the module`);
|
|
112
|
+
return first.text;
|
|
113
|
+
};
|
|
114
|
+
for (const stage of stages) {
|
|
115
|
+
if (stage.name === "param")
|
|
116
|
+
params.push(literal(stage));
|
|
117
|
+
else if (stage.name === "prompt")
|
|
118
|
+
prompt = literal(stage);
|
|
119
|
+
else if (stage.name === "config")
|
|
120
|
+
devOnly = RouteSourceValidator.#devOnlyOf(RouteSourceValidator.#unwrapExpression(stage.args[0]), filePath);
|
|
121
|
+
}
|
|
122
|
+
return { kind, params, prompt, devOnly };
|
|
123
|
+
}
|
|
124
|
+
static #assertChainParams(chain, pattern, filePath) {
|
|
125
|
+
const inPath = pattern.split("/").filter((part) => part.startsWith(":")).map((part) => part.slice(1)).filter((name) => name !== "lang");
|
|
126
|
+
if (chain.params.includes("lang"))
|
|
127
|
+
throw new Error(`[route-convention] ${filePath} declares .param("lang"), which every route receives undeclared`);
|
|
128
|
+
const unknown = chain.params.find((name) => !inPath.includes(name));
|
|
129
|
+
if (unknown)
|
|
130
|
+
throw new Error(`[route-convention] ${filePath} declares .param("${unknown}") but no [${unknown}] segment is in its path`);
|
|
131
|
+
const undeclared = inPath.find((name) => !chain.params.includes(name));
|
|
132
|
+
if (chain.kind === "page" && undeclared)
|
|
133
|
+
throw new Error(`[route-convention] ${filePath} sits under [${undeclared}] but declares no .param("${undeclared}") \u2014 a page reads only what it declares`);
|
|
66
134
|
}
|
|
67
135
|
static #readDevOnly(sourceFile, filePath) {
|
|
68
136
|
for (const statement of sourceFile.statements) {
|
|
@@ -75,26 +143,31 @@ class RouteSourceValidator {
|
|
|
75
143
|
if (!ts.isIdentifier(declaration.name) || declaration.name.text !== "pageConfig")
|
|
76
144
|
continue;
|
|
77
145
|
const initializer = RouteSourceValidator.#unwrapExpression(declaration.initializer);
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
for (const property of initializer.properties) {
|
|
81
|
-
if (!ts.isPropertyAssignment(property))
|
|
82
|
-
continue;
|
|
83
|
-
const name = property.name;
|
|
84
|
-
const key = ts.isIdentifier(name) ? name.text : ts.isStringLiteral(name) ? name.text : null;
|
|
85
|
-
if (key !== "devOnly")
|
|
86
|
-
continue;
|
|
87
|
-
const value = RouteSourceValidator.#unwrapExpression(property.initializer);
|
|
88
|
-
if (value?.kind === ts.SyntaxKind.TrueKeyword)
|
|
89
|
-
return true;
|
|
90
|
-
if (value?.kind === ts.SyntaxKind.FalseKeyword)
|
|
91
|
-
return false;
|
|
92
|
-
throw new Error(`[route-convention] pageConfig.devOnly must be a literal true or false in ${filePath} \u2014 the build reads it without evaluating the module`);
|
|
93
|
-
}
|
|
146
|
+
if (initializer && ts.isObjectLiteralExpression(initializer))
|
|
147
|
+
return RouteSourceValidator.#devOnlyOf(initializer, filePath);
|
|
94
148
|
}
|
|
95
149
|
}
|
|
96
150
|
return false;
|
|
97
151
|
}
|
|
152
|
+
static #devOnlyOf(config, filePath) {
|
|
153
|
+
if (!config || !ts.isObjectLiteralExpression(config))
|
|
154
|
+
return false;
|
|
155
|
+
for (const property of config.properties) {
|
|
156
|
+
if (!ts.isPropertyAssignment(property))
|
|
157
|
+
continue;
|
|
158
|
+
const name = property.name;
|
|
159
|
+
const key = ts.isIdentifier(name) ? name.text : ts.isStringLiteral(name) ? name.text : null;
|
|
160
|
+
if (key !== "devOnly")
|
|
161
|
+
continue;
|
|
162
|
+
const value = RouteSourceValidator.#unwrapExpression(property.initializer);
|
|
163
|
+
if (value?.kind === ts.SyntaxKind.TrueKeyword)
|
|
164
|
+
return true;
|
|
165
|
+
if (value?.kind === ts.SyntaxKind.FalseKeyword)
|
|
166
|
+
return false;
|
|
167
|
+
throw new Error(`[route-convention] devOnly must be a literal true or false in ${filePath} \u2014 the build reads it without evaluating the module`);
|
|
168
|
+
}
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
98
171
|
static #unwrapExpression(expression) {
|
|
99
172
|
let current = expression;
|
|
100
173
|
while (current && (ts.isAsExpression(current) || ts.isSatisfiesExpression(current) || ts.isParenthesizedExpression(current))) {
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Sys,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mak3cd28.js";
|
|
6
6
|
import"./index-q0y2jq9j.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-2tv3fdx4.js";
|
|
8
8
|
import"./index-6wwzs1bc.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-gyd220p2.js";
|
|
12
|
+
import"./index-kn1h7p1x.js";
|
|
13
13
|
import"./index-h7yw2z9n.js";
|
|
14
14
|
import {
|
|
15
15
|
ScalarScript
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-rwg2aa4f.js";
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/cli/scalar/scalar.command.ts
|
|
19
19
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mak3cd28.js";
|
|
8
8
|
import {
|
|
9
9
|
FileSys
|
|
10
10
|
} from "./index-q0y2jq9j.js";
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
Executor,
|
|
13
13
|
WorkspaceExecutor,
|
|
14
14
|
AppExecutor
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-2tv3fdx4.js";
|
|
16
16
|
import"./index-6wwzs1bc.js";
|
|
17
17
|
import {
|
|
18
18
|
SlicePlanner
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-j9yhg404.js";
|
|
20
20
|
import {
|
|
21
21
|
LibSource
|
|
22
22
|
} from "./index-3d9y066c.js";
|