sv 0.6.22 → 0.6.24
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
|
-
import {
|
|
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-
|
|
2
|
+
import { Element, __commonJS, __require, __toESM, addPnpmBuildDependendencies, box, cancel, confirm, create, detectSync, 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-DYKbLpuq.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-Bjzz5ixb.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.
|
|
15
|
+
var version = "0.6.24";
|
|
16
16
|
var type = "module";
|
|
17
17
|
var description = "A CLI for creating and updating SvelteKit projects";
|
|
18
18
|
var license = "MIT";
|
|
@@ -4378,7 +4378,7 @@ function addEslintConfigPrettier(content) {
|
|
|
4378
4378
|
const eslintConfig = defaultExport.value;
|
|
4379
4379
|
if (eslintConfig.type !== "ArrayExpression" && eslintConfig.type !== "CallExpression") return content;
|
|
4380
4380
|
const prettier = common_exports.expressionFromString("prettier");
|
|
4381
|
-
const sveltePrettierConfig = common_exports.expressionFromString(`${svelteImportName}.configs
|
|
4381
|
+
const sveltePrettierConfig = common_exports.expressionFromString(`${svelteImportName}.configs.prettier`);
|
|
4382
4382
|
const configSpread = common_exports.createSpreadElement(sveltePrettierConfig);
|
|
4383
4383
|
const nodesToInsert = [];
|
|
4384
4384
|
if (!common_exports.hasNode(eslintConfig, prettier)) nodesToInsert.push(prettier);
|
|
@@ -4408,10 +4408,8 @@ var eslint_default = defineAddon({
|
|
|
4408
4408
|
const prettierInstalled = Boolean(dependencyVersion("prettier"));
|
|
4409
4409
|
sv.devDependency("eslint", "^9.18.0");
|
|
4410
4410
|
sv.devDependency("@eslint/compat", "^1.2.5");
|
|
4411
|
-
sv.devDependency("globals", "^15.14.0");
|
|
4412
4411
|
sv.devDependency("eslint-plugin-svelte", "^3.0.0");
|
|
4413
4412
|
sv.devDependency("globals", "^16.0.0");
|
|
4414
|
-
sv.devDependency("eslint-plugin-svelte", "^2.46.1");
|
|
4415
4413
|
sv.devDependency("@eslint/js", "^9.18.0");
|
|
4416
4414
|
if (typescript) sv.devDependency("typescript-eslint", "^8.20.0");
|
|
4417
4415
|
if (prettierInstalled) sv.devDependency("eslint-config-prettier", "^10.0.1");
|
|
@@ -6173,7 +6171,7 @@ function appendElement(childNodes, elementToAppend) {
|
|
|
6173
6171
|
childNodes.push(elementToAppend);
|
|
6174
6172
|
}
|
|
6175
6173
|
function addFromRawHtml(childNodes, html) {
|
|
6176
|
-
const document = parseHtml(html);
|
|
6174
|
+
const document = parseHtml$1(html);
|
|
6177
6175
|
for (const childNode of document.childNodes) childNodes.push(childNode);
|
|
6178
6176
|
}
|
|
6179
6177
|
function addSlot(jsAst, htmlAst, svelteVersion) {
|
|
@@ -6314,7 +6312,7 @@ var paraglide_default = defineAddon({
|
|
|
6314
6312
|
});
|
|
6315
6313
|
});
|
|
6316
6314
|
sv.file("src/app.html", (content) => {
|
|
6317
|
-
const { ast, generateCode } = parseHtml
|
|
6315
|
+
const { ast, generateCode } = parseHtml(content);
|
|
6318
6316
|
const htmlNode = ast.children.find((child) => child.type === esm_exports.Tag && child.name === "html");
|
|
6319
6317
|
if (!htmlNode) {
|
|
6320
6318
|
log$1.warn("Could not find <html> node in app.html. You'll need to add the language placeholder manually");
|
|
@@ -6537,36 +6535,6 @@ var storybook_default = defineAddon({
|
|
|
6537
6535
|
}
|
|
6538
6536
|
});
|
|
6539
6537
|
|
|
6540
|
-
//#endregion
|
|
6541
|
-
//#region packages/core/dist/css.js
|
|
6542
|
-
function addImports(ast, imports) {
|
|
6543
|
-
let prev;
|
|
6544
|
-
const nodes = imports.map((param) => {
|
|
6545
|
-
const found = ast.nodes.find((x) => x.type === "atrule" && x.name === "import" && x.params === param);
|
|
6546
|
-
if (found) return prev = found;
|
|
6547
|
-
const rule = new AtRule({
|
|
6548
|
-
name: "import",
|
|
6549
|
-
params: param
|
|
6550
|
-
});
|
|
6551
|
-
if (prev) ast.insertAfter(prev, rule);
|
|
6552
|
-
else ast.prepend(rule);
|
|
6553
|
-
return prev = rule;
|
|
6554
|
-
});
|
|
6555
|
-
return nodes;
|
|
6556
|
-
}
|
|
6557
|
-
function addAtRule(ast, name$1, params, append = false) {
|
|
6558
|
-
const atRules = ast.nodes.filter((x) => x.type == "atrule");
|
|
6559
|
-
let atRule = atRules.find((x) => x.name == name$1 && x.params == params);
|
|
6560
|
-
if (atRule) return atRule;
|
|
6561
|
-
atRule = new AtRule({
|
|
6562
|
-
name: name$1,
|
|
6563
|
-
params
|
|
6564
|
-
});
|
|
6565
|
-
if (!append) ast.prepend(atRule);
|
|
6566
|
-
else ast.append(atRule);
|
|
6567
|
-
return atRule;
|
|
6568
|
-
}
|
|
6569
|
-
|
|
6570
6538
|
//#endregion
|
|
6571
6539
|
//#region packages/addons/tailwindcss/index.ts
|
|
6572
6540
|
const plugins = [{
|
|
@@ -6618,18 +6586,25 @@ var tailwindcss_default = defineAddon({
|
|
|
6618
6586
|
return generateCode();
|
|
6619
6587
|
});
|
|
6620
6588
|
sv.file("src/app.css", (content) => {
|
|
6621
|
-
|
|
6622
|
-
const
|
|
6623
|
-
|
|
6624
|
-
const
|
|
6589
|
+
let atRules = parseCss(content).ast.nodes.filter((node) => node.type === "atrule");
|
|
6590
|
+
const findAtRule = (name$1, params) => atRules.find((rule) => rule.name === name$1 && rule.params.replace(/['"]/g, "") === params);
|
|
6591
|
+
let code = content;
|
|
6592
|
+
const importsTailwind = findAtRule("import", "tailwindcss");
|
|
6593
|
+
if (!importsTailwind) {
|
|
6594
|
+
code = "@import 'tailwindcss';\n" + code;
|
|
6595
|
+
atRules = parseCss(code).ast.nodes.filter((node) => node.type === "atrule");
|
|
6596
|
+
}
|
|
6597
|
+
const lastAtRule = atRules.findLast((rule) => ["plugin", "import"].includes(rule.name));
|
|
6598
|
+
const pluginPos = lastAtRule.source.end.offset;
|
|
6625
6599
|
for (const plugin of plugins) {
|
|
6626
6600
|
if (!options$6.plugins.includes(plugin.id)) continue;
|
|
6627
|
-
|
|
6601
|
+
const pluginRule = findAtRule("plugin", plugin.package);
|
|
6602
|
+
if (!pluginRule) {
|
|
6603
|
+
const pluginImport = `\n@plugin '${plugin.package}';`;
|
|
6604
|
+
code = code.substring(0, pluginPos) + pluginImport + code.substring(pluginPos);
|
|
6605
|
+
}
|
|
6628
6606
|
}
|
|
6629
|
-
|
|
6630
|
-
nodes.shift();
|
|
6631
|
-
nodes.forEach((n$1) => n$1.raws.before = "\n");
|
|
6632
|
-
return generateCode();
|
|
6607
|
+
return code;
|
|
6633
6608
|
});
|
|
6634
6609
|
if (!kit) sv.file("src/App.svelte", (content) => {
|
|
6635
6610
|
const { script, generateCode } = parseSvelte(content, { typescript });
|
|
@@ -10188,15 +10163,15 @@ async function createProject(cwd, options$6) {
|
|
|
10188
10163
|
language: () => {
|
|
10189
10164
|
if (options$6.types) return Promise.resolve(options$6.types);
|
|
10190
10165
|
return select({
|
|
10191
|
-
message: "Add type checking with
|
|
10166
|
+
message: "Add type checking with TypeScript?",
|
|
10192
10167
|
initialValue: "typescript",
|
|
10193
10168
|
options: [
|
|
10194
10169
|
{
|
|
10195
|
-
label: "Yes, using
|
|
10170
|
+
label: "Yes, using TypeScript syntax",
|
|
10196
10171
|
value: "typescript"
|
|
10197
10172
|
},
|
|
10198
10173
|
{
|
|
10199
|
-
label: "Yes, using
|
|
10174
|
+
label: "Yes, using JavaScript with JSDoc comments",
|
|
10200
10175
|
value: "checkjs"
|
|
10201
10176
|
},
|
|
10202
10177
|
{
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, __toESM, be, detectSync, getUserAgent, log, parseJson, parseScript as parseScript$1, parseScript$1 as parseScript, resolveCommand, serializeScript, stripAst, up, walk_exports } from "./package-manager-
|
|
1
|
+
import { __commonJS, __toESM, be, detectSync, getUserAgent, log, parseJson, parseScript as parseScript$1, parseScript$1 as parseScript, resolveCommand, serializeScript, stripAst, up, walk_exports } from "./package-manager-DYKbLpuq.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process$1 from "node:process";
|
|
@@ -40223,4 +40223,4 @@ else packageDirectory = cwd$1;
|
|
|
40223
40223
|
}
|
|
40224
40224
|
|
|
40225
40225
|
//#endregion
|
|
40226
|
-
export {
|
|
40226
|
+
export { Element, __commonJS$3 as __commonJS, __require$1 as __require, __toESM$3 as __toESM, addPnpmBuildDependendencies, be, box, cancel, confirm, create, detectSync, esm_exports, from, getUserAgent, group, installDependencies, intro, isCancel, log, multiselect, note, outro, packageManagerPrompt, parseCss, parseHtml, parseHtml$1, parseJson, parseScript, parseScript$1, parseSvelte, resolveCommand, select, serializeScript, spinner, stripAst, templates, text, up, walk_exports };
|
package/dist/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, __require, __toESM, addPnpmBuildDependendencies, be, create } from "./package-manager-
|
|
1
|
+
import { __commonJS, __require, __toESM, addPnpmBuildDependendencies, be, create } from "./package-manager-DYKbLpuq.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process$1 from "node:process";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A CLI for creating and updating SvelteKit projects",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"tinyexec": "^0.3.1",
|
|
39
39
|
"valibot": "^0.41.0",
|
|
40
40
|
"@sveltejs/addons": "0.0.0",
|
|
41
|
-
"@sveltejs/cli-core": "0.0.0",
|
|
42
41
|
"@sveltejs/clack-prompts": "0.9.1",
|
|
42
|
+
"@sveltejs/cli-core": "0.0.0",
|
|
43
43
|
"@sveltejs/create": "0.0.0"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|