sv 0.6.25 → 0.6.26

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/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Element, __commonJS, __require, __toESM, addPnpmBuildDependendencies, box, cancel, confirm, create, detect, esm_exports, from, getUserAgent, group, installDependencies, intro, isCancel, log, multiselect, note, outro, packageManagerPrompt, parseCss, parseHtml, parseHtml$1, parseJson, parseScript, parseSvelte, resolveCommand, select, spinner, templates, text, up, walk_exports } from "./package-manager-BF1V21Xa.js";
3
- import { __commonJS$1, __export, __toESM$1, addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, kit_exports, object_exports, require_picocolors, setupAddons, variables_exports } from "./install-ByV5M1yf.js";
3
+ import { __commonJS$1, __export, __toESM$1, addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, kit_exports, object_exports, require_picocolors, setupAddons, variables_exports } from "./install-D7XPOwHS.js";
4
4
  import fs, { existsSync } from "node:fs";
5
5
  import path, { dirname, join } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
@@ -12,7 +12,7 @@ import { promisify } from "node:util";
12
12
 
13
13
  //#region packages/cli/package.json
14
14
  var name = "sv";
15
- var version = "0.6.25";
15
+ var version = "0.6.26";
16
16
  var type = "module";
17
17
  var description = "A CLI for creating and updating SvelteKit projects";
18
18
  var license = "MIT";
@@ -6584,7 +6584,7 @@ var tailwindcss_default = defineAddon({
6584
6584
  const param1 = function_exports.argumentByIndex(rootObject, 0, object_exports.createEmpty());
6585
6585
  const pluginsArray = object_exports.property(param1, "plugins", array_exports.createEmpty());
6586
6586
  const pluginFunctionCall = function_exports.call(vitePluginName, []);
6587
- array_exports.push(pluginsArray, pluginFunctionCall);
6587
+ array_exports.unshift(pluginsArray, pluginFunctionCall);
6588
6588
  return generateCode();
6589
6589
  });
6590
6590
  sv.file("src/app.css", (content) => {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { create } from "./package-manager-BF1V21Xa.js";
2
- import { installAddon } from "./install-ByV5M1yf.js";
2
+ import { installAddon } from "./install-D7XPOwHS.js";
3
3
 
4
4
  export { create, installAddon };
@@ -1,4 +1,4 @@
1
- import { __commonJS, __toESM, be, detect, getUserAgent, log, parseJson, parseScript as parseScript$1, parseScript$1 as parseScript, resolveCommand, serializeScript, stripAst, up, walk_exports } from "./package-manager-BF1V21Xa.js";
1
+ import { __commonJS, __toESM, be, detect, getUserAgent, log, parseJson, parseScript, parseScript$1, resolveCommand, serializeScript, stripAst, up, walk_exports } from "./package-manager-BF1V21Xa.js";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import process$1 from "node:process";
@@ -305,17 +305,17 @@ function expressionStatement(expression) {
305
305
  return statement;
306
306
  }
307
307
  function addFromString(ast, value) {
308
- const program = parseScript(dedent_default(value));
308
+ const program = parseScript$1(dedent_default(value));
309
309
  for (const childNode of program.body) ast.body.push(childNode);
310
310
  }
311
311
  function expressionFromString(value) {
312
- const program = parseScript(dedent_default(value));
312
+ const program = parseScript$1(dedent_default(value));
313
313
  const statement = program.body[0];
314
314
  if (statement.type !== "ExpressionStatement") throw new Error("value passed was not an expression");
315
315
  return statement.expression;
316
316
  }
317
317
  function statementFromString(value) {
318
- const program = parseScript(dedent_default(value));
318
+ const program = parseScript$1(dedent_default(value));
319
319
  const statement = program.body[0];
320
320
  return statement;
321
321
  }
@@ -342,7 +342,8 @@ function hasTypeProp(name, node) {
342
342
  var array_exports = {};
343
343
  __export(array_exports, {
344
344
  createEmpty: () => createEmpty$1,
345
- push: () => push
345
+ push: () => push,
346
+ unshift: () => unshift
346
347
  });
347
348
  function createEmpty$1() {
348
349
  const arrayExpression = {
@@ -352,21 +353,28 @@ function createEmpty$1() {
352
353
  return arrayExpression;
353
354
  }
354
355
  function push(ast, data) {
356
+ insertElement(ast, data, true);
357
+ }
358
+ function unshift(ast, data) {
359
+ insertElement(ast, data, false);
360
+ }
361
+ function insertElement(ast, data, insertEnd) {
355
362
  if (typeof data === "string") {
356
- const existingLiterals = ast.elements.filter((x) => x?.type == "StringLiteral");
357
- let literal = existingLiterals.find((x) => x.value == data);
363
+ const existingLiterals = ast.elements.filter((x) => x?.type === "StringLiteral");
364
+ let literal = existingLiterals.find((x) => x.value === data);
358
365
  if (!literal) {
359
366
  literal = {
360
367
  type: "StringLiteral",
361
368
  value: data
362
369
  };
363
- ast.elements.push(literal);
370
+ if (insertEnd) ast.elements.push(literal);
371
+ else ast.elements.unshift(literal);
364
372
  }
365
373
  } else {
366
- let anyNodeEquals = false;
367
374
  const elements = ast.elements;
368
- for (const node of elements) if (areNodesEqual(data, node)) anyNodeEquals = true;
369
- if (!anyNodeEquals) ast.elements.push(data);
375
+ const anyNodeEquals = elements.some((node) => areNodesEqual(data, node));
376
+ if (!anyNodeEquals) if (insertEnd) ast.elements.push(data);
377
+ else ast.elements.unshift(data);
370
378
  }
371
379
  }
372
380
  var object_exports = {};
@@ -970,7 +978,7 @@ function findRoot(cwd) {
970
978
  }
971
979
  function parseKitOptions(cwd) {
972
980
  const configSource = readFile(cwd, commonFilePaths.svelteConfig);
973
- const { ast } = parseScript$1(configSource);
981
+ const { ast } = parseScript(configSource);
974
982
  const defaultExport$1 = ast.body.find((s) => s.type === "ExportDefaultDeclaration");
975
983
  if (!defaultExport$1) throw Error("Missing default export in `svelte.config.js`");
976
984
  let objectExpression;
@@ -31,5 +31,6 @@
31
31
  "svelte": "^5.0.0",
32
32
  "typescript": "^5.3.2",
33
33
  "vite": "^6.0.0"
34
- }
34
+ },
35
+ "keywords": ["svelte"]
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.6.25",
3
+ "version": "0.6.26",
4
4
  "type": "module",
5
5
  "description": "A CLI for creating and updating SvelteKit projects",
6
6
  "license": "MIT",
@@ -38,9 +38,9 @@
38
38
  "tinyexec": "^0.3.1",
39
39
  "valibot": "^0.41.0",
40
40
  "@sveltejs/addons": "0.0.0",
41
+ "@sveltejs/clack-prompts": "0.9.1",
41
42
  "@sveltejs/cli-core": "0.0.0",
42
- "@sveltejs/create": "0.0.0",
43
- "@sveltejs/clack-prompts": "0.9.1"
43
+ "@sveltejs/create": "0.0.0"
44
44
  },
45
45
  "keywords": [
46
46
  "create",