anhedral 0.13.0 → 0.16.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 +23 -229
- package/assets/patches/audit-deps.mjs +12 -2
- package/assets/stack/ai-schema.ts.txt +5 -0
- package/assets/stack/ai.ts.txt +30 -0
- package/assets/stack/api-index.ts.txt +15 -0
- package/assets/stack/auth-features.ts.txt +4 -0
- package/assets/stack/auth-journal.json.txt +13 -0
- package/assets/stack/auth-migration.sql.txt +53 -0
- package/assets/stack/auth-routes.ts.txt +11 -0
- package/assets/stack/auth-schema.ts.txt +64 -0
- package/assets/stack/auth-snapshot.json.txt +346 -0
- package/assets/stack/auth.ts.txt +32 -0
- package/assets/stack/billing-mode.ts.txt +8 -0
- package/assets/stack/billing-schema.ts.txt +11 -0
- package/assets/stack/desktop.rs.txt +21 -0
- package/assets/stack/entitlement-guard.ts.txt +32 -0
- package/assets/stack/entitlements.ts.txt +8 -0
- package/assets/stack/events-schema.ts.txt +12 -0
- package/assets/stack/events.ts.txt +59 -0
- package/assets/stack/mobile-auth.ts.txt +25 -0
- package/assets/stack/mobile-billing.tsx.txt +63 -0
- package/assets/stack/mobile-session.tsx.txt +83 -0
- package/assets/stack/native-button.tsx.txt +108 -0
- package/assets/stack/native-global.css.txt +4 -0
- package/assets/stack/native-lib-utils.ts.txt +5 -0
- package/assets/stack/native-metro.config.js.txt +6 -0
- package/assets/stack/native-nativewind-env.d.ts.txt +1 -0
- package/assets/stack/native-tailwind.config.js.txt +73 -0
- package/assets/stack/native-text.tsx.txt +89 -0
- package/assets/stack/purchases.ts.txt +65 -0
- package/assets/stack/revenuecat.ts.txt +88 -0
- package/assets/stack/rtc-schema.ts.txt +10 -0
- package/assets/stack/rtc.ts.txt +122 -0
- package/assets/stack/security.ts.txt +31 -0
- package/assets/stack/storage.ts.txt +36 -0
- package/assets/stack/stripe.ts.txt +126 -0
- package/assets/stack/web-sign-in.tsx.txt +51 -0
- package/assets/ui/LICENSE.react-native-reusables +21 -0
- package/assets/ui/LICENSE.shadcn +21 -0
- package/assets/ui/UPSTREAM.json +39 -0
- package/assets/ui/catalog.json +891 -0
- package/assets/ui/extensions/registry.json +6 -0
- package/assets/ui/native/_controls.tsx +521 -0
- package/assets/ui/native/_core.tsx +118 -0
- package/assets/ui/native/_data.tsx +200 -0
- package/assets/ui/native/_display.tsx +453 -0
- package/assets/ui/native/_feedback.tsx +242 -0
- package/assets/ui/native/_legacy-dialog.tsx +38 -0
- package/assets/ui/native/_motion.tsx +520 -0
- package/assets/ui/native/_overlay.tsx +402 -0
- package/assets/ui/native/_selection.tsx +366 -0
- package/assets/ui/native/accordion.tsx +1 -0
- package/assets/ui/native/alert-dialog.tsx +11 -0
- package/assets/ui/native/alert.tsx +1 -0
- package/assets/ui/native/aspect-ratio.tsx +1 -0
- package/assets/ui/native/attachment.tsx +8 -0
- package/assets/ui/native/avatar.tsx +8 -0
- package/assets/ui/native/badge.tsx +1 -0
- package/assets/ui/native/breadcrumb.tsx +9 -0
- package/assets/ui/native/bubble.tsx +1 -0
- package/assets/ui/native/button-group.tsx +1 -0
- package/assets/ui/native/button.tsx +86 -0
- package/assets/ui/native/calendar.tsx +170 -0
- package/assets/ui/native/card.tsx +44 -0
- package/assets/ui/native/carousel.tsx +1 -0
- package/assets/ui/native/chart.tsx +193 -0
- package/assets/ui/native/checkbox.tsx +1 -0
- package/assets/ui/native/code-block.tsx +137 -0
- package/assets/ui/native/collapsible.tsx +1 -0
- package/assets/ui/native/combobox.tsx +1 -0
- package/assets/ui/native/command.tsx +11 -0
- package/assets/ui/native/context-menu.tsx +16 -0
- package/assets/ui/native/data-table.tsx +1 -0
- package/assets/ui/native/date-picker.tsx +43 -0
- package/assets/ui/native/dialog.tsx +15 -0
- package/assets/ui/native/direction.tsx +1 -0
- package/assets/ui/native/drawer.tsx +10 -0
- package/assets/ui/native/dropdown-menu.tsx +16 -0
- package/assets/ui/native/empty.tsx +8 -0
- package/assets/ui/native/field.tsx +13 -0
- package/assets/ui/native/hover-card.tsx +1 -0
- package/assets/ui/native/input-group.tsx +8 -0
- package/assets/ui/native/input-otp.tsx +1 -0
- package/assets/ui/native/input.tsx +28 -0
- package/assets/ui/native/item.tsx +12 -0
- package/assets/ui/native/kbd.tsx +1 -0
- package/assets/ui/native/label.tsx +4 -0
- package/assets/ui/native/layout.tsx +26 -0
- package/assets/ui/native/marker.tsx +1 -0
- package/assets/ui/native/menubar.tsx +17 -0
- package/assets/ui/native/message-scroller.tsx +6 -0
- package/assets/ui/native/message.tsx +10 -0
- package/assets/ui/native/native-select.tsx +1 -0
- package/assets/ui/native/navigation-menu.tsx +10 -0
- package/assets/ui/native/pagination.tsx +9 -0
- package/assets/ui/native/popover.tsx +1 -0
- package/assets/ui/native/progress.tsx +1 -0
- package/assets/ui/native/questionnaire.tsx +130 -0
- package/assets/ui/native/radio-group.tsx +1 -0
- package/assets/ui/native/registry.json +1103 -0
- package/assets/ui/native/resizable.tsx +1 -0
- package/assets/ui/native/scroll-area.tsx +1 -0
- package/assets/ui/native/select.tsx +11 -0
- package/assets/ui/native/separator.tsx +1 -0
- package/assets/ui/native/sheet.tsx +10 -0
- package/assets/ui/native/sidebar.tsx +22 -0
- package/assets/ui/native/skeleton.tsx +1 -0
- package/assets/ui/native/slider.tsx +1 -0
- package/assets/ui/native/spinner.tsx +1 -0
- package/assets/ui/native/switch.tsx +1 -0
- package/assets/ui/native/table.tsx +10 -0
- package/assets/ui/native/tabs.tsx +1 -0
- package/assets/ui/native/text.tsx +20 -0
- package/assets/ui/native/textarea.tsx +1 -0
- package/assets/ui/native/theme-switcher.tsx +22 -0
- package/assets/ui/native/toast.tsx +11 -0
- package/assets/ui/native/toggle-group.tsx +1 -0
- package/assets/ui/native/toggle.tsx +1 -0
- package/assets/ui/native/tooltip.tsx +1 -0
- package/assets/ui/native/trace.tsx +20 -0
- package/assets/ui/native/typography.tsx +15 -0
- package/assets/ui/theme-storage.ts +25 -0
- package/assets/ui/theme.tsx +66 -0
- package/assets/ui/web/button.tsx +59 -0
- package/assets/ui/web/input.tsx +21 -0
- package/assets/ui/web/label.tsx +19 -0
- package/dist/bin.js +7 -12
- package/dist/capabilities.d.ts +4 -33
- package/dist/capabilities.js +2 -84
- package/dist/capability-catalog.d.ts +83 -0
- package/dist/capability-catalog.js +121 -0
- package/dist/capability-command.d.ts +3 -0
- package/dist/capability-command.js +188 -0
- package/dist/capability-editor.d.ts +17 -0
- package/dist/capability-editor.js +97 -0
- package/dist/capability-recipes.d.ts +4 -0
- package/dist/capability-recipes.js +520 -0
- package/dist/capability-references.d.ts +4 -0
- package/dist/capability-references.js +7 -0
- package/dist/cli-commands.d.ts +1 -2
- package/dist/cli-commands.js +10 -104
- package/dist/cli-output.d.ts +1 -2
- package/dist/cli-output.js +6 -251
- package/dist/command-schema.js +40 -374
- package/dist/dependencies.d.ts +34 -62
- package/dist/dependencies.js +112 -199
- package/dist/index.d.ts +1 -45
- package/dist/index.js +1 -30
- package/dist/platforms/mobile.js +29 -139
- package/dist/platforms/web.d.ts +3 -0
- package/dist/platforms/web.js +251 -0
- package/dist/project-config.d.ts +2 -13
- package/dist/project-config.js +10 -83
- package/dist/registry/context.js +0 -1
- package/dist/registry/options.js +6 -40
- package/dist/registry/resolve.d.ts +3 -4
- package/dist/registry/resolve.js +18 -108
- package/dist/registry/types.d.ts +1 -7
- package/dist/registry/usage.js +3 -9
- package/dist/runtime-policy.d.ts +0 -2
- package/dist/runtime-policy.js +0 -16
- package/dist/scaffold/backend.d.ts +0 -4
- package/dist/scaffold/backend.js +1 -189
- package/dist/scaffold/bootstrap.d.ts +2 -3
- package/dist/scaffold/bootstrap.js +37 -43
- package/dist/scaffold/compose.js +2 -14
- package/dist/scaffold/database.d.ts +1 -1
- package/dist/scaffold/database.js +19 -126
- package/dist/scaffold/documentation.d.ts +0 -1
- package/dist/scaffold/documentation.js +82 -84
- package/dist/scaffold/expo-runtime.d.ts +2 -2
- package/dist/scaffold/expo-runtime.js +9 -101
- package/dist/scaffold/native-ui.d.ts +2 -0
- package/dist/scaffold/native-ui.js +74 -0
- package/dist/scaffold/stack-documentation.d.ts +0 -1
- package/dist/scaffold/stack-documentation.js +3 -49
- package/dist/scaffold/storage.d.ts +2 -0
- package/dist/scaffold/storage.js +21 -0
- package/dist/scaffold/styling.d.ts +1 -1
- package/dist/scaffold/styling.js +20 -28
- package/dist/scaffold/workspace.js +63 -199
- package/dist/stack-registry.d.ts +2 -58
- package/dist/stack-registry.js +22 -446
- package/dist/standard.js +7 -24
- package/dist/ui-catalog.d.ts +26 -0
- package/dist/ui-catalog.js +31 -0
- package/dist/ui-command.d.ts +3 -0
- package/dist/ui-command.js +219 -0
- package/dist/ui-project.d.ts +22 -0
- package/dist/ui-project.js +110 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/anhedral-stack.md +4 -119
- package/docs/capabilities.md +110 -0
- package/docs/native-ui.md +102 -0
- package/docs/software-factory.md +16 -577
- package/docs/stack-standard.md +11 -307
- package/docs/ui.md +33 -0
- package/docs/verification.md +511 -0
- package/package.json +26 -27
- package/dist/access.d.ts +0 -10
- package/dist/access.js +0 -93
- package/dist/auth-schema-snapshot.d.ts +0 -346
- package/dist/auth-schema-snapshot.js +0 -347
- package/dist/auth-schema.d.ts +0 -1
- package/dist/auth-schema.js +0 -57
- package/dist/capability-contract.d.ts +0 -47
- package/dist/capability-contract.js +0 -168
- package/dist/catalog-model.d.ts +0 -24
- package/dist/catalog-model.js +0 -1
- package/dist/catalog-registration.d.ts +0 -16
- package/dist/catalog-registration.js +0 -22
- package/dist/catalog-snapshot.d.ts +0 -5
- package/dist/catalog-snapshot.js +0 -97
- package/dist/cli-delivery.d.ts +0 -3
- package/dist/cli-delivery.js +0 -172
- package/dist/cloudflare.d.ts +0 -25
- package/dist/cloudflare.js +0 -226
- package/dist/delivery-evidence.d.ts +0 -62
- package/dist/delivery-evidence.js +0 -186
- package/dist/delivery.d.ts +0 -88
- package/dist/delivery.js +0 -570
- package/dist/inspector-model.d.ts +0 -123
- package/dist/inspector-model.js +0 -1
- package/dist/integration-service-readers.d.ts +0 -13
- package/dist/integration-service-readers.js +0 -173
- package/dist/lifecycle-model.d.ts +0 -15
- package/dist/lifecycle-model.js +0 -20
- package/dist/lifecycle.d.ts +0 -11
- package/dist/lifecycle.js +0 -91
- package/dist/management.d.ts +0 -3
- package/dist/management.js +0 -47
- package/dist/mobile-delivery.d.ts +0 -77
- package/dist/mobile-delivery.js +0 -366
- package/dist/neon-service-data.d.ts +0 -8
- package/dist/neon-service-data.js +0 -117
- package/dist/platforms/desktop.d.ts +0 -2
- package/dist/platforms/desktop.js +0 -415
- package/dist/platforms/extension.d.ts +0 -2
- package/dist/platforms/extension.js +0 -328
- package/dist/project-catalog.d.ts +0 -41
- package/dist/project-catalog.js +0 -288
- package/dist/project-inspector.d.ts +0 -4
- package/dist/project-inspector.js +0 -702
- package/dist/project-lifecycle.d.ts +0 -25
- package/dist/project-lifecycle.js +0 -57
- package/dist/project-state.d.ts +0 -49
- package/dist/project-state.js +0 -563
- package/dist/provider-auth.d.ts +0 -41
- package/dist/provider-auth.js +0 -215
- package/dist/provider-readiness.d.ts +0 -30
- package/dist/provider-readiness.js +0 -104
- package/dist/providers/adapters.d.ts +0 -17
- package/dist/providers/adapters.js +0 -278
- package/dist/providers/api.d.ts +0 -29
- package/dist/providers/api.js +0 -253
- package/dist/providers/config.d.ts +0 -15
- package/dist/providers/config.js +0 -182
- package/dist/providers/definitions.d.ts +0 -318
- package/dist/providers/definitions.js +0 -127
- package/dist/providers/provision.d.ts +0 -24
- package/dist/providers/provision.js +0 -76
- package/dist/providers/receipts.d.ts +0 -20
- package/dist/providers/receipts.js +0 -66
- package/dist/providers/recovery-verification.d.ts +0 -7
- package/dist/providers/recovery-verification.js +0 -112
- package/dist/providers/recovery.d.ts +0 -30
- package/dist/providers/recovery.js +0 -34
- package/dist/providers/runtime.d.ts +0 -10
- package/dist/providers/runtime.js +0 -265
- package/dist/providers/schema.d.ts +0 -28
- package/dist/providers/schema.js +0 -49
- package/dist/providers/state.d.ts +0 -55
- package/dist/providers/state.js +0 -289
- package/dist/provision.d.ts +0 -55
- package/dist/provision.js +0 -284
- package/dist/r2-service-data.d.ts +0 -2
- package/dist/r2-service-data.js +0 -136
- package/dist/readiness.d.ts +0 -23
- package/dist/readiness.js +0 -122
- package/dist/registry/add.d.ts +0 -24
- package/dist/registry/add.js +0 -270
- package/dist/registry/bootstrap.d.ts +0 -2
- package/dist/registry/bootstrap.js +0 -14
- package/dist/registry/commands.d.ts +0 -3
- package/dist/registry/commands.js +0 -85
- package/dist/registry/presets.d.ts +0 -4
- package/dist/registry/presets.js +0 -41
- package/dist/registry/preview.d.ts +0 -11
- package/dist/registry/preview.js +0 -91
- package/dist/registry/receipt.d.ts +0 -3
- package/dist/registry/receipt.js +0 -68
- package/dist/repository.d.ts +0 -24
- package/dist/repository.js +0 -96
- package/dist/scaffold/auth.d.ts +0 -3
- package/dist/scaffold/auth.js +0 -151
- package/dist/scaffold/billing-config.d.ts +0 -1
- package/dist/scaffold/billing-config.js +0 -73
- package/dist/scaffold/billing-contracts.d.ts +0 -2
- package/dist/scaffold/billing-contracts.js +0 -48
- package/dist/scaffold/billing-providers.d.ts +0 -1
- package/dist/scaffold/billing-providers.js +0 -249
- package/dist/scaffold/billing-schema.d.ts +0 -1
- package/dist/scaffold/billing-schema.js +0 -34
- package/dist/scaffold/billing-security.d.ts +0 -1
- package/dist/scaffold/billing-security.js +0 -46
- package/dist/scaffold/billing-server.d.ts +0 -1
- package/dist/scaffold/billing-server.js +0 -139
- package/dist/scaffold/billing-store.d.ts +0 -1
- package/dist/scaffold/billing-store.js +0 -72
- package/dist/scaffold/billing.d.ts +0 -2
- package/dist/scaffold/billing.js +0 -216
- package/dist/scaffold/cloudflare-services.d.ts +0 -8
- package/dist/scaffold/cloudflare-services.js +0 -198
- package/dist/scaffold/expo-auth.d.ts +0 -3
- package/dist/scaffold/expo-auth.js +0 -192
- package/dist/scaffold/expo-billing.d.ts +0 -3
- package/dist/scaffold/expo-billing.js +0 -292
- package/dist/scaffold/integrations.d.ts +0 -4
- package/dist/scaffold/integrations.js +0 -12
- package/dist/scaffold/lint.d.ts +0 -4
- package/dist/scaffold/lint.js +0 -56
- package/dist/scaffold/neon-realtime.d.ts +0 -2
- package/dist/scaffold/neon-realtime.js +0 -97
- package/dist/scaffold/services.d.ts +0 -5
- package/dist/scaffold/services.js +0 -108
- package/dist/scaffold/stream.d.ts +0 -2
- package/dist/scaffold/stream.js +0 -114
- package/dist/scaffold/void.d.ts +0 -4
- package/dist/scaffold/void.js +0 -264
- package/dist/scaffold/web.d.ts +0 -2
- package/dist/scaffold/web.js +0 -130
- package/dist/service-deletion.d.ts +0 -29
- package/dist/service-deletion.js +0 -195
- package/dist/service-descriptor.d.ts +0 -10
- package/dist/service-descriptor.js +0 -78
- package/dist/service-model.d.ts +0 -49
- package/dist/service-model.js +0 -8
- package/dist/service-operations.d.ts +0 -29
- package/dist/service-operations.js +0 -78
- package/dist/service-readers.d.ts +0 -8
- package/dist/service-readers.js +0 -247
- package/dist/services-command.d.ts +0 -39
- package/dist/services-command.js +0 -102
- package/dist/ship.d.ts +0 -348
- package/dist/ship.js +0 -239
- package/dist/vercel-project.d.ts +0 -101
- package/dist/vercel-project.js +0 -305
- package/dist/vercel.d.ts +0 -67
- package/dist/vercel.js +0 -581
- package/dist/vinext.d.ts +0 -2
- package/dist/vinext.js +0 -86
- package/dist/void-execution.d.ts +0 -10
- package/dist/void-execution.js +0 -94
- package/dist/void-migrations.d.ts +0 -6
- package/dist/void-migrations.js +0 -110
- package/dist/void-state.d.ts +0 -16
- package/dist/void-state.js +0 -65
- package/dist/void.d.ts +0 -3
- package/dist/void.js +0 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type UiPlatform = 'web' | 'native';
|
|
2
|
+
export interface UiSource {
|
|
3
|
+
item: string;
|
|
4
|
+
dependencies: string[];
|
|
5
|
+
registryDependencies: string[];
|
|
6
|
+
compatibility: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UiComponent {
|
|
9
|
+
name: string;
|
|
10
|
+
web: UiSource | null;
|
|
11
|
+
native: UiSource | null;
|
|
12
|
+
}
|
|
13
|
+
export declare const UI_CATALOG: {
|
|
14
|
+
schemaVersion: number;
|
|
15
|
+
revision: string;
|
|
16
|
+
nativeStyling: string;
|
|
17
|
+
shadcnCliVersion: string;
|
|
18
|
+
sources: Record<string, string>;
|
|
19
|
+
components: UiComponent[];
|
|
20
|
+
};
|
|
21
|
+
/** Resolve names only. Upstream shadcn owns dependency resolution and source installation. */
|
|
22
|
+
export declare function resolveUiItems(names: string[], platform: UiPlatform, extensionRoot?: string): {
|
|
23
|
+
name: string;
|
|
24
|
+
source: string;
|
|
25
|
+
item: string;
|
|
26
|
+
}[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export const UI_CATALOG = JSON.parse(readFileSync(new URL('../assets/ui/catalog.json', import.meta.url), 'utf8'));
|
|
5
|
+
const extensions = fileURLToPath(new URL('../assets/ui/extensions/', import.meta.url));
|
|
6
|
+
/** Resolve names only. Upstream shadcn owns dependency resolution and source installation. */
|
|
7
|
+
export function resolveUiItems(names, platform, extensionRoot = extensions) {
|
|
8
|
+
const registry = JSON.parse(readFileSync(path.join(extensionRoot, 'registry.json'), 'utf8'));
|
|
9
|
+
return [...new Set(names)].map((name) => {
|
|
10
|
+
if (!/^[a-z][a-z0-9-]{0,79}$/.test(name))
|
|
11
|
+
throw Error(`Invalid component name: ${name}.`);
|
|
12
|
+
const component = UI_CATALOG.components.find((item) => item.name === name);
|
|
13
|
+
if (!component)
|
|
14
|
+
throw Error(`Unknown UI component: ${name}. Run anhedral ui list.`);
|
|
15
|
+
if (platform === 'native' && registry.items.some((item) => item.name === name)) {
|
|
16
|
+
const file = path.join(extensionRoot, `${name}.json`);
|
|
17
|
+
if (!existsSync(file))
|
|
18
|
+
throw Error(`Missing reviewed Anhedral extension: ${name}.`);
|
|
19
|
+
return { name, source: 'anhedral', item: file };
|
|
20
|
+
}
|
|
21
|
+
if (!component[platform])
|
|
22
|
+
throw Error(`${name} is not yet available for ${platform}. No substitute was installed.`);
|
|
23
|
+
return {
|
|
24
|
+
name,
|
|
25
|
+
source: platform === 'web' ? 'shadcn' : 'react-native-reusables',
|
|
26
|
+
item: platform === 'web'
|
|
27
|
+
? name
|
|
28
|
+
: `https://reactnativereusables.com/r/nativewind/${component.native.item}.json`,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
4
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
5
|
+
import { commandArguments, commandArgumentError } from './cli-arguments.js';
|
|
6
|
+
import { resolveCommand } from './command.js';
|
|
7
|
+
import { UI_CATALOG, resolveUiItems } from './ui-catalog.js';
|
|
8
|
+
import { detectUiTargets, initializeUiMetadata, inspectUiTarget } from './ui-project.js';
|
|
9
|
+
function runUpstream(args, cwd) {
|
|
10
|
+
const invocation = resolveCommand('pnpm', [
|
|
11
|
+
'dlx',
|
|
12
|
+
`shadcn@${UI_CATALOG.shadcnCliVersion}`,
|
|
13
|
+
...args,
|
|
14
|
+
]);
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const child = spawn(invocation.command, invocation.args, {
|
|
17
|
+
cwd,
|
|
18
|
+
shell: false,
|
|
19
|
+
detached: process.platform !== 'win32',
|
|
20
|
+
windowsHide: true,
|
|
21
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
22
|
+
env: { ...process.env, CI: '1', NO_COLOR: '1' },
|
|
23
|
+
});
|
|
24
|
+
let stdout = '', stderr = '', answered = 0, bytes = 0;
|
|
25
|
+
const fail = (reason) => {
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
if (child.pid) {
|
|
28
|
+
if (process.platform === 'win32')
|
|
29
|
+
spawnSync('taskkill', ['/pid', String(child.pid), '/T', '/F'], {
|
|
30
|
+
shell: false,
|
|
31
|
+
stdio: 'ignore',
|
|
32
|
+
windowsHide: true,
|
|
33
|
+
timeout: 5000,
|
|
34
|
+
});
|
|
35
|
+
else {
|
|
36
|
+
try {
|
|
37
|
+
process.kill(-child.pid, 'SIGKILL');
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
child.kill();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
reject(Error(`Upstream UI command failed in ${cwd}: ${reason}`));
|
|
45
|
+
};
|
|
46
|
+
const timer = setTimeout(() => fail('installer timed out; inspect consumer changes before retrying'), 120000);
|
|
47
|
+
child.stdin.on('error', () => {
|
|
48
|
+
/* Process exit can close stdin before its final answer. */
|
|
49
|
+
});
|
|
50
|
+
child.stdout.setEncoding('utf8');
|
|
51
|
+
child.stderr.setEncoding('utf8');
|
|
52
|
+
const receive = (chunk, stream) => {
|
|
53
|
+
bytes += Buffer.byteLength(chunk);
|
|
54
|
+
if (bytes > 4 * 1024 * 1024)
|
|
55
|
+
return fail('installer output exceeded its bound');
|
|
56
|
+
if (stream === 'stdout')
|
|
57
|
+
stdout += chunk;
|
|
58
|
+
else
|
|
59
|
+
stderr += chunk;
|
|
60
|
+
// shadcn --yes skips confirmation, not overwrite prompts. Reply to each
|
|
61
|
+
// pinned CLI prompt when it appears; prefeeding stdin loses later answers.
|
|
62
|
+
const visible = stripVTControlCharacters(stdout + stderr);
|
|
63
|
+
const prompts = visible.match(/› \(y\/N\)/g)?.length ?? 0;
|
|
64
|
+
while (answered < prompts) {
|
|
65
|
+
answered++;
|
|
66
|
+
child.stdin.write('n\r');
|
|
67
|
+
}
|
|
68
|
+
// prompts retains a stdin listener after confirmations. Close input only
|
|
69
|
+
// after the pinned installer reports its completed file operations.
|
|
70
|
+
if (answered && /(?:Created|Updated|Skipped) \d+ files?\b/.test(visible))
|
|
71
|
+
child.stdin.end();
|
|
72
|
+
};
|
|
73
|
+
child.stdout.on('data', (chunk) => receive(chunk, 'stdout'));
|
|
74
|
+
child.stderr.on('data', (chunk) => receive(chunk, 'stderr'));
|
|
75
|
+
child.on('error', (error) => {
|
|
76
|
+
clearTimeout(timer);
|
|
77
|
+
reject(error);
|
|
78
|
+
});
|
|
79
|
+
child.on('close', (status) => {
|
|
80
|
+
clearTimeout(timer);
|
|
81
|
+
if (status !== 0)
|
|
82
|
+
reject(Error(`Upstream UI command failed in ${cwd}: ${stderr.slice(-2000) || 'check the project configuration'}`));
|
|
83
|
+
else
|
|
84
|
+
resolve(stdout);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export async function runUiCommand(args, output, run = runUpstream) {
|
|
89
|
+
const parsed = commandArguments('ui', args);
|
|
90
|
+
const [action, ...names] = parsed.positional;
|
|
91
|
+
if (!['init', 'add', 'list', 'diff', 'doctor'].includes(action))
|
|
92
|
+
throw commandArgumentError('ui', 'Choose ui init, add, list, diff or doctor.');
|
|
93
|
+
if (['add', 'diff'].includes(action) ? !names.length || names.length > 50 : names.length > 0)
|
|
94
|
+
throw commandArgumentError('ui', 'Supply component names only for add/diff (at most 50).');
|
|
95
|
+
const selectors = ['--web', '--native', '--all'].filter((flag) => parsed.has(flag));
|
|
96
|
+
if (selectors.length > 1)
|
|
97
|
+
throw commandArgumentError('ui', 'Choose one of --web, --native or --all.');
|
|
98
|
+
const selector = selectors[0]?.slice(2);
|
|
99
|
+
let result;
|
|
100
|
+
if (action === 'list') {
|
|
101
|
+
result = {
|
|
102
|
+
catalogRevision: UI_CATALOG.revision,
|
|
103
|
+
nativeStyling: UI_CATALOG.nativeStyling,
|
|
104
|
+
components: UI_CATALOG.components.filter((item) => !selector || selector === 'all' || item[selector]),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const targets = detectUiTargets(process.cwd(), selector);
|
|
109
|
+
if (action === 'doctor') {
|
|
110
|
+
const reports = targets.map(inspectUiTarget);
|
|
111
|
+
result = {
|
|
112
|
+
targets: reports,
|
|
113
|
+
configurationReady: reports.every((report) => report.configurationReady),
|
|
114
|
+
};
|
|
115
|
+
if (!reports.every((report) => report.configurationReady))
|
|
116
|
+
process.exitCode = 1;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// Preflight every target before invoking any installer, including explicit --all.
|
|
120
|
+
const plans = targets.map((target) => {
|
|
121
|
+
const report = inspectUiTarget(target);
|
|
122
|
+
const configExists = existsSync(path.join(target.root, 'components.json'));
|
|
123
|
+
const nativeInit = action === 'init' && target.platform === 'native';
|
|
124
|
+
const issues = nativeInit
|
|
125
|
+
? report.issues.filter((issue) => !issue.startsWith('Missing components.json'))
|
|
126
|
+
: report.issues;
|
|
127
|
+
if ((action !== 'init' || target.platform === 'native' || configExists) && issues.length)
|
|
128
|
+
throw Error(issues.join('\n') + '\n' + report.guide);
|
|
129
|
+
if (nativeInit && !configExists && !existsSync(path.join(target.root, 'global.css')))
|
|
130
|
+
throw Error('Native init needs the upstream NativeWind global.css. Complete the RNR setup first.');
|
|
131
|
+
const items = action === 'init' ? [] : resolveUiItems(names, target.platform);
|
|
132
|
+
return {
|
|
133
|
+
root: target.root,
|
|
134
|
+
platform: target.platform,
|
|
135
|
+
items,
|
|
136
|
+
nativeInit,
|
|
137
|
+
command: action === 'init'
|
|
138
|
+
? configExists || nativeInit
|
|
139
|
+
? []
|
|
140
|
+
: ['init', '--base', 'base', '--defaults', '--no-reinstall', '--no-monorepo']
|
|
141
|
+
: [
|
|
142
|
+
'add',
|
|
143
|
+
...items.map((item) => item.item),
|
|
144
|
+
'--yes',
|
|
145
|
+
...(action === 'diff' ? ['--diff'] : []),
|
|
146
|
+
],
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
if (!parsed.has('--dry-run')) {
|
|
150
|
+
for (const plan of plans) {
|
|
151
|
+
if (plan.nativeInit && !existsSync(path.join(plan.root, 'components.json'))) {
|
|
152
|
+
if (!existsSync(path.join(plan.root, 'global.css')))
|
|
153
|
+
throw Error('Native init needs the upstream NativeWind global.css. Complete the RNR setup first.');
|
|
154
|
+
writeFileSync(path.join(plan.root, 'components.json'), JSON.stringify({
|
|
155
|
+
$schema: 'https://ui.shadcn.com/schema.json',
|
|
156
|
+
style: 'new-york',
|
|
157
|
+
rsc: false,
|
|
158
|
+
tsx: true,
|
|
159
|
+
tailwind: {
|
|
160
|
+
config: 'tailwind.config.js',
|
|
161
|
+
css: 'global.css',
|
|
162
|
+
baseColor: 'neutral',
|
|
163
|
+
cssVariables: true,
|
|
164
|
+
},
|
|
165
|
+
aliases: {
|
|
166
|
+
components: '@/components',
|
|
167
|
+
ui: '@/components/ui',
|
|
168
|
+
utils: '@/lib/utils',
|
|
169
|
+
lib: '@/lib',
|
|
170
|
+
hooks: '@/hooks',
|
|
171
|
+
},
|
|
172
|
+
}, null, 2) + '\n', { flag: 'wx' });
|
|
173
|
+
}
|
|
174
|
+
const vendorOutput = plan.command.length ? await run(plan.command, plan.root) : '';
|
|
175
|
+
if (action === 'init' || action === 'add')
|
|
176
|
+
initializeUiMetadata(plan.root, plan.platform);
|
|
177
|
+
Object.assign(plan, { output: vendorOutput });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
result = {
|
|
181
|
+
action,
|
|
182
|
+
dryRun: parsed.has('--dry-run'),
|
|
183
|
+
installer: `shadcn@${UI_CATALOG.shadcnCliVersion}`,
|
|
184
|
+
targets: plans,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (output.json)
|
|
189
|
+
console.log(JSON.stringify(result, null, 2));
|
|
190
|
+
else if (!output.quiet)
|
|
191
|
+
console.log(action === 'list'
|
|
192
|
+
? UI_CATALOG.components
|
|
193
|
+
.filter((item) => !selector || selector === 'all' || item[selector])
|
|
194
|
+
.map((item) => `${item.name}\tweb: ${item.web ? 'shadcn' : 'unavailable'}\tnative: ${item.native ? 'RNR (validation required)' : 'unavailable'}`)
|
|
195
|
+
.join('\n')
|
|
196
|
+
: action === 'doctor'
|
|
197
|
+
? result.targets
|
|
198
|
+
.map((report) => [
|
|
199
|
+
`${report.platform}: ${report.configurationReady ? 'configuration ready' : 'setup needed'} (${report.root})`,
|
|
200
|
+
...report.issues,
|
|
201
|
+
'Runtime acceptance: not evaluated.',
|
|
202
|
+
].join('\n'))
|
|
203
|
+
.join('\n\n')
|
|
204
|
+
: result.targets
|
|
205
|
+
.map((target) => [
|
|
206
|
+
`${action}${parsed.has('--dry-run') ? ' (dry run)' : ''}: ${target.platform} (${target.root})`,
|
|
207
|
+
...(parsed.has('--dry-run')
|
|
208
|
+
? [
|
|
209
|
+
target.command.length
|
|
210
|
+
? `shadcn@${UI_CATALOG.shadcnCliVersion} ${target.command.join(' ')}`
|
|
211
|
+
: 'Validate existing configuration; initialize metadata and attribution if absent.',
|
|
212
|
+
]
|
|
213
|
+
: []),
|
|
214
|
+
target.output?.trim() ?? '',
|
|
215
|
+
]
|
|
216
|
+
.filter(Boolean)
|
|
217
|
+
.join('\n'))
|
|
218
|
+
.join('\n\n'));
|
|
219
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type UiPlatform } from './ui-catalog.js';
|
|
2
|
+
type Manifest = {
|
|
3
|
+
dependencies?: Record<string, string>;
|
|
4
|
+
devDependencies?: Record<string, string>;
|
|
5
|
+
};
|
|
6
|
+
export interface UiTarget {
|
|
7
|
+
root: string;
|
|
8
|
+
platform: UiPlatform;
|
|
9
|
+
manifest: Manifest;
|
|
10
|
+
}
|
|
11
|
+
export declare function detectUiTargets(cwd: string, selector?: UiPlatform | 'all'): UiTarget[];
|
|
12
|
+
export declare function inspectUiTarget(target: UiTarget): {
|
|
13
|
+
root: string;
|
|
14
|
+
platform: UiPlatform;
|
|
15
|
+
configurationReady: boolean;
|
|
16
|
+
issues: string[];
|
|
17
|
+
runtimeAcceptance: string;
|
|
18
|
+
guide: string;
|
|
19
|
+
};
|
|
20
|
+
/** New metadata and attribution only; never overwrite consumer-owned files. */
|
|
21
|
+
export declare function initializeUiMetadata(root: string, platform: UiPlatform): void;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync, } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { UI_CATALOG } from './ui-catalog.js';
|
|
4
|
+
export function detectUiTargets(cwd, selector) {
|
|
5
|
+
let root = realpathSync(cwd);
|
|
6
|
+
let targets = [];
|
|
7
|
+
function inspect(directory) {
|
|
8
|
+
const file = path.join(directory, 'package.json');
|
|
9
|
+
if (!existsSync(file))
|
|
10
|
+
return;
|
|
11
|
+
const manifest = JSON.parse(readFileSync(file, 'utf8'));
|
|
12
|
+
const dependencies = { ...manifest.devDependencies, ...manifest.dependencies };
|
|
13
|
+
if (dependencies.next)
|
|
14
|
+
targets.push({ root: directory, platform: 'web', manifest });
|
|
15
|
+
if (dependencies.expo)
|
|
16
|
+
targets.push({ root: directory, platform: 'native', manifest });
|
|
17
|
+
}
|
|
18
|
+
for (;;) {
|
|
19
|
+
inspect(root);
|
|
20
|
+
if (!targets.length && existsSync(path.join(root, 'apps'))) {
|
|
21
|
+
for (const entry of readdirSync(path.join(root, 'apps'), { withFileTypes: true }))
|
|
22
|
+
if (entry.isDirectory() && !entry.isSymbolicLink())
|
|
23
|
+
inspect(path.join(root, 'apps', entry.name));
|
|
24
|
+
}
|
|
25
|
+
if (targets.length || existsSync(path.join(root, '.git')))
|
|
26
|
+
break;
|
|
27
|
+
const parent = path.dirname(root);
|
|
28
|
+
if (parent === root)
|
|
29
|
+
break;
|
|
30
|
+
root = parent;
|
|
31
|
+
}
|
|
32
|
+
if (selector && selector !== 'all')
|
|
33
|
+
targets = targets.filter((target) => target.platform === selector);
|
|
34
|
+
if (!targets.length)
|
|
35
|
+
throw Error('No matching Next.js or Expo application found. Use --cwd to select an application.');
|
|
36
|
+
if (targets.length > 1 && selector !== 'all')
|
|
37
|
+
throw Error('Multiple UI applications found. Select --web, --native, --all, or use --cwd for one application.');
|
|
38
|
+
if (new Set(targets.map((target) => target.root)).size !== targets.length)
|
|
39
|
+
throw Error('Web and native UI must use separate application directories.');
|
|
40
|
+
return targets;
|
|
41
|
+
}
|
|
42
|
+
export function inspectUiTarget(target) {
|
|
43
|
+
const issues = [];
|
|
44
|
+
const file = path.join(target.root, 'components.json');
|
|
45
|
+
const config = existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : null;
|
|
46
|
+
if (!config)
|
|
47
|
+
issues.push('Missing components.json. Run anhedral ui init for this application.');
|
|
48
|
+
if (config && (!config.aliases?.ui || !config.aliases?.utils || !config.tailwind?.css))
|
|
49
|
+
issues.push('components.json needs UI/utils aliases and a Tailwind CSS entry.');
|
|
50
|
+
const marker = path.join(target.root, '.anhedral-ui.json');
|
|
51
|
+
if (existsSync(marker) && JSON.parse(readFileSync(marker, 'utf8')).platform !== target.platform)
|
|
52
|
+
issues.push('Existing Anhedral UI configuration targets another platform.');
|
|
53
|
+
if (target.platform === 'native') {
|
|
54
|
+
const dependencies = { ...target.manifest.devDependencies, ...target.manifest.dependencies };
|
|
55
|
+
for (const dependency of [
|
|
56
|
+
'class-variance-authority',
|
|
57
|
+
'clsx',
|
|
58
|
+
'tailwind-merge',
|
|
59
|
+
'tailwindcss-animate',
|
|
60
|
+
'@rn-primitives/portal',
|
|
61
|
+
])
|
|
62
|
+
if (!dependencies[dependency])
|
|
63
|
+
issues.push(`Missing RNR baseline dependency: ${dependency}. Complete the upstream setup first.`);
|
|
64
|
+
if (!/^\D*4\./.test(dependencies.nativewind ?? ''))
|
|
65
|
+
issues.push('Set up NativeWind 4 using the RNR manual guide before native UI installation.');
|
|
66
|
+
if (!['metro.config.js', 'metro.config.cjs', 'metro.config.ts'].some((name) => existsSync(path.join(target.root, name))))
|
|
67
|
+
issues.push('Missing Metro configuration. Complete the upstream NativeWind setup first.');
|
|
68
|
+
if (config?.rsc)
|
|
69
|
+
issues.push('Native components.json must set rsc to false.');
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
root: target.root,
|
|
73
|
+
platform: target.platform,
|
|
74
|
+
configurationReady: issues.length === 0,
|
|
75
|
+
issues,
|
|
76
|
+
runtimeAcceptance: 'not evaluated',
|
|
77
|
+
guide: target.platform === 'native'
|
|
78
|
+
? 'https://reactnativereusables.com/docs/installation/manual'
|
|
79
|
+
: 'https://ui.shadcn.com/docs/installation/next',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** New metadata and attribution only; never overwrite consumer-owned files. */
|
|
83
|
+
export function initializeUiMetadata(root, platform) {
|
|
84
|
+
const file = path.join(root, '.anhedral-ui.json');
|
|
85
|
+
if (existsSync(file)) {
|
|
86
|
+
const existing = JSON.parse(readFileSync(file, 'utf8'));
|
|
87
|
+
if (existing.platform !== platform)
|
|
88
|
+
throw Error('Existing Anhedral UI configuration targets another platform.');
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
writeFileSync(file, JSON.stringify({
|
|
92
|
+
schemaVersion: 1,
|
|
93
|
+
platform,
|
|
94
|
+
catalogRevision: UI_CATALOG.revision,
|
|
95
|
+
nativeStyling: platform === 'native' ? UI_CATALOG.nativeStyling : undefined,
|
|
96
|
+
sourceOwned: true,
|
|
97
|
+
automaticUpdates: false,
|
|
98
|
+
}, null, 2) + '\n', { flag: 'wx' });
|
|
99
|
+
const licenses = path.join(root, 'ANHEDRAL_UI_LICENSES');
|
|
100
|
+
mkdirSync(licenses, { recursive: true });
|
|
101
|
+
for (const name of platform === 'native'
|
|
102
|
+
? ['LICENSE.react-native-reusables', 'LICENSE.shadcn']
|
|
103
|
+
: ['LICENSE.shadcn']) {
|
|
104
|
+
const destination = path.join(licenses, name);
|
|
105
|
+
if (!existsSync(destination))
|
|
106
|
+
writeFileSync(destination, readFileSync(new URL(`../assets/ui/${name}`, import.meta.url)), {
|
|
107
|
+
flag: 'wx',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "0.
|
|
1
|
+
export declare const GENERATOR_VERSION = "0.16.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GENERATOR_VERSION = '0.
|
|
1
|
+
export const GENERATOR_VERSION = '0.16.0';
|
package/docs/anhedral-stack.md
CHANGED
|
@@ -1,122 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Application foundation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
when the complete foundation is appropriate.**
|
|
3
|
+
Start with Next.js, Anhedral UI and OpenNext for Cloudflare Workers. Only the web application is generated. Anhedral UI uses official shadcn web components and React Native Reusables native components, with a small optional Anhedral native extension layer.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
%%{init: {"flowchart": {"curve": "linear", "nodeSpacing": 35, "rankSpacing": 50, "padding": 18}}}%%
|
|
8
|
-
flowchart TB
|
|
9
|
-
subgraph minimal["1 · Minimal default"]
|
|
10
|
-
client["Expo · web / iOS / Android<br/>React Native Reusables · shadcn conventions<br/>NativeWind · shared tokens"]
|
|
11
|
-
web["Cloudflare static web Worker"]
|
|
12
|
-
client -->|"web export"| web
|
|
13
|
-
end
|
|
5
|
+
Grow the application deliberately: Hono for a separate API, Drizzle/D1 and Better Auth for persistence and identity, then optional storage, clients, payments, realtime and AI. Expo, Anhedral UI for Expo, WXT/Side Panel, GPUI, Stripe and RevenueCat are choices rather than automatic scaffold output. The exact “if needed” conditions remain open.
|
|
14
6
|
|
|
15
|
-
|
|
16
|
-
backend["Hono API · Cloudflare Workers<br/>Public contracts · authorization"]
|
|
17
|
-
core["Data, accounts and files<br/>Drizzle / D1 · Better Auth · private R2 · KV"]
|
|
18
|
-
compute["AI, analytics and processing<br/>Workers AI · Analytics Engine · Basin<br/>Images · Queues · Cron · Workflows"]
|
|
19
|
-
media["Realtime and video<br/>Durable Object rooms · RealtimeKit<br/>Stream live / uploaded video"]
|
|
20
|
-
payments["Payments<br/>Stripe web · RevenueCat native<br/>Shared entitlements enforced by Hono"]
|
|
21
|
-
clients["Additional client<br/>WXT browser side panel"]
|
|
22
|
-
operations["External operations<br/>Resend email · Sentry monitoring"]
|
|
23
|
-
backend -.-> core
|
|
24
|
-
backend -.-> compute
|
|
25
|
-
backend -.-> media
|
|
26
|
-
backend -.-> payments
|
|
27
|
-
backend -.-> operations
|
|
28
|
-
clients -.->|"when a backend is needed"| backend
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
web ~~~ clients
|
|
32
|
-
web -.->|"add API service binding"| backend
|
|
33
|
-
client -.->|"native HTTPS when selected"| backend
|
|
34
|
-
|
|
35
|
-
subgraph full["3 · Full-product preset · selection summary"]
|
|
36
|
-
preset["Minimal app + all capabilities above<br/>22 selected products · no provider activation"]
|
|
37
|
-
end
|
|
38
|
-
core ~~~ preset
|
|
39
|
-
compute ~~~ preset
|
|
40
|
-
media ~~~ preset
|
|
41
|
-
payments ~~~ preset
|
|
42
|
-
operations ~~~ preset
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Solid lines show the minimal delivery path. Dashed lines summarize optional
|
|
46
|
-
integrations, not every network request or deployment. The full-product group is a
|
|
47
|
-
selection summary, not another runtime. Grouped capabilities remain separate
|
|
48
|
-
services; their exact connections depend on the implemented product.
|
|
49
|
-
|
|
50
|
-
## Minimal default
|
|
51
|
-
|
|
52
|
-
| Part | Default |
|
|
53
|
-
| --- | --- |
|
|
54
|
-
| Client | Expo + React Native + Expo Router |
|
|
55
|
-
| Components | React Native Reusables with **shadcn conventions** |
|
|
56
|
-
| Styling | NativeWind + shared design tokens |
|
|
57
|
-
| Workspace | TypeScript + pnpm + Turborepo; shared TypeScript/ESLint configuration |
|
|
58
|
-
| Web hosting | Static Expo export on a Cloudflare asset Worker |
|
|
59
|
-
| Native delivery | Local development; EAS and app stores when requested |
|
|
60
|
-
|
|
61
|
-
Plain `anhedral init my-app` creates no API, auth, database, storage binding or
|
|
62
|
-
billing package. Static dynamic routes need build-time paths; SSR is a deliberate
|
|
63
|
-
alternative.
|
|
64
|
-
|
|
65
|
-
**Growth is additive.** `hono` adds the API and contracts. `d1` adds Hono and SQL.
|
|
66
|
-
`better-auth` adds Hono and a database. `r2` adds private server-side file storage.
|
|
67
|
-
Dependencies resolve automatically: an AI tool can have an API without accounts,
|
|
68
|
-
and an anonymous app can use SQL. Additions preserve edited source; backend or
|
|
69
|
-
hosting-engine migrations require explicit review.
|
|
70
|
-
|
|
71
|
-
## Payments and AI
|
|
72
|
-
|
|
73
|
-
| Add | What it supplies |
|
|
74
|
-
| --- | --- |
|
|
75
|
-
| `stripe` | Web Checkout/customer portal; Hono, identity and durable billing state |
|
|
76
|
-
| `revenuecat` | Native purchase/restore/manage flows; shared identity and entitlements |
|
|
77
|
-
| `workers-ai` | Hono + AI binding; no implicit accounts, database or subscriptions |
|
|
78
|
-
|
|
79
|
-
Stripe and RevenueCat are independent. Hono verifies webhooks, reconciles provider
|
|
80
|
-
state and enforces paid access. Native purchases use Apple/Google billing;
|
|
81
|
-
RevenueCat synchronizes subscription state. Client purchase results never authorize
|
|
82
|
-
server operations. AI routes still need models, validation and usage limits.
|
|
83
|
-
|
|
84
|
-
## Services, add-ons and alternatives
|
|
85
|
-
|
|
86
|
-
| Capability | Selection | Scope |
|
|
87
|
-
| --- | --- | --- |
|
|
88
|
-
| Analytics | `analytics-engine`, `basin` | Event dataset/helper; private Pipelines stream |
|
|
89
|
-
| Images | `images` | Binding and private raw-byte transform helper |
|
|
90
|
-
| Video | `video`, `stream` | Private uploaded-video helper; WHIP/WHEP live input helper |
|
|
91
|
-
| Conferencing | `realtimekit` | Server meeting and participant-token helpers |
|
|
92
|
-
| App messaging | `realtime` | Durable Object room Worker |
|
|
93
|
-
| Jobs | `queues`, `cron`, `workflows` | Queue/DLQ, scheduled and durable Worker foundations |
|
|
94
|
-
| Cache | `kv` | Eventually consistent configuration/cache |
|
|
95
|
-
| Extension | `wxt` | Browser side panel API, entrypoints and permissions |
|
|
96
|
-
| Operations | `resend`, `sentry` | Email factory and monitoring integration boundary |
|
|
97
|
-
| **Next.js on Vercel** | `next` | Usual explicit web frontend alternative |
|
|
98
|
-
| **Vinext on Cloudflare** | `vinext` | Additional explicit web frontend alternative |
|
|
99
|
-
| Data / identity alternatives | `neon`, `clerk` | Replace D1 / Better Auth |
|
|
100
|
-
| Specialized additions | `neon-realtime`, `openai` / `ai-sdk`, `posthog`, `electron`, `local-data` | Live SQL, alternative AI, product analytics, desktop or local persistence |
|
|
101
|
-
|
|
102
|
-
**Full-product includes:** Expo, WXT, Hono, Better Auth, D1, R2, KV, Stripe,
|
|
103
|
-
RevenueCat, Workers AI, Analytics Engine, Basin, Images, RealtimeKit, Durable Object
|
|
104
|
-
rooms, uploaded video, live Stream video, Queues, Cron, Workflows, Resend and Sentry.
|
|
105
|
-
Explicit Next.js/Vinext, Neon and Clerk replace their corresponding preset defaults.
|
|
106
|
-
|
|
107
|
-
Cloudflare hosts selected web/API, data, storage, AI and media services. Payment
|
|
108
|
-
providers, app stores, Resend, Sentry and Vercel remain external. Media travels
|
|
109
|
-
directly between clients and media services; Hono handles authorization and token
|
|
110
|
-
issuance. Provider activation, product routes/UI and real acceptance remain work
|
|
111
|
-
after scaffolding—especially room authorization, media clients and job processing.
|
|
112
|
-
|
|
113
|
-
```sh
|
|
114
|
-
anhedral init my-app
|
|
115
|
-
anhedral add better-auth --cwd my-app --dry-run --json
|
|
116
|
-
anhedral init complete --preset full-product --dry-run --json
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Deployable code lives in `apps/*`; shared code lives in `packages/*`. Contracts,
|
|
120
|
-
database, auth, billing and service packages appear when selected. Small apps avoid
|
|
121
|
-
unneeded infrastructure; complex products use the same boundaries with more
|
|
122
|
-
capabilities.
|
|
7
|
+
Use `anhedral add` to compose the selected [capabilities](capabilities.md) after previewing their source changes. Consumers implement features and operate their services. The CLI has no Platform identity, payment broker or provider-management dependency. See [stack standard](stack-standard.md) and [UI commands](ui.md).
|