@akanjs/cli 2.1.0 → 2.1.1-rc.1
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/README.ko.md +63 -0
- package/README.md +62 -0
- package/guidelines/componentRule/componentRule.generate.json +4 -10
- package/guidelines/cssRule/cssRule.generate.json +4 -10
- package/guidelines/docPageRule/docPageRule.generate.json +4 -10
- package/guidelines/docPageRule/docPageRule.instruction.md +1 -1
- package/guidelines/docSyncRule/docSyncRule.generate.json +4 -10
- package/guidelines/enumConstant/enumConstant.generate.json +4 -10
- package/guidelines/fieldRule/fieldRule.generate.json +4 -10
- package/guidelines/framework/framework.generate.json +4 -10
- package/guidelines/modelConstant/modelConstant.generate.json +4 -10
- package/guidelines/modelDictionary/modelDictionary.generate.json +4 -10
- package/guidelines/modelDocument/modelDocument.generate.json +4 -10
- package/guidelines/modelService/modelService.generate.json +4 -10
- package/guidelines/modelSignal/modelSignal.generate.json +4 -10
- package/guidelines/modelStore/modelStore.generate.json +4 -10
- package/guidelines/modelTemplate/modelTemplate.generate.json +4 -10
- package/guidelines/modelUnit/modelUnit.generate.json +4 -10
- package/guidelines/modelUtil/modelUtil.generate.json +4 -10
- package/guidelines/modelView/modelView.generate.json +4 -10
- package/guidelines/modelZone/modelZone.generate.json +4 -10
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +4 -10
- package/guidelines/moduleOverview/moduleOverview.generate.json +4 -10
- package/guidelines/scalarConstant/scalarConstant.generate.json +4 -10
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +4 -10
- package/guidelines/scalarModule/scalarModule.generate.json +4 -10
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +4 -10
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +4 -10
- package/incrementalBuilder.proc.js +455 -18
- package/index.js +532 -33
- package/package.json +3 -2
- package/templates/libRoot/lib/___libName__/__libName__.signal.ts +15 -0
- package/typecheck.proc.js +31 -0
|
@@ -1,6 +1,328 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
12
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
20
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
+
for (let key of __getOwnPropNames(mod))
|
|
23
|
+
if (!__hasOwnProp.call(to, key))
|
|
24
|
+
__defProp(to, key, {
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
2
33
|
var __require = import.meta.require;
|
|
3
34
|
|
|
35
|
+
// node_modules/dayjs/dayjs.min.js
|
|
36
|
+
var require_dayjs_min = __commonJS((exports, module) => {
|
|
37
|
+
(function(t, e) {
|
|
38
|
+
typeof exports == "object" && typeof module != "undefined" ? module.exports = e() : typeof define == "function" && define.amd ? define(e) : (t = typeof globalThis != "undefined" ? globalThis : t || self).dayjs = e();
|
|
39
|
+
})(exports, function() {
|
|
40
|
+
var t = 1000, e = 60000, n = 3600000, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
41
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
42
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
43
|
+
} }, m = function(t2, e2, n2) {
|
|
44
|
+
var r2 = String(t2);
|
|
45
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
46
|
+
}, v = { s: m, z: function(t2) {
|
|
47
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
48
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
49
|
+
}, m: function t2(e2, n2) {
|
|
50
|
+
if (e2.date() < n2.date())
|
|
51
|
+
return -t2(n2, e2);
|
|
52
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
53
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
54
|
+
}, a: function(t2) {
|
|
55
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
56
|
+
}, p: function(t2) {
|
|
57
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
58
|
+
}, u: function(t2) {
|
|
59
|
+
return t2 === undefined;
|
|
60
|
+
} }, g = "en", D = {};
|
|
61
|
+
D[g] = M;
|
|
62
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
63
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
64
|
+
}, w = function t2(e2, n2, r2) {
|
|
65
|
+
var i2;
|
|
66
|
+
if (!e2)
|
|
67
|
+
return g;
|
|
68
|
+
if (typeof e2 == "string") {
|
|
69
|
+
var s2 = e2.toLowerCase();
|
|
70
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
71
|
+
var u2 = e2.split("-");
|
|
72
|
+
if (!i2 && u2.length > 1)
|
|
73
|
+
return t2(u2[0]);
|
|
74
|
+
} else {
|
|
75
|
+
var a2 = e2.name;
|
|
76
|
+
D[a2] = e2, i2 = a2;
|
|
77
|
+
}
|
|
78
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
79
|
+
}, O = function(t2, e2) {
|
|
80
|
+
if (S(t2))
|
|
81
|
+
return t2.clone();
|
|
82
|
+
var n2 = typeof e2 == "object" ? e2 : {};
|
|
83
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
84
|
+
}, b = v;
|
|
85
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
86
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
87
|
+
};
|
|
88
|
+
var _ = function() {
|
|
89
|
+
function M2(t2) {
|
|
90
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
91
|
+
}
|
|
92
|
+
var m2 = M2.prototype;
|
|
93
|
+
return m2.parse = function(t2) {
|
|
94
|
+
this.$d = function(t3) {
|
|
95
|
+
var { date: e2, utc: n2 } = t3;
|
|
96
|
+
if (e2 === null)
|
|
97
|
+
return new Date(NaN);
|
|
98
|
+
if (b.u(e2))
|
|
99
|
+
return new Date;
|
|
100
|
+
if (e2 instanceof Date)
|
|
101
|
+
return new Date(e2);
|
|
102
|
+
if (typeof e2 == "string" && !/Z$/i.test(e2)) {
|
|
103
|
+
var r2 = e2.match($2);
|
|
104
|
+
if (r2) {
|
|
105
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
106
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return new Date(e2);
|
|
110
|
+
}(t2), this.init();
|
|
111
|
+
}, m2.init = function() {
|
|
112
|
+
var t2 = this.$d;
|
|
113
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
114
|
+
}, m2.$utils = function() {
|
|
115
|
+
return b;
|
|
116
|
+
}, m2.isValid = function() {
|
|
117
|
+
return !(this.$d.toString() === l);
|
|
118
|
+
}, m2.isSame = function(t2, e2) {
|
|
119
|
+
var n2 = O(t2);
|
|
120
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
121
|
+
}, m2.isAfter = function(t2, e2) {
|
|
122
|
+
return O(t2) < this.startOf(e2);
|
|
123
|
+
}, m2.isBefore = function(t2, e2) {
|
|
124
|
+
return this.endOf(e2) < O(t2);
|
|
125
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
126
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
127
|
+
}, m2.unix = function() {
|
|
128
|
+
return Math.floor(this.valueOf() / 1000);
|
|
129
|
+
}, m2.valueOf = function() {
|
|
130
|
+
return this.$d.getTime();
|
|
131
|
+
}, m2.startOf = function(t2, e2) {
|
|
132
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
133
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
134
|
+
return r2 ? i2 : i2.endOf(a);
|
|
135
|
+
}, $3 = function(t3, e3) {
|
|
136
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
137
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
138
|
+
switch (f2) {
|
|
139
|
+
case h:
|
|
140
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
141
|
+
case c:
|
|
142
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
143
|
+
case o:
|
|
144
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
145
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
146
|
+
case a:
|
|
147
|
+
case d:
|
|
148
|
+
return $3(v2 + "Hours", 0);
|
|
149
|
+
case u:
|
|
150
|
+
return $3(v2 + "Minutes", 1);
|
|
151
|
+
case s:
|
|
152
|
+
return $3(v2 + "Seconds", 2);
|
|
153
|
+
case i:
|
|
154
|
+
return $3(v2 + "Milliseconds", 3);
|
|
155
|
+
default:
|
|
156
|
+
return this.clone();
|
|
157
|
+
}
|
|
158
|
+
}, m2.endOf = function(t2) {
|
|
159
|
+
return this.startOf(t2, false);
|
|
160
|
+
}, m2.$set = function(t2, e2) {
|
|
161
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $3 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
162
|
+
if (o2 === c || o2 === h) {
|
|
163
|
+
var y2 = this.clone().set(d, 1);
|
|
164
|
+
y2.$d[l2]($3), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
165
|
+
} else
|
|
166
|
+
l2 && this.$d[l2]($3);
|
|
167
|
+
return this.init(), this;
|
|
168
|
+
}, m2.set = function(t2, e2) {
|
|
169
|
+
return this.clone().$set(t2, e2);
|
|
170
|
+
}, m2.get = function(t2) {
|
|
171
|
+
return this[b.p(t2)]();
|
|
172
|
+
}, m2.add = function(r2, f2) {
|
|
173
|
+
var d2, l2 = this;
|
|
174
|
+
r2 = Number(r2);
|
|
175
|
+
var $3 = b.p(f2), y2 = function(t2) {
|
|
176
|
+
var e2 = O(l2);
|
|
177
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
178
|
+
};
|
|
179
|
+
if ($3 === c)
|
|
180
|
+
return this.set(c, this.$M + r2);
|
|
181
|
+
if ($3 === h)
|
|
182
|
+
return this.set(h, this.$y + r2);
|
|
183
|
+
if ($3 === a)
|
|
184
|
+
return y2(1);
|
|
185
|
+
if ($3 === o)
|
|
186
|
+
return y2(7);
|
|
187
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$3] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
188
|
+
return b.w(m3, this);
|
|
189
|
+
}, m2.subtract = function(t2, e2) {
|
|
190
|
+
return this.add(-1 * t2, e2);
|
|
191
|
+
}, m2.format = function(t2) {
|
|
192
|
+
var e2 = this, n2 = this.$locale();
|
|
193
|
+
if (!this.isValid())
|
|
194
|
+
return n2.invalidDate || l;
|
|
195
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
196
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
197
|
+
}, d2 = function(t3) {
|
|
198
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
199
|
+
}, $3 = f2 || function(t3, e3, n3) {
|
|
200
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
201
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
202
|
+
};
|
|
203
|
+
return r2.replace(y, function(t3, r3) {
|
|
204
|
+
return r3 || function(t4) {
|
|
205
|
+
switch (t4) {
|
|
206
|
+
case "YY":
|
|
207
|
+
return String(e2.$y).slice(-2);
|
|
208
|
+
case "YYYY":
|
|
209
|
+
return b.s(e2.$y, 4, "0");
|
|
210
|
+
case "M":
|
|
211
|
+
return a2 + 1;
|
|
212
|
+
case "MM":
|
|
213
|
+
return b.s(a2 + 1, 2, "0");
|
|
214
|
+
case "MMM":
|
|
215
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
216
|
+
case "MMMM":
|
|
217
|
+
return h2(c2, a2);
|
|
218
|
+
case "D":
|
|
219
|
+
return e2.$D;
|
|
220
|
+
case "DD":
|
|
221
|
+
return b.s(e2.$D, 2, "0");
|
|
222
|
+
case "d":
|
|
223
|
+
return String(e2.$W);
|
|
224
|
+
case "dd":
|
|
225
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
226
|
+
case "ddd":
|
|
227
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
228
|
+
case "dddd":
|
|
229
|
+
return o2[e2.$W];
|
|
230
|
+
case "H":
|
|
231
|
+
return String(s2);
|
|
232
|
+
case "HH":
|
|
233
|
+
return b.s(s2, 2, "0");
|
|
234
|
+
case "h":
|
|
235
|
+
return d2(1);
|
|
236
|
+
case "hh":
|
|
237
|
+
return d2(2);
|
|
238
|
+
case "a":
|
|
239
|
+
return $3(s2, u2, true);
|
|
240
|
+
case "A":
|
|
241
|
+
return $3(s2, u2, false);
|
|
242
|
+
case "m":
|
|
243
|
+
return String(u2);
|
|
244
|
+
case "mm":
|
|
245
|
+
return b.s(u2, 2, "0");
|
|
246
|
+
case "s":
|
|
247
|
+
return String(e2.$s);
|
|
248
|
+
case "ss":
|
|
249
|
+
return b.s(e2.$s, 2, "0");
|
|
250
|
+
case "SSS":
|
|
251
|
+
return b.s(e2.$ms, 3, "0");
|
|
252
|
+
case "Z":
|
|
253
|
+
return i2;
|
|
254
|
+
}
|
|
255
|
+
return null;
|
|
256
|
+
}(t3) || i2.replace(":", "");
|
|
257
|
+
});
|
|
258
|
+
}, m2.utcOffset = function() {
|
|
259
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
260
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
261
|
+
var $3, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
262
|
+
return b.m(y2, m3);
|
|
263
|
+
};
|
|
264
|
+
switch (M3) {
|
|
265
|
+
case h:
|
|
266
|
+
$3 = D2() / 12;
|
|
267
|
+
break;
|
|
268
|
+
case c:
|
|
269
|
+
$3 = D2();
|
|
270
|
+
break;
|
|
271
|
+
case f:
|
|
272
|
+
$3 = D2() / 3;
|
|
273
|
+
break;
|
|
274
|
+
case o:
|
|
275
|
+
$3 = (g2 - v2) / 604800000;
|
|
276
|
+
break;
|
|
277
|
+
case a:
|
|
278
|
+
$3 = (g2 - v2) / 86400000;
|
|
279
|
+
break;
|
|
280
|
+
case u:
|
|
281
|
+
$3 = g2 / n;
|
|
282
|
+
break;
|
|
283
|
+
case s:
|
|
284
|
+
$3 = g2 / e;
|
|
285
|
+
break;
|
|
286
|
+
case i:
|
|
287
|
+
$3 = g2 / t;
|
|
288
|
+
break;
|
|
289
|
+
default:
|
|
290
|
+
$3 = g2;
|
|
291
|
+
}
|
|
292
|
+
return l2 ? $3 : b.a($3);
|
|
293
|
+
}, m2.daysInMonth = function() {
|
|
294
|
+
return this.endOf(c).$D;
|
|
295
|
+
}, m2.$locale = function() {
|
|
296
|
+
return D[this.$L];
|
|
297
|
+
}, m2.locale = function(t2, e2) {
|
|
298
|
+
if (!t2)
|
|
299
|
+
return this.$L;
|
|
300
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
301
|
+
return r2 && (n2.$L = r2), n2;
|
|
302
|
+
}, m2.clone = function() {
|
|
303
|
+
return b.w(this.$d, this);
|
|
304
|
+
}, m2.toDate = function() {
|
|
305
|
+
return new Date(this.valueOf());
|
|
306
|
+
}, m2.toJSON = function() {
|
|
307
|
+
return this.isValid() ? this.toISOString() : null;
|
|
308
|
+
}, m2.toISOString = function() {
|
|
309
|
+
return this.$d.toISOString();
|
|
310
|
+
}, m2.toString = function() {
|
|
311
|
+
return this.$d.toUTCString();
|
|
312
|
+
}, M2;
|
|
313
|
+
}(), Y = _.prototype;
|
|
314
|
+
return O.prototype = Y, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
315
|
+
Y[t2[1]] = function(e2) {
|
|
316
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
317
|
+
};
|
|
318
|
+
}), O.extend = function(t2, e2) {
|
|
319
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
320
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
321
|
+
return O(1000 * t2);
|
|
322
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
|
|
4
326
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
|
|
5
327
|
import path37 from "path";
|
|
6
328
|
|
|
@@ -24,9 +346,12 @@ import { mkdir } from "fs/promises";
|
|
|
24
346
|
var basePath = `${Bun.env.HOME ?? Bun.env.USERPROFILE}/.akan`;
|
|
25
347
|
var configPath = `${basePath}/config.json`;
|
|
26
348
|
var akanCloudHost = process.env.AKAN_PUBLIC_OPERATION_MODE === "local" ? "http://localhost" : "https://cloud.akanjs.com";
|
|
27
|
-
var akanCloudUrl = `${akanCloudHost}${process.env.AKAN_PUBLIC_OPERATION_MODE === "local" ? ":8282" : ""}
|
|
349
|
+
var akanCloudUrl = `${akanCloudHost}${process.env.AKAN_PUBLIC_OPERATION_MODE === "local" ? ":8282" : ""}/api`;
|
|
28
350
|
var defaultHostConfig = {};
|
|
29
|
-
var defaultAkanGlobalConfig = {
|
|
351
|
+
var defaultAkanGlobalConfig = {
|
|
352
|
+
cloudHost: {},
|
|
353
|
+
llm: null
|
|
354
|
+
};
|
|
30
355
|
|
|
31
356
|
// pkgs/@akanjs/devkit/fileSys.ts
|
|
32
357
|
import { stat } from "fs/promises";
|
|
@@ -2140,7 +2465,6 @@ class Executor {
|
|
|
2140
2465
|
this.logger = new Logger4(name);
|
|
2141
2466
|
this.logs = [];
|
|
2142
2467
|
this.cwdPath = cwdPath;
|
|
2143
|
-
//! TODO: 테스트 확인 필요
|
|
2144
2468
|
}
|
|
2145
2469
|
#stdout(data) {
|
|
2146
2470
|
if (Executor.verbose)
|
|
@@ -3982,6 +4306,16 @@ function findRootBoundaries(pageKeys, appCwdPath, basePaths) {
|
|
|
3982
4306
|
}
|
|
3983
4307
|
return [...boundaries.values()].sort((a, b) => a.segments.join("/").localeCompare(b.segments.join("/")));
|
|
3984
4308
|
}
|
|
4309
|
+
function hasAncestorRootBoundary(boundary, boundaries) {
|
|
4310
|
+
return boundaries.some((candidate) => candidate !== boundary && candidate.segments.length < boundary.segments.length && candidate.segments.every((segment, index) => boundary.segments[index] === segment));
|
|
4311
|
+
}
|
|
4312
|
+
function findExplicitRootLayoutAbsPath(pageKeys, appCwdPath) {
|
|
4313
|
+
const rootLayoutKey = pageKeys.find((key) => {
|
|
4314
|
+
const segments = getRootBoundarySegments(key);
|
|
4315
|
+
return segments !== null && segments.length === 0;
|
|
4316
|
+
});
|
|
4317
|
+
return rootLayoutKey ? path10.resolve(appCwdPath, "page", rootLayoutKey.replace(/^\.\//, "")) : null;
|
|
4318
|
+
}
|
|
3985
4319
|
function routePrefixForSegments(segments) {
|
|
3986
4320
|
const visible = segments.filter((segment) => !/^\(.+\)$/.test(segment));
|
|
3987
4321
|
return visible[0] ?? null;
|
|
@@ -3998,21 +4332,27 @@ async function writeGeneratedRootLayoutFile(opts) {
|
|
|
3998
4332
|
await mkdir3(path10.dirname(absPath), { recursive: true });
|
|
3999
4333
|
const sourceRel = opts.boundary.sourceAbsPath ? path10.relative(path10.dirname(absPath), opts.boundary.sourceAbsPath).split(path10.sep).join("/") : null;
|
|
4000
4334
|
const sourceSpecifier = sourceRel ? sourceRel.startsWith(".") ? sourceRel : `./${sourceRel}` : null;
|
|
4335
|
+
const inheritedSourceAbsPath = opts.rootSourceAbsPath && opts.rootSourceAbsPath !== opts.boundary.sourceAbsPath ? opts.rootSourceAbsPath : null;
|
|
4336
|
+
const inheritedSourceRel = inheritedSourceAbsPath ? path10.relative(path10.dirname(absPath), inheritedSourceAbsPath).split(path10.sep).join("/") : null;
|
|
4337
|
+
const inheritedSourceSpecifier = inheritedSourceRel ? inheritedSourceRel.startsWith(".") ? inheritedSourceRel : `./${inheritedSourceRel}` : null;
|
|
4001
4338
|
const clientImport = opts.includeStInit ? `import { st } from "@apps/${opts.appName}/client";
|
|
4002
4339
|
void st;
|
|
4003
4340
|
` : `import "@apps/${opts.appName}/client";
|
|
4341
|
+
`;
|
|
4342
|
+
const inheritedImport = inheritedSourceSpecifier ? `import * as inheritedLayout from ${JSON.stringify(inheritedSourceSpecifier)};
|
|
4343
|
+
` : `const inheritedLayout = {};
|
|
4004
4344
|
`;
|
|
4005
4345
|
const prefix = routePrefixForSegments(opts.boundary.segments);
|
|
4006
4346
|
const userImport = sourceSpecifier ? `import UserLayout, * as userLayout from ${JSON.stringify(sourceSpecifier)};
|
|
4007
4347
|
` : `const UserLayout = ({ children }) => children;
|
|
4008
4348
|
const userLayout = {};
|
|
4009
4349
|
`;
|
|
4010
|
-
const source = `import type { LayoutProps, PageProps } from "akanjs/client";
|
|
4350
|
+
const source = opts.includeSystemProvider ? `import type { LayoutProps, PageProps } from "akanjs/client";
|
|
4011
4351
|
import { loadFonts } from "akanjs/client";
|
|
4012
4352
|
import { System } from "akanjs/ui";
|
|
4013
4353
|
import { env } from "@apps/${opts.appName}/env/env.client";
|
|
4014
|
-
${clientImport}${userImport}
|
|
4015
|
-
const userFonts = userLayout.fonts ?? [];
|
|
4354
|
+
${clientImport}${inheritedImport}${userImport}
|
|
4355
|
+
const userFonts = userLayout.fonts ?? inheritedLayout.fonts ?? [];
|
|
4016
4356
|
const defaultFonts = userFonts.filter((font) => font.default);
|
|
4017
4357
|
if (defaultFonts.length > 1) throw new Error("[route-convention] only one default font is allowed per root layout");
|
|
4018
4358
|
const defaultFont = defaultFonts[0];
|
|
@@ -4020,7 +4360,9 @@ const defaultFontClassName = defaultFont ? (defaultFont.className ?? \`font-\${d
|
|
|
4020
4360
|
|
|
4021
4361
|
export async function generateHead(props: PageProps) {
|
|
4022
4362
|
if (userLayout.generateHead) return userLayout.generateHead(props);
|
|
4023
|
-
return userLayout.head;
|
|
4363
|
+
if (userLayout.head !== undefined) return userLayout.head;
|
|
4364
|
+
if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
|
|
4365
|
+
return inheritedLayout.head;
|
|
4024
4366
|
}
|
|
4025
4367
|
|
|
4026
4368
|
export default function GeneratedLayout({ children, params, searchParams }: LayoutProps) {
|
|
@@ -4030,19 +4372,31 @@ export default function GeneratedLayout({ children, params, searchParams }: Layo
|
|
|
4030
4372
|
appName=${JSON.stringify(opts.appName)}
|
|
4031
4373
|
${prefix ? `prefix=${JSON.stringify(prefix)}
|
|
4032
4374
|
` : ""}params={params}
|
|
4033
|
-
manifest={userLayout.manifest}
|
|
4375
|
+
manifest={userLayout.manifest ?? inheritedLayout.manifest}
|
|
4034
4376
|
env={env}
|
|
4035
|
-
theme={userLayout.theme}
|
|
4377
|
+
theme={userLayout.theme ?? inheritedLayout.theme}
|
|
4036
4378
|
fonts={loadFonts(userFonts)}
|
|
4037
4379
|
className={defaultFontClassName}
|
|
4038
|
-
gaTrackingId={userLayout.gaTrackingId}
|
|
4039
|
-
layoutStyle={userLayout.layoutStyle}
|
|
4040
|
-
reconnect={userLayout.reconnect ?? false}
|
|
4380
|
+
gaTrackingId={userLayout.gaTrackingId ?? inheritedLayout.gaTrackingId}
|
|
4381
|
+
layoutStyle={userLayout.layoutStyle ?? inheritedLayout.layoutStyle}
|
|
4382
|
+
reconnect={userLayout.reconnect ?? inheritedLayout.reconnect ?? false}
|
|
4041
4383
|
>
|
|
4042
4384
|
<UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>
|
|
4043
4385
|
</System.Provider>
|
|
4044
4386
|
);
|
|
4045
4387
|
}
|
|
4388
|
+
` : `import type { LayoutProps, PageProps } from "akanjs/client";
|
|
4389
|
+
${inheritedImport}${userImport}
|
|
4390
|
+
export async function generateHead(props: PageProps) {
|
|
4391
|
+
if (userLayout.generateHead) return userLayout.generateHead(props);
|
|
4392
|
+
if (userLayout.head !== undefined) return userLayout.head;
|
|
4393
|
+
if (inheritedLayout.generateHead) return inheritedLayout.generateHead(props);
|
|
4394
|
+
return inheritedLayout.head;
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
export default function GeneratedLayout({ children, params, searchParams }: LayoutProps) {
|
|
4398
|
+
return <UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>;
|
|
4399
|
+
}
|
|
4046
4400
|
`;
|
|
4047
4401
|
await Bun.write(absPath, source);
|
|
4048
4402
|
return absPath;
|
|
@@ -4051,6 +4405,8 @@ async function resolveSsrPageEntries(opts) {
|
|
|
4051
4405
|
const absPageDir = path10.resolve(opts.appCwdPath, "page");
|
|
4052
4406
|
const hasSt = await appHasStModule(opts.appCwdPath);
|
|
4053
4407
|
const basePaths = opts.basePaths ?? [];
|
|
4408
|
+
const rootSourceAbsPath = findExplicitRootLayoutAbsPath(opts.pageKeys, opts.appCwdPath);
|
|
4409
|
+
const rootBoundaries = findRootBoundaries(opts.pageKeys, opts.appCwdPath, basePaths);
|
|
4054
4410
|
const rootLayoutKeys = new Set(opts.pageKeys.filter((key) => {
|
|
4055
4411
|
const segments = getRootBoundarySegments(key);
|
|
4056
4412
|
return segments !== null && isRootBoundarySegments(segments, basePaths);
|
|
@@ -4059,15 +4415,17 @@ async function resolveSsrPageEntries(opts) {
|
|
|
4059
4415
|
key,
|
|
4060
4416
|
moduleAbsPath: path10.resolve(absPageDir, key)
|
|
4061
4417
|
}));
|
|
4062
|
-
const generated = await Promise.all(
|
|
4418
|
+
const generated = await Promise.all(rootBoundaries.map(async (boundary) => ({
|
|
4063
4419
|
key: implicitRootLayoutKey(boundary.segments),
|
|
4064
4420
|
moduleAbsPath: await writeGeneratedRootLayoutFile({
|
|
4065
4421
|
appCwdPath: opts.appCwdPath,
|
|
4066
4422
|
appName: opts.appName,
|
|
4067
4423
|
boundary,
|
|
4068
|
-
|
|
4424
|
+
rootSourceAbsPath,
|
|
4425
|
+
includeStInit: hasSt && boundary.segments.length === 0,
|
|
4426
|
+
includeSystemProvider: !hasAncestorRootBoundary(boundary, rootBoundaries)
|
|
4069
4427
|
}),
|
|
4070
|
-
seedAbsPaths:
|
|
4428
|
+
seedAbsPaths: [...new Set([boundary.sourceAbsPath, rootSourceAbsPath].filter((absPath) => absPath !== null))]
|
|
4071
4429
|
})));
|
|
4072
4430
|
const entries = [...base, ...generated];
|
|
4073
4431
|
entries.sort((a, b) => a.key.localeCompare(b.key));
|
|
@@ -7042,6 +7400,13 @@ function formatBytes(bytes) {
|
|
|
7042
7400
|
}
|
|
7043
7401
|
// pkgs/@akanjs/devkit/frontendBuild/ssrBaseArtifactBuilder.ts
|
|
7044
7402
|
import path30 from "path";
|
|
7403
|
+
import { optimize } from "@tailwindcss/node";
|
|
7404
|
+
function prepareCssAsset(command, basePath2, cssText) {
|
|
7405
|
+
if (command !== "build")
|
|
7406
|
+
return cssText;
|
|
7407
|
+
return optimize(cssText, { file: `${basePath2 || "root"}.css`, minify: true }).code;
|
|
7408
|
+
}
|
|
7409
|
+
|
|
7045
7410
|
class SsrBaseArtifactBuilder {
|
|
7046
7411
|
#app;
|
|
7047
7412
|
#command;
|
|
@@ -7133,14 +7498,15 @@ class SsrBaseArtifactBuilder {
|
|
|
7133
7498
|
}
|
|
7134
7499
|
async#writeCssAsset(basePath2, cssText) {
|
|
7135
7500
|
const cssAssetName = basePath2 || "root";
|
|
7501
|
+
const preparedCssText = await prepareCssAsset(this.#command, basePath2, cssText);
|
|
7136
7502
|
const cssHash = Bun.hash(`${basePath2}
|
|
7137
|
-
${
|
|
7503
|
+
${preparedCssText}`).toString(36);
|
|
7138
7504
|
const [cssRelPath, cssUrl] = [
|
|
7139
7505
|
`styles/${cssAssetName}-${cssHash}.css`,
|
|
7140
7506
|
`/_akan/styles/${cssAssetName}-${cssHash}.css`
|
|
7141
7507
|
];
|
|
7142
|
-
await Bun.write(path30.join(this.#absArtifactDir, cssRelPath),
|
|
7143
|
-
this.#app.verbose(`[base-artifact] wrote ${
|
|
7508
|
+
await Bun.write(path30.join(this.#absArtifactDir, cssRelPath), preparedCssText);
|
|
7509
|
+
this.#app.verbose(`[base-artifact] wrote ${preparedCssText.length} bytes of CSS for ${basePath2} -> ${cssRelPath}`);
|
|
7144
7510
|
return [basePath2, { cssUrl, cssRelPath }];
|
|
7145
7511
|
}
|
|
7146
7512
|
}
|
|
@@ -9407,6 +9773,77 @@ import { Box as Box2, Newline, Text as Text2, useInput as useInput2 } from "ink"
|
|
|
9407
9773
|
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
9408
9774
|
import { jsxDEV as jsxDEV2, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
|
9409
9775
|
"use client";
|
|
9776
|
+
// pkgs/@akanjs/devkit/cloud/cloudApi.ts
|
|
9777
|
+
var import_dayjs = __toESM(require_dayjs_min(), 1);
|
|
9778
|
+
|
|
9779
|
+
class HttpClient2 {
|
|
9780
|
+
baseUrl;
|
|
9781
|
+
constructor(baseUrl) {
|
|
9782
|
+
this.baseUrl = baseUrl;
|
|
9783
|
+
}
|
|
9784
|
+
async get(url, { headers } = {}) {
|
|
9785
|
+
const response = await fetch(`${this.baseUrl}${url}`, {
|
|
9786
|
+
headers: { "Content-Type": "application/json", ...headers }
|
|
9787
|
+
});
|
|
9788
|
+
return response.json();
|
|
9789
|
+
}
|
|
9790
|
+
async post(url, data, { headers } = {}) {
|
|
9791
|
+
const isFormData = data instanceof FormData;
|
|
9792
|
+
const response = await fetch(`${this.baseUrl}${url}`, {
|
|
9793
|
+
method: "POST",
|
|
9794
|
+
body: isFormData ? data : JSON.stringify(data),
|
|
9795
|
+
headers: isFormData ? headers : { "Content-Type": "application/json", ...headers }
|
|
9796
|
+
});
|
|
9797
|
+
return response.json();
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
|
|
9801
|
+
class CloudApi {
|
|
9802
|
+
api;
|
|
9803
|
+
#accessToken = null;
|
|
9804
|
+
constructor(host, { accessToken } = {}) {
|
|
9805
|
+
this.api = new HttpClient2(`${host}/api`);
|
|
9806
|
+
this.#accessToken = accessToken ?? null;
|
|
9807
|
+
}
|
|
9808
|
+
async uploadEnv(devProjectId, file) {
|
|
9809
|
+
const formData = new FormData;
|
|
9810
|
+
formData.append("devProjectId", devProjectId);
|
|
9811
|
+
formData.append("file", file);
|
|
9812
|
+
const response = await this.api.post(`/uploadEnv/${devProjectId}`, formData);
|
|
9813
|
+
return response.success;
|
|
9814
|
+
}
|
|
9815
|
+
async downloadEnv(devProjectId) {
|
|
9816
|
+
const response = await this.api.get(`/downloadEnv/${devProjectId}`);
|
|
9817
|
+
return response.success;
|
|
9818
|
+
}
|
|
9819
|
+
async getRemoteAuthToken(remoteId) {
|
|
9820
|
+
if (this.#needRefreshToken())
|
|
9821
|
+
return await this.refreshAuthToken();
|
|
9822
|
+
else if (this.#accessToken)
|
|
9823
|
+
return this.#accessToken;
|
|
9824
|
+
const accessToken = await this.api.get(`/getRemoteAuthToken/${remoteId}`);
|
|
9825
|
+
this.#accessToken = {
|
|
9826
|
+
jwt: accessToken.jwt,
|
|
9827
|
+
refreshToken: accessToken.refreshToken,
|
|
9828
|
+
expiresAt: accessToken.expiresAt ? import_dayjs.default(accessToken.expiresAt) : null
|
|
9829
|
+
};
|
|
9830
|
+
return this.#accessToken;
|
|
9831
|
+
}
|
|
9832
|
+
async refreshAuthToken() {
|
|
9833
|
+
const response = await this.api.post(`/refreshRemoteAuthToken`, {
|
|
9834
|
+
refreshToken: this.#accessToken?.refreshToken
|
|
9835
|
+
});
|
|
9836
|
+
this.#accessToken = {
|
|
9837
|
+
jwt: response.jwt,
|
|
9838
|
+
refreshToken: response.refreshToken,
|
|
9839
|
+
expiresAt: response.expiresAt ? import_dayjs.default(response.expiresAt) : null
|
|
9840
|
+
};
|
|
9841
|
+
return this.#accessToken;
|
|
9842
|
+
}
|
|
9843
|
+
#needRefreshToken() {
|
|
9844
|
+
return !!this.#accessToken?.expiresAt?.isBefore(import_dayjs.default().add(1, "hour"));
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9410
9847
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
|
|
9411
9848
|
import { Logger as Logger12 } from "akanjs/common";
|
|
9412
9849
|
|