@akanjs/cli 2.4.1-rc.2 → 2.4.1-rc.4
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 -0
- package/{agent.command-h4afc69n.js → agent.command-t4346579.js} +6 -6
- package/{application.command-47mj9qsy.js → application.command-zkmeemdt.js} +5 -4
- package/{applicationBuildRunner-yz144508.js → applicationBuildRunner-5w8j9yp7.js} +2 -1
- package/buildBatch.proc.js +176 -0
- package/{capacitorApp-y0h6cgft.js → capacitorApp-wnxzrppx.js} +2 -2
- package/{cloud.command-hxcgsf80.js → cloud.command-5ztqxppm.js} +9 -8
- package/{context.command-nqbtak4f.js → context.command-smwxwgwf.js} +14 -14
- package/{guideline.command-ya0dh44f.js → guideline.command-1r0esdjs.js} +3 -3
- package/incrementalBuilder.proc.js +281 -160
- package/index-0fn1r7gg.js +466 -0
- package/{index-qhtr07v8.js → index-0jwvs8vp.js} +19 -19
- package/{index-a6sbyy0b.js → index-0t7pwff2.js} +3 -0
- package/{index-h6ca6qg0.js → index-2v10yr8g.js} +1 -1
- package/{index-73pr2cmy.js → index-2v6a4wd5.js} +4 -4
- package/{index-45aj5ry0.js → index-3sd2vape.js} +3 -3
- package/{index-y3hdhy4p.js → index-ahpcr9ss.js} +5 -5
- package/{index-8rc0bm04.js → index-eay4t1te.js} +2 -2
- package/{index-qaq13qk3.js → index-eqxmxan6.js} +1 -1
- package/{index-pmm9e2jf.js → index-fh990y67.js} +2 -2
- package/{index-sgmas1fc.js → index-gr4cjv99.js} +5 -5
- package/{index-1xdrsbry.js → index-hk58kr1m.js} +1 -1
- package/{index-85msc0wg.js → index-jbtn8h1y.js} +3 -3
- package/{index-a5rmdgy4.js → index-khzzttv1.js} +1362 -1447
- package/{index-77crfweb.js → index-n5y2gbf2.js} +478 -20
- package/{index-n6h3482q.js → index-nv7et4t3.js} +2 -2
- package/{index-hwzpw9c1.js → index-pya1h7wx.js} +3 -3
- package/{index-hdqztm58.js → index-qpz4csbs.js} +1 -1
- package/{index-mq6ns0f9.js → index-s9yajzkj.js} +9 -9
- package/{index-8pkbzj26.js → index-wh201a76.js} +7 -7
- package/{index-swf4bmbg.js → index-y4kg682s.js} +1 -1
- package/index.js +18 -18
- package/{library.command-r15zdqvp.js → library.command-jrew04m6.js} +3 -3
- package/{localRegistry.command-6z4s13mj.js → localRegistry.command-m08dkm1b.js} +8 -7
- package/{module.command-qrj3kmyz.js → module.command-p98t7522.js} +6 -6
- package/{package.command-5x5m0ej1.js → package.command-57dyrfmn.js} +3 -3
- package/package.json +2 -2
- package/{page.command-c6xdx0xm.js → page.command-tas6f3na.js} +3 -3
- package/{primitive.command-pv9ssmtf.js → primitive.command-bjrbsakw.js} +7 -7
- package/{quality.command-es67wvdp.js → quality.command-zavaafbw.js} +2 -2
- package/{repair.command-677675vw.js → repair.command-je57wx67.js} +5 -5
- package/{scalar.command-kabkd6wd.js → scalar.command-gqqyy1kr.js} +5 -5
- package/{workflow.command-64r6cw0w.js → workflow.command-d6mrc47s.js} +10 -10
- package/{workspace.command-875aj35r.js → workspace.command-bbg96z8k.js} +24 -23
package/.build-stamp
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cf0119c268ffd25d9a5f294b48dd17139368114c7beb2e14d958c18a47442b5f
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AgentScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
4
|
+
} from "./index-pya1h7wx.js";
|
|
5
|
+
import"./index-eay4t1te.js";
|
|
6
|
+
import"./index-2v10yr8g.js";
|
|
7
|
+
import"./index-eqxmxan6.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
command
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-qpz4csbs.js";
|
|
12
|
+
import"./index-0t7pwff2.js";
|
|
13
13
|
import"./index-61keag0s.js";
|
|
14
14
|
import"./index-6pz1j0zj.js";
|
|
15
15
|
import"./index-r24hmh0q.js";
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ApplicationScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-n5y2gbf2.js";
|
|
5
5
|
import {
|
|
6
6
|
getMobileTargetChoices
|
|
7
7
|
} from "./index-76rn3g2c.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-fh990y67.js";
|
|
9
9
|
import {
|
|
10
10
|
App,
|
|
11
11
|
Exec,
|
|
12
12
|
Sys,
|
|
13
13
|
Workspace,
|
|
14
14
|
command
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-qpz4csbs.js";
|
|
16
16
|
import"./index-fgc8r6dj.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-0t7pwff2.js";
|
|
18
18
|
import"./index-61keag0s.js";
|
|
19
|
+
import"./index-0fn1r7gg.js";
|
|
19
20
|
import"./index-6pz1j0zj.js";
|
|
20
21
|
import"./index-r24hmh0q.js";
|
|
21
22
|
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AppExecutor,
|
|
4
|
+
WorkspaceExecutor
|
|
5
|
+
} from "./index-0t7pwff2.js";
|
|
6
|
+
import"./index-61keag0s.js";
|
|
7
|
+
import {
|
|
8
|
+
CsrArtifactBuilder,
|
|
9
|
+
CssCompiler,
|
|
10
|
+
FontOptimizer,
|
|
11
|
+
PagesBundleBuilder
|
|
12
|
+
} from "./index-khzzttv1.js";
|
|
13
|
+
import"./index-0fn1r7gg.js";
|
|
14
|
+
import"./index-6pz1j0zj.js";
|
|
15
|
+
import"./index-r24hmh0q.js";
|
|
16
|
+
|
|
17
|
+
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
18
|
+
import path from "path";
|
|
19
|
+
import { Logger } from "akanjs/common";
|
|
20
|
+
|
|
21
|
+
class BuildBatch {
|
|
22
|
+
#logger = new Logger("BuildBatch");
|
|
23
|
+
#request;
|
|
24
|
+
#app;
|
|
25
|
+
#result;
|
|
26
|
+
constructor(request, app) {
|
|
27
|
+
this.#request = request;
|
|
28
|
+
this.#app = app;
|
|
29
|
+
this.#result = { generation: request.generation, errors: {} };
|
|
30
|
+
}
|
|
31
|
+
async run() {
|
|
32
|
+
if (this.#request.needs.includes("csr"))
|
|
33
|
+
await this.#buildCsr();
|
|
34
|
+
if (this.#request.needs.includes("pages"))
|
|
35
|
+
await this.#buildPages();
|
|
36
|
+
if (this.#request.needs.includes("css"))
|
|
37
|
+
await this.#buildCss();
|
|
38
|
+
return this.#result;
|
|
39
|
+
}
|
|
40
|
+
#emit(message) {
|
|
41
|
+
process.send?.(message);
|
|
42
|
+
}
|
|
43
|
+
#emitStatus(phase, message) {
|
|
44
|
+
this.#emit({
|
|
45
|
+
type: "build-status",
|
|
46
|
+
data: {
|
|
47
|
+
generation: this.#request.generation,
|
|
48
|
+
phase,
|
|
49
|
+
ok: !message,
|
|
50
|
+
files: this.#request.changedFiles,
|
|
51
|
+
message
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async#buildCsr() {
|
|
56
|
+
const started = Date.now();
|
|
57
|
+
try {
|
|
58
|
+
await new CsrArtifactBuilder(this.#app).build();
|
|
59
|
+
this.#logger.verbose(`csr-rebundle ok (${Date.now() - started}ms)`);
|
|
60
|
+
this.#emitStatus("csr");
|
|
61
|
+
} catch (err) {
|
|
62
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
63
|
+
this.#logger.error(`csr-rebundle failed: ${message}`);
|
|
64
|
+
this.#result.errors.csr = message;
|
|
65
|
+
this.#emitStatus("csr", message);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async#buildPages() {
|
|
69
|
+
const started = Date.now();
|
|
70
|
+
try {
|
|
71
|
+
const next = await new PagesBundleBuilder(this.#app).build();
|
|
72
|
+
this.#emit({
|
|
73
|
+
type: "pages-updated",
|
|
74
|
+
data: {
|
|
75
|
+
bundlePath: next.bundlePath,
|
|
76
|
+
buildId: next.buildId,
|
|
77
|
+
generation: this.#request.generation,
|
|
78
|
+
changedFiles: this.#request.changedFiles
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
this.#emitStatus("pages");
|
|
82
|
+
this.#logger.verbose(`pages-rebundle ok buildId=${next.buildId} (${Date.now() - started}ms)`);
|
|
83
|
+
} catch (err) {
|
|
84
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
85
|
+
this.#logger.error(`pages-rebundle failed: ${message}`);
|
|
86
|
+
this.#result.errors.pages = message;
|
|
87
|
+
this.#emitStatus("pages", message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async#buildCss() {
|
|
91
|
+
const started = Date.now();
|
|
92
|
+
try {
|
|
93
|
+
const cssByBasePath = await new CssCompiler(this.#app).getCssByBasePath({ refresh: true });
|
|
94
|
+
const optimizedFonts = await this.#optimizeFonts();
|
|
95
|
+
const cssAssetEntries = [];
|
|
96
|
+
const cssBase64ByUrl = {};
|
|
97
|
+
await Promise.all(Object.entries(cssByBasePath).map(async ([basePath, baseCssText]) => {
|
|
98
|
+
const cssText = [baseCssText, optimizedFonts.css].filter(Boolean).join(`
|
|
99
|
+
`);
|
|
100
|
+
if (!cssText)
|
|
101
|
+
return;
|
|
102
|
+
const cssAssetName = basePath || "root";
|
|
103
|
+
const cssHash = Bun.hash(`${basePath}
|
|
104
|
+
${cssText}`).toString(36);
|
|
105
|
+
const cssRelPath = `styles/${cssAssetName}-${cssHash}.css`;
|
|
106
|
+
const cssUrl = `/_akan/styles/${cssAssetName}-${cssHash}.css`;
|
|
107
|
+
await Bun.write(path.join(this.#request.artifactDir, cssRelPath), cssText);
|
|
108
|
+
cssAssetEntries.push([basePath, { cssUrl, cssRelPath }]);
|
|
109
|
+
cssBase64ByUrl[cssUrl] = Buffer.from(new TextEncoder().encode(cssText)).toString("base64");
|
|
110
|
+
}));
|
|
111
|
+
const cssAssets = Object.fromEntries(cssAssetEntries);
|
|
112
|
+
this.#result.cssAssets = cssAssets;
|
|
113
|
+
this.#emitStatus("css");
|
|
114
|
+
if (JSON.stringify(this.#request.cssAssets ?? {}) === JSON.stringify(cssAssets)) {
|
|
115
|
+
this.#logger.verbose("css-rebuild unchanged assets; broadcast skipped");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
this.#emit({
|
|
119
|
+
type: "css-updated",
|
|
120
|
+
data: {
|
|
121
|
+
cssAssets,
|
|
122
|
+
cssBase64ByUrl,
|
|
123
|
+
generation: this.#request.generation,
|
|
124
|
+
changedFiles: this.#request.changedFiles
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
this.#logger.verbose(`css-compile ok assets=${Object.keys(cssAssets).length} (${Date.now() - started}ms)`);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
130
|
+
this.#logger.error(`css-rebuild failed: ${message}`);
|
|
131
|
+
this.#result.errors.css = message;
|
|
132
|
+
this.#emitStatus("css", message);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async#optimizeFonts() {
|
|
136
|
+
const previous = this.#request.optimizedFonts;
|
|
137
|
+
if (previous && !BuildBatch.#shouldReoptimizeFonts(previous, this.#request.changedFiles)) {
|
|
138
|
+
this.#logger.verbose(`font-optimize cached files=${previous.files.length}`);
|
|
139
|
+
return previous;
|
|
140
|
+
}
|
|
141
|
+
const started = Date.now();
|
|
142
|
+
const optimizedFonts = await new FontOptimizer(this.#app, "start").optimize();
|
|
143
|
+
this.#result.optimizedFonts = optimizedFonts;
|
|
144
|
+
this.#logger.verbose(`font-optimize ok files=${optimizedFonts.files.length} (${Date.now() - started}ms)`);
|
|
145
|
+
return optimizedFonts;
|
|
146
|
+
}
|
|
147
|
+
static #shouldReoptimizeFonts(previous, changedFiles) {
|
|
148
|
+
if (changedFiles.length === 0)
|
|
149
|
+
return false;
|
|
150
|
+
return changedFiles.some((file) => {
|
|
151
|
+
const normalized = path.resolve(file);
|
|
152
|
+
if (/\.(woff2?|ttf|otf)$/i.test(normalized))
|
|
153
|
+
return true;
|
|
154
|
+
return previous.files.some((fontFile) => path.resolve(fontFile) === normalized);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
static async main() {
|
|
158
|
+
const raw = process.argv[2];
|
|
159
|
+
if (!raw)
|
|
160
|
+
throw new Error("[build-batch] missing request argument");
|
|
161
|
+
const request = JSON.parse(raw);
|
|
162
|
+
const workspace = WorkspaceExecutor.fromRoot({
|
|
163
|
+
workspaceRoot: request.workspaceRoot,
|
|
164
|
+
repoName: request.repoName
|
|
165
|
+
});
|
|
166
|
+
const app = AppExecutor.from(workspace, request.appName);
|
|
167
|
+
if (request.pageKeys)
|
|
168
|
+
app.setPageKeys(request.pageKeys);
|
|
169
|
+
const result = await new BuildBatch(request, app).run();
|
|
170
|
+
process.send?.({ type: "build-batch-result", data: result });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
BuildBatch.main().catch((err) => {
|
|
174
|
+
console.error(err);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
});
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
selectLocalDevHost,
|
|
25
25
|
sortIosRunTargets,
|
|
26
26
|
writeRootCapacitorConfig
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-hk58kr1m.js";
|
|
28
28
|
import"./index-76rn3g2c.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-0t7pwff2.js";
|
|
30
30
|
import"./index-61keag0s.js";
|
|
31
31
|
import"./index-6pz1j0zj.js";
|
|
32
32
|
import"./index-r24hmh0q.js";
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-77crfweb.js";
|
|
7
|
-
import"./index-76rn3g2c.js";
|
|
8
|
-
import"./index-pmm9e2jf.js";
|
|
9
|
-
import"./index-n6h3482q.js";
|
|
4
|
+
} from "./index-s9yajzkj.js";
|
|
5
|
+
import"./index-gr4cjv99.js";
|
|
10
6
|
import {
|
|
11
7
|
GlobalConfig
|
|
12
8
|
} from "./index-5vvwc0cz.js";
|
|
9
|
+
import"./index-n5y2gbf2.js";
|
|
10
|
+
import"./index-76rn3g2c.js";
|
|
11
|
+
import"./index-fh990y67.js";
|
|
12
|
+
import"./index-nv7et4t3.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-qpz4csbs.js";
|
|
17
17
|
import"./index-fgc8r6dj.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-0t7pwff2.js";
|
|
19
19
|
import"./index-x53a5nya.js";
|
|
20
20
|
import"./index-61keag0s.js";
|
|
21
|
+
import"./index-0fn1r7gg.js";
|
|
21
22
|
import"./index-6pz1j0zj.js";
|
|
22
23
|
import"./index-r24hmh0q.js";
|
|
23
24
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ContextScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-76rn3g2c.js";
|
|
12
|
-
import"./index-8pkbzj26.js";
|
|
13
|
-
import"./index-swf4bmbg.js";
|
|
4
|
+
} from "./index-0jwvs8vp.js";
|
|
5
|
+
import"./index-jbtn8h1y.js";
|
|
6
|
+
import"./index-3sd2vape.js";
|
|
7
|
+
import"./index-ahpcr9ss.js";
|
|
8
|
+
import"./index-2v6a4wd5.js";
|
|
9
|
+
import"./index-wh201a76.js";
|
|
10
|
+
import"./index-y4kg682s.js";
|
|
14
11
|
import"./index-ss469dec.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
12
|
+
import"./index-hk58kr1m.js";
|
|
13
|
+
import"./index-eay4t1te.js";
|
|
14
|
+
import"./index-2v10yr8g.js";
|
|
15
|
+
import"./index-eqxmxan6.js";
|
|
17
16
|
import"./index-5vvwc0cz.js";
|
|
17
|
+
import"./index-76rn3g2c.js";
|
|
18
18
|
import {
|
|
19
19
|
Workspace,
|
|
20
20
|
command
|
|
21
|
-
} from "./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
} from "./index-qpz4csbs.js";
|
|
22
|
+
import"./index-0t7pwff2.js";
|
|
23
23
|
import"./index-61keag0s.js";
|
|
24
24
|
import"./index-6pz1j0zj.js";
|
|
25
25
|
import"./index-r24hmh0q.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
Prompter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-eqxmxan6.js";
|
|
5
5
|
import {
|
|
6
6
|
AiSession
|
|
7
7
|
} from "./index-5vvwc0cz.js";
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
command,
|
|
11
11
|
runner,
|
|
12
12
|
script
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-qpz4csbs.js";
|
|
14
14
|
import {
|
|
15
15
|
getDirname
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-0t7pwff2.js";
|
|
17
17
|
import {
|
|
18
18
|
FileSys
|
|
19
19
|
} from "./index-61keag0s.js";
|