anhedral 0.13.0 → 0.15.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 +35 -232
- package/assets/patches/audit-deps.mjs +12 -2
- package/assets/ui/LICENSE.shadcn +21 -0
- package/assets/ui/UPSTREAM.json +33 -0
- package/assets/ui/native/button.tsx +85 -0
- package/assets/ui/native/card.tsx +33 -0
- package/assets/ui/native/dialog.tsx +75 -0
- package/assets/ui/native/input.tsx +27 -0
- package/assets/ui/native/label.tsx +4 -0
- package/assets/ui/native/layout.tsx +26 -0
- package/assets/ui/native/text.tsx +20 -0
- package/assets/ui/native/theme-switcher.tsx +22 -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/capabilities.d.ts +5 -5
- package/dist/capabilities.js +3 -21
- package/dist/capability-contract.d.ts +3 -3
- package/dist/capability-contract.js +11 -50
- package/dist/cli-delivery.d.ts +1 -1
- package/dist/cli-delivery.js +5 -65
- package/dist/cli-output.js +3 -3
- package/dist/command-schema.js +35 -86
- package/dist/delivery-evidence.d.ts +1 -1
- package/dist/delivery-evidence.js +7 -36
- package/dist/delivery.d.ts +2 -8
- package/dist/delivery.js +20 -101
- package/dist/dependencies.d.ts +6 -57
- package/dist/dependencies.js +54 -188
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -4
- package/dist/inspector-model.d.ts +2 -2
- package/dist/integration-service-readers.d.ts +1 -2
- package/dist/integration-service-readers.js +3 -84
- package/dist/lifecycle-model.d.ts +1 -1
- package/dist/lifecycle-model.js +1 -1
- package/dist/mobile-delivery.d.ts +1 -1
- package/dist/mobile-delivery.js +4 -0
- package/dist/platforms/mobile.js +30 -121
- package/dist/platforms/web.d.ts +3 -0
- package/dist/platforms/web.js +299 -0
- package/dist/project-config.d.ts +1 -1
- package/dist/project-config.js +0 -1
- package/dist/project-inspector.js +5 -36
- package/dist/project-state.d.ts +1 -3
- package/dist/project-state.js +2 -85
- package/dist/provider-auth.js +3 -38
- package/dist/provider-readiness.d.ts +1 -1
- package/dist/provider-readiness.js +5 -24
- package/dist/providers/adapters.js +0 -175
- package/dist/providers/api.d.ts +1 -1
- package/dist/providers/api.js +3 -3
- package/dist/providers/config.js +2 -48
- package/dist/providers/definitions.d.ts +1 -204
- package/dist/providers/definitions.js +0 -85
- package/dist/providers/provision.d.ts +1 -1
- package/dist/providers/receipts.js +1 -11
- package/dist/providers/recovery-verification.js +1 -61
- package/dist/providers/runtime.js +4 -35
- package/dist/providers/state.js +1 -7
- package/dist/provision.d.ts +5 -13
- package/dist/provision.js +4 -80
- package/dist/readiness.d.ts +1 -1
- package/dist/readiness.js +3 -8
- package/dist/registry/add.js +10 -70
- package/dist/registry/bootstrap.d.ts +3 -2
- package/dist/registry/bootstrap.js +4 -13
- package/dist/registry/commands.js +8 -10
- package/dist/registry/context.js +0 -1
- package/dist/registry/options.js +8 -38
- package/dist/registry/resolve.d.ts +3 -4
- package/dist/registry/resolve.js +26 -108
- package/dist/registry/types.d.ts +1 -7
- package/dist/registry/usage.js +2 -2
- package/dist/runtime-policy.d.ts +0 -2
- package/dist/runtime-policy.js +0 -16
- package/dist/scaffold/auth.d.ts +1 -2
- package/dist/scaffold/auth.js +55 -130
- package/dist/scaffold/backend.d.ts +0 -4
- package/dist/scaffold/backend.js +1 -186
- package/dist/scaffold/billing-schema.d.ts +1 -1
- package/dist/scaffold/billing-schema.js +4 -4
- package/dist/scaffold/billing.js +11 -19
- 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 +18 -126
- package/dist/scaffold/documentation.d.ts +0 -1
- package/dist/scaffold/documentation.js +22 -86
- package/dist/scaffold/expo-auth.js +33 -22
- package/dist/scaffold/expo-billing.js +17 -52
- package/dist/scaffold/expo-runtime.d.ts +2 -2
- package/dist/scaffold/expo-runtime.js +6 -97
- package/dist/scaffold/integrations.d.ts +1 -3
- package/dist/scaffold/integrations.js +9 -10
- package/dist/scaffold/managed-email.d.ts +3 -0
- package/dist/scaffold/managed-email.js +47 -0
- package/dist/scaffold/native-ui.d.ts +2 -0
- package/dist/scaffold/native-ui.js +69 -0
- package/dist/scaffold/password-reset.d.ts +1 -0
- package/dist/scaffold/password-reset.js +99 -0
- package/dist/scaffold/private-files.d.ts +2 -0
- package/dist/scaffold/private-files.js +78 -0
- package/dist/scaffold/stack-documentation.d.ts +0 -1
- package/dist/scaffold/stack-documentation.js +3 -49
- package/dist/scaffold/styling.d.ts +1 -1
- package/dist/scaffold/styling.js +20 -28
- package/dist/scaffold/web-billing.d.ts +2 -0
- package/dist/scaffold/web-billing.js +48 -0
- package/dist/scaffold/workspace.js +53 -194
- package/dist/service-deletion.js +1 -1
- package/dist/service-descriptor.js +5 -12
- package/dist/service-model.d.ts +1 -1
- package/dist/service-operations.js +2 -32
- package/dist/service-readers.js +1 -32
- package/dist/services-command.d.ts +1 -1
- package/dist/services-command.js +3 -9
- package/dist/ship.d.ts +3 -316
- package/dist/ship.js +10 -142
- package/dist/stack-registry.d.ts +2 -52
- package/dist/stack-registry.js +55 -403
- package/dist/standard.js +7 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/anhedral-stack.md +23 -122
- package/docs/assets/anhedral-stack-light.png +0 -0
- package/docs/assets/anhedral-stack.png +0 -0
- package/docs/software-factory.md +24 -557
- package/docs/stack-standard.md +47 -294
- package/docs/verification.md +320 -0
- package/package.json +20 -22
- 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/registry/presets.d.ts +0 -4
- package/dist/registry/presets.js +0 -41
- package/dist/scaffold/cloudflare-services.d.ts +0 -8
- package/dist/scaffold/cloudflare-services.js +0 -198
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function scaffoldBillingSchema(root: string
|
|
1
|
+
export declare function scaffoldBillingSchema(root: string): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { put } from './files.js';
|
|
4
|
-
export function scaffoldBillingSchema(root
|
|
5
|
-
const table =
|
|
6
|
-
const integer =
|
|
7
|
-
put(root, 'packages/db/src/billing-schema.ts', `import { ${table}, text,
|
|
4
|
+
export function scaffoldBillingSchema(root) {
|
|
5
|
+
const table = 'sqliteTable';
|
|
6
|
+
const integer = 'integer(name)';
|
|
7
|
+
put(root, 'packages/db/src/billing-schema.ts', `import { ${table}, text, integer, index } from 'drizzle-orm/sqlite-core';
|
|
8
8
|
const number = (name: string) => ${integer};
|
|
9
9
|
|
|
10
10
|
// Billing IDs are verified auth subjects, including external identity providers.
|
package/dist/scaffold/billing.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { STACK_DEPENDENCIES } from '../dependencies.js';
|
|
4
4
|
import { scaffoldBillingContracts } from './billing-contracts.js';
|
|
5
|
+
import { scaffoldWebBilling } from './web-billing.js';
|
|
5
6
|
import { scaffoldExpoBilling } from './expo-billing.js';
|
|
6
7
|
import { scaffoldBillingSchema } from './billing-schema.js';
|
|
7
8
|
import { BILLING_CONFIG } from './billing-config.js';
|
|
@@ -13,19 +14,14 @@ import { writeEnvironmentFile } from './environment.js';
|
|
|
13
14
|
import { json, patchPackage, put, readJson, sharedPackage } from './files.js';
|
|
14
15
|
function applicationBilling(context) {
|
|
15
16
|
const { has } = context;
|
|
16
|
-
const database =
|
|
17
|
-
const authenticate =
|
|
18
|
-
? `const state = await authenticate(request, env.CLERK_SECRET_KEY, env.CLERK_PUBLISHABLE_KEY, [new URL(env.BILLING_ORIGIN).origin]);
|
|
19
|
-
const subject = state.toAuth()?.userId;
|
|
20
|
-
if (!subject) throw new BillingError(401, 'Sign in to access billing.');
|
|
21
|
-
return subject;`
|
|
22
|
-
: `const session = await createAuth(createDatabase(${database}), env.BETTER_AUTH_SECRET, env.BETTER_AUTH_URL).api.getSession({ headers: request.headers });
|
|
17
|
+
const database = 'env.DB';
|
|
18
|
+
const authenticate = `const session = await createAuth(createDatabase(env.DB), env.BETTER_AUTH_SECRET, env.BETTER_AUTH_URL, env).api.getSession({ headers: request.headers });
|
|
23
19
|
if (!session) throw new BillingError(401, 'Sign in to access billing.');
|
|
24
20
|
return session.user.id;`;
|
|
25
21
|
return `import { Hono, type Context } from 'hono';
|
|
26
22
|
import { z } from 'zod';
|
|
27
23
|
import { createDatabase } from '@workspace/db';
|
|
28
|
-
import {
|
|
24
|
+
import { createAuth } from '@workspace/auth';
|
|
29
25
|
import { createBilling, BillingError, type Billing } from '@workspace/billing/server';
|
|
30
26
|
|
|
31
27
|
type BillingContext = Context<{ Bindings: Env }>;
|
|
@@ -114,6 +110,7 @@ function connectApi(context) {
|
|
|
114
110
|
const { root } = context;
|
|
115
111
|
put(root, 'apps/api/src/billing.ts', applicationBilling(context));
|
|
116
112
|
put(root, 'apps/api/src/billing-env.d.ts', `import type { BillingEnv } from '@workspace/billing/config';
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Merge billing bindings with Wrangler's generated Env.
|
|
117
114
|
declare global { interface Env extends BillingEnv {} }
|
|
118
115
|
export {};
|
|
119
116
|
`);
|
|
@@ -132,8 +129,7 @@ export default {
|
|
|
132
129
|
context.waitUntil(drainBilling(env));
|
|
133
130
|
},
|
|
134
131
|
};`));
|
|
135
|
-
const
|
|
136
|
-
const configuration = `apps/api/${voidSelected ? 'anhedral.cloudflare.json' : 'wrangler.jsonc'}`;
|
|
132
|
+
const configuration = 'apps/api/wrangler.jsonc';
|
|
137
133
|
const config = readJson(root, configuration);
|
|
138
134
|
const triggers = (config.triggers ?? {});
|
|
139
135
|
config.triggers = {
|
|
@@ -141,20 +137,15 @@ export default {
|
|
|
141
137
|
crons: [...new Set([...(triggers.crons ?? []), '*/5 * * * *'])],
|
|
142
138
|
};
|
|
143
139
|
json(root, configuration, config);
|
|
144
|
-
if (voidSelected)
|
|
145
|
-
put(root, 'apps/api/crons/scheduled.ts', `import application from '../src/index';
|
|
146
|
-
export const cron = ['*/5 * * * *'];
|
|
147
|
-
export default application.scheduled;
|
|
148
|
-
`);
|
|
149
140
|
}
|
|
150
141
|
export function scaffoldBilling(context) {
|
|
151
142
|
const { root, has } = context;
|
|
152
143
|
if (!has('hono'))
|
|
153
144
|
throw new Error('Billing requires the shared Hono runtime.');
|
|
154
|
-
if (!has('d1')
|
|
155
|
-
throw new Error('Billing requires
|
|
145
|
+
if (!has('d1'))
|
|
146
|
+
throw new Error('Billing requires the core D1 database.');
|
|
156
147
|
scaffoldBillingContracts(root);
|
|
157
|
-
scaffoldBillingSchema(root
|
|
148
|
+
scaffoldBillingSchema(root);
|
|
158
149
|
sharedPackage(root, 'billing', "export { createBilling, BillingError } from './server';\n", {
|
|
159
150
|
'@workspace/contracts': 'workspace:*',
|
|
160
151
|
'@workspace/db': 'workspace:*',
|
|
@@ -196,6 +187,7 @@ export function scaffoldBilling(context) {
|
|
|
196
187
|
: {}),
|
|
197
188
|
});
|
|
198
189
|
scaffoldExpoBilling(context);
|
|
190
|
+
scaffoldWebBilling(context);
|
|
199
191
|
put(root, 'packages/billing/README.md', BILLING_README);
|
|
200
192
|
}
|
|
201
193
|
const BILLING_README = `# Shared billing
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { StandardRunner } from '../registry/types.js';
|
|
2
|
-
export declare function assertBootstrapPlatform(run: StandardRunner, platform?: NodeJS.Platform): void;
|
|
3
|
-
/** Planning and diagnostics support older Node releases; generated dependencies do not. */
|
|
4
2
|
export declare function assertWorkspaceRuntime(run: StandardRunner, version?: string): void;
|
|
5
|
-
|
|
3
|
+
/** No downloaded template, disposable Next app or initialization-time cloud operation. */
|
|
4
|
+
export declare function bootstrapWorkspace(root: string, name: string, run: StandardRunner): void;
|
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync } from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { execFile, appendGitignore } from '../util.js';
|
|
4
|
-
import { bootstrapArguments } from '../registry/bootstrap.js';
|
|
5
1
|
import { supportsWorkspaceRuntime } from '../runtime-policy.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
/** Planning and diagnostics support older Node releases; generated dependencies do not. */
|
|
2
|
+
import { execFile } from '../util.js';
|
|
3
|
+
import { STACK_DEPENDENCIES } from '../dependencies.js';
|
|
4
|
+
import { json, put } from './files.js';
|
|
11
5
|
export function assertWorkspaceRuntime(run, version = process.versions.node) {
|
|
12
|
-
if (run
|
|
13
|
-
|
|
14
|
-
if (!supportsWorkspaceRuntime(version))
|
|
15
|
-
throw new Error('Generated workspaces require Node.js 22.13+ on the 22.x line or Node.js 24+. Planning and doctor remain available on older CLI-supported versions.');
|
|
6
|
+
if (run === execFile && !supportsWorkspaceRuntime(version))
|
|
7
|
+
throw new Error('Generated workspaces require Node.js 22.13+ on the 22.x line or Node.js 24+.');
|
|
16
8
|
}
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
/** No downloaded template, disposable Next app or initialization-time cloud operation. */
|
|
10
|
+
export function bootstrapWorkspace(root, name, run) {
|
|
19
11
|
assertWorkspaceRuntime(run);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
: ''
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
12
|
+
json(root, 'package.json', { name, private: true });
|
|
13
|
+
put(root, 'pnpm-workspace.yaml', 'packages:\n - apps/*\n - packages/*\n');
|
|
14
|
+
json(root, 'packages/typescript-config/package.json', {
|
|
15
|
+
name: '@workspace/typescript-config',
|
|
16
|
+
private: true,
|
|
17
|
+
exports: { './base.json': './base.json' },
|
|
18
|
+
});
|
|
19
|
+
json(root, 'packages/typescript-config/base.json', {
|
|
20
|
+
compilerOptions: {
|
|
21
|
+
strict: true,
|
|
22
|
+
skipLibCheck: true,
|
|
23
|
+
target: 'ES2022',
|
|
24
|
+
module: 'ESNext',
|
|
25
|
+
moduleResolution: 'Bundler',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
json(root, 'packages/eslint-config/package.json', {
|
|
29
|
+
name: '@workspace/eslint-config',
|
|
30
|
+
private: true,
|
|
31
|
+
type: 'module',
|
|
32
|
+
exports: { './base': './base.js', './react-internal': './react-internal.js' },
|
|
33
|
+
dependencies: {
|
|
34
|
+
typescript: STACK_DEPENDENCIES.typescript,
|
|
35
|
+
eslint: STACK_DEPENDENCIES.eslint,
|
|
36
|
+
'@typescript-eslint/parser': STACK_DEPENDENCIES['@typescript-eslint/parser'],
|
|
37
|
+
'@typescript-eslint/eslint-plugin': STACK_DEPENDENCIES['@typescript-eslint/eslint-plugin'],
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
put(root, 'packages/eslint-config/base.js', "import parser from '@typescript-eslint/parser';\nimport plugin from '@typescript-eslint/eslint-plugin';\nexport const config = [{ ignores: ['dist/**', '.output/**', '.wrangler/**', 'worker-configuration.d.ts'] }, { files: ['**/*.{ts,tsx,cts,mts}'], languageOptions: { parser, parserOptions: { ecmaFeatures: { jsx: true } } }, plugins: { '@typescript-eslint': plugin }, rules: { ...plugin.configs.recommended.rules, 'no-undef': 'off', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }] } }];\n");
|
|
41
|
+
put(root, 'packages/eslint-config/react-internal.js', "export { config } from './base.js';\n");
|
|
48
42
|
}
|
package/dist/scaffold/compose.js
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
import { scaffoldCloudflareServiceContext } from './cloudflare-services.js';
|
|
2
1
|
import { writeProjectSection } from '../project-config.js';
|
|
3
|
-
import { existsSync
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
4
3
|
import path from 'node:path';
|
|
5
4
|
import { installStackItem } from '../stack-registry.js';
|
|
6
5
|
import { createRecipeContext } from '../registry/context.js';
|
|
7
6
|
import { inspectWorkspaceGraph } from '../workspace-graph.js';
|
|
8
7
|
import { writeStandardRoot } from './workspace.js';
|
|
9
|
-
import { normalizeSharedLint } from './lint.js';
|
|
10
|
-
import { configureVoidDelivery } from './void.js';
|
|
11
8
|
/** Only used in a fresh staged workspace. Existing applications are never overlaid. */
|
|
12
9
|
export async function composeStack(root, options, registry) {
|
|
13
10
|
const context = createRecipeContext(root, options);
|
|
14
|
-
if (!context.has('next') && !context.has('vinext')) {
|
|
15
|
-
for (const directory of ['apps/web', 'packages/ui'])
|
|
16
|
-
rmSync(path.join(root, directory), { recursive: true, force: true });
|
|
17
|
-
}
|
|
18
11
|
for (const item of registry.items)
|
|
19
12
|
Object.assign(context.bindings, item.bindings);
|
|
20
13
|
for (const item of registry.items) {
|
|
21
14
|
if (item.installer === 'recipe')
|
|
22
15
|
await installStackItem(item, context);
|
|
23
16
|
}
|
|
24
|
-
scaffoldCloudflareServiceContext(context);
|
|
25
|
-
normalizeSharedLint(root);
|
|
26
17
|
writeStandardRoot(root, options, registry);
|
|
27
|
-
configureVoidDelivery(root);
|
|
28
18
|
for (const item of registry.items) {
|
|
29
19
|
for (const target of item.targets) {
|
|
30
|
-
if (!existsSync(path.join(root, target))
|
|
31
|
-
!(target.endsWith('/wrangler.jsonc') &&
|
|
32
|
-
existsSync(path.join(root, target.replace('/wrangler.jsonc', '/anhedral.cloudflare.json')))))
|
|
20
|
+
if (!existsSync(path.join(root, target)))
|
|
33
21
|
throw new Error(`Registry target missing: ${item.name} -> ${target}.`);
|
|
34
22
|
}
|
|
35
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RecipeContext } from '../registry/types.js';
|
|
2
|
-
export declare function scaffoldDatabase({ root
|
|
2
|
+
export declare function scaffoldDatabase({ root }: RecipeContext): void;
|
|
@@ -1,148 +1,40 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { writeEnvironmentFile } from './environment.js';
|
|
4
3
|
import { STACK_DEPENDENCIES } from '../dependencies.js';
|
|
5
|
-
import { put, patchPackage,
|
|
6
|
-
export function scaffoldDatabase({ root
|
|
7
|
-
|
|
8
|
-
const postgres = has('neon');
|
|
9
|
-
const directory = 'packages/db';
|
|
10
|
-
sharedPackage(root, 'db', postgres
|
|
11
|
-
? `import { drizzle } from 'drizzle-orm/neon-http';
|
|
12
|
-
import { neon } from '@neondatabase/serverless';
|
|
13
|
-
import * as schema from './schema';
|
|
14
|
-
export function createDatabase(connectionString: string) {
|
|
15
|
-
// HTTP supports independent queries and batches; migrations use a separate transactional connection.
|
|
16
|
-
return drizzle(neon(connectionString), { schema });
|
|
17
|
-
}
|
|
18
|
-
`
|
|
19
|
-
: `import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
+
import { put, patchPackage, sharedPackage } from './files.js';
|
|
5
|
+
export function scaffoldDatabase({ root }) {
|
|
6
|
+
sharedPackage(root, 'db', `import { drizzle } from 'drizzle-orm/d1';
|
|
20
7
|
import * as schema from './schema';
|
|
21
8
|
export function createDatabase(binding: Parameters<typeof drizzle>[0]) { return drizzle(binding, { schema }); }
|
|
22
|
-
`, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
: {}),
|
|
27
|
-
});
|
|
28
|
-
put(root, `${directory}/src/schema.ts`, '// Define product tables here; generate and review SQL before migration.\nexport {};\n');
|
|
29
|
-
put(root, `${directory}/drizzle/.gitkeep`, '');
|
|
30
|
-
if (postgres)
|
|
31
|
-
put(root, `${directory}/migration-environment.ts`, `import { existsSync } from 'node:fs';
|
|
32
|
-
import { loadEnvFile } from 'node:process';
|
|
33
|
-
import { fileURLToPath } from 'node:url';
|
|
34
|
-
const root = new URL('./', import.meta.url);
|
|
35
|
-
export function migrationEnvironment() {
|
|
36
|
-
// Existing process values win; local overrides precede shared defaults.
|
|
37
|
-
for (const name of ['.env.local', '.env']) {
|
|
38
|
-
const file = fileURLToPath(new URL(name, root));
|
|
39
|
-
if (existsSync(file)) loadEnvFile(file);
|
|
40
|
-
}
|
|
41
|
-
return { root, connectionString: process.env.DATABASE_URL_UNPOOLED };
|
|
42
|
-
}
|
|
43
|
-
`);
|
|
44
|
-
put(root, `${directory}/drizzle.config.ts`, postgres
|
|
45
|
-
? `import { relative } from 'node:path';
|
|
46
|
-
import { fileURLToPath } from 'node:url';
|
|
47
|
-
import { defineConfig } from 'drizzle-kit';
|
|
48
|
-
import { migrationEnvironment } from './migration-environment';
|
|
49
|
-
const { root, connectionString: url } = migrationEnvironment();
|
|
50
|
-
export default defineConfig({
|
|
51
|
-
dialect: 'postgresql',
|
|
52
|
-
schema: fileURLToPath(new URL('./src/schema.ts', root)),
|
|
53
|
-
out: relative(process.cwd(), fileURLToPath(new URL('./drizzle/', root))),
|
|
54
|
-
...(url ? { dbCredentials: { url } } : {}),
|
|
55
|
-
});
|
|
56
|
-
`
|
|
57
|
-
: `import { fileURLToPath } from 'node:url';
|
|
9
|
+
`, { 'drizzle-orm': STACK_DEPENDENCIES['drizzle-orm'] });
|
|
10
|
+
put(root, 'packages/db/src/schema.ts', '// Add application tables here. Generate and review SQL before migration.\nexport {};\n');
|
|
11
|
+
put(root, 'packages/db/drizzle/.gitkeep', '');
|
|
12
|
+
put(root, 'packages/db/drizzle.config.ts', `import { fileURLToPath } from 'node:url';
|
|
58
13
|
import { relative } from 'node:path';
|
|
59
14
|
import { defineConfig } from 'drizzle-kit';
|
|
60
|
-
export default defineConfig({
|
|
61
|
-
dialect: 'sqlite',
|
|
62
|
-
schema: fileURLToPath(new URL('./src/schema.ts', import.meta.url)),
|
|
63
|
-
out: relative(process.cwd(), fileURLToPath(new URL('./drizzle/', import.meta.url))),
|
|
64
|
-
});
|
|
15
|
+
export default defineConfig({ dialect: 'sqlite', schema: fileURLToPath(new URL('./src/schema.ts', import.meta.url)), out: relative(process.cwd(), fileURLToPath(new URL('./drizzle/', import.meta.url))) });
|
|
65
16
|
`);
|
|
66
|
-
put(root,
|
|
67
|
-
? `import { fileURLToPath } from 'node:url';
|
|
68
|
-
import { Pool, neonConfig } from '@neondatabase/serverless';
|
|
69
|
-
import { drizzle } from 'drizzle-orm/neon-serverless';
|
|
70
|
-
import { migrate } from 'drizzle-orm/neon-serverless/migrator';
|
|
71
|
-
import { migrationEnvironment } from '../migration-environment';
|
|
72
|
-
const { root, connectionString } = migrationEnvironment();
|
|
73
|
-
if (!connectionString) throw new Error('Configure DATABASE_URL_UNPOOLED for the intended migration branch and role.');
|
|
74
|
-
let url: URL;
|
|
75
|
-
try { url = new URL(connectionString); } catch { throw new Error('Configure a valid direct PostgreSQL migration URL.'); }
|
|
76
|
-
if (!['postgres:', 'postgresql:'].includes(url.protocol) || url.hostname.includes('-pooler.'))
|
|
77
|
-
throw new Error('Migrations require a direct PostgreSQL connection.');
|
|
78
|
-
neonConfig.webSocketConstructor = WebSocket;
|
|
79
|
-
const pool = new Pool({ connectionString });
|
|
80
|
-
try {
|
|
81
|
-
await migrate(drizzle(pool), { migrationsFolder: fileURLToPath(new URL('drizzle/', root)) });
|
|
82
|
-
} catch {
|
|
83
|
-
throw new Error('Database migration failed. Inspect the selected branch and migration history before retrying.');
|
|
84
|
-
} finally {
|
|
85
|
-
await pool.end();
|
|
86
|
-
}
|
|
87
|
-
`
|
|
88
|
-
: `import { spawnSync } from 'node:child_process';
|
|
17
|
+
put(root, 'packages/db/src/migrate.ts', `import { spawnSync } from 'node:child_process';
|
|
89
18
|
import { fileURLToPath } from 'node:url';
|
|
90
19
|
const args = process.argv.slice(2);
|
|
91
|
-
if (args.length > 1 || args.some((arg) => !['--local', '--remote'].includes(arg)))
|
|
92
|
-
throw new Error('Usage: pnpm db:migrate [--local|--remote] (defaults to local).');
|
|
20
|
+
if (args.length > 1 || args.some((arg) => !['--local', '--remote'].includes(arg))) throw new Error('Usage: pnpm db:migrate [--local|--remote] (defaults to local).');
|
|
93
21
|
const pnpm = process.env.npm_execpath;
|
|
94
22
|
if (!pnpm) throw new Error('Run migrations through pnpm db:migrate.');
|
|
95
|
-
const root = fileURLToPath(new URL('../../../apps
|
|
96
|
-
const result = spawnSync(process.execPath, [pnpm, 'exec', 'wrangler', 'd1', 'migrations', 'apply', 'DB',
|
|
97
|
-
args[0] ?? '--local', '--config', fileURLToPath(new URL('../../../apps/${runtimeApp}/wrangler.jsonc', import.meta.url)),
|
|
98
|
-
], { cwd: root, stdio: 'inherit', shell: false });
|
|
23
|
+
const root = fileURLToPath(new URL('../../../apps/api/', import.meta.url));
|
|
24
|
+
const result = spawnSync(process.execPath, [pnpm, 'exec', 'wrangler', 'd1', 'migrations', 'apply', 'DB', args[0] ?? '--local', '--config', fileURLToPath(new URL('../../../apps/api/wrangler.jsonc', import.meta.url))], { cwd: root, stdio: 'inherit', shell: false });
|
|
99
25
|
if (result.error) throw result.error;
|
|
100
26
|
process.exitCode = result.status ?? 1;
|
|
101
27
|
`);
|
|
102
|
-
patchPackage(root,
|
|
28
|
+
patchPackage(root, 'packages/db/package.json', {
|
|
103
29
|
exports: { '.': './src/index.ts', './schema': './src/schema.ts' },
|
|
104
|
-
dependencies: {
|
|
105
|
-
'drizzle-orm': STACK_DEPENDENCIES['drizzle-orm'],
|
|
106
|
-
...(postgres
|
|
107
|
-
? { '@neondatabase/serverless': STACK_DEPENDENCIES['@neondatabase/serverless'] }
|
|
108
|
-
: {}),
|
|
109
|
-
},
|
|
110
30
|
devDependencies: {
|
|
111
31
|
'drizzle-kit': STACK_DEPENDENCIES['drizzle-kit'],
|
|
112
|
-
tsx: STACK_DEPENDENCIES
|
|
113
|
-
|
|
32
|
+
tsx: STACK_DEPENDENCIES.tsx,
|
|
33
|
+
wrangler: STACK_DEPENDENCIES.wrangler,
|
|
114
34
|
},
|
|
115
35
|
scripts: { 'db:generate': 'drizzle-kit generate', 'db:migrate': 'tsx src/migrate.ts' },
|
|
116
36
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (has('hono')) {
|
|
121
|
-
patchPackage(root, 'apps/api/package.json', {
|
|
122
|
-
dependencies: { '@workspace/db': 'workspace:*' },
|
|
123
|
-
});
|
|
124
|
-
const source = readFileSync(path.join(root, 'apps/api/src/index.ts'), 'utf8');
|
|
125
|
-
put(root, 'apps/api/src/index.ts', "import { createDatabase } from '@workspace/db';\n" +
|
|
126
|
-
source
|
|
127
|
-
.replace(source.includes('Variables: {') ? 'Variables: {' : 'Bindings: Env', source.includes('Variables: {')
|
|
128
|
-
? 'Variables: { database: () => ReturnType<typeof createDatabase>;'
|
|
129
|
-
: 'Bindings: Env; Variables: { database: () => ReturnType<typeof createDatabase> }')
|
|
130
|
-
.replace('const health = createRoute({', `// Construct the database only when a route needs it: c.get('database')().
|
|
131
|
-
app.use('/api/*', async (c, next) => {
|
|
132
|
-
c.set('database', () => createDatabase(${postgres ? 'c.env.DATABASE_URL' : 'c.env.DB'}));
|
|
133
|
-
await next();
|
|
134
|
-
});
|
|
135
|
-
const health = createRoute({`));
|
|
136
|
-
}
|
|
137
|
-
if (postgres) {
|
|
138
|
-
const native = runtimeApp === 'web' && options.hosting === 'vercel';
|
|
139
|
-
writeEnvironmentFile(root, `${app}/${native ? '.env.example' : '.dev.vars.example'}`, {
|
|
140
|
-
DATABASE_URL: '',
|
|
141
|
-
});
|
|
142
|
-
writeEnvironmentFile(root, `${directory}/.env.example`, { DATABASE_URL_UNPOOLED: '' });
|
|
143
|
-
if (!native)
|
|
144
|
-
put(root, `${app}/${runtimeApp === 'api' ? 'src/' : ''}database-secrets.d.ts`, runtimeApp === 'api'
|
|
145
|
-
? 'interface Env { DATABASE_URL: string }\n'
|
|
146
|
-
: 'declare namespace Cloudflare { interface Env { DATABASE_URL: string } }\n');
|
|
147
|
-
}
|
|
37
|
+
patchPackage(root, 'apps/api/package.json', { dependencies: { '@workspace/db': 'workspace:*' } });
|
|
38
|
+
const source = readFileSync(path.join(root, 'apps/api/src/index.ts'), 'utf8');
|
|
39
|
+
put(root, 'apps/api/src/index.ts', "import { createDatabase } from '@workspace/db';\n" + source);
|
|
148
40
|
}
|
|
@@ -1,104 +1,40 @@
|
|
|
1
|
-
import { usesVoidSelection } from '../runtime-policy.js';
|
|
2
|
-
import { markdownHeading } from '../render.js';
|
|
3
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
1
|
import { put } from './files.js';
|
|
6
|
-
export function workerBuildSuffix(options) {
|
|
7
|
-
return options.products.includes('next') && options.hosting === 'cloudflare'
|
|
8
|
-
? ' && pnpm build:worker'
|
|
9
|
-
: '';
|
|
10
|
-
}
|
|
11
2
|
export function writeSetupDocumentation(root, options) {
|
|
12
|
-
|
|
13
|
-
const agentsFile = path.join(root, 'AGENTS.md');
|
|
14
|
-
const voidSelected = usesVoidSelection(options.products, options.hosting);
|
|
15
|
-
const existingAgents = existsSync(agentsFile) && (has('next') || has('vinext'))
|
|
16
|
-
? readFileSync(agentsFile, 'utf8') + '\n'
|
|
17
|
-
: '';
|
|
18
|
-
put(root, 'AGENTS.md', existingAgents +
|
|
19
|
-
`# Anhedral delivery standard
|
|
20
|
-
|
|
21
|
-
Keep accounts, source, infrastructure, billing, and recovery client-owned. Use the available developer tools and the selected platforms’ native toolchains for implementation and verification. Use provider plugins, APIs/MCP and CLIs for operations; Void owns Cloudflare provisioning and deployment for supported selections; Anhedral owns composition, customer ownership and verification. New Expo workspaces, explicit OpenNext, queue/DLQ and Basin selections use Wrangler delivery.
|
|
22
|
-
|
|
23
|
-
Plain init creates a minimal Expo client with shadcn conventions, NativeWind and shared styling. Generate Hono, contracts, database, auth, storage and integrations only when selected or required by selected capabilities. Use --preset full-product for the complete compatible selection, not mutually exclusive alternatives. Inspect docs/stack.md and anhedral.json for this project's actual selection. New Expo static web uses Cloudflare; native uses EXPO_PUBLIC_API_URL only when an API is selected. Next.js on Vercel and Vinext on Cloudflare are explicit alternatives. Respect account, budget, audience and release scope. Initialization does not deploy or activate paid services.
|
|
24
|
-
|
|
25
|
-
Hono owns server identity, authorization, persistence and privileged integrations. Web routes only proxy/adapt API calls. Share framework-independent validation and HTTP clients in packages/contracts; applications never import another app’s source. Use pnpm workspaces and Turborepo with one root pnpm-lock.yaml. Add apps and shared packages only when needed. All services belong in apps/*, reusable code in packages/*. Shared styling is named styling. Keep secrets and privileged integrations out of client bundles. When accounts are selected, prefer Better Auth unless Clerk is explicitly selected; native Clerk integration remains owner implementation. Preserve selected supported identity providers in existing and explicit compatibility profiles. Protect product routes explicitly and implement resource authorization.
|
|
3
|
+
put(root, 'AGENTS.md', `# Anhedral application
|
|
26
4
|
|
|
27
|
-
|
|
5
|
+
This project uses Next.js App Router/OpenNext for web and Expo for iOS/Android, a Hono Cloudflare Worker, Drizzle/D1, and private R2. Better Auth supplies the identity needed for private storage and payments. Shared styling tokens are in packages/styling; native components use the Anhedral-maintained shadcn port in packages/native-ui. Optional integrations are Stripe and RevenueCat only.
|
|
28
6
|
|
|
29
|
-
|
|
7
|
+
Hono owns authentication, authorization, persistence, and provider credentials. Clients use API contracts in packages/contracts and never import database/auth server code. Apps must not import each other's source. Keep one root pnpm lockfile. No secrets belong in client bundles.
|
|
30
8
|
|
|
31
|
-
|
|
9
|
+
Review SQL produced by pnpm db:generate. Apply local migrations explicitly using pnpm db:migrate. Remote migrations require an explicit --remote and reviewed target. Builds and startup never migrate databases. R2 stays private; the API derives object namespaces from the verified user, never client-supplied ownership.
|
|
32
10
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
Run pnpm lint, pnpm typecheck, and pnpm build. Verify signup/signin/signout, anonymous rejection and cross-user file isolation. Payment additions require provider sandbox purchase/restore/webhook verification. Keep architecture and dated acceptance evidence in docs/architecture.md and docs/verification.md. Init does not provision, deploy or activate payment services.
|
|
12
|
+
`);
|
|
13
|
+
put(root, 'README.md', `# ${options.name}
|
|
36
14
|
|
|
37
|
-
|
|
15
|
+
Next.js web + native Expo + Hono + Drizzle/D1 + private R2. Better Auth provides email/password accounts for private files. ${options.products.includes('stripe') ? 'Stripe is selected. ' : ''}${options.products.includes('revenuecat') ? 'RevenueCat is selected.' : ''}
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
`);
|
|
41
|
-
put(root, 'README.md', `# ${markdownHeading(options.name)}
|
|
17
|
+
## Local setup
|
|
42
18
|
|
|
43
|
-
|
|
19
|
+
Use the Node and pnpm versions in package.json. Install dependencies if initialization used --skip-install.
|
|
44
20
|
|
|
45
|
-
|
|
21
|
+
1. Copy apps/api/.dev.vars.example to apps/api/.dev.vars. Set BETTER_AUTH_SECRET to at least 32 random characters and keep BETTER_AUTH_URL=http://localhost:3000 for local web.
|
|
22
|
+
2. Run pnpm db:generate, review the generated SQL, then pnpm db:migrate (local D1 only by default).
|
|
23
|
+
3. Run pnpm dev. Open http://localhost:3000. Create an account using the Sign in / account link.
|
|
24
|
+
4. Native development uses pnpm --dir apps/mobile start. Configure EXPO_PUBLIC_API_URL in apps/mobile/.env for an API address reachable by the device and set BETTER_AUTH_URL to that origin when testing native. Use HTTPS outside local development.
|
|
46
25
|
|
|
47
|
-
|
|
26
|
+
## Private files
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
Authenticated POST /api/files accepts raw bytes up to 1 MiB and returns an opaque id. GET /api/files/:id downloads it; DELETE /api/files/:id deletes it. Every operation is scoped to the signed-in user. Files are forced to download as application/octet-stream; bucket credentials and public bucket URLs are never sent to clients. Applications add their own file picker, quotas, retention and product UI.
|
|
50
29
|
|
|
51
|
-
|
|
30
|
+
## Cloud resources and delivery
|
|
52
31
|
|
|
53
|
-
|
|
32
|
+
Initialization is local source generation. Configure the intended Cloudflare account, provision a D1 database and private R2 bucket using the CLI provider workflow, and review apps/api/wrangler.jsonc. Keep public R2 access disabled. Set production secrets through Wrangler. Review/apply remote migrations explicitly before deployment. Ship the API before the Next.js OpenNext Worker, then verify real authentication and file isolation. See docs/stack.md and anhedral.json for setup requirements.
|
|
54
33
|
|
|
55
|
-
|
|
56
|
-
${has('neon') ? 'Configure DATABASE_URL_UNPOOLED separately in packages/db/.env for transactional migrations on the intended branch. Configure server-only DATABASE_URL for the intended Neon branch and role. Direct HTTP needs no Hyperdrive or connection cleanup. Review migrations and authorization; interactive transactions require a reviewed WebSocket or PostgreSQL adapter.\n' : ''}
|
|
57
|
-
${has('neon') || has('d1') ? 'packages/db/src owns the reusable database factory, schema and migration entry point. Generated SQL lives in packages/db/drizzle; the config resolves paths from its own directory. Run pnpm db:generate, review SQL, then pnpm db:migrate. These tasks are uncached and separate from application builds. D1 defaults to local; pass -- --remote explicitly for the selected Worker database. Browser and native interfaces use an API, never database credentials.\n' : ''}
|
|
58
|
-
${has('expo') && has('better-auth') ? 'Expo identity includes the server Expo plugin with the exact configured scheme, SecureStore native client/cookie adapter, separate browser client, sign-in/account screens and shared protected session contracts. Configure secrets/origins and apply reviewed migrations. Local transport checks do not replace development-build/device acceptance. ' : ''}${has('better-auth') ? 'Core Better Auth tables are included in the Drizzle schema. Review and apply migrations before using /api/auth. Configure BETTER_AUTH_SECRET, BETTER_AUTH_URL and trusted origins for the correct environment.\n' : ''}
|
|
59
|
-
${has('clerk') ? `${has('next') || has('vinext') ? 'The web starter includes ClerkProvider, middleware and sign-in/sign-up pages. Configure NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and server-only CLERK_SECRET_KEY. ' : ''}${has('hono') ? 'packages/auth exports a Clerk request authentication helper. Configure its server secret and publishable key, supply explicit authorized origins, and wire it into product routes; the API health route remains public. ' : ''}Authentication does not establish resource authorization.\n` : ''}
|
|
60
|
-
${has('r2') ? 'FILES is a private R2 binding. Implement authentication and file-level authorization before exposing file routes. Clients never receive R2 credentials.\n' : ''}
|
|
61
|
-
${has('neon-realtime') ? 'Neon Realtime is an optional beta live SQL foundation, separate from Durable Object rooms. Read [packages/neon-realtime/README.md](packages/neon-realtime/README.md) for the server/client factories and Drizzle adapter. Manually enable the intended branch, configure exact allowed origins and set server-only NEON_REALTIME_SECRET with DATABASE_URL; NEON_REALTIME_URL is public client transport configuration. Authenticate sealing requests and scope every query to verified user/tenant access. Implement subscriptions, authorized renewal and isolation tests; RLS, automatic Realtime provisioning and a public SQL endpoint are not provided. Live behavior remains unverified.\n' : ''}
|
|
62
|
-
${has('stream') ? 'Cloudflare Stream provides optional one-to-many WHIP/WHEP live video. Follow packages/stream/README.md and import the management factory only from @workspace/stream/server. Configure server-only STREAM_API_TOKEN and STREAM_ACCOUNT_ID manually. Authorize creators and input ownership; never return secret WHIP URLs to viewers. Implement playback token issuance for private media, browser signaling/UI and session cleanup. Stream activation, live inputs and runtime credentials are not automatically provisioned; live behavior remains unverified.\n' : ''}
|
|
63
|
-
${has('realtime') ? 'Durable Object rooms support hibernating WebSockets; the public entrypoint remains disabled until room authorization and short-lived tickets are implemented.\n' : ''}
|
|
64
|
-
${has('queues') ? 'Queue processing retries unimplemented jobs and uses a dead-letter queue. Add product processing and transactional idempotency before acknowledging messages.\n' : ''}
|
|
65
|
-
${has('basin') ? 'Basin uses a Pipelines stream binding. Configure its stream, sink, R2/catalog and SQL in client-owned infrastructure; it is distinct from operational logs.\n' : ''}
|
|
66
|
-
${has('neon') ? 'Neon provisioning configures the server runtime DATABASE_URL only. Set a separate direct DATABASE_URL_UNPOOLED in ignored packages/db/.env for the intended migration database and role. Run pnpm db:generate, review SQL, then pnpm db:migrate before testing authentication or application data.\n' : ''}
|
|
67
|
-
The root pnpm test command runs workspace test tasks; no application tests or test:live script are generated. Implement them for the product before verification.\n\nProvider packages are SDK factories or integration boundaries, not finished business features. Connect only needed packages to server entrypoints. Selected Stripe/RevenueCat billing generates authenticated Hono APIs, provider-verified webhook inbox, scheduled reconciliation and DB-backed entitlement enforcement; read packages/billing/README.md, configure plans/keys/IDs and review/apply SQL. Independent providers share the verified auth user ID; clients never grant access. Local data needs a platform-specific SQLite/filesystem adapter. Sentry needs a platform SDK and runtime initialization. Expo + Better Auth generates native/browser session clients, exact trusted scheme and sign-in/account screens; verify native behavior on a development build/device. Selected RevenueCat generates native purchase/restore/manage wiring; real development-build/store purchase acceptance remains required.
|
|
34
|
+
Next.js supports request-rendered HTML and React Server Components. Production requires the ANHEDRAL_API service binding; API_INTERNAL_URL is restricted to loopback development. The default OpenNext adapter does not provision persistent ISR/cache storage. Private R2 and all database/auth/provider credentials belong only to Hono.
|
|
68
35
|
|
|
69
|
-
|
|
70
|
-
`);
|
|
71
|
-
put(root, '.github/workflows/check.yml', `name: Check
|
|
72
|
-
on:
|
|
73
|
-
pull_request:
|
|
74
|
-
push:
|
|
75
|
-
branches: [main]
|
|
76
|
-
permissions:
|
|
77
|
-
contents: read
|
|
78
|
-
jobs:
|
|
79
|
-
check:
|
|
80
|
-
runs-on: ubuntu-latest
|
|
81
|
-
timeout-minutes: 20
|
|
82
|
-
steps:
|
|
83
|
-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
|
|
84
|
-
with:
|
|
85
|
-
fetch-depth: 0
|
|
86
|
-
persist-credentials: false
|
|
87
|
-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271
|
|
88
|
-
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38
|
|
89
|
-
with:
|
|
90
|
-
node-version: '${voidSelected ? '24.21.0' : '22'}'
|
|
91
|
-
cache: pnpm
|
|
92
|
-
- run: pnpm install --frozen-lockfile
|
|
93
|
-
- run: pnpm lint && pnpm typecheck && pnpm audit:deps
|
|
94
|
-
- name: Audit pull request
|
|
95
|
-
if: github.event_name == 'pull_request'
|
|
96
|
-
env:
|
|
97
|
-
AUDIT_BASE: \${{ github.event.pull_request.base.sha }}
|
|
98
|
-
run: pnpm exec fallow audit --base "$AUDIT_BASE"
|
|
99
|
-
- name: Audit branch
|
|
100
|
-
if: github.event_name != 'pull_request'
|
|
101
|
-
run: pnpm audit:full
|
|
102
|
-
- run: pnpm test && pnpm build${workerBuildSuffix(options)}
|
|
36
|
+
Stripe and RevenueCat remain inactive until client-owned provider products, credentials, origins and webhooks are configured. Verify sandbox flows before live activation.
|
|
103
37
|
`);
|
|
38
|
+
put(root, 'docs/architecture.md', '# Architecture\n\nNext.js web / Expo native → Hono Worker → Drizzle/D1 and private R2. Better Auth identifies users. Record application flows, access boundaries and selected payment providers here.\n');
|
|
39
|
+
put(root, 'docs/verification.md', '# Verification\n\nRecord dates, environments, commands, denied-access checks and unresolved acceptance gaps. Generated source is not production acceptance.\n');
|
|
104
40
|
}
|