sv 0.6.6 → 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/dist/bin.js +4 -4
- package/dist/bin.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{install-ClR4mYH4.js → install-BNk1yMP2.js} +170 -119
- package/dist/install-BNk1yMP2.js.map +1 -0
- package/dist/templates/demo/package.json +1 -0
- package/dist/templates/minimal/package.json +1 -0
- package/package.json +2 -2
- package/dist/install-ClR4mYH4.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1657,16 +1657,144 @@ const group = async (prompts, opts) => {
|
|
|
1657
1657
|
return results;
|
|
1658
1658
|
};
|
|
1659
1659
|
|
|
1660
|
+
function npmRun(agent) {
|
|
1661
|
+
return (args) => {
|
|
1662
|
+
if (args.length > 1) {
|
|
1663
|
+
return [agent, "run", args[0], "--", ...args.slice(1)];
|
|
1664
|
+
} else {
|
|
1665
|
+
return [agent, "run", args[0]];
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
function denoExecute() {
|
|
1670
|
+
return (args) => {
|
|
1671
|
+
return ["deno", "run", `npm:${args[0]}`, ...args.slice(1)];
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
const npm = {
|
|
1675
|
+
"agent": ["npm", 0],
|
|
1676
|
+
"run": npmRun("npm"),
|
|
1677
|
+
"install": ["npm", "i", 0],
|
|
1678
|
+
"frozen": ["npm", "ci"],
|
|
1679
|
+
"global": ["npm", "i", "-g", 0],
|
|
1680
|
+
"add": ["npm", "i", 0],
|
|
1681
|
+
"upgrade": ["npm", "update", 0],
|
|
1682
|
+
"upgrade-interactive": null,
|
|
1683
|
+
"execute": ["npx", 0],
|
|
1684
|
+
"execute-local": ["npx", 0],
|
|
1685
|
+
"uninstall": ["npm", "uninstall", 0],
|
|
1686
|
+
"global_uninstall": ["npm", "uninstall", "-g", 0]
|
|
1687
|
+
};
|
|
1688
|
+
const yarn = {
|
|
1689
|
+
"agent": ["yarn", 0],
|
|
1690
|
+
"run": ["yarn", "run", 0],
|
|
1691
|
+
"install": ["yarn", "install", 0],
|
|
1692
|
+
"frozen": ["yarn", "install", "--frozen-lockfile"],
|
|
1693
|
+
"global": ["yarn", "global", "add", 0],
|
|
1694
|
+
"add": ["yarn", "add", 0],
|
|
1695
|
+
"upgrade": ["yarn", "upgrade", 0],
|
|
1696
|
+
"upgrade-interactive": ["yarn", "upgrade-interactive", 0],
|
|
1697
|
+
"execute": ["npx", 0],
|
|
1698
|
+
"execute-local": ["yarn", "exec", 0],
|
|
1699
|
+
"uninstall": ["yarn", "remove", 0],
|
|
1700
|
+
"global_uninstall": ["yarn", "global", "remove", 0]
|
|
1701
|
+
};
|
|
1702
|
+
const yarnBerry = {
|
|
1703
|
+
...yarn,
|
|
1704
|
+
"frozen": ["yarn", "install", "--immutable"],
|
|
1705
|
+
"upgrade": ["yarn", "up", 0],
|
|
1706
|
+
"upgrade-interactive": ["yarn", "up", "-i", 0],
|
|
1707
|
+
"execute": ["yarn", "dlx", 0],
|
|
1708
|
+
"execute-local": ["yarn", "exec", 0],
|
|
1709
|
+
// Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821
|
|
1710
|
+
"global": ["npm", "i", "-g", 0],
|
|
1711
|
+
"global_uninstall": ["npm", "uninstall", "-g", 0]
|
|
1712
|
+
};
|
|
1713
|
+
const pnpm = {
|
|
1714
|
+
"agent": ["pnpm", 0],
|
|
1715
|
+
"run": ["pnpm", "run", 0],
|
|
1716
|
+
"install": ["pnpm", "i", 0],
|
|
1717
|
+
"frozen": ["pnpm", "i", "--frozen-lockfile"],
|
|
1718
|
+
"global": ["pnpm", "add", "-g", 0],
|
|
1719
|
+
"add": ["pnpm", "add", 0],
|
|
1720
|
+
"upgrade": ["pnpm", "update", 0],
|
|
1721
|
+
"upgrade-interactive": ["pnpm", "update", "-i", 0],
|
|
1722
|
+
"execute": ["pnpm", "dlx", 0],
|
|
1723
|
+
"execute-local": ["pnpm", "exec", 0],
|
|
1724
|
+
"uninstall": ["pnpm", "remove", 0],
|
|
1725
|
+
"global_uninstall": ["pnpm", "remove", "--global", 0]
|
|
1726
|
+
};
|
|
1727
|
+
const bun = {
|
|
1728
|
+
"agent": ["bun", 0],
|
|
1729
|
+
"run": ["bun", "run", 0],
|
|
1730
|
+
"install": ["bun", "install", 0],
|
|
1731
|
+
"frozen": ["bun", "install", "--frozen-lockfile"],
|
|
1732
|
+
"global": ["bun", "add", "-g", 0],
|
|
1733
|
+
"add": ["bun", "add", 0],
|
|
1734
|
+
"upgrade": ["bun", "update", 0],
|
|
1735
|
+
"upgrade-interactive": ["bun", "update", 0],
|
|
1736
|
+
"execute": ["bun", "x", 0],
|
|
1737
|
+
"execute-local": ["bun", "x", 0],
|
|
1738
|
+
"uninstall": ["bun", "remove", 0],
|
|
1739
|
+
"global_uninstall": ["bun", "remove", "-g", 0]
|
|
1740
|
+
};
|
|
1741
|
+
const deno = {
|
|
1742
|
+
"agent": ["deno", 0],
|
|
1743
|
+
"run": ["deno", "task", 0],
|
|
1744
|
+
"install": ["deno", "install", 0],
|
|
1745
|
+
"frozen": ["deno", "install", "--frozen"],
|
|
1746
|
+
"global": ["deno", "install", "-g", 0],
|
|
1747
|
+
"add": ["deno", "add", 0],
|
|
1748
|
+
"upgrade": ["deno", "outdated", "--update", 0],
|
|
1749
|
+
"upgrade-interactive": ["deno", "outdated", "--update", 0],
|
|
1750
|
+
"execute": denoExecute(),
|
|
1751
|
+
"execute-local": ["deno", "task", "--eval", 0],
|
|
1752
|
+
"uninstall": ["deno", "remove", 0],
|
|
1753
|
+
"global_uninstall": ["deno", "uninstall", "-g", 0]
|
|
1754
|
+
};
|
|
1755
|
+
const COMMANDS = {
|
|
1756
|
+
"npm": npm,
|
|
1757
|
+
"yarn": yarn,
|
|
1758
|
+
"yarn@berry": yarnBerry,
|
|
1759
|
+
"pnpm": pnpm,
|
|
1760
|
+
// pnpm v6.x or below
|
|
1761
|
+
"pnpm@6": {
|
|
1762
|
+
...pnpm,
|
|
1763
|
+
run: npmRun("pnpm")
|
|
1764
|
+
},
|
|
1765
|
+
"bun": bun,
|
|
1766
|
+
"deno": deno
|
|
1767
|
+
};
|
|
1768
|
+
function resolveCommand(agent, command, args) {
|
|
1769
|
+
const value = COMMANDS[agent][command];
|
|
1770
|
+
return constructCommand(value, args);
|
|
1771
|
+
}
|
|
1772
|
+
function constructCommand(value, args) {
|
|
1773
|
+
if (value == null)
|
|
1774
|
+
return null;
|
|
1775
|
+
const list = typeof value === "function" ? value(args) : value.flatMap((v) => {
|
|
1776
|
+
if (typeof v === "number")
|
|
1777
|
+
return args;
|
|
1778
|
+
return [v];
|
|
1779
|
+
});
|
|
1780
|
+
return {
|
|
1781
|
+
command: list[0],
|
|
1782
|
+
args: list.slice(1)
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1660
1786
|
const AGENTS = [
|
|
1661
1787
|
"npm",
|
|
1662
1788
|
"yarn",
|
|
1663
1789
|
"yarn@berry",
|
|
1664
1790
|
"pnpm",
|
|
1665
1791
|
"pnpm@6",
|
|
1666
|
-
"bun"
|
|
1792
|
+
"bun",
|
|
1793
|
+
"deno"
|
|
1667
1794
|
];
|
|
1668
1795
|
const LOCKS = {
|
|
1669
1796
|
"bun.lockb": "bun",
|
|
1797
|
+
"deno.lock": "deno",
|
|
1670
1798
|
"pnpm-lock.yaml": "pnpm",
|
|
1671
1799
|
"yarn.lock": "yarn",
|
|
1672
1800
|
"package-lock.json": "npm",
|
|
@@ -1739,110 +1867,6 @@ function fileExistsSync(filePath) {
|
|
|
1739
1867
|
return false;
|
|
1740
1868
|
}
|
|
1741
1869
|
|
|
1742
|
-
function npmRun(agent) {
|
|
1743
|
-
return (args) => {
|
|
1744
|
-
if (args.length > 1) {
|
|
1745
|
-
return [agent, "run", args[0], "--", ...args.slice(1)];
|
|
1746
|
-
} else {
|
|
1747
|
-
return [agent, "run", args[0]];
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
}
|
|
1751
|
-
const yarn = {
|
|
1752
|
-
"agent": ["yarn", 0],
|
|
1753
|
-
"run": ["yarn", "run", 0],
|
|
1754
|
-
"install": ["yarn", "install", 0],
|
|
1755
|
-
"frozen": ["yarn", "install", "--frozen-lockfile"],
|
|
1756
|
-
"global": ["yarn", "global", "add", 0],
|
|
1757
|
-
"add": ["yarn", "add", 0],
|
|
1758
|
-
"upgrade": ["yarn", "upgrade", 0],
|
|
1759
|
-
"upgrade-interactive": ["yarn", "upgrade-interactive", 0],
|
|
1760
|
-
"execute": ["npx", 0],
|
|
1761
|
-
"execute-local": ["yarn", "exec", 0],
|
|
1762
|
-
"uninstall": ["yarn", "remove", 0],
|
|
1763
|
-
"global_uninstall": ["yarn", "global", "remove", 0]
|
|
1764
|
-
};
|
|
1765
|
-
const pnpm = {
|
|
1766
|
-
"agent": ["pnpm", 0],
|
|
1767
|
-
"run": ["pnpm", "run", 0],
|
|
1768
|
-
"install": ["pnpm", "i", 0],
|
|
1769
|
-
"frozen": ["pnpm", "i", "--frozen-lockfile"],
|
|
1770
|
-
"global": ["pnpm", "add", "-g", 0],
|
|
1771
|
-
"add": ["pnpm", "add", 0],
|
|
1772
|
-
"upgrade": ["pnpm", "update", 0],
|
|
1773
|
-
"upgrade-interactive": ["pnpm", "update", "-i", 0],
|
|
1774
|
-
"execute": ["pnpm", "dlx", 0],
|
|
1775
|
-
"execute-local": ["pnpm", "exec", 0],
|
|
1776
|
-
"uninstall": ["pnpm", "remove", 0],
|
|
1777
|
-
"global_uninstall": ["pnpm", "remove", "--global", 0]
|
|
1778
|
-
};
|
|
1779
|
-
const bun = {
|
|
1780
|
-
"agent": ["bun", 0],
|
|
1781
|
-
"run": ["bun", "run", 0],
|
|
1782
|
-
"install": ["bun", "install", 0],
|
|
1783
|
-
"frozen": ["bun", "install", "--frozen-lockfile"],
|
|
1784
|
-
"global": ["bun", "add", "-g", 0],
|
|
1785
|
-
"add": ["bun", "add", 0],
|
|
1786
|
-
"upgrade": ["bun", "update", 0],
|
|
1787
|
-
"upgrade-interactive": ["bun", "update", 0],
|
|
1788
|
-
"execute": ["bun", "x", 0],
|
|
1789
|
-
"execute-local": ["bun", "x", 0],
|
|
1790
|
-
"uninstall": ["bun", "remove", 0],
|
|
1791
|
-
"global_uninstall": ["bun", "remove", "-g", 0]
|
|
1792
|
-
};
|
|
1793
|
-
const COMMANDS = {
|
|
1794
|
-
"npm": {
|
|
1795
|
-
"agent": ["npm", 0],
|
|
1796
|
-
"run": npmRun("npm"),
|
|
1797
|
-
"install": ["npm", "i", 0],
|
|
1798
|
-
"frozen": ["npm", "ci"],
|
|
1799
|
-
"global": ["npm", "i", "-g", 0],
|
|
1800
|
-
"add": ["npm", "i", 0],
|
|
1801
|
-
"upgrade": ["npm", "update", 0],
|
|
1802
|
-
"upgrade-interactive": null,
|
|
1803
|
-
"execute": ["npx", 0],
|
|
1804
|
-
"execute-local": ["npx", 0],
|
|
1805
|
-
"uninstall": ["npm", "uninstall", 0],
|
|
1806
|
-
"global_uninstall": ["npm", "uninstall", "-g", 0]
|
|
1807
|
-
},
|
|
1808
|
-
"yarn": yarn,
|
|
1809
|
-
"yarn@berry": {
|
|
1810
|
-
...yarn,
|
|
1811
|
-
"frozen": ["yarn", "install", "--immutable"],
|
|
1812
|
-
"upgrade": ["yarn", "up", 0],
|
|
1813
|
-
"upgrade-interactive": ["yarn", "up", "-i", 0],
|
|
1814
|
-
"execute": ["yarn", "dlx", 0],
|
|
1815
|
-
"execute-local": ["yarn", "exec", 0],
|
|
1816
|
-
// Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821
|
|
1817
|
-
"global": ["npm", "i", "-g", 0],
|
|
1818
|
-
"global_uninstall": ["npm", "uninstall", "-g", 0]
|
|
1819
|
-
},
|
|
1820
|
-
"pnpm": pnpm,
|
|
1821
|
-
// pnpm v6.x or below
|
|
1822
|
-
"pnpm@6": {
|
|
1823
|
-
...pnpm,
|
|
1824
|
-
run: npmRun("pnpm")
|
|
1825
|
-
},
|
|
1826
|
-
"bun": bun
|
|
1827
|
-
};
|
|
1828
|
-
function resolveCommand(agent, command, args) {
|
|
1829
|
-
const value = COMMANDS[agent][command];
|
|
1830
|
-
return constructCommand(value, args);
|
|
1831
|
-
}
|
|
1832
|
-
function constructCommand(value, args) {
|
|
1833
|
-
if (value == null)
|
|
1834
|
-
return null;
|
|
1835
|
-
const list = typeof value === "function" ? value(args) : value.flatMap((v) => {
|
|
1836
|
-
if (typeof v === "number")
|
|
1837
|
-
return args;
|
|
1838
|
-
return [v];
|
|
1839
|
-
});
|
|
1840
|
-
return {
|
|
1841
|
-
command: list[0],
|
|
1842
|
-
args: list.slice(1)
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
1870
|
const TESTING = process$1.env.NODE_ENV?.toLowerCase() === "test";
|
|
1847
1871
|
|
|
1848
1872
|
function absolute(input, root) {
|
|
@@ -35665,6 +35689,27 @@ function cloneNode(obj, parent) {
|
|
|
35665
35689
|
}
|
|
35666
35690
|
return cloned;
|
|
35667
35691
|
}
|
|
35692
|
+
function sourceOffset(inputCSS, position) {
|
|
35693
|
+
if (position && typeof position.offset !== "undefined") {
|
|
35694
|
+
return position.offset;
|
|
35695
|
+
}
|
|
35696
|
+
let column = 1;
|
|
35697
|
+
let line = 1;
|
|
35698
|
+
let offset = 0;
|
|
35699
|
+
for (let i = 0; i < inputCSS.length; i++) {
|
|
35700
|
+
if (line === position.line && column === position.column) {
|
|
35701
|
+
offset = i;
|
|
35702
|
+
break;
|
|
35703
|
+
}
|
|
35704
|
+
if (inputCSS[i] === "\n") {
|
|
35705
|
+
column = 1;
|
|
35706
|
+
line += 1;
|
|
35707
|
+
} else {
|
|
35708
|
+
column += 1;
|
|
35709
|
+
}
|
|
35710
|
+
}
|
|
35711
|
+
return offset;
|
|
35712
|
+
}
|
|
35668
35713
|
let Node$4 = class Node2 {
|
|
35669
35714
|
constructor(defaults = {}) {
|
|
35670
35715
|
this.raws = {};
|
|
@@ -35784,23 +35829,27 @@ let Node$4 = class Node2 {
|
|
|
35784
35829
|
let index2 = this.parent.index(this);
|
|
35785
35830
|
return this.parent.nodes[index2 + 1];
|
|
35786
35831
|
}
|
|
35787
|
-
positionBy(opts
|
|
35832
|
+
positionBy(opts) {
|
|
35788
35833
|
let pos = this.source.start;
|
|
35789
35834
|
if (opts.index) {
|
|
35790
|
-
pos = this.positionInside(opts.index
|
|
35835
|
+
pos = this.positionInside(opts.index);
|
|
35791
35836
|
} else if (opts.word) {
|
|
35792
|
-
stringRepresentation = this.
|
|
35837
|
+
let stringRepresentation = this.source.input.css.slice(
|
|
35838
|
+
sourceOffset(this.source.input.css, this.source.start),
|
|
35839
|
+
sourceOffset(this.source.input.css, this.source.end)
|
|
35840
|
+
);
|
|
35793
35841
|
let index2 = stringRepresentation.indexOf(opts.word);
|
|
35794
|
-
if (index2 !== -1) pos = this.positionInside(index2
|
|
35842
|
+
if (index2 !== -1) pos = this.positionInside(index2);
|
|
35795
35843
|
}
|
|
35796
35844
|
return pos;
|
|
35797
35845
|
}
|
|
35798
|
-
positionInside(index2
|
|
35799
|
-
let string = stringRepresentation || this.toString();
|
|
35846
|
+
positionInside(index2) {
|
|
35800
35847
|
let column = this.source.start.column;
|
|
35801
35848
|
let line = this.source.start.line;
|
|
35802
|
-
|
|
35803
|
-
|
|
35849
|
+
let offset = sourceOffset(this.source.input.css, this.source.start);
|
|
35850
|
+
let end = offset + index2;
|
|
35851
|
+
for (let i = offset; i < end; i++) {
|
|
35852
|
+
if (this.source.input.css[i] === "\n") {
|
|
35804
35853
|
column = 1;
|
|
35805
35854
|
line += 1;
|
|
35806
35855
|
} else {
|
|
@@ -35827,13 +35876,15 @@ let Node$4 = class Node2 {
|
|
|
35827
35876
|
line: start.line
|
|
35828
35877
|
};
|
|
35829
35878
|
if (opts.word) {
|
|
35830
|
-
let stringRepresentation = this.
|
|
35879
|
+
let stringRepresentation = this.source.input.css.slice(
|
|
35880
|
+
sourceOffset(this.source.input.css, this.source.start),
|
|
35881
|
+
sourceOffset(this.source.input.css, this.source.end)
|
|
35882
|
+
);
|
|
35831
35883
|
let index2 = stringRepresentation.indexOf(opts.word);
|
|
35832
35884
|
if (index2 !== -1) {
|
|
35833
|
-
start = this.positionInside(index2
|
|
35885
|
+
start = this.positionInside(index2);
|
|
35834
35886
|
end = this.positionInside(
|
|
35835
|
-
index2 + opts.word.length
|
|
35836
|
-
stringRepresentation
|
|
35887
|
+
index2 + opts.word.length
|
|
35837
35888
|
);
|
|
35838
35889
|
}
|
|
35839
35890
|
} else {
|
|
@@ -40267,7 +40318,7 @@ let NoWorkResult2 = noWorkResult;
|
|
|
40267
40318
|
let Root$2 = root;
|
|
40268
40319
|
let Processor$1 = class Processor {
|
|
40269
40320
|
constructor(plugins = []) {
|
|
40270
|
-
this.version = "8.4.
|
|
40321
|
+
this.version = "8.4.49";
|
|
40271
40322
|
this.plugins = this.normalize(plugins);
|
|
40272
40323
|
}
|
|
40273
40324
|
normalize(plugins) {
|
|
@@ -43289,4 +43340,4 @@ function orderAddons(addons, setupResults) {
|
|
|
43289
43340
|
}
|
|
43290
43341
|
|
|
43291
43342
|
export { AtRule2 as A, isCancel as B, confirm as C, createWorkspace as D, Element as E, setupAddons as F, note as G, select as H, text as I, packageManagerPrompt as J, applyAddons as K, installDependencies as L, formatFiles as M, spinner as N, getHighlighter as O, detectSync as P, getUserAgent as Q, group as R, resolveCommand as S, from as T, _function as _, parseScript as a, imports as b, common as c, dedent as d, exports as e, parseSvelte as f, array as g, addFromString as h, installAddon as i, index as j, kit as k, parseHtml$1 as l, parseHtml as m, parseCss as n, object as o, parseJson as p, pc as q, intro as r, outro as s, log as t, up as u, variables as v, walk$1 as w, cancel as x, box as y, multiselect as z };
|
|
43292
|
-
//# sourceMappingURL=install-
|
|
43343
|
+
//# sourceMappingURL=install-BNk1yMP2.js.map
|