sv 0.6.5 → 0.6.7

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/README.md CHANGED
@@ -6,11 +6,9 @@ A command line interface (CLI) for creating and maintaining [Svelte](https://sve
6
6
  npx sv
7
7
  ```
8
8
 
9
- ## Acknowledgements
9
+ ## Documentation
10
10
 
11
- Thank you to [Christopher Brown](https://github.com/chbrown) who originally owned the `sv` name on npm for graciously allowing it to be used for this package. You can find the original `sv` package at [`@chbrown/sv`](https://www.npmjs.com/package/@chbrown/sv).
12
-
13
- This project was formed by merging the `create-svelte` and `svelte-add` CLIs. Thank you to [J](https://github.com/babichjacob) for starting the community-led `svelte-add` project and to the [`svelte-add` contributors](https://github.com/svelte-add/svelte-add/graphs/contributors).
11
+ [Documentation](https://svelte.dev/docs/cli/overview)
14
12
 
15
13
  ## Changelog
16
14
 
@@ -19,3 +17,9 @@ This project was formed by merging the `create-svelte` and `svelte-add` CLIs. Th
19
17
  ## License
20
18
 
21
19
  [MIT](../../LICENSE)
20
+
21
+ ## Acknowledgements
22
+
23
+ Thank you to [Christopher Brown](https://github.com/chbrown) who originally owned the `sv` name on npm for graciously allowing it to be used for this package. You can find the original `sv` package at [`@chbrown/sv`](https://www.npmjs.com/package/@chbrown/sv).
24
+
25
+ This project was formed by merging the `create-svelte` and `svelte-add` CLIs. Thank you to [J](https://github.com/babichjacob) for starting the community-led `svelte-add` project and to the [`svelte-add` contributors](https://github.com/svelte-add/svelte-add/graphs/contributors).
package/dist/bin.js CHANGED
@@ -4,7 +4,7 @@ import require$$1, { execSync } from 'node:child_process';
4
4
  import path$2 from 'node:path';
5
5
  import fs$3 from 'node:fs';
6
6
  import process$1$1 from 'node:process';
7
- import { u as up$1, d as dedent, p as parseJson, a as parseScript, b as imports, c as common, e as exports$1, o as object$1, v as variables, _ as _function, f as parseSvelte, g as array$1, w as walk$1, k as kit, h as addFromString, E as Element, j as index, l as parseHtml, m as parseHtml$1, A as AtRule2, n as parseCss, q as pc, r as intro, s as outro, t as log$1, x as cancel, y as box, z as multiselect, B as isCancel, C as confirm, D as createWorkspace, F as setupAddons, G as note, H as select, I as text, J as packageManagerPrompt, K as applyAddons, L as installDependencies, M as formatFiles, N as spinner, O as getHighlighter, P as detectSync, Q as getUserAgent, R as group, S as resolveCommand, T as from$1 } from './install-ClR4mYH4.js';
7
+ import { u as up$1, d as dedent, p as parseJson, a as parseScript, b as imports, c as common, e as exports$1, o as object$1, v as variables, _ as _function, f as parseSvelte, g as array$1, w as walk$1, k as kit, h as addFromString, E as Element, j as index, l as parseHtml, m as parseHtml$1, A as AtRule2, n as parseCss, q as pc, r as intro, s as outro, t as log$1, x as cancel, y as box, z as multiselect, B as isCancel, C as confirm, D as createWorkspace, F as setupAddons, G as note, H as select, I as text, J as packageManagerPrompt, K as applyAddons, L as installDependencies, M as formatFiles, N as spinner, O as getHighlighter, P as detectSync, Q as getUserAgent, R as group, S as resolveCommand, T as from$1 } from './install-BNk1yMP2.js';
8
8
  import 'node:readline';
9
9
  import 'node:tty';
10
10
  import { createGunzip } from 'node:zlib';
@@ -24,7 +24,7 @@ import 'stream';
24
24
  import 'readline';
25
25
 
26
26
  var name = "sv";
27
- var version = "0.6.5";
27
+ var version = "0.6.7";
28
28
  var type = "module";
29
29
  var description = "A CLI for creating and updating SvelteKit projects";
30
30
  var license = "MIT";
@@ -64,7 +64,7 @@ var devDependencies = {
64
64
  commander: "^12.1.0",
65
65
  degit: "^2.8.4",
66
66
  empathic: "^1.0.0",
67
- "package-manager-detector": "^0.2.2",
67
+ "package-manager-detector": "^0.2.7",
68
68
  picocolors: "^1.1.0",
69
69
  "ps-tree": "^1.2.0",
70
70
  "tar-fs": "^3.0.6",
@@ -5266,6 +5266,7 @@ var eslint = defineAddon({
5266
5266
  run: ({ sv, typescript, dependencyVersion }) => {
5267
5267
  const prettierInstalled = Boolean(dependencyVersion("prettier"));
5268
5268
  sv.devDependency("eslint", "^9.7.0");
5269
+ sv.devDependency("@eslint/compat", "^1.2.3");
5269
5270
  sv.devDependency("globals", "^15.0.0");
5270
5271
  sv.devDependency("eslint-plugin-svelte", "^2.36.0");
5271
5272
  if (typescript) sv.devDependency("typescript-eslint", "^8.0.0");
@@ -5291,6 +5292,12 @@ var eslint = defineAddon({
5291
5292
  sv.file("eslint.config.js", (content) => {
5292
5293
  const { ast, generateCode } = parseScript(content);
5293
5294
  const eslintConfigs = [];
5295
+ const gitIgnorePathStatement = common.statementFromString(
5296
+ '\nconst gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));'
5297
+ );
5298
+ common.addStatement(ast, gitIgnorePathStatement);
5299
+ const ignoresConfig = common.expressionFromString("includeIgnoreFile(gitignorePath)");
5300
+ eslintConfigs.push(ignoresConfig);
5294
5301
  const jsConfig = common.expressionFromString("js.configs.recommended");
5295
5302
  eslintConfigs.push(jsConfig);
5296
5303
  if (typescript) {
@@ -5322,10 +5329,6 @@ var eslint = defineAddon({
5322
5329
  });
5323
5330
  eslintConfigs.push(svelteTSParserConfig);
5324
5331
  }
5325
- const ignoresConfig = object$1.create({
5326
- ignores: common.expressionFromString('["build/", ".svelte-kit/", "dist/"]')
5327
- });
5328
- eslintConfigs.push(ignoresConfig);
5329
5332
  let exportExpression;
5330
5333
  if (typescript) {
5331
5334
  const tsConfigCall = _function.call("ts.config", []);
@@ -5344,8 +5347,10 @@ var eslint = defineAddon({
5344
5347
  if (!typescript)
5345
5348
  common.addJsDocTypeComment(defaultExport.astNode, "import('eslint').Linter.Config[]");
5346
5349
  if (typescript) imports.addDefault(ast, "typescript-eslint", "ts");
5350
+ imports.addNamed(ast, "node:url", { fileURLToPath: "fileURLToPath" });
5347
5351
  imports.addDefault(ast, "globals", "globals");
5348
5352
  imports.addDefault(ast, "eslint-plugin-svelte", "svelte");
5353
+ imports.addNamed(ast, "@eslint/compat", { includeIgnoreFile: "includeIgnoreFile" });
5349
5354
  imports.addDefault(ast, "@eslint/js", "js");
5350
5355
  return generateCode();
5351
5356
  });
@@ -7389,6 +7394,7 @@ var paraglide = defineAddon({
7389
7394
  run: ({ sv, options: options2, typescript, kit: kit$1, dependencyVersion }) => {
7390
7395
  const ext = typescript ? "ts" : "js";
7391
7396
  if (!kit$1) throw new Error("SvelteKit is required");
7397
+ const paraglideOutDir = "src/lib/paraglide";
7392
7398
  sv.dependency("@inlang/paraglide-sveltekit", "^0.11.1");
7393
7399
  sv.file("project.inlang/settings.json", (content) => {
7394
7400
  if (content) return content;
@@ -7412,7 +7418,7 @@ var paraglide = defineAddon({
7412
7418
  const pluginFunctionCall = _function.call(vitePluginName, []);
7413
7419
  const pluginConfig = object$1.create({
7414
7420
  project: common.createLiteral("./project.inlang"),
7415
- outdir: common.createLiteral("./src/lib/paraglide")
7421
+ outdir: common.createLiteral(`./${paraglideOutDir}`)
7416
7422
  });
7417
7423
  _function.argumentByIndex(pluginFunctionCall, 0, pluginConfig);
7418
7424
  array$1.push(pluginsArray, pluginFunctionCall);
@@ -7486,6 +7492,17 @@ var paraglide = defineAddon({
7486
7492
  };
7487
7493
  return generateCode();
7488
7494
  });
7495
+ sv.file(".gitignore", (content) => {
7496
+ if (!content) return content;
7497
+ if (!content.includes(`
7498
+ ${paraglideOutDir}`)) {
7499
+ content = content.trimEnd() + `
7500
+
7501
+ # Paraglide
7502
+ ${paraglideOutDir}`;
7503
+ }
7504
+ return content;
7505
+ });
7489
7506
  if (options2.demo) {
7490
7507
  sv.file(`${kit$1.routesDirectory}/demo/+page.svelte`, (content) => {
7491
7508
  return addToDemoPage(content, "paraglide");
@@ -7511,7 +7528,7 @@ var paraglide = defineAddon({
7511
7528
  scriptCode.append("\n\n");
7512
7529
  scriptCode.append(dedent`
7513
7530
  ${ts("", "/**")}
7514
- ${ts("", '* @param import("$lib/paraglide/runtime").AvailableLanguageTag newLanguage')}
7531
+ ${ts("", '* @param {import("$lib/paraglide/runtime").AvailableLanguageTag} newLanguage')}
7515
7532
  ${ts("", "*/")}
7516
7533
  function switchToLanguage(newLanguage${ts(": AvailableLanguageTag")}) {
7517
7534
  const canonicalPath = i18n.route($page.url.pathname);