@akanjs/devkit 3.3.0-rc.17 → 3.3.0-rc.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/mobile/nativeConfig.test.ts +17 -1
- package/mobile/nativeConfig.ts +11 -6
- package/package.json +3 -3
|
@@ -142,6 +142,7 @@ describe("NativeConfig.build", () => {
|
|
|
142
142
|
googleServices: path.resolve("/repo/apps/minimal", "secrets/google-services.json"),
|
|
143
143
|
},
|
|
144
144
|
keyboard: { resize: "none" },
|
|
145
|
+
splash: { autoHide: false },
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
148
|
|
|
@@ -187,7 +188,7 @@ describe("NativeConfig.build", () => {
|
|
|
187
188
|
android: { debugAppIdSuffix: ".debug" },
|
|
188
189
|
keyboard: { resize: "none" },
|
|
189
190
|
icon: path.resolve("/repo/apps/portal", "assets/icon.png"),
|
|
190
|
-
splash: { image: path.resolve("/repo/apps/portal", "assets/splash.png") },
|
|
191
|
+
splash: { image: path.resolve("/repo/apps/portal", "assets/splash.png"), autoHide: false },
|
|
191
192
|
});
|
|
192
193
|
});
|
|
193
194
|
|
|
@@ -306,6 +307,21 @@ describe("NativeConfig.build", () => {
|
|
|
306
307
|
expect(build()).toBeUndefined();
|
|
307
308
|
});
|
|
308
309
|
|
|
310
|
+
test("the runtime hides the splash once the first page is drawn, unless the app hands that back to the shell", () => {
|
|
311
|
+
const splashOf = (splash: Parameters<typeof NativeConfig.build>[0]["target"]["splash"]) =>
|
|
312
|
+
NativeConfig.build({
|
|
313
|
+
appPath: "/repo/apps/portal",
|
|
314
|
+
target: { ...adminTarget, splash },
|
|
315
|
+
webDir: "/web",
|
|
316
|
+
contributions: [],
|
|
317
|
+
locales: ["en"],
|
|
318
|
+
platform: "ios",
|
|
319
|
+
}).config.splash;
|
|
320
|
+
expect(splashOf(undefined)).toEqual({ autoHide: false });
|
|
321
|
+
expect(splashOf({ autoHide: true, timeout: 3000 })).toEqual({ autoHide: true, timeout: 3000 });
|
|
322
|
+
expect(NativeConfig.basePlugins).toContain("splash-screen");
|
|
323
|
+
});
|
|
324
|
+
|
|
309
325
|
test("push, privacy and the icon and splash objects reach the runtime, paths from the app folder", () => {
|
|
310
326
|
const { config } = NativeConfig.build({
|
|
311
327
|
appPath: "/repo/apps/portal",
|
package/mobile/nativeConfig.ts
CHANGED
|
@@ -46,8 +46,9 @@ export interface NativeConfigResult {
|
|
|
46
46
|
type NativeIos = NonNullable<NonNullable<AkanNativeConfig["native"]>["ios"]>;
|
|
47
47
|
|
|
48
48
|
export class NativeConfig {
|
|
49
|
-
//* What every akanjs page may call: routing, lifecycle, links, storage, the device facts the runtime reads,
|
|
50
|
-
//* system sheet useCamera asks camera-or-library with
|
|
49
|
+
//* What every akanjs page may call: routing, lifecycle, links, storage, the device facts the runtime reads, the
|
|
50
|
+
//* system sheet useCamera asks camera-or-library with, and the splash the CSR runtime hides once the first page is
|
|
51
|
+
//* drawn.
|
|
51
52
|
static readonly basePlugins = [
|
|
52
53
|
"app",
|
|
53
54
|
"app-state",
|
|
@@ -60,6 +61,7 @@ export class NativeConfig {
|
|
|
60
61
|
"preferences",
|
|
61
62
|
"secure-storage",
|
|
62
63
|
"haptics",
|
|
64
|
+
"splash-screen",
|
|
63
65
|
] as const;
|
|
64
66
|
//? Only scripts stay strict ('self', inline ones by hash): injected script must not reach the native bridge.
|
|
65
67
|
static readonly defaultCsp: Readonly<Record<string, readonly string[]>> = {
|
|
@@ -267,7 +269,7 @@ export class NativeConfig {
|
|
|
267
269
|
keyboard: { resize: "none" },
|
|
268
270
|
...(desktop ? { desktop } : {}),
|
|
269
271
|
...(target.icon ? { icon: NativeConfig.#icon(target.icon, abs) } : {}),
|
|
270
|
-
|
|
272
|
+
splash: NativeConfig.#splash(target.splash, abs),
|
|
271
273
|
...(shell ? { shell } : {}),
|
|
272
274
|
};
|
|
273
275
|
return { config, warnings };
|
|
@@ -376,12 +378,15 @@ export class NativeConfig {
|
|
|
376
378
|
return typeof icon === "string" ? abs(icon) : { ...icon, image: abs(icon.image) };
|
|
377
379
|
}
|
|
378
380
|
|
|
381
|
+
//? The shell's own hide fires when the document has loaded, before the CSR page is drawn; the runtime hides it then
|
|
382
|
+
//? (`NativeSplash`), so it stays off unless the app says otherwise.
|
|
379
383
|
static #splash(
|
|
380
|
-
splash:
|
|
384
|
+
splash: AkanNativeTarget["splash"],
|
|
381
385
|
abs: (relative: string) => string,
|
|
382
386
|
): NonNullable<AkanNativeConfig["splash"]> {
|
|
383
|
-
if (
|
|
384
|
-
|
|
387
|
+
if (!splash) return { autoHide: false };
|
|
388
|
+
if (typeof splash === "string") return { image: abs(splash), autoHide: false };
|
|
389
|
+
return { autoHide: false, ...splash, ...(splash.image ? { image: abs(splash.image) } : {}) };
|
|
385
390
|
}
|
|
386
391
|
|
|
387
392
|
static #desktop(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "3.3.0-rc.
|
|
3
|
+
"version": "3.3.0-rc.18",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"./workspace/getRelatedCnsts": "./workspace/getRelatedCnsts.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@akanjs/language": "3.3.0-rc.
|
|
53
|
+
"@akanjs/language": "3.3.0-rc.18",
|
|
54
54
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
55
55
|
"@earendil-works/pi-ai": "1.5.2",
|
|
56
56
|
"@earendil-works/pi-codemode": "1.5.2",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@earendil-works/pi-tui": "1.5.2",
|
|
60
60
|
"@inquirer/prompts": "^8.7.3",
|
|
61
61
|
"@tailwindcss/node": "^4.3.3",
|
|
62
|
-
"akanjs": "3.3.0-rc.
|
|
62
|
+
"akanjs": "3.3.0-rc.18",
|
|
63
63
|
"chalk": "^6.0.1",
|
|
64
64
|
"commander": "^15.0.0",
|
|
65
65
|
"dayjs": "^1.11.23",
|