@powerlines/plugin-deepkit 0.11.370 → 0.11.371

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.cjs CHANGED
@@ -30,244 +30,8 @@ require('./types/index.cjs');
30
30
  let _powerlines_deepkit_transformer = require("@powerlines/deepkit/transformer");
31
31
  let _powerlines_plugin_tsc = require("@powerlines/plugin-tsc");
32
32
  _powerlines_plugin_tsc = __toESM(_powerlines_plugin_tsc, 1);
33
+ let _stryke_path_append = require("@stryke/path/append");
33
34
 
34
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/cwd.mjs
35
- /**
36
- * Get the current working directory.
37
- *
38
- * @remarks
39
- * This function attempts to retrieve the current working directory using `process.cwd()`.
40
- *
41
- * @returns The current working directory or '/' if it cannot be determined
42
- */
43
- function cwd() {
44
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
45
- return "/";
46
- }
47
-
48
- //#endregion
49
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/regex.mjs
50
- const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
51
- const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
52
- const UNC_REGEX = /^[/\\]{2}/;
53
- const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
54
-
55
- //#endregion
56
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-type.mjs
57
- /**
58
- * Check if the path is an absolute path.
59
- *
60
- * @param path - The path to check
61
- * @returns An indicator specifying if the path is an absolute path
62
- */
63
- function isAbsolutePath(path) {
64
- return ABSOLUTE_PATH_REGEX.test(slash(path));
65
- }
66
- /**
67
- * Check if the path is an absolute path.
68
- *
69
- * @remarks
70
- * This is an alias for {@link isAbsolutePath}.
71
- *
72
- * @param path - The path to check
73
- * @returns An indicator specifying if the path is an absolute path
74
- */
75
- function isAbsolute(path) {
76
- return isAbsolutePath(path);
77
- }
78
-
79
- //#endregion
80
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/slash.mjs
81
- /**
82
- * Replace backslash to slash
83
- *
84
- * @param path - The string to replace
85
- * @returns The string with replaced backslashes
86
- */
87
- function slash(path) {
88
- if (path.startsWith("\\\\?\\")) return path;
89
- return path.replace(/\\/g, "/");
90
- }
91
-
92
- //#endregion
93
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-parent-path.mjs
94
- /**
95
- * Check if a given path is a parent of another path.
96
- *
97
- * @example
98
- * ```ts
99
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src");
100
- * // returns true
101
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project");
102
- * // returns true
103
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/other");
104
- * // returns false
105
- * isParentPath("/home/user/project/src/index.ts", "/home/user/other");
106
- * // returns false
107
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/index.ts");
108
- * // returns false
109
- * ```
110
- *
111
- * @param childPath - The path to check if it is a child of the parent path.
112
- * @param parentPath - The path to check if it is a parent of the child path.
113
- * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.
114
- */
115
- function isParentPath(childPath, parentPath) {
116
- const normalizedChild = slash(childPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
117
- const normalizedParent = slash(parentPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
118
- return childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
119
- }
120
-
121
- //#endregion
122
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/join-paths.mjs
123
- function normalizeWindowsPath(input = "") {
124
- if (!input) return input;
125
- return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
126
- }
127
- function correctPaths(path) {
128
- if (!path || path.length === 0) return ".";
129
- path = normalizeWindowsPath(path);
130
- const isUNCPath = path.match(UNC_REGEX);
131
- const isPathAbsolute = isAbsolute(path);
132
- const trailingSeparator = path[path.length - 1] === "/";
133
- path = normalizeString(path, !isPathAbsolute);
134
- if (path.length === 0) {
135
- if (isPathAbsolute) return "/";
136
- return trailingSeparator ? "./" : ".";
137
- }
138
- if (trailingSeparator) path += "/";
139
- if (DRIVE_LETTER_REGEX.test(path)) path += "/";
140
- if (isUNCPath) {
141
- if (!isPathAbsolute) return `//./${path}`;
142
- return `//${path}`;
143
- }
144
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
145
- }
146
- /**
147
- * Joins all given path segments together using the platform-specific separator as a delimiter.
148
- *
149
- * @remarks
150
- * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
151
- *
152
- * @example
153
- * ```ts
154
- * import { joinPaths } from 'stryke/path';
155
- *
156
- * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
157
- * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
158
- *
159
- * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
160
- * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
161
- *
162
- * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
163
- * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
164
- *
165
- * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
166
- * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
167
- * ```
168
- *
169
- * @param segments - The path segments to join.
170
- * @returns The joined and normalized path string.
171
- */
172
- function joinPaths(...segments) {
173
- let result = "";
174
- for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
175
- if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
176
- else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
177
- else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
178
- }
179
- return correctPaths(result);
180
- }
181
- /**
182
- * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
183
- *
184
- * @param path - The path to normalize.
185
- * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
186
- * @returns the normalized path string.
187
- */
188
- function normalizeString(path, allowAboveRoot) {
189
- let res = "";
190
- let lastSegmentLength = 0;
191
- let lastSlash = -1;
192
- let dots = 0;
193
- let char = null;
194
- for (let index = 0; index <= path.length; ++index) {
195
- if (index < path.length) char = path[index];
196
- else if (char === "/") break;
197
- else char = "/";
198
- if (char === "/") {
199
- if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
200
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
201
- if (res.length > 2) {
202
- const lastSlashIndex = res.lastIndexOf("/");
203
- if (lastSlashIndex === -1) {
204
- res = "";
205
- lastSegmentLength = 0;
206
- } else {
207
- res = res.slice(0, lastSlashIndex);
208
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
209
- }
210
- lastSlash = index;
211
- dots = 0;
212
- continue;
213
- } else if (res.length > 0) {
214
- res = "";
215
- lastSegmentLength = 0;
216
- lastSlash = index;
217
- dots = 0;
218
- continue;
219
- }
220
- }
221
- if (allowAboveRoot) {
222
- res += res.length > 0 ? "/.." : "..";
223
- lastSegmentLength = 2;
224
- }
225
- } else {
226
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
227
- else res = path.slice(lastSlash + 1, index);
228
- lastSegmentLength = index - lastSlash - 1;
229
- }
230
- lastSlash = index;
231
- dots = 0;
232
- } else if (char === "." && dots !== -1) ++dots;
233
- else dots = -1;
234
- }
235
- return res;
236
- }
237
-
238
- //#endregion
239
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/append.mjs
240
- /**
241
- * If not already a parent path, append the base path from the beginning of the given child path.
242
- *
243
- * @example
244
- * ```ts
245
- * appendPath("src/index.ts", "/home/user/project");
246
- * // returns "/home/user/project/src/index.ts"
247
- *
248
- * appendPath("/user/dev/app.ts", "/user/dev");
249
- * // returns "/user/dev/app.ts"
250
- *
251
- * appendPath("docs/readme.md");
252
- * // returns "<current_working_directory>/docs/readme.md"
253
- *
254
- * appendPath("src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
255
- * // returns "/home/user/project/src/index.ts"
256
- *
257
- * appendPath("/home/user/project/src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
258
- * // returns "/home/user/project/src/index.ts"
259
- * ```
260
- *
261
- * @param childPath - The child path to append to the {@link parentPath}
262
- * @param parentPath - The parent path to add the {@link childPath} to
263
- * @param options - Options for appending the path
264
- * @returns The {@link parentPath} with the {@link childPath} appended
265
- */
266
- function appendPath(childPath, parentPath = cwd(), options = {}) {
267
- return slash(options.skipIfAlreadyParent !== false && isParentPath(childPath, parentPath) ? childPath : joinPaths(parentPath, childPath));
268
- }
269
-
270
- //#endregion
271
35
  //#region src/index.ts
272
36
  /**
273
37
  * Deepkit plugin for Powerlines.
@@ -305,7 +69,7 @@ const plugin = (options = {}) => {
305
69
  exclude: this.config.deepkit.exclude ?? [],
306
70
  reflection,
307
71
  level,
308
- configFilePath: appendPath(this.tsconfig.tsconfigFilePath, this.config.cwd)
72
+ configFilePath: (0, _stryke_path_append.appendPath)(this.tsconfig.tsconfigFilePath, this.config.cwd)
309
73
  };
310
74
  this.config.tsc.transformers ??= {
311
75
  before: [],
package/dist/index.mjs CHANGED
@@ -1,244 +1,8 @@
1
1
  import "./types/index.mjs";
2
2
  import { createDeclarationTransformer, createTransformer } from "@powerlines/deepkit/transformer";
3
3
  import tsc from "@powerlines/plugin-tsc";
4
+ import { appendPath } from "@stryke/path/append";
4
5
 
5
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/cwd.mjs
6
- /**
7
- * Get the current working directory.
8
- *
9
- * @remarks
10
- * This function attempts to retrieve the current working directory using `process.cwd()`.
11
- *
12
- * @returns The current working directory or '/' if it cannot be determined
13
- */
14
- function cwd() {
15
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
16
- return "/";
17
- }
18
-
19
- //#endregion
20
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/regex.mjs
21
- const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
22
- const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
23
- const UNC_REGEX = /^[/\\]{2}/;
24
- const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
25
-
26
- //#endregion
27
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-type.mjs
28
- /**
29
- * Check if the path is an absolute path.
30
- *
31
- * @param path - The path to check
32
- * @returns An indicator specifying if the path is an absolute path
33
- */
34
- function isAbsolutePath(path) {
35
- return ABSOLUTE_PATH_REGEX.test(slash(path));
36
- }
37
- /**
38
- * Check if the path is an absolute path.
39
- *
40
- * @remarks
41
- * This is an alias for {@link isAbsolutePath}.
42
- *
43
- * @param path - The path to check
44
- * @returns An indicator specifying if the path is an absolute path
45
- */
46
- function isAbsolute(path) {
47
- return isAbsolutePath(path);
48
- }
49
-
50
- //#endregion
51
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/slash.mjs
52
- /**
53
- * Replace backslash to slash
54
- *
55
- * @param path - The string to replace
56
- * @returns The string with replaced backslashes
57
- */
58
- function slash(path) {
59
- if (path.startsWith("\\\\?\\")) return path;
60
- return path.replace(/\\/g, "/");
61
- }
62
-
63
- //#endregion
64
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-parent-path.mjs
65
- /**
66
- * Check if a given path is a parent of another path.
67
- *
68
- * @example
69
- * ```ts
70
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src");
71
- * // returns true
72
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project");
73
- * // returns true
74
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/other");
75
- * // returns false
76
- * isParentPath("/home/user/project/src/index.ts", "/home/user/other");
77
- * // returns false
78
- * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/index.ts");
79
- * // returns false
80
- * ```
81
- *
82
- * @param childPath - The path to check if it is a child of the parent path.
83
- * @param parentPath - The path to check if it is a parent of the child path.
84
- * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.
85
- */
86
- function isParentPath(childPath, parentPath) {
87
- const normalizedChild = slash(childPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
88
- const normalizedParent = slash(parentPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
89
- return childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
90
- }
91
-
92
- //#endregion
93
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/join-paths.mjs
94
- function normalizeWindowsPath(input = "") {
95
- if (!input) return input;
96
- return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
97
- }
98
- function correctPaths(path) {
99
- if (!path || path.length === 0) return ".";
100
- path = normalizeWindowsPath(path);
101
- const isUNCPath = path.match(UNC_REGEX);
102
- const isPathAbsolute = isAbsolute(path);
103
- const trailingSeparator = path[path.length - 1] === "/";
104
- path = normalizeString(path, !isPathAbsolute);
105
- if (path.length === 0) {
106
- if (isPathAbsolute) return "/";
107
- return trailingSeparator ? "./" : ".";
108
- }
109
- if (trailingSeparator) path += "/";
110
- if (DRIVE_LETTER_REGEX.test(path)) path += "/";
111
- if (isUNCPath) {
112
- if (!isPathAbsolute) return `//./${path}`;
113
- return `//${path}`;
114
- }
115
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
116
- }
117
- /**
118
- * Joins all given path segments together using the platform-specific separator as a delimiter.
119
- *
120
- * @remarks
121
- * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
122
- *
123
- * @example
124
- * ```ts
125
- * import { joinPaths } from 'stryke/path';
126
- *
127
- * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
128
- * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
129
- *
130
- * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
131
- * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
132
- *
133
- * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
134
- * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
135
- *
136
- * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
137
- * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
138
- * ```
139
- *
140
- * @param segments - The path segments to join.
141
- * @returns The joined and normalized path string.
142
- */
143
- function joinPaths(...segments) {
144
- let result = "";
145
- for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
146
- if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
147
- else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
148
- else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
149
- }
150
- return correctPaths(result);
151
- }
152
- /**
153
- * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
154
- *
155
- * @param path - The path to normalize.
156
- * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
157
- * @returns the normalized path string.
158
- */
159
- function normalizeString(path, allowAboveRoot) {
160
- let res = "";
161
- let lastSegmentLength = 0;
162
- let lastSlash = -1;
163
- let dots = 0;
164
- let char = null;
165
- for (let index = 0; index <= path.length; ++index) {
166
- if (index < path.length) char = path[index];
167
- else if (char === "/") break;
168
- else char = "/";
169
- if (char === "/") {
170
- if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
171
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
172
- if (res.length > 2) {
173
- const lastSlashIndex = res.lastIndexOf("/");
174
- if (lastSlashIndex === -1) {
175
- res = "";
176
- lastSegmentLength = 0;
177
- } else {
178
- res = res.slice(0, lastSlashIndex);
179
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
180
- }
181
- lastSlash = index;
182
- dots = 0;
183
- continue;
184
- } else if (res.length > 0) {
185
- res = "";
186
- lastSegmentLength = 0;
187
- lastSlash = index;
188
- dots = 0;
189
- continue;
190
- }
191
- }
192
- if (allowAboveRoot) {
193
- res += res.length > 0 ? "/.." : "..";
194
- lastSegmentLength = 2;
195
- }
196
- } else {
197
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
198
- else res = path.slice(lastSlash + 1, index);
199
- lastSegmentLength = index - lastSlash - 1;
200
- }
201
- lastSlash = index;
202
- dots = 0;
203
- } else if (char === "." && dots !== -1) ++dots;
204
- else dots = -1;
205
- }
206
- return res;
207
- }
208
-
209
- //#endregion
210
- //#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/append.mjs
211
- /**
212
- * If not already a parent path, append the base path from the beginning of the given child path.
213
- *
214
- * @example
215
- * ```ts
216
- * appendPath("src/index.ts", "/home/user/project");
217
- * // returns "/home/user/project/src/index.ts"
218
- *
219
- * appendPath("/user/dev/app.ts", "/user/dev");
220
- * // returns "/user/dev/app.ts"
221
- *
222
- * appendPath("docs/readme.md");
223
- * // returns "<current_working_directory>/docs/readme.md"
224
- *
225
- * appendPath("src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
226
- * // returns "/home/user/project/src/index.ts"
227
- *
228
- * appendPath("/home/user/project/src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
229
- * // returns "/home/user/project/src/index.ts"
230
- * ```
231
- *
232
- * @param childPath - The child path to append to the {@link parentPath}
233
- * @param parentPath - The parent path to add the {@link childPath} to
234
- * @param options - Options for appending the path
235
- * @returns The {@link parentPath} with the {@link childPath} appended
236
- */
237
- function appendPath(childPath, parentPath = cwd(), options = {}) {
238
- return slash(options.skipIfAlreadyParent !== false && isParentPath(childPath, parentPath) ? childPath : joinPaths(parentPath, childPath));
239
- }
240
-
241
- //#endregion
242
6
  //#region src/index.ts
243
7
  /**
244
8
  * Deepkit plugin for Powerlines.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/cwd.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/regex.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-type.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/slash.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/is-parent-path.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/join-paths.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_66e9bd02e1bcd5670145709b889a699d/node_modules/@stryke/path/dist/append.mjs","../src/index.ts"],"sourcesContent":["//#region src/cwd.ts\n/**\n* Get the current working directory.\n*\n* @remarks\n* This function attempts to retrieve the current working directory using `process.cwd()`.\n*\n* @returns The current working directory or '/' if it cannot be determined\n*/\nfunction cwd() {\n\tif (typeof process !== \"undefined\" && typeof process.cwd === \"function\") return process.cwd().replace(/\\\\/g, \"/\");\n\treturn \"/\";\n}\n\n//#endregion\nexport { cwd };\n//# sourceMappingURL=cwd.mjs.map","//#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 { 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 { 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 { slash } from \"./slash.mjs\";\n\n//#region src/is-parent-path.ts\n/**\n* Check if a given path is a parent of another path.\n*\n* @example\n* ```ts\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src\");\n* // returns true\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n* // returns true\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/other\");\n* // returns false\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/other\");\n* // returns false\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/index.ts\");\n* // returns false\n* ```\n*\n* @param childPath - The path to check if it is a child of the parent path.\n* @param parentPath - The path to check if it is a parent of the child path.\n* @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.\n*/\nfunction isParentPath(childPath, parentPath) {\n\tconst normalizedChild = slash(childPath.replaceAll(/\\\\/g, \"/\").replace(/\\/*$/, \"\"))?.toLowerCase();\n\tconst normalizedParent = slash(parentPath.replaceAll(/\\\\/g, \"/\").replace(/\\/*$/, \"\"))?.toLowerCase();\n\treturn childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);\n}\n\n//#endregion\nexport { isParentPath };\n//# sourceMappingURL=is-parent-path.mjs.map","import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from \"./regex.mjs\";\nimport { isAbsolute } from \"./is-type.mjs\";\nimport { slash } from \"./slash.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*\n* @remarks\n* Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.\n*\n* @example\n* ```ts\n* import { joinPaths } from 'stryke/path';\n*\n* const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');\n* console.log(fullPath); // Output: 'folder1/folder3/file.txt'\n*\n* const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');\n* console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'\n*\n* const windowsPath = joinPaths('C:\\\\', 'Users', 'Public', '..', 'Documents', 'file.txt');\n* console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'\n*\n* const uncPath = joinPaths('\\\\\\\\Server\\\\Share', 'Folder', 'File.txt');\n* console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'\n* ```\n*\n* @param segments - The path segments to join.\n* @returns The joined and normalized path string.\n*/\nfunction joinPaths(...segments) {\n\tlet result = \"\";\n\tfor (const segment of segments) if (segment && slash(segment).replaceAll(/\\//g, \"\") !== \".\") {\n\t\tif (result) if (slash(segment).replaceAll(/\\//g, \"\") === \"..\") result = slash(result).replace(/\\/+$/, \"\").replace(/\\/*[^/]+$/, \"\");\n\t\telse result = `${slash(result).replace(/\\/+$/, \"\")}/${slash(segment).replace(/^\\/+/, \"\")}`;\n\t\telse if (slash(segment).replaceAll(/\\//g, \"\") !== \"..\") result = segment;\n\t}\n\treturn correctPaths(result);\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","import { cwd } from \"./cwd.mjs\";\nimport { slash } from \"./slash.mjs\";\nimport { isParentPath } from \"./is-parent-path.mjs\";\nimport { joinPaths } from \"./join-paths.mjs\";\n\n//#region src/append.ts\n/**\n* If not already a parent path, append the base path from the beginning of the given child path.\n*\n* @example\n* ```ts\n* appendPath(\"src/index.ts\", \"/home/user/project\");\n* // returns \"/home/user/project/src/index.ts\"\n*\n* appendPath(\"/user/dev/app.ts\", \"/user/dev\");\n* // returns \"/user/dev/app.ts\"\n*\n* appendPath(\"docs/readme.md\");\n* // returns \"<current_working_directory>/docs/readme.md\"\n*\n* appendPath(\"src/index.ts\", \"/home/user/project\", { skipIfAlreadyParent: false });\n* // returns \"/home/user/project/src/index.ts\"\n*\n* appendPath(\"/home/user/project/src/index.ts\", \"/home/user/project\", { skipIfAlreadyParent: false });\n* // returns \"/home/user/project/src/index.ts\"\n* ```\n*\n* @param childPath - The child path to append to the {@link parentPath}\n* @param parentPath - The parent path to add the {@link childPath} to\n* @param options - Options for appending the path\n* @returns The {@link parentPath} with the {@link childPath} appended\n*/\nfunction appendPath(childPath, parentPath = cwd(), options = {}) {\n\treturn slash(options.skipIfAlreadyParent !== false && isParentPath(childPath, parentPath) ? childPath : joinPaths(parentPath, childPath));\n}\nconst append = appendPath;\n/**\n* Append the extension to the given path.\n*\n* @example\n* ```ts\n* appendExtension(\"/home/user/project/src/index\", \".ts\");\n* // returns \"/home/user/project/src/index.ts\"\n* appendExtension(\"/home/user/project/src/index.ts\", \".js\");\n* // returns \"/home/user/project/src/index.ts.js\"\n* ```\n*\n* @param path - The path to append the extension to.\n* @param extension - The extension to append.\n* @returns The path with the appended extension.\n*/\nfunction appendExtension(path, extension) {\n\treturn `${path}.${extension.replace(/^\\./, \"\")}`;\n}\n\n//#endregion\nexport { append, appendExtension, appendPath };\n//# sourceMappingURL=append.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 {\n createDeclarationTransformer,\n createTransformer\n} from \"@powerlines/deepkit/transformer\";\nimport tsc from \"@powerlines/plugin-tsc\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { Plugin } from \"powerlines\";\nimport { DeepkitPluginContext, DeepkitPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n deepkit?: DeepkitPluginOptions;\n }\n}\n\n/**\n * Deepkit plugin for Powerlines.\n *\n * @param options - The Deepkit plugin user configuration options.\n * @returns A Powerlines plugin that integrates Deepkit transformations.\n */\nexport const plugin = <\n TContext extends DeepkitPluginContext = DeepkitPluginContext\n>(\n options: DeepkitPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n tsc({ order: \"pre\", ...options }),\n {\n name: \"deepkit\",\n config() {\n return {\n deepkit: options ?? {},\n resolve: {\n external: [\n \"@powerlines/deepkit/vendor/type-compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/config\",\n \"@powerlines/deepkit/vendor/type-spec\",\n \"@powerlines/deepkit/vendor/type\",\n \"@powerlines/deepkit/vendor/core\"\n ]\n }\n };\n },\n configResolved: {\n order: \"post\",\n async handler() {\n const reflection =\n this.config.deepkit.reflection ||\n this.tsconfig.tsconfigJson.compilerOptions?.reflection ||\n this.tsconfig.tsconfigJson.reflection ||\n \"default\";\n const level =\n this.config.deepkit.level ||\n this.tsconfig.tsconfigJson.compilerOptions?.level ||\n this.tsconfig.tsconfigJson.level ||\n \"default\";\n\n this.config.tsc ??= {} as TContext[\"config\"][\"tsc\"];\n this.config.tsc.compilerOptions = {\n ...(this.config.tsc.compilerOptions ?? {}),\n exclude: this.config.deepkit.exclude ?? [],\n reflection,\n level,\n configFilePath: appendPath(\n this.tsconfig.tsconfigFilePath,\n this.config.cwd\n )\n };\n\n this.config.tsc.transformers ??= {\n before: [],\n after: []\n };\n\n this.config.tsc.transformers.before!.push(\n createTransformer(this, this.config.deepkit)\n );\n this.config.tsc.transformers.after!.push(\n createDeclarationTransformer(this, this.config.deepkit)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;AASA,SAAS,MAAM;AACd,KAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,QAAQ,WAAY,QAAO,QAAQ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3B;AAEF,SAAK,OAAO,QAAQ,EAAE;AACtB,SAAK,OAAO,IAAI,kBAAkB;KAChC,GAAI,KAAK,OAAO,IAAI,mBAAmB,EAAE;KACzC,SAAS,KAAK,OAAO,QAAQ,WAAW,EAAE;KAC1C;KACA;KACA,gBAAgB,WACd,KAAK,SAAS,kBACd,KAAK,OAAO,IACb;KACF;AAED,SAAK,OAAO,IAAI,iBAAiB;KAC/B,QAAQ,EAAE;KACV,OAAO,EAAE;KACV;AAED,SAAK,OAAO,IAAI,aAAa,OAAQ,KACnC,kBAAkB,MAAM,KAAK,OAAO,QAAQ,CAC7C;AACD,SAAK,OAAO,IAAI,aAAa,MAAO,KAClC,6BAA6B,MAAM,KAAK,OAAO,QAAQ,CACxD;;GAEJ;EACF,CACF"}
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 {\n createDeclarationTransformer,\n createTransformer\n} from \"@powerlines/deepkit/transformer\";\nimport tsc from \"@powerlines/plugin-tsc\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { Plugin } from \"powerlines\";\nimport { DeepkitPluginContext, DeepkitPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n deepkit?: DeepkitPluginOptions;\n }\n}\n\n/**\n * Deepkit plugin for Powerlines.\n *\n * @param options - The Deepkit plugin user configuration options.\n * @returns A Powerlines plugin that integrates Deepkit transformations.\n */\nexport const plugin = <\n TContext extends DeepkitPluginContext = DeepkitPluginContext\n>(\n options: DeepkitPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n tsc({ order: \"pre\", ...options }),\n {\n name: \"deepkit\",\n config() {\n return {\n deepkit: options ?? {},\n resolve: {\n external: [\n \"@powerlines/deepkit/vendor/type-compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/config\",\n \"@powerlines/deepkit/vendor/type-spec\",\n \"@powerlines/deepkit/vendor/type\",\n \"@powerlines/deepkit/vendor/core\"\n ]\n }\n };\n },\n configResolved: {\n order: \"post\",\n async handler() {\n const reflection =\n this.config.deepkit.reflection ||\n this.tsconfig.tsconfigJson.compilerOptions?.reflection ||\n this.tsconfig.tsconfigJson.reflection ||\n \"default\";\n const level =\n this.config.deepkit.level ||\n this.tsconfig.tsconfigJson.compilerOptions?.level ||\n this.tsconfig.tsconfigJson.level ||\n \"default\";\n\n this.config.tsc ??= {} as TContext[\"config\"][\"tsc\"];\n this.config.tsc.compilerOptions = {\n ...(this.config.tsc.compilerOptions ?? {}),\n exclude: this.config.deepkit.exclude ?? [],\n reflection,\n level,\n configFilePath: appendPath(\n this.tsconfig.tsconfigFilePath,\n this.config.cwd\n )\n };\n\n this.config.tsc.transformers ??= {\n before: [],\n after: []\n };\n\n this.config.tsc.transformers.before!.push(\n createTransformer(this, this.config.deepkit)\n );\n this.config.tsc.transformers.after!.push(\n createDeclarationTransformer(this, this.config.deepkit)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAyCA,MAAa,UAGX,UAAgC,EAAE,KACX;AACvB,QAAO,CACL,IAAI;EAAE,OAAO;EAAO,GAAG;EAAS,CAAC,EACjC;EACE,MAAM;EACN,SAAS;AACP,UAAO;IACL,SAAS,WAAW,EAAE;IACtB,SAAS,EACP,UAAU;KACR;KACA;KACA;KACA;KACA;KACA;KACD,EACF;IACF;;EAEH,gBAAgB;GACd,OAAO;GACP,MAAM,UAAU;IACd,MAAM,aACJ,KAAK,OAAO,QAAQ,cACpB,KAAK,SAAS,aAAa,iBAAiB,cAC5C,KAAK,SAAS,aAAa,cAC3B;IACF,MAAM,QACJ,KAAK,OAAO,QAAQ,SACpB,KAAK,SAAS,aAAa,iBAAiB,SAC5C,KAAK,SAAS,aAAa,SAC3B;AAEF,SAAK,OAAO,QAAQ,EAAE;AACtB,SAAK,OAAO,IAAI,kBAAkB;KAChC,GAAI,KAAK,OAAO,IAAI,mBAAmB,EAAE;KACzC,SAAS,KAAK,OAAO,QAAQ,WAAW,EAAE;KAC1C;KACA;KACA,gBAAgB,WACd,KAAK,SAAS,kBACd,KAAK,OAAO,IACb;KACF;AAED,SAAK,OAAO,IAAI,iBAAiB;KAC/B,QAAQ,EAAE;KACV,OAAO,EAAE;KACV;AAED,SAAK,OAAO,IAAI,aAAa,OAAQ,KACnC,kBAAkB,MAAM,KAAK,OAAO,QAAQ,CAC7C;AACD,SAAK,OAAO,IAAI,aAAa,MAAO,KAClC,6BAA6B,MAAM,KAAK,OAAO,QAAQ,CACxD;;GAEJ;EACF,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-deepkit",
3
- "version": "0.11.370",
3
+ "version": "0.11.371",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -54,19 +54,20 @@
54
54
  },
55
55
  "types": "./dist/index.d.cts",
56
56
  "typings": "dist/index.d.mts",
57
- "files": ["dist/**/*"],
58
- "keywords": ["deepkit", "powerlines", "storm-software", "powerlines-plugin"],
57
+ "files": ["dist"],
58
+ "keywords": ["deepkit", "powerlines", "powerlines-plugin"],
59
59
  "dependencies": {
60
- "@powerlines/deepkit": "workspace:*",
61
- "@powerlines/plugin-tsc": "workspace:*",
62
- "@stryke/json": "catalog:",
63
- "powerlines": "workspace:*",
60
+ "@powerlines/deepkit": "^0.9.8",
61
+ "@powerlines/plugin-tsc": "^0.3.25",
62
+ "@stryke/json": "^0.15.0",
63
+ "@stryke/path": "^0.29.3",
64
+ "powerlines": "^0.47.28",
64
65
  "typescript": "^6.0.3"
65
66
  },
66
67
  "devDependencies": {
67
- "@powerlines/plugin-plugin": "workspace:*",
68
- "@types/node": "catalog:"
68
+ "@powerlines/plugin-plugin": "^0.12.440",
69
+ "@types/node": "^25.8.0"
69
70
  },
70
71
  "publishConfig": { "access": "public" },
71
- "inlinedDependencies": { "@stryke/path": "0.29.3" }
72
+ "gitHead": "42960678257e089a5a86f7b7f4fb714f6eacaef2"
72
73
  }