sv 0.6.4 → 0.6.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/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
@@ -24,7 +24,7 @@ import 'stream';
24
24
  import 'readline';
25
25
 
26
26
  var name = "sv";
27
- var version = "0.6.4";
27
+ var version = "0.6.6";
28
28
  var type = "module";
29
29
  var description = "A CLI for creating and updating SvelteKit projects";
30
30
  var license = "MIT";
@@ -4934,6 +4934,7 @@ const options$4 = defineAddonOptions({
4934
4934
  });
4935
4935
  var drizzle = defineAddon({
4936
4936
  id: "drizzle",
4937
+ shortDescription: "database orm",
4937
4938
  homepage: "https://orm.drizzle.team",
4938
4939
  options: options$4,
4939
4940
  setup: ({ kit, unsupported }) => {
@@ -5259,12 +5260,13 @@ function addToDemoPage(content, path) {
5259
5260
 
5260
5261
  var eslint = defineAddon({
5261
5262
  id: "eslint",
5263
+ shortDescription: "linter",
5262
5264
  homepage: "https://eslint.org",
5263
5265
  options: {},
5264
5266
  run: ({ sv, typescript, dependencyVersion }) => {
5265
5267
  const prettierInstalled = Boolean(dependencyVersion("prettier"));
5266
5268
  sv.devDependency("eslint", "^9.7.0");
5267
- sv.devDependency("@types/eslint", "^9.6.0");
5269
+ sv.devDependency("@eslint/compat", "^1.2.3");
5268
5270
  sv.devDependency("globals", "^15.0.0");
5269
5271
  sv.devDependency("eslint-plugin-svelte", "^2.36.0");
5270
5272
  if (typescript) sv.devDependency("typescript-eslint", "^8.0.0");
@@ -5290,6 +5292,12 @@ var eslint = defineAddon({
5290
5292
  sv.file("eslint.config.js", (content) => {
5291
5293
  const { ast, generateCode } = parseScript(content);
5292
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);
5293
5301
  const jsConfig = common.expressionFromString("js.configs.recommended");
5294
5302
  eslintConfigs.push(jsConfig);
5295
5303
  if (typescript) {
@@ -5321,10 +5329,6 @@ var eslint = defineAddon({
5321
5329
  });
5322
5330
  eslintConfigs.push(svelteTSParserConfig);
5323
5331
  }
5324
- const ignoresConfig = object$1.create({
5325
- ignores: common.expressionFromString('["build/", ".svelte-kit/", "dist/"]')
5326
- });
5327
- eslintConfigs.push(ignoresConfig);
5328
5332
  let exportExpression;
5329
5333
  if (typescript) {
5330
5334
  const tsConfigCall = _function.call("ts.config", []);
@@ -5343,8 +5347,10 @@ var eslint = defineAddon({
5343
5347
  if (!typescript)
5344
5348
  common.addJsDocTypeComment(defaultExport.astNode, "import('eslint').Linter.Config[]");
5345
5349
  if (typescript) imports.addDefault(ast, "typescript-eslint", "ts");
5350
+ imports.addNamed(ast, "node:url", { fileURLToPath: "fileURLToPath" });
5346
5351
  imports.addDefault(ast, "globals", "globals");
5347
5352
  imports.addDefault(ast, "eslint-plugin-svelte", "svelte");
5353
+ imports.addNamed(ast, "@eslint/compat", { includeIgnoreFile: "includeIgnoreFile" });
5348
5354
  imports.addDefault(ast, "@eslint/js", "js");
5349
5355
  return generateCode();
5350
5356
  });
@@ -6721,6 +6727,7 @@ const options$3 = defineAddonOptions({
6721
6727
  });
6722
6728
  var lucia = defineAddon({
6723
6729
  id: "lucia",
6730
+ shortDescription: "auth guide",
6724
6731
  homepage: "https://lucia-auth.com",
6725
6732
  options: options$3,
6726
6733
  setup: ({ kit, dependencyVersion, unsupported, dependsOn }) => {
@@ -7283,6 +7290,7 @@ function getCallExpression(ast) {
7283
7290
 
7284
7291
  var mdsvex = defineAddon({
7285
7292
  id: "mdsvex",
7293
+ shortDescription: "svelte + markdown",
7286
7294
  homepage: "https://mdsvex.pngwn.io",
7287
7295
  options: {},
7288
7296
  run: ({ sv }) => {
@@ -7377,6 +7385,7 @@ const options$2 = defineAddonOptions({
7377
7385
  });
7378
7386
  var paraglide = defineAddon({
7379
7387
  id: "paraglide",
7388
+ shortDescription: "i18n",
7380
7389
  homepage: "https://inlang.com",
7381
7390
  options: options$2,
7382
7391
  setup: ({ kit, unsupported }) => {
@@ -7385,6 +7394,7 @@ var paraglide = defineAddon({
7385
7394
  run: ({ sv, options: options2, typescript, kit: kit$1, dependencyVersion }) => {
7386
7395
  const ext = typescript ? "ts" : "js";
7387
7396
  if (!kit$1) throw new Error("SvelteKit is required");
7397
+ const paraglideOutDir = "src/lib/paraglide";
7388
7398
  sv.dependency("@inlang/paraglide-sveltekit", "^0.11.1");
7389
7399
  sv.file("project.inlang/settings.json", (content) => {
7390
7400
  if (content) return content;
@@ -7408,7 +7418,7 @@ var paraglide = defineAddon({
7408
7418
  const pluginFunctionCall = _function.call(vitePluginName, []);
7409
7419
  const pluginConfig = object$1.create({
7410
7420
  project: common.createLiteral("./project.inlang"),
7411
- outdir: common.createLiteral("./src/lib/paraglide")
7421
+ outdir: common.createLiteral(`./${paraglideOutDir}`)
7412
7422
  });
7413
7423
  _function.argumentByIndex(pluginFunctionCall, 0, pluginConfig);
7414
7424
  array$1.push(pluginsArray, pluginFunctionCall);
@@ -7482,6 +7492,17 @@ var paraglide = defineAddon({
7482
7492
  };
7483
7493
  return generateCode();
7484
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
+ });
7485
7506
  if (options2.demo) {
7486
7507
  sv.file(`${kit$1.routesDirectory}/demo/+page.svelte`, (content) => {
7487
7508
  return addToDemoPage(content, "paraglide");
@@ -7571,6 +7592,7 @@ function parseLanguageTagInput(input) {
7571
7592
 
7572
7593
  var playwright = defineAddon({
7573
7594
  id: "playwright",
7595
+ shortDescription: "browser testing",
7574
7596
  homepage: "https://playwright.dev",
7575
7597
  options: {},
7576
7598
  run: ({ sv, typescript }) => {
@@ -7629,6 +7651,7 @@ var playwright = defineAddon({
7629
7651
 
7630
7652
  var prettier = defineAddon({
7631
7653
  id: "prettier",
7654
+ shortDescription: "formatter",
7632
7655
  homepage: "https://prettier.io",
7633
7656
  options: {},
7634
7657
  run: ({ sv, dependencyVersion }) => {
@@ -7700,6 +7723,7 @@ function hasEslint(version) {
7700
7723
 
7701
7724
  var storybook = defineAddon({
7702
7725
  id: "storybook",
7726
+ shortDescription: "frontend workshop",
7703
7727
  homepage: "https://storybook.js.org",
7704
7728
  options: {},
7705
7729
  run: async ({ sv }) => {
@@ -7740,12 +7764,6 @@ const plugins = [
7740
7764
  package: "@tailwindcss/container-queries",
7741
7765
  version: "^0.1.1",
7742
7766
  identifier: "containerQueries"
7743
- },
7744
- {
7745
- id: "aspect-ratio",
7746
- package: "@tailwindcss/aspect-ratio",
7747
- version: "^0.4.2",
7748
- identifier: "aspectRatio"
7749
7767
  }
7750
7768
  ];
7751
7769
  const options$1 = defineAddonOptions({
@@ -7759,6 +7777,7 @@ const options$1 = defineAddonOptions({
7759
7777
  var tailwindcss = defineAddon({
7760
7778
  id: "tailwindcss",
7761
7779
  alias: "tailwind",
7780
+ shortDescription: "css framework",
7762
7781
  homepage: "https://tailwindcss.com",
7763
7782
  options: options$1,
7764
7783
  run: ({ sv, options: options2, typescript, kit, dependencyVersion }) => {
@@ -7864,6 +7883,7 @@ var tailwindcss = defineAddon({
7864
7883
 
7865
7884
  var vitest = defineAddon({
7866
7885
  id: "vitest",
7886
+ shortDescription: "unit testing",
7867
7887
  homepage: "https://vitest.dev",
7868
7888
  options: {},
7869
7889
  run: ({ sv, typescript }) => {
@@ -11519,7 +11539,11 @@ Available options: ${communityAddonIds.join(", ")}`
11519
11539
  let workspace = createWorkspace({ cwd: options.cwd });
11520
11540
  const addonSetupResults = setupAddons(officialAddons, workspace);
11521
11541
  if (selectedAddons.length === 0) {
11522
- const addonOptions = officialAddons.filter(({ id }) => addonSetupResults[id].unsupported.length === 0).map(({ id, homepage }) => ({ label: id, value: id, hint: homepage }));
11542
+ const addonOptions = officialAddons.filter(({ id }) => addonSetupResults[id].unsupported.length === 0).map(({ id, homepage, shortDescription }) => ({
11543
+ label: id,
11544
+ value: id,
11545
+ hint: `${shortDescription} - ${homepage}`
11546
+ }));
11523
11547
  const selected = await multiselect({
11524
11548
  message: `What would you like to add to your project? ${pc.dim("(use arrow keys / space bar)")}`,
11525
11549
  options: addonOptions,