@akanjs/cli 3.0.0-alpha.11 → 3.0.0-alpha.13
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/{application.command-rdm3et0g.js → application.command-16bzjsam.js} +1 -1
- package/{applicationBuildRunner-6m8n71w4.js → applicationBuildRunner-9ps10a0h.js} +1 -1
- package/buildBatch.proc.js +1 -1
- package/{cloud.command-56aeekqn.js → cloud.command-f6t115qw.js} +3 -3
- package/guidelines/conventions/conventions.instruction.md +1 -1
- package/{index-bzznxgcx.js → index-1az48fvn.js} +1 -1
- package/{index-cav1azma.js → index-2m11t9ek.js} +47 -12
- package/{index-nwqqssnb.js → index-mt3nkbpt.js} +1 -1
- package/{index-a5cs7d8r.js → index-xzkynk9f.js} +2 -2
- package/index.js +4 -4
- package/{localRegistry.command-649g1n7b.js → localRegistry.command-3jssedmy.js} +2 -2
- package/package.json +2 -2
- package/{workspace.command-xhyhajxa.js → workspace.command-bqchx18r.js} +3 -3
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0c2560c17e7c39a0ab1a6f08e27af58e63e9598a265c90e5d65e943b82db95c9
|
package/buildBatch.proc.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-xzkynk9f.js";
|
|
5
|
+
import"./index-mt3nkbpt.js";
|
|
6
6
|
import"./index-h5whaj26.js";
|
|
7
7
|
import {
|
|
8
8
|
GlobalConfig
|
|
9
9
|
} from "./index-0cj2zxbm.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-1az48fvn.js";
|
|
11
11
|
import"./index-8pd02prk.js";
|
|
12
12
|
import"./index-76rn3g2c.js";
|
|
13
13
|
import {
|
|
@@ -272,7 +272,7 @@ Full version with code, the `Tab` composition example, and a review checklist: `
|
|
|
272
272
|
- Conditional render is `cond ? <X/> : null`. Never `{cond && <X/>}` — in a `className` context it renders the literal string `"false"`. Early `return null` is for guard clauses only.
|
|
273
273
|
- Never hand-roll loading, empty, or list states. Use `Load.Units` / `Load.View` / `Load.Edit` with `renderItem`, `renderList`, `renderView`, and `renderEmpty`; `<Empty />` for a bare placeholder; and `Model.New` / `Model.Edit` / `Model.SureToRemove` for CRUD modals.
|
|
274
274
|
- Avoid hooks. `useState` is for modal-open, tab, draft-input, and drag state only — never for server data. `useEffect` must be a genuine effect such as subscribe-with-cleanup or one-shot init. Prefer `Tab` over a `useState` mode switch. `.Template.tsx` files contain zero `useState`.
|
|
275
|
-
- Forms are entirely store-driven: `value={xForm.field}` with `onChange={st.do.setFieldOnX}`, the setter passed by reference. Always use `Field.*`, never a bare `<input>` for a model field. Nested rows use `st.do.writeOnX("payments.3.name", v)` plus the generated `add<Field>OnX` / `sub<Field>OnX`.
|
|
275
|
+
- Forms are entirely store-driven: `value={xForm.field}` with `onChange={st.do.setFieldOnX}`, the setter passed by reference. Always use `Field.*`, never a bare `<input>` for a model field. Nested rows use `st.do.writeOnX("payments.3.name", v)` plus the generated `add<Field>OnX` / `sub<Field>OnX`. **Passing the setter by reference is also what makes the framework emit `data-akan-action` / `data-akan-state`** on the control — the annotation an in-page agent, an E2E selector, and an external browser agent all read. Wrapping it in an inline arrow (`onChange={(v) => st.do.setFieldOnX(v)}`) silently drops that: a closure the caller wrote says nothing about what it does. Never hand-write a `data-akan-*` attribute.
|
|
276
276
|
- Read with `st.use.*` and write with `st.do.*`. Client components do not call `fetch.*`.
|
|
277
277
|
- Static class strings stay plain strings. Reach for `cn` only for a conditional or to merge an incoming `className`, and merge the caller last: `cn("base classes", cond && "extra", className)`. `cn` comes from `akanjs/client` (token-aware tailwind-merge) and is the only class-combining function — no `clsx` (removed), no raw `twMerge` imports, no object syntax (`{ x: cond }` → `cond && "x"`).
|
|
278
278
|
- Multi-slot components take extra named props (`wrapperClassName`, `bodyClassName`), never a `classNames` object.
|
|
@@ -1898,7 +1898,7 @@ function openBrowser(url) {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
1900
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
1901
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
1901
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-9ps10a0h.js")).ApplicationBuildRunner;
|
|
1902
1902
|
var loadReleasePackager = async () => (await import("./applicationReleasePackager-gg8ccbeh.js")).ApplicationReleasePackager;
|
|
1903
1903
|
var loadCapacitorApp = async () => (await import("./capacitorApp-mr81qdxq.js")).CapacitorApp;
|
|
1904
1904
|
var loadAbstractCompactor = async () => (await import("./abstractCompactor-e5yq60qz.js")).AbstractCompactor;
|
|
@@ -1036,6 +1036,7 @@ class CssCompiler {
|
|
|
1036
1036
|
#resolvedFileCache = new Map;
|
|
1037
1037
|
#resolvedSpecifierCache = new Map;
|
|
1038
1038
|
#discoveredCssPaths = new Set;
|
|
1039
|
+
importedStylesheetsByBasePath = {};
|
|
1039
1040
|
#fileExists(absPath) {
|
|
1040
1041
|
let cached = this.#fileExistsCache.get(absPath);
|
|
1041
1042
|
if (!cached) {
|
|
@@ -1070,8 +1071,11 @@ class CssCompiler {
|
|
|
1070
1071
|
if (this.#cssText !== null && !refresh)
|
|
1071
1072
|
return this.#cssText;
|
|
1072
1073
|
this.#discoveredCssPaths.clear();
|
|
1074
|
+
this.importedStylesheetsByBasePath = {};
|
|
1073
1075
|
const { cssPaths, sourcePaths } = await this.discoverCssAndSources({ refresh });
|
|
1074
|
-
|
|
1076
|
+
const { css, imported } = await this.#compileWithImports(cssPaths, sourcePaths);
|
|
1077
|
+
this.#cssText = css;
|
|
1078
|
+
this.importedStylesheetsByBasePath = { "": imported };
|
|
1075
1079
|
await this.#warnUnreachableStylesheets();
|
|
1076
1080
|
return this.#cssText;
|
|
1077
1081
|
}
|
|
@@ -1079,6 +1083,7 @@ class CssCompiler {
|
|
|
1079
1083
|
if (this.#cssTextByBasePath !== null && !refresh)
|
|
1080
1084
|
return this.#cssTextByBasePath;
|
|
1081
1085
|
this.#discoveredCssPaths.clear();
|
|
1086
|
+
this.importedStylesheetsByBasePath = {};
|
|
1082
1087
|
const akanConfig = await this.#app.getConfig({ refresh });
|
|
1083
1088
|
const pageKeys = await this.#app.getPageKeys({ refresh });
|
|
1084
1089
|
const basePaths = [...akanConfig.basePaths];
|
|
@@ -1089,7 +1094,8 @@ class CssCompiler {
|
|
|
1089
1094
|
return ["", ""];
|
|
1090
1095
|
const started = Date.now();
|
|
1091
1096
|
const { cssPaths, sourcePaths } = await this.discoverCssAndSources({ refresh, pageKeys: rootPageKeys });
|
|
1092
|
-
const css = await this
|
|
1097
|
+
const { css, imported } = await this.#compileWithImports(cssPaths, sourcePaths);
|
|
1098
|
+
this.importedStylesheetsByBasePath[""] = imported;
|
|
1093
1099
|
this.#logger.verbose(`css base=root paths=${cssPaths.length} sources=${sourcePaths.length} in ${Date.now() - started}ms`);
|
|
1094
1100
|
return ["", css];
|
|
1095
1101
|
})(),
|
|
@@ -1099,7 +1105,8 @@ class CssCompiler {
|
|
|
1099
1105
|
return [basePath, ""];
|
|
1100
1106
|
const started = Date.now();
|
|
1101
1107
|
const { cssPaths, sourcePaths } = await this.discoverCssAndSources({ refresh, pageKeys: basePathPageKeys });
|
|
1102
|
-
const css = await this
|
|
1108
|
+
const { css, imported } = await this.#compileWithImports(cssPaths, sourcePaths);
|
|
1109
|
+
this.importedStylesheetsByBasePath[basePath] = imported;
|
|
1103
1110
|
this.#logger.verbose(`css base=${basePath} paths=${cssPaths.length} sources=${sourcePaths.length} in ${Date.now() - started}ms`);
|
|
1104
1111
|
return [basePath, css];
|
|
1105
1112
|
})
|
|
@@ -1202,18 +1209,23 @@ class CssCompiler {
|
|
|
1202
1209
|
return tokenPaths.filter((tokensPath) => !!tokensPath);
|
|
1203
1210
|
}
|
|
1204
1211
|
async compileCss(cssPaths, sourcePaths) {
|
|
1212
|
+
const { css } = await this.#compileWithImports(cssPaths, sourcePaths);
|
|
1213
|
+
return css;
|
|
1214
|
+
}
|
|
1215
|
+
async#compileWithImports(cssPaths, sourcePaths) {
|
|
1205
1216
|
if (cssPaths.length === 0)
|
|
1206
|
-
return "";
|
|
1217
|
+
return { css: "", imported: [] };
|
|
1207
1218
|
const compileStarted = Date.now();
|
|
1208
1219
|
const compilers = await Promise.all(cssPaths.map(async (cssPath) => {
|
|
1209
1220
|
const css = await Bun.file(cssPath).text();
|
|
1210
1221
|
const base = path8.dirname(cssPath);
|
|
1222
|
+
const imported2 = new Map;
|
|
1211
1223
|
const compiler = await compile(css, {
|
|
1212
1224
|
base,
|
|
1213
|
-
loadStylesheet: (id, fromBase) => this.#loadStylesheet(id, fromBase),
|
|
1225
|
+
loadStylesheet: (id, fromBase) => this.#loadStylesheet(id, fromBase, imported2),
|
|
1214
1226
|
loadModule: (id, fromBase) => this.#loadModule(id, fromBase)
|
|
1215
1227
|
});
|
|
1216
|
-
return { cssPath, compiler };
|
|
1228
|
+
return { cssPath, compiler, imported: imported2 };
|
|
1217
1229
|
}));
|
|
1218
1230
|
const sourceDirs = new Set;
|
|
1219
1231
|
for (const entry of compilers) {
|
|
@@ -1226,19 +1238,30 @@ class CssCompiler {
|
|
|
1226
1238
|
const candidates = await this.#scanCandidates(sourcePaths, [...sourceDirs]);
|
|
1227
1239
|
this.#logger.verbose(`css candidates scanned count=${candidates.length} sources=${sourcePaths.length} dirs=${sourceDirs.size} in ${Date.now() - scanStarted}ms`);
|
|
1228
1240
|
const parts = [];
|
|
1241
|
+
const imported = [];
|
|
1229
1242
|
for (const entry of compilers) {
|
|
1230
1243
|
if (!entry)
|
|
1231
1244
|
continue;
|
|
1232
|
-
|
|
1245
|
+
const part = entry.compiler.build(candidates);
|
|
1246
|
+
parts.push(part);
|
|
1247
|
+
for (const [cssPath, content] of entry.imported) {
|
|
1248
|
+
const declaredNames = declaredCustomProperties(content);
|
|
1249
|
+
imported.push({ cssPath, declaredNames });
|
|
1250
|
+
if (declaredNames.length === 0 || declaredNames.some((name) => part.includes(`${name}:`)))
|
|
1251
|
+
continue;
|
|
1252
|
+
this.#logger.warn(`css @import ${cssPath} was loaded by ${entry.cssPath} but none of its ${declaredNames.length} declaration(s) reached the compiled CSS`);
|
|
1253
|
+
}
|
|
1233
1254
|
}
|
|
1234
1255
|
this.#logger.verbose(`css compiled paths=${cssPaths.length} candidates=${candidates.length} in ${Date.now() - compileStarted}ms`);
|
|
1235
|
-
return parts.join(`
|
|
1236
|
-
`);
|
|
1256
|
+
return { css: parts.join(`
|
|
1257
|
+
`), imported };
|
|
1237
1258
|
}
|
|
1238
|
-
async#loadStylesheet(id, fromBase) {
|
|
1259
|
+
async#loadStylesheet(id, fromBase, imported) {
|
|
1239
1260
|
const p = await this.#resolveCssImport(id, fromBase);
|
|
1240
1261
|
this.#discoveredCssPaths.add(p);
|
|
1241
1262
|
const content = await Bun.file(p).text();
|
|
1263
|
+
imported?.set(p, content);
|
|
1264
|
+
this.#logger.verbose(`css import "${id}" from ${fromBase} -> ${p} (${content.length} bytes)`);
|
|
1242
1265
|
return { path: p, base: path8.dirname(p), content };
|
|
1243
1266
|
}
|
|
1244
1267
|
async#resolveCssImport(id, fromBase) {
|
|
@@ -1332,6 +1355,10 @@ function isSourceFile(filePath) {
|
|
|
1332
1355
|
function isIgnoredNodeModuleSource(filePath) {
|
|
1333
1356
|
return NODE_MODULES_RE.test(filePath) && !AKANJS_NODE_MODULE_RE.test(filePath);
|
|
1334
1357
|
}
|
|
1358
|
+
function declaredCustomProperties(css) {
|
|
1359
|
+
const withoutThemeBlocks = css.replace(/@theme[^{]*\{[^}]*\}/g, "");
|
|
1360
|
+
return [...new Set([...withoutThemeBlocks.matchAll(/(?:^|[\s;{])(--[\w-]+)\s*:/g)].map(([, name]) => name))].filter((name) => !!name);
|
|
1361
|
+
}
|
|
1335
1362
|
function getPageKeyBasePath(pageKey, basePaths) {
|
|
1336
1363
|
const normalized = pageKey.split(path8.sep).join("/").replace(/^\.\//, "");
|
|
1337
1364
|
const segments = normalized.split("/");
|
|
@@ -2278,13 +2305,13 @@ class SsrBaseArtifactBuilder {
|
|
|
2278
2305
|
`);
|
|
2279
2306
|
if (!cssText)
|
|
2280
2307
|
return [];
|
|
2281
|
-
return [this.#writeCssAsset(basePath, cssText)];
|
|
2308
|
+
return [this.#writeCssAsset(basePath, cssText, cssCompiler.importedStylesheetsByBasePath[basePath] ?? [])];
|
|
2282
2309
|
})));
|
|
2283
2310
|
if (optimizedFonts.files.length > 0)
|
|
2284
2311
|
this.#app.verbose(`[base-artifact] optimized ${optimizedFonts.files.length} font files`);
|
|
2285
2312
|
return { cssCompiler, optimizedFonts, cssAssets };
|
|
2286
2313
|
}
|
|
2287
|
-
async#writeCssAsset(basePath, cssText) {
|
|
2314
|
+
async#writeCssAsset(basePath, cssText, imported) {
|
|
2288
2315
|
const cssAssetName = basePath || "root";
|
|
2289
2316
|
const preparedCssText = await prepareCssAsset(this.#command, basePath, cssText);
|
|
2290
2317
|
const cssHash = Bun.hash(`${basePath}
|
|
@@ -2294,9 +2321,17 @@ ${preparedCssText}`).toString(36);
|
|
|
2294
2321
|
`/_akan/styles/${cssAssetName}-${cssHash}.css`
|
|
2295
2322
|
];
|
|
2296
2323
|
await Bun.write(path13.join(this.#absArtifactDir, cssRelPath), preparedCssText);
|
|
2324
|
+
SsrBaseArtifactBuilder.#warnDroppedImports(this.#app, cssRelPath, preparedCssText, imported);
|
|
2297
2325
|
this.#app.verbose(`[base-artifact] wrote ${preparedCssText.length} bytes of CSS for ${basePath} -> ${cssRelPath}`);
|
|
2298
2326
|
return [basePath, { cssUrl, cssRelPath }];
|
|
2299
2327
|
}
|
|
2328
|
+
static #warnDroppedImports(app, cssRelPath, css, imported) {
|
|
2329
|
+
for (const { cssPath, declaredNames } of imported) {
|
|
2330
|
+
if (declaredNames.length === 0 || declaredNames.some((name) => css.includes(`${name}:`)))
|
|
2331
|
+
continue;
|
|
2332
|
+
app.logger.warn(`[base-artifact] @import ${cssPath} declares ${declaredNames.length} custom propert${declaredNames.length === 1 ? "y" : "ies"} and none of them are in ${cssRelPath}`);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2300
2335
|
}
|
|
2301
2336
|
// pkgs/@akanjs/devkit/frontendBuild/styleGuard.ts
|
|
2302
2337
|
var PREFIX = "(?:bg|text|border(?:-[tblrxy])?(?:-[se])?|ring(?:-offset)?|fill|stroke|shadow|from|to|via|divide|outline|decoration|placeholder|caret|accent)";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-mt3nkbpt.js";
|
|
5
5
|
import {
|
|
6
6
|
PackageScript
|
|
7
7
|
} from "./index-h5whaj26.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./index-0cj2zxbm.js";
|
|
13
13
|
import {
|
|
14
14
|
ApplicationScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-1az48fvn.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
18
|
} from "./index-etwh7sd3.js";
|
package/index.js
CHANGED
|
@@ -18,16 +18,16 @@ import path from "path";
|
|
|
18
18
|
|
|
19
19
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
20
20
|
var commandModules = {
|
|
21
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
+
workspace: async () => (await import("./workspace.command-bqchx18r.js")).WorkspaceCommand,
|
|
22
22
|
agent: async () => (await import("./agent.command-a3n15c6t.js")).AgentCommand,
|
|
23
|
-
application: async () => (await import("./application.command-
|
|
23
|
+
application: async () => (await import("./application.command-16bzjsam.js")).ApplicationCommand,
|
|
24
24
|
library: async () => (await import("./library.command-x6t29a30.js")).LibraryCommand,
|
|
25
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
+
localRegistry: async () => (await import("./localRegistry.command-3jssedmy.js")).LocalRegistryCommand,
|
|
26
26
|
package: async () => (await import("./package.command-zgy7f3fz.js")).PackageCommand,
|
|
27
27
|
module: async () => (await import("./module.command-8w8ys5t3.js")).ModuleCommand,
|
|
28
28
|
page: async () => (await import("./page.command-yjmnkyk2.js")).PageCommand,
|
|
29
29
|
context: async () => (await import("./context.command-ysxawe7h.js")).ContextCommand,
|
|
30
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
+
cloud: async () => (await import("./cloud.command-f6t115qw.js")).CloudCommand,
|
|
31
31
|
guideline: async () => (await import("./guideline.command-yqf9a372.js")).GuidelineCommand,
|
|
32
32
|
scalar: async () => (await import("./scalar.command-9dhmqhtm.js")).ScalarCommand,
|
|
33
33
|
primitive: async () => (await import("./primitive.command-gfqaagsg.js")).PrimitiveCommand,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mt3nkbpt.js";
|
|
6
6
|
import {
|
|
7
7
|
PackageScript
|
|
8
8
|
} from "./index-h5whaj26.js";
|
|
9
9
|
import"./index-0cj2zxbm.js";
|
|
10
10
|
import {
|
|
11
11
|
ApplicationScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-1az48fvn.js";
|
|
13
13
|
import"./index-8pd02prk.js";
|
|
14
14
|
import"./index-76rn3g2c.js";
|
|
15
15
|
import {
|
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.13",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "3.0.0-alpha.
|
|
37
|
+
"akanjs": "3.0.0-alpha.13",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"dayjs": "^1.11.20",
|
|
@@ -11,11 +11,11 @@ import"./index-ss469dec.js";
|
|
|
11
11
|
import"./index-65aeh789.js";
|
|
12
12
|
import {
|
|
13
13
|
CloudScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-xzkynk9f.js";
|
|
15
15
|
import {
|
|
16
16
|
getLatestPackageVersion,
|
|
17
17
|
getNpmRegistryUrl
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-mt3nkbpt.js";
|
|
19
19
|
import {
|
|
20
20
|
PackageScript
|
|
21
21
|
} from "./index-h5whaj26.js";
|
|
@@ -31,7 +31,7 @@ import"./index-kcsa1zff.js";
|
|
|
31
31
|
import"./index-j37qq1f2.js";
|
|
32
32
|
import {
|
|
33
33
|
ApplicationScript
|
|
34
|
-
} from "./index-
|
|
34
|
+
} from "./index-1az48fvn.js";
|
|
35
35
|
import {
|
|
36
36
|
LibraryScript
|
|
37
37
|
} from "./index-8pd02prk.js";
|