sv 0.5.8 → 0.5.10
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 +83 -67
- package/dist/bin.js.map +1 -1
- package/dist/shared.json +1 -1
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -25,7 +25,7 @@ import require$$0$3 from 'events';
|
|
|
25
25
|
import { t as templates, c as create$2 } from './index-A89HFWzv.js';
|
|
26
26
|
|
|
27
27
|
var name = "sv";
|
|
28
|
-
var version = "0.5.
|
|
28
|
+
var version = "0.5.10";
|
|
29
29
|
var type = "module";
|
|
30
30
|
var description = "A CLI for creating and updating SvelteKit projects";
|
|
31
31
|
var license = "MIT";
|
|
@@ -10713,56 +10713,50 @@ function requireNamedTypes() {
|
|
|
10713
10713
|
})(namedTypes);
|
|
10714
10714
|
return namedTypes;
|
|
10715
10715
|
}
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
(
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
exports.use = use;
|
|
10761
|
-
exports.visit = visit;
|
|
10762
|
-
Object.assign(namedTypes_1.namedTypes, n);
|
|
10763
|
-
})(main$1);
|
|
10764
|
-
return main$1;
|
|
10765
|
-
}
|
|
10716
|
+
(function(exports) {
|
|
10717
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10718
|
+
exports.visit = exports.use = exports.Type = exports.someField = exports.PathVisitor = exports.Path = exports.NodePath = exports.namedTypes = exports.getSupertypeNames = exports.getFieldValue = exports.getFieldNames = exports.getBuilderName = exports.finalize = exports.eachField = exports.defineMethod = exports.builtInTypes = exports.builders = exports.astNodesAreEquivalent = void 0;
|
|
10719
|
+
var tslib_12 = require$$0;
|
|
10720
|
+
var fork_1 = tslib_12.__importDefault(requireFork());
|
|
10721
|
+
var es_proposals_1 = tslib_12.__importDefault(requireEsProposals());
|
|
10722
|
+
var jsx_1 = tslib_12.__importDefault(requireJsx());
|
|
10723
|
+
var flow_1 = tslib_12.__importDefault(requireFlow());
|
|
10724
|
+
var esprima_1 = tslib_12.__importDefault(requireEsprima$2());
|
|
10725
|
+
var babel_12 = tslib_12.__importDefault(requireBabel());
|
|
10726
|
+
var typescript_1 = tslib_12.__importDefault(requireTypescript());
|
|
10727
|
+
var namedTypes_1 = requireNamedTypes();
|
|
10728
|
+
Object.defineProperty(exports, "namedTypes", { enumerable: true, get: function() {
|
|
10729
|
+
return namedTypes_1.namedTypes;
|
|
10730
|
+
} });
|
|
10731
|
+
var _a2 = (0, fork_1.default)([
|
|
10732
|
+
// Feel free to add to or remove from this list of extension modules to
|
|
10733
|
+
// configure the precise type hierarchy that you need.
|
|
10734
|
+
es_proposals_1.default,
|
|
10735
|
+
jsx_1.default,
|
|
10736
|
+
flow_1.default,
|
|
10737
|
+
esprima_1.default,
|
|
10738
|
+
babel_12.default,
|
|
10739
|
+
typescript_1.default
|
|
10740
|
+
]), astNodesAreEquivalent = _a2.astNodesAreEquivalent, builders = _a2.builders, builtInTypes = _a2.builtInTypes, defineMethod = _a2.defineMethod, eachField = _a2.eachField, finalize = _a2.finalize, getBuilderName = _a2.getBuilderName, getFieldNames = _a2.getFieldNames, getFieldValue = _a2.getFieldValue, getSupertypeNames = _a2.getSupertypeNames, n = _a2.namedTypes, NodePath = _a2.NodePath, Path = _a2.Path, PathVisitor = _a2.PathVisitor, someField = _a2.someField, Type = _a2.Type, use = _a2.use, visit = _a2.visit;
|
|
10741
|
+
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
10742
|
+
exports.builders = builders;
|
|
10743
|
+
exports.builtInTypes = builtInTypes;
|
|
10744
|
+
exports.defineMethod = defineMethod;
|
|
10745
|
+
exports.eachField = eachField;
|
|
10746
|
+
exports.finalize = finalize;
|
|
10747
|
+
exports.getBuilderName = getBuilderName;
|
|
10748
|
+
exports.getFieldNames = getFieldNames;
|
|
10749
|
+
exports.getFieldValue = getFieldValue;
|
|
10750
|
+
exports.getSupertypeNames = getSupertypeNames;
|
|
10751
|
+
exports.NodePath = NodePath;
|
|
10752
|
+
exports.Path = Path;
|
|
10753
|
+
exports.PathVisitor = PathVisitor;
|
|
10754
|
+
exports.someField = someField;
|
|
10755
|
+
exports.Type = Type;
|
|
10756
|
+
exports.use = use;
|
|
10757
|
+
exports.visit = visit;
|
|
10758
|
+
Object.assign(namedTypes_1.namedTypes, n);
|
|
10759
|
+
})(main$1);
|
|
10766
10760
|
var sourceMap$1 = {};
|
|
10767
10761
|
var sourceMapGenerator$1 = {};
|
|
10768
10762
|
var base64Vlq$1 = {};
|
|
@@ -12533,7 +12527,7 @@ function requireUtil() {
|
|
|
12533
12527
|
util$7.isTrailingCommaEnabled = util$7.getParentExportDeclaration = util$7.isExportDeclaration = util$7.fixFaultyLocations = util$7.getTrueLoc = util$7.composeSourceMaps = util$7.copyPos = util$7.comparePos = util$7.getUnionOfKeys = util$7.getOption = util$7.isBrowser = util$7.getLineTerminator = void 0;
|
|
12534
12528
|
var tslib_12 = require$$0;
|
|
12535
12529
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
12536
|
-
var types2 = tslib_12.__importStar(
|
|
12530
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
12537
12531
|
var n = types2.namedTypes;
|
|
12538
12532
|
var source_map_1 = tslib_12.__importDefault(requireSourceMap());
|
|
12539
12533
|
var SourceMapConsumer2 = source_map_1.default.SourceMapConsumer;
|
|
@@ -33963,7 +33957,7 @@ function requireComments() {
|
|
|
33963
33957
|
comments.printComments = comments.attach = void 0;
|
|
33964
33958
|
var tslib_12 = require$$0;
|
|
33965
33959
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
33966
|
-
var types2 = tslib_12.__importStar(
|
|
33960
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
33967
33961
|
var n = types2.namedTypes;
|
|
33968
33962
|
var isArray = types2.builtInTypes.array;
|
|
33969
33963
|
var isObject = types2.builtInTypes.object;
|
|
@@ -34213,7 +34207,7 @@ function requireParser() {
|
|
|
34213
34207
|
parser$1.parse = void 0;
|
|
34214
34208
|
var tslib_12 = require$$0;
|
|
34215
34209
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
34216
|
-
var types2 = tslib_12.__importStar(
|
|
34210
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
34217
34211
|
var b = types2.builders;
|
|
34218
34212
|
var isObject = types2.builtInTypes.object;
|
|
34219
34213
|
var isArray = types2.builtInTypes.array;
|
|
@@ -34404,7 +34398,7 @@ function requireFastPath() {
|
|
|
34404
34398
|
Object.defineProperty(fastPath, "__esModule", { value: true });
|
|
34405
34399
|
var tslib_12 = require$$0;
|
|
34406
34400
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
34407
|
-
var types2 = tslib_12.__importStar(
|
|
34401
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
34408
34402
|
var util2 = tslib_12.__importStar(requireUtil());
|
|
34409
34403
|
var n = types2.namedTypes;
|
|
34410
34404
|
var isArray = types2.builtInTypes.array;
|
|
@@ -34841,7 +34835,7 @@ function requirePatcher() {
|
|
|
34841
34835
|
var tslib_12 = require$$0;
|
|
34842
34836
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
34843
34837
|
var linesModule = tslib_12.__importStar(requireLines());
|
|
34844
|
-
var types2 = tslib_12.__importStar(
|
|
34838
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
34845
34839
|
var Printable = types2.namedTypes.Printable;
|
|
34846
34840
|
var Expression = types2.namedTypes.Expression;
|
|
34847
34841
|
var ReturnStatement = types2.namedTypes.ReturnStatement;
|
|
@@ -35153,7 +35147,7 @@ function requirePrinter() {
|
|
|
35153
35147
|
printer.Printer = void 0;
|
|
35154
35148
|
var tslib_12 = require$$0;
|
|
35155
35149
|
var tiny_invariant_1 = tslib_12.__importDefault(requireTinyInvariant_cjs());
|
|
35156
|
-
var types2 = tslib_12.__importStar(
|
|
35150
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
35157
35151
|
var comments_1 = requireComments();
|
|
35158
35152
|
var fast_path_1 = tslib_12.__importDefault(requireFastPath());
|
|
35159
35153
|
var lines_1 = requireLines();
|
|
@@ -37343,14 +37337,14 @@ function requirePrinter() {
|
|
|
37343
37337
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
37344
37338
|
var tslib_12 = require$$0;
|
|
37345
37339
|
var fs_1 = tslib_12.__importDefault(require$$1$1);
|
|
37346
|
-
var types2 = tslib_12.__importStar(
|
|
37340
|
+
var types2 = tslib_12.__importStar(main$1);
|
|
37347
37341
|
exports.types = types2;
|
|
37348
37342
|
var parser_1 = requireParser();
|
|
37349
37343
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
37350
37344
|
return parser_1.parse;
|
|
37351
37345
|
} });
|
|
37352
37346
|
var printer_1 = requirePrinter();
|
|
37353
|
-
var ast_types_1 =
|
|
37347
|
+
var ast_types_1 = main$1;
|
|
37354
37348
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
37355
37349
|
return ast_types_1.visit;
|
|
37356
37350
|
} });
|
|
@@ -45890,6 +45884,14 @@ function typeAnnotateExpression(node, type) {
|
|
|
45890
45884
|
};
|
|
45891
45885
|
return expression;
|
|
45892
45886
|
}
|
|
45887
|
+
function satisfiesExpression(node, type) {
|
|
45888
|
+
const expression = {
|
|
45889
|
+
type: "TSSatisfiesExpression",
|
|
45890
|
+
expression: node,
|
|
45891
|
+
typeAnnotation: { type: "TSTypeReference", typeName: { type: "Identifier", name: type } }
|
|
45892
|
+
};
|
|
45893
|
+
return expression;
|
|
45894
|
+
}
|
|
45893
45895
|
function createSpreadElement(expression) {
|
|
45894
45896
|
return {
|
|
45895
45897
|
type: "SpreadElement",
|
|
@@ -45974,6 +45976,7 @@ var common = /* @__PURE__ */ Object.freeze({
|
|
|
45974
45976
|
expressionStatement,
|
|
45975
45977
|
hasNode,
|
|
45976
45978
|
hasTypeProp,
|
|
45979
|
+
satisfiesExpression,
|
|
45977
45980
|
statementFromString,
|
|
45978
45981
|
typeAnnotateExpression
|
|
45979
45982
|
});
|
|
@@ -51460,13 +51463,16 @@ var tailwindcss = defineAdder({
|
|
|
51460
51463
|
const rootExport = object.createEmpty();
|
|
51461
51464
|
if (typescript) {
|
|
51462
51465
|
imports.addNamed(ast, "tailwindcss", { Config: "Config" }, true);
|
|
51463
|
-
root = common.
|
|
51466
|
+
root = common.satisfiesExpression(rootExport, "Config");
|
|
51464
51467
|
}
|
|
51465
51468
|
const { astNode: exportDeclaration, value: node } = exports.defaultExport(
|
|
51466
51469
|
ast,
|
|
51467
51470
|
root ?? rootExport
|
|
51468
51471
|
);
|
|
51469
|
-
const config = node.type === "
|
|
51472
|
+
const config = node.type === "TSSatisfiesExpression" ? node.expression : node;
|
|
51473
|
+
if (config.type !== "ObjectExpression") {
|
|
51474
|
+
throw new Error(`Unexpected tailwind config shape: ${config.type}`);
|
|
51475
|
+
}
|
|
51470
51476
|
if (!typescript) {
|
|
51471
51477
|
common.addJsDocTypeComment(exportDeclaration, "import('tailwindcss').Config");
|
|
51472
51478
|
}
|
|
@@ -51497,12 +51503,16 @@ var tailwindcss = defineAdder({
|
|
|
51497
51503
|
{
|
|
51498
51504
|
name: () => "src/app.css",
|
|
51499
51505
|
content: ({ content }) => {
|
|
51500
|
-
const { ast, generateCode } = parseCss(content);
|
|
51501
51506
|
const layerImports = ["base", "components", "utilities"].map(
|
|
51502
|
-
(layer) => `
|
|
51507
|
+
(layer) => `tailwindcss/${layer}`
|
|
51503
51508
|
);
|
|
51509
|
+
if (layerImports.every((i) => content.includes(i))) {
|
|
51510
|
+
return content;
|
|
51511
|
+
}
|
|
51512
|
+
const { ast, generateCode } = parseCss(content);
|
|
51504
51513
|
const originalFirst = ast.first;
|
|
51505
|
-
const
|
|
51514
|
+
const specifiers = layerImports.map((i) => `'${i}'`);
|
|
51515
|
+
const nodes = addImports(ast, specifiers);
|
|
51506
51516
|
if (originalFirst !== ast.first && originalFirst?.type === "atrule" && originalFirst.name === "import") {
|
|
51507
51517
|
originalFirst.raws.before = "\n";
|
|
51508
51518
|
}
|
|
@@ -51720,7 +51730,8 @@ async function installDependencies(agent, cwd) {
|
|
|
51720
51730
|
spinner$1.start("Installing dependencies...");
|
|
51721
51731
|
try {
|
|
51722
51732
|
const { command, args } = constructCommand(COMMANDS[agent].install, []);
|
|
51723
|
-
await be(command, args, { nodeOptions: { cwd } });
|
|
51733
|
+
const { stderr } = await be(command, args, { nodeOptions: { cwd } });
|
|
51734
|
+
if (stderr) throw new Error(stderr);
|
|
51724
51735
|
spinner$1.stop("Successfully installed dependencies");
|
|
51725
51736
|
} catch (error) {
|
|
51726
51737
|
spinner$1.stop("Failed to install dependencies", 2);
|
|
@@ -55563,6 +55574,7 @@ async function runAdders({
|
|
|
55563
55574
|
);
|
|
55564
55575
|
const details = adderDetails.concat(commDetails);
|
|
55565
55576
|
details.sort((a, b) => {
|
|
55577
|
+
if (!a.dependsOn && !b.dependsOn) return 0;
|
|
55566
55578
|
if (!a.dependsOn) return -1;
|
|
55567
55579
|
if (!b.dependsOn) return 1;
|
|
55568
55580
|
return a.dependsOn.includes(b.id) ? 1 : b.dependsOn.includes(a.id) ? -1 : 0;
|
|
@@ -55588,7 +55600,10 @@ async function runAdders({
|
|
|
55588
55600
|
);
|
|
55589
55601
|
if (workspace.packageManager === "npm") args.unshift("--yes");
|
|
55590
55602
|
try {
|
|
55591
|
-
await be(command, args, {
|
|
55603
|
+
const { stderr } = await be(command, args, {
|
|
55604
|
+
nodeOptions: { cwd: workspace.cwd, stdio: script.stdio }
|
|
55605
|
+
});
|
|
55606
|
+
if (stderr) throw new Error(stderr);
|
|
55592
55607
|
} catch (error) {
|
|
55593
55608
|
const typedError = error;
|
|
55594
55609
|
throw new Error(
|
|
@@ -55707,10 +55722,11 @@ const create = new Command("create").description("scaffolds a new SvelteKit proj
|
|
|
55707
55722
|
if (!packageManager) {
|
|
55708
55723
|
initialSteps.push(`${i++}: ${highlight(`${pm} install`)}`);
|
|
55709
55724
|
}
|
|
55725
|
+
const pmRun = pm === "npm" ? "npm run dev --" : `${pm} dev`;
|
|
55710
55726
|
const steps = [
|
|
55711
55727
|
...initialSteps,
|
|
55712
55728
|
`${i++}: ${highlight('git init && git add -A && git commit -m "Initial commit"')} (optional)`,
|
|
55713
|
-
`${i++}: ${highlight(`${
|
|
55729
|
+
`${i++}: ${highlight(`${pmRun} --open`)}`,
|
|
55714
55730
|
"",
|
|
55715
55731
|
`To close the dev server, hit ${highlight("Ctrl-C")}`,
|
|
55716
55732
|
"",
|