unplugin-dingtalk 1002.0.0 → 1003.1.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/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/unplugin-dingtalk?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-dingtalk)
4
4
 
5
- 一键启动钉钉内调试。支持 `vite`、`vue-cli`、`rebuild`。
5
+ 一键启动钉钉内调试。支持 `vite`、`vue-cli`、`rsbuild`。
6
6
 
7
7
  ## 功能
8
8
  - [x] 在钉钉内打开调试链接
9
9
  - [x] 可选注入 [vConsole](https://github.com/Tencent/vConsole) 用于调试 (仅支持 vite )
10
10
  - [x] 可选注入 [chii](https://github.com/liriliri/chii) 用于调试
11
- - [x] ~~可选打开 [vue-devtools](https://github.com/vuejs/devtools) 用于调试~~ 已移除
11
+ - [x] ~~可选打开 [vue-devtools](https://github.com/vuejs/devtools) 用于调试~~ 已移除,如有需要请使用 [vue-devtools](https://devtools.vuejs.org/guide/standalone)
12
12
  - [x] 支持调试 `HttpOnly` cookies
13
13
 
14
14
  ![images](https://github.com/zcf0508/unplugin-dingtalk/raw/main/images/Snipaste_2024-05-22_11-25-35.png)
@@ -33,8 +33,15 @@ interface Options {
33
33
  vconsole?: viteVConsoleOptions
34
34
  /** 需要调试的 cookies, 避免无法调试 HttpOnly 的 cookie */
35
35
  debugCookies?: string[]
36
- /** 默认值 `true` */
37
- chii?: boolean
36
+ chii?: {
37
+ /** 默认值 `true` */
38
+ enable?: boolean
39
+ /**
40
+ * 默认值 `false`
41
+ * @link https://chii.liriliri.io/docs/#usage
42
+ */
43
+ embedded?: boolean
44
+ }
38
45
  }
39
46
  ```
40
47
 
package/dist/astro.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-6LTE4RPT.js";
4
- import "./chunk-ZEHXGFFH.js";
3
+ } from "./chunk-IH5FP4BK.js";
4
+ import "./chunk-A2RZ6ACY.js";
5
+ import "./chunk-MCTMMV5B.js";
5
6
 
6
7
  // src/astro.ts
7
8
  var astro_default = (options) => ({
@@ -1,103 +1,15 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
12
- var __typeError = (msg) => {
13
- throw TypeError(msg);
14
- };
15
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
- var __spreadValues = (a, b) => {
17
- for (var prop in b || (b = {}))
18
- if (__hasOwnProp.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- if (__getOwnPropSymbols)
21
- for (var prop of __getOwnPropSymbols(b)) {
22
- if (__propIsEnum.call(b, prop))
23
- __defNormalProp(a, prop, b[prop]);
24
- }
25
- return a;
26
- };
27
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
- var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
29
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
30
- }) : x2)(function(x2) {
31
- if (typeof require !== "undefined") return require.apply(this, arguments);
32
- throw Error('Dynamic require of "' + x2 + '" is not supported');
33
- });
34
- var __commonJS = (cb, mod) => function __require2() {
35
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
36
- };
37
- var __copyProps = (to, from, except, desc) => {
38
- if (from && typeof from === "object" || typeof from === "function") {
39
- for (let key of __getOwnPropNames(from))
40
- if (!__hasOwnProp.call(to, key) && key !== except)
41
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
42
- }
43
- return to;
44
- };
45
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
46
- // If the importer is in node compatibility mode or this is not an ESM
47
- // file that has been converted to a CommonJS file using a Babel-
48
- // compatible transform (i.e. "__esModule" has not been set), then set
49
- // "default" to the CommonJS "module.exports" for node compatibility.
50
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
51
- mod
52
- ));
53
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
54
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
55
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
56
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
57
- var __await = function(promise, isYieldStar) {
58
- this[0] = promise;
59
- this[1] = isYieldStar;
60
- };
61
- var __asyncGenerator = (__this, __arguments, generator) => {
62
- var resume = (k, v, yes, no) => {
63
- try {
64
- var x2 = generator[k](v), isAwait = (v = x2.value) instanceof __await, done = x2.done;
65
- Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e2) => resume("throw", e2, yes, no));
66
- } catch (e2) {
67
- no(e2);
68
- }
69
- }, method = (k) => it[k] = (x2) => new Promise((yes, no) => resume(k, x2, yes, no)), it = {};
70
- return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
71
- };
72
- var __yieldStar = (value) => {
73
- var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
74
- if (obj == null) {
75
- obj = value[__knownSymbol("iterator")]();
76
- method = (k) => it[k] = (x2) => obj[k](x2);
77
- } else {
78
- obj = obj.call(value);
79
- method = (k) => it[k] = (v) => {
80
- if (isAwait) {
81
- isAwait = false;
82
- if (k === "throw") throw v;
83
- return v;
84
- }
85
- isAwait = true;
86
- return {
87
- done: false,
88
- value: new __await(new Promise((resolve) => {
89
- var x2 = obj[k](v);
90
- if (!(x2 instanceof Object)) __typeError("Object expected");
91
- resolve(x2);
92
- }), 1)
93
- };
94
- };
95
- }
96
- return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x2) => {
97
- throw x2;
98
- }, "return" in obj && method("return"), it;
99
- };
100
- var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
1
+ import {
2
+ __asyncGenerator,
3
+ __await,
4
+ __commonJS,
5
+ __forAwait,
6
+ __privateAdd,
7
+ __privateGet,
8
+ __privateSet,
9
+ __require,
10
+ __toESM,
11
+ __yieldStar
12
+ } from "./chunk-MCTMMV5B.js";
101
13
 
102
14
  // node_modules/.pnpm/web-streams-polyfill@3.3.3/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js
103
15
  var require_ponyfill_es2018 = __commonJS({
@@ -4804,9 +4716,6 @@ var import_node_domexception = __toESM(require_node_domexception(), 1);
4804
4716
  var { stat } = fs;
4805
4717
 
4806
4718
  export {
4807
- __spreadValues,
4808
- __spreadProps,
4809
- __forAwait,
4810
4719
  fetch_blob_default,
4811
4720
  file_default,
4812
4721
  FormData,
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  FormData,
3
- __forAwait,
4
- __spreadProps,
5
- __spreadValues,
6
3
  fetch_blob_default,
7
4
  formDataToBlob
8
- } from "./chunk-ZEHXGFFH.js";
5
+ } from "./chunk-A2RZ6ACY.js";
6
+ import {
7
+ __forAwait,
8
+ __spreadProps,
9
+ __spreadValues
10
+ } from "./chunk-MCTMMV5B.js";
9
11
 
10
12
  // src/index.ts
11
13
  import process2 from "node:process";
@@ -187,7 +189,7 @@ var Body = class {
187
189
  }
188
190
  return formData;
189
191
  }
190
- const { toFormData } = await import("./multipart-parser-VO5TIRQZ.js");
192
+ const { toFormData } = await import("./multipart-parser-WSPU7YI5.js");
191
193
  return toFormData(this.body, ct);
192
194
  }
193
195
  /**
@@ -1305,7 +1307,6 @@ import { createUnplugin } from "unplugin";
1305
1307
  import c from "picocolors";
1306
1308
  import cookie from "cookie";
1307
1309
  import { start } from "z-chii";
1308
- import dns2 from "dns2";
1309
1310
 
1310
1311
  // node_modules/.pnpm/get-port-please@3.1.2/node_modules/get-port-please/dist/index.mjs
1311
1312
  import { createServer } from "node:net";
@@ -1566,66 +1567,9 @@ var cwd = process2.cwd();
1566
1567
  var config;
1567
1568
  var colorUrl = (url) => c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
1568
1569
  var resovedInfo = {
1569
- dnsServerInstence: void 0,
1570
1570
  availablePort: void 0,
1571
1571
  targetURL: void 0
1572
1572
  };
1573
- function startDnsServer(options) {
1574
- function debug(...args) {
1575
- if (options == null ? void 0 : options.debug) {
1576
- console.log(` ${c.yellow("DEBUG")} `, ...args);
1577
- }
1578
- }
1579
- if ((options == null ? void 0 : options.enable) && (options == null ? void 0 : options.dns) && !resovedInfo.dnsServerInstence) {
1580
- const { Packet } = dns2;
1581
- resovedInfo.dnsServerInstence = dns2.createServer({
1582
- tcp: true,
1583
- udp: true,
1584
- handle: (request, send, rinfo) => {
1585
- var _a;
1586
- const response = Packet.createResponseFromRequest(request);
1587
- const [question] = request.questions;
1588
- const { name } = question;
1589
- if (name === options.dns.host) {
1590
- response.answers.push({
1591
- name,
1592
- type: Packet.TYPE.A,
1593
- class: Packet.CLASS.IN,
1594
- ttl: 300,
1595
- address: (_a = options.dns) == null ? void 0 : _a.ip
1596
- });
1597
- debug(`dns request from ${rinfo.address}:${rinfo.port} for ${name} => ${options.dns.ip}`);
1598
- }
1599
- send(response);
1600
- }
1601
- });
1602
- resovedInfo.dnsServerInstence.listen({
1603
- udp: { address: "0.0.0.0", port: 53 },
1604
- tcp: { address: "0.0.0.0", port: 53 }
1605
- }).then(() => {
1606
- debug("DNS server is running.");
1607
- const dns = new dns2({
1608
- port: 53,
1609
- nameServers: ["127.0.0.1", "8.8.8.8"]
1610
- });
1611
- dns.resolveA(options.dns.host).then((addresses) => {
1612
- var _a;
1613
- if (((_a = addresses.answers[0]) == null ? void 0 : _a.address) === options.dns.ip) {
1614
- startDnsServer(options);
1615
- console.log(` ${c.green("\u279C")} ${c.bold(`DNS server is started, please modify the DNS of the remote device to ${options.dns.ip}`)}`);
1616
- } else {
1617
- debug(addresses.answers[0].address);
1618
- throw new Error("DNS server started failed");
1619
- }
1620
- }).catch((e) => {
1621
- throw e;
1622
- });
1623
- }).catch((e) => {
1624
- debug(e);
1625
- console.log(` ${c.red("\u279C")} ${c.bold((e == null ? void 0 : e.message) || e)}`);
1626
- });
1627
- }
1628
- }
1629
1573
  var unpluginFactory = (options) => {
1630
1574
  const {
1631
1575
  chii
@@ -1661,6 +1605,7 @@ var unpluginFactory = (options) => {
1661
1605
  config = _config;
1662
1606
  },
1663
1607
  transformIndexHtml(html) {
1608
+ var _a;
1664
1609
  if ((options == null ? void 0 : options.enable) && enableChii) {
1665
1610
  return html.replace(
1666
1611
  "</body>",
@@ -1669,6 +1614,7 @@ var unpluginFactory = (options) => {
1669
1614
  (() => {
1670
1615
  const script = document.createElement('script');
1671
1616
  script.src="/__chii_proxy/target.js";
1617
+ ${((_a = options == null ? void 0 : options.chii) == null ? void 0 : _a.embedded) ? 'script.setAttribute("embedded", "true");' : ""}
1672
1618
  document.body.appendChild(script);
1673
1619
  })()
1674
1620
  </script>
@@ -1794,7 +1740,6 @@ var unpluginFactory = (options) => {
1794
1740
  });
1795
1741
  res.end();
1796
1742
  });
1797
- startDnsServer(options);
1798
1743
  }
1799
1744
  },
1800
1745
  webpack(compiler) {
@@ -1824,7 +1769,6 @@ var unpluginFactory = (options) => {
1824
1769
  if (options == null ? void 0 : options.corpId) {
1825
1770
  resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
1826
1771
  }
1827
- startDnsServer(options);
1828
1772
  },
1829
1773
  async rspack(compiler) {
1830
1774
  var _a, _b, _c, _d;
@@ -1853,7 +1797,6 @@ var unpluginFactory = (options) => {
1853
1797
  "Click to open chrome devtools"
1854
1798
  )}: ${colorUrl(`http://${source}${base}__chrome_devtools`)}`);
1855
1799
  }
1856
- startDnsServer(options);
1857
1800
  }
1858
1801
  };
1859
1802
  return unpluginDing;
@@ -1864,7 +1807,6 @@ var index_default = unplugin;
1864
1807
  export {
1865
1808
  fetch,
1866
1809
  resovedInfo,
1867
- startDnsServer,
1868
1810
  unpluginFactory,
1869
1811
  unplugin,
1870
1812
  index_default
@@ -0,0 +1,9 @@
1
+ // src/utils.ts
2
+ async function interopDefault(m) {
3
+ const resolved = await m;
4
+ return resolved.default || resolved;
5
+ }
6
+
7
+ export {
8
+ interopDefault
9
+ };
@@ -0,0 +1,115 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
12
+ var __typeError = (msg) => {
13
+ throw TypeError(msg);
14
+ };
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
+ var __spreadValues = (a, b) => {
17
+ for (var prop in b || (b = {}))
18
+ if (__hasOwnProp.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ if (__getOwnPropSymbols)
21
+ for (var prop of __getOwnPropSymbols(b)) {
22
+ if (__propIsEnum.call(b, prop))
23
+ __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
29
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
30
+ }) : x)(function(x) {
31
+ if (typeof require !== "undefined") return require.apply(this, arguments);
32
+ throw Error('Dynamic require of "' + x + '" is not supported');
33
+ });
34
+ var __commonJS = (cb, mod) => function __require2() {
35
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
36
+ };
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
42
+ }
43
+ return to;
44
+ };
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
46
+ // If the importer is in node compatibility mode or this is not an ESM
47
+ // file that has been converted to a CommonJS file using a Babel-
48
+ // compatible transform (i.e. "__esModule" has not been set), then set
49
+ // "default" to the CommonJS "module.exports" for node compatibility.
50
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
51
+ mod
52
+ ));
53
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
54
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
55
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
56
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
57
+ var __await = function(promise, isYieldStar) {
58
+ this[0] = promise;
59
+ this[1] = isYieldStar;
60
+ };
61
+ var __asyncGenerator = (__this, __arguments, generator) => {
62
+ var resume = (k, v, yes, no) => {
63
+ try {
64
+ var x = generator[k](v), isAwait = (v = x.value) instanceof __await, done = x.done;
65
+ Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume("throw", e, yes, no));
66
+ } catch (e) {
67
+ no(e);
68
+ }
69
+ }, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {};
70
+ return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
71
+ };
72
+ var __yieldStar = (value) => {
73
+ var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
74
+ if (obj == null) {
75
+ obj = value[__knownSymbol("iterator")]();
76
+ method = (k) => it[k] = (x) => obj[k](x);
77
+ } else {
78
+ obj = obj.call(value);
79
+ method = (k) => it[k] = (v) => {
80
+ if (isAwait) {
81
+ isAwait = false;
82
+ if (k === "throw") throw v;
83
+ return v;
84
+ }
85
+ isAwait = true;
86
+ return {
87
+ done: false,
88
+ value: new __await(new Promise((resolve) => {
89
+ var x = obj[k](v);
90
+ if (!(x instanceof Object)) __typeError("Object expected");
91
+ resolve(x);
92
+ }), 1)
93
+ };
94
+ };
95
+ }
96
+ return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
97
+ throw x;
98
+ }, "return" in obj && method("return"), it;
99
+ };
100
+ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
101
+
102
+ export {
103
+ __spreadValues,
104
+ __spreadProps,
105
+ __require,
106
+ __commonJS,
107
+ __toESM,
108
+ __privateGet,
109
+ __privateAdd,
110
+ __privateSet,
111
+ __await,
112
+ __asyncGenerator,
113
+ __yieldStar,
114
+ __forAwait
115
+ };
@@ -0,0 +1,26 @@
1
+ import {
2
+ unpluginFactory
3
+ } from "./chunk-IH5FP4BK.js";
4
+ import {
5
+ interopDefault
6
+ } from "./chunk-KQOHODTC.js";
7
+
8
+ // src/vite.ts
9
+ import { createVitePlugin } from "unplugin";
10
+ var vite_default = async (options) => {
11
+ var _a;
12
+ const plugins = [createVitePlugin(unpluginFactory)(options)];
13
+ if ((options == null ? void 0 : options.enable) && ((_a = options == null ? void 0 : options.vconsole) == null ? void 0 : _a.enabled)) {
14
+ try {
15
+ const viteVConsilePlugin = await interopDefault(import("vite-plugin-vconsole"));
16
+ plugins.push(viteVConsilePlugin(options == null ? void 0 : options.vconsole));
17
+ } catch (e) {
18
+ console.error("vite-plugin-vconsole not found");
19
+ }
20
+ }
21
+ return plugins;
22
+ };
23
+
24
+ export {
25
+ vite_default
26
+ };
package/dist/esbuild.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-6LTE4RPT.js";
4
- import "./chunk-ZEHXGFFH.js";
3
+ } from "./chunk-IH5FP4BK.js";
4
+ import "./chunk-A2RZ6ACY.js";
5
+ import "./chunk-MCTMMV5B.js";
5
6
 
6
7
  // src/esbuild.ts
7
8
  import { createEsbuildPlugin } from "unplugin";
package/dist/index.d.ts CHANGED
@@ -1,18 +1,15 @@
1
1
  import * as _unplugin from 'unplugin';
2
2
  import { UnpluginFactory } from 'unplugin';
3
- import dns2 from 'dns2';
4
3
  import { Options } from './types.js';
5
4
  import 'webpack-dev-server';
6
5
  import 'node:http';
7
6
  import 'vite-plugin-vconsole';
8
7
 
9
8
  declare const resovedInfo: {
10
- dnsServerInstence: ReturnType<typeof dns2.createServer> | undefined;
11
9
  availablePort: number | undefined;
12
10
  targetURL: undefined | URL;
13
11
  };
14
- declare function startDnsServer(options?: Options): void;
15
12
  declare const unpluginFactory: UnpluginFactory<Options | undefined, boolean>;
16
13
  declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
17
14
 
18
- export { unplugin as default, resovedInfo, startDnsServer, unplugin, unpluginFactory };
15
+ export { unplugin as default, resovedInfo, unplugin, unpluginFactory };
package/dist/index.js CHANGED
@@ -1,15 +1,14 @@
1
1
  import {
2
2
  index_default,
3
3
  resovedInfo,
4
- startDnsServer,
5
4
  unplugin,
6
5
  unpluginFactory
7
- } from "./chunk-6LTE4RPT.js";
8
- import "./chunk-ZEHXGFFH.js";
6
+ } from "./chunk-IH5FP4BK.js";
7
+ import "./chunk-A2RZ6ACY.js";
8
+ import "./chunk-MCTMMV5B.js";
9
9
  export {
10
10
  index_default as default,
11
11
  resovedInfo,
12
- startDnsServer,
13
12
  unplugin,
14
13
  unpluginFactory
15
14
  };
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  FormData,
3
- __forAwait,
4
3
  file_default
5
- } from "./chunk-ZEHXGFFH.js";
4
+ } from "./chunk-A2RZ6ACY.js";
5
+ import {
6
+ __forAwait
7
+ } from "./chunk-MCTMMV5B.js";
6
8
 
7
9
  // node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js
8
10
  var s = 0;
package/dist/nuxt.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-CTXK6UCW.js";
4
- import "./chunk-6LTE4RPT.js";
5
- import "./chunk-ZEHXGFFH.js";
3
+ } from "./chunk-NVQKD2XR.js";
4
+ import "./chunk-IH5FP4BK.js";
5
+ import "./chunk-A2RZ6ACY.js";
6
+ import "./chunk-KQOHODTC.js";
7
+ import "./chunk-MCTMMV5B.js";
6
8
 
7
9
  // src/nuxt.ts
8
10
  import { addVitePlugin, defineNuxtModule } from "@nuxt/kit";
@@ -15,8 +17,9 @@ var nuxt_default = defineNuxtModule({
15
17
  defaults: {
16
18
  // ...default options
17
19
  },
18
- setup(options, _nuxt) {
19
- addVitePlugin(() => vite_default(options));
20
+ async setup(options, _nuxt) {
21
+ const vitePlugins = await vite_default(options);
22
+ addVitePlugin(vitePlugins);
20
23
  }
21
24
  });
22
25
  export {
package/dist/rollup.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-6LTE4RPT.js";
4
- import "./chunk-ZEHXGFFH.js";
3
+ } from "./chunk-IH5FP4BK.js";
4
+ import "./chunk-A2RZ6ACY.js";
5
+ import "./chunk-MCTMMV5B.js";
5
6
 
6
7
  // src/rollup.ts
7
8
  import { createRollupPlugin } from "unplugin";
package/dist/rspack.js CHANGED
@@ -2,8 +2,9 @@ import {
2
2
  fetch,
3
3
  resovedInfo,
4
4
  unpluginFactory
5
- } from "./chunk-6LTE4RPT.js";
6
- import "./chunk-ZEHXGFFH.js";
5
+ } from "./chunk-IH5FP4BK.js";
6
+ import "./chunk-A2RZ6ACY.js";
7
+ import "./chunk-MCTMMV5B.js";
7
8
 
8
9
  // src/rspack.ts
9
10
  import { createRspackPlugin } from "unplugin";
package/dist/types.d.ts CHANGED
@@ -5,11 +5,6 @@ import { viteVConsoleOptions } from 'vite-plugin-vconsole';
5
5
  interface Options {
6
6
  enable?: boolean;
7
7
  targetUrl?: string;
8
- /** 是否启动dns服务器 */
9
- dns?: {
10
- host: string;
11
- ip: string;
12
- };
13
8
  corpId?: string;
14
9
  debug?: boolean;
15
10
  /** only support vite */
@@ -17,8 +12,11 @@ interface Options {
17
12
  chii?: {
18
13
  /** default true */
19
14
  enable?: boolean;
20
- /** default 127.0.0.1 */
21
- host: string;
15
+ /**
16
+ * default false
17
+ * @link [chii embedded](https://chii.liriliri.io/docs/#usage)
18
+ */
19
+ embedded?: boolean;
22
20
  };
23
21
  debugCookies?: string[];
24
22
  }
@@ -0,0 +1,6 @@
1
+ type Awaitable<T> = T | Promise<T>;
2
+ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
3
+ default: infer U;
4
+ } ? U : T>;
5
+
6
+ export { type Awaitable, interopDefault };
package/dist/utils.js ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ interopDefault
3
+ } from "./chunk-KQOHODTC.js";
4
+ import "./chunk-MCTMMV5B.js";
5
+ export {
6
+ interopDefault
7
+ };
package/dist/vite.d.ts CHANGED
@@ -4,6 +4,6 @@ import 'webpack-dev-server';
4
4
  import 'node:http';
5
5
  import 'vite-plugin-vconsole';
6
6
 
7
- declare const _default: (options: Options) => Plugin<any>[];
7
+ declare const _default: (options: Options) => Promise<Plugin<any>[]>;
8
8
 
9
9
  export { _default as default };
package/dist/vite.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-CTXK6UCW.js";
4
- import "./chunk-6LTE4RPT.js";
5
- import "./chunk-ZEHXGFFH.js";
3
+ } from "./chunk-NVQKD2XR.js";
4
+ import "./chunk-IH5FP4BK.js";
5
+ import "./chunk-A2RZ6ACY.js";
6
+ import "./chunk-KQOHODTC.js";
7
+ import "./chunk-MCTMMV5B.js";
6
8
  export {
7
9
  vite_default as default
8
10
  };
package/dist/webpack.js CHANGED
@@ -2,8 +2,9 @@ import {
2
2
  fetch,
3
3
  resovedInfo,
4
4
  unpluginFactory
5
- } from "./chunk-6LTE4RPT.js";
6
- import "./chunk-ZEHXGFFH.js";
5
+ } from "./chunk-IH5FP4BK.js";
6
+ import "./chunk-A2RZ6ACY.js";
7
+ import "./chunk-MCTMMV5B.js";
7
8
 
8
9
  // src/webpack.ts
9
10
  import { createWebpackPlugin } from "unplugin";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-dingtalk",
3
3
  "type": "module",
4
- "version": "1002.0.0",
4
+ "version": "1003.1.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/zcf0508/unplugin-dingtalk#readme",
@@ -51,8 +51,8 @@
51
51
  "@rsbuild/core": "^0.7.9",
52
52
  "esbuild": "*",
53
53
  "rollup": "^3",
54
- "vconsole": "^3.15.1",
55
54
  "vite": ">=3",
55
+ "vite-plugin-vconsole": "^2.1.1",
56
56
  "webpack": "^4 || ^5"
57
57
  },
58
58
  "peerDependenciesMeta": {
@@ -71,10 +71,10 @@
71
71
  "rollup": {
72
72
  "optional": true
73
73
  },
74
- "vconsole": {
74
+ "vite": {
75
75
  "optional": true
76
76
  },
77
- "vite": {
77
+ "vite-plugin-vconsole": {
78
78
  "optional": true
79
79
  },
80
80
  "webpack": {
@@ -83,18 +83,15 @@
83
83
  },
84
84
  "dependencies": {
85
85
  "cookie": "^1.0.2",
86
- "dns2": "^2.1.0",
87
86
  "http-proxy": "^1.18.1",
88
87
  "picocolors": "^1.0.1",
89
88
  "unplugin": "^1.5.1",
90
- "vite-plugin-vconsole": "^2.1.1",
91
89
  "z-chii": "1.15.5-beta.1"
92
90
  },
93
91
  "devDependencies": {
94
92
  "@antfu/eslint-config": "^2.18.1",
95
93
  "@nuxt/kit": "^3.8.2",
96
94
  "@nuxt/schema": "^3.8.2",
97
- "@types/dns2": "^2.0.9",
98
95
  "@types/node": "^20.10.3",
99
96
  "bumpp": "^9.2.0",
100
97
  "chalk": "^5.3.0",
@@ -108,6 +105,7 @@
108
105
  "rollup": "^4.6.1",
109
106
  "tsup": "^8.0.1",
110
107
  "vite": "^5.0.4",
108
+ "vite-plugin-vconsole": "^2.1.1",
111
109
  "vitest": "^1.6.0",
112
110
  "webpack": "^5.89.0",
113
111
  "webpack-dev-server": "^5.0.4"
@@ -1,19 +0,0 @@
1
- import {
2
- unpluginFactory
3
- } from "./chunk-6LTE4RPT.js";
4
-
5
- // src/vite.ts
6
- import { createVitePlugin } from "unplugin";
7
- import viteVConsole from "vite-plugin-vconsole";
8
- var vite_default = (options) => {
9
- var _a;
10
- const plugins = [createVitePlugin(unpluginFactory)(options)];
11
- if ((options == null ? void 0 : options.enable) && ((_a = options == null ? void 0 : options.vconsole) == null ? void 0 : _a.enabled)) {
12
- plugins.push(viteVConsole(options == null ? void 0 : options.vconsole));
13
- }
14
- return plugins;
15
- };
16
-
17
- export {
18
- vite_default
19
- };