sv 0.9.4 → 0.9.6
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/{addons-DT8tgFSU.js → addons-C1BtYuVp.js} +202 -122
- package/dist/bin.js +22956 -167
- package/dist/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Element, T, Tag, __commonJS, __export, __toESM, __toESM$1, be, detect, esm_exports, getUserAgent, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript, parseScript$1, parseSvelte, require_picocolors, require_picocolors$1, resolveCommand, serializeScript, stripAst, up, walk, walk_exports } from "./package-manager-DO5R9a6p.js";
|
|
1
|
+
import { Element, T, Tag, __commonJS, __export, __toESM, __toESM$1, be, detect, esm_exports, getUserAgent, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript, parseScript$1, parseSvelte, require_picocolors as require_picocolors$1, require_picocolors$1 as require_picocolors, resolveCommand, serializeScript, stripAst, up, walk, walk_exports } from "./package-manager-DO5R9a6p.js";
|
|
2
2
|
import fs, { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
3
3
|
import path, { dirname, join } from "node:path";
|
|
4
4
|
import process$1, { stdin, stdout } from "node:process";
|
|
@@ -288,25 +288,23 @@ else node.elements.unshift(element);
|
|
|
288
288
|
}
|
|
289
289
|
var object_exports = {};
|
|
290
290
|
__export(object_exports, {
|
|
291
|
-
addProperties: () => addProperties,
|
|
292
291
|
create: () => create,
|
|
293
292
|
overrideProperties: () => overrideProperties,
|
|
294
|
-
overrideProperty: () => overrideProperty,
|
|
295
293
|
property: () => property,
|
|
296
|
-
|
|
294
|
+
propertyNode: () => propertyNode
|
|
297
295
|
});
|
|
298
296
|
function property(node, options$6) {
|
|
297
|
+
return propertyNode(node, options$6).value;
|
|
298
|
+
}
|
|
299
|
+
function propertyNode(node, options$6) {
|
|
299
300
|
const properties = node.properties.filter((x$2) => x$2.type === "Property");
|
|
300
301
|
let prop = properties.find((x$2) => x$2.key.name === options$6.name);
|
|
301
|
-
|
|
302
|
-
if (prop) propertyValue = prop.value;
|
|
303
|
-
else {
|
|
302
|
+
if (!prop) {
|
|
304
303
|
let isShorthand = false;
|
|
305
304
|
if (options$6.fallback.type === "Identifier") {
|
|
306
305
|
const identifier = options$6.fallback;
|
|
307
306
|
isShorthand = identifier.name === options$6.name;
|
|
308
307
|
}
|
|
309
|
-
propertyValue = options$6.fallback;
|
|
310
308
|
prop = {
|
|
311
309
|
type: "Property",
|
|
312
310
|
shorthand: isShorthand,
|
|
@@ -314,14 +312,32 @@ else {
|
|
|
314
312
|
type: "Identifier",
|
|
315
313
|
name: options$6.name
|
|
316
314
|
},
|
|
317
|
-
value:
|
|
315
|
+
value: options$6.fallback,
|
|
318
316
|
kind: "init",
|
|
319
317
|
computed: false,
|
|
320
318
|
method: false
|
|
321
319
|
};
|
|
322
320
|
node.properties.push(prop);
|
|
323
321
|
}
|
|
324
|
-
return
|
|
322
|
+
return prop;
|
|
323
|
+
}
|
|
324
|
+
function create(properties) {
|
|
325
|
+
const objectExpression = {
|
|
326
|
+
type: "ObjectExpression",
|
|
327
|
+
properties: []
|
|
328
|
+
};
|
|
329
|
+
return populateObjectExpression({
|
|
330
|
+
objectExpression,
|
|
331
|
+
properties,
|
|
332
|
+
override: false
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function overrideProperties(objectExpression, properties) {
|
|
336
|
+
populateObjectExpression({
|
|
337
|
+
objectExpression,
|
|
338
|
+
properties,
|
|
339
|
+
override: true
|
|
340
|
+
});
|
|
325
341
|
}
|
|
326
342
|
function overrideProperty(node, options$6) {
|
|
327
343
|
const properties = node.properties.filter((x$2) => x$2.type === "Property");
|
|
@@ -333,51 +349,42 @@ function overrideProperty(node, options$6) {
|
|
|
333
349
|
prop.value = options$6.value;
|
|
334
350
|
return options$6.value;
|
|
335
351
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
338
|
-
if (value === undefined) continue;
|
|
339
|
-
overrideProperty(node, {
|
|
340
|
-
name: prop,
|
|
341
|
-
value
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
function addProperties(node, options$6) {
|
|
346
|
-
for (const [prop, value] of Object.entries(options$6.properties)) {
|
|
347
|
-
if (value === undefined) continue;
|
|
348
|
-
property(node, {
|
|
349
|
-
name: prop,
|
|
350
|
-
fallback: value
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function removeProperty(node, options$6) {
|
|
355
|
-
const properties = node.properties.filter((x$2) => x$2.type === "Property");
|
|
356
|
-
const propIdx = properties.findIndex((x$2) => x$2.key.name === options$6.name);
|
|
357
|
-
if (propIdx !== -1) node.properties.splice(propIdx, 1);
|
|
358
|
-
}
|
|
359
|
-
function create(properties) {
|
|
360
|
-
const objExpression = {
|
|
361
|
-
type: "ObjectExpression",
|
|
362
|
-
properties: []
|
|
363
|
-
};
|
|
364
|
-
const getExpression = (value) => {
|
|
352
|
+
function populateObjectExpression(options$6) {
|
|
353
|
+
const getExpression = (value, existingExpression) => {
|
|
365
354
|
let expression;
|
|
366
355
|
if (Array.isArray(value)) {
|
|
367
356
|
expression = create$1();
|
|
368
357
|
for (const v$2 of value) append(expression, getExpression(v$2));
|
|
369
|
-
} else if (typeof value === "object" && value !== null)
|
|
358
|
+
} else if (typeof value === "object" && value !== null) if (value.type !== undefined) expression = value;
|
|
359
|
+
else if (options$6.override && existingExpression && existingExpression.type === "ObjectExpression") expression = populateObjectExpression({
|
|
360
|
+
objectExpression: existingExpression,
|
|
361
|
+
properties: value,
|
|
362
|
+
override: options$6.override
|
|
363
|
+
});
|
|
364
|
+
else expression = populateObjectExpression({
|
|
365
|
+
objectExpression: create({}),
|
|
366
|
+
properties: value,
|
|
367
|
+
override: options$6.override
|
|
368
|
+
});
|
|
370
369
|
else expression = createLiteral(value);
|
|
371
370
|
return expression;
|
|
372
371
|
};
|
|
373
|
-
for (const [prop, value] of Object.entries(properties)) {
|
|
372
|
+
for (const [prop, value] of Object.entries(options$6.properties)) {
|
|
374
373
|
if (value === undefined) continue;
|
|
375
|
-
|
|
374
|
+
if (options$6.override) {
|
|
375
|
+
const existingProperties = options$6.objectExpression.properties.filter((x$2) => x$2.type === "Property");
|
|
376
|
+
const existingProperty = existingProperties.find((x$2) => x$2.key.name === prop);
|
|
377
|
+
const existingExpression = existingProperty?.value.type === "ObjectExpression" ? existingProperty.value : undefined;
|
|
378
|
+
overrideProperty(options$6.objectExpression, {
|
|
379
|
+
name: prop,
|
|
380
|
+
value: getExpression(value, existingExpression)
|
|
381
|
+
});
|
|
382
|
+
} else property(options$6.objectExpression, {
|
|
376
383
|
name: prop,
|
|
377
384
|
fallback: getExpression(value)
|
|
378
385
|
});
|
|
379
386
|
}
|
|
380
|
-
return
|
|
387
|
+
return options$6.objectExpression;
|
|
381
388
|
}
|
|
382
389
|
var function_exports = {};
|
|
383
390
|
__export(function_exports, {
|
|
@@ -429,7 +436,9 @@ __export(imports_exports, {
|
|
|
429
436
|
addDefault: () => addDefault,
|
|
430
437
|
addEmpty: () => addEmpty,
|
|
431
438
|
addNamed: () => addNamed,
|
|
432
|
-
addNamespace: () => addNamespace
|
|
439
|
+
addNamespace: () => addNamespace,
|
|
440
|
+
find: () => find,
|
|
441
|
+
remove: () => remove
|
|
433
442
|
});
|
|
434
443
|
function addEmpty(node, options$6) {
|
|
435
444
|
const expectedImportDeclaration = {
|
|
@@ -526,6 +535,42 @@ function addImportIfNecessary(node, expectedImportDeclaration) {
|
|
|
526
535
|
const importDeclaration = importDeclarations.find((item) => areNodesEqual(item, expectedImportDeclaration));
|
|
527
536
|
if (!importDeclaration) node.body.unshift(expectedImportDeclaration);
|
|
528
537
|
}
|
|
538
|
+
function find(ast, options$6) {
|
|
539
|
+
let alias = options$6.name;
|
|
540
|
+
let statement;
|
|
541
|
+
walk(ast, null, { ImportDeclaration(node) {
|
|
542
|
+
if (node.specifiers && node.source.value === options$6.from) {
|
|
543
|
+
const specifier = node.specifiers.find((sp) => sp.type === "ImportSpecifier" && sp.imported.type === "Identifier" && sp.imported.name === options$6.name);
|
|
544
|
+
if (specifier) {
|
|
545
|
+
statement = node;
|
|
546
|
+
alias = specifier.local?.name ?? alias;
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
} });
|
|
551
|
+
if (statement) return {
|
|
552
|
+
statement,
|
|
553
|
+
alias
|
|
554
|
+
};
|
|
555
|
+
return {
|
|
556
|
+
statement: undefined,
|
|
557
|
+
alias: undefined
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function remove(ast, options$6) {
|
|
561
|
+
const statement = options$6.statement ?? find(ast, {
|
|
562
|
+
name: options$6.name,
|
|
563
|
+
from: options$6.from
|
|
564
|
+
}).statement;
|
|
565
|
+
if (!statement) return;
|
|
566
|
+
if (statement.specifiers?.length === 1) {
|
|
567
|
+
const idxToRemove = ast.body.indexOf(statement);
|
|
568
|
+
ast.body.splice(idxToRemove, 1);
|
|
569
|
+
} else {
|
|
570
|
+
const idxToRemove = statement.specifiers?.findIndex((s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && s.imported.name === options$6.name);
|
|
571
|
+
if (idxToRemove !== undefined && idxToRemove !== -1) statement.specifiers?.splice(idxToRemove, 1);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
529
574
|
var variables_exports = {};
|
|
530
575
|
__export(variables_exports, {
|
|
531
576
|
createIdentifier: () => createIdentifier,
|
|
@@ -589,7 +634,8 @@ function createDefault(node, options$6) {
|
|
|
589
634
|
node.body.push(exportNode);
|
|
590
635
|
return {
|
|
591
636
|
astNode: exportNode,
|
|
592
|
-
value: options$6.fallback
|
|
637
|
+
value: options$6.fallback,
|
|
638
|
+
isFallback: true
|
|
593
639
|
};
|
|
594
640
|
}
|
|
595
641
|
const exportDefaultDeclaration = existingNode;
|
|
@@ -607,13 +653,15 @@ function createDefault(node, options$6) {
|
|
|
607
653
|
const value = variableDeclarator.init;
|
|
608
654
|
return {
|
|
609
655
|
astNode: exportDefaultDeclaration,
|
|
610
|
-
value
|
|
656
|
+
value,
|
|
657
|
+
isFallback: false
|
|
611
658
|
};
|
|
612
659
|
}
|
|
613
660
|
const declaration$1 = exportDefaultDeclaration.declaration;
|
|
614
661
|
return {
|
|
615
662
|
astNode: exportDefaultDeclaration,
|
|
616
|
-
value: declaration$1
|
|
663
|
+
value: declaration$1,
|
|
664
|
+
isFallback: false
|
|
617
665
|
};
|
|
618
666
|
}
|
|
619
667
|
function createNamed(node, options$6) {
|
|
@@ -818,20 +866,35 @@ function isFunctionDeclaration(node, funcName) {
|
|
|
818
866
|
return node.type === "FunctionDeclaration" && node.id?.name === funcName;
|
|
819
867
|
}
|
|
820
868
|
var vite_exports = {};
|
|
821
|
-
__export(vite_exports, {
|
|
822
|
-
|
|
869
|
+
__export(vite_exports, {
|
|
870
|
+
addPlugin: () => addPlugin,
|
|
871
|
+
getConfig: () => getConfig
|
|
872
|
+
});
|
|
873
|
+
function isConfigWrapper(callExpression, knownWrappers) {
|
|
874
|
+
if (callExpression.callee.type !== "Identifier") return false;
|
|
875
|
+
const calleeName = callExpression.callee.name;
|
|
876
|
+
if (knownWrappers.includes(calleeName)) return true;
|
|
877
|
+
const isObjectCall = callExpression.arguments.length === 1 && callExpression.arguments[0]?.type === "ObjectExpression";
|
|
878
|
+
return knownWrappers.includes(calleeName) || isObjectCall;
|
|
879
|
+
}
|
|
880
|
+
function exportDefaultConfig(ast, options$6) {
|
|
823
881
|
const { fallback, ignoreWrapper } = options$6;
|
|
824
882
|
let fallbackExpression;
|
|
825
|
-
if (fallback) fallbackExpression = typeof fallback === "string" ? parseExpression(fallback) : fallback;
|
|
883
|
+
if (fallback) fallbackExpression = typeof fallback.code === "string" ? parseExpression(fallback.code) : fallback.code;
|
|
826
884
|
else fallbackExpression = create({});
|
|
827
|
-
const { value } = createDefault(ast, { fallback: fallbackExpression });
|
|
885
|
+
const { value, isFallback } = createDefault(ast, { fallback: fallbackExpression });
|
|
886
|
+
if (isFallback) options$6.fallback?.additional?.(ast);
|
|
828
887
|
const rootObject = value.type === "TSSatisfiesExpression" ? value.expression : value;
|
|
829
888
|
let configObject;
|
|
830
|
-
if (!
|
|
889
|
+
if (!("arguments" in rootObject) || !Array.isArray(rootObject.arguments)) {
|
|
890
|
+
configObject = rootObject;
|
|
891
|
+
return configObject;
|
|
892
|
+
}
|
|
893
|
+
if (rootObject.type !== "CallExpression" || rootObject.callee.type !== "Identifier") {
|
|
831
894
|
configObject = rootObject;
|
|
832
895
|
return configObject;
|
|
833
896
|
}
|
|
834
|
-
if (rootObject
|
|
897
|
+
if (!isConfigWrapper(rootObject, ignoreWrapper)) {
|
|
835
898
|
configObject = rootObject;
|
|
836
899
|
return configObject;
|
|
837
900
|
}
|
|
@@ -873,23 +936,28 @@ function addInArrayOfObject(ast, options$6) {
|
|
|
873
936
|
else append(targetArray, expression);
|
|
874
937
|
}
|
|
875
938
|
const addPlugin = (ast, options$6) => {
|
|
876
|
-
|
|
877
|
-
from: "vite",
|
|
878
|
-
imports: { defineConfig: "defineConfig" }
|
|
879
|
-
});
|
|
880
|
-
const configObject = exportDefaultConfig(ast, {
|
|
881
|
-
fallback: "defineConfig()",
|
|
882
|
-
ignoreWrapper: "defineConfig"
|
|
883
|
-
});
|
|
939
|
+
const configObject = getConfig(ast);
|
|
884
940
|
addInArrayOfObject(configObject, {
|
|
885
941
|
arrayProperty: "plugins",
|
|
886
942
|
...options$6
|
|
887
943
|
});
|
|
888
944
|
};
|
|
945
|
+
const getConfig = (ast) => {
|
|
946
|
+
return exportDefaultConfig(ast, {
|
|
947
|
+
fallback: {
|
|
948
|
+
code: "defineConfig()",
|
|
949
|
+
additional: (ast$1) => addNamed(ast$1, {
|
|
950
|
+
imports: ["defineConfig"],
|
|
951
|
+
from: "vite"
|
|
952
|
+
})
|
|
953
|
+
},
|
|
954
|
+
ignoreWrapper: ["defineConfig"]
|
|
955
|
+
});
|
|
956
|
+
};
|
|
889
957
|
|
|
890
958
|
//#endregion
|
|
891
959
|
//#region packages/cli/commands/add/utils.ts
|
|
892
|
-
var import_picocolors$5 = __toESM$1(require_picocolors
|
|
960
|
+
var import_picocolors$5 = __toESM$1(require_picocolors(), 1);
|
|
893
961
|
function getPackageJson(cwd) {
|
|
894
962
|
const packageText = readFile(cwd, commonFilePaths.packageJson);
|
|
895
963
|
if (!packageText) {
|
|
@@ -1063,7 +1131,7 @@ function parseKitOptions(cwd) {
|
|
|
1063
1131
|
|
|
1064
1132
|
//#endregion
|
|
1065
1133
|
//#region packages/cli/lib/install.ts
|
|
1066
|
-
var import_picocolors$4 = __toESM$1(require_picocolors
|
|
1134
|
+
var import_picocolors$4 = __toESM$1(require_picocolors(), 1);
|
|
1067
1135
|
async function installAddon({ addons, cwd, options: options$6, packageManager = "npm" }) {
|
|
1068
1136
|
const workspace = await createWorkspace({
|
|
1069
1137
|
cwd,
|
|
@@ -1271,7 +1339,7 @@ else if (y > 0) ret += `${CSI}${y}B`;
|
|
|
1271
1339
|
};
|
|
1272
1340
|
} });
|
|
1273
1341
|
var import_src$1 = __toESM(require_src(), 1);
|
|
1274
|
-
var import_picocolors$3 = __toESM(require_picocolors(), 1);
|
|
1342
|
+
var import_picocolors$3 = __toESM(require_picocolors$1(), 1);
|
|
1275
1343
|
function hu({ onlyFirst: e$1 = !1 } = {}) {
|
|
1276
1344
|
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
1277
1345
|
return new RegExp(t, e$1 ? void 0 : "g");
|
|
@@ -2006,8 +2074,8 @@ B$1 = new WeakMap(), k$1 = new WeakMap(), I = new WeakMap(), v$1 = new WeakMap()
|
|
|
2006
2074
|
e$1 ? this.filteredOptions = D$1.filter((t) => x$1(this, I).call(this, e$1, t)) : this.filteredOptions = [...D$1], m(this, B$1, FD(this.focusedValue, this.filteredOptions)), this.focusedValue = this.filteredOptions[x$1(this, B$1)]?.value, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
2007
2075
|
}
|
|
2008
2076
|
};
|
|
2009
|
-
var import_picocolors$1 = __toESM(require_picocolors(), 1);
|
|
2010
|
-
var import_picocolors$2 = __toESM(require_picocolors(), 1);
|
|
2077
|
+
var import_picocolors$1 = __toESM(require_picocolors$1(), 1);
|
|
2078
|
+
var import_picocolors$2 = __toESM(require_picocolors$1(), 1);
|
|
2011
2079
|
var import_src = __toESM(require_src(), 1);
|
|
2012
2080
|
function Pe() {
|
|
2013
2081
|
return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -2708,7 +2776,7 @@ else return true;
|
|
|
2708
2776
|
if (version.patch === below.patch) return false;
|
|
2709
2777
|
return undefined;
|
|
2710
2778
|
}
|
|
2711
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
2779
|
+
var import_picocolors = __toESM(require_picocolors$1(), 1);
|
|
2712
2780
|
var colors = import_picocolors.default;
|
|
2713
2781
|
|
|
2714
2782
|
//#endregion
|
|
@@ -3197,11 +3265,12 @@ var eslint_default = defineAddon({
|
|
|
3197
3265
|
options: {},
|
|
3198
3266
|
run: ({ sv, typescript, dependencyVersion }) => {
|
|
3199
3267
|
const prettierInstalled = Boolean(dependencyVersion("prettier"));
|
|
3200
|
-
sv.devDependency("eslint", "^9.
|
|
3268
|
+
sv.devDependency("eslint", "^9.22.0");
|
|
3201
3269
|
sv.devDependency("@eslint/compat", "^1.2.5");
|
|
3202
3270
|
sv.devDependency("eslint-plugin-svelte", "^3.0.0");
|
|
3203
3271
|
sv.devDependency("globals", "^16.0.0");
|
|
3204
|
-
sv.devDependency("@eslint/js", "^9.
|
|
3272
|
+
sv.devDependency("@eslint/js", "^9.22.0");
|
|
3273
|
+
sv.devDependency("@types/node", getNodeTypesVersion());
|
|
3205
3274
|
if (typescript) sv.devDependency("typescript-eslint", "^8.20.0");
|
|
3206
3275
|
if (prettierInstalled) sv.devDependency("eslint-config-prettier", "^10.0.1");
|
|
3207
3276
|
sv.file("package.json", (content) => {
|
|
@@ -3282,7 +3351,7 @@ var eslint_default = defineAddon({
|
|
|
3282
3351
|
let exportExpression;
|
|
3283
3352
|
if (typescript) {
|
|
3284
3353
|
const tsConfigCall = function_exports.createCall({
|
|
3285
|
-
name: "
|
|
3354
|
+
name: "defineConfig",
|
|
3286
3355
|
args: []
|
|
3287
3356
|
});
|
|
3288
3357
|
tsConfigCall.arguments.push(...eslintConfigs);
|
|
@@ -3302,14 +3371,14 @@ var eslint_default = defineAddon({
|
|
|
3302
3371
|
from: "typescript-eslint",
|
|
3303
3372
|
as: "ts"
|
|
3304
3373
|
});
|
|
3305
|
-
imports_exports.addNamed(ast, {
|
|
3306
|
-
from: "node:url",
|
|
3307
|
-
imports: ["fileURLToPath"]
|
|
3308
|
-
});
|
|
3309
3374
|
imports_exports.addDefault(ast, {
|
|
3310
3375
|
from: "globals",
|
|
3311
3376
|
as: "globals"
|
|
3312
3377
|
});
|
|
3378
|
+
if (typescript) imports_exports.addNamed(ast, {
|
|
3379
|
+
from: "eslint/config",
|
|
3380
|
+
imports: ["defineConfig"]
|
|
3381
|
+
});
|
|
3313
3382
|
imports_exports.addDefault(ast, {
|
|
3314
3383
|
from: "eslint-plugin-svelte",
|
|
3315
3384
|
as: "svelte"
|
|
@@ -3322,6 +3391,10 @@ var eslint_default = defineAddon({
|
|
|
3322
3391
|
from: "@eslint/compat",
|
|
3323
3392
|
imports: ["includeIgnoreFile"]
|
|
3324
3393
|
});
|
|
3394
|
+
imports_exports.addNamed(ast, {
|
|
3395
|
+
from: "node:url",
|
|
3396
|
+
imports: ["fileURLToPath"]
|
|
3397
|
+
});
|
|
3325
3398
|
return generateCode();
|
|
3326
3399
|
});
|
|
3327
3400
|
if (prettierInstalled) sv.file("eslint.config.js", addEslintConfigPrettier);
|
|
@@ -4423,16 +4496,16 @@ var lucia_default = defineAddon({
|
|
|
4423
4496
|
"integer"
|
|
4424
4497
|
]
|
|
4425
4498
|
});
|
|
4426
|
-
object_exports.overrideProperties(userAttributes, {
|
|
4427
|
-
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4499
|
+
object_exports.overrideProperties(userAttributes, { id: common_exports.parseExpression("text('id').primaryKey()") });
|
|
4500
|
+
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4428
4501
|
username: common_exports.parseExpression("text('username').notNull().unique()"),
|
|
4429
4502
|
passwordHash: common_exports.parseExpression("text('password_hash').notNull()")
|
|
4430
|
-
}
|
|
4431
|
-
object_exports.overrideProperties(sessionAttributes, {
|
|
4503
|
+
});
|
|
4504
|
+
object_exports.overrideProperties(sessionAttributes, {
|
|
4432
4505
|
id: common_exports.parseExpression("text('id').primaryKey()"),
|
|
4433
4506
|
userId: common_exports.parseExpression("text('user_id').notNull().references(() => user.id)"),
|
|
4434
4507
|
expiresAt: common_exports.parseExpression("integer('expires_at', { mode: 'timestamp' }).notNull()")
|
|
4435
|
-
}
|
|
4508
|
+
});
|
|
4436
4509
|
}
|
|
4437
4510
|
if (drizzleDialect === "mysql") {
|
|
4438
4511
|
imports_exports.addNamed(ast, {
|
|
@@ -4443,16 +4516,16 @@ var lucia_default = defineAddon({
|
|
|
4443
4516
|
"datetime"
|
|
4444
4517
|
]
|
|
4445
4518
|
});
|
|
4446
|
-
object_exports.overrideProperties(userAttributes, {
|
|
4447
|
-
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4519
|
+
object_exports.overrideProperties(userAttributes, { id: common_exports.parseExpression("varchar('id', { length: 255 }).primaryKey()") });
|
|
4520
|
+
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4448
4521
|
username: common_exports.parseExpression("varchar('username', { length: 32 }).notNull().unique()"),
|
|
4449
4522
|
passwordHash: common_exports.parseExpression("varchar('password_hash', { length: 255 }).notNull()")
|
|
4450
|
-
}
|
|
4451
|
-
object_exports.overrideProperties(sessionAttributes, {
|
|
4523
|
+
});
|
|
4524
|
+
object_exports.overrideProperties(sessionAttributes, {
|
|
4452
4525
|
id: common_exports.parseExpression("varchar('id', { length: 255 }).primaryKey()"),
|
|
4453
4526
|
userId: common_exports.parseExpression("varchar('user_id', { length: 255 }).notNull().references(() => user.id)"),
|
|
4454
4527
|
expiresAt: common_exports.parseExpression("datetime('expires_at').notNull()")
|
|
4455
|
-
}
|
|
4528
|
+
});
|
|
4456
4529
|
}
|
|
4457
4530
|
if (drizzleDialect === "postgresql") {
|
|
4458
4531
|
imports_exports.addNamed(ast, {
|
|
@@ -4463,16 +4536,16 @@ var lucia_default = defineAddon({
|
|
|
4463
4536
|
"timestamp"
|
|
4464
4537
|
]
|
|
4465
4538
|
});
|
|
4466
|
-
object_exports.overrideProperties(userAttributes, {
|
|
4467
|
-
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4539
|
+
object_exports.overrideProperties(userAttributes, { id: common_exports.parseExpression("text('id').primaryKey()") });
|
|
4540
|
+
if (options$6.demo) object_exports.overrideProperties(userAttributes, {
|
|
4468
4541
|
username: common_exports.parseExpression("text('username').notNull().unique()"),
|
|
4469
4542
|
passwordHash: common_exports.parseExpression("text('password_hash').notNull()")
|
|
4470
|
-
}
|
|
4471
|
-
object_exports.overrideProperties(sessionAttributes, {
|
|
4543
|
+
});
|
|
4544
|
+
object_exports.overrideProperties(sessionAttributes, {
|
|
4472
4545
|
id: common_exports.parseExpression("text('id').primaryKey()"),
|
|
4473
4546
|
userId: common_exports.parseExpression("text('user_id').notNull().references(() => user.id)"),
|
|
4474
4547
|
expiresAt: common_exports.parseExpression("timestamp('expires_at', { withTimezone: true, mode: 'date' }).notNull()")
|
|
4475
|
-
}
|
|
4548
|
+
});
|
|
4476
4549
|
}
|
|
4477
4550
|
let code = generateCode();
|
|
4478
4551
|
if (typescript) {
|
|
@@ -4971,10 +5044,7 @@ var mdsvex_default = defineAddon({
|
|
|
4971
5044
|
const previousElement = preprocessorArray;
|
|
4972
5045
|
preprocessorArray = array_exports.create();
|
|
4973
5046
|
array_exports.append(preprocessorArray, previousElement);
|
|
4974
|
-
object_exports.
|
|
4975
|
-
name: "preprocess",
|
|
4976
|
-
value: preprocessorArray
|
|
4977
|
-
});
|
|
5047
|
+
object_exports.overrideProperties(exportDefault, { preprocess: preprocessorArray });
|
|
4978
5048
|
}
|
|
4979
5049
|
const mdsvexCall = function_exports.createCall({
|
|
4980
5050
|
name: "mdsvex",
|
|
@@ -5243,19 +5313,19 @@ var playwright_default = defineAddon({
|
|
|
5243
5313
|
const defineConfig = common_exports.parseExpression("defineConfig({})");
|
|
5244
5314
|
const { value: defaultExport } = exports_exports.createDefault(ast, { fallback: defineConfig });
|
|
5245
5315
|
const config = {
|
|
5246
|
-
webServer:
|
|
5316
|
+
webServer: {
|
|
5247
5317
|
command: "npm run build && npm run preview",
|
|
5248
5318
|
port: 4173
|
|
5249
|
-
}
|
|
5250
|
-
testDir:
|
|
5319
|
+
},
|
|
5320
|
+
testDir: "e2e"
|
|
5251
5321
|
};
|
|
5252
5322
|
if (defaultExport.type === "CallExpression" && defaultExport.arguments[0]?.type === "ObjectExpression") {
|
|
5253
5323
|
imports_exports.addNamed(ast, {
|
|
5254
|
-
|
|
5255
|
-
|
|
5324
|
+
imports: ["defineConfig"],
|
|
5325
|
+
from: "@playwright/test"
|
|
5256
5326
|
});
|
|
5257
|
-
object_exports.
|
|
5258
|
-
} else if (defaultExport.type === "ObjectExpression") object_exports.
|
|
5327
|
+
object_exports.overrideProperties(defaultExport.arguments[0], config);
|
|
5328
|
+
} else if (defaultExport.type === "ObjectExpression") object_exports.overrideProperties(defaultExport, config);
|
|
5259
5329
|
else T$2.warn("Unexpected playwright config for playwright add-on. Could not update.");
|
|
5260
5330
|
return generateCode();
|
|
5261
5331
|
});
|
|
@@ -5437,20 +5507,23 @@ var sveltekit_adapter_default = defineAddon({
|
|
|
5437
5507
|
as: adapterName
|
|
5438
5508
|
});
|
|
5439
5509
|
const { value: config } = exports_exports.createDefault(ast, { fallback: object_exports.create({}) });
|
|
5440
|
-
|
|
5441
|
-
if (kitConfig && kitConfig.value.type === "ObjectExpression") {
|
|
5442
|
-
const adapterProp = kitConfig.value.properties.find((p$1) => p$1.type === "Property" && p$1.key.type === "Identifier" && p$1.key.name === "adapter");
|
|
5443
|
-
if (adapterProp) adapterProp.leadingComments = [];
|
|
5444
|
-
object_exports.overrideProperties(kitConfig.value, { properties: { adapter: function_exports.createCall({
|
|
5445
|
-
name: adapterName,
|
|
5446
|
-
args: [],
|
|
5447
|
-
useIdentifiers: true
|
|
5448
|
-
}) } });
|
|
5449
|
-
} else object_exports.addProperties(config, { properties: { kit: object_exports.create({ adapter: function_exports.createCall({
|
|
5510
|
+
object_exports.overrideProperties(config, { kit: { adapter: function_exports.createCall({
|
|
5450
5511
|
name: adapterName,
|
|
5451
5512
|
args: [],
|
|
5452
5513
|
useIdentifiers: true
|
|
5453
|
-
}) }
|
|
5514
|
+
}) } });
|
|
5515
|
+
if (adapter.package !== "@sveltejs/adapter-auto") {
|
|
5516
|
+
const fallback = object_exports.create({});
|
|
5517
|
+
const cfgKitValue = object_exports.property(config, {
|
|
5518
|
+
name: "kit",
|
|
5519
|
+
fallback
|
|
5520
|
+
});
|
|
5521
|
+
const cfgAdapter = object_exports.propertyNode(cfgKitValue, {
|
|
5522
|
+
name: "adapter",
|
|
5523
|
+
fallback
|
|
5524
|
+
});
|
|
5525
|
+
cfgAdapter.leadingComments = [];
|
|
5526
|
+
}
|
|
5454
5527
|
return generateCode();
|
|
5455
5528
|
});
|
|
5456
5529
|
}
|
|
@@ -5667,17 +5740,8 @@ var vitest_addon_default = defineAddon({
|
|
|
5667
5740
|
exclude: ["src/**/*.svelte.{test,spec}.{js,ts}"]
|
|
5668
5741
|
}
|
|
5669
5742
|
});
|
|
5670
|
-
const
|
|
5671
|
-
|
|
5672
|
-
args: []
|
|
5673
|
-
});
|
|
5674
|
-
const { value: defineWorkspaceCall } = exports_exports.createDefault(ast, { fallback: defineConfigFallback });
|
|
5675
|
-
if (defineWorkspaceCall.type !== "CallExpression") T$2.warn("Unexpected vite config. Could not update.");
|
|
5676
|
-
const vitestConfig = function_exports.getArgument(defineWorkspaceCall, {
|
|
5677
|
-
index: 0,
|
|
5678
|
-
fallback: object_exports.create({})
|
|
5679
|
-
});
|
|
5680
|
-
const testObject = object_exports.property(vitestConfig, {
|
|
5743
|
+
const viteConfig = vite_exports.getConfig(ast);
|
|
5744
|
+
const testObject = object_exports.property(viteConfig, {
|
|
5681
5745
|
name: "test",
|
|
5682
5746
|
fallback: object_exports.create({ expect: { requireAssertions: true } })
|
|
5683
5747
|
});
|
|
@@ -5687,6 +5751,22 @@ var vitest_addon_default = defineAddon({
|
|
|
5687
5751
|
});
|
|
5688
5752
|
if (componentTesting) array_exports.append(workspaceArray, clientObjectExpression);
|
|
5689
5753
|
if (unitTesting) array_exports.append(workspaceArray, serverObjectExpression);
|
|
5754
|
+
const importName = "defineConfig";
|
|
5755
|
+
const { statement, alias } = imports_exports.find(ast, {
|
|
5756
|
+
name: importName,
|
|
5757
|
+
from: "vite"
|
|
5758
|
+
});
|
|
5759
|
+
if (statement) {
|
|
5760
|
+
imports_exports.addNamed(ast, {
|
|
5761
|
+
imports: { defineConfig: alias },
|
|
5762
|
+
from: "vitest/config"
|
|
5763
|
+
});
|
|
5764
|
+
imports_exports.remove(ast, {
|
|
5765
|
+
name: importName,
|
|
5766
|
+
from: "vite",
|
|
5767
|
+
statement
|
|
5768
|
+
});
|
|
5769
|
+
}
|
|
5690
5770
|
return generateCode();
|
|
5691
5771
|
});
|
|
5692
5772
|
}
|