@powerlines/plugin-tsdown 0.1.202 → 0.1.204
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/format-package-json-Cy0hXUxs.mjs +237 -0
- package/dist/format-package-json-Cy0hXUxs.mjs.map +1 -0
- package/dist/format-package-json-Dt4gyoUq.cjs +242 -0
- package/dist/helpers/format-package-json.cjs +3 -0
- package/dist/helpers/format-package-json.d.cts +13 -0
- package/dist/helpers/format-package-json.d.cts.map +1 -0
- package/dist/helpers/format-package-json.d.mts +13 -0
- package/dist/helpers/format-package-json.d.mts.map +1 -0
- package/dist/helpers/format-package-json.mjs +3 -0
- package/dist/helpers/index.cjs +2 -2
- package/dist/helpers/index.d.cts +3 -3
- package/dist/helpers/index.d.mts +3 -3
- package/dist/helpers/index.mjs +2 -2
- package/dist/helpers/unplugin.cjs +1 -1
- package/dist/helpers/unplugin.d.cts +2 -2
- package/dist/helpers/unplugin.d.mts +2 -2
- package/dist/helpers/unplugin.mjs +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{plugin-BohvMapN.d.cts → plugin-CZEJ9SKF.d.mts} +1 -1
- package/dist/{plugin-BohvMapN.d.cts.map → plugin-CZEJ9SKF.d.mts.map} +1 -1
- package/dist/{plugin-By2hpTwn.d.mts → plugin-C_NYHEM5.d.cts} +1 -1
- package/dist/{plugin-By2hpTwn.d.mts.map → plugin-C_NYHEM5.d.cts.map} +1 -1
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.mts +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/{unplugin-LwBbzSbq.mjs → unplugin-0Zevy5n4.mjs} +1 -1
- package/dist/{unplugin-LwBbzSbq.mjs.map → unplugin-0Zevy5n4.mjs.map} +1 -1
- package/dist/{unplugin-COtJJRXi.d.mts → unplugin-DAxS5ZTK.d.cts} +2 -2
- package/dist/unplugin-DAxS5ZTK.d.cts.map +1 -0
- package/dist/{unplugin-rS-jtHDh.d.cts → unplugin-YSgWz6zp.d.mts} +2 -2
- package/dist/unplugin-YSgWz6zp.d.mts.map +1 -0
- package/package.json +18 -4
- package/dist/unplugin-COtJJRXi.d.mts.map +0 -1
- package/dist/unplugin-rS-jtHDh.d.cts.map +0 -1
- /package/dist/{helpers-B15z10jN.mjs → helpers-y2jvHwgF.mjs} +0 -0
- /package/dist/{helpers-LF26RHol.cjs → helpers-yB1XkvQI.cjs} +0 -0
- /package/dist/{index-9iG2qHLe.d.mts → index-BR1oNnaF.d.cts} +0 -0
- /package/dist/{index-D4ELpJXS.d.cts → index-DEHBdV_z.d.mts} +0 -0
- /package/dist/{index-D6CnpA_r.d.cts → index-DNLi60D-.d.mts} +0 -0
- /package/dist/{index-DL0uimUT.d.mts → index-_wQ5ClJU.d.cts} +0 -0
- /package/dist/{plugin-ifZVa20V.mjs → plugin-B0q2kj8i.mjs} +0 -0
- /package/dist/{plugin-pBKbb5K9.cjs → plugin-Ckx8qAq8.cjs} +0 -0
- /package/dist/{types-U3zd8PTP.mjs → types--fVOUYBq.mjs} +0 -0
- /package/dist/{types-o3zWarRp.cjs → types-a8gm_IaQ.cjs} +0 -0
- /package/dist/{unplugin-Ca4es71P.cjs → unplugin-DWU1VqQz.cjs} +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { format } from "powerlines/lib/utilities/format";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs
|
|
4
|
+
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
5
|
+
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
6
|
+
const UNC_REGEX = /^[/\\]{2}/;
|
|
7
|
+
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs
|
|
11
|
+
/**
|
|
12
|
+
* Replace backslash to slash
|
|
13
|
+
*
|
|
14
|
+
* @param path - The string to replace
|
|
15
|
+
* @returns The string with replaced backslashes
|
|
16
|
+
*/
|
|
17
|
+
function slash(path) {
|
|
18
|
+
if (path.startsWith("\\\\?\\")) return path;
|
|
19
|
+
return path.replace(/\\/g, "/");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs
|
|
24
|
+
/**
|
|
25
|
+
* Check if the path is an absolute path.
|
|
26
|
+
*
|
|
27
|
+
* @param path - The path to check
|
|
28
|
+
* @returns An indicator specifying if the path is an absolute path
|
|
29
|
+
*/
|
|
30
|
+
function isAbsolutePath(path) {
|
|
31
|
+
return ABSOLUTE_PATH_REGEX.test(slash(path));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if the path is an absolute path.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* This is an alias for {@link isAbsolutePath}.
|
|
38
|
+
*
|
|
39
|
+
* @param path - The path to check
|
|
40
|
+
* @returns An indicator specifying if the path is an absolute path
|
|
41
|
+
*/
|
|
42
|
+
function isAbsolute(path) {
|
|
43
|
+
return isAbsolutePath(path);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs
|
|
48
|
+
function normalizeWindowsPath(input = "") {
|
|
49
|
+
if (!input) return input;
|
|
50
|
+
return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
51
|
+
}
|
|
52
|
+
function correctPaths(path) {
|
|
53
|
+
if (!path || path.length === 0) return ".";
|
|
54
|
+
path = normalizeWindowsPath(path);
|
|
55
|
+
const isUNCPath = path.match(UNC_REGEX);
|
|
56
|
+
const isPathAbsolute = isAbsolute(path);
|
|
57
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
58
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
59
|
+
if (path.length === 0) {
|
|
60
|
+
if (isPathAbsolute) return "/";
|
|
61
|
+
return trailingSeparator ? "./" : ".";
|
|
62
|
+
}
|
|
63
|
+
if (trailingSeparator) path += "/";
|
|
64
|
+
if (DRIVE_LETTER_REGEX.test(path)) path += "/";
|
|
65
|
+
if (isUNCPath) {
|
|
66
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
67
|
+
return `//${path}`;
|
|
68
|
+
}
|
|
69
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Joins all given path segments together using the platform-specific separator as a delimiter.
|
|
73
|
+
* The resulting path is normalized to remove any redundant or unnecessary segments.
|
|
74
|
+
*
|
|
75
|
+
* @param segments - The path segments to join.
|
|
76
|
+
* @returns The joined and normalized path string.
|
|
77
|
+
*/
|
|
78
|
+
function joinPaths(...segments) {
|
|
79
|
+
let path = "";
|
|
80
|
+
for (const seg of segments) {
|
|
81
|
+
if (!seg) continue;
|
|
82
|
+
if (path.length > 0) {
|
|
83
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
84
|
+
const segLeading = seg[0] === "/";
|
|
85
|
+
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
86
|
+
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
87
|
+
} else path += seg;
|
|
88
|
+
}
|
|
89
|
+
return correctPaths(path);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
93
|
+
*
|
|
94
|
+
* @param path - The path to normalize.
|
|
95
|
+
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
96
|
+
* @returns the normalized path string.
|
|
97
|
+
*/
|
|
98
|
+
function normalizeString(path, allowAboveRoot) {
|
|
99
|
+
let res = "";
|
|
100
|
+
let lastSegmentLength = 0;
|
|
101
|
+
let lastSlash = -1;
|
|
102
|
+
let dots = 0;
|
|
103
|
+
let char = null;
|
|
104
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
105
|
+
if (index < path.length) char = path[index];
|
|
106
|
+
else if (char === "/") break;
|
|
107
|
+
else char = "/";
|
|
108
|
+
if (char === "/") {
|
|
109
|
+
if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
|
|
110
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
111
|
+
if (res.length > 2) {
|
|
112
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
113
|
+
if (lastSlashIndex === -1) {
|
|
114
|
+
res = "";
|
|
115
|
+
lastSegmentLength = 0;
|
|
116
|
+
} else {
|
|
117
|
+
res = res.slice(0, lastSlashIndex);
|
|
118
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
119
|
+
}
|
|
120
|
+
lastSlash = index;
|
|
121
|
+
dots = 0;
|
|
122
|
+
continue;
|
|
123
|
+
} else if (res.length > 0) {
|
|
124
|
+
res = "";
|
|
125
|
+
lastSegmentLength = 0;
|
|
126
|
+
lastSlash = index;
|
|
127
|
+
dots = 0;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (allowAboveRoot) {
|
|
132
|
+
res += res.length > 0 ? "/.." : "..";
|
|
133
|
+
lastSegmentLength = 2;
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
137
|
+
else res = path.slice(lastSlash + 1, index);
|
|
138
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
139
|
+
}
|
|
140
|
+
lastSlash = index;
|
|
141
|
+
dots = 0;
|
|
142
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
143
|
+
else dots = -1;
|
|
144
|
+
}
|
|
145
|
+
return res;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs
|
|
150
|
+
const isString = (value) => {
|
|
151
|
+
try {
|
|
152
|
+
return typeof value === "string";
|
|
153
|
+
} catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
160
|
+
const isNull = (value) => {
|
|
161
|
+
try {
|
|
162
|
+
return value === null;
|
|
163
|
+
} catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
|
|
170
|
+
const isUndefined = (value) => {
|
|
171
|
+
return value === void 0;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
176
|
+
/**
|
|
177
|
+
* Check if the provided value's type is `null` or `undefined`
|
|
178
|
+
*
|
|
179
|
+
* @param value - The value to type check
|
|
180
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
181
|
+
*/
|
|
182
|
+
const isEmpty = (value) => {
|
|
183
|
+
try {
|
|
184
|
+
return isUndefined(value) || isNull(value);
|
|
185
|
+
} catch {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
192
|
+
/**
|
|
193
|
+
* The inverse of the `isEmpty` function
|
|
194
|
+
*
|
|
195
|
+
* @param value - The value to type check
|
|
196
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
197
|
+
*/
|
|
198
|
+
const isSet = (value) => {
|
|
199
|
+
try {
|
|
200
|
+
return !isEmpty(value);
|
|
201
|
+
} catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs
|
|
208
|
+
/**
|
|
209
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
210
|
+
*
|
|
211
|
+
* @param value - The value to type check
|
|
212
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
213
|
+
*/
|
|
214
|
+
const isSetString = (value) => {
|
|
215
|
+
try {
|
|
216
|
+
return isSet(value) && isString(value) && value.length > 0;
|
|
217
|
+
} catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/helpers/format-package-json.ts
|
|
224
|
+
/**
|
|
225
|
+
* Formats the `package.json` file in the project root.
|
|
226
|
+
*
|
|
227
|
+
* @param context - The Tsdown plugin context.
|
|
228
|
+
*/
|
|
229
|
+
async function formatPackageJson(context) {
|
|
230
|
+
const packageJsonPath = joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "package.json");
|
|
231
|
+
const packageJsonFile = await context.fs.read(packageJsonPath);
|
|
232
|
+
if (isSetString(packageJsonFile)) await context.fs.write(packageJsonPath, await format(context, packageJsonPath, packageJsonFile));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
//#endregion
|
|
236
|
+
export { formatPackageJson as t };
|
|
237
|
+
//# sourceMappingURL=format-package-json-Cy0hXUxs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-package-json-Cy0hXUxs.mjs","names":[],"sources":["../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs","../src/helpers/format-package-json.ts"],"sourcesContent":["//#region src/regex.ts\nconst DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nconst DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\nconst UNC_REGEX = /^[/\\\\]{2}/;\nconst ABSOLUTE_PATH_REGEX = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\nconst ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\nconst FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\nconst FULL_FILE_EXTENSION_REGEX = /(\\.d)?\\.[0-9a-z]+(\\.map)?$/i;\nconst PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nconst NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n\n//#endregion\nexport { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX };\n//# sourceMappingURL=regex.mjs.map","import { isAbsolutePath } from \"./is-type.mjs\";\n\n//#region src/slash.ts\n/**\n* Replace backslash to slash\n*\n* @param path - The string to replace\n* @returns The string with replaced backslashes\n*/\nfunction slash(path) {\n\tif (path.startsWith(\"\\\\\\\\?\\\\\")) return path;\n\treturn path.replace(/\\\\/g, \"/\");\n}\n/**\n* Replace backslash to slash and remove unneeded leading and trailing slashes\n*\n* @param path - The string to replace\n* @returns The string with replaced backslashes\n*/\nfunction formatSlash(path) {\n\tconst formatted = slash(path);\n\treturn isAbsolutePath(formatted) ? formatted.replace(/\\/+$/g, \"\") : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n\n//#endregion\nexport { formatSlash, slash };\n//# sourceMappingURL=slash.mjs.map","import { ABSOLUTE_PATH_REGEX, NPM_SCOPED_PACKAGE_REGEX } from \"./regex.mjs\";\nimport { slash } from \"./slash.mjs\";\n\n//#region src/is-type.ts\n/**\n* Check if the path is an absolute path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolutePath(path) {\n\treturn ABSOLUTE_PATH_REGEX.test(slash(path));\n}\n/**\n* Check if the path is an absolute path.\n*\n* @remarks\n* This is an alias for {@link isAbsolutePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolute(path) {\n\treturn isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelativePath(path) {\n\treturn !isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @remarks\n* This is an alias for {@link isRelativePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelative(path) {\n\treturn isRelativePath(path);\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.\n*\n* @example\n* ```ts\n* isNpmScopedPackage(\"@stryke/path\"); // returns true\n* isNpmScopedPackage(\"lodash\"); // returns false\n* isNpmNamespacePackage(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackagePath(path) {\n\treturn NPM_SCOPED_PACKAGE_REGEX.test(slash(path));\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.\n*\n* @example\n* ```ts\n* isNpmScopedPackagePath(\"@stryke/path\"); // returns true\n* isNpmScopedPackagePath(\"lodash\"); // returns false\n* isNpmScopedPackagePath(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackage(path) {\n\treturn isNpmScopedPackagePath(path);\n}\n\n//#endregion\nexport { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };\n//# sourceMappingURL=is-type.mjs.map","import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from \"./regex.mjs\";\nimport { isAbsolute } from \"./is-type.mjs\";\n\n//#region src/join-paths.ts\nfunction normalizeWindowsPath(input = \"\") {\n\tif (!input) return input;\n\treturn input.replace(/\\\\/g, \"/\").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());\n}\nfunction correctPaths(path) {\n\tif (!path || path.length === 0) return \".\";\n\tpath = normalizeWindowsPath(path);\n\tconst isUNCPath = path.match(UNC_REGEX);\n\tconst isPathAbsolute = isAbsolute(path);\n\tconst trailingSeparator = path[path.length - 1] === \"/\";\n\tpath = normalizeString(path, !isPathAbsolute);\n\tif (path.length === 0) {\n\t\tif (isPathAbsolute) return \"/\";\n\t\treturn trailingSeparator ? \"./\" : \".\";\n\t}\n\tif (trailingSeparator) path += \"/\";\n\tif (DRIVE_LETTER_REGEX.test(path)) path += \"/\";\n\tif (isUNCPath) {\n\t\tif (!isPathAbsolute) return `//./${path}`;\n\t\treturn `//${path}`;\n\t}\n\treturn isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n/**\n* Joins all given path segments together using the platform-specific separator as a delimiter.\n* The resulting path is normalized to remove any redundant or unnecessary segments.\n*\n* @param segments - The path segments to join.\n* @returns The joined and normalized path string.\n*/\nfunction joinPaths(...segments) {\n\tlet path = \"\";\n\tfor (const seg of segments) {\n\t\tif (!seg) continue;\n\t\tif (path.length > 0) {\n\t\t\tconst pathTrailing = path[path.length - 1] === \"/\";\n\t\t\tconst segLeading = seg[0] === \"/\";\n\t\t\tif (pathTrailing && segLeading) path += seg.slice(1);\n\t\t\telse path += pathTrailing || segLeading ? seg : `/${seg}`;\n\t\t} else path += seg;\n\t}\n\treturn correctPaths(path);\n}\nconst join = joinPaths;\n/**\n* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n*\n* @param path - The path to normalize.\n* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n* @returns the normalized path string.\n*/\nfunction normalizeString(path, allowAboveRoot) {\n\tlet res = \"\";\n\tlet lastSegmentLength = 0;\n\tlet lastSlash = -1;\n\tlet dots = 0;\n\tlet char = null;\n\tfor (let index = 0; index <= path.length; ++index) {\n\t\tif (index < path.length) char = path[index];\n\t\telse if (char === \"/\") break;\n\t\telse char = \"/\";\n\t\tif (char === \"/\") {\n\t\t\tif (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {\n\t\t\t\tif (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== \".\" || res[res.length - 2] !== \".\") {\n\t\t\t\t\tif (res.length > 2) {\n\t\t\t\t\t\tconst lastSlashIndex = res.lastIndexOf(\"/\");\n\t\t\t\t\t\tif (lastSlashIndex === -1) {\n\t\t\t\t\t\t\tres = \"\";\n\t\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tres = res.slice(0, lastSlashIndex);\n\t\t\t\t\t\t\tlastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastSlash = index;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (res.length > 0) {\n\t\t\t\t\t\tres = \"\";\n\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\tlastSlash = index;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (allowAboveRoot) {\n\t\t\t\t\tres += res.length > 0 ? \"/..\" : \"..\";\n\t\t\t\t\tlastSegmentLength = 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;\n\t\t\t\telse res = path.slice(lastSlash + 1, index);\n\t\t\t\tlastSegmentLength = index - lastSlash - 1;\n\t\t\t}\n\t\t\tlastSlash = index;\n\t\t\tdots = 0;\n\t\t} else if (char === \".\" && dots !== -1) ++dots;\n\t\telse dots = -1;\n\t}\n\treturn res;\n}\n\n//#endregion\nexport { join, joinPaths };\n//# sourceMappingURL=join-paths.mjs.map","//#region src/is-string.ts\nconst isString = (value) => {\n\ttry {\n\t\treturn typeof value === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isString };\n//# sourceMappingURL=is-string.mjs.map","//#region src/is-null.ts\nconst isNull = (value) => {\n\ttry {\n\t\treturn value === null;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isNull };\n//# sourceMappingURL=is-null.mjs.map","//#region src/is-undefined.ts\nconst isUndefined = (value) => {\n\treturn value === void 0;\n};\n\n//#endregion\nexport { isUndefined };\n//# sourceMappingURL=is-undefined.mjs.map","import { isDate } from \"./is-date.mjs\";\nimport { isFunction } from \"./is-function.mjs\";\nimport { isNull } from \"./is-null.mjs\";\nimport { isNumber } from \"./is-number.mjs\";\nimport { isSymbol } from \"./is-symbol.mjs\";\nimport { isUndefined } from \"./is-undefined.mjs\";\n\n//#region src/is-empty.ts\n/**\n* Check if the provided value's type is `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `null` or `undefined`\n*/\nconst isEmpty = (value) => {\n\ttry {\n\t\treturn isUndefined(value) || isNull(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\nconst isEmptyAnything = (value) => {\n\tif (value === true || value === false) return true;\n\tif (value === null || value === void 0) return true;\n\tif (isNumber(value)) return value === 0;\n\tif (isDate(value)) return Number.isNaN(value.getTime());\n\tif (isFunction(value)) return false;\n\tif (isSymbol(value)) return false;\n\tconst { length } = value;\n\tif (isNumber(length)) return length === 0;\n\tconst { size } = value;\n\tif (isNumber(size)) return size === 0;\n\treturn Object.keys(value).length === 0;\n};\n\n//#endregion\nexport { isEmpty, isEmptyAnything };\n//# sourceMappingURL=is-empty.mjs.map","import { isEmpty } from \"./is-empty.mjs\";\n\n//#region src/is-set.ts\n/**\n* The inverse of the `isEmpty` function\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n*/\nconst isSet = (value) => {\n\ttry {\n\t\treturn !isEmpty(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSet };\n//# sourceMappingURL=is-set.mjs.map","import { isString } from \"./is-string.mjs\";\nimport { isSet } from \"./is-set.mjs\";\n\n//#region src/is-set-string.ts\n/**\n* Determine if the type is string and is not empty (length greater than zero)\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n*/\nconst isSetString = (value) => {\n\ttry {\n\t\treturn isSet(value) && isString(value) && value.length > 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSetString };\n//# sourceMappingURL=is-set-string.mjs.map","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"powerlines/lib/utilities/format\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The Tsdown plugin context.\n */\nexport async function formatPackageJson(context: TsdownPluginContext) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n \"package.json\"\n );\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9],"mappings":"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"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
const require_index = require('./index.cjs');
|
|
2
|
+
let powerlines_lib_utilities_format = require("powerlines/lib/utilities/format");
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs
|
|
5
|
+
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
6
|
+
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
7
|
+
const UNC_REGEX = /^[/\\]{2}/;
|
|
8
|
+
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs
|
|
12
|
+
/**
|
|
13
|
+
* Replace backslash to slash
|
|
14
|
+
*
|
|
15
|
+
* @param path - The string to replace
|
|
16
|
+
* @returns The string with replaced backslashes
|
|
17
|
+
*/
|
|
18
|
+
function slash(path) {
|
|
19
|
+
if (path.startsWith("\\\\?\\")) return path;
|
|
20
|
+
return path.replace(/\\/g, "/");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs
|
|
25
|
+
/**
|
|
26
|
+
* Check if the path is an absolute path.
|
|
27
|
+
*
|
|
28
|
+
* @param path - The path to check
|
|
29
|
+
* @returns An indicator specifying if the path is an absolute path
|
|
30
|
+
*/
|
|
31
|
+
function isAbsolutePath(path) {
|
|
32
|
+
return ABSOLUTE_PATH_REGEX.test(slash(path));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if the path is an absolute path.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* This is an alias for {@link isAbsolutePath}.
|
|
39
|
+
*
|
|
40
|
+
* @param path - The path to check
|
|
41
|
+
* @returns An indicator specifying if the path is an absolute path
|
|
42
|
+
*/
|
|
43
|
+
function isAbsolute(path) {
|
|
44
|
+
return isAbsolutePath(path);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs
|
|
49
|
+
function normalizeWindowsPath(input = "") {
|
|
50
|
+
if (!input) return input;
|
|
51
|
+
return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
52
|
+
}
|
|
53
|
+
function correctPaths(path) {
|
|
54
|
+
if (!path || path.length === 0) return ".";
|
|
55
|
+
path = normalizeWindowsPath(path);
|
|
56
|
+
const isUNCPath = path.match(UNC_REGEX);
|
|
57
|
+
const isPathAbsolute = isAbsolute(path);
|
|
58
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
59
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
60
|
+
if (path.length === 0) {
|
|
61
|
+
if (isPathAbsolute) return "/";
|
|
62
|
+
return trailingSeparator ? "./" : ".";
|
|
63
|
+
}
|
|
64
|
+
if (trailingSeparator) path += "/";
|
|
65
|
+
if (DRIVE_LETTER_REGEX.test(path)) path += "/";
|
|
66
|
+
if (isUNCPath) {
|
|
67
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
68
|
+
return `//${path}`;
|
|
69
|
+
}
|
|
70
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Joins all given path segments together using the platform-specific separator as a delimiter.
|
|
74
|
+
* The resulting path is normalized to remove any redundant or unnecessary segments.
|
|
75
|
+
*
|
|
76
|
+
* @param segments - The path segments to join.
|
|
77
|
+
* @returns The joined and normalized path string.
|
|
78
|
+
*/
|
|
79
|
+
function joinPaths(...segments) {
|
|
80
|
+
let path = "";
|
|
81
|
+
for (const seg of segments) {
|
|
82
|
+
if (!seg) continue;
|
|
83
|
+
if (path.length > 0) {
|
|
84
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
85
|
+
const segLeading = seg[0] === "/";
|
|
86
|
+
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
87
|
+
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
88
|
+
} else path += seg;
|
|
89
|
+
}
|
|
90
|
+
return correctPaths(path);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
94
|
+
*
|
|
95
|
+
* @param path - The path to normalize.
|
|
96
|
+
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
97
|
+
* @returns the normalized path string.
|
|
98
|
+
*/
|
|
99
|
+
function normalizeString(path, allowAboveRoot) {
|
|
100
|
+
let res = "";
|
|
101
|
+
let lastSegmentLength = 0;
|
|
102
|
+
let lastSlash = -1;
|
|
103
|
+
let dots = 0;
|
|
104
|
+
let char = null;
|
|
105
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
106
|
+
if (index < path.length) char = path[index];
|
|
107
|
+
else if (char === "/") break;
|
|
108
|
+
else char = "/";
|
|
109
|
+
if (char === "/") {
|
|
110
|
+
if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
|
|
111
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
112
|
+
if (res.length > 2) {
|
|
113
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
114
|
+
if (lastSlashIndex === -1) {
|
|
115
|
+
res = "";
|
|
116
|
+
lastSegmentLength = 0;
|
|
117
|
+
} else {
|
|
118
|
+
res = res.slice(0, lastSlashIndex);
|
|
119
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
120
|
+
}
|
|
121
|
+
lastSlash = index;
|
|
122
|
+
dots = 0;
|
|
123
|
+
continue;
|
|
124
|
+
} else if (res.length > 0) {
|
|
125
|
+
res = "";
|
|
126
|
+
lastSegmentLength = 0;
|
|
127
|
+
lastSlash = index;
|
|
128
|
+
dots = 0;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (allowAboveRoot) {
|
|
133
|
+
res += res.length > 0 ? "/.." : "..";
|
|
134
|
+
lastSegmentLength = 2;
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
138
|
+
else res = path.slice(lastSlash + 1, index);
|
|
139
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
140
|
+
}
|
|
141
|
+
lastSlash = index;
|
|
142
|
+
dots = 0;
|
|
143
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
144
|
+
else dots = -1;
|
|
145
|
+
}
|
|
146
|
+
return res;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs
|
|
151
|
+
const isString = (value) => {
|
|
152
|
+
try {
|
|
153
|
+
return typeof value === "string";
|
|
154
|
+
} catch {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
161
|
+
const isNull = (value) => {
|
|
162
|
+
try {
|
|
163
|
+
return value === null;
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
|
|
171
|
+
const isUndefined = (value) => {
|
|
172
|
+
return value === void 0;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
177
|
+
/**
|
|
178
|
+
* Check if the provided value's type is `null` or `undefined`
|
|
179
|
+
*
|
|
180
|
+
* @param value - The value to type check
|
|
181
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
182
|
+
*/
|
|
183
|
+
const isEmpty = (value) => {
|
|
184
|
+
try {
|
|
185
|
+
return isUndefined(value) || isNull(value);
|
|
186
|
+
} catch {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
193
|
+
/**
|
|
194
|
+
* The inverse of the `isEmpty` function
|
|
195
|
+
*
|
|
196
|
+
* @param value - The value to type check
|
|
197
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
198
|
+
*/
|
|
199
|
+
const isSet = (value) => {
|
|
200
|
+
try {
|
|
201
|
+
return !isEmpty(value);
|
|
202
|
+
} catch {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs
|
|
209
|
+
/**
|
|
210
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
211
|
+
*
|
|
212
|
+
* @param value - The value to type check
|
|
213
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
214
|
+
*/
|
|
215
|
+
const isSetString = (value) => {
|
|
216
|
+
try {
|
|
217
|
+
return isSet(value) && isString(value) && value.length > 0;
|
|
218
|
+
} catch {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/helpers/format-package-json.ts
|
|
225
|
+
/**
|
|
226
|
+
* Formats the `package.json` file in the project root.
|
|
227
|
+
*
|
|
228
|
+
* @param context - The Tsdown plugin context.
|
|
229
|
+
*/
|
|
230
|
+
async function formatPackageJson(context) {
|
|
231
|
+
const packageJsonPath = joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "package.json");
|
|
232
|
+
const packageJsonFile = await context.fs.read(packageJsonPath);
|
|
233
|
+
if (isSetString(packageJsonFile)) await context.fs.write(packageJsonPath, await (0, powerlines_lib_utilities_format.format)(context, packageJsonPath, packageJsonFile));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
//#endregion
|
|
237
|
+
Object.defineProperty(exports, 'formatPackageJson', {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return formatPackageJson;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as TsdownPluginContext } from "../plugin-C_NYHEM5.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/format-package-json.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formats the `package.json` file in the project root.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The Tsdown plugin context.
|
|
9
|
+
*/
|
|
10
|
+
declare function formatPackageJson(context: TsdownPluginContext): Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { formatPackageJson };
|
|
13
|
+
//# sourceMappingURL=format-package-json.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-package-json.d.cts","names":[],"sources":["../../src/helpers/format-package-json.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,iBAAA,UAA2B,sBAAmB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as TsdownPluginContext } from "../plugin-CZEJ9SKF.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/format-package-json.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formats the `package.json` file in the project root.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The Tsdown plugin context.
|
|
9
|
+
*/
|
|
10
|
+
declare function formatPackageJson(context: TsdownPluginContext): Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { formatPackageJson };
|
|
13
|
+
//# sourceMappingURL=format-package-json.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-package-json.d.mts","names":[],"sources":["../../src/helpers/format-package-json.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,iBAAA,UAA2B,sBAAmB"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_unplugin = require('../unplugin-
|
|
2
|
-
require('../helpers-
|
|
1
|
+
const require_unplugin = require('../unplugin-DWU1VqQz.cjs');
|
|
2
|
+
require('../helpers-yB1XkvQI.cjs');
|
|
3
3
|
|
|
4
4
|
exports.createTsdownPlugin = require_unplugin.createTsdownPlugin;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "../unplugin-
|
|
3
|
-
import "../index-
|
|
1
|
+
import "../plugin-C_NYHEM5.cjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "../unplugin-DAxS5ZTK.cjs";
|
|
3
|
+
import "../index-_wQ5ClJU.cjs";
|
|
4
4
|
export { createTsdownPlugin };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "../unplugin-
|
|
3
|
-
import "../index-
|
|
1
|
+
import "../plugin-CZEJ9SKF.mjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "../unplugin-YSgWz6zp.mjs";
|
|
3
|
+
import "../index-DEHBdV_z.mjs";
|
|
4
4
|
export { createTsdownPlugin };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "../unplugin-
|
|
1
|
+
import "../plugin-C_NYHEM5.cjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "../unplugin-DAxS5ZTK.cjs";
|
|
3
3
|
export { createTsdownPlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "../unplugin-
|
|
1
|
+
import "../plugin-CZEJ9SKF.mjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "../unplugin-YSgWz6zp.mjs";
|
|
3
3
|
export { createTsdownPlugin };
|
package/dist/index.cjs
CHANGED
|
@@ -26,10 +26,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
}) : target, mod));
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
|
-
const
|
|
30
|
-
require('./
|
|
31
|
-
require('./
|
|
32
|
-
require('./
|
|
29
|
+
const require_format_package_json = require('./format-package-json-Dt4gyoUq.cjs');
|
|
30
|
+
const require_unplugin = require('./unplugin-DWU1VqQz.cjs');
|
|
31
|
+
require('./helpers-yB1XkvQI.cjs');
|
|
32
|
+
require('./plugin-Ckx8qAq8.cjs');
|
|
33
|
+
require('./types-a8gm_IaQ.cjs');
|
|
33
34
|
let defu = require("defu");
|
|
34
35
|
defu = __toESM(defu);
|
|
35
36
|
let powerlines_lib_build_tsdown = require("powerlines/lib/build/tsdown");
|
|
@@ -58,6 +59,7 @@ const plugin = (options = {}) => {
|
|
|
58
59
|
config: false,
|
|
59
60
|
plugins: [require_unplugin.createTsdownPlugin(this)]
|
|
60
61
|
}, (0, powerlines_lib_build_tsdown.extractTsdownConfig)(this)));
|
|
62
|
+
await require_format_package_json.formatPackageJson(this);
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
65
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "./unplugin-
|
|
3
|
-
import "./index-
|
|
4
|
-
import "./index-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-C_NYHEM5.cjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "./unplugin-DAxS5ZTK.cjs";
|
|
3
|
+
import "./index-_wQ5ClJU.cjs";
|
|
4
|
+
import "./index-BR1oNnaF.cjs";
|
|
5
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCa,cAAA,MAsCZ,EAAA,CAAA,iBArCkB,mBAqClB,GArCwC,mBAqCxC,CAAA,CAAA,OAAA,CAAA,EAnCU,mBAmCV,EAAA,GAlCE,MAkCF,CAlCS,QAkCT,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-
|
|
2
|
-
import { t as createTsdownPlugin } from "./unplugin-
|
|
3
|
-
import "./index-
|
|
4
|
-
import "./index-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "./plugin-CZEJ9SKF.mjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "./unplugin-YSgWz6zp.mjs";
|
|
3
|
+
import "./index-DEHBdV_z.mjs";
|
|
4
|
+
import "./index-DNLi60D-.mjs";
|
|
5
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCa,cAAA,MAsCZ,EAAA,CAAA,iBArCkB,mBAqClB,GArCwC,mBAqCxC,CAAA,CAAA,OAAA,CAAA,EAnCU,mBAmCV,EAAA,GAlCE,MAkCF,CAlCS,QAkCT,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
1
|
+
import { t as formatPackageJson } from "./format-package-json-Cy0hXUxs.mjs";
|
|
2
|
+
import { t as createTsdownPlugin } from "./unplugin-0Zevy5n4.mjs";
|
|
3
|
+
import "./helpers-y2jvHwgF.mjs";
|
|
4
|
+
import "./plugin-B0q2kj8i.mjs";
|
|
5
|
+
import "./types--fVOUYBq.mjs";
|
|
5
6
|
import defu from "defu";
|
|
6
7
|
import { extractTsdownConfig } from "powerlines/lib/build/tsdown";
|
|
7
8
|
import { build } from "tsdown";
|
|
@@ -29,6 +30,7 @@ const plugin = (options = {}) => {
|
|
|
29
30
|
config: false,
|
|
30
31
|
plugins: [createTsdownPlugin(this)]
|
|
31
32
|
}, extractTsdownConfig(this)));
|
|
33
|
+
await formatPackageJson(this);
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
36
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport defu from \"defu\";\nimport { extractTsdownConfig } from \"powerlines/lib/build/tsdown\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { build } from \"tsdown\";\nimport { createTsdownPlugin } from \"./helpers/unplugin\";\nimport {\n TsdownPluginContext,\n TsdownPluginOptions,\n TsdownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to use Tsdown to build the project.\n */\nexport const plugin = <\n TContext extends TsdownPluginContext = TsdownPluginContext\n>(\n options: TsdownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsdown\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `tsdown` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n build: {\n ...options,\n variant: \"tsdown\"\n }\n } as Partial<TsdownPluginResolvedConfig>;\n },\n async build() {\n this.trace(\"Starting Tsdown build process...\");\n\n await build(\n defu(\n {\n config: false,\n plugins: [createTsdownPlugin(this)]\n },\n extractTsdownConfig(this)\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport defu from \"defu\";\nimport { extractTsdownConfig } from \"powerlines/lib/build/tsdown\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { build } from \"tsdown\";\nimport { formatPackageJson } from \"./helpers/format-package-json\";\nimport { createTsdownPlugin } from \"./helpers/unplugin\";\nimport {\n TsdownPluginContext,\n TsdownPluginOptions,\n TsdownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to use Tsdown to build the project.\n */\nexport const plugin = <\n TContext extends TsdownPluginContext = TsdownPluginContext\n>(\n options: TsdownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsdown\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `tsdown` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n build: {\n ...options,\n variant: \"tsdown\"\n }\n } as Partial<TsdownPluginResolvedConfig>;\n },\n async build() {\n this.trace(\"Starting Tsdown build process...\");\n\n await build(\n defu(\n {\n config: false,\n plugins: [createTsdownPlugin(this)]\n },\n extractTsdownConfig(this)\n )\n );\n\n await formatPackageJson(this);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,OAAO;KACL,GAAG;KACH,SAAS;KACV;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;AAE9C,SAAM,MACJ,KACE;IACE,QAAQ;IACR,SAAS,CAAC,mBAAmB,KAAK,CAAC;IACpC,EACD,oBAAoB,KAAK,CAC1B,CACF;AAED,SAAM,kBAAkB,KAAK;;EAEhC;;AAGH,kBAAe"}
|
|
@@ -14,4 +14,4 @@ declare type __ΩTsdownPluginResolvedConfig = any[];
|
|
|
14
14
|
declare type __ΩTsdownPluginContext = any[];
|
|
15
15
|
//#endregion
|
|
16
16
|
export { __ΩTsdownPluginContext as a, __ΩTsdownPluginUserConfig as c, TsdownPluginUserConfig as i, TsdownPluginOptions as n, __ΩTsdownPluginOptions as o, TsdownPluginResolvedConfig as r, __ΩTsdownPluginResolvedConfig as s, TsdownPluginContext as t };
|
|
17
|
-
//# sourceMappingURL=plugin-
|
|
17
|
+
//# sourceMappingURL=plugin-CZEJ9SKF.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-CZEJ9SKF.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,mBAAA,GAAsB,QAAQ;KAE9B,sBAAA,GAAyB;AAFzB,KAIA,0BAAA,GAA6B,oBAJP;AAEtB,KAIA,mBAJsB,CAAA,wBAKR,0BAL2B,GAMjD,0BANiD,CAAA,GAOjD,aAPiD,CAOnC,eAPmC,CAAA;AAEzC,sCAA6B,GAAA,EAAA;AAE7B,yCAAmB,GAAA,EAAA;AACL,6CAAA,GAAA,EAAA;AACtB,sCAAA,GAAA,EAAA"}
|
|
@@ -14,4 +14,4 @@ declare type __ΩTsdownPluginResolvedConfig = any[];
|
|
|
14
14
|
declare type __ΩTsdownPluginContext = any[];
|
|
15
15
|
//#endregion
|
|
16
16
|
export { __ΩTsdownPluginContext as a, __ΩTsdownPluginUserConfig as c, TsdownPluginUserConfig as i, TsdownPluginOptions as n, __ΩTsdownPluginOptions as o, TsdownPluginResolvedConfig as r, __ΩTsdownPluginResolvedConfig as s, TsdownPluginContext as t };
|
|
17
|
-
//# sourceMappingURL=plugin-
|
|
17
|
+
//# sourceMappingURL=plugin-C_NYHEM5.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-C_NYHEM5.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,mBAAA,GAAsB,QAAQ;KAE9B,sBAAA,GAAyB;AAFzB,KAIA,0BAAA,GAA6B,oBAJP;AAEtB,KAIA,mBAJsB,CAAA,wBAKR,0BAL2B,GAMjD,0BANiD,CAAA,GAOjD,aAPiD,CAOnC,eAPmC,CAAA;AAEzC,sCAA6B,GAAA,EAAA;AAE7B,yCAAmB,GAAA,EAAA;AACL,6CAAA,GAAA,EAAA;AACtB,sCAAA,GAAA,EAAA"}
|
package/dist/types/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require('../plugin-
|
|
2
|
-
require('../types-
|
|
1
|
+
require('../plugin-Ckx8qAq8.cjs');
|
|
2
|
+
require('../types-a8gm_IaQ.cjs');
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-C_NYHEM5.cjs";
|
|
2
|
+
import "../index-BR1oNnaF.cjs";
|
|
3
3
|
export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-CZEJ9SKF.mjs";
|
|
2
|
+
import "../index-DNLi60D-.mjs";
|
|
3
3
|
export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require('../plugin-
|
|
1
|
+
require('../plugin-Ckx8qAq8.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-C_NYHEM5.cjs";
|
|
2
2
|
export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-
|
|
1
|
+
import { a as __ΩTsdownPluginContext, c as __ΩTsdownPluginUserConfig, i as TsdownPluginUserConfig, n as TsdownPluginOptions, o as __ΩTsdownPluginOptions, r as TsdownPluginResolvedConfig, s as __ΩTsdownPluginResolvedConfig, t as TsdownPluginContext } from "../plugin-CZEJ9SKF.mjs";
|
|
2
2
|
export { TsdownPluginContext, TsdownPluginOptions, TsdownPluginResolvedConfig, TsdownPluginUserConfig, __ΩTsdownPluginContext, __ΩTsdownPluginOptions, __ΩTsdownPluginResolvedConfig, __ΩTsdownPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-
|
|
1
|
+
{"version":3,"file":"unplugin-0Zevy5n4.mjs","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"powerlines/lib/unplugin\";\nimport { createRolldownPlugin } from \"unplugin\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\nexport function createTsdownPlugin(context: TsdownPluginContext) {\n return createRolldownPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,qBAAqB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as TsdownPluginContext } from "./plugin-
|
|
1
|
+
import { t as TsdownPluginContext } from "./plugin-C_NYHEM5.cjs";
|
|
2
2
|
import * as rolldown0 from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/unplugin.d.ts
|
|
5
5
|
declare function createTsdownPlugin(context: TsdownPluginContext): rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { createTsdownPlugin as t };
|
|
8
|
-
//# sourceMappingURL=unplugin-
|
|
8
|
+
//# sourceMappingURL=unplugin-DAxS5ZTK.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-DAxS5ZTK.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as TsdownPluginContext } from "./plugin-
|
|
1
|
+
import { t as TsdownPluginContext } from "./plugin-CZEJ9SKF.mjs";
|
|
2
2
|
import * as rolldown0 from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/unplugin.d.ts
|
|
5
5
|
declare function createTsdownPlugin(context: TsdownPluginContext): rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { createTsdownPlugin as t };
|
|
8
|
-
//# sourceMappingURL=unplugin-
|
|
8
|
+
//# sourceMappingURL=unplugin-YSgWz6zp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-YSgWz6zp.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.204",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -69,6 +69,20 @@
|
|
|
69
69
|
"default": "./dist/helpers/index.mjs"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
+
"./helpers/format-package-json": {
|
|
73
|
+
"require": {
|
|
74
|
+
"types": "./dist/helpers/format-package-json.d.cts",
|
|
75
|
+
"default": "./dist/helpers/format-package-json.cjs"
|
|
76
|
+
},
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./dist/helpers/format-package-json.d.mts",
|
|
79
|
+
"default": "./dist/helpers/format-package-json.mjs"
|
|
80
|
+
},
|
|
81
|
+
"default": {
|
|
82
|
+
"types": "./dist/helpers/format-package-json.d.mts",
|
|
83
|
+
"default": "./dist/helpers/format-package-json.mjs"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
72
86
|
"./helpers/unplugin": {
|
|
73
87
|
"require": {
|
|
74
88
|
"types": "./dist/helpers/unplugin.d.cts",
|
|
@@ -118,15 +132,15 @@
|
|
|
118
132
|
"keywords": ["tsdown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
119
133
|
"dependencies": {
|
|
120
134
|
"defu": "^6.1.4",
|
|
121
|
-
"powerlines": "^0.38.
|
|
135
|
+
"powerlines": "^0.38.18",
|
|
122
136
|
"tsdown": "0.17.0-beta.5",
|
|
123
137
|
"unplugin": "3.0.0-beta.3"
|
|
124
138
|
},
|
|
125
139
|
"devDependencies": {
|
|
126
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
140
|
+
"@powerlines/plugin-plugin": "^0.12.202",
|
|
127
141
|
"@types/node": "^24.10.9"
|
|
128
142
|
},
|
|
129
143
|
"publishConfig": { "access": "public" },
|
|
130
144
|
"types": "./dist/index.d.cts",
|
|
131
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "e29af8437f93d198bc9f140cd38a6a06b1634508"
|
|
132
146
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-COtJJRXi.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin-rS-jtHDh.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,SAAA,CAAA,cAAA,SAAA,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|