sv 0.12.0 → 0.12.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.
@@ -1439,7 +1439,7 @@ function generateEnvFileContent(content, opts, isExample) {
1439
1439
  const comment = ["Drizzle"];
1440
1440
  if (opts.docker) value = `"${opts.database === "mysql" ? "mysql" : "postgres"}://root:mysecretpassword@localhost:${PORTS[opts.database]}/local"`;
1441
1441
  else if (opts.sqlite === "better-sqlite3" || opts.sqlite === "libsql") value = opts.sqlite === "libsql" ? "file:local.db" : "local.db";
1442
- else if (opts.sqlite === "turso") {
1442
+ else if (opts.sqlite === "turso") if (isExample) {
1443
1443
  value = "\"libsql://db-name-user.turso.io\"";
1444
1444
  comment.push("Replace with your DB credentials!", {
1445
1445
  text: "A local DB can also be used in dev as well",
@@ -1448,7 +1448,11 @@ function generateEnvFileContent(content, opts, isExample) {
1448
1448
  text: `${DB_URL_KEY}="file:local.db"`,
1449
1449
  mode: "append"
1450
1450
  });
1451
- } else if (opts.database === "mysql") {
1451
+ } else {
1452
+ value = "\"file:local.db\"";
1453
+ comment.push("Replace with your DB credentials!", `${DB_URL_KEY}="libsql://db-name-user.turso.io"`, "A local DB can also be used in dev as well");
1454
+ }
1455
+ else if (opts.database === "mysql") {
1452
1456
  value = "\"mysql://user:password@host:port/db-name\"";
1453
1457
  comment.push("Replace with your DB credentials!");
1454
1458
  } else if (opts.database === "postgresql") {
@@ -2819,7 +2823,7 @@ async function createWorkspace({ cwd: cwd$1, packageManager, override }) {
2819
2823
  }
2820
2824
  }
2821
2825
  for (const [key, value] of Object.entries(dependencies)) dependencies[key] = value.replaceAll(/[^\d|.]/g, "");
2822
- const kit = override?.kit ? override.kit : dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : void 0;
2826
+ const kit = override?.kit ? override.kit : dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd, svelteConfig) : void 0;
2823
2827
  const stylesheet = kit ? `${kit.routesDirectory}/layout.css` : "src/app.css";
2824
2828
  return {
2825
2829
  cwd: resolvedCwd,
@@ -2861,11 +2865,11 @@ function findWorkspaceRoot(cwd$1) {
2861
2865
  }
2862
2866
  return cwd$1;
2863
2867
  }
2864
- function parseKitOptions(cwd$1) {
2865
- const configSource = readFile(cwd$1, commonFilePaths.svelteConfig);
2868
+ function parseKitOptions(cwd$1, svelteConfigPath) {
2869
+ const configSource = readFile(cwd$1, svelteConfigPath);
2866
2870
  const { ast } = parse$1.script(configSource);
2867
2871
  const defaultExport = ast.body.find((s) => s.type === "ExportDefaultDeclaration");
2868
- if (!defaultExport) throw Error(`Missing default export in \`${commonFilePaths.svelteConfig}\``);
2872
+ if (!defaultExport) throw Error(`Missing default export in \`${svelteConfigPath}\``);
2869
2873
  let objectExpression;
2870
2874
  if (defaultExport.declaration.type === "Identifier") {
2871
2875
  const identifier = defaultExport.declaration;
@@ -2875,9 +2879,9 @@ function parseKitOptions(cwd$1) {
2875
2879
  if (declarator?.init?.type !== "ObjectExpression") continue;
2876
2880
  objectExpression = declarator.init;
2877
2881
  }
2878
- if (!objectExpression) throw Error(`Unable to find svelte config object expression from \`${commonFilePaths.svelteConfig}\``);
2882
+ if (!objectExpression) throw Error(`Unable to find svelte config object expression from \`${svelteConfigPath}\``);
2879
2883
  } else if (defaultExport.declaration.type === "ObjectExpression") objectExpression = defaultExport.declaration;
2880
- if (!objectExpression) throw new Error(`Unexpected svelte config shape from \`${commonFilePaths.svelteConfig}\``);
2884
+ if (!objectExpression) throw new Error(`Unexpected svelte config shape from \`${svelteConfigPath}\``);
2881
2885
  const kit = property(objectExpression, {
2882
2886
  name: "kit",
2883
2887
  fallback: create$2({})
@@ -2903,7 +2907,7 @@ function parseKitOptions(cwd$1) {
2903
2907
  //#endregion
2904
2908
  //#region package.json
2905
2909
  var name = "sv";
2906
- var version = "0.12.0";
2910
+ var version = "0.12.1";
2907
2911
 
2908
2912
  //#endregion
2909
2913
  //#region lib/cli/utils/errors.ts
package/dist/bin.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { f as program, l as from, r as detectPackageManager, u as Command } from "./package-manager-DYfxv5nk.mjs";
3
3
  import { ht as resolveCommand, t as color } from "./utils-CnfD6Z1s.mjs";
4
- import { a as helpConfig, i as forwardExitCode, n as add, o as name, r as create, s as version } from "./add-CrUK5jc7.mjs";
4
+ import { a as helpConfig, i as forwardExitCode, n as add, o as name, r as create, s as version } from "./add-D8995Wsf.mjs";
5
5
  import process from "node:process";
6
6
  import { execSync } from "node:child_process";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { p as create } from "../package-manager-DYfxv5nk.mjs";
2
2
  import "../utils-CnfD6Z1s.mjs";
3
- import { c as officialAddons, t as add } from "../add-CrUK5jc7.mjs";
3
+ import { c as officialAddons, t as add } from "../add-D8995Wsf.mjs";
4
4
 
5
5
  export { add, create, officialAddons };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "description": "A command line interface (CLI) for creating and maintaining Svelte applications",
6
6
  "license": "MIT",