sv 0.7.2 → 0.8.1
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 +109 -3077
- package/dist/index.js +2 -2
- package/dist/{install-DPLwqpud.js → install-iBxCFLH9.js} +16 -40
- package/dist/{package-manager-BusIB9Xp.js → package-manager-D3PRQ-L_.js} +3545 -622
- package/dist/templates/demo/assets/src/app.css +5 -7
- package/dist/templates/demo/package.json +1 -1
- package/dist/templates/library/package.json +1 -1
- package/dist/templates/minimal/package.json +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, __toESM, be, detect, getUserAgent, log, parseJson, parseScript
|
|
1
|
+
import { __commonJS, __export, __toESM$1 as __toESM, be, detect, getUserAgent, log, parseJson$1, parseScript, parseScript$1, resolveCommand, serializeScript, stripAst, up, walk } from "./package-manager-D3PRQ-L_.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process$1 from "node:process";
|
|
@@ -76,36 +76,7 @@ var require_picocolors = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_
|
|
|
76
76
|
const TESTING = process$1.env.NODE_ENV?.toLowerCase() === "test";
|
|
77
77
|
|
|
78
78
|
//#endregion
|
|
79
|
-
//#region packages/core/dist/dedent-
|
|
80
|
-
var __create = Object.create;
|
|
81
|
-
var __defProp = Object.defineProperty;
|
|
82
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
83
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
84
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
85
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
86
|
-
var __commonJS$1 = (cb, mod) => function() {
|
|
87
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
88
|
-
};
|
|
89
|
-
var __export = (target, all) => {
|
|
90
|
-
for (var name in all) __defProp(target, name, {
|
|
91
|
-
get: all[name],
|
|
92
|
-
enumerable: true
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
var __copyProps = (to, from, except, desc) => {
|
|
96
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
97
|
-
key = keys[i];
|
|
98
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
99
|
-
get: ((k) => from[k]).bind(null, key),
|
|
100
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return to;
|
|
104
|
-
};
|
|
105
|
-
var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
106
|
-
value: mod,
|
|
107
|
-
enumerable: true
|
|
108
|
-
}) : target, mod));
|
|
79
|
+
//#region packages/core/dist/dedent-CElkE_9E.js
|
|
109
80
|
function ownKeys(object, enumerableOnly) {
|
|
110
81
|
var keys = Object.keys(object);
|
|
111
82
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -188,7 +159,7 @@ else mindent = Math.min(mindent, indent);
|
|
|
188
159
|
}
|
|
189
160
|
|
|
190
161
|
//#endregion
|
|
191
|
-
//#region packages/core/dist/common-
|
|
162
|
+
//#region packages/core/dist/common-B-wxp0Ti.js
|
|
192
163
|
function decircular(object) {
|
|
193
164
|
const seenObjects = new WeakMap();
|
|
194
165
|
function internalDecircular(value, path$1 = []) {
|
|
@@ -326,7 +297,7 @@ function addStatement(ast, statement) {
|
|
|
326
297
|
}
|
|
327
298
|
function hasNode(ast, nodeToMatch) {
|
|
328
299
|
let found = false;
|
|
329
|
-
|
|
300
|
+
walk(ast, null, { _(node, { next, stop }) {
|
|
330
301
|
if (node.type === nodeToMatch.type) {
|
|
331
302
|
found = areNodesEqual(node, nodeToMatch);
|
|
332
303
|
if (found) stop();
|
|
@@ -530,6 +501,7 @@ function addEmpty(ast, importFrom) {
|
|
|
530
501
|
value: importFrom
|
|
531
502
|
},
|
|
532
503
|
specifiers: [],
|
|
504
|
+
attributes: [],
|
|
533
505
|
importKind: "value"
|
|
534
506
|
};
|
|
535
507
|
addImportIfNecessary(ast, expectedImportDeclaration);
|
|
@@ -548,7 +520,8 @@ function addNamespace(ast, importFrom, importAs) {
|
|
|
548
520
|
type: "Identifier",
|
|
549
521
|
name: importAs
|
|
550
522
|
}
|
|
551
|
-
}]
|
|
523
|
+
}],
|
|
524
|
+
attributes: []
|
|
552
525
|
};
|
|
553
526
|
addImportIfNecessary(ast, expectedImportDeclaration);
|
|
554
527
|
}
|
|
@@ -566,6 +539,7 @@ function addDefault(ast, importFrom, importAs) {
|
|
|
566
539
|
name: importAs
|
|
567
540
|
}
|
|
568
541
|
}],
|
|
542
|
+
attributes: [],
|
|
569
543
|
importKind: "value"
|
|
570
544
|
};
|
|
571
545
|
addImportIfNecessary(ast, expectedImportDeclaration);
|
|
@@ -586,7 +560,7 @@ function addNamed(ast, importFrom, exportedAsImportAs, isType = false) {
|
|
|
586
560
|
return specifier;
|
|
587
561
|
});
|
|
588
562
|
let importDecl;
|
|
589
|
-
|
|
563
|
+
walk(ast, null, { ImportDeclaration(node) {
|
|
590
564
|
if (node.source.value === importFrom && node.specifiers) importDecl = node;
|
|
591
565
|
} });
|
|
592
566
|
if (importDecl) {
|
|
@@ -603,6 +577,7 @@ function addNamed(ast, importFrom, exportedAsImportAs, isType = false) {
|
|
|
603
577
|
value: importFrom
|
|
604
578
|
},
|
|
605
579
|
specifiers,
|
|
580
|
+
attributes: [],
|
|
606
581
|
importKind: isType ? "type" : "value"
|
|
607
582
|
};
|
|
608
583
|
ast.body.unshift(expectedImportDeclaration);
|
|
@@ -714,7 +689,8 @@ function namedExport(ast, name, fallback) {
|
|
|
714
689
|
namedExport$1 = {
|
|
715
690
|
type: "ExportNamedDeclaration",
|
|
716
691
|
declaration: fallback,
|
|
717
|
-
specifiers: []
|
|
692
|
+
specifiers: [],
|
|
693
|
+
attributes: []
|
|
718
694
|
};
|
|
719
695
|
ast.body.push(namedExport$1);
|
|
720
696
|
return namedExport$1;
|
|
@@ -733,7 +709,7 @@ function addGlobalAppInterface(ast, name) {
|
|
|
733
709
|
if (globalDecl.body?.type !== "TSModuleBlock") throw new Error("Unexpected body type of `declare global` in `src/app.d.ts`");
|
|
734
710
|
let app;
|
|
735
711
|
let interfaceNode;
|
|
736
|
-
|
|
712
|
+
walk(globalDecl, null, {
|
|
737
713
|
TSModuleDeclaration(node, { next }) {
|
|
738
714
|
if (node.id.type === "Identifier" && node.id.name === "App") app = node;
|
|
739
715
|
next();
|
|
@@ -759,7 +735,7 @@ function addHooksHandle(ast, typescript, newHandleName, handleContent) {
|
|
|
759
735
|
let handleName = "handle";
|
|
760
736
|
let exportDecl;
|
|
761
737
|
let originalHandleDecl;
|
|
762
|
-
|
|
738
|
+
walk(ast, null, { ExportNamedDeclaration(node) {
|
|
763
739
|
let maybeHandleDecl;
|
|
764
740
|
const handleSpecifier = node.specifiers?.find((s) => s.exported.type === "Identifier" && s.exported.name === "handle");
|
|
765
741
|
if (handleSpecifier && handleSpecifier.local.type === "Identifier" && handleSpecifier.exported.type === "Identifier") {
|
|
@@ -868,7 +844,7 @@ function getPackageJson(cwd) {
|
|
|
868
844
|
const pkgPath = path.join(cwd, commonFilePaths.packageJson);
|
|
869
845
|
throw new Error(`Invalid workspace: missing '${pkgPath}'`);
|
|
870
846
|
}
|
|
871
|
-
const { data, generateCode } = parseJson(packageText);
|
|
847
|
+
const { data, generateCode } = parseJson$1(packageText);
|
|
872
848
|
return {
|
|
873
849
|
source: packageText,
|
|
874
850
|
data,
|
|
@@ -1145,4 +1121,4 @@ function orderAddons(addons, setupResults) {
|
|
|
1145
1121
|
}
|
|
1146
1122
|
|
|
1147
1123
|
//#endregion
|
|
1148
|
-
export {
|
|
1124
|
+
export { addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, installAddon, kit_exports, object_exports, require_picocolors as require_picocolors$1, setupAddons, variables_exports };
|