anhedral 0.8.5 → 0.9.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 +140 -34
- package/assets/anhedral-cli-init-technical.svg +8 -8
- package/assets/anhedral-cli-init.svg +9 -9
- package/assets/security/LICENSES.txt +63 -0
- package/assets/security/audit-deps.mjs +295 -0
- package/assets/security/braces-regression.mjs +102 -0
- package/assets/security/braces@3.0.3.patch +285 -0
- package/assets/security/decode-uri-component@0.2.2.patch +149 -0
- package/assets/security/decoder-regression.mjs +37 -0
- package/assets/security/forge-regression.mjs +46 -0
- package/assets/security/manifest.json +53 -0
- package/assets/security/node-forge@1.4.0.patch +26 -0
- package/dist/access.d.ts +10 -0
- package/dist/access.js +93 -0
- package/dist/auth-schema-snapshot.d.ts +346 -0
- package/dist/auth-schema-snapshot.js +347 -0
- package/dist/auth-schema.d.ts +1 -0
- package/dist/auth-schema.js +57 -0
- package/dist/bin.js +353 -10
- package/dist/bounded-file.d.ts +2 -0
- package/dist/bounded-file.js +30 -0
- package/dist/capabilities.d.ts +19 -33
- package/dist/capabilities.js +73 -71
- package/dist/cloudflare.d.ts +14 -0
- package/dist/cloudflare.js +66 -0
- package/dist/command.js +12 -3
- package/dist/delivery.d.ts +118 -0
- package/dist/delivery.js +611 -0
- package/dist/dependencies.d.ts +22 -0
- package/dist/dependencies.js +109 -67
- package/dist/dependency-order.d.ts +2 -0
- package/dist/dependency-order.js +24 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +12 -1
- package/dist/managed-hosting.d.ts +49 -0
- package/dist/managed-hosting.js +373 -0
- package/dist/management.d.ts +3 -0
- package/dist/management.js +47 -0
- package/dist/platforms/desktop.d.ts +2 -2
- package/dist/platforms/desktop.js +22 -12
- package/dist/platforms/extension.d.ts +2 -2
- package/dist/platforms/extension.js +12 -4
- package/dist/platforms/mobile.d.ts +2 -2
- package/dist/platforms/mobile.js +13 -7
- package/dist/pnpm-policy.d.ts +4 -0
- package/dist/pnpm-policy.js +66 -0
- package/dist/project-state.d.ts +28 -0
- package/dist/project-state.js +226 -0
- package/dist/provider-readiness.d.ts +30 -0
- package/dist/provider-readiness.js +87 -0
- package/dist/provision.d.ts +46 -0
- package/dist/provision.js +197 -0
- package/dist/readiness.d.ts +4 -1
- package/dist/readiness.js +80 -8
- package/dist/registry/add.d.ts +22 -0
- package/dist/registry/add.js +198 -0
- package/dist/registry/bootstrap.d.ts +2 -0
- package/dist/registry/bootstrap.js +14 -0
- package/dist/registry/commands.d.ts +2 -0
- package/dist/registry/commands.js +99 -0
- package/dist/registry/context.d.ts +3 -0
- package/dist/registry/context.js +21 -0
- package/dist/registry/options.d.ts +2 -0
- package/dist/registry/options.js +65 -0
- package/dist/registry/receipt.d.ts +3 -0
- package/dist/registry/receipt.js +73 -0
- package/dist/registry/remote.d.ts +25 -0
- package/dist/registry/remote.js +168 -0
- package/dist/registry/resolve.d.ts +10 -0
- package/dist/registry/resolve.js +98 -0
- package/dist/registry/types.d.ts +64 -0
- package/dist/registry/usage.d.ts +1 -0
- package/dist/registry/usage.js +38 -0
- package/dist/render.js +3 -3
- package/dist/repository.d.ts +24 -0
- package/dist/repository.js +96 -0
- package/dist/scaffold/api.d.ts +2 -0
- package/dist/scaffold/api.js +13 -0
- package/dist/scaffold/auth.d.ts +3 -0
- package/dist/scaffold/auth.js +95 -0
- package/dist/scaffold/bootstrap.d.ts +2 -0
- package/dist/scaffold/bootstrap.js +34 -0
- package/dist/scaffold/compose.d.ts +4 -0
- package/dist/scaffold/compose.js +34 -0
- package/dist/scaffold/database.d.ts +2 -0
- package/dist/scaffold/database.js +43 -0
- package/dist/scaffold/documentation.d.ts +3 -0
- package/dist/scaffold/documentation.js +91 -0
- package/dist/scaffold/environment.d.ts +2 -0
- package/dist/scaffold/environment.js +5 -0
- package/dist/scaffold/files.d.ts +25 -0
- package/dist/scaffold/files.js +108 -0
- package/dist/scaffold/integrations.d.ts +3 -0
- package/dist/scaffold/integrations.js +7 -0
- package/dist/scaffold/services.d.ts +5 -0
- package/dist/scaffold/services.js +84 -0
- package/dist/scaffold/web.d.ts +2 -0
- package/dist/scaffold/web.js +102 -0
- package/dist/scaffold/workspace.d.ts +3 -0
- package/dist/scaffold/workspace.js +150 -0
- package/dist/security-backports.d.ts +3 -0
- package/dist/security-backports.js +26 -0
- package/dist/stack-registry.d.ts +80 -0
- package/dist/stack-registry.js +424 -0
- package/dist/standard.d.ts +6 -17
- package/dist/standard.js +41 -585
- package/dist/transaction.js +46 -26
- package/dist/util.js +12 -2
- package/dist/vercel.d.ts +98 -0
- package/dist/vercel.js +796 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vinext.d.ts +1 -0
- package/dist/vinext.js +83 -0
- package/dist/workspace-graph.d.ts +7 -0
- package/dist/workspace-graph.js +73 -0
- package/docs/application-stack-standard.md +75 -674
- package/docs/delivery-workflow.md +83 -0
- package/docs/managed-hosting-architecture.md +87 -0
- package/docs/sponsorships.md +25 -0
- package/package.json +23 -28
- package/dist/project.d.ts +0 -4
- package/dist/standard-products.d.ts +0 -2
- package/dist/standard-products.js +0 -6
- /package/assets/{images/svg/logo-white-subtract.svg → anhedral-mark.svg} +0 -0
- /package/dist/{project.js → registry/types.js} +0 -0
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "0.
|
|
1
|
+
export declare const GENERATOR_VERSION = "0.9.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GENERATOR_VERSION = '0.
|
|
1
|
+
export const GENERATOR_VERSION = '0.9.0';
|
package/dist/vinext.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function configureVinext(root: string, workerName: string, bindings: Record<string, unknown>): void;
|
package/dist/vinext.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { existsSync, readFileSync, rmSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { writeFile } from './util.js';
|
|
4
|
+
// Official Vinext App Router integration using the supported Wrangler/Vite adapter.
|
|
5
|
+
// Wrangler's generated dist/server config preserves binding IDs and built assets.
|
|
6
|
+
export function configureVinext(root, workerName, bindings) {
|
|
7
|
+
const put = (file, value) => writeFile(path.join(root, 'apps/web', file), value);
|
|
8
|
+
const pkg = JSON.parse(readFileSync(path.join(root, 'apps/web/package.json'), 'utf8'));
|
|
9
|
+
delete pkg.dependencies?.['@opennextjs/cloudflare'];
|
|
10
|
+
pkg.type = 'module';
|
|
11
|
+
pkg.dependencies = {
|
|
12
|
+
...pkg.dependencies,
|
|
13
|
+
vinext: '1.1.0',
|
|
14
|
+
next: '16.4.0',
|
|
15
|
+
react: '19.2.8',
|
|
16
|
+
'react-dom': '19.2.8',
|
|
17
|
+
'react-server-dom-webpack': '19.2.8',
|
|
18
|
+
};
|
|
19
|
+
pkg.devDependencies = {
|
|
20
|
+
...pkg.devDependencies,
|
|
21
|
+
vite: '8.3.4',
|
|
22
|
+
'@cloudflare/vite-plugin': '1.63.1',
|
|
23
|
+
'@vitejs/plugin-rsc': '0.5.36',
|
|
24
|
+
'@vitejs/plugin-react': '6.1.2',
|
|
25
|
+
wrangler: '4.149.0',
|
|
26
|
+
};
|
|
27
|
+
pkg.scripts = {
|
|
28
|
+
...pkg.scripts,
|
|
29
|
+
dev: 'vite dev --host 127.0.0.1 --port 3000',
|
|
30
|
+
build: 'vite build',
|
|
31
|
+
start: 'vinext start',
|
|
32
|
+
preview: 'wrangler dev --config dist/server/wrangler.json --persist-to .wrangler/state',
|
|
33
|
+
deploy: 'vite build && wrangler deploy --config dist/server/wrangler.json',
|
|
34
|
+
'build:worker': 'vite build',
|
|
35
|
+
typecheck: 'wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts && tsc --noEmit',
|
|
36
|
+
};
|
|
37
|
+
put('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
38
|
+
put('vite.config.ts', `import { defineConfig } from 'vite';
|
|
39
|
+
import vinext from 'vinext';
|
|
40
|
+
import { cloudflare } from '@cloudflare/vite-plugin';
|
|
41
|
+
export default defineConfig({ plugins: [vinext(), cloudflare({ viteEnvironment: { name: 'rsc', childEnvironments: ['ssr'] } })] });
|
|
42
|
+
`);
|
|
43
|
+
put('wrangler.jsonc', JSON.stringify({
|
|
44
|
+
$schema: 'node_modules/wrangler/config-schema.json',
|
|
45
|
+
name: workerName,
|
|
46
|
+
main: 'vinext/server/fetch-handler',
|
|
47
|
+
compatibility_date: '2026-10-05',
|
|
48
|
+
compatibility_flags: ['nodejs_compat'],
|
|
49
|
+
assets: { binding: 'ASSETS', not_found_handling: 'none' },
|
|
50
|
+
observability: { enabled: true },
|
|
51
|
+
...bindings,
|
|
52
|
+
}, null, 2) + '\n');
|
|
53
|
+
put('next.config.ts', `import type { NextConfig } from 'next';
|
|
54
|
+
const config: NextConfig = { transpilePackages: ['@workspace/ui'] };
|
|
55
|
+
export default config;
|
|
56
|
+
`);
|
|
57
|
+
for (const file of [
|
|
58
|
+
'next.config.js',
|
|
59
|
+
'next.config.mjs',
|
|
60
|
+
'open-next.config.ts',
|
|
61
|
+
'vercel.json',
|
|
62
|
+
'next-env.d.ts',
|
|
63
|
+
])
|
|
64
|
+
rmSync(path.join(root, 'apps/web', file), { force: true });
|
|
65
|
+
const tsFile = path.join(root, 'apps/web/tsconfig.json');
|
|
66
|
+
if (existsSync(tsFile)) {
|
|
67
|
+
const ts = JSON.parse(readFileSync(tsFile, 'utf8'));
|
|
68
|
+
delete ts.compilerOptions?.plugins;
|
|
69
|
+
// Respect the UI package exports (globals.css lives in src/styles, not src).
|
|
70
|
+
if (ts.compilerOptions?.paths)
|
|
71
|
+
delete ts.compilerOptions.paths['@workspace/ui/*'];
|
|
72
|
+
ts.include = ['**/*.ts', '**/*.tsx', '**/*.mts'];
|
|
73
|
+
put('tsconfig.json', JSON.stringify(ts, null, 2) + '\n');
|
|
74
|
+
}
|
|
75
|
+
put('vinext-env.d.ts', '/// <reference types="vinext/types" />\n/// <reference types="vite/client" />\n');
|
|
76
|
+
put('.dev.vars.example', '# Worker secrets are local-only and ignored by Git.\n');
|
|
77
|
+
const uiFile = path.join(root, 'packages/ui/package.json');
|
|
78
|
+
if (existsSync(uiFile)) {
|
|
79
|
+
const ui = JSON.parse(readFileSync(uiFile, 'utf8'));
|
|
80
|
+
ui.dependencies = { ...ui.dependencies, react: '19.2.8', 'react-dom': '19.2.8' };
|
|
81
|
+
writeFile(uiFile, JSON.stringify(ui, null, 2) + '\n');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { dependencyOrder } from './dependency-order.js';
|
|
4
|
+
const dependencyFields = [
|
|
5
|
+
'dependencies',
|
|
6
|
+
'devDependencies',
|
|
7
|
+
'peerDependencies',
|
|
8
|
+
'optionalDependencies',
|
|
9
|
+
];
|
|
10
|
+
function readManifest(file, directory) {
|
|
11
|
+
if (!existsSync(file))
|
|
12
|
+
throw new Error(`Workspace manifest missing: ${directory}.`);
|
|
13
|
+
if (lstatSync(file).isSymbolicLink())
|
|
14
|
+
throw new Error(`Workspace symlinks are unsupported: ${directory}/package.json.`);
|
|
15
|
+
const value = JSON.parse(readFileSync(file, 'utf8'));
|
|
16
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
17
|
+
throw new Error(`Invalid workspace manifest: ${directory}.`);
|
|
18
|
+
const manifest = value;
|
|
19
|
+
if (typeof manifest.name !== 'string' || !manifest.name)
|
|
20
|
+
throw new Error(`Workspace name missing: ${directory}.`);
|
|
21
|
+
for (const field of dependencyFields) {
|
|
22
|
+
const dependencies = manifest[field];
|
|
23
|
+
if (dependencies === undefined)
|
|
24
|
+
continue;
|
|
25
|
+
if (!dependencies ||
|
|
26
|
+
typeof dependencies !== 'object' ||
|
|
27
|
+
Array.isArray(dependencies) ||
|
|
28
|
+
Object.values(dependencies).some((version) => typeof version !== 'string'))
|
|
29
|
+
throw new Error(`Invalid workspace dependencies: ${directory}/${field}.`);
|
|
30
|
+
}
|
|
31
|
+
return manifest;
|
|
32
|
+
}
|
|
33
|
+
/** Validate manifests and references, then traverse the indexed dependency graph. */
|
|
34
|
+
export function inspectWorkspaceGraph(root) {
|
|
35
|
+
const packages = new Map();
|
|
36
|
+
for (const group of ['apps', 'packages']) {
|
|
37
|
+
const parent = path.join(root, group);
|
|
38
|
+
if (!existsSync(parent))
|
|
39
|
+
continue;
|
|
40
|
+
if (lstatSync(parent).isSymbolicLink())
|
|
41
|
+
throw new Error(`Workspace symlinks are unsupported: ${group}.`);
|
|
42
|
+
for (const entry of readdirSync(parent, { withFileTypes: true })) {
|
|
43
|
+
const directory = `${group}/${entry.name}`;
|
|
44
|
+
if (entry.isSymbolicLink())
|
|
45
|
+
throw new Error(`Workspace symlinks are unsupported: ${directory}.`);
|
|
46
|
+
if (!entry.isDirectory())
|
|
47
|
+
continue;
|
|
48
|
+
const manifest = readManifest(path.join(root, directory, 'package.json'), directory);
|
|
49
|
+
if (packages.has(manifest.name))
|
|
50
|
+
throw new Error(`Duplicate workspace package: ${manifest.name}.`);
|
|
51
|
+
packages.set(manifest.name, { directory, manifest });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const graph = [...packages]
|
|
55
|
+
.map(([name, { directory, manifest }]) => {
|
|
56
|
+
const dependencies = new Set();
|
|
57
|
+
for (const field of dependencyFields) {
|
|
58
|
+
for (const [dependency, version] of Object.entries(manifest[field] ?? {})) {
|
|
59
|
+
if (!version.startsWith('workspace:'))
|
|
60
|
+
continue;
|
|
61
|
+
if (!['workspace:*', 'workspace:^', 'workspace:~'].includes(version))
|
|
62
|
+
throw new Error(`Unsupported workspace reference ${name} -> ${dependency}: ${version}.`);
|
|
63
|
+
if (!packages.has(dependency))
|
|
64
|
+
throw new Error(`Missing workspace dependency: ${name} -> ${dependency}.`);
|
|
65
|
+
dependencies.add(dependency);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { name, directory, dependencies: [...dependencies].sort() };
|
|
69
|
+
})
|
|
70
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
71
|
+
dependencyOrder(new Map(graph.map((node) => [node.name, node.dependencies])), 'Workspace');
|
|
72
|
+
return graph;
|
|
73
|
+
}
|