@nexusts/cli 0.9.8 → 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.
@@ -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 (bun-sqlite|node-sqlite|libsql|postgres|mysql|none)
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
@@ -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 bun-sqlite
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;
@@ -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" | "node-sqlite" | "libsql" | "postgres" | "mysql" | "none";
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). */
@@ -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 ["bun-sqlite", "node-sqlite", "libsql", "postgres", "mysql", "none"];
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: "bun-sqlite",
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: ["bun-sqlite", "node-sqlite", "libsql", "postgres", "mysql", "none"],
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 === "node-sqlite" || db === "bun-sqlite")
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
- if (db !== "bun-sqlite" && db !== "node-sqlite" && db !== "libsql" && db !== "postgres" && db !== "mysql")
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 bun-sqlite",
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 (bun-sqlite|node-sqlite|libsql|postgres|mysql|none)" },
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, "bun-sqlite", interactive);
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 === "node-sqlite" ? "app.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,10 +1872,7 @@ var initCommand = {
1876
1872
  }
1877
1873
  if (entry.mode === "merge-tsconfig") {
1878
1874
  if (exists) {
1879
- mergeTsconfig(abs, {
1880
- experimentalDecorators: true,
1881
- emitDecoratorMetadata: true
1882
- });
1875
+ mergeTsconfig(abs, {});
1883
1876
  merged.push(entry.path);
1884
1877
  } else {
1885
1878
  writeFileSync3(abs, defaultTsconfig());
@@ -2004,7 +1997,6 @@ function defaultTsconfig() {
2004
1997
  "module": "ESNext",
2005
1998
  "moduleResolution": "bundler",
2006
1999
  "experimentalDecorators": true,
2007
- "emitDecoratorMetadata": true,
2008
2000
  "strict": true,
2009
2001
  "esModuleInterop": true,
2010
2002
  "skipLibCheck": true,
@@ -3770,19 +3762,17 @@ var newCommand = {
3770
3762
  const routing = await resolveProjectOption(ctx.flags, "style", VALID_PROJECT_OPTIONS.style, "nest", interactive);
3771
3763
  const view = await resolveProjectOption(ctx.flags, "view", VALID_PROJECT_OPTIONS.view, "rendu", interactive);
3772
3764
  const orm = await resolveProjectOption(ctx.flags, "orm", VALID_PROJECT_OPTIONS.orm, "drizzle", interactive);
3773
- const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "bun-sqlite", interactive);
3765
+ const db = await resolveProjectOption(ctx.flags, "db", VALID_PROJECT_OPTIONS.db, "sqlite", interactive);
3774
3766
  const frontend = await resolveProjectOption(ctx.flags, "frontend", VALID_PROJECT_OPTIONS.frontend, "react", interactive);
3775
3767
  const ssr = !flagBool(ctx.flags, "no-ssr", false);
3776
3768
  mkdirSync5(target, { recursive: true });
3777
- const dbUrl = db === "bun-sqlite" || db === "node-sqlite" ? "app.db" : "";
3769
+ const dbUrl = db === "bun-sqlite" || db === "sqlite" ? "app.db" : "";
3778
3770
  ensureDirectories(target, view);
3779
3771
  writeFileSync4(resolve24(target, "tsconfig.json"), `{
3780
- "compilerOptions": {
3772
+ "compilerOptions": {
3781
3773
  "target": "ES2022",
3782
3774
  "module": "ESNext",
3783
3775
  "moduleResolution": "bundler",
3784
- "experimentalDecorators": true,
3785
- "emitDecoratorMetadata": true,
3786
3776
  "strict": true,
3787
3777
  "esModuleInterop": true,
3788
3778
  "skipLibCheck": true,
@@ -3821,7 +3811,7 @@ var DEFAULT_VALUES = {
3821
3811
  view: "rendu",
3822
3812
  viewPaths: "resources/views",
3823
3813
  orm: "drizzle",
3824
- dbDriver: "bun-sqlite",
3814
+ dbDriver: "sqlite",
3825
3815
  dbUrl: "app.db",
3826
3816
  inertiaFrontend: "react",
3827
3817
  inertiaSSR: true,
@@ -3869,8 +3859,7 @@ function parseExistingConfig(path) {
3869
3859
  function driverToDialect(driver) {
3870
3860
  switch (driver) {
3871
3861
  case "bun-sqlite":
3872
- case "node-sqlite":
3873
- case "libsql":
3862
+ case "sqlite":
3874
3863
  return "sqlite";
3875
3864
  case "postgres":
3876
3865
  return "postgresql";
@@ -3881,7 +3870,7 @@ function driverToDialect(driver) {
3881
3870
  }
3882
3871
  }
3883
3872
  function defaultDbUrl(driver) {
3884
- if (driver === "bun-sqlite" || driver === "node-sqlite" || driver === "libsql") {
3873
+ if (driver === "bun-sqlite" || driver === "sqlite") {
3885
3874
  return "app.db";
3886
3875
  }
3887
3876
  return "";
@@ -3894,7 +3883,7 @@ var configCommand = {
3894
3883
  examples: [
3895
3884
  "nx config",
3896
3885
  "nx config --db postgres --db-url postgres://localhost/mydb",
3897
- "nx config --orm drizzle --db bun-sqlite",
3886
+ "nx config --orm drizzle --db sqlite",
3898
3887
  "nx config --view inertia --frontend vue --no-ssr",
3899
3888
  "nx config --force"
3900
3889
  ],
@@ -3912,7 +3901,7 @@ var configCommand = {
3912
3901
  { name: "orm", description: "ORM driver (drizzle|kysely|none)" },
3913
3902
  {
3914
3903
  name: "db",
3915
- description: "Database driver (bun-sqlite|node-sqlite|libsql|postgres|mysql|none)"
3904
+ description: "Database driver (sqlite|postgres|mysql|none)"
3916
3905
  },
3917
3906
  {
3918
3907
  name: "db-url",
@@ -3978,7 +3967,7 @@ var configCommand = {
3978
3967
  interactive,
3979
3968
  default: values.orm
3980
3969
  }) ?? values.orm;
3981
- values.dbDriver = await select("Database driver", ["bun-sqlite", "node-sqlite", "libsql", "postgres", "mysql", "none"], { interactive, default: values.dbDriver }) ?? values.dbDriver;
3970
+ values.dbDriver = await select("Database driver", ["sqlite", "postgres", "mysql", "none"], { interactive, default: values.dbDriver }) ?? values.dbDriver;
3982
3971
  values.inertiaFrontend = await select("Inertia frontend", ["react", "vue", "svelte", "solid"], { interactive, default: values.inertiaFrontend }) ?? values.inertiaFrontend;
3983
3972
  }
3984
3973
  if (flag("db-url") === undefined && flag("db") !== undefined) {
@@ -4676,5 +4665,5 @@ main().then((code) => process.exit(code)).catch((err) => {
4676
4665
  process.exit(1);
4677
4666
  });
4678
4667
 
4679
- //# debugId=0BB397411F7B54EA64756E2164756E21
4668
+ //# debugId=8C2378D6B1E99D5064756E2164756E21
4680
4669
  //# sourceMappingURL=index.js.map