sv 0.9.13 → 0.9.15
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 +18 -18
- package/dist/{create-Bt2-1pFJ.js → create-BOEKhcVU.js} +268 -279
- package/dist/{install-b9th3u8C.js → install-BoYywMIH.js} +243 -163
- package/dist/lib/index.d.ts +121 -8
- package/dist/lib/index.js +2 -2
- package/dist/lib/testing.js +1 -1
- package/dist/shared.json +12 -4
- package/dist/templates/demo/files.types=checkjs.json +4 -4
- package/dist/templates/demo/files.types=none.json +4 -4
- package/dist/templates/demo/files.types=typescript.json +4 -4
- package/dist/templates/demo/package.json +3 -3
- package/dist/templates/library/package.json +5 -5
- package/dist/templates/minimal/package.json +3 -3
- package/package.json +3 -3
- /package/dist/templates/demo/assets/src/{app.css → routes/layout.css} +0 -0
|
@@ -4579,7 +4579,7 @@ function createOptionBuilder(options) {
|
|
|
4579
4579
|
}
|
|
4580
4580
|
|
|
4581
4581
|
//#endregion
|
|
4582
|
-
//#region ../../node_modules/.pnpm/dedent@1.
|
|
4582
|
+
//#region ../../node_modules/.pnpm/dedent@1.7.0/node_modules/dedent/dist/dedent.mjs
|
|
4583
4583
|
function ownKeys(object, enumerableOnly) {
|
|
4584
4584
|
var keys = Object.keys(object);
|
|
4585
4585
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -4633,13 +4633,16 @@ function createDedent(options) {
|
|
|
4633
4633
|
return dedent$2;
|
|
4634
4634
|
function dedent$2(strings, ...values) {
|
|
4635
4635
|
const raw = typeof strings === "string" ? [strings] : strings.raw;
|
|
4636
|
-
const { escapeSpecialCharacters = Array.isArray(strings), trimWhitespace = true } = options;
|
|
4636
|
+
const { alignValues = false, escapeSpecialCharacters = Array.isArray(strings), trimWhitespace = true } = options;
|
|
4637
4637
|
let result = "";
|
|
4638
4638
|
for (let i$1 = 0; i$1 < raw.length; i$1++) {
|
|
4639
4639
|
let next = raw[i$1];
|
|
4640
4640
|
if (escapeSpecialCharacters) next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{");
|
|
4641
4641
|
result += next;
|
|
4642
|
-
if (i$1 < values.length)
|
|
4642
|
+
if (i$1 < values.length) {
|
|
4643
|
+
const value = alignValues ? alignValue(values[i$1], result) : values[i$1];
|
|
4644
|
+
result += value;
|
|
4645
|
+
}
|
|
4643
4646
|
}
|
|
4644
4647
|
const lines = result.split("\n");
|
|
4645
4648
|
let mindent = null;
|
|
@@ -4660,6 +4663,18 @@ function createDedent(options) {
|
|
|
4660
4663
|
return result;
|
|
4661
4664
|
}
|
|
4662
4665
|
}
|
|
4666
|
+
/**
|
|
4667
|
+
* Adjusts the indentation of a multi-line interpolated value to match the current line.
|
|
4668
|
+
*/
|
|
4669
|
+
function alignValue(value, precedingText) {
|
|
4670
|
+
if (typeof value !== "string" || !value.includes("\n")) return value;
|
|
4671
|
+
const indentMatch = precedingText.slice(precedingText.lastIndexOf("\n") + 1).match(/^(\s+)/);
|
|
4672
|
+
if (indentMatch) {
|
|
4673
|
+
const indent$2 = indentMatch[1];
|
|
4674
|
+
return value.replace(/\n/g, `\n${indent$2}`);
|
|
4675
|
+
}
|
|
4676
|
+
return value;
|
|
4677
|
+
}
|
|
4663
4678
|
|
|
4664
4679
|
//#endregion
|
|
4665
4680
|
//#region ../core/utils.ts
|
|
@@ -4700,18 +4715,19 @@ function isVersionUnsupportedBelow(versionStr, belowStr) {
|
|
|
4700
4715
|
}
|
|
4701
4716
|
|
|
4702
4717
|
//#endregion
|
|
4703
|
-
//#region ../../node_modules/.pnpm/zimmerframe@1.1.
|
|
4718
|
+
//#region ../../node_modules/.pnpm/zimmerframe@1.1.4/node_modules/zimmerframe/src/walk.js
|
|
4719
|
+
/** @import { Context, Visitor, Visitors } from './types.js' */
|
|
4704
4720
|
/**
|
|
4705
|
-
* @template {{type: string}} T
|
|
4721
|
+
* @template {{ type: string }} T
|
|
4706
4722
|
* @template {Record<string, any> | null} U
|
|
4707
4723
|
* @param {T} node
|
|
4708
4724
|
* @param {U} state
|
|
4709
|
-
* @param {
|
|
4725
|
+
* @param {Visitors<T, U>} visitors
|
|
4710
4726
|
*/
|
|
4711
4727
|
function walk(node, state, visitors) {
|
|
4712
4728
|
const universal = visitors._;
|
|
4713
4729
|
let stopped = false;
|
|
4714
|
-
/** @type {
|
|
4730
|
+
/** @type {Visitor<T, U, T>} _ */
|
|
4715
4731
|
function default_visitor(_$1, { next, state: state$1 }) {
|
|
4716
4732
|
next(state$1);
|
|
4717
4733
|
}
|
|
@@ -4728,7 +4744,7 @@ function walk(node, state, visitors) {
|
|
|
4728
4744
|
let result;
|
|
4729
4745
|
/** @type {Record<string, any>} */
|
|
4730
4746
|
const mutations = {};
|
|
4731
|
-
/** @type {
|
|
4747
|
+
/** @type {Context<T, U>} */
|
|
4732
4748
|
const context = {
|
|
4733
4749
|
path: path$2,
|
|
4734
4750
|
state: state$1,
|
|
@@ -4740,13 +4756,19 @@ function walk(node, state, visitors) {
|
|
|
4740
4756
|
if (child_node && typeof child_node === "object") if (Array.isArray(child_node)) {
|
|
4741
4757
|
/** @type {Record<number, T>} */
|
|
4742
4758
|
const array_mutations = {};
|
|
4743
|
-
|
|
4759
|
+
const len = child_node.length;
|
|
4760
|
+
let mutated = false;
|
|
4761
|
+
for (let i$1 = 0; i$1 < len; i$1++) {
|
|
4762
|
+
const node$2 = child_node[i$1];
|
|
4744
4763
|
if (node$2 && typeof node$2 === "object") {
|
|
4745
4764
|
const result$1 = visit$6(node$2, path$2, next_state);
|
|
4746
|
-
if (result$1)
|
|
4765
|
+
if (result$1) {
|
|
4766
|
+
array_mutations[i$1] = result$1;
|
|
4767
|
+
mutated = true;
|
|
4768
|
+
}
|
|
4747
4769
|
}
|
|
4748
|
-
}
|
|
4749
|
-
if (
|
|
4770
|
+
}
|
|
4771
|
+
if (mutated) mutations[key] = child_node.map((node$2, i$1) => array_mutations[i$1] ?? node$2);
|
|
4750
4772
|
} else {
|
|
4751
4773
|
const result$1 = visit$6(child_node, path$2, next_state);
|
|
4752
4774
|
if (result$1) mutations[key] = result$1;
|
|
@@ -6979,12 +7001,6 @@ const attributeNames = new Map([
|
|
|
6979
7001
|
|
|
6980
7002
|
//#endregion
|
|
6981
7003
|
//#region ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.js
|
|
6982
|
-
/**
|
|
6983
|
-
* Mixed-case SVG and MathML tags & attributes
|
|
6984
|
-
* recognized by the HTML parser.
|
|
6985
|
-
*
|
|
6986
|
-
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
6987
|
-
*/
|
|
6988
7004
|
const unencodedElements = new Set([
|
|
6989
7005
|
"style",
|
|
6990
7006
|
"script",
|
|
@@ -14179,8 +14195,6 @@ function encode(decoded) {
|
|
|
14179
14195
|
|
|
14180
14196
|
//#endregion
|
|
14181
14197
|
//#region ../../node_modules/.pnpm/esrap@1.4.9/node_modules/esrap/src/index.js
|
|
14182
|
-
/** @import { TSESTree } from '@typescript-eslint/types' */
|
|
14183
|
-
/** @import { Command, PrintOptions, State } from './types' */
|
|
14184
14198
|
/** @type {(str: string) => string} str */
|
|
14185
14199
|
let btoa$2 = () => {
|
|
14186
14200
|
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
@@ -19348,54 +19362,32 @@ function tokenizer(input, options) {
|
|
|
19348
19362
|
}
|
|
19349
19363
|
|
|
19350
19364
|
//#endregion
|
|
19351
|
-
//#region ../../node_modules/.pnpm/@sveltejs+acorn-typescript@1.0.
|
|
19365
|
+
//#region ../../node_modules/.pnpm/@sveltejs+acorn-typescript@1.0.7_acorn@8.15.0/node_modules/@sveltejs/acorn-typescript/index.js
|
|
19352
19366
|
var startsExpr = true;
|
|
19353
19367
|
function kwLike(_name, options = {}) {
|
|
19354
19368
|
return new TokenType("name", options);
|
|
19355
19369
|
}
|
|
19356
19370
|
var acornTypeScriptMap = /* @__PURE__ */ new WeakMap();
|
|
19371
|
+
var keywordTypeValues = Object.values(keywords);
|
|
19357
19372
|
function generateAcornTypeScript(_acorn) {
|
|
19358
19373
|
const acorn = _acorn.Parser.acorn || _acorn;
|
|
19359
19374
|
let acornTypeScript = acornTypeScriptMap.get(acorn);
|
|
19360
19375
|
if (!acornTypeScript) {
|
|
19361
19376
|
let tokenIsLiteralPropertyName = function(token) {
|
|
19362
|
-
return
|
|
19363
|
-
...[
|
|
19364
|
-
types$1.name,
|
|
19365
|
-
types$1.string,
|
|
19366
|
-
types$1.num
|
|
19367
|
-
],
|
|
19368
|
-
...Object.values(keywords),
|
|
19369
|
-
...Object.values(tsKwTokenType)
|
|
19370
|
-
].includes(token);
|
|
19377
|
+
return token === types$1.name || token === types$1.string || token === types$1.num || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token);
|
|
19371
19378
|
}, tokenIsKeywordOrIdentifier = function(token) {
|
|
19372
|
-
return
|
|
19373
|
-
...[types$1.name],
|
|
19374
|
-
...Object.values(keywords),
|
|
19375
|
-
...Object.values(tsKwTokenType)
|
|
19376
|
-
].includes(token);
|
|
19379
|
+
return token === types$1.name || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token);
|
|
19377
19380
|
}, tokenIsIdentifier = function(token) {
|
|
19378
|
-
return
|
|
19381
|
+
return token === types$1.name || tsKwTokenTypeValues.includes(token);
|
|
19379
19382
|
}, tokenIsTSDeclarationStart = function(token) {
|
|
19380
|
-
return
|
|
19381
|
-
tsKwTokenType.abstract,
|
|
19382
|
-
tsKwTokenType.declare,
|
|
19383
|
-
tsKwTokenType.enum,
|
|
19384
|
-
tsKwTokenType.module,
|
|
19385
|
-
tsKwTokenType.namespace,
|
|
19386
|
-
tsKwTokenType.interface,
|
|
19387
|
-
tsKwTokenType.type
|
|
19388
|
-
].includes(token);
|
|
19383
|
+
return token === tsKwTokenType.abstract || token === tsKwTokenType.declare || token === tsKwTokenType.enum || token === tsKwTokenType.module || token === tsKwTokenType.namespace || token === tsKwTokenType.interface || token === tsKwTokenType.type;
|
|
19389
19384
|
}, tokenIsTSTypeOperator = function(token) {
|
|
19390
|
-
return
|
|
19391
|
-
tsKwTokenType.keyof,
|
|
19392
|
-
tsKwTokenType.readonly,
|
|
19393
|
-
tsKwTokenType.unique
|
|
19394
|
-
].includes(token);
|
|
19385
|
+
return token === tsKwTokenType.keyof || token === tsKwTokenType.readonly || token === tsKwTokenType.unique;
|
|
19395
19386
|
}, tokenIsTemplate = function(token) {
|
|
19396
19387
|
return token === types$1.invalidTemplate;
|
|
19397
19388
|
};
|
|
19398
19389
|
const tsKwTokenType = generateTsKwTokenType();
|
|
19390
|
+
const tsKwTokenTypeValues = Object.values(tsKwTokenType);
|
|
19399
19391
|
const tsTokenType = generateTsTokenType();
|
|
19400
19392
|
const tsTokenContext = generateTsTokenContext();
|
|
19401
19393
|
const tsKeywordsRegExp = /* @__PURE__ */ new RegExp(`^(?:${Object.keys(tsKwTokenType).join("|")})$`);
|
|
@@ -19548,7 +19540,6 @@ var TypeScriptError = {
|
|
|
19548
19540
|
InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",
|
|
19549
19541
|
InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
|
|
19550
19542
|
MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
|
|
19551
|
-
MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.",
|
|
19552
19543
|
NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
|
|
19553
19544
|
NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
|
|
19554
19545
|
OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
|
|
@@ -20442,7 +20433,7 @@ function tsPlugin(options) {
|
|
|
20442
20433
|
});
|
|
20443
20434
|
}
|
|
20444
20435
|
atPossibleAsyncArrow(base) {
|
|
20445
|
-
return base.type === "Identifier" && base.name === "async" && this.
|
|
20436
|
+
return base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.potentialArrowAt;
|
|
20446
20437
|
}
|
|
20447
20438
|
tsIsIdentifier() {
|
|
20448
20439
|
return tokenIsIdentifier(this.type);
|
|
@@ -20977,7 +20968,7 @@ function tsPlugin(options) {
|
|
|
20977
20968
|
}
|
|
20978
20969
|
tsParseBindingListForSignature() {
|
|
20979
20970
|
return super.parseBindingList(tt.parenR, true, true).map((pattern) => {
|
|
20980
|
-
if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") this.raise(pattern.start, TypeScriptError.UnsupportedSignatureParameterKind(pattern.type));
|
|
20971
|
+
if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") this.raise(pattern.start, TypeScriptError.UnsupportedSignatureParameterKind({ type: pattern.type }));
|
|
20981
20972
|
return pattern;
|
|
20982
20973
|
});
|
|
20983
20974
|
}
|
|
@@ -21224,19 +21215,11 @@ function tsPlugin(options) {
|
|
|
21224
21215
|
const node = this.startNode();
|
|
21225
21216
|
node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
|
|
21226
21217
|
let seenOptionalElement = false;
|
|
21227
|
-
let labeledElements = null;
|
|
21228
21218
|
node.elementTypes.forEach((elementNode) => {
|
|
21229
21219
|
const { type } = elementNode;
|
|
21230
21220
|
if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) this.raise(elementNode.start, TypeScriptError.OptionalTypeBeforeRequired);
|
|
21231
21221
|
seenOptionalElement ||= type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType";
|
|
21232
|
-
|
|
21233
|
-
if (type === "TSRestType") {
|
|
21234
|
-
elementNode = elementNode.typeAnnotation;
|
|
21235
|
-
checkType = elementNode.type;
|
|
21236
|
-
}
|
|
21237
|
-
const isLabeled = checkType === "TSNamedTupleMember";
|
|
21238
|
-
labeledElements ??= isLabeled;
|
|
21239
|
-
if (labeledElements !== isLabeled) this.raise(elementNode.start, TypeScriptError.MixedLabeledAndUnlabeledElements);
|
|
21222
|
+
if (type === "TSRestType") elementNode = elementNode.typeAnnotation;
|
|
21240
21223
|
});
|
|
21241
21224
|
return this.finishNode(node, "TSTupleType");
|
|
21242
21225
|
}
|
|
@@ -22052,7 +22035,8 @@ function tsPlugin(options) {
|
|
|
22052
22035
|
this.importOrExportOuterKind = void 0;
|
|
22053
22036
|
return this.finishNode(decl$1, "TSNamespaceExportDeclaration");
|
|
22054
22037
|
} else {
|
|
22055
|
-
|
|
22038
|
+
const lookahead2 = this.lookahead(2).type;
|
|
22039
|
+
if (this.ts_isContextualWithState(enterHead, tokTypes2.type) && (lookahead2 === tt.braceL || lookahead2 === tt.star)) {
|
|
22056
22040
|
this.next();
|
|
22057
22041
|
this.importOrExportOuterKind = "type";
|
|
22058
22042
|
node.exportKind = "type";
|
|
@@ -22109,6 +22093,7 @@ function tsPlugin(options) {
|
|
|
22109
22093
|
return node.expression;
|
|
22110
22094
|
}
|
|
22111
22095
|
toAssignableList(exprList, isBinding) {
|
|
22096
|
+
if (!exprList) exprList = [];
|
|
22112
22097
|
for (let i$1 = 0; i$1 < exprList.length; i$1++) {
|
|
22113
22098
|
const expr = exprList[i$1];
|
|
22114
22099
|
if (expr?.type === "TSTypeCastExpression") exprList[i$1] = this.typeCastToParameter(expr);
|
|
@@ -22569,7 +22554,7 @@ function tsPlugin(options) {
|
|
|
22569
22554
|
accessibility = modified.accessibility;
|
|
22570
22555
|
override = modified.override;
|
|
22571
22556
|
readonly = modified.readonly;
|
|
22572
|
-
if (allowModifiers === false && (accessibility || readonly || override)) this.raise(startLoc.
|
|
22557
|
+
if (allowModifiers === false && (accessibility || readonly || override)) this.raise(startLoc.column, TypeScriptError.UnexpectedParameterModifier);
|
|
22573
22558
|
}
|
|
22574
22559
|
const left = this.parseMaybeDefault(startPos, startLoc);
|
|
22575
22560
|
this.parseBindingListItem(left);
|
|
@@ -30019,7 +30004,7 @@ function serializeYaml(data$1) {
|
|
|
30019
30004
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
30020
30005
|
|
|
30021
30006
|
//#endregion
|
|
30022
|
-
//#region ../../node_modules/.pnpm/magic-string@0.30.
|
|
30007
|
+
//#region ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
|
|
30023
30008
|
var BitSet = class BitSet {
|
|
30024
30009
|
constructor(arg) {
|
|
30025
30010
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -31484,195 +31469,37 @@ function constructCommand(value, args) {
|
|
|
31484
31469
|
}
|
|
31485
31470
|
|
|
31486
31471
|
//#endregion
|
|
31487
|
-
//#region
|
|
31488
|
-
|
|
31489
|
-
|
|
31490
|
-
|
|
31491
|
-
"yarn@berry",
|
|
31492
|
-
"pnpm",
|
|
31493
|
-
"pnpm@6",
|
|
31494
|
-
"bun",
|
|
31495
|
-
"deno"
|
|
31496
|
-
];
|
|
31497
|
-
const LOCKS = {
|
|
31498
|
-
"bun.lock": "bun",
|
|
31499
|
-
"bun.lockb": "bun",
|
|
31500
|
-
"deno.lock": "deno",
|
|
31501
|
-
"pnpm-lock.yaml": "pnpm",
|
|
31502
|
-
"yarn.lock": "yarn",
|
|
31503
|
-
"package-lock.json": "npm",
|
|
31504
|
-
"npm-shrinkwrap.json": "npm"
|
|
31505
|
-
};
|
|
31506
|
-
|
|
31507
|
-
//#endregion
|
|
31508
|
-
//#region ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs
|
|
31509
|
-
const GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
|
|
31510
|
-
var QuansyncError = class extends Error {
|
|
31511
|
-
constructor(message = "Unexpected promise in sync context") {
|
|
31512
|
-
super(message);
|
|
31513
|
-
this.name = "QuansyncError";
|
|
31514
|
-
}
|
|
31515
|
-
};
|
|
31516
|
-
function isThenable(value) {
|
|
31517
|
-
return value && typeof value === "object" && typeof value.then === "function";
|
|
31518
|
-
}
|
|
31519
|
-
function isQuansyncGenerator(value) {
|
|
31520
|
-
return value && typeof value === "object" && typeof value[Symbol.iterator] === "function" && "__quansync" in value;
|
|
31521
|
-
}
|
|
31522
|
-
function fromObject(options) {
|
|
31523
|
-
const generator = function* (...args) {
|
|
31524
|
-
if (yield GET_IS_ASYNC) return yield options.async.apply(this, args);
|
|
31525
|
-
return options.sync.apply(this, args);
|
|
31526
|
-
};
|
|
31527
|
-
function fn(...args) {
|
|
31528
|
-
const iter = generator.apply(this, args);
|
|
31529
|
-
iter.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);
|
|
31530
|
-
iter.__quansync = true;
|
|
31531
|
-
return iter;
|
|
31532
|
-
}
|
|
31533
|
-
fn.sync = options.sync;
|
|
31534
|
-
fn.async = options.async;
|
|
31535
|
-
return fn;
|
|
31536
|
-
}
|
|
31537
|
-
function fromPromise(promise) {
|
|
31538
|
-
return fromObject({
|
|
31539
|
-
async: () => Promise.resolve(promise),
|
|
31540
|
-
sync: () => {
|
|
31541
|
-
if (isThenable(promise)) throw new QuansyncError();
|
|
31542
|
-
return promise;
|
|
31543
|
-
}
|
|
31544
|
-
});
|
|
31545
|
-
}
|
|
31546
|
-
function unwrapYield(value, isAsync) {
|
|
31547
|
-
if (value === GET_IS_ASYNC) return isAsync;
|
|
31548
|
-
if (isQuansyncGenerator(value)) return isAsync ? iterateAsync(value) : iterateSync(value);
|
|
31549
|
-
if (!isAsync && isThenable(value)) throw new QuansyncError();
|
|
31550
|
-
return value;
|
|
31551
|
-
}
|
|
31552
|
-
const DEFAULT_ON_YIELD = (value) => value;
|
|
31553
|
-
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
31554
|
-
let current = generator.next();
|
|
31555
|
-
while (!current.done) try {
|
|
31556
|
-
current = generator.next(unwrapYield(onYield(current.value, false)));
|
|
31472
|
+
//#region ../create/utils.ts
|
|
31473
|
+
function mkdirp(dir) {
|
|
31474
|
+
try {
|
|
31475
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
31557
31476
|
} catch (err) {
|
|
31558
|
-
|
|
31477
|
+
const e$1 = err;
|
|
31478
|
+
if (e$1.code === "EEXIST") return;
|
|
31479
|
+
throw e$1;
|
|
31559
31480
|
}
|
|
31560
|
-
return unwrapYield(current.value);
|
|
31561
31481
|
}
|
|
31562
|
-
|
|
31563
|
-
|
|
31564
|
-
while (!current.done) try {
|
|
31565
|
-
current = generator.next(await unwrapYield(onYield(current.value, true), true));
|
|
31566
|
-
} catch (err) {
|
|
31567
|
-
current = generator.throw(err);
|
|
31568
|
-
}
|
|
31569
|
-
return current.value;
|
|
31482
|
+
function identity(x$3) {
|
|
31483
|
+
return x$3;
|
|
31570
31484
|
}
|
|
31571
|
-
function
|
|
31572
|
-
|
|
31573
|
-
|
|
31574
|
-
|
|
31575
|
-
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
31576
|
-
},
|
|
31577
|
-
sync(...args) {
|
|
31578
|
-
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
31579
|
-
}
|
|
31485
|
+
function copy(from$1, to, rename = identity) {
|
|
31486
|
+
if (!fs.existsSync(from$1)) return;
|
|
31487
|
+
if (fs.statSync(from$1).isDirectory()) fs.readdirSync(from$1).forEach((file) => {
|
|
31488
|
+
copy(path.join(from$1, file), path.join(to, rename(file)));
|
|
31580
31489
|
});
|
|
31581
|
-
|
|
31582
|
-
|
|
31583
|
-
|
|
31584
|
-
if (typeof input === "function") return fromGeneratorFn(input, options);
|
|
31585
|
-
else return fromObject(input);
|
|
31586
|
-
}
|
|
31587
|
-
const getIsAsync = quansync$1({
|
|
31588
|
-
async: () => Promise.resolve(true),
|
|
31589
|
-
sync: () => false
|
|
31590
|
-
});
|
|
31591
|
-
|
|
31592
|
-
//#endregion
|
|
31593
|
-
//#region ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/macro.mjs
|
|
31594
|
-
const quansync = quansync$1;
|
|
31595
|
-
|
|
31596
|
-
//#endregion
|
|
31597
|
-
//#region ../../node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/detect.mjs
|
|
31598
|
-
const isFile = quansync({
|
|
31599
|
-
sync: (path2) => {
|
|
31600
|
-
try {
|
|
31601
|
-
return fs.statSync(path2).isFile();
|
|
31602
|
-
} catch {
|
|
31603
|
-
return false;
|
|
31604
|
-
}
|
|
31605
|
-
},
|
|
31606
|
-
async: async (path2) => {
|
|
31607
|
-
try {
|
|
31608
|
-
return (await fs.promises.stat(path2)).isFile();
|
|
31609
|
-
} catch {
|
|
31610
|
-
return false;
|
|
31611
|
-
}
|
|
31612
|
-
}
|
|
31613
|
-
});
|
|
31614
|
-
function* lookup(cwd$1 = process$1.cwd()) {
|
|
31615
|
-
let directory = path.resolve(cwd$1);
|
|
31616
|
-
const { root: root$1 } = path.parse(directory);
|
|
31617
|
-
while (directory && directory !== root$1) {
|
|
31618
|
-
yield directory;
|
|
31619
|
-
directory = path.dirname(directory);
|
|
31490
|
+
else {
|
|
31491
|
+
mkdirp(path.dirname(to));
|
|
31492
|
+
fs.copyFileSync(from$1, to);
|
|
31620
31493
|
}
|
|
31621
31494
|
}
|
|
31622
|
-
|
|
31623
|
-
|
|
31624
|
-
});
|
|
31625
|
-
|
|
31626
|
-
|
|
31627
|
-
|
|
31628
|
-
|
|
31629
|
-
|
|
31630
|
-
const result2 = yield parsePackageJson(path.join(directory, "package.json"), onUnknown);
|
|
31631
|
-
if (result2) return result2;
|
|
31632
|
-
else return {
|
|
31633
|
-
name,
|
|
31634
|
-
agent: name
|
|
31635
|
-
};
|
|
31636
|
-
}
|
|
31637
|
-
const result = yield parsePackageJson(path.join(directory, "package.json"), onUnknown);
|
|
31638
|
-
if (result) return result;
|
|
31639
|
-
}
|
|
31640
|
-
return null;
|
|
31641
|
-
});
|
|
31642
|
-
const detectSync = detect.sync;
|
|
31643
|
-
function handlePackageManager(filepath, onUnknown) {
|
|
31644
|
-
try {
|
|
31645
|
-
const pkg = JSON.parse(fs.readFileSync(filepath, "utf8"));
|
|
31646
|
-
let agent;
|
|
31647
|
-
if (typeof pkg.packageManager === "string") {
|
|
31648
|
-
const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
|
|
31649
|
-
let version$1 = ver;
|
|
31650
|
-
if (name === "yarn" && Number.parseInt(ver) > 1) {
|
|
31651
|
-
agent = "yarn@berry";
|
|
31652
|
-
version$1 = "berry";
|
|
31653
|
-
return {
|
|
31654
|
-
name,
|
|
31655
|
-
agent,
|
|
31656
|
-
version: version$1
|
|
31657
|
-
};
|
|
31658
|
-
} else if (name === "pnpm" && Number.parseInt(ver) < 7) {
|
|
31659
|
-
agent = "pnpm@6";
|
|
31660
|
-
return {
|
|
31661
|
-
name,
|
|
31662
|
-
agent,
|
|
31663
|
-
version: version$1
|
|
31664
|
-
};
|
|
31665
|
-
} else if (AGENTS.includes(name)) {
|
|
31666
|
-
agent = name;
|
|
31667
|
-
return {
|
|
31668
|
-
name,
|
|
31669
|
-
agent,
|
|
31670
|
-
version: version$1
|
|
31671
|
-
};
|
|
31672
|
-
} else return onUnknown?.(pkg.packageManager) ?? null;
|
|
31673
|
-
}
|
|
31674
|
-
} catch {}
|
|
31675
|
-
return null;
|
|
31495
|
+
function dist(path$2) {
|
|
31496
|
+
const insideDistFolder = import.meta.url.includes("dist");
|
|
31497
|
+
return fileURLToPath(new URL(`./${!insideDistFolder ? "dist/" : ""}${path$2}`, import.meta.url).href);
|
|
31498
|
+
}
|
|
31499
|
+
function getSharedFiles() {
|
|
31500
|
+
const shared$1 = dist("shared.json");
|
|
31501
|
+
const { files } = JSON.parse(fs.readFileSync(shared$1, "utf-8"));
|
|
31502
|
+
return files;
|
|
31676
31503
|
}
|
|
31677
31504
|
|
|
31678
31505
|
//#endregion
|
|
@@ -32144,6 +31971,198 @@ var R = class {
|
|
|
32144
31971
|
return r.spawn(), r;
|
|
32145
31972
|
}, be = ve;
|
|
32146
31973
|
|
|
31974
|
+
//#endregion
|
|
31975
|
+
//#region ../../node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/constants.mjs
|
|
31976
|
+
const AGENTS = [
|
|
31977
|
+
"npm",
|
|
31978
|
+
"yarn",
|
|
31979
|
+
"yarn@berry",
|
|
31980
|
+
"pnpm",
|
|
31981
|
+
"pnpm@6",
|
|
31982
|
+
"bun",
|
|
31983
|
+
"deno"
|
|
31984
|
+
];
|
|
31985
|
+
const LOCKS = {
|
|
31986
|
+
"bun.lock": "bun",
|
|
31987
|
+
"bun.lockb": "bun",
|
|
31988
|
+
"deno.lock": "deno",
|
|
31989
|
+
"pnpm-lock.yaml": "pnpm",
|
|
31990
|
+
"yarn.lock": "yarn",
|
|
31991
|
+
"package-lock.json": "npm",
|
|
31992
|
+
"npm-shrinkwrap.json": "npm"
|
|
31993
|
+
};
|
|
31994
|
+
|
|
31995
|
+
//#endregion
|
|
31996
|
+
//#region ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs
|
|
31997
|
+
const GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
|
|
31998
|
+
var QuansyncError = class extends Error {
|
|
31999
|
+
constructor(message = "Unexpected promise in sync context") {
|
|
32000
|
+
super(message);
|
|
32001
|
+
this.name = "QuansyncError";
|
|
32002
|
+
}
|
|
32003
|
+
};
|
|
32004
|
+
function isThenable(value) {
|
|
32005
|
+
return value && typeof value === "object" && typeof value.then === "function";
|
|
32006
|
+
}
|
|
32007
|
+
function isQuansyncGenerator(value) {
|
|
32008
|
+
return value && typeof value === "object" && typeof value[Symbol.iterator] === "function" && "__quansync" in value;
|
|
32009
|
+
}
|
|
32010
|
+
function fromObject(options) {
|
|
32011
|
+
const generator = function* (...args) {
|
|
32012
|
+
if (yield GET_IS_ASYNC) return yield options.async.apply(this, args);
|
|
32013
|
+
return options.sync.apply(this, args);
|
|
32014
|
+
};
|
|
32015
|
+
function fn(...args) {
|
|
32016
|
+
const iter = generator.apply(this, args);
|
|
32017
|
+
iter.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);
|
|
32018
|
+
iter.__quansync = true;
|
|
32019
|
+
return iter;
|
|
32020
|
+
}
|
|
32021
|
+
fn.sync = options.sync;
|
|
32022
|
+
fn.async = options.async;
|
|
32023
|
+
return fn;
|
|
32024
|
+
}
|
|
32025
|
+
function fromPromise(promise) {
|
|
32026
|
+
return fromObject({
|
|
32027
|
+
async: () => Promise.resolve(promise),
|
|
32028
|
+
sync: () => {
|
|
32029
|
+
if (isThenable(promise)) throw new QuansyncError();
|
|
32030
|
+
return promise;
|
|
32031
|
+
}
|
|
32032
|
+
});
|
|
32033
|
+
}
|
|
32034
|
+
function unwrapYield(value, isAsync) {
|
|
32035
|
+
if (value === GET_IS_ASYNC) return isAsync;
|
|
32036
|
+
if (isQuansyncGenerator(value)) return isAsync ? iterateAsync(value) : iterateSync(value);
|
|
32037
|
+
if (!isAsync && isThenable(value)) throw new QuansyncError();
|
|
32038
|
+
return value;
|
|
32039
|
+
}
|
|
32040
|
+
const DEFAULT_ON_YIELD = (value) => value;
|
|
32041
|
+
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
32042
|
+
let current = generator.next();
|
|
32043
|
+
while (!current.done) try {
|
|
32044
|
+
current = generator.next(unwrapYield(onYield(current.value, false)));
|
|
32045
|
+
} catch (err) {
|
|
32046
|
+
current = generator.throw(err);
|
|
32047
|
+
}
|
|
32048
|
+
return unwrapYield(current.value);
|
|
32049
|
+
}
|
|
32050
|
+
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
32051
|
+
let current = generator.next();
|
|
32052
|
+
while (!current.done) try {
|
|
32053
|
+
current = generator.next(await unwrapYield(onYield(current.value, true), true));
|
|
32054
|
+
} catch (err) {
|
|
32055
|
+
current = generator.throw(err);
|
|
32056
|
+
}
|
|
32057
|
+
return current.value;
|
|
32058
|
+
}
|
|
32059
|
+
function fromGeneratorFn(generatorFn, options) {
|
|
32060
|
+
return fromObject({
|
|
32061
|
+
name: generatorFn.name,
|
|
32062
|
+
async(...args) {
|
|
32063
|
+
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
32064
|
+
},
|
|
32065
|
+
sync(...args) {
|
|
32066
|
+
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
32067
|
+
}
|
|
32068
|
+
});
|
|
32069
|
+
}
|
|
32070
|
+
function quansync$1(input, options) {
|
|
32071
|
+
if (isThenable(input)) return fromPromise(input);
|
|
32072
|
+
if (typeof input === "function") return fromGeneratorFn(input, options);
|
|
32073
|
+
else return fromObject(input);
|
|
32074
|
+
}
|
|
32075
|
+
const getIsAsync = quansync$1({
|
|
32076
|
+
async: () => Promise.resolve(true),
|
|
32077
|
+
sync: () => false
|
|
32078
|
+
});
|
|
32079
|
+
|
|
32080
|
+
//#endregion
|
|
32081
|
+
//#region ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/macro.mjs
|
|
32082
|
+
const quansync = quansync$1;
|
|
32083
|
+
|
|
32084
|
+
//#endregion
|
|
32085
|
+
//#region ../../node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/detect.mjs
|
|
32086
|
+
const isFile = quansync({
|
|
32087
|
+
sync: (path2) => {
|
|
32088
|
+
try {
|
|
32089
|
+
return fs.statSync(path2).isFile();
|
|
32090
|
+
} catch {
|
|
32091
|
+
return false;
|
|
32092
|
+
}
|
|
32093
|
+
},
|
|
32094
|
+
async: async (path2) => {
|
|
32095
|
+
try {
|
|
32096
|
+
return (await fs.promises.stat(path2)).isFile();
|
|
32097
|
+
} catch {
|
|
32098
|
+
return false;
|
|
32099
|
+
}
|
|
32100
|
+
}
|
|
32101
|
+
});
|
|
32102
|
+
function* lookup(cwd$1 = process$1.cwd()) {
|
|
32103
|
+
let directory = path.resolve(cwd$1);
|
|
32104
|
+
const { root: root$1 } = path.parse(directory);
|
|
32105
|
+
while (directory && directory !== root$1) {
|
|
32106
|
+
yield directory;
|
|
32107
|
+
directory = path.dirname(directory);
|
|
32108
|
+
}
|
|
32109
|
+
}
|
|
32110
|
+
const parsePackageJson = quansync(function* (filepath, onUnknown) {
|
|
32111
|
+
return !filepath || !(yield isFile(filepath)) ? null : handlePackageManager(filepath, onUnknown);
|
|
32112
|
+
});
|
|
32113
|
+
const detect = quansync(function* (options = {}) {
|
|
32114
|
+
const { cwd: cwd$1, onUnknown } = options;
|
|
32115
|
+
for (const directory of lookup(cwd$1)) {
|
|
32116
|
+
for (const lock of Object.keys(LOCKS)) if (yield isFile(path.join(directory, lock))) {
|
|
32117
|
+
const name = LOCKS[lock];
|
|
32118
|
+
const result2 = yield parsePackageJson(path.join(directory, "package.json"), onUnknown);
|
|
32119
|
+
if (result2) return result2;
|
|
32120
|
+
else return {
|
|
32121
|
+
name,
|
|
32122
|
+
agent: name
|
|
32123
|
+
};
|
|
32124
|
+
}
|
|
32125
|
+
const result = yield parsePackageJson(path.join(directory, "package.json"), onUnknown);
|
|
32126
|
+
if (result) return result;
|
|
32127
|
+
}
|
|
32128
|
+
return null;
|
|
32129
|
+
});
|
|
32130
|
+
const detectSync = detect.sync;
|
|
32131
|
+
function handlePackageManager(filepath, onUnknown) {
|
|
32132
|
+
try {
|
|
32133
|
+
const pkg = JSON.parse(fs.readFileSync(filepath, "utf8"));
|
|
32134
|
+
let agent;
|
|
32135
|
+
if (typeof pkg.packageManager === "string") {
|
|
32136
|
+
const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
|
|
32137
|
+
let version$1 = ver;
|
|
32138
|
+
if (name === "yarn" && Number.parseInt(ver) > 1) {
|
|
32139
|
+
agent = "yarn@berry";
|
|
32140
|
+
version$1 = "berry";
|
|
32141
|
+
return {
|
|
32142
|
+
name,
|
|
32143
|
+
agent,
|
|
32144
|
+
version: version$1
|
|
32145
|
+
};
|
|
32146
|
+
} else if (name === "pnpm" && Number.parseInt(ver) < 7) {
|
|
32147
|
+
agent = "pnpm@6";
|
|
32148
|
+
return {
|
|
32149
|
+
name,
|
|
32150
|
+
agent,
|
|
32151
|
+
version: version$1
|
|
32152
|
+
};
|
|
32153
|
+
} else if (AGENTS.includes(name)) {
|
|
32154
|
+
agent = name;
|
|
32155
|
+
return {
|
|
32156
|
+
name,
|
|
32157
|
+
agent,
|
|
32158
|
+
version: version$1
|
|
32159
|
+
};
|
|
32160
|
+
} else return onUnknown?.(pkg.packageManager) ?? null;
|
|
32161
|
+
}
|
|
32162
|
+
} catch {}
|
|
32163
|
+
return null;
|
|
32164
|
+
}
|
|
32165
|
+
|
|
32147
32166
|
//#endregion
|
|
32148
32167
|
//#region utils/package-manager.ts
|
|
32149
32168
|
const AGENT_NAMES = AGENTS.filter((agent) => !agent.includes("@"));
|
|
@@ -32244,35 +32263,6 @@ async function getPnpmVersion() {
|
|
|
32244
32263
|
return v$2;
|
|
32245
32264
|
}
|
|
32246
32265
|
|
|
32247
|
-
//#endregion
|
|
32248
|
-
//#region ../create/utils.ts
|
|
32249
|
-
function mkdirp(dir) {
|
|
32250
|
-
try {
|
|
32251
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
32252
|
-
} catch (err) {
|
|
32253
|
-
const e$1 = err;
|
|
32254
|
-
if (e$1.code === "EEXIST") return;
|
|
32255
|
-
throw e$1;
|
|
32256
|
-
}
|
|
32257
|
-
}
|
|
32258
|
-
function identity(x$3) {
|
|
32259
|
-
return x$3;
|
|
32260
|
-
}
|
|
32261
|
-
function copy(from$1, to, rename = identity) {
|
|
32262
|
-
if (!fs.existsSync(from$1)) return;
|
|
32263
|
-
if (fs.statSync(from$1).isDirectory()) fs.readdirSync(from$1).forEach((file) => {
|
|
32264
|
-
copy(path.join(from$1, file), path.join(to, rename(file)));
|
|
32265
|
-
});
|
|
32266
|
-
else {
|
|
32267
|
-
mkdirp(path.dirname(to));
|
|
32268
|
-
fs.copyFileSync(from$1, to);
|
|
32269
|
-
}
|
|
32270
|
-
}
|
|
32271
|
-
function dist(path$2) {
|
|
32272
|
-
const insideDistFolder = import.meta.url.includes("dist");
|
|
32273
|
-
return fileURLToPath(new URL(`./${!insideDistFolder ? "dist/" : ""}${path$2}`, import.meta.url).href);
|
|
32274
|
-
}
|
|
32275
|
-
|
|
32276
32266
|
//#endregion
|
|
32277
32267
|
//#region ../create/index.ts
|
|
32278
32268
|
const templateTypes = [
|
|
@@ -32311,8 +32301,7 @@ function write_template_files(template, types$2, name, cwd$1) {
|
|
|
32311
32301
|
});
|
|
32312
32302
|
}
|
|
32313
32303
|
function write_common_files(cwd$1, options, name) {
|
|
32314
|
-
const
|
|
32315
|
-
const { files } = JSON.parse(fs.readFileSync(shared$1, "utf-8"));
|
|
32304
|
+
const files = getSharedFiles();
|
|
32316
32305
|
const pkg_file = path.join(cwd$1, "package.json");
|
|
32317
32306
|
const pkg = JSON.parse(fs.readFileSync(pkg_file, "utf-8"));
|
|
32318
32307
|
sort_files(files).forEach((file) => {
|
|
@@ -32368,4 +32357,4 @@ function to_valid_package_name(name) {
|
|
|
32368
32357
|
}
|
|
32369
32358
|
|
|
32370
32359
|
//#endregion
|
|
32371
|
-
export { __require as $, dedent_default as A, We as B, serializeScript as C, walk as D, Tag as E, Ge as F, any as G, ke as H, J as I, require_picocolors as J, up as K, Ke as L, defineAddonOptions as M, De as N, isVersionUnsupportedBelow as O, Fe as P, __commonJS as Q, T as R, parseScript$1 as S, Element as T, ze as U, et$1 as V, Vu as W, Option as X, Command as Y, program as Z, parseScript as _,
|
|
32360
|
+
export { __require as $, dedent_default as A, We as B, serializeScript as C, walk as D, Tag as E, Ge as F, any as G, ke as H, J as I, require_picocolors as J, up as K, Ke as L, defineAddonOptions as M, De as N, isVersionUnsupportedBelow as O, Fe as P, __commonJS as Q, T as R, parseScript$1 as S, Element as T, ze as U, et$1 as V, Vu as W, Option as X, Command as Y, program as Z, parseScript as _, getUserAgent as a, import_picocolors as b, packageManagerPrompt as c, ve as d, __toESM as et, getSharedFiles as f, parseJson as g, parseHtml as h, addPnpmBuildDependencies as i, defineAddon as j, createPrinter as k, detect as l, parseCss as m, templates as n, installDependencies as o, resolveCommand as p, from as q, AGENT_NAMES as r, installOption as s, create as t, be as u, parseSvelte as v, stripAst as w, parseHtml$1 as x, MagicString as y, Ue as z };
|