Skip to content

Commit 2cee52d

Browse files
author
Taois
committed
feat: 增加bun运行测试命令
1 parent bc8f7c8 commit 2cee52d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

drpy-node-bundle/libs/localDsCore.bundled.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396290,11 +396290,14 @@ var FetchAxios = class {
396290396290
}
396291396291
}
396292396292
}
396293-
let fetchDispatcher = undefined;
396293+
let fetchDispatcher = new import_undici.Agent({ connect: { rejectUnauthorized: false } });
396294396294
try {
396295396295
const proxy = await getSystemProxy();
396296396296
if (proxy) {
396297-
fetchDispatcher = new import_undici.ProxyAgent(proxy);
396297+
fetchDispatcher = new import_undici.ProxyAgent({
396298+
uri: proxy,
396299+
connect: { rejectUnauthorized: false }
396300+
});
396298396301
} else {
396299396302
let fullUrl = finalConfig.url;
396300396303
if (finalConfig.baseURL && !/^https?:\/\//i.test(fullUrl)) {
@@ -414740,7 +414743,9 @@ const init = async function(filePath, env = {}, refresh) {
414740414743
} else {
414741414744
rule = module.default || module;
414742414745
}
414743-
await rule.init(default_init_cfg);
414746+
if (typeof rule.init === "function") {
414747+
await rule.init(default_init_cfg);
414748+
}
414744414749
let t2 = getNowTime$1();
414745414750
const moduleObject = deepCopy$1(rule);
414746414751
moduleObject.cost = t2 - t1;

drpy-node-bundle/localDsCoreTest.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// import * as localtDsCore from './localDsCore.js';
2+
const start = performance.now();
23
import * as localtDsCore from './libs/localDsCore.bundled.js';
34

45
console.log(getEngine)
@@ -11,4 +12,7 @@ console.log(getEngine)
1112
// const d = await getEngine('设置中心', {do: 'ds'})
1213
// console.log(d)
1314
const e = await getEngine('B站 ᵈᶻ', {do: 'php'})
14-
console.log(e)
15+
console.log(e)
16+
const end = performance.now();
17+
18+
console.log(`耗时: ${end - start} ms`);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"ungzip-1": "node controllers/decoder.js json/十六万歌曲.json.gz",
2626
"moontv": "node scripts/mjs/moontv.mjs 采集2025.json -p",
2727
"bundle": "cd drpy-node-bundle && npx rolldown -c",
28-
"test:bundle": "cd drpy-node-bundle && node localDsCoreTest.js"
28+
"test:bundle": "cd drpy-node-bundle && node localDsCoreTest.js",
29+
"test-bun:bundle": "cd drpy-node-bundle && bun localDsCoreTest.js"
2930
},
3031
"engines": {
3132
"node": ">17 <23"

0 commit comments

Comments
 (0)