@marktiderman/genesis-cli 1.6.0 → 1.7.0
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.md +156 -1
- package/dist/cli.js +2769 -567
- package/dist/cli.js.map +1 -1
- package/dist/{config-CUdwT-nY.d.ts → config-CrZbM3jD.d.ts} +45 -2
- package/dist/doctor.d.ts +2 -2
- package/dist/doctor.js +133 -5
- package/dist/doctor.js.map +1 -1
- package/dist/expo.d.ts +91 -8
- package/dist/expo.js +207 -14
- package/dist/expo.js.map +1 -1
- package/dist/genesis-catalog.json +502 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +140 -9
- package/dist/index.js.map +1 -1
- package/dist/scaffolder.d.ts +1 -1
- package/dist/scaffolder.js +7 -4
- package/dist/scaffolder.js.map +1 -1
- package/dist/starter/.eas/scripts/rollout-health.mjs +85 -0
- package/dist/starter/.eas/workflows/deploy-production.yml +149 -0
- package/dist/starter/.eas/workflows/e2e.yml +77 -0
- package/dist/starter/.eas/workflows/pr-preview.yml +117 -0
- package/dist/starter/.eas/workflows/rollout.yml +120 -0
- package/dist/starter/.env.example +11 -0
- package/dist/starter/.fingerprintignore +7 -0
- package/dist/starter/.maestro/README.md +38 -0
- package/dist/starter/.maestro/config.yaml +5 -0
- package/dist/starter/.maestro/flows/deep-link.yaml +22 -0
- package/dist/starter/.maestro/flows/launch.yaml +17 -0
- package/dist/starter/.maestro/flows/settings-version.yaml +28 -0
- package/dist/starter/.maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/starter/.maestro/subflows/sign-in.yaml +20 -0
- package/dist/starter/README.md +314 -0
- package/dist/starter/__tests__/app-config.test.ts +51 -0
- package/dist/starter/__tests__/check-in-photos.test.ts +57 -0
- package/dist/starter/__tests__/components/css-stub.js +2 -0
- package/dist/starter/__tests__/components/fake-supabase.ts +136 -0
- package/dist/starter/__tests__/components/links.test.ts +25 -0
- package/dist/starter/__tests__/components/render-app.ts +22 -0
- package/dist/starter/__tests__/components/reports.ts +10 -0
- package/dist/starter/__tests__/components/resolver.js +12 -0
- package/dist/starter/__tests__/components/root-layout.test.tsx +55 -0
- package/dist/starter/__tests__/components/session-storage.test.tsx +81 -0
- package/dist/starter/__tests__/components/settings.test.tsx +134 -0
- package/dist/starter/__tests__/components/setup.ts +69 -0
- package/dist/starter/__tests__/components/sign-in.test.tsx +90 -0
- package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +19 -0
- package/dist/starter/__tests__/components/tabs.test.tsx +43 -0
- package/dist/starter/__tests__/components/tabs.ts +12 -0
- package/dist/starter/__tests__/entry.test.ts +28 -0
- package/dist/starter/__tests__/inline-copy.ts +59 -0
- package/dist/starter/__tests__/starter.test.ts +319 -0
- package/dist/starter/_gitignore +13 -0
- package/dist/starter/app.config.ts +44 -0
- package/dist/starter/babel.config.js +9 -0
- package/dist/starter/eas.json +47 -0
- package/dist/starter/eslint.config.js +5 -0
- package/dist/starter/genesis.config.json +12 -0
- package/dist/starter/global.css +3 -0
- package/dist/starter/index.ts +14 -0
- package/dist/starter/jest.config.js +36 -0
- package/dist/starter/metro.config.js +38 -0
- package/dist/starter/package.json +93 -0
- package/dist/starter/pnpm-workspace.yaml +73 -0
- package/dist/starter/src/app/(app)/(home)/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/(home)/check-in.tsx +41 -0
- package/dist/starter/src/app/(app)/(home)/index.tsx +34 -0
- package/dist/starter/src/app/(app)/_layout.tsx +27 -0
- package/dist/starter/src/app/(app)/notifications/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/notifications/index.tsx +36 -0
- package/dist/starter/src/app/(app)/settings/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/settings/index.tsx +96 -0
- package/dist/starter/src/app/(app)/settings/notifications.tsx +16 -0
- package/dist/starter/src/app/(app)/settings/support/[id].tsx +23 -0
- package/dist/starter/src/app/(app)/settings/support/ideas.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/index.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/new.tsx +35 -0
- package/dist/starter/src/app/(app)/settings/support/shipped.tsx +20 -0
- package/dist/starter/src/app/+native-intent.ts +11 -0
- package/dist/starter/src/app/_layout.tsx +20 -0
- package/dist/starter/src/app/sign-in.tsx +69 -0
- package/dist/starter/src/copy.ts +118 -0
- package/dist/starter/src/forms/check-in.json +121 -0
- package/dist/starter/src/lib/account.ts +42 -0
- package/dist/starter/src/lib/app.ts +52 -0
- package/dist/starter/src/lib/auth.ts +80 -0
- package/dist/starter/src/lib/check-in-photos.ts +66 -0
- package/dist/starter/src/lib/check-in.ts +85 -0
- package/dist/starter/src/lib/define-starter.ts +148 -0
- package/dist/starter/src/lib/devtools-overlay.ts +34 -0
- package/dist/starter/src/lib/devtools.ts +23 -0
- package/dist/starter/src/lib/env.ts +33 -0
- package/dist/starter/src/lib/google-signin.ts +23 -0
- package/dist/starter/src/lib/links.ts +40 -0
- package/dist/starter/src/lib/native-modules.ts +27 -0
- package/dist/starter/src/lib/notifications.ts +15 -0
- package/dist/starter/src/lib/observability.ts +45 -0
- package/dist/starter/src/lib/push.ts +49 -0
- package/dist/starter/src/lib/supabase.ts +65 -0
- package/dist/starter/src/lib/support.ts +44 -0
- package/dist/starter/src/lib/updates.ts +61 -0
- package/dist/starter/starter.config.ts +37 -0
- package/dist/starter/supabase/config.toml +26 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/apple.ts +237 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/handler.ts +227 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/index.ts +55 -0
- package/dist/starter/supabase/functions/genesis-push-send/expo.ts +117 -0
- package/dist/starter/supabase/functions/genesis-push-send/handler.ts +462 -0
- package/dist/starter/supabase/functions/genesis-push-send/index.ts +54 -0
- package/dist/starter/supabase/migrations/20261024000000_genesis_account_deletion.sql +133 -0
- package/dist/starter/supabase/migrations/20261024000100_genesis_app_release_policy.sql +82 -0
- package/dist/starter/supabase/migrations/20261024000200_genesis_apple_token_revocation.sql +205 -0
- package/dist/starter/supabase/migrations/20261024000400_genesis_push.sql +524 -0
- package/dist/starter/supabase/migrations/20261024000600_genesis_support.sql +846 -0
- package/dist/starter/supabase/tests/database/genesis_account_deletion.test.sql +138 -0
- package/dist/starter/supabase/tests/database/genesis_app_release_policy.test.sql +148 -0
- package/dist/starter/supabase/tests/database/genesis_apple_token_revocation.test.sql +230 -0
- package/dist/starter/supabase/tests/database/genesis_push.test.sql +407 -0
- package/dist/starter/supabase/tests/database/genesis_support.test.sql +552 -0
- package/dist/starter/tailwind.config.mjs +15 -0
- package/dist/starter/tsconfig.json +14 -0
- package/dist/starter/vitest.config.mts +7 -0
- package/dist/templates/ci/app-ci.yml +17 -0
- package/dist/templates/ci/genesis-upgrade.yml +21 -0
- package/dist/templates/ci/supabase-ci.yml +20 -0
- package/dist/templates/eas/eas.json +47 -0
- package/dist/templates/eas/scripts/rollout-health.mjs +85 -0
- package/dist/templates/eas/workflows/deploy-production.yml +149 -0
- package/dist/templates/eas/workflows/e2e.yml +77 -0
- package/dist/templates/eas/workflows/pr-preview.yml +117 -0
- package/dist/templates/eas/workflows/rollout.yml +120 -0
- package/dist/templates/maestro/config.yaml +5 -0
- package/dist/templates/maestro/flows/deep-link.yaml +22 -0
- package/dist/templates/maestro/flows/launch.yaml +17 -0
- package/dist/templates/maestro/flows/settings-version.yaml +28 -0
- package/dist/templates/maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/templates/maestro/subflows/sign-in.yaml +20 -0
- package/dist/vite.js +133 -5
- package/dist/vite.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -235,9 +235,12 @@ export const brand: Brand = {
|
|
|
235
235
|
}
|
|
236
236
|
function tailwindConfig(consumer, native) {
|
|
237
237
|
return `import type { Config } from "tailwindcss";
|
|
238
|
-
|
|
239
|
-
//
|
|
240
|
-
|
|
238
|
+
${native ? `// NativeWind v4 needs its preset; Genesis's goes after it. The NativeWind preset also declares
|
|
239
|
+
// the theme variables, which NativeWind can't import from genesis.css. genesisNativewindContent
|
|
240
|
+
// lists the Genesis React Native packages the app uses, wherever they are installed.
|
|
241
|
+
import { fileURLToPath } from "node:url";
|
|
242
|
+
import nativewindPreset from "nativewind/preset";
|
|
243
|
+
import { genesisNativewindContent, genesisNativewindPreset as genesisPreset } from "@marktiderman/genesis-design-system/presets/nativewind";` : `import { genesisPreset } from "@marktiderman/genesis-design-system/presets/tailwind";`}
|
|
241
244
|
import { brand } from "@${consumer}/brand";
|
|
242
245
|
|
|
243
246
|
/**
|
|
@@ -253,7 +256,7 @@ const config: Config = {
|
|
|
253
256
|
content: [
|
|
254
257
|
"./app/**/*.{ts,tsx}",
|
|
255
258
|
"./components/**/*.{ts,tsx}",
|
|
256
|
-
${native ? ` "
|
|
259
|
+
${native ? ` ...genesisNativewindContent({ root: fileURLToPath(new URL(".", import.meta.url)) }),
|
|
257
260
|
` : ""} ],
|
|
258
261
|
presets: [${native ? "nativewindPreset, " : ""}genesisPreset],
|
|
259
262
|
theme: {
|
|
@@ -1000,6 +1003,54 @@ var GenesisConfigError = class extends Error {
|
|
|
1000
1003
|
var DoctorConfigError = class extends GenesisConfigError {
|
|
1001
1004
|
name = "DoctorConfigError";
|
|
1002
1005
|
};
|
|
1006
|
+
var PRIVACY_DATA_TYPES = {
|
|
1007
|
+
name: "NSPrivacyCollectedDataTypeName",
|
|
1008
|
+
"email address": "NSPrivacyCollectedDataTypeEmailAddress",
|
|
1009
|
+
"phone number": "NSPrivacyCollectedDataTypePhoneNumber",
|
|
1010
|
+
"physical address": "NSPrivacyCollectedDataTypePhysicalAddress",
|
|
1011
|
+
"other user contact info": "NSPrivacyCollectedDataTypeOtherUserContactInfo",
|
|
1012
|
+
health: "NSPrivacyCollectedDataTypeHealth",
|
|
1013
|
+
fitness: "NSPrivacyCollectedDataTypeFitness",
|
|
1014
|
+
"payment info": "NSPrivacyCollectedDataTypePaymentInfo",
|
|
1015
|
+
"credit info": "NSPrivacyCollectedDataTypeCreditInfo",
|
|
1016
|
+
"other financial info": "NSPrivacyCollectedDataTypeOtherFinancialInfo",
|
|
1017
|
+
"precise location": "NSPrivacyCollectedDataTypePreciseLocation",
|
|
1018
|
+
"coarse location": "NSPrivacyCollectedDataTypeCoarseLocation",
|
|
1019
|
+
"sensitive info": "NSPrivacyCollectedDataTypeSensitiveInfo",
|
|
1020
|
+
contacts: "NSPrivacyCollectedDataTypeContacts",
|
|
1021
|
+
"emails or text messages": "NSPrivacyCollectedDataTypeEmailsOrTextMessages",
|
|
1022
|
+
"photos or videos": "NSPrivacyCollectedDataTypePhotosorVideos",
|
|
1023
|
+
"audio data": "NSPrivacyCollectedDataTypeAudioData",
|
|
1024
|
+
"gameplay content": "NSPrivacyCollectedDataTypeGameplayContent",
|
|
1025
|
+
"customer support": "NSPrivacyCollectedDataTypeCustomerSupport",
|
|
1026
|
+
"other user content": "NSPrivacyCollectedDataTypeOtherUserContent",
|
|
1027
|
+
"browsing history": "NSPrivacyCollectedDataTypeBrowsingHistory",
|
|
1028
|
+
"search history": "NSPrivacyCollectedDataTypeSearchHistory",
|
|
1029
|
+
"user id": "NSPrivacyCollectedDataTypeUserID",
|
|
1030
|
+
"device id": "NSPrivacyCollectedDataTypeDeviceID",
|
|
1031
|
+
"purchase history": "NSPrivacyCollectedDataTypePurchaseHistory",
|
|
1032
|
+
"product interaction": "NSPrivacyCollectedDataTypeProductInteraction",
|
|
1033
|
+
"advertising data": "NSPrivacyCollectedDataTypeAdvertisingData",
|
|
1034
|
+
"other usage data": "NSPrivacyCollectedDataTypeOtherUsageData",
|
|
1035
|
+
"crash data": "NSPrivacyCollectedDataTypeCrashData",
|
|
1036
|
+
"performance data": "NSPrivacyCollectedDataTypePerformanceData",
|
|
1037
|
+
"other diagnostic data": "NSPrivacyCollectedDataTypeOtherDiagnosticData",
|
|
1038
|
+
"environment scanning": "NSPrivacyCollectedDataTypeEnvironmentScanning",
|
|
1039
|
+
hands: "NSPrivacyCollectedDataTypeHands",
|
|
1040
|
+
head: "NSPrivacyCollectedDataTypeHead",
|
|
1041
|
+
"other data types": "NSPrivacyCollectedDataTypeOtherDataTypes"
|
|
1042
|
+
};
|
|
1043
|
+
function privacyDataType(type) {
|
|
1044
|
+
return PRIVACY_DATA_TYPES[type.toLowerCase()];
|
|
1045
|
+
}
|
|
1046
|
+
var PRIVACY_PURPOSES = {
|
|
1047
|
+
"app functionality": "NSPrivacyCollectedDataTypePurposeAppFunctionality",
|
|
1048
|
+
analytics: "NSPrivacyCollectedDataTypePurposeAnalytics",
|
|
1049
|
+
"product personalization": "NSPrivacyCollectedDataTypePurposeProductPersonalization",
|
|
1050
|
+
"developer advertising": "NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
|
|
1051
|
+
"third-party advertising": "NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
|
|
1052
|
+
other: "NSPrivacyCollectedDataTypePurposeOther"
|
|
1053
|
+
};
|
|
1003
1054
|
var STRING_LISTS = ["src", "extensions", "ignore", "tokenFiles", "ignoreTokenPrefixes", "localPrimitiveDirs", "build"];
|
|
1004
1055
|
var STRINGS = ["uiPackage", "rulesDoc"];
|
|
1005
1056
|
var KNOWN = /* @__PURE__ */ new Set([
|
|
@@ -1064,8 +1115,48 @@ function readGenesisConfig(root) {
|
|
|
1064
1115
|
if (!existsSync(file)) return null;
|
|
1065
1116
|
const raw = readJson(file);
|
|
1066
1117
|
if (!isObject(raw)) throw new GenesisConfigError(`${file}: the config must be a JSON object`);
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1118
|
+
const out = { raw };
|
|
1119
|
+
if (raw.links !== void 0) out.links = validateLinks(raw.links, file);
|
|
1120
|
+
if (raw.privacy !== void 0) out.privacy = validatePrivacy(raw.privacy, file);
|
|
1121
|
+
return out;
|
|
1122
|
+
}
|
|
1123
|
+
var PRIVACY_KEYS = /* @__PURE__ */ new Set(["blocks", "collects", "tracking"]);
|
|
1124
|
+
var DATA_USE_KEYS = /* @__PURE__ */ new Set(["type", "purposes", "linked", "tracking"]);
|
|
1125
|
+
function validatePrivacy(raw, source = "config") {
|
|
1126
|
+
const fail = (msg) => {
|
|
1127
|
+
throw new GenesisConfigError(`${source}: ${msg}`);
|
|
1128
|
+
};
|
|
1129
|
+
if (!isObject(raw)) fail(`"privacy" must be an object`);
|
|
1130
|
+
const c = raw;
|
|
1131
|
+
for (const key of Object.keys(c)) if (!PRIVACY_KEYS.has(key)) fail(`privacy: unknown setting "${key}"`);
|
|
1132
|
+
const out = {};
|
|
1133
|
+
if (c.blocks !== void 0) {
|
|
1134
|
+
if (!isStringList(c.blocks)) fail(`privacy.blocks must be a list of block ids`);
|
|
1135
|
+
out.blocks = [...new Set(c.blocks)];
|
|
1136
|
+
}
|
|
1137
|
+
if (c.tracking !== void 0) {
|
|
1138
|
+
if (typeof c.tracking !== "boolean") fail(`privacy.tracking must be true or false`);
|
|
1139
|
+
out.tracking = c.tracking;
|
|
1140
|
+
}
|
|
1141
|
+
if (c.collects !== void 0) {
|
|
1142
|
+
if (!Array.isArray(c.collects)) fail(`privacy.collects must be a list`);
|
|
1143
|
+
out.collects = c.collects.map((entry, i) => {
|
|
1144
|
+
const where = `privacy.collects[${i}]`;
|
|
1145
|
+
if (!isObject(entry)) return fail(`${where} must be an object`);
|
|
1146
|
+
for (const key of Object.keys(entry)) if (!DATA_USE_KEYS.has(key)) fail(`${where}: unknown setting "${key}"`);
|
|
1147
|
+
if (typeof entry.type !== "string" || !privacyDataType(entry.type)) {
|
|
1148
|
+
fail(`${where}.type "${String(entry.type)}" is not one of ${Object.keys(PRIVACY_DATA_TYPES).join(", ")}`);
|
|
1149
|
+
}
|
|
1150
|
+
if (!isStringList(entry.purposes) || entry.purposes.length === 0) fail(`${where}.purposes must be a non-empty list`);
|
|
1151
|
+
for (const p of entry.purposes) {
|
|
1152
|
+
if (!(p in PRIVACY_PURPOSES)) fail(`${where}.purposes: "${p}" is not one of ${Object.keys(PRIVACY_PURPOSES).join(", ")}`);
|
|
1153
|
+
}
|
|
1154
|
+
if (typeof entry.linked !== "boolean") fail(`${where}.linked must be true or false`);
|
|
1155
|
+
if (typeof entry.tracking !== "boolean") fail(`${where}.tracking must be true or false`);
|
|
1156
|
+
return { type: entry.type, purposes: [...new Set(entry.purposes)], linked: entry.linked, tracking: entry.tracking };
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
return out;
|
|
1069
1160
|
}
|
|
1070
1161
|
var LINK_KEYS = /* @__PURE__ */ new Set(["hosts", "paths", "webcredentials"]);
|
|
1071
1162
|
var HOST = /^(?=.{1,253}$)(\*\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
@@ -1968,11 +2059,51 @@ var NATIVE_WRAPPED_PRIMITIVES = Object.freeze({
|
|
|
1968
2059
|
function wrappedPrimitivesIn(namedImports) {
|
|
1969
2060
|
return namedImports.split(",").map((n) => n.trim()).filter((n) => n && !/^type\s/.test(n)).map((n) => n.split(/\s+as\s+/)[0].trim()).filter((n) => n && Object.hasOwn(NATIVE_WRAPPED_PRIMITIVES, n));
|
|
1970
2061
|
}
|
|
2062
|
+
var api = (category, ...reasons) => ({
|
|
2063
|
+
NSPrivacyAccessedAPIType: `NSPrivacyAccessedAPICategory${category}`,
|
|
2064
|
+
NSPrivacyAccessedAPITypeReasons: reasons
|
|
2065
|
+
});
|
|
1971
2066
|
var PRIVACY_APIS = {
|
|
1972
|
-
"
|
|
1973
|
-
|
|
1974
|
-
]
|
|
2067
|
+
"react-native": [api("FileTimestamp", "C617.1"), api("UserDefaults", "CA92.1"), api("SystemBootTime", "35F9.1")],
|
|
2068
|
+
expo: [api("FileTimestamp", "0A2A.1", "3B52.1"), api("DiskSpace", "E174.1", "85F4.1"), api("UserDefaults", "CA92.1")],
|
|
2069
|
+
"expo-updates": [api("UserDefaults", "CA92.1")],
|
|
2070
|
+
"expo-application": [api("FileTimestamp", "C617.1")],
|
|
2071
|
+
"expo-notifications": [api("UserDefaults", "CA92.1")],
|
|
2072
|
+
"@react-native-async-storage/async-storage": [api("FileTimestamp", "C617.1")],
|
|
2073
|
+
"@sentry/react-native": [api("UserDefaults", "CA92.1"), api("SystemBootTime", "35F9.1"), api("FileTimestamp", "C617.1")]
|
|
1975
2074
|
};
|
|
2075
|
+
var appFunctionality = (type, ...more) => ({
|
|
2076
|
+
type,
|
|
2077
|
+
purposes: ["app functionality", ...more],
|
|
2078
|
+
linked: true,
|
|
2079
|
+
tracking: false
|
|
2080
|
+
});
|
|
2081
|
+
({
|
|
2082
|
+
account: {
|
|
2083
|
+
collects: [appFunctionality("email address"), appFunctionality("user id"), appFunctionality("name")]
|
|
2084
|
+
},
|
|
2085
|
+
observability: {
|
|
2086
|
+
collects: [
|
|
2087
|
+
appFunctionality("crash data"),
|
|
2088
|
+
appFunctionality("performance data"),
|
|
2089
|
+
appFunctionality("other diagnostic data"),
|
|
2090
|
+
appFunctionality("user id", "analytics"),
|
|
2091
|
+
{ type: "product interaction", purposes: ["analytics"], linked: true, tracking: false }
|
|
2092
|
+
]
|
|
2093
|
+
},
|
|
2094
|
+
push: {
|
|
2095
|
+
collects: [appFunctionality("device ID")]
|
|
2096
|
+
},
|
|
2097
|
+
support: {
|
|
2098
|
+
collects: [
|
|
2099
|
+
appFunctionality("user id"),
|
|
2100
|
+
appFunctionality("customer support"),
|
|
2101
|
+
appFunctionality("other user content"),
|
|
2102
|
+
appFunctionality("photos or videos"),
|
|
2103
|
+
appFunctionality("other diagnostic data")
|
|
2104
|
+
]
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
1976
2107
|
function privacyApisFor(dependencies2) {
|
|
1977
2108
|
return Object.keys(PRIVACY_APIS).filter((pkg) => pkg in dependencies2).flatMap((pkg) => PRIVACY_APIS[pkg]);
|
|
1978
2109
|
}
|