anhedral 0.3.0 → 0.4.1

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/dist/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createInterface } from 'node:readline/promises';
3
3
  import { argv, stdin, stdout } from 'node:process';
4
4
  import { buildAddOptions, buildOptions, buildOptionsForRoot, parseCli, parseNewProjectRequest, parseUiAddOptions, USAGE } from './cli.js';
5
- import { doctorProject, scaffoldAddModules, scaffoldProject, scaffoldUiComponents } from './scaffold.js';
5
+ import { doctorProject, scaffoldAddModules, scaffoldProject, scaffoldUiComponents, scaffoldUpgradeProject } from './scaffold.js';
6
6
  import { DEFAULT_PROMPT_APP_MODULES, DEFAULT_PROMPT_FEATURE_MODULES, hasUiSelection, parsePromptModules, shouldPromptForInitModules, } from './prompts.js';
7
7
  import { GENERATOR_VERSION } from './version.js';
8
8
  import { PostCommitError } from './transaction.js';
@@ -41,7 +41,7 @@ async function promptForInitModules(args) {
41
41
  try {
42
42
  console.log('Select app surfaces: web, mobile, api, desktop, extension');
43
43
  const appAnswer = await rl.question('App surfaces [all]: ');
44
- console.log('Select backend features: db, auth, billing, storage, native-subscriptions');
44
+ console.log('Select backend features: db, auth, billing, storage, native-subscriptions, electron-updater');
45
45
  const featureAnswer = await rl.question('Backend features [all]: ');
46
46
  const selected = [
47
47
  ...parsePromptModules(appAnswer, DEFAULT_PROMPT_APP_MODULES),
@@ -89,7 +89,7 @@ async function main() {
89
89
  console.log(USAGE);
90
90
  return;
91
91
  }
92
- if (!['new', 'init', 'add', 'ui', 'doctor'].includes(command)) {
92
+ if (!['new', 'init', 'add', 'ui', 'upgrade', 'doctor'].includes(command)) {
93
93
  if (json)
94
94
  writeCliError(new Error(`Unknown command: ${command}`), 'UNKNOWN_COMMAND', true);
95
95
  else {
@@ -114,8 +114,9 @@ async function main() {
114
114
  const options = buildOptionsForRoot(parseCli(promptedArgs), request.directory);
115
115
  phase = 'execute';
116
116
  await scaffoldProject(options);
117
- if (!options.json && !options.dryRun)
118
- console.log(`\nCreated ${options.rootDirectory}\nRun: cd ${options.rootDirectory} && pnpm dev`);
117
+ if (!options.json && !options.dryRun) {
118
+ console.log(`\nCreated ${options.rootDirectory}\nNext: cd ${options.rootDirectory}\nThen follow README.md to configure the selected providers and start the app.`);
119
+ }
119
120
  }
120
121
  else if (command === 'doctor') {
121
122
  const unknown = rawArgs.filter((arg) => !['--json', '--verbose'].includes(arg));
@@ -146,6 +147,17 @@ async function main() {
146
147
  phase = 'execute';
147
148
  await scaffoldUiComponents(options);
148
149
  }
150
+ else if (command === 'upgrade') {
151
+ const unknown = rawArgs.filter((arg) => !['--skip-install', '--dry-run', '--json', '--verbose'].includes(arg));
152
+ if (unknown.length)
153
+ throw new Error(`Unknown upgrade option: ${unknown[0]}`);
154
+ phase = 'execute';
155
+ await scaffoldUpgradeProject({
156
+ skipInstall: rawArgs.includes('--skip-install'),
157
+ dryRun: rawArgs.includes('--dry-run'),
158
+ json,
159
+ });
160
+ }
149
161
  else {
150
162
  const options = buildOptions(parseCli(await promptForInitModules(rawArgs)));
151
163
  phase = 'execute';
package/dist/cli.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import type { AddOptions, InitOptions } from './scaffold.js';
2
2
  import { type NativeStylingLibrary } from './ui.js';
3
3
  import type { UiAddOptions } from './scaffold.js';
4
- export declare const USAGE = "\nanhedral new <directory> [modules...] [--ui <components>] [--native-styling <nativewind|uniwind>] [--toolchain <latest|stable>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral init [modules...] [--ui <components>] [--native-styling <nativewind|uniwind>] [--toolchain <latest|stable>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral add <module...> [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral ui add <component...> [--target <client>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral doctor [--json] [--verbose]\nanhedral --version\n\nCommands:\n anhedral new my-app\n Generate the complete TypeScript stack in a new directory. With no module flags, every module is included.\n anhedral new my-app --web --api --db --auth\n Generate a web app, Fastify API, shared database package, and auth wiring.\n anhedral init --web --api --db --auth\n Generate the same readable workspace in the current empty directory.\n anhedral add mobile extension\n Add missing modules to an existing Anhedral project.\n anhedral ui add button dialog --target mobile\n Add React Native Reusables components to Expo. DOM clients use shadcn/ui.\n";
4
+ export declare const USAGE = "\nanhedral new <directory> [modules...] [--ui <components>] [--native-styling <nativewind|uniwind>] [--toolchain <latest|stable>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral init [modules...] [--ui <components>] [--native-styling <nativewind|uniwind>] [--toolchain <latest|stable>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral add <module...> [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral ui add <component...> [--target <client>] [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral upgrade [--skip-install] [--dry-run] [--json] [--verbose]\nanhedral doctor [--json] [--verbose]\nanhedral --version\n\nCommands:\n anhedral new my-app\n Generate the complete TypeScript stack in a new directory. With no module flags, every module is included.\n anhedral new my-app --web --api --db --auth\n Generate a web app, Fastify API, shared database package, and auth wiring.\n anhedral init --web --api --db --auth\n Generate the same readable workspace in the current empty directory.\n anhedral add mobile extension\n Add missing modules to an existing Anhedral project.\n anhedral ui add button dialog --target mobile\n Add React Native Reusables components to Expo. DOM clients use shadcn/ui.\n anhedral upgrade\n Transactionally upgrade a supported older Anhedral project before adding modules.\n";
5
5
  export type NewProjectRequest = {
6
6
  readonly directory: string;
7
7
  readonly moduleArgs: readonly string[];
8
8
  };
9
9
  export declare function parseNewProjectRequest(args: readonly string[]): NewProjectRequest;
10
10
  export declare const APP_MODULES: readonly ["web", "mobile", "api", "desktop", "extension"];
11
- export declare const FEATURE_MODULES: readonly ["db", "auth", "billing", "storage", "native-subscriptions"];
11
+ export declare const FEATURE_MODULES: readonly ["db", "auth", "billing", "storage", "native-subscriptions", "electron-updater"];
12
12
  export type AppModule = (typeof APP_MODULES)[number];
13
13
  export type FeatureModule = (typeof FEATURE_MODULES)[number];
14
14
  export type SupportedModule = AppModule | FeatureModule;
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ anhedral new <directory> [modules...] [--ui <components>] [--native-styling <nat
9
9
  anhedral init [modules...] [--ui <components>] [--native-styling <nativewind|uniwind>] [--toolchain <latest|stable>] [--skip-install] [--dry-run] [--json] [--verbose]
10
10
  anhedral add <module...> [--skip-install] [--dry-run] [--json] [--verbose]
11
11
  anhedral ui add <component...> [--target <client>] [--skip-install] [--dry-run] [--json] [--verbose]
12
+ anhedral upgrade [--skip-install] [--dry-run] [--json] [--verbose]
12
13
  anhedral doctor [--json] [--verbose]
13
14
  anhedral --version
14
15
 
@@ -23,6 +24,8 @@ Commands:
23
24
  Add missing modules to an existing Anhedral project.
24
25
  anhedral ui add button dialog --target mobile
25
26
  Add React Native Reusables components to Expo. DOM clients use shadcn/ui.
27
+ anhedral upgrade
28
+ Transactionally upgrade a supported older Anhedral project before adding modules.
26
29
  `;
27
30
  export function parseNewProjectRequest(args) {
28
31
  const [directory, ...moduleArgs] = args;
@@ -31,7 +34,7 @@ export function parseNewProjectRequest(args) {
31
34
  return Object.freeze({ directory, moduleArgs: Object.freeze(moduleArgs) });
32
35
  }
33
36
  export const APP_MODULES = ['web', 'mobile', 'api', 'desktop', 'extension'];
34
- export const FEATURE_MODULES = ['db', 'auth', 'billing', 'storage', 'native-subscriptions'];
37
+ export const FEATURE_MODULES = ['db', 'auth', 'billing', 'storage', 'native-subscriptions', 'electron-updater'];
35
38
  export function parseCli(args) {
36
39
  const flags = { modules: new Set(), uiComponents: [] };
37
40
  for (let index = 0; index < args.length; index += 1) {
@@ -17,6 +17,7 @@ const ROOT_ENVIRONMENT_ORDER = [
17
17
  'R2_BUCKET_NAME',
18
18
  'R2_PREFIX',
19
19
  'R2_PROXY_READ_URL_TTL_SECONDS',
20
+ 'DESKTOP_UPDATE_BASE_URL',
20
21
  'CLOUDFLARE_API_TOKEN',
21
22
  'CRON_SECRET',
22
23
  ];
@@ -29,6 +29,7 @@ export declare const MOBILE_NATIVEWIND_DEPENDENCIES: DependencyGroup;
29
29
  export declare const MOBILE_UNIWIND_DEPENDENCIES: DependencyGroup;
30
30
  export declare const WEB_APP_DEPENDENCIES: DependencyGroup;
31
31
  export declare const DESKTOP_DEPENDENCIES: DependencyGroup;
32
+ export declare const ELECTRON_UPDATER_DEPENDENCIES: DependencyGroup;
32
33
  export declare function dependencyManifest(): {
33
34
  verifiedAt: string;
34
35
  packageManager: string;
@@ -54,4 +55,5 @@ export declare function dependencyManifest(): {
54
55
  mobileUniwind: DependencyGroup;
55
56
  webApp: DependencyGroup;
56
57
  desktop: DependencyGroup;
58
+ electronUpdater: DependencyGroup;
57
59
  };
@@ -264,7 +264,7 @@ export const WEB_APP_DEPENDENCIES = {
264
264
  // renovate: datasource=npm depName=@clerk/ui
265
265
  '@clerk/ui': '1.25.3',
266
266
  // renovate: datasource=npm depName=next
267
- next: '16.2.10',
267
+ next: '16.2.11',
268
268
  // renovate: datasource=npm depName=react
269
269
  react: EXTENSION_DEPENDENCIES.dependencies.react,
270
270
  // renovate: datasource=npm depName=react-dom
@@ -322,6 +322,12 @@ export const DESKTOP_DEPENDENCIES = {
322
322
  vite: '7.3.6',
323
323
  },
324
324
  };
325
+ export const ELECTRON_UPDATER_DEPENDENCIES = {
326
+ dependencies: {
327
+ // renovate: datasource=npm depName=electron-updater
328
+ 'electron-updater': '6.8.9',
329
+ },
330
+ };
325
331
  export function dependencyManifest() {
326
332
  return {
327
333
  verifiedAt: VERIFIED_AT,
@@ -341,5 +347,6 @@ export function dependencyManifest() {
341
347
  mobileUniwind: MOBILE_UNIWIND_DEPENDENCIES,
342
348
  webApp: WEB_APP_DEPENDENCIES,
343
349
  desktop: DESKTOP_DEPENDENCIES,
350
+ electronUpdater: ELECTRON_UPDATER_DEPENDENCIES,
344
351
  };
345
352
  }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { APP_MODULES, FEATURE_MODULES, USAGE, buildAddOptions, buildOptions, deriveDisplayName, deriveProjectName, normalizeModuleName, parseCli, parseNewProjectRequest, buildOptionsForRoot, parseUiAddOptions, } from './cli.js';
2
2
  export type { AppModule, FeatureModule, ParsedFlags, SupportedModule } from './cli.js';
3
- export { doctorProject, scaffoldAddModules, scaffoldProject, scaffoldUiComponents, } from './scaffold.js';
4
- export type { AddOptions, DoctorIssue, DoctorReport, InitOptions, ProjectOptions, UiAddOptions, } from './scaffold.js';
3
+ export { doctorProject, isSupportedProjectUpgrade, scaffoldAddModules, scaffoldProject, scaffoldUiComponents, scaffoldUpgradeProject, } from './scaffold.js';
4
+ export type { AddOptions, DoctorIssue, DoctorReport, InitOptions, ProjectOptions, UiAddOptions, UpgradeOptions, } from './scaffold.js';
5
5
  export * from './architecture/index.js';
6
6
  export { BundledTemplateSource, assertTemplateProvenance, hashTemplateDirectory, materializeTemplates, templateIdsForModules, } from './template-source.js';
7
7
  export type { TemplateMaterializeRequest, TemplateSource, } from './template-source.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { APP_MODULES, FEATURE_MODULES, USAGE, buildAddOptions, buildOptions, deriveDisplayName, deriveProjectName, normalizeModuleName, parseCli, parseNewProjectRequest, buildOptionsForRoot, parseUiAddOptions, } from './cli.js';
2
- export { doctorProject, scaffoldAddModules, scaffoldProject, scaffoldUiComponents, } from './scaffold.js';
2
+ export { doctorProject, isSupportedProjectUpgrade, scaffoldAddModules, scaffoldProject, scaffoldUiComponents, scaffoldUpgradeProject, } from './scaffold.js';
3
3
  export * from './architecture/index.js';
4
4
  export { BundledTemplateSource, assertTemplateProvenance, hashTemplateDirectory, materializeTemplates, templateIdsForModules, } from './template-source.js';
5
5
  export { GENERATOR_VERSION } from './version.js';
package/dist/prompts.d.ts CHANGED
@@ -2,4 +2,4 @@ export declare function shouldPromptForInitModules(args: readonly string[], isTT
2
2
  export declare function hasUiSelection(args: readonly string[]): boolean;
3
3
  export declare function parsePromptModules(input: string, fallback: readonly string[]): string[];
4
4
  export declare const DEFAULT_PROMPT_APP_MODULES: readonly ["web", "mobile", "api", "desktop", "extension"];
5
- export declare const DEFAULT_PROMPT_FEATURE_MODULES: readonly ["db", "auth", "billing", "storage", "native-subscriptions"];
5
+ export declare const DEFAULT_PROMPT_FEATURE_MODULES: readonly ["db", "auth", "billing", "storage", "native-subscriptions", "electron-updater"];
@@ -14,6 +14,7 @@ export type FeatureSelections = {
14
14
  billing: boolean;
15
15
  storage: boolean;
16
16
  nativeSubscriptions: boolean;
17
+ electronUpdater: boolean;
17
18
  };
18
19
  export interface InitOptions {
19
20
  projectName: string;
@@ -42,6 +43,11 @@ export interface UiAddOptions {
42
43
  dryRun: boolean;
43
44
  json: boolean;
44
45
  }
46
+ export interface UpgradeOptions {
47
+ skipInstall: boolean;
48
+ dryRun: boolean;
49
+ json: boolean;
50
+ }
45
51
  export interface ProjectOptions {
46
52
  projectName: string;
47
53
  displayName: string;
@@ -62,7 +68,9 @@ export type DoctorReport = {
62
68
  generatorVersion: string;
63
69
  issues: DoctorIssue[];
64
70
  };
71
+ export declare function isSupportedProjectUpgrade(fromVersion: string, toVersion: string): boolean;
65
72
  export declare function scaffoldProject(inputOptions: InitOptions): Promise<void>;
66
73
  export declare function scaffoldUiComponents(uiOptions: UiAddOptions): Promise<void>;
74
+ export declare function scaffoldUpgradeProject(upgradeOptions: UpgradeOptions): Promise<void>;
67
75
  export declare function scaffoldAddModules(addOptions: AddOptions): Promise<void>;
68
76
  export declare function doctorProject(): DoctorReport;