@nexusts/cli 0.9.4 → 0.9.6
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/commands/config.d.ts +1 -1
- package/dist/commands/db-generate.d.ts +8 -6
- package/dist/commands/db-migrate.d.ts +6 -15
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/make-crud.d.ts +1 -1
- package/dist/commands/make-model.d.ts +1 -1
- package/dist/commands/make-repository.d.ts +6 -0
- package/dist/core/config.d.ts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/scaffold.d.ts +1 -1
- package/dist/index.js +466 -259
- package/dist/index.js.map +32 -31
- package/dist/templates/index.d.ts +5 -2
- package/dist/templates/migration/kysely.d.ts +14 -0
- package/dist/templates/model/kysely.d.ts +5 -1
- package/dist/templates/project/nx.config.d.ts +1 -1
- package/dist/templates/repository/kysely-repository.d.ts +15 -0
- package/dist/templates/service/service.d.ts +2 -0
- package/package.json +2 -2
- package/dist/templates/model/prisma.d.ts +0 -11
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* --target <dir> Target directory (default: cwd)
|
|
30
30
|
* --style <name> Routing style (nest|adonis|functional)
|
|
31
31
|
* --view <name> View engine (rendu|edge|inertia|none)
|
|
32
|
-
* --orm <name> ORM driver (drizzle|
|
|
32
|
+
* --orm <name> ORM driver (drizzle|kysely|none)
|
|
33
33
|
* --db <name> Database driver
|
|
34
34
|
* --db-url <url> Database URL (used when DATABASE_URL is unset)
|
|
35
35
|
* --frontend <name> Inertia frontend (react|vue|svelte|solid)
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nx db:generate [name]` — generate a new migration file from schema changes.
|
|
3
3
|
*
|
|
4
|
-
* Runs `drizzle-kit generate` which compares your schema files
|
|
5
|
-
* (under app/models/*.model.ts) with the database and auto-generates
|
|
6
|
-
*
|
|
4
|
+
* **Drizzle**: Runs `drizzle-kit generate` which compares your schema files
|
|
5
|
+
* (under app/models/*.model.ts) with the database and auto-generates a migration.
|
|
6
|
+
*
|
|
7
|
+
* **Kysely**: Generates a TypeScript migration file with `up()`/`down()`
|
|
8
|
+
* functions for Kysely's built-in Migrator.
|
|
9
|
+
*
|
|
10
|
+
* **Plain SQL** (`--sql`): Generates a raw SQL migration file (any ORM).
|
|
7
11
|
*
|
|
8
12
|
* Examples:
|
|
9
13
|
* nx db:generate add_users_table
|
|
10
14
|
* nx db:generate add_posts_table --dialect postgres
|
|
11
|
-
* nx db:generate --sql # raw SQL file
|
|
15
|
+
* nx db:generate --sql # raw SQL file
|
|
12
16
|
*
|
|
13
17
|
* See also:
|
|
14
18
|
* nx db:migrate — apply pending migrations
|
|
15
19
|
* nx db:seed — run database seeds
|
|
16
20
|
* nx make:migration — scaffold an EMPTY migration file (manual)
|
|
17
|
-
* Use this for one-off SQL edits; prefer
|
|
18
|
-
* db:generate for normal schema changes.
|
|
19
21
|
*/
|
|
20
22
|
import type { Command } from "../core/index.js";
|
|
21
23
|
export declare const dbGenerateCommand: Command;
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nx db:migrate` — apply pending database migrations.
|
|
3
3
|
*
|
|
4
|
-
* Two modes:
|
|
4
|
+
* Two modes based on ORM config:
|
|
5
5
|
*
|
|
6
|
-
* 1. **
|
|
7
|
-
*
|
|
8
|
-
* drizzle-kit-equivalent migrator path.
|
|
6
|
+
* 1. **Drizzle** (default): spawns `bunx drizzle-kit migrate` with
|
|
7
|
+
* the project's drizzle.config.ts.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* migration script that uses `@nexusts/drizzle`'s
|
|
13
|
-
* `db.migrate(folder)` directly.
|
|
14
|
-
*
|
|
15
|
-
* 2. **`--status`**: list applied migrations + pending count.
|
|
16
|
-
*
|
|
17
|
-
* 3. **`--generate "<name>"`**: wrapper around `drizzle-kit
|
|
18
|
-
* generate` — useful when you want to commit a migration file
|
|
19
|
-
* but prefer the `nx` alias over the bare command.
|
|
9
|
+
* 2. **Kysely**: runs an in-process migration script that uses
|
|
10
|
+
* Kysely's built-in `Migrator` + `FileMigrationProvider`.
|
|
20
11
|
*
|
|
21
12
|
* Examples:
|
|
22
13
|
* nx db:migrate
|
|
23
14
|
* nx db:migrate --status
|
|
24
|
-
* nx db:migrate --generate "add_user_email"
|
|
25
15
|
* nx db:migrate --folder ./drizzle --dialect postgres
|
|
26
16
|
*
|
|
27
17
|
* See also: `nx db:seed` for inserting fixture data.
|
|
28
18
|
*/
|
|
29
19
|
import type { Command } from "../core/index.js";
|
|
30
20
|
export declare const dbMigrateCommand: Command;
|
|
21
|
+
export { dbMigrateCommand as command };
|
|
31
22
|
export declare function runDrizzleKit(cwd: string, args: string[]): Promise<number>;
|
|
32
23
|
export default dbMigrateCommand;
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* --target <dir> Scaffold into <dir> instead of the cwd
|
|
16
16
|
* --style <name> Routing style (nest|adonis|functional)
|
|
17
17
|
* --view <name> View engine (rendu|edge|eta|inertia|none)
|
|
18
|
-
* --orm <name> ORM driver (drizzle|
|
|
18
|
+
* --orm <name> ORM driver (drizzle|kysely|none)
|
|
19
19
|
* --db <name> Database driver (bun-sqlite|node-sqlite|libsql|postgres|mysql|none)
|
|
20
20
|
* --frontend <name> Inertia frontend (react|vue|svelte|solid)
|
|
21
21
|
* --no-ssr Disable Inertia SSR
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* The output adapts to `nx.config.ts`:
|
|
19
19
|
* - routing → controller template
|
|
20
20
|
* - view → emits Inertia render() when 'inertia', otherwise plain JSON
|
|
21
|
-
* - orm → Drizzle/
|
|
21
|
+
* - orm → Drizzle/Kysely template selection
|
|
22
22
|
*
|
|
23
23
|
* Use `--no-views` to skip view-aware parts even when `view === 'inertia'`.
|
|
24
24
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Supports three ORMs via `nx.config.ts`'s `orm` field:
|
|
5
5
|
* - drizzle → Drizzle table definition (dialect-aware)
|
|
6
|
-
* -
|
|
6
|
+
* - kysely → table interface + typed repository
|
|
7
7
|
* - kysely → table interface + typed repository
|
|
8
8
|
*
|
|
9
9
|
* For Drizzle, the `--dialect` flag selects the right import path and
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nx make:repository <Name>` — generate a repository class.
|
|
3
|
+
*
|
|
4
|
+
* Adapts to the project's ORM (from nx.config.ts):
|
|
5
|
+
* - drizzle → DrizzleRepository (default)
|
|
6
|
+
* - kysely → KyselyRepository
|
|
7
|
+
*
|
|
8
|
+
* Requires a model file at app/models/<name>.model.ts.
|
|
3
9
|
*/
|
|
4
10
|
import type { Command } from "../core/index.js";
|
|
5
11
|
export declare const makeRepositoryCommand: Command;
|
package/dist/core/config.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export type RoutingStyle = "nest" | "adonis" | "functional" | "mixed";
|
|
12
12
|
export type ViewEngine = "rendu" | "edge" | "inertia" | "none";
|
|
13
|
-
export type OrmDriver = "drizzle" | "
|
|
13
|
+
export type OrmDriver = "drizzle" | "kysely" | "none";
|
|
14
14
|
export type InertiaFrontend = "react" | "vue" | "svelte" | "solid";
|
|
15
15
|
export type DatabaseDriver = "bun-sqlite" | "node-sqlite" | "libsql" | "postgres" | "mysql" | "none";
|
|
16
16
|
export type QueueBackendKind = "bullmq" | "cloudflare" | "memory";
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/scaffold.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function computeDeps(view: string, orm: string, db: string, front
|
|
|
23
23
|
/**
|
|
24
24
|
* Build a default package.json object.
|
|
25
25
|
*/
|
|
26
|
-
export declare function buildPackageJson(name: string, deps: Record<string, string>, devDeps: Record<string, string>, view?: string, frontend?: string): Record<string,
|
|
26
|
+
export declare function buildPackageJson(name: string, deps: Record<string, string>, devDeps: Record<string, string>, view?: string, frontend?: string): Record<string, unknown>;
|
|
27
27
|
/**
|
|
28
28
|
* Generate an nx.config.ts file.
|
|
29
29
|
*/
|