@nexusts/cli 0.9.9 → 0.9.10
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/init.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* --style <name> Routing style (nest|adonis|functional)
|
|
17
17
|
* --view <name> View engine (rendu|edge|eta|inertia|none)
|
|
18
18
|
* --orm <name> ORM driver (drizzle|kysely|none)
|
|
19
|
-
* --db <name> Database driver (
|
|
19
|
+
* --db <name> Database driver (sqlite|postgres|mysql|none)
|
|
20
20
|
* --frontend <name> Inertia frontend (react|vue|svelte|solid)
|
|
21
21
|
* --no-ssr Disable Inertia SSR
|
|
22
22
|
* --force Overwrite existing files
|
package/dist/commands/new.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scratch.
|
|
7
7
|
*
|
|
8
8
|
* nx new my-app
|
|
9
|
-
* nx new my-app --style nest --view inertia --orm drizzle --db
|
|
9
|
+
* nx new my-app --style nest --view inertia --orm drizzle --db sqlite
|
|
10
10
|
*/
|
|
11
11
|
import type { Command } from "../core/index.js";
|
|
12
12
|
export declare const newCommand: Command;
|
package/dist/core/config.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type RoutingStyle = "nest" | "adonis" | "functional" | "mixed";
|
|
|
12
12
|
export type ViewEngine = "rendu" | "edge" | "inertia" | "none";
|
|
13
13
|
export type OrmDriver = "drizzle" | "kysely" | "none";
|
|
14
14
|
export type InertiaFrontend = "react" | "vue" | "svelte" | "solid";
|
|
15
|
-
export type DatabaseDriver = "bun-sqlite" | "
|
|
15
|
+
export type DatabaseDriver = "bun-sqlite" | "sqlite" | "postgres" | "mysql" | "none";
|
|
16
16
|
export type QueueBackendKind = "bullmq" | "cloudflare" | "memory";
|
|
17
17
|
/** Authentication surface. Mirrors `src/auth/types.ts` (kept inline so
|
|
18
18
|
* the CLI doesn't depend on the auth module). */
|
package/dist/core/prompts.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const VALID_PROJECT_OPTIONS: {
|
|
|
24
24
|
readonly style: readonly ["nest", "adonis", "functional"];
|
|
25
25
|
readonly view: readonly ["rendu", "edge", "eta", "inertia", "none"];
|
|
26
26
|
readonly orm: readonly ["drizzle", "kysely", "none"];
|
|
27
|
-
readonly db: readonly ["
|
|
27
|
+
readonly db: readonly ["sqlite", "postgres", "mysql", "none"];
|
|
28
28
|
readonly frontend: readonly ["react", "vue", "svelte", "solid"];
|
|
29
29
|
};
|
|
30
30
|
/**
|
package/dist/index.js
CHANGED
|
@@ -129,7 +129,7 @@ var DEFAULT_CONFIG = {
|
|
|
129
129
|
view: "inertia",
|
|
130
130
|
orm: "drizzle",
|
|
131
131
|
database: {
|
|
132
|
-
driver: "
|
|
132
|
+
driver: "sqlite",
|
|
133
133
|
url: "app.db"
|
|
134
134
|
},
|
|
135
135
|
inertia: {
|
|
@@ -196,8 +196,6 @@ async function loadConfig(cwd = process.cwd()) {
|
|
|
196
196
|
assertEnum("orm", merged.orm, ["drizzle", "kysely", "none"]);
|
|
197
197
|
assertEnum("database.driver", merged.database.driver, [
|
|
198
198
|
"bun-sqlite",
|
|
199
|
-
"node-sqlite",
|
|
200
|
-
"libsql",
|
|
201
199
|
"postgres",
|
|
202
200
|
"mysql",
|
|
203
201
|
"none"
|
|
@@ -496,7 +494,7 @@ var VALID_PROJECT_OPTIONS = {
|
|
|
496
494
|
style: ["nest", "adonis", "functional"],
|
|
497
495
|
view: ["rendu", "edge", "eta", "inertia", "none"],
|
|
498
496
|
orm: ["drizzle", "kysely", "none"],
|
|
499
|
-
db: ["
|
|
497
|
+
db: ["sqlite", "postgres", "mysql", "none"],
|
|
500
498
|
frontend: ["react", "vue", "svelte", "solid"]
|
|
501
499
|
};
|
|
502
500
|
async function resolveProjectOption(flags, key, valid, defaultVal, interactive) {
|
|
@@ -1388,7 +1386,7 @@ function computeDeps(view, orm, db, frontend) {
|
|
|
1388
1386
|
deps.pg = "^8.13.0";
|
|
1389
1387
|
if (db === "mysql")
|
|
1390
1388
|
deps.mysql2 = "^3.11.0";
|
|
1391
|
-
if (db === "sqlite" || db === "
|
|
1389
|
+
if (db === "sqlite" || db === "sqlite" || db === "bun-sqlite")
|
|
1392
1390
|
deps["better-sqlite3"] = "^12.0.0";
|
|
1393
1391
|
devDeps["drizzle-kit"] = "^0.31.0";
|
|
1394
1392
|
}
|
|
@@ -1453,9 +1451,7 @@ function generateNxConfig(target, opts) {
|
|
|
1453
1451
|
writeFileSync2(resolve4(target, "nx.config.ts"), code);
|
|
1454
1452
|
}
|
|
1455
1453
|
function generateDrizzleConfig(target, db, dbUrl) {
|
|
1456
|
-
|
|
1457
|
-
return;
|
|
1458
|
-
const dialect = db === "bun-sqlite" || db === "node-sqlite" || db === "libsql" ? "sqlite" : db === "postgres" ? "postgresql" : "mysql";
|
|
1454
|
+
const dialect = db === "bun-sqlite" || db === "sqlite" ? "sqlite" : db === "postgres" ? "postgresql" : "mysql";
|
|
1459
1455
|
const code = render(templates.project["drizzle.config.ts"], {
|
|
1460
1456
|
dialect,
|
|
1461
1457
|
dbUrl: dbUrl || "app.db"
|
|
@@ -1807,7 +1803,7 @@ var initCommand = {
|
|
|
1807
1803
|
examples: [
|
|
1808
1804
|
"nx init",
|
|
1809
1805
|
"nx init ./my-app",
|
|
1810
|
-
"nx init --style nest --view inertia --orm drizzle --db
|
|
1806
|
+
"nx init --style nest --view inertia --orm drizzle --db sqlite",
|
|
1811
1807
|
"nx init --force"
|
|
1812
1808
|
],
|
|
1813
1809
|
flags: [
|
|
@@ -1815,7 +1811,7 @@ var initCommand = {
|
|
|
1815
1811
|
{ name: "style", description: "Routing style (nest|adonis|functional)" },
|
|
1816
1812
|
{ name: "view", description: "View engine (rendu|edge|eta|inertia|none)" },
|
|
1817
1813
|
{ name: "orm", description: "ORM driver (drizzle|kysely|none)" },
|
|
1818
|
-
{ name: "db", description: "Database driver (
|
|
1814
|
+
{ name: "db", description: "Database driver (sqlite|postgres|mysql|none)" },
|
|
1819
1815
|
{
|
|
1820
1816
|
name: "frontend",
|
|
1821
1817
|
description: "Inertia frontend (react|vue|svelte|solid)"
|
|
@@ -1831,11 +1827,11 @@ var initCommand = {
|
|
|
1831
1827
|
const routing = await resolveProjectOption(ctx.flags, "style", VALID_PROJECT_OPTIONS.style, "nest", interactive);
|
|
1832
1828
|
const view = await resolveProjectOption(ctx.flags, "view", VALID_PROJECT_OPTIONS.view, "rendu", interactive);
|
|
1833
1829
|
const orm = await resolveProjectOption(ctx.flags, "orm", VALID_PROJECT_OPTIONS.orm, "drizzle", interactive);
|
|
1834
|
-
const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "
|
|
1830
|
+
const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "sqlite", interactive);
|
|
1835
1831
|
const frontend = await resolveProjectOption(ctx.flags, "frontend", VALID_PROJECT_OPTIONS.frontend, "react", interactive);
|
|
1836
1832
|
const ssr = !flagBool(ctx.flags, "no-ssr", false);
|
|
1837
1833
|
const name = target.split("/").pop() ?? "nexus-app";
|
|
1838
|
-
const dbUrl = db === "bun-sqlite" || db === "
|
|
1834
|
+
const dbUrl = db === "bun-sqlite" || db === "sqlite" ? "app.db" : "";
|
|
1839
1835
|
const plan = [
|
|
1840
1836
|
{ path: "package.json", mode: "merge-pkg" },
|
|
1841
1837
|
{ path: "tsconfig.json", mode: "merge-tsconfig" },
|
|
@@ -1876,9 +1872,7 @@ var initCommand = {
|
|
|
1876
1872
|
}
|
|
1877
1873
|
if (entry.mode === "merge-tsconfig") {
|
|
1878
1874
|
if (exists) {
|
|
1879
|
-
mergeTsconfig(abs, {
|
|
1880
|
-
experimentalDecorators: true
|
|
1881
|
-
});
|
|
1875
|
+
mergeTsconfig(abs, {});
|
|
1882
1876
|
merged.push(entry.path);
|
|
1883
1877
|
} else {
|
|
1884
1878
|
writeFileSync3(abs, defaultTsconfig());
|
|
@@ -3768,18 +3762,17 @@ var newCommand = {
|
|
|
3768
3762
|
const routing = await resolveProjectOption(ctx.flags, "style", VALID_PROJECT_OPTIONS.style, "nest", interactive);
|
|
3769
3763
|
const view = await resolveProjectOption(ctx.flags, "view", VALID_PROJECT_OPTIONS.view, "rendu", interactive);
|
|
3770
3764
|
const orm = await resolveProjectOption(ctx.flags, "orm", VALID_PROJECT_OPTIONS.orm, "drizzle", interactive);
|
|
3771
|
-
const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "
|
|
3765
|
+
const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "sqlite", interactive);
|
|
3772
3766
|
const frontend = await resolveProjectOption(ctx.flags, "frontend", VALID_PROJECT_OPTIONS.frontend, "react", interactive);
|
|
3773
3767
|
const ssr = !flagBool(ctx.flags, "no-ssr", false);
|
|
3774
3768
|
mkdirSync5(target, { recursive: true });
|
|
3775
|
-
const dbUrl = db === "bun-sqlite" || db === "
|
|
3769
|
+
const dbUrl = db === "bun-sqlite" || db === "sqlite" ? "app.db" : "";
|
|
3776
3770
|
ensureDirectories(target, view);
|
|
3777
3771
|
writeFileSync4(resolve24(target, "tsconfig.json"), `{
|
|
3778
|
-
|
|
3772
|
+
"compilerOptions": {
|
|
3779
3773
|
"target": "ES2022",
|
|
3780
3774
|
"module": "ESNext",
|
|
3781
3775
|
"moduleResolution": "bundler",
|
|
3782
|
-
"experimentalDecorators": true,
|
|
3783
3776
|
"strict": true,
|
|
3784
3777
|
"esModuleInterop": true,
|
|
3785
3778
|
"skipLibCheck": true,
|
|
@@ -3818,7 +3811,7 @@ var DEFAULT_VALUES = {
|
|
|
3818
3811
|
view: "rendu",
|
|
3819
3812
|
viewPaths: "resources/views",
|
|
3820
3813
|
orm: "drizzle",
|
|
3821
|
-
dbDriver: "
|
|
3814
|
+
dbDriver: "sqlite",
|
|
3822
3815
|
dbUrl: "app.db",
|
|
3823
3816
|
inertiaFrontend: "react",
|
|
3824
3817
|
inertiaSSR: true,
|
|
@@ -3866,8 +3859,7 @@ function parseExistingConfig(path) {
|
|
|
3866
3859
|
function driverToDialect(driver) {
|
|
3867
3860
|
switch (driver) {
|
|
3868
3861
|
case "bun-sqlite":
|
|
3869
|
-
case "
|
|
3870
|
-
case "libsql":
|
|
3862
|
+
case "sqlite":
|
|
3871
3863
|
return "sqlite";
|
|
3872
3864
|
case "postgres":
|
|
3873
3865
|
return "postgresql";
|
|
@@ -3878,7 +3870,7 @@ function driverToDialect(driver) {
|
|
|
3878
3870
|
}
|
|
3879
3871
|
}
|
|
3880
3872
|
function defaultDbUrl(driver) {
|
|
3881
|
-
if (driver === "bun-sqlite" || driver === "
|
|
3873
|
+
if (driver === "bun-sqlite" || driver === "sqlite") {
|
|
3882
3874
|
return "app.db";
|
|
3883
3875
|
}
|
|
3884
3876
|
return "";
|
|
@@ -3891,7 +3883,7 @@ var configCommand = {
|
|
|
3891
3883
|
examples: [
|
|
3892
3884
|
"nx config",
|
|
3893
3885
|
"nx config --db postgres --db-url postgres://localhost/mydb",
|
|
3894
|
-
"nx config --orm drizzle --db
|
|
3886
|
+
"nx config --orm drizzle --db sqlite",
|
|
3895
3887
|
"nx config --view inertia --frontend vue --no-ssr",
|
|
3896
3888
|
"nx config --force"
|
|
3897
3889
|
],
|
|
@@ -3909,7 +3901,7 @@ var configCommand = {
|
|
|
3909
3901
|
{ name: "orm", description: "ORM driver (drizzle|kysely|none)" },
|
|
3910
3902
|
{
|
|
3911
3903
|
name: "db",
|
|
3912
|
-
description: "Database driver (
|
|
3904
|
+
description: "Database driver (sqlite|postgres|mysql|none)"
|
|
3913
3905
|
},
|
|
3914
3906
|
{
|
|
3915
3907
|
name: "db-url",
|
|
@@ -3975,7 +3967,7 @@ var configCommand = {
|
|
|
3975
3967
|
interactive,
|
|
3976
3968
|
default: values.orm
|
|
3977
3969
|
}) ?? values.orm;
|
|
3978
|
-
values.dbDriver = await select("Database driver", ["
|
|
3970
|
+
values.dbDriver = await select("Database driver", ["sqlite", "postgres", "mysql", "none"], { interactive, default: values.dbDriver }) ?? values.dbDriver;
|
|
3979
3971
|
values.inertiaFrontend = await select("Inertia frontend", ["react", "vue", "svelte", "solid"], { interactive, default: values.inertiaFrontend }) ?? values.inertiaFrontend;
|
|
3980
3972
|
}
|
|
3981
3973
|
if (flag("db-url") === undefined && flag("db") !== undefined) {
|
|
@@ -4673,5 +4665,5 @@ main().then((code) => process.exit(code)).catch((err) => {
|
|
|
4673
4665
|
process.exit(1);
|
|
4674
4666
|
});
|
|
4675
4667
|
|
|
4676
|
-
//# debugId=
|
|
4668
|
+
//# debugId=8C2378D6B1E99D5064756E2164756E21
|
|
4677
4669
|
//# sourceMappingURL=index.js.map
|