@akanjs/devkit 3.3.0-rc.2 → 3.3.0-rc.20
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/CHANGELOG.md +284 -20
- package/DEV_RUNTIME_KNOBS.md +1 -1
- package/README.ko.md +3 -2
- package/README.md +3 -3
- package/akanApp/akanApp.host.test.ts +1 -1
- package/akanConfig/akanConfig.test.ts +57 -8
- package/akanConfig/akanConfig.ts +16 -69
- package/akanConfig/dockerImage.ts +17 -0
- package/akanConfig/nativeKeys.ts +52 -0
- package/app/applicationBuildRunner.test.ts +321 -1
- package/app/applicationBuildRunner.ts +90 -3
- package/artifact/implicitRootLayoutRender.test.tsx +4 -1
- package/codeAgent/agent/CodeAgent.ts +36 -16
- package/codeAgent/agent/CodeAgentAllowed.ts +35 -0
- package/codeAgent/agent/CodeAgentCommandLine.ts +372 -0
- package/codeAgent/agent/CodeAgentGate.ts +23 -4
- package/codeAgent/agent/CodeAgentRpcHost.ts +1 -1
- package/codeAgent/agent/codeAgent.test.ts +62 -0
- package/codeAgent/agent/codeAgentCommandLine.test.ts +212 -0
- package/codeAgent/agent/codeAgentContract.test.ts +117 -5
- package/codeAgent/skills/akan-agent/SKILL.md +8 -1
- package/codeAgent/skills/akan-code/SKILL.md +38 -3
- package/codeAgent/skills/akan-err/SKILL.md +11 -2
- package/codeAgent/skills/akan-page/SKILL.md +21 -26
- package/codeAgent/skills/akan-runtime/SKILL.md +41 -16
- package/codeAgent/skills/akan-service/SKILL.md +2 -2
- package/docs/apiReference.test.ts +14 -0
- package/docs/apiReference.ts +21 -3
- package/docs/declarationReader.ts +28 -1
- package/executors/appExecutor.ts +16 -7
- package/executors/workspaceExecutor.ts +7 -4
- package/frontendBuild/buildRouteClient.test.ts +2 -7
- package/frontendBuild/clientEntryDiscovery.test.ts +35 -0
- package/frontendBuild/clientEntryDiscovery.ts +16 -3
- package/frontendBuild/cssCompiler.test.ts +112 -0
- package/frontendBuild/cssCompiler.ts +41 -21
- package/frontendBuild/devBarrelImports.test.ts +30 -0
- package/frontendBuild/devBarrelImports.ts +2 -2
- package/frontendBuild/pagesBundleBuilder.ts +3 -1
- package/frontendBuild/plainStylesheet.test.ts +155 -0
- package/frontendBuild/plainStylesheet.ts +197 -0
- package/frontendBuild/rscServerRendererGuard.test.ts +60 -0
- package/frontendBuild/rscServerRendererGuard.ts +68 -0
- package/guideline/agentAssets.test.ts +10 -0
- package/guideline/agentAssets.ts +52 -11
- package/incrementalBuilder/buildBatch.proc.ts +9 -9
- package/incrementalBuilder/buildBatchProtocol.ts +1 -1
- package/incrementalBuilder/builderBoot.ts +5 -5
- package/incrementalBuilder/builderGraphPayloads.ts +4 -4
- package/incrementalBuilder/builderLanes.ts +2 -2
- package/incrementalBuilder/builderWatch.ts +8 -8
- package/incrementalBuilder/csrRegistry.ts +4 -4
- package/incrementalBuilder/incrementalBuilder.proc.ts +8 -8
- package/incrementalBuilder/ssrRegistry.ts +6 -6
- package/index.ts +1 -1
- package/integration/renderAdmissionSoak.test.ts +99 -0
- package/integration/renderAdmissionSoak.ts +609 -0
- package/lint/__fixtures__/no-arbitrary-color/every-color-function/bad.tsx +11 -0
- package/lint/__fixtures__/no-arbitrary-color/every-color-function/good.tsx +2 -0
- package/lint/__fixtures__/no-daisyui-legacy-class/every-class/bad.tsx +34 -0
- package/lint/__fixtures__/no-daisyui-legacy-class/every-class/good.tsx +2 -0
- package/lint/__fixtures__/no-inline-color/every-color-function/bad.tsx +10 -0
- package/lint/__fixtures__/no-inline-color/every-color-function/good.tsx +2 -0
- package/lint/__fixtures__/no-raw-palette-class/every-palette/bad.tsx +22 -0
- package/lint/__fixtures__/no-raw-palette-class/every-palette/good.tsx +2 -0
- package/lint/biomeCheck.test.ts +145 -0
- package/lint/biomeCheck.ts +131 -0
- package/lint/no-arbitrary-color.grit +5 -0
- package/lint/no-conditional-st-hook.grit +5 -1
- package/lint/no-daisyui-legacy-class.grit +8 -0
- package/lint/no-document-cookie.grit +3 -0
- package/lint/no-inline-color.grit +10 -2
- package/lint/no-oversized-list-limit.grit +2 -0
- package/lint/no-raw-palette-class.grit +7 -0
- package/lint/no-unpublished-form-setter.grit +2 -0
- package/lint/no-web-only-api-outside-webkit.grit +5 -0
- package/lint/no-web-storage.grit +3 -0
- package/lint/withheldEnvFile.ts +17 -0
- package/mobile/nativeApp.test.ts +7 -5
- package/mobile/nativeApp.ts +2 -2
- package/mobile/nativeConfig.test.ts +117 -1
- package/mobile/nativeConfig.ts +66 -22
- package/mobile/serverBundleSecrets.ts +43 -0
- package/package.json +14 -169
- package/packageExports.test.ts +38 -24
- package/test/secretEnvFixture.ts +134 -0
- package/transforms/barrelAnalyzer.ts +2 -2
- package/transforms/secretEnvDeclaration.test.ts +208 -0
- package/transforms/secretEnvDeclaration.ts +213 -0
- package/transforms/secretEnvFile.test.ts +117 -0
- package/transforms/secretEnvFile.ts +113 -0
- package/transforms/secretEnvName.test.ts +54 -0
- package/transforms/secretEnvName.ts +29 -0
- package/transforms/secretEnvSource.test.ts +148 -0
- package/transforms/secretEnvSource.ts +166 -0
- package/transforms/serverEnvEvaluationError.ts +11 -0
- package/transforms/serverEnvPlugin.test.ts +2 -1
- package/transforms/serverEnvPlugin.ts +13 -0
- package/transforms/serverEnvProfile.test.ts +115 -2
- package/transforms/serverEnvProfile.ts +117 -40
- package/transforms/serverEnvSecrets.test.ts +292 -0
- package/transforms/transforms.test.ts +3 -3
- package/tunnel/createTunnel.test.ts +29 -8
- package/tunnel/createTunnel.ts +18 -11
- package/typecheck/projectTypecheck.test.ts +29 -0
- package/typecheck/typeChecker.test.ts +49 -0
- package/typecheck/typeChecker.ts +9 -7
- package/typecheck/withheldDiagnostics.ts +41 -0
- package/util/fileEditor.ts +1 -0
- package/util/selectModel.ts +1 -0
- package/workspace/getRelatedCnsts.ts +7 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { PlainStylesheet, type StylesheetLoader } from "./plainStylesheet";
|
|
4
|
+
|
|
5
|
+
const loaderOf = (files: Record<string, string>): StylesheetLoader => {
|
|
6
|
+
return async (id, fromBase) => {
|
|
7
|
+
const filePath = path.resolve(fromBase, id);
|
|
8
|
+
const content = files[filePath];
|
|
9
|
+
if (content === undefined) throw new Error(`no stylesheet at ${filePath}`);
|
|
10
|
+
return { path: filePath, base: path.dirname(filePath), content };
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const refuseLoad: StylesheetLoader = async (id) => {
|
|
14
|
+
throw new Error(`loaded ${id}`);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe("PlainStylesheet.scan", () => {
|
|
18
|
+
test("finds nothing Tailwind in plain CSS", () => {
|
|
19
|
+
const css = [
|
|
20
|
+
'@charset "utf-8";',
|
|
21
|
+
"@layer reset, app;",
|
|
22
|
+
":root { --brand: #111; }",
|
|
23
|
+
"@media (prefers-reduced-motion: reduce) { .a { animation: none; } }",
|
|
24
|
+
"@supports (display: grid) { .grid { display: grid; } }",
|
|
25
|
+
"@container card (min-width: 20rem) { .b { color: color-mix(in oklab, var(--brand) 50%, transparent); } }",
|
|
26
|
+
"@font-face { font-family: X; src: url(data:font/woff2;base64,AAAA) format('woff2'); }",
|
|
27
|
+
"@keyframes spin { to { transform: rotate(1turn); } }",
|
|
28
|
+
'.c::before { content: "@apply theme(x)"; }',
|
|
29
|
+
"/* @theme { --color-x: red; } and --spacing(4) */",
|
|
30
|
+
".icon { background: url(icon@2x.png); }",
|
|
31
|
+
].join("\n");
|
|
32
|
+
expect(PlainStylesheet.scan(css)).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test.each([
|
|
36
|
+
"@tailwind utilities;",
|
|
37
|
+
"@TAILWIND utilities;",
|
|
38
|
+
".a { @apply flex; }",
|
|
39
|
+
'@plugin "tailwind-scrollbar";',
|
|
40
|
+
'@config "./tailwind.config.js";',
|
|
41
|
+
"@theme { --color-brand: red; }",
|
|
42
|
+
"@theme inline { --color-brand: var(--brand); }",
|
|
43
|
+
"@utility tab-4 { tab-size: 4; }",
|
|
44
|
+
".a { @variant hover { color: red; } }",
|
|
45
|
+
"@custom-variant dark (&:where([data-theme=dark] *));",
|
|
46
|
+
"@custom-variant any-hover { @media (any-hover: hover) { &:hover { @slot; } } }",
|
|
47
|
+
'@source "../node_modules/x";',
|
|
48
|
+
'@source not "./legacy";',
|
|
49
|
+
'@source inline("underline");',
|
|
50
|
+
'@reference "./app.css";',
|
|
51
|
+
".a { color: theme(colors.red.500); }",
|
|
52
|
+
".a { color: --theme(--color-red-500); }",
|
|
53
|
+
".a { color: --alpha(var(--brand) / 50%); }",
|
|
54
|
+
".a { margin: --spacing(4); }",
|
|
55
|
+
"@media (width >= theme(--breakpoint-md)) { .a { color: red; } }",
|
|
56
|
+
"@media source(none) { .a { color: red; } }",
|
|
57
|
+
'@import "tailwindcss";',
|
|
58
|
+
"@import 'tailwindcss';",
|
|
59
|
+
'@import "tailwindcss/theme.css" layer(theme);',
|
|
60
|
+
'@import "tailwindcss/utilities";',
|
|
61
|
+
'@import "./theme.css" theme(reference);',
|
|
62
|
+
'@import "./app.css" source(none);',
|
|
63
|
+
'@import "./app.css" prefix(tw);',
|
|
64
|
+
'@import "./app.css" important;',
|
|
65
|
+
'@import "./app.css" reference;',
|
|
66
|
+
])("needs Tailwind: %s", (css) => {
|
|
67
|
+
expect(PlainStylesheet.scan(css)).toBeNull();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test("reads the conditions of an import Tailwind would inline", () => {
|
|
71
|
+
const css = [
|
|
72
|
+
'@import "./a.css";',
|
|
73
|
+
"@import './b.css' layer;",
|
|
74
|
+
'@import "./c.css" layer(base) supports(display: grid) screen and (min-width: 40rem);',
|
|
75
|
+
'@import "./d.css" supports((display: flex) and (gap: 1rem)) print;',
|
|
76
|
+
].join("\n");
|
|
77
|
+
expect(
|
|
78
|
+
PlainStylesheet.scan(css)?.map(({ uri, layer, supports, media }) => ({ uri, layer, supports, media })),
|
|
79
|
+
).toEqual([
|
|
80
|
+
{ uri: "./a.css", layer: null, supports: null, media: null },
|
|
81
|
+
{ uri: "./b.css", layer: "", supports: null, media: null },
|
|
82
|
+
{ uri: "./c.css", layer: "base", supports: "display: grid", media: "screen and (min-width: 40rem)" },
|
|
83
|
+
{ uri: "./d.css", layer: null, supports: "(display: flex) and (gap: 1rem)", media: "print" },
|
|
84
|
+
]);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("leaves url(), data: and remote imports where they stand, as Tailwind does", () => {
|
|
88
|
+
const css = [
|
|
89
|
+
'@import url("./a.css");',
|
|
90
|
+
"@import url(./b.css) screen;",
|
|
91
|
+
'@import "https://fonts.example.com/x.css";',
|
|
92
|
+
'@import "data:text/css,.a{color:red}";',
|
|
93
|
+
].join("\n");
|
|
94
|
+
expect(PlainStylesheet.scan(css)).toEqual([]);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("defers to Tailwind on CSS it cannot read with certainty", () => {
|
|
98
|
+
expect(PlainStylesheet.scan("/* never closed")).toBeNull();
|
|
99
|
+
expect(PlainStylesheet.scan(".a { color: red;")).toBeNull();
|
|
100
|
+
expect(PlainStylesheet.scan(".a { color: red; } }")).toBeNull();
|
|
101
|
+
expect(PlainStylesheet.scan('@import "./a.css" layer(x) layer(y);')).toBeNull();
|
|
102
|
+
expect(PlainStylesheet.scan('@import "./a.css" supports(display: grid;')).toBeNull();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe("PlainStylesheet.bundle", () => {
|
|
107
|
+
test("returns a stylesheet without imports byte for byte", async () => {
|
|
108
|
+
const css = "/* brand */\n:root {\n --brand: #111;\n}\n.a { color: var(--brand) }";
|
|
109
|
+
expect(await PlainStylesheet.bundle(css, "/app", refuseLoad)).toBe(css);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("inlines imports, nested ones too, wrapped in their layer, supports and media conditions", async () => {
|
|
113
|
+
const load = loaderOf({
|
|
114
|
+
"/app/a.css": '@import "./nested/b.css";\n.a { color: red; }\n',
|
|
115
|
+
"/app/nested/b.css": ".b { color: blue; }",
|
|
116
|
+
"/app/c.css": ".c { color: green; }",
|
|
117
|
+
});
|
|
118
|
+
const css =
|
|
119
|
+
'@import "./a.css";\n@import "./c.css" layer(base) supports(display: grid) print;\n.app { margin: 0; }\n';
|
|
120
|
+
|
|
121
|
+
expect(await PlainStylesheet.bundle(css, "/app", load)).toBe(
|
|
122
|
+
[
|
|
123
|
+
".b { color: blue; }",
|
|
124
|
+
".a { color: red; }",
|
|
125
|
+
"",
|
|
126
|
+
"@supports (display: grid) {",
|
|
127
|
+
"@media print {",
|
|
128
|
+
"@layer base {",
|
|
129
|
+
".c { color: green; }",
|
|
130
|
+
"}",
|
|
131
|
+
"}",
|
|
132
|
+
"}",
|
|
133
|
+
".app { margin: 0; }",
|
|
134
|
+
"",
|
|
135
|
+
].join("\n"),
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("needs Tailwind when only an imported stylesheet uses it", async () => {
|
|
140
|
+
const load = loaderOf({
|
|
141
|
+
"/app/a.css": '@import "./b.css";\n',
|
|
142
|
+
"/app/b.css": ".b { color: red; }\n@custom-variant dark (&:where(.dark *));\n",
|
|
143
|
+
});
|
|
144
|
+
expect(await PlainStylesheet.bundle('@import "./a.css";\n.app { margin: 0; }\n', "/app", load)).toBeNull();
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test('decides on `@import "tailwindcss"` without resolving it', async () => {
|
|
148
|
+
expect(await PlainStylesheet.bundle('@import "tailwindcss";\n.a { color: red; }\n', "/app", refuseLoad)).toBeNull();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
test("hands an import cycle to Tailwind instead of following it forever", async () => {
|
|
152
|
+
const load = loaderOf({ "/app/a.css": '@import "./b.css";', "/app/b.css": '@import "./a.css";' });
|
|
153
|
+
expect(await PlainStylesheet.bundle('@import "./a.css";', "/app", load)).toBeNull();
|
|
154
|
+
});
|
|
155
|
+
});
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export interface LoadedStylesheet {
|
|
2
|
+
path: string;
|
|
3
|
+
base: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type StylesheetLoader = (id: string, fromBase: string) => Promise<LoadedStylesheet>;
|
|
8
|
+
|
|
9
|
+
interface ImportConditions {
|
|
10
|
+
layer: string | null;
|
|
11
|
+
supports: string | null;
|
|
12
|
+
media: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PlainImport extends ImportConditions {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
uri: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Every at-rule Tailwind v4's `compile()` acts on (`parseCss`, `substituteAtImports`, `registerPlugins`, `@apply`).
|
|
22
|
+
const TAILWIND_AT_RULES = new Set([
|
|
23
|
+
"@tailwind",
|
|
24
|
+
"@apply",
|
|
25
|
+
"@plugin",
|
|
26
|
+
"@config",
|
|
27
|
+
"@theme",
|
|
28
|
+
"@utility",
|
|
29
|
+
"@variant",
|
|
30
|
+
"@custom-variant",
|
|
31
|
+
"@slot",
|
|
32
|
+
"@source",
|
|
33
|
+
"@reference",
|
|
34
|
+
]);
|
|
35
|
+
// Tailwind's own test (`theme\(` also covers `--theme(`), run over declaration values and media/supports params.
|
|
36
|
+
const TAILWIND_FUNCTION_RE = /(?:--alpha|--spacing|theme)\(/;
|
|
37
|
+
// `@import "x" theme(…)`, `source(…)`, `prefix(…)`, `important` and `reference` become Tailwind-only `@media` params.
|
|
38
|
+
const TAILWIND_CONDITION_RE = /\b(?:source|prefix|theme)\(|(?:^|\s)(?:important|reference)(?=\s|$)/i;
|
|
39
|
+
const TAILWIND_PACKAGE_RE = /^tailwindcss(?:\/|$)/;
|
|
40
|
+
const REMOTE_URI_RE = /^(?:data:|https?:\/\/)/i;
|
|
41
|
+
const COMMENT_RE = /\/\*[\s\S]*?\*\//g;
|
|
42
|
+
const AT_KEYWORD_RE = /@[\w-]+/y;
|
|
43
|
+
const QUOTED_IMPORT_RE = /^\s*(["'])((?:\\[\s\S]|(?!\1)[^\\\n])*)\1([\s\S]*)$/;
|
|
44
|
+
const LAYER_RE = /^layer(?:\(\s*([^()]*?)\s*\))?(?![\w(-])/i;
|
|
45
|
+
const MAX_IMPORT_DEPTH = 100;
|
|
46
|
+
|
|
47
|
+
interface OpenAtRule {
|
|
48
|
+
name: string;
|
|
49
|
+
start: number;
|
|
50
|
+
preludeStart: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type AtRuleVerdict = (ImportConditions & { uri: string }) | "tailwind" | "plain";
|
|
54
|
+
|
|
55
|
+
export class PlainStylesheet {
|
|
56
|
+
static async bundle(css: string, base: string, load: StylesheetLoader, depth = 0): Promise<string | null> {
|
|
57
|
+
//? Past Tailwind's own depth limit (an import cycle), `compile()` runs instead and reports it.
|
|
58
|
+
if (depth > MAX_IMPORT_DEPTH) return null;
|
|
59
|
+
const imports = PlainStylesheet.scan(css);
|
|
60
|
+
if (!imports) return null;
|
|
61
|
+
const parts: string[] = [];
|
|
62
|
+
let cursor = 0;
|
|
63
|
+
for (const rule of imports) {
|
|
64
|
+
const loaded = await load(rule.uri, base);
|
|
65
|
+
const inner = await PlainStylesheet.bundle(loaded.content, loaded.base, load, depth + 1);
|
|
66
|
+
if (inner === null) return null;
|
|
67
|
+
parts.push(css.slice(cursor, rule.start), PlainStylesheet.#wrap(inner, rule));
|
|
68
|
+
cursor = rule.end;
|
|
69
|
+
}
|
|
70
|
+
parts.push(css.slice(cursor));
|
|
71
|
+
return parts.join("");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static scan(css: string): PlainImport[] | null {
|
|
75
|
+
const imports: PlainImport[] = [];
|
|
76
|
+
const code: string[] = [];
|
|
77
|
+
let segmentStart = 0;
|
|
78
|
+
let parenDepth = 0;
|
|
79
|
+
let braceDepth = 0;
|
|
80
|
+
let atRule: OpenAtRule | null = null;
|
|
81
|
+
let idx = 0;
|
|
82
|
+
while (idx < css.length) {
|
|
83
|
+
const char = css[idx];
|
|
84
|
+
if (char === "/" && css[idx + 1] === "*") {
|
|
85
|
+
const end = css.indexOf("*/", idx + 2);
|
|
86
|
+
if (end === -1) return null;
|
|
87
|
+
code.push(css.slice(segmentStart, idx));
|
|
88
|
+
idx = segmentStart = end + 2;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (char === "\\") {
|
|
92
|
+
idx += 2;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (char === '"' || char === "'") {
|
|
96
|
+
code.push(css.slice(segmentStart, idx));
|
|
97
|
+
idx = segmentStart = PlainStylesheet.#skipString(css, idx);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (char === "@" && !atRule && parenDepth === 0) {
|
|
101
|
+
AT_KEYWORD_RE.lastIndex = idx;
|
|
102
|
+
const keyword = AT_KEYWORD_RE.exec(css);
|
|
103
|
+
if (keyword) {
|
|
104
|
+
const name = keyword[0].toLowerCase();
|
|
105
|
+
if (TAILWIND_AT_RULES.has(name)) return null;
|
|
106
|
+
atRule = { name, start: idx, preludeStart: idx + keyword[0].length };
|
|
107
|
+
idx += keyword[0].length;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (char === "(") parenDepth += 1;
|
|
112
|
+
else if (char === ")") parenDepth = Math.max(0, parenDepth - 1);
|
|
113
|
+
else if (parenDepth === 0 && (char === ";" || char === "{" || char === "}")) {
|
|
114
|
+
if (atRule && !PlainStylesheet.#closeAtRule(css, atRule, idx, char, imports)) return null;
|
|
115
|
+
atRule = null;
|
|
116
|
+
braceDepth += char === "{" ? 1 : char === "}" ? -1 : 0;
|
|
117
|
+
if (braceDepth < 0) return null;
|
|
118
|
+
}
|
|
119
|
+
idx += 1;
|
|
120
|
+
}
|
|
121
|
+
if (atRule && !PlainStylesheet.#closeAtRule(css, atRule, css.length, "", imports)) return null;
|
|
122
|
+
if (braceDepth !== 0 || parenDepth !== 0) return null;
|
|
123
|
+
code.push(css.slice(segmentStart));
|
|
124
|
+
return TAILWIND_FUNCTION_RE.test(code.join(" ")) ? null : imports;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static #closeAtRule(css: string, atRule: OpenAtRule, end: number, terminator: string, imports: PlainImport[]) {
|
|
128
|
+
const prelude = css.slice(atRule.preludeStart, end).replace(COMMENT_RE, " ");
|
|
129
|
+
const verdict = PlainStylesheet.#readAtRule(atRule.name, prelude, terminator === "{");
|
|
130
|
+
if (verdict === "tailwind") return false;
|
|
131
|
+
if (verdict !== "plain") imports.push({ ...verdict, start: atRule.start, end: terminator === ";" ? end + 1 : end });
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static #readAtRule(name: string, prelude: string, opensBlock: boolean): AtRuleVerdict {
|
|
136
|
+
if (name === "@media") return TAILWIND_CONDITION_RE.test(prelude) ? "tailwind" : "plain";
|
|
137
|
+
if (name !== "@import") return "plain";
|
|
138
|
+
const match = QUOTED_IMPORT_RE.exec(prelude);
|
|
139
|
+
//? Tailwind leaves an `@import url(…)` where it stands, so this does too.
|
|
140
|
+
if (!match) return "plain";
|
|
141
|
+
const [, , uri = "", rest = ""] = match;
|
|
142
|
+
if (TAILWIND_PACKAGE_RE.test(uri) || TAILWIND_CONDITION_RE.test(rest) || opensBlock) return "tailwind";
|
|
143
|
+
if (REMOTE_URI_RE.test(uri)) return "plain";
|
|
144
|
+
const conditions = PlainStylesheet.#parseConditions(rest.trim());
|
|
145
|
+
return conditions ? { uri, ...conditions } : "tailwind";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
static #parseConditions(text: string): ImportConditions | null {
|
|
149
|
+
let rest = text;
|
|
150
|
+
let layer: string | null = null;
|
|
151
|
+
let supports: string | null = null;
|
|
152
|
+
const layerMatch = LAYER_RE.exec(rest);
|
|
153
|
+
if (layerMatch) {
|
|
154
|
+
layer = layerMatch[1] ?? "";
|
|
155
|
+
rest = rest.slice(layerMatch[0].length).trim();
|
|
156
|
+
}
|
|
157
|
+
if (/^supports\(/i.test(rest)) {
|
|
158
|
+
const close = PlainStylesheet.#closingParen(rest, "supports".length);
|
|
159
|
+
if (close === -1) return null;
|
|
160
|
+
supports = rest.slice("supports(".length, close).trim();
|
|
161
|
+
rest = rest.slice(close + 1).trim();
|
|
162
|
+
}
|
|
163
|
+
if (/["']|\burl\(|\blayer\b|\bsupports\(/i.test(rest)) return null;
|
|
164
|
+
return { layer, supports, media: rest || null };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static #closingParen(text: string, open: number): number {
|
|
168
|
+
let depth = 0;
|
|
169
|
+
for (let idx = open; idx < text.length; idx++) {
|
|
170
|
+
if (text[idx] === "(") depth += 1;
|
|
171
|
+
else if (text[idx] === ")" && --depth === 0) return idx;
|
|
172
|
+
}
|
|
173
|
+
return -1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static #wrap(css: string, { layer, media, supports }: PlainImport): string {
|
|
177
|
+
let wrapped = css;
|
|
178
|
+
if (layer !== null) wrapped = `@layer${layer ? ` ${layer}` : ""} {\n${wrapped}\n}`;
|
|
179
|
+
if (media !== null) wrapped = `@media ${media} {\n${wrapped}\n}`;
|
|
180
|
+
if (supports !== null)
|
|
181
|
+
wrapped = `@supports ${supports.startsWith("(") ? supports : `(${supports})`} {\n${wrapped}\n}`;
|
|
182
|
+
return wrapped;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
static #skipString(css: string, start: number): number {
|
|
186
|
+
const quote = css[start];
|
|
187
|
+
let idx = start + 1;
|
|
188
|
+
while (idx < css.length) {
|
|
189
|
+
const char = css[idx];
|
|
190
|
+
if (char === "\\") idx += 2;
|
|
191
|
+
else if (char === quote) return idx + 1;
|
|
192
|
+
else if (char === "\n") return idx;
|
|
193
|
+
else idx += 1;
|
|
194
|
+
}
|
|
195
|
+
return css.length;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { RscServerRendererGuard } from "./rscServerRendererGuard";
|
|
6
|
+
|
|
7
|
+
let root = "";
|
|
8
|
+
|
|
9
|
+
const files = {
|
|
10
|
+
"renderer.ts": `import { renderToReadableStream } from "react-dom/server.edge";\nexport const render = () => renderToReadableStream;\n`,
|
|
11
|
+
"server.ts": `import { render } from "./renderer";\nexport const boot = () => render;\nexport const migrations = ["m1"];\n`,
|
|
12
|
+
"service.ts": `export const report = async () => (await import("./server")).migrations;\n`,
|
|
13
|
+
"dynamicPage.ts": `import { report } from "./service";\nexport const page = () => report;\n`,
|
|
14
|
+
"lazyRenderer.ts": `export const render = async () => (await import("react-dom/server.browser")).renderToReadableStream;\n`,
|
|
15
|
+
"lazyPage.ts": `import { render } from "./lazyRenderer";\nexport const page = () => render;\n`,
|
|
16
|
+
"plainPage.ts": `export const page = () => "plain";\n`,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const metafileOf = async (entry: string) => {
|
|
20
|
+
const result = await Bun.build({
|
|
21
|
+
entrypoints: [path.join(root, entry)],
|
|
22
|
+
outdir: path.join(root, "out", entry),
|
|
23
|
+
target: "bun",
|
|
24
|
+
format: "esm",
|
|
25
|
+
metafile: true,
|
|
26
|
+
external: ["react-dom/*"],
|
|
27
|
+
});
|
|
28
|
+
expect(result.success).toBe(true);
|
|
29
|
+
return result.metafile;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
beforeAll(async () => {
|
|
33
|
+
root = await mkdtemp(path.join(tmpdir(), "rsc-guard-"));
|
|
34
|
+
for (const [file, source] of Object.entries(files)) await writeFile(path.join(root, file), source);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
afterAll(async () => {
|
|
38
|
+
await rm(root, { recursive: true, force: true });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("RscServerRendererGuard", () => {
|
|
42
|
+
test("names the chain from the page through the dynamic import of the server entry to the renderer", async () => {
|
|
43
|
+
const assertion = (async () => RscServerRendererGuard.assert(await metafileOf("dynamicPage.ts"), root))();
|
|
44
|
+
|
|
45
|
+
await expect(assertion).rejects.toThrow(
|
|
46
|
+
[
|
|
47
|
+
"where that import throws. It is reached through:",
|
|
48
|
+
" dynamicPage.ts",
|
|
49
|
+
" → service.ts",
|
|
50
|
+
" → import() server.ts",
|
|
51
|
+
" → renderer.ts",
|
|
52
|
+
].join("\n"),
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("passes a page whose renderer import waits inside a function, and one that reaches no renderer", async () => {
|
|
57
|
+
for (const entry of ["lazyPage.ts", "plainPage.ts"])
|
|
58
|
+
expect(RscServerRendererGuard.offenders((await metafileOf(entry)) as Bun.BuildMetafile)).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
interface ImportEdge {
|
|
5
|
+
from: string;
|
|
6
|
+
dynamic: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//? Every `react-dom/server` entry resolves to `server.react-server.js` under the react-server condition, which throws.
|
|
10
|
+
const SERVER_RENDERER_RE = /^react-dom\/server(?:\.\w+)?$/;
|
|
11
|
+
|
|
12
|
+
export class RscServerRendererGuard {
|
|
13
|
+
//? Bun keeps an external `import` after tree-shaking drops its bindings, and hoists one out of a lazily wrapped module.
|
|
14
|
+
static offenders(metafile: Bun.BuildMetafile): { input: string; specifier: string }[] {
|
|
15
|
+
const offenders: { input: string; specifier: string }[] = [];
|
|
16
|
+
const included = new Set(
|
|
17
|
+
Object.values(metafile.outputs).flatMap((output) =>
|
|
18
|
+
Object.entries(output.inputs)
|
|
19
|
+
.filter(([, { bytesInOutput }]) => bytesInOutput > 0)
|
|
20
|
+
.map(([input]) => input),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
for (const input of included)
|
|
24
|
+
for (const edge of metafile.inputs[input]?.imports ?? [])
|
|
25
|
+
if (edge.external && edge.kind === "import-statement" && SERVER_RENDERER_RE.test(edge.path))
|
|
26
|
+
offenders.push({ input, specifier: edge.path });
|
|
27
|
+
return offenders;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static chain(metafile: Bun.BuildMetafile, target: string): { input: string; dynamic: boolean }[] {
|
|
31
|
+
const entries = Object.values(metafile.outputs).flatMap((output) => (output.entryPoint ? [output.entryPoint] : []));
|
|
32
|
+
const reached = new Map<string, ImportEdge | null>(entries.map((entry) => [entry, null]));
|
|
33
|
+
const queue = [...entries];
|
|
34
|
+
for (let input = queue.shift(); input !== undefined && !reached.has(target); input = queue.shift())
|
|
35
|
+
for (const edge of metafile.inputs[input]?.imports ?? []) {
|
|
36
|
+
if (edge.external || reached.has(edge.path)) continue;
|
|
37
|
+
reached.set(edge.path, {
|
|
38
|
+
from: input,
|
|
39
|
+
dynamic: edge.kind === "dynamic-import" || edge.kind === "require-call",
|
|
40
|
+
});
|
|
41
|
+
queue.push(edge.path);
|
|
42
|
+
}
|
|
43
|
+
const chain: { input: string; dynamic: boolean }[] = [];
|
|
44
|
+
for (let input: string | undefined = target; input !== undefined; ) {
|
|
45
|
+
const edge: ImportEdge | null | undefined = reached.get(input);
|
|
46
|
+
chain.unshift({ input, dynamic: edge?.dynamic ?? false });
|
|
47
|
+
input = edge?.from;
|
|
48
|
+
}
|
|
49
|
+
return chain;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static assert(metafile: Bun.BuildMetafile | undefined, workspaceRoot: string) {
|
|
53
|
+
const [offender] = metafile ? RscServerRendererGuard.offenders(metafile) : [];
|
|
54
|
+
if (!metafile || !offender) return;
|
|
55
|
+
const root = realpathSync(workspaceRoot);
|
|
56
|
+
const shown = (input: string) => path.relative(root, path.resolve(input)) || input;
|
|
57
|
+
const lines = RscServerRendererGuard.chain(metafile, offender.input).map(
|
|
58
|
+
({ input, dynamic }, idx) => ` ${idx === 0 ? "" : dynamic ? "→ import() " : "→ "}${shown(input)}`,
|
|
59
|
+
);
|
|
60
|
+
throw new Error(
|
|
61
|
+
[
|
|
62
|
+
`[PagesBundleBuilder] The server pages bundle imports ${offender.specifier} as it loads, and the RSC worker runs under the react-server condition, where that import throws. It is reached through:`,
|
|
63
|
+
...lines,
|
|
64
|
+
"A module in the page graph that imports the app's server entry, or anything that starts the server, brings the SSR renderer with it: import only what that module uses, or hand it in from the code that boots the server.",
|
|
65
|
+
].join("\n"),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -46,6 +46,16 @@ describe("AgentAssets", () => {
|
|
|
46
46
|
expect(references.filter((asset) => asset.path.includes("/agentRule")).length).toBeGreaterThan(1);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
test("ships a guideline section on its own, and the skill's index names every entry in it", async () => {
|
|
50
|
+
const assets = await AgentAssets.skills();
|
|
51
|
+
const read = (file: string) => assets.find((asset) => asset.path === file)?.content ?? "";
|
|
52
|
+
const routes = read(".agents/skills/akan-page/references/akanApi-routes.md");
|
|
53
|
+
expect(read(".agents/skills/akan-page/SKILL.md")).toMatch(/akanApi-routes\.md` — Routes .*`Link`/);
|
|
54
|
+
expect(routes).toContain("### `Link` · `akanjs/ui`");
|
|
55
|
+
expect(routes).toContain("none of\nthem has to be looked up in `node_modules`");
|
|
56
|
+
expect(routes).not.toContain("## Endpoints");
|
|
57
|
+
});
|
|
58
|
+
|
|
49
59
|
test("names no rule or skill file that a new workspace's .gitignore would keep out of git", async () => {
|
|
50
60
|
const assets = [...(await AgentAssets.rules()), ...(await AgentAssets.skills())];
|
|
51
61
|
const root = await fsPromise.mkdtemp(path.join(os.tmpdir(), "akan-agent-ignore-"));
|
package/guideline/agentAssets.ts
CHANGED
|
@@ -31,7 +31,15 @@ export class AgentAssets {
|
|
|
31
31
|
"akan-scaffold": ["workspaceRecipes"],
|
|
32
32
|
"akan-module": ["moduleOverview", "modelConstant", "modelDictionary", "fieldRule"],
|
|
33
33
|
"akan-scalar": ["scalarModule", "scalarConstant", "scalarDictionary"],
|
|
34
|
-
"akan-service": [
|
|
34
|
+
"akan-service": [
|
|
35
|
+
"modelService",
|
|
36
|
+
"modelSignal",
|
|
37
|
+
"modelDocument",
|
|
38
|
+
"akanApi#imports",
|
|
39
|
+
"akanApi#services-and-adapters",
|
|
40
|
+
"akanApi#endpoints",
|
|
41
|
+
"akanApi#dictionaries",
|
|
42
|
+
],
|
|
35
43
|
"akan-store": ["modelStore"],
|
|
36
44
|
"akan-ui": [
|
|
37
45
|
"ssrRule",
|
|
@@ -48,7 +56,7 @@ export class AgentAssets {
|
|
|
48
56
|
"akan-err": ["errorCodes"],
|
|
49
57
|
"akan-deps": [],
|
|
50
58
|
"akan-debug": [],
|
|
51
|
-
"akan-page": ["pageRule", "akanApi"],
|
|
59
|
+
"akan-page": ["pageRule", "akanApi#imports", "akanApi#routes", "akanApi#app-config"],
|
|
52
60
|
"akan-query": ["queryRule"],
|
|
53
61
|
"akan-transport": ["transportRule"],
|
|
54
62
|
"akan-runtime": ["runtimeRule"],
|
|
@@ -101,14 +109,12 @@ ${AgentAssets.marker}
|
|
|
101
109
|
for (const [name, guidelines] of Object.entries(AgentAssets.skillReferences)) {
|
|
102
110
|
const source = await fsPromise.readFile(path.join(dir, name, "SKILL.md"), "utf-8");
|
|
103
111
|
const index: string[] = [];
|
|
104
|
-
for (const
|
|
105
|
-
const
|
|
106
|
-
parts.forEach((part, idx) => {
|
|
107
|
-
const file = parts.length === 1 ? `${guideline}.md` : `${guideline}-${idx + 1}.md`;
|
|
112
|
+
for (const reference of guidelines) {
|
|
113
|
+
for (const { file, text, summary } of await AgentAssets.#referenceFiles(reference)) {
|
|
108
114
|
const referencePath = `.agents/skills/${name}/references/${file}`;
|
|
109
|
-
assets.push({ path: referencePath, content: `${AgentAssets.marker}\n\n${
|
|
110
|
-
index.push(`- \`${referencePath}\` — ${
|
|
111
|
-
}
|
|
115
|
+
assets.push({ path: referencePath, content: `${AgentAssets.marker}\n\n${text.trim()}\n` });
|
|
116
|
+
index.push(`- \`${referencePath}\` — ${summary}`);
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
const skill = AgentAssets.#skillFile(source, index);
|
|
114
120
|
for (const root of AgentAssets.skillRoots) assets.push({ path: `${root}/${name}/SKILL.md`, content: skill });
|
|
@@ -116,7 +122,38 @@ ${AgentAssets.marker}
|
|
|
116
122
|
return assets;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
static
|
|
125
|
+
static async #referenceFiles(reference: string) {
|
|
126
|
+
const [guideline = reference, slug] = reference.split("#");
|
|
127
|
+
const text = await Prompter.getInstruction(guideline);
|
|
128
|
+
if (slug) {
|
|
129
|
+
const sections = AgentAssets.sections(text);
|
|
130
|
+
const preamble = sections[0]?.headings.length === 0 ? sections[0].text : "";
|
|
131
|
+
const section = sections.find((each) => each.headings[0] && AgentAssets.slug(each.headings[0]) === slug);
|
|
132
|
+
if (!section) throw new Error(`Guideline ${guideline} has no section ${slug}`);
|
|
133
|
+
const entries = [...section.text.matchAll(/^### (.+?)(?: · .*)?$/gm)].map((match) => match[1]);
|
|
134
|
+
const title = section.headings[0];
|
|
135
|
+
return [
|
|
136
|
+
{
|
|
137
|
+
file: `${guideline}-${slug}.md`,
|
|
138
|
+
text: preamble ? `${preamble.trim()}\n\n${section.text.trim()}` : section.text,
|
|
139
|
+
summary: entries.length ? `${title}: ${entries.join(", ")}` : title,
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
const parts = AgentAssets.split(text);
|
|
144
|
+
return parts.map((part, idx) => ({
|
|
145
|
+
file: parts.length === 1 ? `${guideline}.md` : `${guideline}-${idx + 1}.md`,
|
|
146
|
+
text: part.text,
|
|
147
|
+
summary: AgentAssets.#summarize(part.headings),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static slug(heading: string) {
|
|
152
|
+
const paren = heading.indexOf("(");
|
|
153
|
+
return (paren === -1 ? heading : heading.slice(0, paren).trimEnd()).toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static sections(markdown: string): ReferencePart[] {
|
|
120
157
|
const sections: ReferencePart[] = [];
|
|
121
158
|
let fenced = false;
|
|
122
159
|
for (const line of markdown.trim().split("\n")) {
|
|
@@ -126,8 +163,12 @@ ${AgentAssets.marker}
|
|
|
126
163
|
if (heading !== null || !last) sections.push({ text: line, headings: heading === null ? [] : [heading] });
|
|
127
164
|
else last.text += `\n${line}`;
|
|
128
165
|
}
|
|
166
|
+
return sections;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static split(markdown: string): ReferencePart[] {
|
|
129
170
|
const parts: ReferencePart[] = [];
|
|
130
|
-
for (const section of sections) {
|
|
171
|
+
for (const section of AgentAssets.sections(markdown)) {
|
|
131
172
|
const last = parts.at(-1);
|
|
132
173
|
if (last && last.text.length + section.text.length + 1 <= AgentAssets.referenceLimit) {
|
|
133
174
|
last.text += `\n${section.text}`;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
2
|
+
import { Logger } from "akanjs/common";
|
|
3
|
+
import type { BuilderMessage, BuildPhase, HmrTrace } from "akanjs/server";
|
|
4
|
+
import { resolveDevCsrMode } from "akanjs/server/hmr/csrDevManifest";
|
|
5
|
+
import { ApplicationBuildReporter } from "../app/applicationBuildReporter";
|
|
6
|
+
import { resolveSsrPageEntriesForApp } from "../artifact/implicitRootLayout";
|
|
7
|
+
import { computeRouteSeedIndex, saveRouteSeedIndex } from "../artifact/routeSeedIndex";
|
|
8
|
+
import type { App } from "../commandDecorators";
|
|
6
9
|
// Subpath imports only, as few as possible: spawned per generation, this process pays every import on every save.
|
|
7
|
-
import { AppExecutor, WorkspaceExecutor } from "
|
|
10
|
+
import { AppExecutor, WorkspaceExecutor } from "../executors";
|
|
8
11
|
import {
|
|
9
12
|
CsrArtifactBuilder,
|
|
10
13
|
CsrDevBundler,
|
|
@@ -14,10 +17,7 @@ import {
|
|
|
14
17
|
ServerGraphFile,
|
|
15
18
|
SsrBaseArtifactBuilder,
|
|
16
19
|
SsrDevBundler,
|
|
17
|
-
} from "
|
|
18
|
-
import { Logger } from "akanjs/common";
|
|
19
|
-
import type { BuilderMessage, BuildPhase, HmrTrace } from "akanjs/server";
|
|
20
|
-
import { resolveDevCsrMode } from "akanjs/server/hmr/csrDevManifest";
|
|
20
|
+
} from "../frontendBuild";
|
|
21
21
|
import type { BuildBatchRequest, BuildBatchResult, OptimizedFonts, PagesBatchCssAssets } from "./buildBatchProtocol";
|
|
22
22
|
|
|
23
23
|
// `Bun.build` keeps native bundler arenas that `Bun.gc(true)` cannot reclaim; only exiting returns them.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FontOptimizer } from "@akanjs/devkit/frontendBuild";
|
|
2
1
|
import type { BaseBuildArtifact, CssPayload, HmrTrace, PagesBundlePayload } from "akanjs/server";
|
|
2
|
+
import type { FontOptimizer } from "../frontendBuild";
|
|
3
3
|
|
|
4
4
|
export type OptimizedFonts = Awaited<ReturnType<FontOptimizer["optimize"]>>;
|
|
5
5
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import type { App } from "@akanjs/devkit/commandDecorators";
|
|
3
|
-
import type { ClientEntryDiscovery } from "@akanjs/devkit/frontendBuild/clientBuildTypes";
|
|
4
|
-
import { GraphClientEntryDiscovery } from "@akanjs/devkit/frontendBuild/clientEntryDiscovery";
|
|
5
|
-
import { HmrWatcher } from "@akanjs/devkit/frontendBuild/hmrWatcher";
|
|
6
|
-
import { WatchRootResolver } from "@akanjs/devkit/frontendBuild/watchRootResolver";
|
|
7
2
|
import type { Logger } from "akanjs/common";
|
|
8
3
|
import type { BaseBuildArtifact } from "akanjs/server";
|
|
4
|
+
import type { App } from "../commandDecorators";
|
|
5
|
+
import type { ClientEntryDiscovery } from "../frontendBuild/clientBuildTypes";
|
|
6
|
+
import { GraphClientEntryDiscovery } from "../frontendBuild/clientEntryDiscovery";
|
|
7
|
+
import { HmrWatcher } from "../frontendBuild/hmrWatcher";
|
|
8
|
+
import { WatchRootResolver } from "../frontendBuild/watchRootResolver";
|
|
9
9
|
import type { OptimizedFonts } from "./buildBatchProtocol";
|
|
10
10
|
import type { BuildBatchRunner } from "./buildBatchRunner";
|
|
11
11
|
import { BuilderChannel } from "./builderChannel";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { App } from "@akanjs/devkit/commandDecorators";
|
|
2
|
-
import { FrameworkGraph } from "@akanjs/devkit/docs/frameworkGraph";
|
|
3
|
-
import { GitRevision } from "@akanjs/devkit/workspace/gitRevision";
|
|
4
|
-
import { WorkspaceGraph } from "@akanjs/devkit/workspace/workspaceGraph";
|
|
5
1
|
import type { BuildChangesPayload, BuilderGraphReq, BuildFrameworkPayload, BuildGraphPayload } from "akanjs/server";
|
|
2
|
+
import type { App } from "../commandDecorators";
|
|
3
|
+
import { FrameworkGraph } from "../docs/frameworkGraph";
|
|
4
|
+
import { GitRevision } from "../workspace/gitRevision";
|
|
5
|
+
import { WorkspaceGraph } from "../workspace/workspaceGraph";
|
|
6
6
|
|
|
7
7
|
export class BuilderGraphPayloads {
|
|
8
8
|
readonly #app: App;
|