unplugin-dingtalk 1004.0.0 → 1005.0.0
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/__chrome_devtools.js +1 -1
- package/dist/astro.js +2 -2
- package/dist/{chunk-DZEMXGMI.js → chunk-2YQKM4BX.js} +2 -2
- package/dist/{chunk-7VYUT3GL.js → chunk-D63IDACA.js} +1 -1
- package/dist/{chunk-5U7LETMH.js → chunk-ZLK5HLCO.js} +62 -30
- package/dist/esbuild.js +2 -2
- package/dist/index.js +2 -2
- package/dist/nuxt.js +3 -3
- package/dist/rollup.js +2 -2
- package/dist/rspack.js +2 -2
- package/dist/vite.js +3 -3
- package/dist/webpack.js +2 -2
- package/package.json +1 -1
package/dist/astro.js
CHANGED
|
@@ -76,9 +76,9 @@ function getChromeDevtoolsHtml(targetPort) {
|
|
|
76
76
|
list.innerHTML = "<li>\u83B7\u53D6\u8C03\u8BD5\u76EE\u6807\u5931\u8D25</li>";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
document.getElementById("refresh").onclick =
|
|
79
|
+
document.getElementById("refresh").onclick = () => window.location.reload();
|
|
80
80
|
window.onload = fetchTargets;
|
|
81
|
-
document.addEventListener('visibilitychange',
|
|
81
|
+
document.addEventListener('visibilitychange', window.location.reload);
|
|
82
82
|
</script>
|
|
83
83
|
</body>
|
|
84
84
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getChromeDevtoolsHtml
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2YQKM4BX.js";
|
|
4
4
|
import {
|
|
5
5
|
__spreadValues
|
|
6
6
|
} from "./chunk-5JBD5THX.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
|
-
import process2 from "
|
|
10
|
-
import { ServerResponse } from "
|
|
11
|
-
import { Socket } from "
|
|
9
|
+
import process2 from "process";
|
|
10
|
+
import { ServerResponse } from "http";
|
|
11
|
+
import { Socket } from "net";
|
|
12
12
|
import { createUnplugin } from "unplugin";
|
|
13
13
|
import c from "picocolors";
|
|
14
14
|
import cookie from "cookie";
|
|
15
15
|
import { start } from "z-chii";
|
|
16
16
|
|
|
17
17
|
// node_modules/.pnpm/get-port-please@3.1.2/node_modules/get-port-please/dist/index.mjs
|
|
18
|
-
import { createServer } from "
|
|
19
|
-
import { networkInterfaces } from "
|
|
18
|
+
import { createServer } from "net";
|
|
19
|
+
import { networkInterfaces } from "os";
|
|
20
20
|
var unsafePorts = /* @__PURE__ */ new Set([
|
|
21
21
|
1,
|
|
22
22
|
// tcpmux
|
|
@@ -289,44 +289,71 @@ var unpluginFactory = (options) => {
|
|
|
289
289
|
const unpluginDing = {
|
|
290
290
|
name: "unplugin-dingtalk",
|
|
291
291
|
enforce: "pre",
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
resolveId(source) {
|
|
293
|
+
if (source === "virtual:chii-client") {
|
|
294
|
+
return source;
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
load(id) {
|
|
298
|
+
var _a, _b;
|
|
299
|
+
if (id === "virtual:chii-client") {
|
|
300
|
+
return `
|
|
301
|
+
;(function(){
|
|
302
|
+
if (document.getElementById('__chii_client')) return;
|
|
303
|
+
const script = document.createElement('script');
|
|
304
|
+
script.id = '__chii_client';
|
|
305
|
+
script.src="/__chii_proxy/target.js";
|
|
306
|
+
${((_a = options == null ? void 0 : options.chii) == null ? void 0 : _a.embedded) ? "script.setAttribute('embedded','true');" : ""}
|
|
307
|
+
document.body.appendChild(script);
|
|
308
|
+
})();
|
|
309
|
+
if (import.meta.hot) {
|
|
310
|
+
import.meta.hot.accept(() => {
|
|
311
|
+
const old = document.getElementById('__chii_client');
|
|
312
|
+
if (old) old.remove();
|
|
313
|
+
const script = document.createElement('script');
|
|
314
|
+
script.id = '__chii_client';
|
|
315
|
+
script.src="/__chii_proxy/target.js";
|
|
316
|
+
${((_b = options == null ? void 0 : options.chii) == null ? void 0 : _b.embedded) ? "script.setAttribute('embedded','true');" : ""}
|
|
317
|
+
document.body.appendChild(script);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
294
322
|
},
|
|
295
|
-
async transform(
|
|
323
|
+
async transform(source, id) {
|
|
296
324
|
if ((options == null ? void 0 : options.enable) && enableChii && !resovedInfo.availablePort) {
|
|
297
325
|
resovedInfo.availablePort = await getRandomPort();
|
|
298
|
-
start({
|
|
299
|
-
port: resovedInfo.availablePort
|
|
300
|
-
});
|
|
326
|
+
start({ port: resovedInfo.availablePort });
|
|
301
327
|
debug(`chii server port: ${resovedInfo.availablePort}`);
|
|
302
328
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
329
|
+
if ((options == null ? void 0 : options.enable) && enableChii) {
|
|
330
|
+
const file = id.split("?")[0];
|
|
331
|
+
if (file.startsWith(config.root) && !file.includes("node_modules") && file.match(/\.[t|j]s$/)) {
|
|
332
|
+
return {
|
|
333
|
+
code: `import 'virtual:chii-client';
|
|
334
|
+
${source}`,
|
|
335
|
+
map: null
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return { code: source, map: null };
|
|
308
340
|
},
|
|
309
341
|
vite: {
|
|
310
342
|
configResolved(_config) {
|
|
311
343
|
config = _config;
|
|
312
344
|
},
|
|
313
345
|
transformIndexHtml(html) {
|
|
314
|
-
var _a;
|
|
315
346
|
if ((options == null ? void 0 : options.enable) && enableChii) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const script = document.createElement('script');
|
|
322
|
-
script.src="/__chii_proxy/target.js";
|
|
323
|
-
${((_a = options == null ? void 0 : options.chii) == null ? void 0 : _a.embedded) ? 'script.setAttribute("embedded", "true");' : ""}
|
|
324
|
-
document.body.appendChild(script);
|
|
325
|
-
})()
|
|
326
|
-
</script>
|
|
347
|
+
const tag = `<script type="module">import 'virtual:chii-client';</script>`;
|
|
348
|
+
if (!html.includes(tag)) {
|
|
349
|
+
return html.replace(
|
|
350
|
+
"</body>",
|
|
351
|
+
`</body>${tag}
|
|
327
352
|
`
|
|
328
|
-
|
|
353
|
+
);
|
|
354
|
+
}
|
|
329
355
|
}
|
|
356
|
+
return html;
|
|
330
357
|
},
|
|
331
358
|
async configureServer(server) {
|
|
332
359
|
var _a, _b;
|
|
@@ -419,6 +446,11 @@ var unpluginFactory = (options) => {
|
|
|
419
446
|
};
|
|
420
447
|
var createProxyMiddleware = createProxyMiddleware2;
|
|
421
448
|
server.middlewares.use("/__chrome_devtools", async (_req, res) => {
|
|
449
|
+
if (!resovedInfo.availablePort) {
|
|
450
|
+
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
451
|
+
res.end("Server not started");
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
422
454
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
423
455
|
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
424
456
|
res.end();
|
package/dist/esbuild.js
CHANGED
package/dist/index.js
CHANGED
package/dist/nuxt.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D63IDACA.js";
|
|
4
4
|
import "./chunk-KQOHODTC.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ZLK5HLCO.js";
|
|
6
|
+
import "./chunk-2YQKM4BX.js";
|
|
7
7
|
import "./chunk-5JBD5THX.js";
|
|
8
8
|
|
|
9
9
|
// src/nuxt.ts
|
package/dist/rollup.js
CHANGED
package/dist/rspack.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resovedInfo,
|
|
3
3
|
unpluginFactory
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZLK5HLCO.js";
|
|
5
5
|
import {
|
|
6
6
|
getChromeDevtoolsHtml
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2YQKM4BX.js";
|
|
8
8
|
import "./chunk-5JBD5THX.js";
|
|
9
9
|
|
|
10
10
|
// src/rspack.ts
|
package/dist/vite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D63IDACA.js";
|
|
4
4
|
import "./chunk-KQOHODTC.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ZLK5HLCO.js";
|
|
6
|
+
import "./chunk-2YQKM4BX.js";
|
|
7
7
|
import "./chunk-5JBD5THX.js";
|
|
8
8
|
export {
|
|
9
9
|
vite_default as default
|
package/dist/webpack.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resovedInfo,
|
|
3
3
|
unpluginFactory
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZLK5HLCO.js";
|
|
5
5
|
import {
|
|
6
6
|
getChromeDevtoolsHtml
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2YQKM4BX.js";
|
|
8
8
|
import "./chunk-5JBD5THX.js";
|
|
9
9
|
|
|
10
10
|
// src/webpack.ts
|