skeleton 4.12.1 → 4.13.0
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/index.mjs +1 -29
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,6 @@ import { extname as extname$1 } from "path";
|
|
|
21
21
|
import { Argument, Command, Option } from "commander";
|
|
22
22
|
import { fileURLToPath } from "node:url";
|
|
23
23
|
import { bgBlueBright, bgGreenBright, black, dim, red } from "colorette";
|
|
24
|
-
|
|
25
24
|
//#region src/utility/install-dependencies.ts
|
|
26
25
|
const exec = promisify(child_process.exec);
|
|
27
26
|
async function installDependencies(cwd = process.cwd()) {
|
|
@@ -29,7 +28,6 @@ async function installDependencies(cwd = process.cwd()) {
|
|
|
29
28
|
if (!resolvedCommand) throw new Error("Could not resolve package manager command.");
|
|
30
29
|
return exec(`${resolvedCommand.command} ${resolvedCommand.args.join(" ")}`, { cwd });
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
//#endregion
|
|
34
32
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-classes.ts
|
|
35
33
|
const COLOR_PAIRING_REGEXES = [
|
|
@@ -237,7 +235,6 @@ function transformClasses(code) {
|
|
|
237
235
|
return result.replace(migration.find, migration.replace);
|
|
238
236
|
}, code) };
|
|
239
237
|
}
|
|
240
|
-
|
|
241
238
|
//#endregion
|
|
242
239
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-stylesheet.ts
|
|
243
240
|
function transformStylesheet$1(code) {
|
|
@@ -252,7 +249,6 @@ function transformStylesheet$1(code) {
|
|
|
252
249
|
return { code };
|
|
253
250
|
}
|
|
254
251
|
}
|
|
255
|
-
|
|
256
252
|
//#endregion
|
|
257
253
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-app.css.ts
|
|
258
254
|
function getTailwindImport(root) {
|
|
@@ -290,7 +286,6 @@ function transformAppCss(code, theme) {
|
|
|
290
286
|
else root.prepend(nodes);
|
|
291
287
|
return { code: root.toString() };
|
|
292
288
|
}
|
|
293
|
-
|
|
294
289
|
//#endregion
|
|
295
290
|
//#region src/commands/migrate/migrations/skeleton-3/utility/theme-mappings.ts
|
|
296
291
|
const THEME_MAPPINGS = {
|
|
@@ -335,7 +330,6 @@ const THEME_MAPPINGS = {
|
|
|
335
330
|
value: "crimson"
|
|
336
331
|
}
|
|
337
332
|
};
|
|
338
|
-
|
|
339
333
|
//#endregion
|
|
340
334
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-app.html.ts
|
|
341
335
|
function transformAppHtml(code) {
|
|
@@ -368,7 +362,6 @@ function transformAppHtml(code) {
|
|
|
368
362
|
} }
|
|
369
363
|
};
|
|
370
364
|
}
|
|
371
|
-
|
|
372
365
|
//#endregion
|
|
373
366
|
//#region src/utility/ts-morph/add-named-import.ts
|
|
374
367
|
function addNamedImport(file, specifier, name) {
|
|
@@ -382,7 +375,6 @@ function addNamedImport(file, specifier, name) {
|
|
|
382
375
|
namedImports: [name]
|
|
383
376
|
});
|
|
384
377
|
}
|
|
385
|
-
|
|
386
378
|
//#endregion
|
|
387
379
|
//#region src/utility/ts-morph/parse-source-file.ts
|
|
388
380
|
const project = new Project({
|
|
@@ -394,7 +386,6 @@ const project = new Project({
|
|
|
394
386
|
function parseSourceFile(code) {
|
|
395
387
|
return project.createSourceFile(`${nanoid()}.ts`, code);
|
|
396
388
|
}
|
|
397
|
-
|
|
398
389
|
//#endregion
|
|
399
390
|
//#region src/commands/migrate/migrations/skeleton-3/utility/export-mappings.ts
|
|
400
391
|
const EXPORT_MAPPINGS = {
|
|
@@ -785,7 +776,6 @@ const EXPORT_MAPPINGS = {
|
|
|
785
776
|
}
|
|
786
777
|
}
|
|
787
778
|
};
|
|
788
|
-
|
|
789
779
|
//#endregion
|
|
790
780
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-module.ts
|
|
791
781
|
function transformModule$1(code) {
|
|
@@ -837,7 +827,6 @@ function transformModule$1(code) {
|
|
|
837
827
|
meta: { skeletonImports }
|
|
838
828
|
};
|
|
839
829
|
}
|
|
840
|
-
|
|
841
830
|
//#endregion
|
|
842
831
|
//#region src/utility/sort-properties-alphabetically.ts
|
|
843
832
|
function sortPropertiesAlphabetically(object) {
|
|
@@ -846,7 +835,6 @@ function sortPropertiesAlphabetically(object) {
|
|
|
846
835
|
for (const [key, value] of sortedEntries) orderedObject[key] = value;
|
|
847
836
|
return orderedObject;
|
|
848
837
|
}
|
|
849
|
-
|
|
850
838
|
//#endregion
|
|
851
839
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-package.json.ts
|
|
852
840
|
function transformPackageJson$1(code, skeletonVersion, skeletonSvelteVersion) {
|
|
@@ -871,13 +859,11 @@ function transformPackageJson$1(code, skeletonVersion, skeletonSvelteVersion) {
|
|
|
871
859
|
meta: { isUsingComponents }
|
|
872
860
|
};
|
|
873
861
|
}
|
|
874
|
-
|
|
875
862
|
//#endregion
|
|
876
863
|
//#region src/utility/svelte/has-range.ts
|
|
877
864
|
function hasRange(node) {
|
|
878
865
|
return "start" in node && "end" in node && typeof node.start === "number" && typeof node.end === "number";
|
|
879
866
|
}
|
|
880
|
-
|
|
881
867
|
//#endregion
|
|
882
868
|
//#region src/utility/svelte/rename-component.ts
|
|
883
869
|
function renameComponent(s, node, name) {
|
|
@@ -887,7 +873,6 @@ function renameComponent(s, node, name) {
|
|
|
887
873
|
if (indexOfNonSelfClosingTag === -1 || node.start + indexOfNonSelfClosingTag > node.end) return;
|
|
888
874
|
s.update(node.start + indexOfNonSelfClosingTag + 2, node.start + indexOfNonSelfClosingTag + 2 + node.name.length, name);
|
|
889
875
|
}
|
|
890
|
-
|
|
891
876
|
//#endregion
|
|
892
877
|
//#region src/commands/migrate/migrations/skeleton-3/transformers/transform-svelte.ts
|
|
893
878
|
function transformScript$1(s, script) {
|
|
@@ -941,14 +926,12 @@ function transformSvelte$1(code) {
|
|
|
941
926
|
transformCss$1(s, root.css);
|
|
942
927
|
return { code: s.toString() };
|
|
943
928
|
}
|
|
944
|
-
|
|
945
929
|
//#endregion
|
|
946
930
|
//#region src/commands/migrate/migrations/skeleton-3/utility/constants.ts
|
|
947
931
|
const FALLBACK_THEME = {
|
|
948
932
|
type: "preset",
|
|
949
933
|
value: "cerberus"
|
|
950
934
|
};
|
|
951
|
-
|
|
952
935
|
//#endregion
|
|
953
936
|
//#region src/commands/migrate/migrations/skeleton-3/index.ts
|
|
954
937
|
async function skeleton_3_default(options) {
|
|
@@ -1106,7 +1089,6 @@ async function skeleton_3_default(options) {
|
|
|
1106
1089
|
}
|
|
1107
1090
|
log.info("Migration complete! Visit https://skeleton.dev for more information.");
|
|
1108
1091
|
}
|
|
1109
|
-
|
|
1110
1092
|
//#endregion
|
|
1111
1093
|
//#region src/commands/migrate/migrations/skeleton-4/utility/identifier-mappings.ts
|
|
1112
1094
|
const IDENTIFIER_MAPPINGS = {
|
|
@@ -1118,7 +1100,6 @@ const IDENTIFIER_MAPPINGS = {
|
|
|
1118
1100
|
Segment: "SegmentedControl",
|
|
1119
1101
|
Toaster: "Toast.Group"
|
|
1120
1102
|
};
|
|
1121
|
-
|
|
1122
1103
|
//#endregion
|
|
1123
1104
|
//#region src/commands/migrate/migrations/skeleton-4/utility/import-mappings.ts
|
|
1124
1105
|
const IMPORT_MAPPINGS = {
|
|
@@ -1129,7 +1110,6 @@ const IMPORT_MAPPINGS = {
|
|
|
1129
1110
|
Segment: "SegmentedControl",
|
|
1130
1111
|
Toaster: "Toast"
|
|
1131
1112
|
};
|
|
1132
|
-
|
|
1133
1113
|
//#endregion
|
|
1134
1114
|
//#region src/commands/migrate/migrations/skeleton-4/transformers/transform-module.ts
|
|
1135
1115
|
function transformModule(code) {
|
|
@@ -1157,7 +1137,6 @@ function transformModule(code) {
|
|
|
1157
1137
|
meta: { skeletonImports }
|
|
1158
1138
|
};
|
|
1159
1139
|
}
|
|
1160
|
-
|
|
1161
1140
|
//#endregion
|
|
1162
1141
|
//#region src/commands/migrate/migrations/skeleton-4/transformers/transform-package.json.ts
|
|
1163
1142
|
function transformPackageJson(code) {
|
|
@@ -1180,7 +1159,6 @@ function transformPackageJson(code) {
|
|
|
1180
1159
|
}
|
|
1181
1160
|
return { code: JSON.stringify(pkg, void 0, detectIndent(code).indent || " ") };
|
|
1182
1161
|
}
|
|
1183
|
-
|
|
1184
1162
|
//#endregion
|
|
1185
1163
|
//#region src/commands/migrate/migrations/skeleton-4/transformers/transform-stylesheet.ts
|
|
1186
1164
|
function transformStylesheet(content) {
|
|
@@ -1205,7 +1183,6 @@ function transformStylesheet(content) {
|
|
|
1205
1183
|
return { code: content };
|
|
1206
1184
|
}
|
|
1207
1185
|
}
|
|
1208
|
-
|
|
1209
1186
|
//#endregion
|
|
1210
1187
|
//#region src/commands/migrate/migrations/skeleton-4/transformers/transform-svelte.ts
|
|
1211
1188
|
function transformScript(s, script) {
|
|
@@ -1237,7 +1214,6 @@ function transformSvelte(code) {
|
|
|
1237
1214
|
transformCss(s, root.css);
|
|
1238
1215
|
return { code: s.toString() };
|
|
1239
1216
|
}
|
|
1240
|
-
|
|
1241
1217
|
//#endregion
|
|
1242
1218
|
//#region src/commands/migrate/migrations/skeleton-4/index.ts
|
|
1243
1219
|
async function skeleton_4_default(options) {
|
|
@@ -1344,7 +1320,6 @@ async function skeleton_4_default(options) {
|
|
|
1344
1320
|
}
|
|
1345
1321
|
log.info("Migration complete! Visit https://skeleton.dev for more information.");
|
|
1346
1322
|
}
|
|
1347
|
-
|
|
1348
1323
|
//#endregion
|
|
1349
1324
|
//#region src/commands/migrate/index.ts
|
|
1350
1325
|
const MIGRATIONS = {
|
|
@@ -1352,14 +1327,12 @@ const MIGRATIONS = {
|
|
|
1352
1327
|
"skeleton-4": skeleton_4_default
|
|
1353
1328
|
};
|
|
1354
1329
|
const migrate = new Command("migrate").description("Run a migration").addArgument(new Argument("<migration>", "The migration to run").choices(Object.keys(MIGRATIONS))).addOption(new Option("--cwd <cwd>", "The directory to run the migration in")).action((migration, options) => MIGRATIONS[migration](options));
|
|
1355
|
-
|
|
1356
1330
|
//#endregion
|
|
1357
1331
|
//#region src/utility/get-our-package-json.ts
|
|
1358
1332
|
async function getOurPackageJson() {
|
|
1359
1333
|
const content = await readFile(join(dirname(fileURLToPath(import.meta.url)), "../package.json"), "utf-8");
|
|
1360
1334
|
return JSON.parse(content);
|
|
1361
1335
|
}
|
|
1362
|
-
|
|
1363
1336
|
//#endregion
|
|
1364
1337
|
//#region src/index.ts
|
|
1365
1338
|
const pkg = await getOurPackageJson();
|
|
@@ -1380,6 +1353,5 @@ async function skeleton() {
|
|
|
1380
1353
|
outro(bgGreenBright(black(" All Done! ")));
|
|
1381
1354
|
}
|
|
1382
1355
|
await skeleton();
|
|
1383
|
-
|
|
1384
1356
|
//#endregion
|
|
1385
|
-
export { cli };
|
|
1357
|
+
export { cli };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skeleton",
|
|
3
3
|
"description": "The CLI for Skeleton related tooling.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.13.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/skeletonlabs/skeleton.git",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"latest-version": "9.0.0",
|
|
21
21
|
"magic-string": "0.30.21",
|
|
22
22
|
"nanoid": "5.1.6",
|
|
23
|
-
"node-html-parser": "7.0
|
|
23
|
+
"node-html-parser": "7.1.0",
|
|
24
24
|
"package-manager-detector": "1.6.0",
|
|
25
|
-
"postcss": "8.5.
|
|
25
|
+
"postcss": "8.5.8",
|
|
26
26
|
"semver": "7.7.4",
|
|
27
|
-
"svelte": "5.
|
|
27
|
+
"svelte": "5.53.7",
|
|
28
28
|
"tinyglobby": "0.2.15",
|
|
29
29
|
"ts-morph": "27.0.2",
|
|
30
30
|
"zimmerframe": "1.1.4"
|