@kubb/core 4.11.3 → 4.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fs-DhLl4-lT.cjs +177 -0
- package/dist/fs-DhLl4-lT.cjs.map +1 -0
- package/dist/fs-ph1OdgEr.js +108 -0
- package/dist/fs-ph1OdgEr.js.map +1 -0
- package/dist/fs.cjs +8 -0
- package/dist/fs.d.cts +21 -0
- package/dist/fs.d.ts +21 -0
- package/dist/fs.js +3 -0
- package/dist/{getBarrelFiles-ZIHk_1ln.d.ts → getBarrelFiles-BEWbZEZf.d.ts} +3 -6
- package/dist/{getBarrelFiles-8VEWWk9Z.cjs → getBarrelFiles-BcgToi50.cjs} +71 -62
- package/dist/getBarrelFiles-BcgToi50.cjs.map +1 -0
- package/dist/{getBarrelFiles-DQ0hksqD.js → getBarrelFiles-ClyWjO0d.js} +65 -55
- package/dist/getBarrelFiles-ClyWjO0d.js.map +1 -0
- package/dist/{getBarrelFiles-B_2WDywH.d.cts → getBarrelFiles-LW3anr-E.d.cts} +3 -6
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.cjs +68 -212
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -9
- package/dist/index.d.ts +8 -9
- package/dist/index.js +61 -204
- package/dist/index.js.map +1 -1
- package/dist/{transformers-B-zCAPV-.cjs → transformers-BqQRkrxy.cjs} +2 -2
- package/dist/{transformers-B-zCAPV-.cjs.map → transformers-BqQRkrxy.cjs.map} +1 -1
- package/dist/{transformers-CjdbeLAK.js → transformers-C481fXH-.js} +1 -1
- package/dist/{transformers-CjdbeLAK.js.map → transformers-C481fXH-.js.map} +1 -1
- package/dist/transformers.cjs +2 -2
- package/dist/transformers.js +1 -1
- package/dist/{types-DgfEZ3IN.d.ts → types-DZARm27h.d.ts} +253 -46
- package/dist/{types-CCEy_FVr.d.cts → types-icDNKrIP.d.cts} +253 -46
- package/dist/utils.cjs +6 -5
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +3 -3
- package/package.json +10 -17
- package/src/BarrelManager.ts +3 -18
- package/src/Kubb.ts +249 -0
- package/src/PluginManager.ts +42 -73
- package/src/build.ts +38 -138
- package/src/defineLogger.ts +7 -0
- package/src/index.ts +2 -1
- package/src/types.ts +35 -2
- package/src/utils/getBarrelFiles.ts +7 -10
- package/src/utils/index.ts +1 -0
- package/dist/EventEmitter-BwU6Ixxt.cjs +0 -31
- package/dist/EventEmitter-BwU6Ixxt.cjs.map +0 -1
- package/dist/EventEmitter-DlzW04T3.js +0 -25
- package/dist/EventEmitter-DlzW04T3.js.map +0 -1
- package/dist/chunk-CbDLau6x.cjs +0 -34
- package/dist/getBarrelFiles-8VEWWk9Z.cjs.map +0 -1
- package/dist/getBarrelFiles-DQ0hksqD.js.map +0 -1
- package/dist/logger-CQn6sdC0.js +0 -1152
- package/dist/logger-CQn6sdC0.js.map +0 -1
- package/dist/logger-US5g7KdM.cjs +0 -1187
- package/dist/logger-US5g7KdM.cjs.map +0 -1
- package/dist/logger-mq06Cxxv.d.cts +0 -94
- package/dist/logger-o16AyvGp.d.ts +0 -94
- package/dist/logger.cjs +0 -6
- package/dist/logger.d.cts +0 -2
- package/dist/logger.d.ts +0 -2
- package/dist/logger.js +0 -3
- package/dist/prompt-CWSscQpj.cjs +0 -852
- package/dist/prompt-CWSscQpj.cjs.map +0 -1
- package/dist/prompt-Dt0jyRBe.js +0 -848
- package/dist/prompt-Dt0jyRBe.js.map +0 -1
- package/src/logger.ts +0 -236
- package/src/utils/ciDetection.ts +0 -40
package/dist/index.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import "./transformers-
|
|
1
|
+
import { a as exists, i as readSync, n as getRelativePath, o as clean, r as read, t as write } from "./fs-ph1OdgEr.js";
|
|
2
|
+
import { a as getMode, c as PromiseManager, i as PluginManager, l as Queue, n as URLPath, r as AsyncEventEmitter, t as getBarrelFiles } from "./getBarrelFiles-ClyWjO0d.js";
|
|
3
|
+
import "./transformers-C481fXH-.js";
|
|
4
4
|
import mod from "node:module";
|
|
5
|
-
import path, { join,
|
|
5
|
+
import path, { join, resolve } from "node:path";
|
|
6
6
|
import { performance } from "node:perf_hooks";
|
|
7
7
|
import { createFabric } from "@kubb/react-fabric";
|
|
8
8
|
import { typescriptParser } from "@kubb/react-fabric/parsers";
|
|
9
9
|
import { fsPlugin } from "@kubb/react-fabric/plugins";
|
|
10
|
-
import pc from "picocolors";
|
|
11
10
|
import { isDeepEqual } from "remeda";
|
|
12
|
-
import
|
|
13
|
-
import { switcher } from "js-runtime";
|
|
14
|
-
import g$1, { version } from "node:process";
|
|
11
|
+
import process$1, { version } from "node:process";
|
|
15
12
|
import os from "node:os";
|
|
16
13
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
-
import fs
|
|
14
|
+
import fs, { promises } from "node:fs";
|
|
18
15
|
import { coerce, satisfies } from "semver";
|
|
19
16
|
|
|
20
17
|
//#region src/BaseGenerator.ts
|
|
@@ -70,62 +67,9 @@ function isInputPath(config) {
|
|
|
70
67
|
return typeof config?.input === "object" && config.input !== null && "path" in config.input;
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/fs/clean.ts
|
|
75
|
-
async function clean(path$1) {
|
|
76
|
-
return fs.remove(path$1);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/fs/exists.ts
|
|
81
|
-
const reader$1 = switcher({
|
|
82
|
-
node: async (path$1) => {
|
|
83
|
-
return fs.pathExists(path$1);
|
|
84
|
-
},
|
|
85
|
-
bun: async (path$1) => {
|
|
86
|
-
return Bun.file(path$1).exists();
|
|
87
|
-
}
|
|
88
|
-
}, "node");
|
|
89
|
-
const syncReader$1 = switcher({
|
|
90
|
-
node: (path$1) => {
|
|
91
|
-
return fs.pathExistsSync(path$1);
|
|
92
|
-
},
|
|
93
|
-
bun: () => {
|
|
94
|
-
throw new Error("Bun cannot read sync");
|
|
95
|
-
}
|
|
96
|
-
}, "node");
|
|
97
|
-
async function exists(path$1) {
|
|
98
|
-
return reader$1(path$1);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/fs/read.ts
|
|
103
|
-
const reader = switcher({
|
|
104
|
-
node: async (path$1) => {
|
|
105
|
-
return fs.readFile(path$1, { encoding: "utf8" });
|
|
106
|
-
},
|
|
107
|
-
bun: async (path$1) => {
|
|
108
|
-
return Bun.file(path$1).text();
|
|
109
|
-
}
|
|
110
|
-
}, "node");
|
|
111
|
-
const syncReader = switcher({
|
|
112
|
-
node: (path$1) => {
|
|
113
|
-
return fs.readFileSync(path$1, { encoding: "utf8" });
|
|
114
|
-
},
|
|
115
|
-
bun: () => {
|
|
116
|
-
throw new Error("Bun cannot read sync");
|
|
117
|
-
}
|
|
118
|
-
}, "node");
|
|
119
|
-
async function read(path$1) {
|
|
120
|
-
return reader(path$1);
|
|
121
|
-
}
|
|
122
|
-
function readSync(path$1) {
|
|
123
|
-
return syncReader(path$1);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
70
|
//#endregion
|
|
127
71
|
//#region package.json
|
|
128
|
-
var version$1 = "4.
|
|
72
|
+
var version$1 = "4.12.1";
|
|
129
73
|
|
|
130
74
|
//#endregion
|
|
131
75
|
//#region src/utils/diagnostics.ts
|
|
@@ -145,12 +89,11 @@ function getDiagnosticInfo() {
|
|
|
145
89
|
//#endregion
|
|
146
90
|
//#region src/build.ts
|
|
147
91
|
async function setup(options) {
|
|
148
|
-
const { config: userConfig,
|
|
92
|
+
const { config: userConfig, events = new AsyncEventEmitter() } = options;
|
|
149
93
|
const diagnosticInfo = getDiagnosticInfo();
|
|
150
|
-
if (Array.isArray(userConfig.input))
|
|
151
|
-
|
|
94
|
+
if (Array.isArray(userConfig.input)) await events.emit("warn", "This feature is still under development — use with caution");
|
|
95
|
+
await events.emit("debug", {
|
|
152
96
|
date: /* @__PURE__ */ new Date(),
|
|
153
|
-
category: "setup",
|
|
154
97
|
logs: [
|
|
155
98
|
"Configuration:",
|
|
156
99
|
` • Name: ${userConfig.name || "unnamed"}`,
|
|
@@ -168,9 +111,8 @@ async function setup(options) {
|
|
|
168
111
|
try {
|
|
169
112
|
if (isInputPath(userConfig) && !new URLPath(userConfig.input.path).isURL) {
|
|
170
113
|
await exists(userConfig.input.path);
|
|
171
|
-
|
|
114
|
+
await events.emit("debug", {
|
|
172
115
|
date: /* @__PURE__ */ new Date(),
|
|
173
|
-
category: "setup",
|
|
174
116
|
logs: [`✓ Input file validated: ${userConfig.input.path}`]
|
|
175
117
|
});
|
|
176
118
|
}
|
|
@@ -193,9 +135,8 @@ async function setup(options) {
|
|
|
193
135
|
plugins: userConfig.plugins
|
|
194
136
|
};
|
|
195
137
|
if (definedConfig.output.clean) {
|
|
196
|
-
|
|
138
|
+
await events.emit("debug", {
|
|
197
139
|
date: /* @__PURE__ */ new Date(),
|
|
198
|
-
category: "setup",
|
|
199
140
|
logs: [
|
|
200
141
|
"Cleaning output directories",
|
|
201
142
|
` • Output: ${definedConfig.output.path}`,
|
|
@@ -208,123 +149,45 @@ async function setup(options) {
|
|
|
208
149
|
const fabric = createFabric();
|
|
209
150
|
fabric.use(fsPlugin, { dryRun: !definedConfig.output.write });
|
|
210
151
|
fabric.use(typescriptParser);
|
|
211
|
-
fabric.context.on("
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
size: files.length,
|
|
215
|
-
message: "Writing files ..."
|
|
216
|
-
});
|
|
217
|
-
logger.emit("debug", {
|
|
152
|
+
fabric.context.on("files:processing:start", (files) => {
|
|
153
|
+
events.emit("files:processing:start", files);
|
|
154
|
+
events.emit("debug", {
|
|
218
155
|
date: /* @__PURE__ */ new Date(),
|
|
219
|
-
category: "file",
|
|
220
156
|
logs: [`Writing ${files.length} files...`]
|
|
221
157
|
});
|
|
222
158
|
});
|
|
223
|
-
fabric.context.on("
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
159
|
+
fabric.context.on("file:processing:update", async (params) => {
|
|
160
|
+
const { file, source } = params;
|
|
161
|
+
await events.emit("file:processing:update", {
|
|
162
|
+
...params,
|
|
163
|
+
config: definedConfig,
|
|
164
|
+
source
|
|
228
165
|
});
|
|
229
166
|
if (source) await write(file.path, source, { sanity: false });
|
|
230
167
|
});
|
|
231
|
-
fabric.context.on("
|
|
232
|
-
|
|
233
|
-
|
|
168
|
+
fabric.context.on("files:processing:end", async (files) => {
|
|
169
|
+
await events.emit("files:processing:end", files);
|
|
170
|
+
await events.emit("debug", {
|
|
234
171
|
date: /* @__PURE__ */ new Date(),
|
|
235
|
-
category: "file",
|
|
236
172
|
logs: ["✓ File write process completed"]
|
|
237
173
|
});
|
|
238
174
|
});
|
|
239
|
-
|
|
175
|
+
await events.emit("debug", {
|
|
240
176
|
date: /* @__PURE__ */ new Date(),
|
|
241
|
-
category: "setup",
|
|
242
177
|
logs: [
|
|
243
178
|
"✓ Fabric initialized",
|
|
244
179
|
` • File writing: ${definedConfig.output.write ? "enabled" : "disabled (dry-run)"}`,
|
|
245
180
|
` • Barrel type: ${definedConfig.output.barrelType || "none"}`
|
|
246
181
|
]
|
|
247
182
|
});
|
|
248
|
-
const pluginManager = new PluginManager(definedConfig, {
|
|
249
|
-
fabric,
|
|
250
|
-
logger,
|
|
251
|
-
concurrency: 5
|
|
252
|
-
});
|
|
253
|
-
pluginManager.on("executing", ({ plugin, hookName, strategy, parameters }) => {
|
|
254
|
-
logger.emit("debug", {
|
|
255
|
-
date: /* @__PURE__ */ new Date(),
|
|
256
|
-
category: "hook",
|
|
257
|
-
pluginName: plugin.name,
|
|
258
|
-
logs: [
|
|
259
|
-
`Executing hook: ${hookName}`,
|
|
260
|
-
` • Strategy: ${strategy}`,
|
|
261
|
-
" • Parameters:",
|
|
262
|
-
JSON.stringify(parameters, null, 2)
|
|
263
|
-
]
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
pluginManager.on("executed", ({ plugin, hookName, duration, parameters }) => {
|
|
267
|
-
let message = "";
|
|
268
|
-
if (hookName === "resolvePath") {
|
|
269
|
-
const [path$1] = parameters || [];
|
|
270
|
-
message = `Resolving path '${path$1}'`;
|
|
271
|
-
}
|
|
272
|
-
if (hookName === "resolveName") {
|
|
273
|
-
const [name, type] = parameters || [];
|
|
274
|
-
message = `Resolving name '${name}' and type '${type}'`;
|
|
275
|
-
}
|
|
276
|
-
logger.emit("progressed", {
|
|
277
|
-
id: hookName,
|
|
278
|
-
message: `${plugin.name}: ${message}`
|
|
279
|
-
});
|
|
280
|
-
logger.emit("debug", {
|
|
281
|
-
date: /* @__PURE__ */ new Date(),
|
|
282
|
-
category: "hook",
|
|
283
|
-
pluginName: plugin.name,
|
|
284
|
-
logs: [`✓ Completed in ${duration}ms`]
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
pluginManager.on("progress_start", ({ hookName, plugins }) => {
|
|
288
|
-
logger.emit("progress_start", {
|
|
289
|
-
id: hookName,
|
|
290
|
-
size: plugins.length,
|
|
291
|
-
message: "Running plugins..."
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
pluginManager.on("progress_stop", ({ hookName }) => {
|
|
295
|
-
logger.emit("progress_stop", { id: hookName });
|
|
296
|
-
});
|
|
297
|
-
pluginManager.on("error", (error, { plugin, strategy, duration, parameters, hookName }) => {
|
|
298
|
-
const text = `${error.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})`;
|
|
299
|
-
logger.emit("error", text, error);
|
|
300
|
-
logger.emit("debug", {
|
|
301
|
-
date: /* @__PURE__ */ new Date(),
|
|
302
|
-
category: "error",
|
|
303
|
-
pluginName: plugin.name,
|
|
304
|
-
logs: [
|
|
305
|
-
`✗ Hook '${hookName}' failed after ${duration}ms`,
|
|
306
|
-
` • Strategy: ${strategy}`,
|
|
307
|
-
` • Error: ${error.constructor.name} - ${error.message}`,
|
|
308
|
-
" • Stack Trace:",
|
|
309
|
-
error.stack || "No stack trace available",
|
|
310
|
-
" • Parameters:",
|
|
311
|
-
JSON.stringify(parameters, null, 2)
|
|
312
|
-
]
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
logger.emit("debug", {
|
|
316
|
-
date: /* @__PURE__ */ new Date(),
|
|
317
|
-
category: "setup",
|
|
318
|
-
logs: [
|
|
319
|
-
"✓ PluginManager initialized",
|
|
320
|
-
" • Concurrency: 5",
|
|
321
|
-
` • Total plugins: ${pluginManager.plugins.length}`
|
|
322
|
-
]
|
|
323
|
-
});
|
|
324
183
|
return {
|
|
325
|
-
|
|
184
|
+
events,
|
|
326
185
|
fabric,
|
|
327
|
-
pluginManager
|
|
186
|
+
pluginManager: new PluginManager(definedConfig, {
|
|
187
|
+
fabric,
|
|
188
|
+
events,
|
|
189
|
+
concurrency: 5
|
|
190
|
+
})
|
|
328
191
|
};
|
|
329
192
|
}
|
|
330
193
|
async function build(options, overrides) {
|
|
@@ -340,7 +203,7 @@ async function build(options, overrides) {
|
|
|
340
203
|
};
|
|
341
204
|
}
|
|
342
205
|
async function safeBuild(options, overrides) {
|
|
343
|
-
const { fabric, pluginManager,
|
|
206
|
+
const { fabric, pluginManager, events } = overrides ? overrides : await setup(options);
|
|
344
207
|
const failedPlugins = /* @__PURE__ */ new Set();
|
|
345
208
|
const pluginTimings = /* @__PURE__ */ new Map();
|
|
346
209
|
const config = pluginManager.config;
|
|
@@ -351,40 +214,24 @@ async function safeBuild(options, overrides) {
|
|
|
351
214
|
try {
|
|
352
215
|
const startTime = performance.now();
|
|
353
216
|
const timestamp = /* @__PURE__ */ new Date();
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
pluginGroupMarker: "start",
|
|
357
|
-
pluginName: plugin.name,
|
|
358
|
-
logs: []
|
|
359
|
-
});
|
|
360
|
-
logger.emit("debug", {
|
|
217
|
+
await events.emit("plugin:start", plugin);
|
|
218
|
+
await events.emit("debug", {
|
|
361
219
|
date: timestamp,
|
|
362
|
-
category: "plugin",
|
|
363
|
-
pluginName: plugin.name,
|
|
364
220
|
logs: ["Installing plugin...", ` • Plugin Key: ${JSON.stringify(plugin.key)}`]
|
|
365
221
|
});
|
|
366
222
|
await installer(context);
|
|
367
223
|
const duration = Math.round(performance.now() - startTime);
|
|
368
224
|
pluginTimings.set(plugin.name, duration);
|
|
369
|
-
|
|
225
|
+
await events.emit("plugin:end", plugin, duration);
|
|
226
|
+
await events.emit("debug", {
|
|
370
227
|
date: /* @__PURE__ */ new Date(),
|
|
371
|
-
category: "plugin",
|
|
372
|
-
pluginName: plugin.name,
|
|
373
228
|
logs: [`✓ Plugin installed successfully (${duration}ms)`]
|
|
374
229
|
});
|
|
375
|
-
logger.emit("debug", {
|
|
376
|
-
date: /* @__PURE__ */ new Date(),
|
|
377
|
-
pluginGroupMarker: "end",
|
|
378
|
-
pluginName: plugin.name,
|
|
379
|
-
logs: []
|
|
380
|
-
});
|
|
381
230
|
} catch (e) {
|
|
382
231
|
const error = e;
|
|
383
232
|
const errorTimestamp = /* @__PURE__ */ new Date();
|
|
384
|
-
|
|
233
|
+
await events.emit("debug", {
|
|
385
234
|
date: errorTimestamp,
|
|
386
|
-
category: "error",
|
|
387
|
-
pluginName: plugin.name,
|
|
388
235
|
logs: [
|
|
389
236
|
"✗ Plugin installation failed",
|
|
390
237
|
` • Plugin Key: ${JSON.stringify(plugin.key)}`,
|
|
@@ -393,12 +240,6 @@ async function safeBuild(options, overrides) {
|
|
|
393
240
|
error.stack || "No stack trace available"
|
|
394
241
|
]
|
|
395
242
|
});
|
|
396
|
-
logger.emit("debug", {
|
|
397
|
-
date: errorTimestamp,
|
|
398
|
-
pluginGroupMarker: "end",
|
|
399
|
-
pluginName: plugin.name,
|
|
400
|
-
logs: []
|
|
401
|
-
});
|
|
402
243
|
failedPlugins.add({
|
|
403
244
|
plugin,
|
|
404
245
|
error
|
|
@@ -407,7 +248,7 @@ async function safeBuild(options, overrides) {
|
|
|
407
248
|
}
|
|
408
249
|
if (config.output.barrelType) {
|
|
409
250
|
const rootPath = resolve(resolve(config.root), config.output.path, "index.ts");
|
|
410
|
-
|
|
251
|
+
await events.emit("debug", {
|
|
411
252
|
date: /* @__PURE__ */ new Date(),
|
|
412
253
|
logs: [
|
|
413
254
|
"Generating barrel file",
|
|
@@ -418,7 +259,7 @@ async function safeBuild(options, overrides) {
|
|
|
418
259
|
const barrelFiles = fabric.files.filter((file) => {
|
|
419
260
|
return file.sources.some((source) => source.isIndexable);
|
|
420
261
|
});
|
|
421
|
-
|
|
262
|
+
await events.emit("debug", {
|
|
422
263
|
date: /* @__PURE__ */ new Date(),
|
|
423
264
|
logs: [`Found ${barrelFiles.length} indexable files for barrel export`]
|
|
424
265
|
});
|
|
@@ -445,9 +286,8 @@ async function safeBuild(options, overrides) {
|
|
|
445
286
|
meta: {}
|
|
446
287
|
};
|
|
447
288
|
await fabric.upsertFile(rootFile);
|
|
448
|
-
|
|
289
|
+
await events.emit("debug", {
|
|
449
290
|
date: /* @__PURE__ */ new Date(),
|
|
450
|
-
category: "file",
|
|
451
291
|
logs: [`✓ Generated barrel file (${rootFile.exports?.length || 0} exports)`]
|
|
452
292
|
});
|
|
453
293
|
}
|
|
@@ -472,6 +312,12 @@ async function safeBuild(options, overrides) {
|
|
|
472
312
|
}
|
|
473
313
|
}
|
|
474
314
|
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/defineLogger.ts
|
|
317
|
+
function defineLogger(logger) {
|
|
318
|
+
return { ...logger };
|
|
319
|
+
}
|
|
320
|
+
|
|
475
321
|
//#endregion
|
|
476
322
|
//#region src/definePlugin.ts
|
|
477
323
|
/**
|
|
@@ -558,7 +404,7 @@ function checkType(type) {
|
|
|
558
404
|
}
|
|
559
405
|
const matchType = (type, stat) => stat[typeMappings[type]]();
|
|
560
406
|
const toPath$1 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
561
|
-
async function locatePath(paths, { cwd =
|
|
407
|
+
async function locatePath(paths, { cwd = process$1.cwd(), type = "file", allowSymlinks = true, concurrency, preserveOrder } = {}) {
|
|
562
408
|
checkType(type);
|
|
563
409
|
cwd = toPath$1(cwd);
|
|
564
410
|
const statFunction = allowSymlinks ? promises.stat : promises.lstat;
|
|
@@ -573,10 +419,10 @@ async function locatePath(paths, { cwd = g$1.cwd(), type = "file", allowSymlinks
|
|
|
573
419
|
preserveOrder
|
|
574
420
|
});
|
|
575
421
|
}
|
|
576
|
-
function locatePathSync(paths, { cwd =
|
|
422
|
+
function locatePathSync(paths, { cwd = process$1.cwd(), type = "file", allowSymlinks = true } = {}) {
|
|
577
423
|
checkType(type);
|
|
578
424
|
cwd = toPath$1(cwd);
|
|
579
|
-
const statFunction = allowSymlinks ? fs
|
|
425
|
+
const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;
|
|
580
426
|
for (const path_ of paths) try {
|
|
581
427
|
const stat = statFunction(path.resolve(cwd, path_), { throwIfNoEntry: false });
|
|
582
428
|
if (!stat) continue;
|
|
@@ -747,5 +593,16 @@ var PackageManager = class PackageManager {
|
|
|
747
593
|
};
|
|
748
594
|
|
|
749
595
|
//#endregion
|
|
750
|
-
|
|
596
|
+
//#region src/types.ts
|
|
597
|
+
const LogLevel = {
|
|
598
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
599
|
+
error: 0,
|
|
600
|
+
warn: 1,
|
|
601
|
+
info: 3,
|
|
602
|
+
verbose: 4,
|
|
603
|
+
debug: 5
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
//#endregion
|
|
607
|
+
export { BaseGenerator, LogLevel, PackageManager, PluginManager, PromiseManager, build, build as default, defineConfig, defineLogger, definePlugin, getBarrelFiles, getMode, isInputPath, safeBuild, setup };
|
|
751
608
|
//# sourceMappingURL=index.js.map
|