@akanjs/cli 3.0.0-alpha.16 → 3.0.0-alpha.18
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/README.ko.md +1 -1
- package/README.md +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
- package/{agent.command-h6tc0pzh.js → agent.command-e835fjem.js} +6 -6
- package/{application.command-kphnfwyg.js → application.command-3tjnzez7.js} +5 -5
- package/{applicationBuildRunner-9ps10a0h.js → applicationBuildRunner-7gnfz7ww.js} +5 -6
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
- package/buildBatch.proc.js +4 -4
- package/{capacitorApp-9ejk3k7q.js → capacitorApp-qv7g3dp2.js} +27 -27
- package/{cloud.command-zn6mfscb.js → cloud.command-s2ck4ktz.js} +9 -9
- package/{context.command-pkbccyys.js → context.command-vn87jb08.js} +14 -14
- package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
- package/{getDirname-m9s0cmhq.js → getDirname-ka11hm7e.js} +1 -1
- package/{guideline.command-0jj2k77g.js → guideline.command-s4hn2bsy.js} +4 -4
- package/guidelines/conventions/conventions.instruction.md +89 -6
- package/incrementalBuilder.proc.js +3 -3
- package/{index-b9m84bjp.js → index-0h212yqe.js} +10 -10
- package/{index-xwfkgss0.js → index-33zce8gt.js} +8 -4
- package/{index-w7farjxd.js → index-3dp7x6rc.js} +3 -3
- package/{index-p42te6qb.js → index-73rnbwgg.js} +14 -6
- package/{index-1twehz1x.js → index-8vkkm7v0.js} +8 -18
- package/{index-4v0wvt37.js → index-9jsnb4vw.js} +4 -4
- package/{index-rv16ck4r.js → index-ae8ptzzm.js} +8 -8
- package/{index-djh5gpb7.js → index-g9e2fhw2.js} +2 -2
- package/{index-2m11t9ek.js → index-hg0qvhmx.js} +3 -208
- package/{index-7ecpft60.js → index-k6fvbcj1.js} +3 -3
- package/{index-aak9cctp.js → index-mykmf6wd.js} +5 -5
- package/{index-gz91pc3p.js → index-mz5jtaq7.js} +1 -1
- package/{index-bkwnr08k.js → index-n706txcv.js} +2 -2
- package/{index-gyvrhtpm.js → index-qc0tnhs2.js} +1 -1
- package/{index-j9cxndc0.js → index-qnv0aqmm.js} +9 -6
- package/{index-96vpa123.js → index-rdw5bxqf.js} +4 -4
- package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
- package/{index-9s991k9v.js → index-tsmjxph2.js} +1 -1
- package/{index-8d9r0df5.js → index-x33gnap3.js} +3 -3
- package/{index-4agbdds8.js → index-xyrb7pk5.js} +3 -3
- package/{index-g3brq942.js → index-ze41924k.js} +6 -6
- package/index.js +19 -19
- package/{library.command-wbptp6q3.js → library.command-v5cyaw9t.js} +4 -4
- package/{localRegistry.command-6ea3pgq0.js → localRegistry.command-263b9wxm.js} +8 -8
- package/{module.command-ghkf919z.js → module.command-pq6w84xg.js} +7 -7
- package/{package.command-ph2m34tv.js → package.command-qkcs60ts.js} +4 -4
- package/package.json +3 -4
- package/{page.command-atnzfn88.js → page.command-qj5bfnh9.js} +4 -4
- package/{primitive.command-7qbdhfc2.js → primitive.command-bw0nes6x.js} +8 -8
- package/{quality.command-51q9kmhj.js → quality.command-f8drhx6c.js} +3 -3
- package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
- package/{repair.command-weakn0yr.js → repair.command-mzwtejpk.js} +6 -6
- package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
- package/{scalar.command-xdjhvsgb.js → scalar.command-rm6k3c65.js} +6 -6
- package/templates/lib/db.ts +1 -1
- package/templates/lib/dict.ts +1 -1
- package/templates/lib/sig.ts +1 -1
- package/templates/lib/srv.ts +6 -2
- package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{workflow.command-msm2tjee.js → workflow.command-g2cgcgxn.js} +11 -11
- package/{workspace.command-gr8z82z9.js → workspace.command-wecyg0t0.js} +20 -21
- /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-n706txcv.js";
|
|
6
6
|
import {
|
|
7
7
|
LibExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-8vkkm7v0.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/cli/semver.ts
|
|
11
|
-
|
|
11
|
+
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
12
|
+
var parseVersion = (version) => {
|
|
12
13
|
return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
13
|
-
}
|
|
14
|
-
|
|
14
|
+
};
|
|
15
|
+
var compareNumeric = (a, b) => {
|
|
15
16
|
const left = parseVersion(a);
|
|
16
17
|
const right = parseVersion(b);
|
|
17
18
|
const length = Math.max(left.length, right.length);
|
|
@@ -21,7 +22,14 @@ function compareSemver(a, b) {
|
|
|
21
22
|
return diff > 0 ? 1 : -1;
|
|
22
23
|
}
|
|
23
24
|
return 0;
|
|
24
|
-
}
|
|
25
|
+
};
|
|
26
|
+
var compareSemver = (a, b) => {
|
|
27
|
+
try {
|
|
28
|
+
return Bun.semver.order(stripRangeOperator(a), stripRangeOperator(b));
|
|
29
|
+
} catch {
|
|
30
|
+
return compareNumeric(a, b);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
25
33
|
|
|
26
34
|
// pkgs/@akanjs/cli/library/library.runner.ts
|
|
27
35
|
class LibraryRunner extends runner("library") {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./index-67546d0j.js";
|
|
11
11
|
import {
|
|
12
12
|
__require
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-yb2wsc7f.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/devkit/executors.ts
|
|
16
16
|
import {
|
|
@@ -44,7 +44,7 @@ import chalk2 from "chalk";
|
|
|
44
44
|
|
|
45
45
|
// pkgs/@akanjs/devkit/agentsIndex.ts
|
|
46
46
|
var recipeScannerLoad = null;
|
|
47
|
-
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-
|
|
47
|
+
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-zrzev25x.js");
|
|
48
48
|
var AGENT_BLOCK_START = "<!-- akan:agent:start -->";
|
|
49
49
|
var AGENT_BLOCK_END = "<!-- akan:agent:end -->";
|
|
50
50
|
var AGENT_VERSION_PREFIX = "<!-- akan:agent:version ";
|
|
@@ -54,7 +54,7 @@ ${block}`;
|
|
|
54
54
|
var extractBlockVersion = (content) => content.match(/<!-- akan:agent:version ([^\s]+) -->/)?.[1] ?? null;
|
|
55
55
|
var readDevkitVersion = async () => {
|
|
56
56
|
const { readFile } = await import("fs/promises");
|
|
57
|
-
const { getDirname: getDirname2 } = await import("./getDirname-
|
|
57
|
+
const { getDirname: getDirname2 } = await import("./getDirname-ka11hm7e.js");
|
|
58
58
|
try {
|
|
59
59
|
const raw = await readFile(`${getDirname2(import.meta.url)}/package.json`, "utf-8");
|
|
60
60
|
return JSON.parse(raw).version ?? null;
|
|
@@ -220,8 +220,6 @@ var DEFAULT_OPTIMIZE_IMPORTS = [
|
|
|
220
220
|
];
|
|
221
221
|
var WORKSPACE_BARREL_FACETS = ["ui", "webkit", "common", "client", "server"];
|
|
222
222
|
var SSR_RUNTIME_PACKAGES = ["react", "react-dom", "react-server-dom-webpack"];
|
|
223
|
-
var NATIVE_RUNTIME_PACKAGES = ["sharp"];
|
|
224
|
-
var DEFAULT_BACKEND_RUNTIME_PACKAGES = ["croner"];
|
|
225
223
|
var MOBILE_RUNTIME_PACKAGES = [
|
|
226
224
|
"@capacitor/cli",
|
|
227
225
|
"@capacitor/core",
|
|
@@ -250,8 +248,6 @@ var DATABASE_MODE_RUNTIME_PACKAGES = {
|
|
|
250
248
|
};
|
|
251
249
|
var AKAN_RUNTIME_PACKAGES = new Set([
|
|
252
250
|
...SSR_RUNTIME_PACKAGES,
|
|
253
|
-
...NATIVE_RUNTIME_PACKAGES,
|
|
254
|
-
...DEFAULT_BACKEND_RUNTIME_PACKAGES,
|
|
255
251
|
...MOBILE_RUNTIME_PACKAGES,
|
|
256
252
|
...Object.values(DATABASE_MODE_RUNTIME_PACKAGES).flat()
|
|
257
253
|
]);
|
|
@@ -543,13 +539,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
543
539
|
return akanPackageJson.dependencies?.[lib] ?? akanPackageJson.peerDependencies?.[lib];
|
|
544
540
|
}
|
|
545
541
|
#getProductionRuntimePackages() {
|
|
546
|
-
return [
|
|
547
|
-
...this.externalLibs,
|
|
548
|
-
...SSR_RUNTIME_PACKAGES,
|
|
549
|
-
...NATIVE_RUNTIME_PACKAGES,
|
|
550
|
-
...DEFAULT_BACKEND_RUNTIME_PACKAGES,
|
|
551
|
-
...this.getDatabaseModeRuntimePackages()
|
|
552
|
-
];
|
|
542
|
+
return [...this.externalLibs, ...SSR_RUNTIME_PACKAGES, ...this.getDatabaseModeRuntimePackages()];
|
|
553
543
|
}
|
|
554
544
|
getDatabaseModeRuntimePackages(databaseMode = this.defaultDatabaseMode) {
|
|
555
545
|
return [...DATABASE_MODE_RUNTIME_PACKAGES[databaseMode]];
|
|
@@ -1048,7 +1038,7 @@ var moduleUiFileTypes = {
|
|
|
1048
1038
|
};
|
|
1049
1039
|
var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
1050
1040
|
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
1051
|
-
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-
|
|
1041
|
+
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-rbs2407b.js")).TypeScriptDependencyScanner.from(exec);
|
|
1052
1042
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
1053
1043
|
var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
1054
1044
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
@@ -2089,7 +2079,7 @@ class Executor {
|
|
|
2089
2079
|
return this._applyTemplate({ ...options, dict });
|
|
2090
2080
|
}
|
|
2091
2081
|
async getTypeChecker() {
|
|
2092
|
-
const { TypeChecker } = await import("./typeChecker-
|
|
2082
|
+
const { TypeChecker } = await import("./typeChecker-g6bh0xfv.js");
|
|
2093
2083
|
this.typeChecker ??= new TypeChecker(this);
|
|
2094
2084
|
return this.typeChecker;
|
|
2095
2085
|
}
|
|
@@ -2546,7 +2536,7 @@ class SysExecutor extends Executor {
|
|
|
2546
2536
|
class AppExecutor extends SysExecutor {
|
|
2547
2537
|
static #routeSourceValidator = null;
|
|
2548
2538
|
static async#getRouteSourceValidator() {
|
|
2549
|
-
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-
|
|
2539
|
+
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-7fycdqyv.js")).RouteSourceValidator;
|
|
2550
2540
|
return AppExecutor.#routeSourceValidator;
|
|
2551
2541
|
}
|
|
2552
2542
|
dist;
|
|
@@ -3029,7 +3019,7 @@ class PkgExecutor extends Executor {
|
|
|
3029
3019
|
default: "./index.ts"
|
|
3030
3020
|
}
|
|
3031
3021
|
},
|
|
3032
|
-
engines: { bun: ">=1.
|
|
3022
|
+
engines: { bun: ">=1.4.0" },
|
|
3033
3023
|
...dependencyMaps
|
|
3034
3024
|
};
|
|
3035
3025
|
await Promise.all([this.dist.writeJson("package.json", distPkgJson), this.writeJson("package.json", distPkgJson)]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-mykmf6wd.js";
|
|
5
5
|
import {
|
|
6
6
|
addFieldUiPolicyForType,
|
|
7
7
|
coerceFieldDefault,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
sourceFile,
|
|
35
35
|
validationCommandsForTarget,
|
|
36
36
|
viaBuilderParameterName
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-tsmjxph2.js";
|
|
38
38
|
import {
|
|
39
39
|
script
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-n706txcv.js";
|
|
41
41
|
import {
|
|
42
42
|
AppExecutor,
|
|
43
43
|
LibExecutor,
|
|
44
44
|
ModuleExecutor
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-8vkkm7v0.js";
|
|
46
46
|
|
|
47
47
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
48
48
|
import { capitalize } from "akanjs/common";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-73rnbwgg.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveMobileTargets
|
|
7
7
|
} from "./index-76rn3g2c.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-n706txcv.js";
|
|
12
12
|
import {
|
|
13
13
|
HmrWatcher,
|
|
14
14
|
WatchRootResolver
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
LibExecutor,
|
|
19
19
|
PkgExecutor,
|
|
20
20
|
WorkspaceExecutor
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-8vkkm7v0.js";
|
|
22
22
|
import {
|
|
23
23
|
__require
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-yb2wsc7f.js";
|
|
25
25
|
|
|
26
26
|
// pkgs/@akanjs/devkit/applicationBuildReporter.ts
|
|
27
27
|
import { Logger } from "akanjs/common";
|
|
@@ -1898,10 +1898,10 @@ function openBrowser(url) {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
1900
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
1901
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
1902
|
-
var loadReleasePackager = async () => (await import("./applicationReleasePackager-
|
|
1903
|
-
var loadCapacitorApp = async () => (await import("./capacitorApp-
|
|
1904
|
-
var loadAbstractCompactor = async () => (await import("./abstractCompactor-
|
|
1901
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-7gnfz7ww.js")).ApplicationBuildRunner;
|
|
1902
|
+
var loadReleasePackager = async () => (await import("./applicationReleasePackager-93nzdfsy.js")).ApplicationReleasePackager;
|
|
1903
|
+
var loadCapacitorApp = async () => (await import("./capacitorApp-qv7g3dp2.js")).CapacitorApp;
|
|
1904
|
+
var loadAbstractCompactor = async () => (await import("./abstractCompactor-20e0cwbs.js")).AbstractCompactor;
|
|
1905
1905
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
1906
1906
|
|
|
1907
1907
|
class ApplicationRunner extends runner("application") {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
workflowRunArtifactPath,
|
|
4
4
|
workflowSyncDir
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-tsmjxph2.js";
|
|
6
6
|
import {
|
|
7
7
|
AppExecutor,
|
|
8
8
|
LibExecutor,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
extractBlockVersion,
|
|
12
12
|
isScannedAppRootEntry,
|
|
13
13
|
readDevkitVersion
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-8vkkm7v0.js";
|
|
15
15
|
import {
|
|
16
16
|
collectRecipeSources,
|
|
17
17
|
findInlineRecipeDuplicates,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
createTsconfigPackageResolver,
|
|
10
10
|
rewriteBarrelImports,
|
|
11
11
|
transformUseClient
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-qnv0aqmm.js";
|
|
13
13
|
import {
|
|
14
14
|
__require
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-yb2wsc7f.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/devkit/frontendBuild/allRoutesBuilder.ts
|
|
18
18
|
import path4 from "path";
|
|
@@ -1836,7 +1836,6 @@ var DEFAULT_EXCLUDE_PREFIX = ["@akanjs/cli/", "@akanjs/devkit/"];
|
|
|
1836
1836
|
var OPTIONAL_BACKEND_EXTERNAL_EXACT = new Set([
|
|
1837
1837
|
"@libsql/client",
|
|
1838
1838
|
"bullmq",
|
|
1839
|
-
"croner",
|
|
1840
1839
|
"ioredis",
|
|
1841
1840
|
"postgres",
|
|
1842
1841
|
"protobufjs"
|
|
@@ -2253,7 +2252,7 @@ class SsrBaseArtifactBuilder {
|
|
|
2253
2252
|
const ssrBundle = await new ClientEntriesBundler({
|
|
2254
2253
|
app: this.#app,
|
|
2255
2254
|
entries: [rscSegmentOutletEntry],
|
|
2256
|
-
...RouteClientBuilder.
|
|
2255
|
+
...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
|
|
2257
2256
|
outputSubdir: "client-ssr",
|
|
2258
2257
|
command: this.#command
|
|
2259
2258
|
}).bundle();
|
|
@@ -2339,210 +2338,6 @@ var PALETTE = "(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|gre
|
|
|
2339
2338
|
var LEAD = "(^|[\\s\"'`{(\\[:!])";
|
|
2340
2339
|
var TAIL = "(?=[\\s\"'`})\\]:/!,]|$)";
|
|
2341
2340
|
var RAW_PALETTE_RE = new RegExp(`${LEAD}((?:${PREFIX})-)${PALETTE}-\\d{2,3}${TAIL}`, "g");
|
|
2342
|
-
var ARBITRARY_COLOR_RE = /\[(#[0-9a-fA-F]{3,8}|(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb|color)\([^\]]*\))\]/g;
|
|
2343
2341
|
var INTERPOLATED_ARBITRARY_RE = new RegExp(`${LEAD}[a-z][a-z0-9-]*-\\[[^\\]\`]*\\$\\{`, "g");
|
|
2344
|
-
var STYLE_OBJECT_RE = /style=\{\{([\s\S]*?)\}\}/g;
|
|
2345
|
-
var STYLE_TAG_RE = /<style[^>]*>([\s\S]*?)<\/style>/g;
|
|
2346
|
-
var INLINE_COLOR_LITERAL_RE = /#[0-9a-fA-F]{3,8}\b|(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb)\(/g;
|
|
2347
2342
|
var DAISYUI_LEGACY_RE = new RegExp(`${LEAD}(?:` + "btn-(?:primary|secondary|accent|neutral|info|success|warning|error|ghost|link|outline|square|circle|wide|block|xs|sm|md|lg)|" + "badge-(?:primary|secondary|accent|neutral|info|success|warning|error|ghost|outline)|" + "alert-(?:info|success|warning|error)|" + "input-(?:bordered|primary|secondary|accent|ghost|error)|" + "select-(?:bordered|primary|ghost)|textarea-(?:bordered|primary|ghost)|" + "checkbox-(?:primary|secondary|accent)|toggle-(?:primary|secondary|accent)|" + "loading-(?:spinner|dots|ring|ball|bars|infinity)|" + "card-(?:body|title|actions)|modal-(?:box|action|backdrop)|" + "collapse-(?:title|content|arrow|plus)|dropdown-(?:content|end|start|hover)|" + "stat-(?:title|value|desc)|tabs-(?:boxed|lifted|bordered)|tab-active|" + "menu-(?:title|dropdown)|steps-(?:horizontal|vertical)|join-item|" + "mockup-(?:code|phone|browser|window)|drawer-(?:side|content|toggle)" + `)${TAIL}`, "g");
|
|
2348
|
-
var ALL_RULES = [
|
|
2349
|
-
"raw-palette",
|
|
2350
|
-
"arbitrary-color",
|
|
2351
|
-
"inline-color",
|
|
2352
|
-
"daisyui-legacy",
|
|
2353
|
-
"interpolated-arbitrary"
|
|
2354
|
-
];
|
|
2355
|
-
|
|
2356
|
-
class StyleGuard {
|
|
2357
|
-
run(files) {
|
|
2358
|
-
const out = [];
|
|
2359
|
-
for (const file of files) {
|
|
2360
|
-
const directives = this.#parseDirectives(file.content);
|
|
2361
|
-
const scan = this.#stripComments(file.content);
|
|
2362
|
-
const local = [];
|
|
2363
|
-
this.#scanClassLiterals(file, scan, local);
|
|
2364
|
-
this.#scanInlineColors(file, scan, local);
|
|
2365
|
-
for (const v of local)
|
|
2366
|
-
if (!this.#isSuppressed(v, directives))
|
|
2367
|
-
out.push(v);
|
|
2368
|
-
}
|
|
2369
|
-
return out;
|
|
2370
|
-
}
|
|
2371
|
-
#stripComments(src) {
|
|
2372
|
-
const out = src.split("");
|
|
2373
|
-
const blank = (i2) => {
|
|
2374
|
-
if (src[i2] !== `
|
|
2375
|
-
`)
|
|
2376
|
-
out[i2] = " ";
|
|
2377
|
-
};
|
|
2378
|
-
let state = "code";
|
|
2379
|
-
let i = 0;
|
|
2380
|
-
while (i < src.length) {
|
|
2381
|
-
const c = src[i];
|
|
2382
|
-
const d = src[i + 1];
|
|
2383
|
-
if (state === "code") {
|
|
2384
|
-
if (c === "/" && d === "/") {
|
|
2385
|
-
blank(i);
|
|
2386
|
-
blank(i + 1);
|
|
2387
|
-
state = "line";
|
|
2388
|
-
i += 2;
|
|
2389
|
-
} else if (c === "/" && d === "*") {
|
|
2390
|
-
blank(i);
|
|
2391
|
-
blank(i + 1);
|
|
2392
|
-
state = "block";
|
|
2393
|
-
i += 2;
|
|
2394
|
-
} else {
|
|
2395
|
-
if (c === "'")
|
|
2396
|
-
state = "squote";
|
|
2397
|
-
else if (c === '"')
|
|
2398
|
-
state = "dquote";
|
|
2399
|
-
else if (c === "`")
|
|
2400
|
-
state = "template";
|
|
2401
|
-
i++;
|
|
2402
|
-
}
|
|
2403
|
-
} else if (state === "line") {
|
|
2404
|
-
if (c === `
|
|
2405
|
-
`)
|
|
2406
|
-
state = "code";
|
|
2407
|
-
else
|
|
2408
|
-
blank(i);
|
|
2409
|
-
i++;
|
|
2410
|
-
} else if (state === "block") {
|
|
2411
|
-
if (c === "*" && d === "/") {
|
|
2412
|
-
blank(i);
|
|
2413
|
-
blank(i + 1);
|
|
2414
|
-
state = "code";
|
|
2415
|
-
i += 2;
|
|
2416
|
-
} else {
|
|
2417
|
-
blank(i);
|
|
2418
|
-
i++;
|
|
2419
|
-
}
|
|
2420
|
-
} else {
|
|
2421
|
-
const close = state === "squote" ? "'" : state === "dquote" ? '"' : "`";
|
|
2422
|
-
if (c === "\\")
|
|
2423
|
-
i += 2;
|
|
2424
|
-
else {
|
|
2425
|
-
if (c === close)
|
|
2426
|
-
state = "code";
|
|
2427
|
-
i++;
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
return out.join("");
|
|
2432
|
-
}
|
|
2433
|
-
#parseDirectives(content) {
|
|
2434
|
-
const directives = { file: null, nextLine: new Map };
|
|
2435
|
-
const lines = content.split(`
|
|
2436
|
-
`);
|
|
2437
|
-
for (let i = 0;i < lines.length; i++) {
|
|
2438
|
-
const line = lines[i];
|
|
2439
|
-
const nextLineMatch = line.match(/styleguard-disable-next-line\b(.*)$/);
|
|
2440
|
-
if (nextLineMatch) {
|
|
2441
|
-
directives.nextLine.set(i + 2, this.#extractRules(nextLineMatch[1]));
|
|
2442
|
-
continue;
|
|
2443
|
-
}
|
|
2444
|
-
const fileMatch = line.match(/styleguard-disable\b(.*)$/);
|
|
2445
|
-
if (fileMatch)
|
|
2446
|
-
directives.file = this.#mergeFileScope(directives.file, this.#extractRules(fileMatch[1]));
|
|
2447
|
-
}
|
|
2448
|
-
return directives;
|
|
2449
|
-
}
|
|
2450
|
-
#extractRules(tail) {
|
|
2451
|
-
const found = ALL_RULES.filter((rule) => tail.includes(rule));
|
|
2452
|
-
return found.length === 0 ? "all" : new Set(found);
|
|
2453
|
-
}
|
|
2454
|
-
#mergeFileScope(prev, next) {
|
|
2455
|
-
if (prev === "all" || next === "all")
|
|
2456
|
-
return "all";
|
|
2457
|
-
return new Set([...prev ?? [], ...next]);
|
|
2458
|
-
}
|
|
2459
|
-
#isSuppressed(v, directives) {
|
|
2460
|
-
if (directives.file === "all" || directives.file?.has(v.rule))
|
|
2461
|
-
return true;
|
|
2462
|
-
const nextLine = directives.nextLine.get(v.line);
|
|
2463
|
-
return nextLine === "all" || (nextLine?.has(v.rule) ?? false);
|
|
2464
|
-
}
|
|
2465
|
-
#scanClassLiterals(file, scan, out) {
|
|
2466
|
-
for (const m of scan.matchAll(RAW_PALETTE_RE)) {
|
|
2467
|
-
out.push(this.#violation(file, m.index ?? 0, {
|
|
2468
|
-
rule: "raw-palette",
|
|
2469
|
-
severity: "error",
|
|
2470
|
-
suggestion: "\uC2DC\uB9E8\uD2F1 \uD1A0\uD070\uC73C\uB85C \uAD50\uCCB4\uD558\uC138\uC694 \u2014 \uC608: text-gray-500\u2192text-muted-foreground, bg-red-500\u2192bg-destructive, bg-blue-500\u2192bg-info. \uBE0C\uB79C\uB4DC \uC0C9\uC740 page/styles.css \uD1A0\uD070\uC5D0\uC11C \uC870\uC815\uD569\uB2C8\uB2E4."
|
|
2471
|
-
}));
|
|
2472
|
-
}
|
|
2473
|
-
for (const m of scan.matchAll(ARBITRARY_COLOR_RE)) {
|
|
2474
|
-
out.push(this.#violation(file, m.index ?? 0, {
|
|
2475
|
-
rule: "arbitrary-color",
|
|
2476
|
-
severity: "error",
|
|
2477
|
-
suggestion: "\uC784\uC758 \uC0C9 \uB9AC\uD130\uB7F4 \uB300\uC2E0 \uD1A0\uD070\uC744 \uC4F0\uC138\uC694 \u2014 bg-[#3b82f6]\u2192bg-info, text-[rgb(...)]\u2192\uC2DC\uB9E8\uD2F1 \uD1A0\uD070. \uAF2D \uD544\uC694\uD558\uBA74 \uC2A4\uCF54\uD504 \uD1A0\uD070(.campaign-x { --primary: \u2026 })\uC744 \uC815\uC758\uD558\uC138\uC694."
|
|
2478
|
-
}));
|
|
2479
|
-
}
|
|
2480
|
-
for (const m of scan.matchAll(DAISYUI_LEGACY_RE)) {
|
|
2481
|
-
out.push(this.#violation(file, m.index ?? 0, {
|
|
2482
|
-
rule: "daisyui-legacy",
|
|
2483
|
-
severity: "error",
|
|
2484
|
-
suggestion: "daisyUI \uD074\uB798\uC2A4\uB294 \uC81C\uAC70\uB410\uC2B5\uB2C8\uB2E4. akanjs/ui \uD504\uB9AC\uBBF8\uD2F0\uBE0C(Button/Badge \uB4F1)\uB098 buttonRecipe()/badgeRecipe() + \uC2DC\uB9E8\uD2F1 \uD1A0\uD070\uC73C\uB85C \uAD50\uCCB4\uD558\uC138\uC694."
|
|
2485
|
-
}));
|
|
2486
|
-
}
|
|
2487
|
-
for (const m of scan.matchAll(INTERPOLATED_ARBITRARY_RE)) {
|
|
2488
|
-
out.push(this.#violation(file, m.index ?? 0, {
|
|
2489
|
-
rule: "interpolated-arbitrary",
|
|
2490
|
-
severity: "error",
|
|
2491
|
-
suggestion: "\uB7F0\uD0C0\uC784 \uAC12\uC73C\uB85C \uC784\uC758\uAC12 \uD074\uB798\uC2A4\uB97C \uC870\uB9BD\uD558\uBA74 CSS \uAC00 \uC0DD\uC131\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4(\uC2A4\uCE90\uB108\uB294 \uC18C\uC2A4 \uD14D\uC2A4\uD2B8\uB97C \uC77D\uC2B5\uB2C8\uB2E4). \uD06C\uAE30/\uC704\uCE58\uB294 style prop \uC73C\uB85C \uB118\uAE30\uC138\uC694 \u2014 style={{ minHeight }}. \uAC12\uC774 enum \uC774\uBA74 \uB9AC\uD130\uB7F4 \uD074\uB798\uC2A4 \uB9F5\uC73C\uB85C \uB450\uC138\uC694."
|
|
2492
|
-
}));
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
#scanInlineColors(file, scan, out) {
|
|
2496
|
-
const push = (index) => out.push(this.#violation(file, index, {
|
|
2497
|
-
rule: "inline-color",
|
|
2498
|
-
severity: "error",
|
|
2499
|
-
suggestion: "\uC778\uB77C\uC778 \uC0C9 \uB9AC\uD130\uB7F4 \uB300\uC2E0 CSS \uBCC0\uC218/\uD1A0\uD070\uC744 \uCC38\uC870\uD558\uC138\uC694 \u2014 style={{ color: 'var(--primary)' }} \uB610\uB294 \uC2DC\uB9E8\uD2F1 \uD074\uB798\uC2A4(text-primary). \uD558\uB4DC\uCF54\uB529 hex/rgb \uB294 \uD14C\uB9C8 \uC804\uD658\uC744 \uAE68\uB728\uB9BD\uB2C8\uB2E4."
|
|
2500
|
-
}));
|
|
2501
|
-
for (const region of [STYLE_OBJECT_RE, STYLE_TAG_RE]) {
|
|
2502
|
-
for (const m of scan.matchAll(region)) {
|
|
2503
|
-
const inner = m[1] ?? "";
|
|
2504
|
-
const innerStart = (m.index ?? 0) + m[0].indexOf(inner);
|
|
2505
|
-
for (const lit of inner.matchAll(INLINE_COLOR_LITERAL_RE)) {
|
|
2506
|
-
push(innerStart + (lit.index ?? 0));
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
}
|
|
2511
|
-
#violation(file, index, base) {
|
|
2512
|
-
const before = file.content.slice(0, index);
|
|
2513
|
-
const line = before.length === 0 ? 1 : before.split(`
|
|
2514
|
-
`).length;
|
|
2515
|
-
const lineStart = before.lastIndexOf(`
|
|
2516
|
-
`) + 1;
|
|
2517
|
-
const lineEnd = file.content.indexOf(`
|
|
2518
|
-
`, index);
|
|
2519
|
-
const snippet = file.content.slice(lineStart, lineEnd === -1 ? undefined : lineEnd).trim();
|
|
2520
|
-
return { ...base, path: file.path, line, snippet };
|
|
2521
|
-
}
|
|
2522
|
-
static countNamedComponentClasses(css) {
|
|
2523
|
-
const names = new Set;
|
|
2524
|
-
const layerRe = /@layer\s+components\s*\{/g;
|
|
2525
|
-
for (const layer of css.matchAll(layerRe)) {
|
|
2526
|
-
const bodyStart = (layer.index ?? 0) + layer[0].length;
|
|
2527
|
-
const body = StyleGuard.#extractBalanced(css, bodyStart);
|
|
2528
|
-
for (const sel of body.matchAll(/(^|[\s}])\.(-?[a-zA-Z_][\w-]*)/g))
|
|
2529
|
-
names.add(sel[2]);
|
|
2530
|
-
}
|
|
2531
|
-
return { count: names.size, names: [...names].sort() };
|
|
2532
|
-
}
|
|
2533
|
-
static #extractBalanced(css, start) {
|
|
2534
|
-
let depth = 1;
|
|
2535
|
-
for (let i = start;i < css.length; i++) {
|
|
2536
|
-
const ch = css[i];
|
|
2537
|
-
if (ch === "{")
|
|
2538
|
-
depth++;
|
|
2539
|
-
else if (ch === "}") {
|
|
2540
|
-
depth--;
|
|
2541
|
-
if (depth === 0)
|
|
2542
|
-
return css.slice(start, i);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
return css.slice(start);
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
2343
|
export { AllRoutesBuilder, CsrArtifactBuilder, CssCompiler, FontOptimizer, PagesBundleBuilder, precompressArtifacts, SsrBaseArtifactBuilder };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-g9e2fhw2.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
7
|
} from "./index-j37qq1f2.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-n706txcv.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT_BLOCK_END,
|
|
14
14
|
AGENT_BLOCK_START,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
renderRecipeEntries,
|
|
20
20
|
stampBlockVersion,
|
|
21
21
|
upsertAgentBlock
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-8vkkm7v0.js";
|
|
23
23
|
import {
|
|
24
24
|
collectRecipeSources,
|
|
25
25
|
scanRecipes
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./index-ss469dec.js";
|
|
5
5
|
import {
|
|
6
6
|
PageScript
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-qc0tnhs2.js";
|
|
8
8
|
import {
|
|
9
9
|
AiSession
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-sh01r3pm.js";
|
|
11
11
|
import {
|
|
12
12
|
bilingualDescriptionForField,
|
|
13
13
|
bilingualLabelForField,
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
generatedFilesForSync,
|
|
16
16
|
moduleSourcePaths,
|
|
17
17
|
sourceFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-tsmjxph2.js";
|
|
19
19
|
import {
|
|
20
20
|
Prompter
|
|
21
21
|
} from "./index-j37qq1f2.js";
|
|
22
22
|
import {
|
|
23
23
|
runner,
|
|
24
24
|
script
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-n706txcv.js";
|
|
26
26
|
import {
|
|
27
27
|
ModuleExecutor
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-8vkkm7v0.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSys
|
|
31
31
|
} from "./index-67546d0j.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ModuleExecutor,
|
|
7
7
|
PkgExecutor,
|
|
8
8
|
WorkspaceExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-8vkkm7v0.js";
|
|
10
10
|
import {
|
|
11
11
|
getDirname
|
|
12
12
|
} from "./index-1577bej2.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./index-67546d0j.js";
|
|
16
16
|
import {
|
|
17
17
|
__require
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-yb2wsc7f.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/devkit/commandDecorators/targetMeta.ts
|
|
21
21
|
var COMMAND_META = Symbol("akan.command.meta");
|
|
@@ -849,6 +849,7 @@ class ClientEntriesBundler {
|
|
|
849
849
|
#externalSubpaths;
|
|
850
850
|
#externalAliases;
|
|
851
851
|
#command;
|
|
852
|
+
#target;
|
|
852
853
|
#outputSubdir;
|
|
853
854
|
#reactFastRefresh;
|
|
854
855
|
#artifactDir;
|
|
@@ -870,6 +871,7 @@ class ClientEntriesBundler {
|
|
|
870
871
|
this.#externalSubpaths = options.externalSubpaths ?? [];
|
|
871
872
|
this.#externalAliases = options.externalAliases ?? {};
|
|
872
873
|
this.#command = options.command ?? "start";
|
|
874
|
+
this.#target = options.target ?? "browser";
|
|
873
875
|
this.#outputSubdir = options.outputSubdir ?? "client";
|
|
874
876
|
this.#reactFastRefresh = options.reactFastRefresh ?? false;
|
|
875
877
|
this.#artifactDir = `${this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath}/.akan/artifact`;
|
|
@@ -883,7 +885,7 @@ class ClientEntriesBundler {
|
|
|
883
885
|
entrypoints: this.#opaqueEntries.entries,
|
|
884
886
|
outdir: this.#outdir,
|
|
885
887
|
splitting: true,
|
|
886
|
-
target:
|
|
888
|
+
target: this.#target,
|
|
887
889
|
format: "esm",
|
|
888
890
|
naming: CLIENT_BUNDLE_NAMING,
|
|
889
891
|
metafile: true,
|
|
@@ -1117,7 +1119,8 @@ var VENDOR_SPECIFIERS = [
|
|
|
1117
1119
|
"akanjs/store",
|
|
1118
1120
|
"akanjs/base",
|
|
1119
1121
|
"akanjs/common",
|
|
1120
|
-
"akanjs/constant"
|
|
1122
|
+
"akanjs/constant",
|
|
1123
|
+
"akanjs/fetch"
|
|
1121
1124
|
];
|
|
1122
1125
|
|
|
1123
1126
|
// pkgs/@akanjs/devkit/frontendBuild/routeClientBuilder.ts
|
|
@@ -1226,12 +1229,11 @@ class RouteClientBuilder {
|
|
|
1226
1229
|
}).bundle();
|
|
1227
1230
|
}
|
|
1228
1231
|
async#buildSsrBundle(bootstrapEntries) {
|
|
1229
|
-
const externalOptions = RouteClientBuilder.resolveSsrClientExternalOptions(this.#command);
|
|
1230
1232
|
return new ClientEntriesBundler({
|
|
1231
1233
|
app: this.#app,
|
|
1232
1234
|
entries: bootstrapEntries.buildEntries,
|
|
1233
1235
|
plugins: [await createBarrelImportsPlugin(this.#app)],
|
|
1234
|
-
...
|
|
1236
|
+
...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
|
|
1235
1237
|
outputSubdir: "client-ssr",
|
|
1236
1238
|
command: this.#command
|
|
1237
1239
|
}).bundle();
|
|
@@ -1293,15 +1295,16 @@ ${defaultNames.map((name) => `export default ${name};`).join(`
|
|
|
1293
1295
|
const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
|
|
1294
1296
|
return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
|
|
1295
1297
|
}
|
|
1296
|
-
static
|
|
1298
|
+
static resolveSsrClientBundleOptions(command) {
|
|
1297
1299
|
if (command === "start") {
|
|
1298
1300
|
return {
|
|
1301
|
+
target: "bun",
|
|
1299
1302
|
external: SSR_CLIENT_EXTERNALS,
|
|
1300
1303
|
externalSubpaths: ["akanjs/fetch"],
|
|
1301
1304
|
externalAliases: RouteClientBuilder.resolveSsrClientRuntimeAliases()
|
|
1302
1305
|
};
|
|
1303
1306
|
}
|
|
1304
|
-
return { external: SSR_CLIENT_ALIAS_EXTERNALS };
|
|
1307
|
+
return { target: "bun", external: SSR_CLIENT_ALIAS_EXTERNALS };
|
|
1305
1308
|
}
|
|
1306
1309
|
static resolveAkanServerEntry() {
|
|
1307
1310
|
try {
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
GlobalConfig,
|
|
6
6
|
getDefaultHostConfig
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-sh01r3pm.js";
|
|
8
8
|
import {
|
|
9
9
|
openBrowser
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-ae8ptzzm.js";
|
|
11
11
|
import {
|
|
12
12
|
runner
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-n706txcv.js";
|
|
14
14
|
import {
|
|
15
15
|
AppExecutor,
|
|
16
16
|
WorkspaceExecutor
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-8vkkm7v0.js";
|
|
18
18
|
|
|
19
19
|
// pkgs/@akanjs/cli/npmRegistry.ts
|
|
20
20
|
var defaultNpmRegistry = "https://registry.npmjs.org";
|
|
@@ -240,7 +240,7 @@ import { ChatOpenAI } from "@langchain/openai";
|
|
|
240
240
|
import { Logger } from "akanjs/common";
|
|
241
241
|
import chalk from "chalk";
|
|
242
242
|
var MAX_ASK_TRY = 300;
|
|
243
|
-
var deepSeekLlmModels = ["deepseek-
|
|
243
|
+
var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
|
|
244
244
|
var openAiLlmModels = ["gpt-5.5"];
|
|
245
245
|
var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
|
|
246
246
|
var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
|