@protobase/cli 0.96.1 → 0.96.2
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/dist/build/theme.js +8 -4
- package/dist/cli/package.js +1 -1
- package/dist/mobile/android-splash.js +55 -0
- package/dist/mobile/capacitor-config.js +5 -1
- package/dist/mobile/generate.js +7 -2
- package/dist/mobile/ios-splash.js +53 -0
- package/dist/mobile/native-splash.js +23 -0
- package/dist/mobile/run.js +3 -0
- package/dist/mobile/splash-colors.js +78 -0
- package/package.json +8 -8
- package/skills/protobase/references/guides/mobile-app.md +1 -1
package/dist/build/theme.js
CHANGED
|
@@ -6,14 +6,18 @@ import { transform } from "lightningcss";
|
|
|
6
6
|
//#region src/build/theme.ts
|
|
7
7
|
/** The project's theme, at its root, and where a bundle's `public` folder has it: the app links it at `/protobase.theme.css`. */
|
|
8
8
|
const themeFile = "protobase.theme.css";
|
|
9
|
+
/** The app's tokens, the CSS variables its components read, beside its stylesheet in @protobase/ui's src and dist alike. */
|
|
9
10
|
const tokensFile = path.join(path.dirname(uiEntry), "tokens.css");
|
|
10
11
|
/** The names of the tokens the installed @protobase/ui reads, such as `--primary` and `--radius`. */
|
|
11
12
|
const themeTokens = async (file = tokensFile) => new Set([...(await readFile(file, "utf8")).matchAll(/(--[\w-]+)\s*:/g)].map(([, name]) => name));
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/** Which values a theme selector sets: the light ones on :root, the dark ones on [data-theme="dark"]; none for another. */
|
|
14
|
+
const themeScheme = (selector) => {
|
|
15
|
+
if (selector.length !== 1) return;
|
|
14
16
|
const [part] = selector;
|
|
15
|
-
|
|
17
|
+
if (part.type === "pseudo-class" && part.kind === "root") return "light";
|
|
18
|
+
if (part.type === "attribute" && part.name === "data-theme" && part.operation?.value === "dark") return "dark";
|
|
16
19
|
};
|
|
20
|
+
const isThemeSelector = (selector) => themeScheme(selector) !== void 0;
|
|
17
21
|
const where = (file, line) => `${file}:${line + 1}`;
|
|
18
22
|
const checkRule = (rule, file) => {
|
|
19
23
|
if (rule.type === "font-face") return {
|
|
@@ -84,4 +88,4 @@ const buildTheme = async ({ projectDir, outFile }) => {
|
|
|
84
88
|
return warnings;
|
|
85
89
|
};
|
|
86
90
|
//#endregion
|
|
87
|
-
export { buildTheme, compileTheme, themeFile, themeTokens };
|
|
91
|
+
export { buildTheme, compileTheme, themeFile, themeScheme, themeTokens, tokensFile };
|
package/dist/cli/package.js
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { copySplashFile, removeTemplateSplash } from "./native-splash.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
//#region src/mobile/android-splash.ts
|
|
5
|
+
const res = "app/src/main/res";
|
|
6
|
+
const densities = [
|
|
7
|
+
"mdpi",
|
|
8
|
+
"hdpi",
|
|
9
|
+
"xhdpi",
|
|
10
|
+
"xxhdpi",
|
|
11
|
+
"xxxhdpi"
|
|
12
|
+
];
|
|
13
|
+
/** The template's full-screen splash images, with Capacitor's logo, which nothing shows once its launch theme is Protobase's. */
|
|
14
|
+
const templateSplashImages = [`${res}/drawable/splash.png`, ...["port", "land"].flatMap((orientation) => densities.map((density) => `${res}/drawable-${orientation}-${density}/splash.png`))];
|
|
15
|
+
/**
|
|
16
|
+
* Protobase's splash for the splash screen plugin to show while the app reloads into a live update (its `layoutName`):
|
|
17
|
+
* the one the launch shows, drawn as the core-splashscreen library draws it.
|
|
18
|
+
*/
|
|
19
|
+
const androidSplashFiles = [`${res}/drawable/protobase_splash.xml`, `${res}/layout/protobase_splash.xml`];
|
|
20
|
+
/** The splash screen plugin's `layoutName`, the layout in `androidSplashFiles`. */
|
|
21
|
+
const androidSplashLayout = "protobase_splash";
|
|
22
|
+
const stylesPath = `${res}/values/styles.xml`;
|
|
23
|
+
const templateLaunchTheme = ` <style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
|
24
|
+
<item name="android:background">@drawable/splash</item>
|
|
25
|
+
</style>`;
|
|
26
|
+
const launchTheme = ` <style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen.IconBackground">
|
|
27
|
+
<item name="windowSplashScreenBackground">@color/protobase_splash_background</item>
|
|
28
|
+
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
|
29
|
+
<item name="windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>
|
|
30
|
+
</style>`;
|
|
31
|
+
/** The template's styles.xml with Protobase's launch theme; it fails on any other, which may set its own splash. */
|
|
32
|
+
const withLaunchTheme = (styles) => {
|
|
33
|
+
if (!styles.includes(templateLaunchTheme)) throw new Error("The generated android project's styles.xml is not Capacitor's template: its launch theme is not the one Protobase replaces");
|
|
34
|
+
return styles.replace(templateLaunchTheme, launchTheme);
|
|
35
|
+
};
|
|
36
|
+
/** The `protobase_splash_background` colour resource, in values for light mode and values-night for dark. */
|
|
37
|
+
const splashBackgroundResource = (color) => `<?xml version="1.0" encoding="utf-8"?>
|
|
38
|
+
<resources>
|
|
39
|
+
<color name="protobase_splash_background">${color}</color>
|
|
40
|
+
</resources>
|
|
41
|
+
`;
|
|
42
|
+
/** Gives the Android project in the workspace Protobase's splash screen on the app's background in place of Capacitor's. */
|
|
43
|
+
const withAndroidSplash = async (ws, { light, dark }) => {
|
|
44
|
+
const styles = path.join(ws, "android", stylesPath);
|
|
45
|
+
await writeFile(styles, withLaunchTheme(await readFile(styles, "utf8")));
|
|
46
|
+
for (const [values, color] of [["values", light], ["values-night", dark]]) {
|
|
47
|
+
const dir = path.join(ws, "android", res, values);
|
|
48
|
+
await mkdir(dir, { recursive: true });
|
|
49
|
+
await writeFile(path.join(dir, "protobase_splash.xml"), splashBackgroundResource(color));
|
|
50
|
+
}
|
|
51
|
+
for (const image of templateSplashImages) await removeTemplateSplash(ws, "android", image);
|
|
52
|
+
for (const file of androidSplashFiles) await copySplashFile(ws, "android", file);
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { androidSplashFiles, androidSplashLayout, splashBackgroundResource, templateSplashImages, withAndroidSplash, withLaunchTheme };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pushPlugin } from "./pinned-packages.js";
|
|
2
|
+
import { androidSplashLayout } from "./android-splash.js";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { rm, writeFile } from "node:fs/promises";
|
|
4
5
|
import { capacitorOrigin } from "@protobase/schema/internal";
|
|
@@ -48,7 +49,10 @@ const capacitorConfig = ({ appId, appName, fingerprint, shellVersion, plugins, l
|
|
|
48
49
|
origin: capacitorOrigin[platform]
|
|
49
50
|
},
|
|
50
51
|
Keyboard: { autoBackdropColor: "dom" },
|
|
51
|
-
SplashScreen: {
|
|
52
|
+
SplashScreen: {
|
|
53
|
+
launchAutoHide: false,
|
|
54
|
+
layoutName: androidSplashLayout
|
|
55
|
+
},
|
|
52
56
|
...push && { PushNotifications: { presentationOptions: pushPresentation } },
|
|
53
57
|
...apnsEnvironment && { ProtobasePush: { environment: apnsEnvironment } },
|
|
54
58
|
...liveUpdate && { LiveUpdate: {
|
package/dist/mobile/generate.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { withAndroidSplash } from "./android-splash.js";
|
|
1
2
|
import { dataExtractionRules, dataExtractionRulesPath, withoutBackup } from "./android-backup.js";
|
|
2
3
|
import { copyGoogleServices } from "./google-services.js";
|
|
3
4
|
import { withLocalNetworking } from "./info-plist.js";
|
|
4
5
|
import { withFreshInstall } from "./ios-fresh-install.js";
|
|
5
6
|
import { setUpIosPush } from "./ios-push.js";
|
|
7
|
+
import { withIosSplash } from "./ios-splash.js";
|
|
6
8
|
import { withProtobaseIcon } from "./native-icon.js";
|
|
7
9
|
import path from "node:path";
|
|
8
10
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -12,13 +14,14 @@ const appDelegate = (ws) => path.join(ws, "ios", "App", "App", "AppDelegate.swif
|
|
|
12
14
|
const androidManifest = (ws) => path.join(ws, "android", "app", "src", "main", "AndroidManifest.xml");
|
|
13
15
|
/**
|
|
14
16
|
* Generates the platform's native project in the workspace from its capacitor.config.json and app files, replacing
|
|
15
|
-
* the last one: it is never edited by hand. Its home-screen icon is Protobase's,
|
|
17
|
+
* the last one: it is never edited by hand. Its home-screen icon is Protobase's, and its splash screen that icon on the
|
|
18
|
+
* app's background in `splash`, light and dark, in place of Capacitor's logo. An Android app with push gets the
|
|
16
19
|
* project's google-services.json from `googleServicesFrom`, an iOS app with push its entitlement in `apnsEnvironment` and
|
|
17
20
|
* the token forwarding, and an iOS app calling the API over plain http may reach local addresses. Android apps opt out
|
|
18
21
|
* of backup and device transfer, and iOS apps start as a fresh install after a restore or a move, so nothing carries
|
|
19
22
|
* over to another phone.
|
|
20
23
|
*/
|
|
21
|
-
const generatePlatform = async (ws, platform, { cleartext, googleServicesFrom, apnsEnvironment }, cap) => {
|
|
24
|
+
const generatePlatform = async (ws, platform, { cleartext, splash, googleServicesFrom, apnsEnvironment }, cap) => {
|
|
22
25
|
await rm(path.join(ws, platform), {
|
|
23
26
|
recursive: true,
|
|
24
27
|
force: true
|
|
@@ -26,6 +29,7 @@ const generatePlatform = async (ws, platform, { cleartext, googleServicesFrom, a
|
|
|
26
29
|
await cap(["add", platform]);
|
|
27
30
|
await withProtobaseIcon(ws, platform);
|
|
28
31
|
if (platform === "android") {
|
|
32
|
+
await withAndroidSplash(ws, splash);
|
|
29
33
|
if (googleServicesFrom !== void 0) await copyGoogleServices(googleServicesFrom, ws);
|
|
30
34
|
await writeFile(androidManifest(ws), withoutBackup(await readFile(androidManifest(ws), "utf8")));
|
|
31
35
|
const rules = path.join(ws, "android", ...dataExtractionRulesPath);
|
|
@@ -33,6 +37,7 @@ const generatePlatform = async (ws, platform, { cleartext, googleServicesFrom, a
|
|
|
33
37
|
await writeFile(rules, dataExtractionRules);
|
|
34
38
|
return;
|
|
35
39
|
}
|
|
40
|
+
await withIosSplash(ws, splash);
|
|
36
41
|
await writeFile(appDelegate(ws), withFreshInstall(await readFile(appDelegate(ws), "utf8")));
|
|
37
42
|
if (apnsEnvironment !== void 0) await setUpIosPush(ws, apnsEnvironment);
|
|
38
43
|
if (!cleartext) return;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { copySplashFile, removeTemplateSplash } from "./native-splash.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
//#region src/mobile/ios-splash.ts
|
|
5
|
+
const assets = "App/App/Assets.xcassets";
|
|
6
|
+
/**
|
|
7
|
+
* The launch screen files the template has, which Protobase's replace: the storyboard, Protobase's as a plain view in
|
|
8
|
+
* the `SplashBackground` colour with the `Splash` image, the home-screen icon with its corners rounded, in its middle;
|
|
9
|
+
* and that image.
|
|
10
|
+
*/
|
|
11
|
+
const iosSplashFiles = ["App/App/Base.lproj/LaunchScreen.storyboard", `${assets}/Splash.imageset`];
|
|
12
|
+
/** The folder of the `SplashBackground` colour in the app's asset catalog. */
|
|
13
|
+
const splashBackgroundSet = `${assets}/SplashBackground.colorset`;
|
|
14
|
+
const component = (hex, at) => `0x${hex.slice(at, at + 2).toUpperCase()}`;
|
|
15
|
+
const color = (hex) => ({
|
|
16
|
+
"color-space": "srgb",
|
|
17
|
+
components: {
|
|
18
|
+
red: component(hex, 1),
|
|
19
|
+
green: component(hex, 3),
|
|
20
|
+
blue: component(hex, 5),
|
|
21
|
+
alpha: "1.000"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/** The asset catalog's `SplashBackground` colour: `light`, and `dark` in dark mode, so the launch screen follows the phone's. */
|
|
25
|
+
const splashBackgroundContents = ({ light, dark }) => `${JSON.stringify({
|
|
26
|
+
colors: [{
|
|
27
|
+
color: color(light),
|
|
28
|
+
idiom: "universal"
|
|
29
|
+
}, {
|
|
30
|
+
appearances: [{
|
|
31
|
+
appearance: "luminosity",
|
|
32
|
+
value: "dark"
|
|
33
|
+
}],
|
|
34
|
+
color: color(dark),
|
|
35
|
+
idiom: "universal"
|
|
36
|
+
}],
|
|
37
|
+
info: {
|
|
38
|
+
author: "xcode",
|
|
39
|
+
version: 1
|
|
40
|
+
}
|
|
41
|
+
}, null, 2)}\n`;
|
|
42
|
+
/** Gives the iOS project in the workspace Protobase's launch screen on the app's background in place of Capacitor's. */
|
|
43
|
+
const withIosSplash = async (ws, colors) => {
|
|
44
|
+
for (const file of iosSplashFiles) {
|
|
45
|
+
await removeTemplateSplash(ws, "ios", file);
|
|
46
|
+
await copySplashFile(ws, "ios", file);
|
|
47
|
+
}
|
|
48
|
+
const set = path.join(ws, "ios", splashBackgroundSet);
|
|
49
|
+
await mkdir(set, { recursive: true });
|
|
50
|
+
await writeFile(path.join(set, "Contents.json"), splashBackgroundContents(colors));
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { iosSplashFiles, splashBackgroundContents, splashBackgroundSet, withIosSplash };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { cp, rm } from "node:fs/promises";
|
|
4
|
+
//#region src/mobile/native-splash.ts
|
|
5
|
+
/** Where @protobase/mobile, installed in the workspace `ws`, has the platform's splash files, by their native project paths. */
|
|
6
|
+
const protobaseSplashDir = (ws, platform) => path.join(ws, "node_modules", "@protobase", "mobile", "splash", platform);
|
|
7
|
+
/** Copies Protobase's splash file or folder `file` into the platform's native project in the workspace, by the same path. */
|
|
8
|
+
const copySplashFile = async (ws, platform, file) => {
|
|
9
|
+
const from = path.join(protobaseSplashDir(ws, platform), file);
|
|
10
|
+
if (!existsSync(from)) throw new Error(`@protobase/mobile has no ${path.join(platform, file)} of Protobase's splash screen`);
|
|
11
|
+
await cp(from, path.join(ws, platform, file), { recursive: true });
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Removes the template's splash file or folder `file` from the platform's native project in the workspace. It must be
|
|
15
|
+
* one the template has, so a template that moves its splash fails here rather than leaving Capacitor's on the phone.
|
|
16
|
+
*/
|
|
17
|
+
const removeTemplateSplash = async (ws, platform, file) => {
|
|
18
|
+
const at = path.join(ws, platform, file);
|
|
19
|
+
if (!existsSync(at)) throw new Error(`The generated ${platform} project has no ${file}, the splash screen Protobase's replaces`);
|
|
20
|
+
await rm(at, { recursive: true });
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { copySplashFile, protobaseSplashDir, removeTemplateSplash };
|
package/dist/mobile/run.js
CHANGED
|
@@ -16,6 +16,7 @@ import { liveUpdateSettings } from "./live-update-settings.js";
|
|
|
16
16
|
import { loadMobileProject } from "./load-project.js";
|
|
17
17
|
import { signForDevelopment } from "./development-signing.js";
|
|
18
18
|
import { checkIosPlugins, checkProtobasePlugin, guardIosLiveUpdate, guardLiveUpdate } from "./protobase-plugin.js";
|
|
19
|
+
import { splashColors } from "./splash-colors.js";
|
|
19
20
|
import { mobileSpec, prepareWorkspace, workspaceDir, workspacePackageJson } from "./workspace.js";
|
|
20
21
|
import path from "node:path";
|
|
21
22
|
import { nativeFingerprint } from "@protobase/server/mobile-release";
|
|
@@ -25,6 +26,7 @@ const prepare = async ({ projectDir, platform, api, extensions, live, release },
|
|
|
25
26
|
if (live !== void 0 && api !== void 0) throw new Error("--live opens protobase dev, which serves the API itself: leave out --api");
|
|
26
27
|
const project = await loadMobileProject(projectDir, extensions);
|
|
27
28
|
const mobile = checkMobileConfig(project.mobile);
|
|
29
|
+
const splash = await splashColors(projectDir);
|
|
28
30
|
const url = live === void 0 ? apiUrl(api, project.auth?.issuer, platform) : new URL(`http://localhost:${live}`);
|
|
29
31
|
if (release) checkReleaseUrl(url);
|
|
30
32
|
const allowances = httpAllowances(url);
|
|
@@ -87,6 +89,7 @@ const prepare = async ({ projectDir, platform, api, extensions, live, release },
|
|
|
87
89
|
const cap = capacitorRunner(ws, env, run);
|
|
88
90
|
await generatePlatform(ws, platform, {
|
|
89
91
|
...allowances,
|
|
92
|
+
splash,
|
|
90
93
|
...push && platform === "android" && { googleServicesFrom: projectDir },
|
|
91
94
|
...apnsEnvironment && { apnsEnvironment }
|
|
92
95
|
}, cap);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { themeFile, themeScheme, tokensFile } from "../build/theme.js";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { transform } from "lightningcss";
|
|
6
|
+
//#region src/mobile/splash-colors.ts
|
|
7
|
+
const record = (found, selectors, declarations) => {
|
|
8
|
+
for (const declaration of declarations) {
|
|
9
|
+
if (declaration.property !== "custom" || declaration.value.name !== "--background") continue;
|
|
10
|
+
for (const selector of selectors) {
|
|
11
|
+
const scheme = themeScheme(selector);
|
|
12
|
+
if (scheme) found[scheme] = declaration.value.value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const backgrounds = (code, file) => {
|
|
17
|
+
const normal = {};
|
|
18
|
+
const important = {};
|
|
19
|
+
const visit = (rules) => {
|
|
20
|
+
for (const rule of rules) {
|
|
21
|
+
if (rule.type === "layer-block") visit(rule.value.rules);
|
|
22
|
+
if (rule.type !== "style") continue;
|
|
23
|
+
record(normal, rule.value.selectors, rule.value.declarations?.declarations ?? []);
|
|
24
|
+
record(important, rule.value.selectors, rule.value.declarations?.importantDeclarations ?? []);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
transform({
|
|
28
|
+
filename: file,
|
|
29
|
+
code: Buffer.from(code),
|
|
30
|
+
visitor: { StyleSheet: (sheet) => void visit(sheet.rules) }
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
light: important.light ?? normal.light,
|
|
34
|
+
dark: important.dark ?? normal.dark
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const namedColor = (name) => {
|
|
38
|
+
let color;
|
|
39
|
+
transform({
|
|
40
|
+
filename: "name.css",
|
|
41
|
+
code: Buffer.from(`a{color:${name}}`),
|
|
42
|
+
visitor: { Declaration: { color: (declaration) => void (declaration.property === "color" && (color = declaration.value)) } }
|
|
43
|
+
});
|
|
44
|
+
return color;
|
|
45
|
+
};
|
|
46
|
+
const parsedColor = (value) => {
|
|
47
|
+
const [only] = value;
|
|
48
|
+
if (value.length !== 1 || !only) return;
|
|
49
|
+
if (only.type === "color") return only.value;
|
|
50
|
+
if (only.type === "token" && only.value.type === "ident") return namedColor(only.value.value);
|
|
51
|
+
};
|
|
52
|
+
const isRgb = (color) => typeof color === "object" && color.type === "rgb";
|
|
53
|
+
const hex = (value) => value.toString(16).padStart(2, "0");
|
|
54
|
+
const nativeColor = (value, where) => {
|
|
55
|
+
const color = parsedColor(value);
|
|
56
|
+
if (!isRgb(color) || color.alpha !== 1) throw new Error(`${where}: the native splash screen needs --background as an opaque sRGB colour, such as #f4f3ee, rgb() or hsl()`);
|
|
57
|
+
return `#${hex(color.r)}${hex(color.g)}${hex(color.b)}`;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The background the app's first screen paints, for the native splash screen: `--background` from the project's
|
|
61
|
+
* protobase.theme.css, where it sets it, and from the installed @protobase/ui's tokens otherwise. As in the app, a theme
|
|
62
|
+
* that sets it on :root only sets it for dark mode too.
|
|
63
|
+
*/
|
|
64
|
+
const splashColors = async (projectDir, tokens = tokensFile) => {
|
|
65
|
+
const source = path.join(projectDir, themeFile);
|
|
66
|
+
const theme = existsSync(source) ? backgrounds(await readFile(source, "utf8"), themeFile) : {};
|
|
67
|
+
const ui = backgrounds(await readFile(tokens, "utf8"), tokens);
|
|
68
|
+
const pick = (scheme, ...choices) => {
|
|
69
|
+
for (const [value, where] of choices) if (value) return nativeColor(value, where);
|
|
70
|
+
throw new Error(`${tokens} sets no ${scheme} --background`);
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
light: pick("light", [theme.light, themeFile], [ui.light, tokens]),
|
|
74
|
+
dark: pick("dark", [theme.dark, themeFile], [theme.light, themeFile], [ui.dark, tokens])
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { splashColors };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.96.
|
|
3
|
+
"version": "0.96.2",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.96.
|
|
47
|
-
"@protobase/layout": "0.96.
|
|
48
|
-
"@protobase/query": "0.96.
|
|
49
|
-
"@protobase/schema": "0.96.
|
|
50
|
-
"@protobase/server": "0.96.
|
|
51
|
-
"@protobase/ui": "0.96.
|
|
52
|
-
"@protobase/workflows": "0.96.
|
|
46
|
+
"@protobase/config": "0.96.2",
|
|
47
|
+
"@protobase/layout": "0.96.2",
|
|
48
|
+
"@protobase/query": "0.96.2",
|
|
49
|
+
"@protobase/schema": "0.96.2",
|
|
50
|
+
"@protobase/server": "0.96.2",
|
|
51
|
+
"@protobase/ui": "0.96.2",
|
|
52
|
+
"@protobase/workflows": "0.96.2",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -37,7 +37,7 @@ export default defineConfig({
|
|
|
37
37
|
|
|
38
38
|
The app is installed under the name it shows in its upper left, on iOS and Android alike: `protobase mobile` reads it from the server the app calls (its web manifest), so a `PROTOBASE_APP_NAME` the server runs with names the app on the phone too. When that server cannot be reached, `run` and `open` warn and take the project's own name, the config's `name` or `PROTOBASE_APP_NAME` in its environment, and `build` stops.
|
|
39
39
|
|
|
40
|
-
On the home screen the app shows Protobase's icon, on iOS and Android alike. <gap>An app cannot show its own icon on the phone because setting the mobile app's icon is not implemented.</gap>
|
|
40
|
+
On the home screen the app shows Protobase's icon, on iOS and Android alike. While it starts, its splash screen shows that icon in the middle of the app's background: the `--background` [token](../reference/theme.md) of its `protobase.theme.css`, or the default without one, light or dark as the phone is. `protobase mobile` takes it as a colour such as `#f4f3ee`, `rgb()`, `hsl()` or `white`, and stops on one a phone's splash screen cannot show, such as `oklch()` or `var()`. <gap>An app cannot show its own icon on the phone, on the home screen or its splash screen, because setting the mobile app's icon is not implemented.</gap>
|
|
41
41
|
|
|
42
42
|
With a mobile section, the API answers the app's origins, `capacitor://localhost` on iOS and `https://localhost` on Android, through [CORS](../reference/api.md#cors). Apps without one get no new dependency, and `protobase build` and `protobase dev` work as before.
|
|
43
43
|
|