sv 0.8.19 → 0.8.20
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/README.md +1 -1
- package/dist/{addons-BHPw2iRi.js → addons-Ce9LFQn0.js} +143 -130
- package/dist/bin.js +3 -3
- package/dist/index.js +1 -1
- package/dist/shared.json +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Element, T, Tag, __commonJS, __export, __toESM
|
|
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";
|
|
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";
|
|
@@ -483,7 +483,8 @@ function addDefault(node, options$6) {
|
|
|
483
483
|
addImportIfNecessary(node, expectedImportDeclaration);
|
|
484
484
|
}
|
|
485
485
|
function addNamed(node, options$6) {
|
|
486
|
-
const
|
|
486
|
+
const o_imports = Array.isArray(options$6.imports) ? Object.fromEntries(options$6.imports.map((n$1) => [n$1, n$1])) : options$6.imports;
|
|
487
|
+
const specifiers = Object.entries(o_imports).map(([key, value]) => {
|
|
487
488
|
const specifier = {
|
|
488
489
|
type: "ImportSpecifier",
|
|
489
490
|
imported: {
|
|
@@ -816,10 +817,78 @@ function getVariableDeclarator(node, variableName) {
|
|
|
816
817
|
function isFunctionDeclaration(node, funcName) {
|
|
817
818
|
return node.type === "FunctionDeclaration" && node.id?.name === funcName;
|
|
818
819
|
}
|
|
820
|
+
var vite_exports = {};
|
|
821
|
+
__export(vite_exports, { addPlugin: () => addPlugin });
|
|
822
|
+
function exportDefaultConfig(ast, options$6 = {}) {
|
|
823
|
+
const { fallback, ignoreWrapper } = options$6;
|
|
824
|
+
let fallbackExpression;
|
|
825
|
+
if (fallback) fallbackExpression = typeof fallback === "string" ? parseExpression(fallback) : fallback;
|
|
826
|
+
else fallbackExpression = create({});
|
|
827
|
+
const { value: rootObject } = createDefault(ast, { fallback: fallbackExpression });
|
|
828
|
+
let configObject;
|
|
829
|
+
if (!ignoreWrapper || !("arguments" in rootObject) || !Array.isArray(rootObject.arguments)) {
|
|
830
|
+
configObject = rootObject;
|
|
831
|
+
return configObject;
|
|
832
|
+
}
|
|
833
|
+
if (rootObject.type !== "CallExpression" || rootObject.callee.type !== "Identifier" || rootObject.callee.name !== ignoreWrapper) {
|
|
834
|
+
configObject = rootObject;
|
|
835
|
+
return configObject;
|
|
836
|
+
}
|
|
837
|
+
const firstArg = getArgument(rootObject, {
|
|
838
|
+
index: 0,
|
|
839
|
+
fallback: create({})
|
|
840
|
+
});
|
|
841
|
+
if (firstArg.type === "ArrowFunctionExpression") {
|
|
842
|
+
const arrowFunction = firstArg;
|
|
843
|
+
if (arrowFunction.body.type === "BlockStatement") {
|
|
844
|
+
const returnStatement = arrowFunction.body.body.find((stmt) => stmt.type === "ReturnStatement");
|
|
845
|
+
if (returnStatement && returnStatement.argument?.type === "ObjectExpression") configObject = returnStatement.argument;
|
|
846
|
+
else {
|
|
847
|
+
configObject = create({});
|
|
848
|
+
const newReturnStatement = {
|
|
849
|
+
type: "ReturnStatement",
|
|
850
|
+
argument: configObject
|
|
851
|
+
};
|
|
852
|
+
arrowFunction.body.body.push(newReturnStatement);
|
|
853
|
+
}
|
|
854
|
+
} else if (arrowFunction.body.type === "ObjectExpression") configObject = arrowFunction.body;
|
|
855
|
+
else {
|
|
856
|
+
configObject = create({});
|
|
857
|
+
arrowFunction.body = configObject;
|
|
858
|
+
arrowFunction.expression = true;
|
|
859
|
+
}
|
|
860
|
+
} else if (firstArg.type === "ObjectExpression") configObject = firstArg;
|
|
861
|
+
else configObject = create({});
|
|
862
|
+
return configObject;
|
|
863
|
+
}
|
|
864
|
+
function addInArrayOfObject(ast, options$6) {
|
|
865
|
+
const { code, arrayProperty, mode = "append" } = options$6;
|
|
866
|
+
const targetArray = property(ast, {
|
|
867
|
+
name: arrayProperty,
|
|
868
|
+
fallback: create$1()
|
|
869
|
+
});
|
|
870
|
+
const expression = parseExpression(code);
|
|
871
|
+
if (mode === "prepend") prepend(targetArray, expression);
|
|
872
|
+
else append(targetArray, expression);
|
|
873
|
+
}
|
|
874
|
+
const addPlugin = (ast, options$6) => {
|
|
875
|
+
addNamed(ast, {
|
|
876
|
+
from: "vite",
|
|
877
|
+
imports: { defineConfig: "defineConfig" }
|
|
878
|
+
});
|
|
879
|
+
const configObject = exportDefaultConfig(ast, {
|
|
880
|
+
fallback: "defineConfig()",
|
|
881
|
+
ignoreWrapper: "defineConfig"
|
|
882
|
+
});
|
|
883
|
+
addInArrayOfObject(configObject, {
|
|
884
|
+
arrayProperty: "plugins",
|
|
885
|
+
...options$6
|
|
886
|
+
});
|
|
887
|
+
};
|
|
819
888
|
|
|
820
889
|
//#endregion
|
|
821
890
|
//#region packages/cli/commands/add/utils.ts
|
|
822
|
-
var import_picocolors$5 = __toESM(require_picocolors(), 1);
|
|
891
|
+
var import_picocolors$5 = __toESM$1(require_picocolors$1(), 1);
|
|
823
892
|
function getPackageJson(cwd) {
|
|
824
893
|
const packageText = readFile(cwd, commonFilePaths.packageJson);
|
|
825
894
|
if (!packageText) {
|
|
@@ -990,7 +1059,7 @@ function parseKitOptions(cwd) {
|
|
|
990
1059
|
|
|
991
1060
|
//#endregion
|
|
992
1061
|
//#region packages/cli/lib/install.ts
|
|
993
|
-
var import_picocolors$4 = __toESM(require_picocolors(), 1);
|
|
1062
|
+
var import_picocolors$4 = __toESM$1(require_picocolors$1(), 1);
|
|
994
1063
|
async function installAddon({ addons, cwd, options: options$6, packageManager = "npm" }) {
|
|
995
1064
|
const workspace = await createWorkspace({
|
|
996
1065
|
cwd,
|
|
@@ -1183,8 +1252,8 @@ else if (y > 0) ret += `${CSI}${y}B`;
|
|
|
1183
1252
|
beep
|
|
1184
1253
|
};
|
|
1185
1254
|
} });
|
|
1186
|
-
var import_src$1 = __toESM
|
|
1187
|
-
var import_picocolors$3 = __toESM
|
|
1255
|
+
var import_src$1 = __toESM(require_src(), 1);
|
|
1256
|
+
var import_picocolors$3 = __toESM(require_picocolors(), 1);
|
|
1188
1257
|
function hu({ onlyFirst: e$1 = !1 } = {}) {
|
|
1189
1258
|
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("|");
|
|
1190
1259
|
return new RegExp(t, e$1 ? void 0 : "g");
|
|
@@ -1919,9 +1988,9 @@ B$1 = new WeakMap(), k$1 = new WeakMap(), I = new WeakMap(), v$1 = new WeakMap()
|
|
|
1919
1988
|
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());
|
|
1920
1989
|
}
|
|
1921
1990
|
};
|
|
1922
|
-
var import_picocolors$1 = __toESM
|
|
1923
|
-
var import_picocolors$2 = __toESM
|
|
1924
|
-
var import_src = __toESM
|
|
1991
|
+
var import_picocolors$1 = __toESM(require_picocolors(), 1);
|
|
1992
|
+
var import_picocolors$2 = __toESM(require_picocolors(), 1);
|
|
1993
|
+
var import_src = __toESM(require_src(), 1);
|
|
1925
1994
|
function Pe() {
|
|
1926
1995
|
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";
|
|
1927
1996
|
}
|
|
@@ -2621,7 +2690,7 @@ else return true;
|
|
|
2621
2690
|
if (version.patch === below.patch) return false;
|
|
2622
2691
|
return undefined;
|
|
2623
2692
|
}
|
|
2624
|
-
var import_picocolors = __toESM
|
|
2693
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
2625
2694
|
var colors = import_picocolors.default;
|
|
2626
2695
|
|
|
2627
2696
|
//#endregion
|
|
@@ -2638,26 +2707,10 @@ var devtools_json_default = defineAddon({
|
|
|
2638
2707
|
const { ast, generateCode } = parseScript$1(content);
|
|
2639
2708
|
const vitePluginName = "devtoolsJson";
|
|
2640
2709
|
imports_exports.addDefault(ast, {
|
|
2641
|
-
|
|
2642
|
-
|
|
2710
|
+
as: vitePluginName,
|
|
2711
|
+
from: "vite-plugin-devtools-json"
|
|
2643
2712
|
});
|
|
2644
|
-
|
|
2645
|
-
name: "defineConfig",
|
|
2646
|
-
args: []
|
|
2647
|
-
}) });
|
|
2648
|
-
const param1 = function_exports.getArgument(rootObject, {
|
|
2649
|
-
index: 0,
|
|
2650
|
-
fallback: object_exports.create({})
|
|
2651
|
-
});
|
|
2652
|
-
const pluginsArray = object_exports.property(param1, {
|
|
2653
|
-
name: "plugins",
|
|
2654
|
-
fallback: array_exports.create()
|
|
2655
|
-
});
|
|
2656
|
-
const pluginFunctionCall = function_exports.createCall({
|
|
2657
|
-
name: vitePluginName,
|
|
2658
|
-
args: []
|
|
2659
|
-
});
|
|
2660
|
-
array_exports.append(pluginsArray, pluginFunctionCall);
|
|
2713
|
+
vite_exports.addPlugin(ast, { code: `${vitePluginName}()` });
|
|
2661
2714
|
return generateCode();
|
|
2662
2715
|
});
|
|
2663
2716
|
}
|
|
@@ -2919,10 +2972,7 @@ var drizzle_default = defineAddon({
|
|
|
2919
2972
|
if (options$6.database === "sqlite") {
|
|
2920
2973
|
imports_exports.addNamed(ast, {
|
|
2921
2974
|
from: "drizzle-orm/sqlite-core",
|
|
2922
|
-
imports:
|
|
2923
|
-
sqliteTable: "sqliteTable",
|
|
2924
|
-
integer: "integer"
|
|
2925
|
-
}
|
|
2975
|
+
imports: ["sqliteTable", "integer"]
|
|
2926
2976
|
});
|
|
2927
2977
|
userSchemaExpression = common_exports.parseExpression(`sqliteTable('user', {
|
|
2928
2978
|
id: integer('id').primaryKey(),
|
|
@@ -2932,11 +2982,11 @@ var drizzle_default = defineAddon({
|
|
|
2932
2982
|
if (options$6.database === "mysql") {
|
|
2933
2983
|
imports_exports.addNamed(ast, {
|
|
2934
2984
|
from: "drizzle-orm/mysql-core",
|
|
2935
|
-
imports:
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2985
|
+
imports: [
|
|
2986
|
+
"mysqlTable",
|
|
2987
|
+
"serial",
|
|
2988
|
+
"int"
|
|
2989
|
+
]
|
|
2940
2990
|
});
|
|
2941
2991
|
userSchemaExpression = common_exports.parseExpression(`mysqlTable('user', {
|
|
2942
2992
|
id: serial('id').primaryKey(),
|
|
@@ -2946,11 +2996,11 @@ var drizzle_default = defineAddon({
|
|
|
2946
2996
|
if (options$6.database === "postgresql") {
|
|
2947
2997
|
imports_exports.addNamed(ast, {
|
|
2948
2998
|
from: "drizzle-orm/pg-core",
|
|
2949
|
-
imports:
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2999
|
+
imports: [
|
|
3000
|
+
"pgTable",
|
|
3001
|
+
"serial",
|
|
3002
|
+
"integer"
|
|
3003
|
+
]
|
|
2954
3004
|
});
|
|
2955
3005
|
userSchemaExpression = common_exports.parseExpression(`pgTable('user', {
|
|
2956
3006
|
id: serial('id').primaryKey(),
|
|
@@ -2973,7 +3023,7 @@ var drizzle_default = defineAddon({
|
|
|
2973
3023
|
const { ast, generateCode } = parseScript$1(content);
|
|
2974
3024
|
imports_exports.addNamed(ast, {
|
|
2975
3025
|
from: "$env/dynamic/private",
|
|
2976
|
-
imports:
|
|
3026
|
+
imports: ["env"]
|
|
2977
3027
|
});
|
|
2978
3028
|
imports_exports.addNamespace(ast, {
|
|
2979
3029
|
from: "./schema",
|
|
@@ -2989,23 +3039,23 @@ var drizzle_default = defineAddon({
|
|
|
2989
3039
|
});
|
|
2990
3040
|
imports_exports.addNamed(ast, {
|
|
2991
3041
|
from: "drizzle-orm/better-sqlite3",
|
|
2992
|
-
imports:
|
|
3042
|
+
imports: ["drizzle"]
|
|
2993
3043
|
});
|
|
2994
3044
|
clientExpression = common_exports.parseExpression("new Database(env.DATABASE_URL)");
|
|
2995
3045
|
}
|
|
2996
3046
|
if (options$6.sqlite === "libsql" || options$6.sqlite === "turso") {
|
|
2997
3047
|
imports_exports.addNamed(ast, {
|
|
2998
3048
|
from: "@libsql/client",
|
|
2999
|
-
imports:
|
|
3049
|
+
imports: ["createClient"]
|
|
3000
3050
|
});
|
|
3001
3051
|
imports_exports.addNamed(ast, {
|
|
3002
3052
|
from: "drizzle-orm/libsql",
|
|
3003
|
-
imports:
|
|
3053
|
+
imports: ["drizzle"]
|
|
3004
3054
|
});
|
|
3005
3055
|
if (options$6.sqlite === "turso") {
|
|
3006
3056
|
imports_exports.addNamed(ast, {
|
|
3007
3057
|
from: "$app/environment",
|
|
3008
|
-
imports:
|
|
3058
|
+
imports: ["dev"]
|
|
3009
3059
|
});
|
|
3010
3060
|
const authTokenCheck = common_exports.parseStatement("if (!dev && !env.DATABASE_AUTH_TOKEN) throw new Error('DATABASE_AUTH_TOKEN is not set');");
|
|
3011
3061
|
ast.body.push(authTokenCheck);
|
|
@@ -3019,18 +3069,18 @@ var drizzle_default = defineAddon({
|
|
|
3019
3069
|
});
|
|
3020
3070
|
imports_exports.addNamed(ast, {
|
|
3021
3071
|
from: "drizzle-orm/mysql2",
|
|
3022
|
-
imports:
|
|
3072
|
+
imports: ["drizzle"]
|
|
3023
3073
|
});
|
|
3024
3074
|
clientExpression = common_exports.parseExpression("mysql.createPool(env.DATABASE_URL)");
|
|
3025
3075
|
}
|
|
3026
3076
|
if (options$6.postgresql === "neon") {
|
|
3027
3077
|
imports_exports.addNamed(ast, {
|
|
3028
3078
|
from: "@neondatabase/serverless",
|
|
3029
|
-
imports:
|
|
3079
|
+
imports: ["neon"]
|
|
3030
3080
|
});
|
|
3031
3081
|
imports_exports.addNamed(ast, {
|
|
3032
3082
|
from: "drizzle-orm/neon-http",
|
|
3033
|
-
imports:
|
|
3083
|
+
imports: ["drizzle"]
|
|
3034
3084
|
});
|
|
3035
3085
|
clientExpression = common_exports.parseExpression("neon(env.DATABASE_URL)");
|
|
3036
3086
|
}
|
|
@@ -3041,7 +3091,7 @@ var drizzle_default = defineAddon({
|
|
|
3041
3091
|
});
|
|
3042
3092
|
imports_exports.addNamed(ast, {
|
|
3043
3093
|
from: "drizzle-orm/postgres-js",
|
|
3044
|
-
imports:
|
|
3094
|
+
imports: ["drizzle"]
|
|
3045
3095
|
});
|
|
3046
3096
|
clientExpression = common_exports.parseExpression("postgres(env.DATABASE_URL)");
|
|
3047
3097
|
}
|
|
@@ -3242,7 +3292,7 @@ var eslint_default = defineAddon({
|
|
|
3242
3292
|
});
|
|
3243
3293
|
imports_exports.addNamed(ast, {
|
|
3244
3294
|
from: "node:url",
|
|
3245
|
-
imports:
|
|
3295
|
+
imports: ["fileURLToPath"]
|
|
3246
3296
|
});
|
|
3247
3297
|
imports_exports.addDefault(ast, {
|
|
3248
3298
|
from: "globals",
|
|
@@ -3258,7 +3308,7 @@ var eslint_default = defineAddon({
|
|
|
3258
3308
|
});
|
|
3259
3309
|
imports_exports.addNamed(ast, {
|
|
3260
3310
|
from: "@eslint/compat",
|
|
3261
|
-
imports:
|
|
3311
|
+
imports: ["includeIgnoreFile"]
|
|
3262
3312
|
});
|
|
3263
3313
|
return generateCode();
|
|
3264
3314
|
});
|
|
@@ -4355,11 +4405,11 @@ var lucia_default = defineAddon({
|
|
|
4355
4405
|
if (drizzleDialect === "sqlite" || drizzleDialect === "turso") {
|
|
4356
4406
|
imports_exports.addNamed(ast, {
|
|
4357
4407
|
from: "drizzle-orm/sqlite-core",
|
|
4358
|
-
imports:
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4408
|
+
imports: [
|
|
4409
|
+
"sqliteTable",
|
|
4410
|
+
"text",
|
|
4411
|
+
"integer"
|
|
4412
|
+
]
|
|
4363
4413
|
});
|
|
4364
4414
|
object_exports.overrideProperties(userAttributes, { properties: { id: common_exports.parseExpression("text('id').primaryKey()") } });
|
|
4365
4415
|
if (options$6.demo) object_exports.overrideProperties(userAttributes, { properties: {
|
|
@@ -4375,11 +4425,11 @@ var lucia_default = defineAddon({
|
|
|
4375
4425
|
if (drizzleDialect === "mysql") {
|
|
4376
4426
|
imports_exports.addNamed(ast, {
|
|
4377
4427
|
from: "drizzle-orm/mysql-core",
|
|
4378
|
-
imports:
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4428
|
+
imports: [
|
|
4429
|
+
"mysqlTable",
|
|
4430
|
+
"varchar",
|
|
4431
|
+
"datetime"
|
|
4432
|
+
]
|
|
4383
4433
|
});
|
|
4384
4434
|
object_exports.overrideProperties(userAttributes, { properties: { id: common_exports.parseExpression("varchar('id', { length: 255 }).primaryKey()") } });
|
|
4385
4435
|
if (options$6.demo) object_exports.overrideProperties(userAttributes, { properties: {
|
|
@@ -4395,11 +4445,11 @@ var lucia_default = defineAddon({
|
|
|
4395
4445
|
if (drizzleDialect === "postgresql") {
|
|
4396
4446
|
imports_exports.addNamed(ast, {
|
|
4397
4447
|
from: "drizzle-orm/pg-core",
|
|
4398
|
-
imports:
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4448
|
+
imports: [
|
|
4449
|
+
"pgTable",
|
|
4450
|
+
"text",
|
|
4451
|
+
"timestamp"
|
|
4452
|
+
]
|
|
4403
4453
|
});
|
|
4404
4454
|
object_exports.overrideProperties(userAttributes, { properties: { id: common_exports.parseExpression("text('id').primaryKey()") } });
|
|
4405
4455
|
if (options$6.demo) object_exports.overrideProperties(userAttributes, { properties: {
|
|
@@ -4427,26 +4477,23 @@ var lucia_default = defineAddon({
|
|
|
4427
4477
|
});
|
|
4428
4478
|
imports_exports.addNamed(ast, {
|
|
4429
4479
|
from: "$lib/server/db",
|
|
4430
|
-
imports:
|
|
4480
|
+
imports: ["db"]
|
|
4431
4481
|
});
|
|
4432
4482
|
imports_exports.addNamed(ast, {
|
|
4433
4483
|
from: "@oslojs/encoding",
|
|
4434
|
-
imports:
|
|
4435
|
-
encodeBase64url: "encodeBase64url",
|
|
4436
|
-
encodeHexLowerCase: "encodeHexLowerCase"
|
|
4437
|
-
}
|
|
4484
|
+
imports: ["encodeBase64url", "encodeHexLowerCase"]
|
|
4438
4485
|
});
|
|
4439
4486
|
imports_exports.addNamed(ast, {
|
|
4440
4487
|
from: "@oslojs/crypto/sha2",
|
|
4441
|
-
imports:
|
|
4488
|
+
imports: ["sha256"]
|
|
4442
4489
|
});
|
|
4443
4490
|
imports_exports.addNamed(ast, {
|
|
4444
4491
|
from: "drizzle-orm",
|
|
4445
|
-
imports:
|
|
4492
|
+
imports: ["eq"]
|
|
4446
4493
|
});
|
|
4447
4494
|
if (typescript) imports_exports.addNamed(ast, {
|
|
4448
4495
|
from: "@sveltejs/kit",
|
|
4449
|
-
imports:
|
|
4496
|
+
imports: ["RequestEvent"],
|
|
4450
4497
|
isType: true
|
|
4451
4498
|
});
|
|
4452
4499
|
const ms = new MagicString(generateCode().trim());
|
|
@@ -4900,7 +4947,7 @@ var mdsvex_default = defineAddon({
|
|
|
4900
4947
|
const { ast, generateCode } = parseScript$1(content);
|
|
4901
4948
|
imports_exports.addNamed(ast, {
|
|
4902
4949
|
from: "mdsvex",
|
|
4903
|
-
imports:
|
|
4950
|
+
imports: ["mdsvex"]
|
|
4904
4951
|
});
|
|
4905
4952
|
const { value: exportDefault } = exports_exports.createDefault(ast, { fallback: object_exports.create({}) });
|
|
4906
4953
|
let preprocessorArray = object_exports.property(exportDefault, {
|
|
@@ -5018,41 +5065,20 @@ var paraglide_default = defineAddon({
|
|
|
5018
5065
|
const { ast, generateCode } = parseScript$1(content);
|
|
5019
5066
|
const vitePluginName = "paraglideVitePlugin";
|
|
5020
5067
|
imports_exports.addNamed(ast, {
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
});
|
|
5024
|
-
const { value: rootObject } = exports_exports.createDefault(ast, { fallback: function_exports.createCall({
|
|
5025
|
-
name: "defineConfig",
|
|
5026
|
-
args: []
|
|
5027
|
-
}) });
|
|
5028
|
-
const param1 = function_exports.getArgument(rootObject, {
|
|
5029
|
-
index: 0,
|
|
5030
|
-
fallback: object_exports.create({})
|
|
5031
|
-
});
|
|
5032
|
-
const pluginsArray = object_exports.property(param1, {
|
|
5033
|
-
name: "plugins",
|
|
5034
|
-
fallback: array_exports.create()
|
|
5035
|
-
});
|
|
5036
|
-
const pluginFunctionCall = function_exports.createCall({
|
|
5037
|
-
name: vitePluginName,
|
|
5038
|
-
args: []
|
|
5039
|
-
});
|
|
5040
|
-
const pluginConfig = object_exports.create({
|
|
5041
|
-
project: "./project.inlang",
|
|
5042
|
-
outdir: `./${paraglideOutDir}`
|
|
5043
|
-
});
|
|
5044
|
-
function_exports.getArgument(pluginFunctionCall, {
|
|
5045
|
-
index: 0,
|
|
5046
|
-
fallback: pluginConfig
|
|
5068
|
+
imports: [vitePluginName],
|
|
5069
|
+
from: "@inlang/paraglide-js"
|
|
5047
5070
|
});
|
|
5048
|
-
|
|
5071
|
+
vite_exports.addPlugin(ast, { code: `${vitePluginName}({
|
|
5072
|
+
project: './project.inlang',
|
|
5073
|
+
outdir: './${paraglideOutDir}'
|
|
5074
|
+
})` });
|
|
5049
5075
|
return generateCode();
|
|
5050
5076
|
});
|
|
5051
5077
|
sv.file(`src/hooks.${ext}`, (content) => {
|
|
5052
5078
|
const { ast, generateCode } = parseScript$1(content);
|
|
5053
5079
|
imports_exports.addNamed(ast, {
|
|
5054
5080
|
from: "$lib/paraglide/runtime",
|
|
5055
|
-
imports:
|
|
5081
|
+
imports: ["deLocalizeUrl"]
|
|
5056
5082
|
});
|
|
5057
5083
|
const expression = common_exports.parseExpression("(request) => deLocalizeUrl(request.url).pathname");
|
|
5058
5084
|
const rerouteIdentifier = variables_exports.declaration(ast, {
|
|
@@ -5071,7 +5097,7 @@ var paraglide_default = defineAddon({
|
|
|
5071
5097
|
const { ast, generateCode } = parseScript$1(content);
|
|
5072
5098
|
imports_exports.addNamed(ast, {
|
|
5073
5099
|
from: "$lib/paraglide/server",
|
|
5074
|
-
imports:
|
|
5100
|
+
imports: ["paraglideMiddleware"]
|
|
5075
5101
|
});
|
|
5076
5102
|
const hookHandleContent = `({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => {
|
|
5077
5103
|
event.request = request;
|
|
@@ -5112,19 +5138,19 @@ var paraglide_default = defineAddon({
|
|
|
5112
5138
|
const { script, template, generateCode } = parseSvelte(content, { typescript });
|
|
5113
5139
|
imports_exports.addNamed(script.ast, {
|
|
5114
5140
|
from: "$lib/paraglide/messages.js",
|
|
5115
|
-
imports:
|
|
5141
|
+
imports: ["m"]
|
|
5116
5142
|
});
|
|
5117
5143
|
imports_exports.addNamed(script.ast, {
|
|
5118
5144
|
from: "$app/navigation",
|
|
5119
|
-
imports:
|
|
5145
|
+
imports: ["goto"]
|
|
5120
5146
|
});
|
|
5121
5147
|
imports_exports.addNamed(script.ast, {
|
|
5122
5148
|
from: "$app/state",
|
|
5123
|
-
imports:
|
|
5149
|
+
imports: ["page"]
|
|
5124
5150
|
});
|
|
5125
5151
|
imports_exports.addNamed(script.ast, {
|
|
5126
5152
|
from: "$lib/paraglide/runtime",
|
|
5127
|
-
imports:
|
|
5153
|
+
imports: ["setLocale"]
|
|
5128
5154
|
});
|
|
5129
5155
|
const scriptCode = new MagicString(script.generateCode());
|
|
5130
5156
|
const templateCode = new MagicString(template.source);
|
|
@@ -5217,7 +5243,7 @@ var playwright_default = defineAddon({
|
|
|
5217
5243
|
if (defaultExport.type === "CallExpression" && defaultExport.arguments[0]?.type === "ObjectExpression") {
|
|
5218
5244
|
imports_exports.addNamed(ast, {
|
|
5219
5245
|
from: "@playwright/test",
|
|
5220
|
-
imports:
|
|
5246
|
+
imports: ["defineConfig"]
|
|
5221
5247
|
});
|
|
5222
5248
|
object_exports.addProperties(defaultExport.arguments[0], { properties: config });
|
|
5223
5249
|
} else if (defaultExport.type === "ObjectExpression") object_exports.addProperties(defaultExport, { properties: config });
|
|
@@ -5465,26 +5491,13 @@ var tailwindcss_default = defineAddon({
|
|
|
5465
5491
|
const { ast, generateCode } = parseScript$1(content);
|
|
5466
5492
|
const vitePluginName = "tailwindcss";
|
|
5467
5493
|
imports_exports.addDefault(ast, {
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
});
|
|
5471
|
-
const { value: rootObject } = exports_exports.createDefault(ast, { fallback: function_exports.createCall({
|
|
5472
|
-
name: "defineConfig",
|
|
5473
|
-
args: []
|
|
5474
|
-
}) });
|
|
5475
|
-
const param1 = function_exports.getArgument(rootObject, {
|
|
5476
|
-
index: 0,
|
|
5477
|
-
fallback: object_exports.create({})
|
|
5494
|
+
as: vitePluginName,
|
|
5495
|
+
from: "@tailwindcss/vite"
|
|
5478
5496
|
});
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
});
|
|
5483
|
-
const pluginFunctionCall = function_exports.createCall({
|
|
5484
|
-
name: vitePluginName,
|
|
5485
|
-
args: []
|
|
5497
|
+
vite_exports.addPlugin(ast, {
|
|
5498
|
+
code: `${vitePluginName}()`,
|
|
5499
|
+
mode: "prepend"
|
|
5486
5500
|
});
|
|
5487
|
-
array_exports.prepend(pluginsArray, pluginFunctionCall);
|
|
5488
5501
|
return generateCode();
|
|
5489
5502
|
});
|
|
5490
5503
|
sv.file("src/app.css", (content) => {
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { AGENT_NAMES, Command, De, Fe, Ge, J, Ke, Option, T, Ue, Vu, We, __toESM$1 as __toESM, addPnpmBuildDependencies, create, detect, et, from, getUserAgent, installDependencies, installOption, ke, packageManagerPrompt, program, require_picocolors$1 as require_picocolors, resolveCommand, templates, up, ze } from "./package-manager-DO5R9a6p.js";
|
|
3
|
-
import { applyAddons, communityAddonIds, createWorkspace, formatFiles, getAddonDetails, getCommunityAddon, getHighlighter, isVersionUnsupportedBelow, officialAddons, setupAddons } from "./addons-
|
|
3
|
+
import { applyAddons, communityAddonIds, createWorkspace, formatFiles, getAddonDetails, getCommunityAddon, getHighlighter, isVersionUnsupportedBelow, officialAddons, setupAddons } from "./addons-Ce9LFQn0.js";
|
|
4
4
|
import fs, { existsSync } from "node:fs";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -12,7 +12,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
12
12
|
|
|
13
13
|
//#region packages/cli/package.json
|
|
14
14
|
var name = "sv";
|
|
15
|
-
var version = "0.8.
|
|
15
|
+
var version = "0.8.20";
|
|
16
16
|
var type = "module";
|
|
17
17
|
var description = "A CLI for creating and updating SvelteKit projects";
|
|
18
18
|
var license = "MIT";
|
|
@@ -1238,7 +1238,7 @@ const create$1 = new Command("create").description("scaffolds a new SvelteKit pr
|
|
|
1238
1238
|
}
|
|
1239
1239
|
if (!packageManager) {
|
|
1240
1240
|
const { args: args$1, command: command$1 } = resolveCommand(pm, "install", []);
|
|
1241
|
-
initialSteps.push(
|
|
1241
|
+
initialSteps.push(` ${i++}: ${highlight(`${command$1} ${args$1.join(" ")}`)}`);
|
|
1242
1242
|
}
|
|
1243
1243
|
const { args, command } = resolveCommand(pm, "run", ["dev", "--open"]);
|
|
1244
1244
|
const pmRunCmd = `${command} ${args.join(" ")}`;
|
package/dist/index.js
CHANGED
package/dist/shared.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "README.md",
|
|
5
5
|
"include": [],
|
|
6
6
|
"exclude": [],
|
|
7
|
-
"contents": "# sv\n\nEverything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).\n\n## Creating a project\n\nIf you're seeing this, you've probably already done this step. Congrats!\n\n```
|
|
7
|
+
"contents": "# sv\n\nEverything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).\n\n## Creating a project\n\nIf you're seeing this, you've probably already done this step. Congrats!\n\n```sh\n# create a new project in the current directory\nnpx sv create\n\n# create a new project in my-app\nnpx sv create my-app\n```\n\n## Developing\n\nOnce you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:\n\n```sh\nnpm run dev\n\n# or start the server and open the app in a new browser tab\nnpm run dev -- --open\n```\n\n## Building\n\nTo create a production version of your app:\n\n```sh\nnpm run build\n```\n\nYou can preview the production build with `npm run preview`.\n\n> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.\n"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "jsconfig.json",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"library"
|
|
29
29
|
],
|
|
30
30
|
"exclude": [],
|
|
31
|
-
"contents": "# Svelte library\n\nEverything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).\n\nRead more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).\n\n## Creating a project\n\nIf you're seeing this, you've probably already done this step. Congrats!\n\n```
|
|
31
|
+
"contents": "# Svelte library\n\nEverything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).\n\nRead more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).\n\n## Creating a project\n\nIf you're seeing this, you've probably already done this step. Congrats!\n\n```sh\n# create a new project in the current directory\nnpx sv create\n\n# create a new project in my-app\nnpx sv create my-app\n```\n\n## Developing\n\nOnce you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:\n\n```sh\nnpm run dev\n\n# or start the server and open the app in a new browser tab\nnpm run dev -- --open\n```\n\nEverything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.\n\n## Building\n\nTo build your library:\n\n```sh\nnpm run package\n```\n\nTo create a production version of your showcase app:\n\n```sh\nnpm run build\n```\n\nYou can preview the production build with `npm run preview`.\n\n> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.\n\n## Publishing\n\nGo into the `package.json` and give your package the desired name through the `\"name\"` option. Also consider adding a `\"license\"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).\n\nTo publish your library to [npm](https://www.npmjs.com):\n\n```sh\nnpm publish\n```\n"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "jsconfig.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A CLI for creating and updating SvelteKit projects",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"ps-tree": "^1.2.0",
|
|
37
37
|
"tinyexec": "^0.3.2",
|
|
38
38
|
"valibot": "^0.41.0",
|
|
39
|
-
"@sveltejs/addons": "0.0.0",
|
|
40
39
|
"@sveltejs/cli-core": "0.0.0",
|
|
41
|
-
"@sveltejs/create": "0.0.0"
|
|
40
|
+
"@sveltejs/create": "0.0.0",
|
|
41
|
+
"@sveltejs/addons": "0.0.0"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"create",
|