@nexusts/cli 0.9.6 → 0.9.8

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.
@@ -10,6 +10,7 @@ export * from "./prompts.js";
10
10
  export * from "./template.js";
11
11
  export { VERSION } from "./version.js";
12
12
  export { ensureDirectories, computeDeps, buildPackageJson, generateProjectFiles } from "./scaffold.js";
13
+ export { formatTimestamp, inferTableName } from "./naming.js";
13
14
  /**
14
15
  * The CLI command contract. Every command module exports a default
15
16
  * `Command` object that the entry point dispatches against.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared naming utilities for the CLI.
3
+ *
4
+ * Consolidates `inferTableName` and similar name-parsing helpers
5
+ * that were previously duplicated across multiple command files.
6
+ */
7
+ /**
8
+ * Infer a table name from a migration name.
9
+ *
10
+ * Examples:
11
+ * "create_users_table" → "users"
12
+ * "add_email_to_users" → "users"
13
+ * "drop_old_index" → "old_indexs" (fallback)
14
+ * "Posts" → "posts"
15
+ */
16
+ export declare function inferTableName(input: string): string;
17
+ /**
18
+ * Format a Date as YYYYMMDD_HHmmss for migration filenames.
19
+ */
20
+ export declare function formatTimestamp(d: Date): string;
@@ -19,3 +19,17 @@ export interface PromptOptions {
19
19
  export declare function prompt(message: string, options?: PromptOptions): Promise<string>;
20
20
  export declare function confirm(message: string, defaultYes?: boolean, options?: PromptOptions): Promise<boolean>;
21
21
  export declare function select(message: string, choices: string[], options?: PromptOptions): Promise<string>;
22
+ /** Valid values for each interactive project-scaffold prompt. */
23
+ export declare const VALID_PROJECT_OPTIONS: {
24
+ readonly style: readonly ["nest", "adonis", "functional"];
25
+ readonly view: readonly ["rendu", "edge", "eta", "inertia", "none"];
26
+ readonly orm: readonly ["drizzle", "kysely", "none"];
27
+ readonly db: readonly ["bun-sqlite", "node-sqlite", "libsql", "postgres", "mysql", "none"];
28
+ readonly frontend: readonly ["react", "vue", "svelte", "solid"];
29
+ };
30
+ /**
31
+ * Resolve a project option from flags or interactive prompt.
32
+ * Validates flag values against the allowed list and re-prompts on invalid input.
33
+ * Shared between `nx new` and `nx init`.
34
+ */
35
+ export declare function resolveProjectOption(flags: Record<string, unknown>, key: string, valid: readonly string[], defaultVal: string, interactive: boolean): Promise<string>;