@absolutejs/absolute 0.20.0-beta.112 → 0.20.0-beta.114

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.
@@ -11,6 +11,7 @@ var UPDATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u;
11
11
  var RELEASE_TARGET_PATTERN = /^[a-z0-9][a-z0-9._-]{0,63}$/u;
12
12
  var UPDATE_PUBLIC_KEY_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/u;
13
13
  var ENVIRONMENT_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/u;
14
+ var COLOR_PATTERN = /^#[0-9A-F]{6}$/u;
14
15
  var DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000;
15
16
  var DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2;
16
17
  var DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20;
@@ -43,6 +44,58 @@ var resolveProjectPath = (projectRoot, value, field) => {
43
44
  }
44
45
  return path;
45
46
  };
47
+ var normalizeBrandingColor = (value, fallback, field) => {
48
+ const normalized = (value ?? fallback).trim().toUpperCase();
49
+ if (!COLOR_PATTERN.test(normalized))
50
+ throw new TypeError(`${field} must use #RRGGBB hexadecimal notation.`);
51
+ return normalized;
52
+ };
53
+ var normalizeBrandingPath = (projectRoot, value, field) => {
54
+ const path = resolveProjectPath(projectRoot, requireText(value, field), field);
55
+ if (!path.toLowerCase().endsWith(".png"))
56
+ throw new TypeError(`${field} must reference a PNG file.`);
57
+ return path;
58
+ };
59
+ var normalizeBranding = (config, projectRoot) => {
60
+ const { branding } = config;
61
+ if (!branding)
62
+ return;
63
+ const darkIcon = branding.ios?.darkIcon ? normalizeBrandingPath(projectRoot, branding.ios.darkIcon, "mobile.branding.ios.darkIcon") : undefined;
64
+ const tintedIcon = branding.ios?.tintedIcon ? normalizeBrandingPath(projectRoot, branding.ios.tintedIcon, "mobile.branding.ios.tintedIcon") : undefined;
65
+ const logoScale = branding.splash?.logoScale ?? 0.2;
66
+ if (!Number.isFinite(logoScale) || logoScale < 0.1 || logoScale > 0.4)
67
+ throw new TypeError("mobile.branding.splash.logoScale must be between 0.1 and 0.4.");
68
+ return {
69
+ android: {
70
+ backgroundColor: normalizeBrandingColor(branding.android?.backgroundColor, "#FFFFFF", "mobile.branding.android.backgroundColor"),
71
+ ...branding.android?.backgroundImage ? {
72
+ backgroundImage: normalizeBrandingPath(projectRoot, branding.android.backgroundImage, "mobile.branding.android.backgroundImage")
73
+ } : {},
74
+ ...branding.android?.foreground ? {
75
+ foreground: normalizeBrandingPath(projectRoot, branding.android.foreground, "mobile.branding.android.foreground")
76
+ } : {},
77
+ ...branding.android?.monochrome ? {
78
+ monochrome: normalizeBrandingPath(projectRoot, branding.android.monochrome, "mobile.branding.android.monochrome")
79
+ } : {}
80
+ },
81
+ icon: normalizeBrandingPath(projectRoot, branding.icon, "mobile.branding.icon"),
82
+ ios: {
83
+ ...darkIcon ? { darkIcon } : {},
84
+ ...tintedIcon ? { tintedIcon } : {}
85
+ },
86
+ splash: {
87
+ backgroundColor: normalizeBrandingColor(branding.splash?.backgroundColor, "#FFFFFF", "mobile.branding.splash.backgroundColor"),
88
+ darkBackgroundColor: normalizeBrandingColor(branding.splash?.darkBackgroundColor, "#111111", "mobile.branding.splash.darkBackgroundColor"),
89
+ ...branding.splash?.darkImage ? {
90
+ darkImage: normalizeBrandingPath(projectRoot, branding.splash.darkImage, "mobile.branding.splash.darkImage")
91
+ } : {},
92
+ ...branding.splash?.image ? {
93
+ image: normalizeBrandingPath(projectRoot, branding.splash.image, "mobile.branding.splash.image")
94
+ } : {},
95
+ logoScale
96
+ }
97
+ };
98
+ };
46
99
  var requireText = (value, field) => {
47
100
  const normalized = value.trim();
48
101
  if (!normalized)
@@ -445,11 +498,13 @@ var normalizeAbsoluteMobileConfig = (config, projectRoot) => {
445
498
  const updates = normalizeUpdates(config, productionOrigin, projectRoot);
446
499
  const updateServer = normalizeUpdateServer(config, productionOrigin, projectRoot, updates);
447
500
  const observability = normalizeObservability(config, productionOrigin);
501
+ const branding = normalizeBranding(config, projectRoot);
448
502
  return {
449
503
  androidCertificateFingerprints: normalizeCertificateFingerprints(config.deepLinks?.android?.sha256CertificateFingerprints),
450
504
  appId,
451
505
  appleAppIdPrefix: normalizeAppleAppIdPrefix(config.deepLinks?.apple?.appIdPrefix),
452
506
  appName: requireText(config.appName, "mobile.appName"),
507
+ ...branding ? { branding } : {},
453
508
  bundleDirectory: resolveProjectPath(projectRoot, config.bundleDirectory ?? ".absolutejs/mobile/web", "mobile.bundleDirectory"),
454
509
  deepLinkHosts: normalizeHosts(config.deepLinks?.hosts, productionOrigin),
455
510
  deepLinkScheme,
package/dist/cli/index.js CHANGED
@@ -58,7 +58,7 @@ if (command === "dev") {
58
58
  }
59
59
  const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
60
60
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
61
- const { dev } = await import("./dev-f0safhsr.js");
61
+ const { dev } = await import("./dev-5cqmf7za.js");
62
62
  await dev(serverEntry, configPath, {
63
63
  androidDevice,
64
64
  eager: args.includes("--eager"),
@@ -71,7 +71,7 @@ if (command === "dev") {
71
71
  const configPath = parseNamedArg("--config");
72
72
  const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
73
73
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
74
- const { start } = await import("./start-8v6g2y31.js");
74
+ const { start } = await import("./start-jt61f40d.js");
75
75
  await start(serverEntry, outdir, configPath, {
76
76
  prebuilt: args.includes("--prebuilt")
77
77
  });
@@ -81,7 +81,7 @@ if (command === "dev") {
81
81
  const configPath = parseNamedArg("--config");
82
82
  const positionalArgs = stripNamedArgs("--outdir", "--config");
83
83
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
84
- const { start } = await import("./start-8v6g2y31.js");
84
+ const { start } = await import("./start-jt61f40d.js");
85
85
  await start(serverEntry, outdir, configPath, { prepareOnly: true });
86
86
  } else if (command === "build") {
87
87
  sendTelemetryEvent("cli:command", { command });
@@ -197,13 +197,13 @@ if (command === "dev") {
197
197
  const configPath = parseNamedArg("--config");
198
198
  const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
199
199
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
200
- const { compile } = await import("./compile-1d5arbqj.js");
200
+ const { compile } = await import("./compile-ya4kd2sg.js");
201
201
  await compile(serverEntry, outdir, outfile, configPath);
202
202
  } else if (command === "mobile") {
203
203
  sendTelemetryEvent("cli:command", {
204
204
  command: `mobile:${workspaceCommand ?? "unknown"}`
205
205
  });
206
- const { runMobile } = await import("./mobile-d5wbqynh.js");
206
+ const { runMobile } = await import("./mobile-55wjg3nd.js");
207
207
  try {
208
208
  await runMobile(args);
209
209
  } catch (error) {
@@ -238,7 +238,7 @@ if (command === "dev") {
238
238
  console.error(" prepare [entry] [--outdir dir] Build production assets and server without launching");
239
239
  console.error(" start [entry] [--outdir dir] [--prebuilt] Start production server");
240
240
  console.error(" compile [entry] [--outdir dir] [--outfile path] Compile standalone executable");
241
- console.error(" mobile <init|sync|inspect|ci|pair|remotes|doctor|test> Manage Capacitor apps and the experimental Expo hybrid shell");
241
+ console.error(" mobile <init|sync|assets|inspect|ci|pair|remotes|doctor|test> Manage Capacitor apps and the experimental Expo hybrid shell");
242
242
  console.error(" config [--port n] Open the unified config UI (ESLint, tsconfig, Prettier)");
243
243
  console.error(" db <backup|restore|seed> Backup/restore any Postgres DB (ORM-agnostic, upsert by PK) or run the seed script");
244
244
  console.error(" doctor [--fix] [--json] Diagnose the project (bun, type graph, config, framework dirs, env, port)");