unplugin-dingtalk 0.3.1 → 0.4.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/astro.cjs +35 -5
- package/dist/astro.d.cts +1 -0
- package/dist/astro.d.ts +1 -0
- package/dist/astro.js +1 -1
- package/dist/{chunk-Q26XYG3E.js → chunk-2OB7UBRW.js} +1 -1
- package/dist/{chunk-E34H52KV.js → chunk-RDTWBIQD.js} +35 -5
- package/dist/esbuild.cjs +35 -5
- package/dist/esbuild.d.cts +1 -0
- package/dist/esbuild.d.ts +1 -0
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +35 -5
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +78 -123
- package/dist/nuxt.d.cts +1 -0
- package/dist/nuxt.d.ts +1 -0
- package/dist/nuxt.js +3 -7
- package/dist/rollup.cjs +35 -5
- package/dist/rollup.d.cts +1 -0
- package/dist/rollup.d.ts +1 -0
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +157 -53
- package/dist/rspack.d.cts +4 -2
- package/dist/rspack.d.ts +4 -2
- package/dist/rspack.js +80 -2
- package/dist/types.d.cts +15 -1
- package/dist/types.d.ts +15 -1
- package/dist/vite.cjs +35 -5
- package/dist/vite.d.cts +1 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +36 -6
- package/dist/webpack.d.cts +1 -0
- package/dist/webpack.d.ts +1 -0
- package/dist/webpack.js +78 -3
- package/package.json +5 -1
- package/dist/chunk-OVAVOVTT.js +0 -83
package/dist/nuxt.cjs
CHANGED
|
@@ -4389,15 +4389,15 @@ var require_streams = __commonJS({
|
|
|
4389
4389
|
var POOL_SIZE2 = 65536;
|
|
4390
4390
|
if (!globalThis.ReadableStream) {
|
|
4391
4391
|
try {
|
|
4392
|
-
const
|
|
4393
|
-
const { emitWarning } =
|
|
4392
|
+
const process3 = require("process");
|
|
4393
|
+
const { emitWarning } = process3;
|
|
4394
4394
|
try {
|
|
4395
|
-
|
|
4395
|
+
process3.emitWarning = () => {
|
|
4396
4396
|
};
|
|
4397
4397
|
Object.assign(globalThis, require("stream/web"));
|
|
4398
|
-
|
|
4398
|
+
process3.emitWarning = emitWarning;
|
|
4399
4399
|
} catch (error) {
|
|
4400
|
-
|
|
4400
|
+
process3.emitWarning = emitWarning;
|
|
4401
4401
|
throw error;
|
|
4402
4402
|
}
|
|
4403
4403
|
} catch (error) {
|
|
@@ -4707,17 +4707,17 @@ var init_file = __esm({
|
|
|
4707
4707
|
|
|
4708
4708
|
// node_modules/.pnpm/formdata-polyfill@4.0.10/node_modules/formdata-polyfill/esm.min.js
|
|
4709
4709
|
function formDataToBlob(F2, B = fetch_blob_default) {
|
|
4710
|
-
var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"),
|
|
4710
|
+
var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c2 = [], p = `--${b}\r
|
|
4711
4711
|
Content-Disposition: form-data; name="`;
|
|
4712
|
-
F2.forEach((v, n) => typeof v == "string" ?
|
|
4712
|
+
F2.forEach((v, n) => typeof v == "string" ? c2.push(p + e(n) + `"\r
|
|
4713
4713
|
\r
|
|
4714
4714
|
${v.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n", "g"), "\r\n")}\r
|
|
4715
|
-
`) :
|
|
4715
|
+
`) : c2.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r
|
|
4716
4716
|
Content-Type: ${v.type || "application/octet-stream"}\r
|
|
4717
4717
|
\r
|
|
4718
4718
|
`, v, "\r\n"));
|
|
4719
|
-
|
|
4720
|
-
return new B(
|
|
4719
|
+
c2.push(`--${b}--`);
|
|
4720
|
+
return new B(c2, { type: "multipart/form-data; boundary=" + b });
|
|
4721
4721
|
}
|
|
4722
4722
|
var t, i, h, r, m, f, e, x, _d, _a3, FormData;
|
|
4723
4723
|
var init_esm_min = __esm({
|
|
@@ -4728,8 +4728,8 @@ var init_esm_min = __esm({
|
|
|
4728
4728
|
({ toStringTag: t, iterator: i, hasInstance: h } = Symbol);
|
|
4729
4729
|
r = Math.random;
|
|
4730
4730
|
m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(",");
|
|
4731
|
-
f = (a, b,
|
|
4732
|
-
e = (
|
|
4731
|
+
f = (a, b, c2) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c2 = c2 !== void 0 ? c2 + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c2 || b[t] == "blob" ? new file_default([b], c2, b) : b] : [a, b + ""]);
|
|
4732
|
+
e = (c2, f3) => (f3 ? c2 : c2.replace(/\r?\n|\r/g, "\r\n")).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
|
|
4733
4733
|
x = (n, a, e2) => {
|
|
4734
4734
|
if (a.length < e2) {
|
|
4735
4735
|
throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
|
|
@@ -4761,14 +4761,14 @@ var init_esm_min = __esm({
|
|
|
4761
4761
|
get(a) {
|
|
4762
4762
|
x("get", arguments, 1);
|
|
4763
4763
|
a += "";
|
|
4764
|
-
for (var b = __privateGet(this, _d), l = b.length,
|
|
4764
|
+
for (var b = __privateGet(this, _d), l = b.length, c2 = 0; c2 < l; c2++) if (b[c2][0] === a) return b[c2][1];
|
|
4765
4765
|
return null;
|
|
4766
4766
|
}
|
|
4767
4767
|
getAll(a, b) {
|
|
4768
4768
|
x("getAll", arguments, 1);
|
|
4769
4769
|
b = [];
|
|
4770
4770
|
a += "";
|
|
4771
|
-
__privateGet(this, _d).forEach((
|
|
4771
|
+
__privateGet(this, _d).forEach((c2) => c2[0] === a && b.push(c2[1]));
|
|
4772
4772
|
return b;
|
|
4773
4773
|
}
|
|
4774
4774
|
has(a) {
|
|
@@ -4778,16 +4778,16 @@ var init_esm_min = __esm({
|
|
|
4778
4778
|
}
|
|
4779
4779
|
forEach(a, b) {
|
|
4780
4780
|
x("forEach", arguments, 1);
|
|
4781
|
-
for (var [
|
|
4781
|
+
for (var [c2, d] of this) a.call(b, d, c2, this);
|
|
4782
4782
|
}
|
|
4783
4783
|
set(...a) {
|
|
4784
4784
|
x("set", arguments, 2);
|
|
4785
|
-
var b = [],
|
|
4785
|
+
var b = [], c2 = true;
|
|
4786
4786
|
a = f(...a);
|
|
4787
4787
|
__privateGet(this, _d).forEach((d) => {
|
|
4788
|
-
d[0] === a[0] ?
|
|
4788
|
+
d[0] === a[0] ? c2 && (c2 = !b.push(a)) : b.push(d);
|
|
4789
4789
|
});
|
|
4790
|
-
|
|
4790
|
+
c2 && b.push(a);
|
|
4791
4791
|
__privateSet(this, _d, b);
|
|
4792
4792
|
}
|
|
4793
4793
|
*entries() {
|
|
@@ -4968,7 +4968,7 @@ var init_multipart_parser = __esm({
|
|
|
4968
4968
|
COLON = 58;
|
|
4969
4969
|
A = 97;
|
|
4970
4970
|
Z = 122;
|
|
4971
|
-
lower = (
|
|
4971
|
+
lower = (c2) => c2 | 32;
|
|
4972
4972
|
noop = () => {
|
|
4973
4973
|
};
|
|
4974
4974
|
MultipartParser = class {
|
|
@@ -5007,7 +5007,7 @@ var init_multipart_parser = __esm({
|
|
|
5007
5007
|
const boundaryLength = this.boundary.length;
|
|
5008
5008
|
const boundaryEnd = boundaryLength - 1;
|
|
5009
5009
|
const bufferLength = data.length;
|
|
5010
|
-
let
|
|
5010
|
+
let c2;
|
|
5011
5011
|
let cl;
|
|
5012
5012
|
const mark = (name) => {
|
|
5013
5013
|
this[name + "Mark"] = i2;
|
|
@@ -5034,22 +5034,22 @@ var init_multipart_parser = __esm({
|
|
|
5034
5034
|
}
|
|
5035
5035
|
};
|
|
5036
5036
|
for (i2 = 0; i2 < length_; i2++) {
|
|
5037
|
-
|
|
5037
|
+
c2 = data[i2];
|
|
5038
5038
|
switch (state) {
|
|
5039
5039
|
case S.START_BOUNDARY:
|
|
5040
5040
|
if (index === boundary.length - 2) {
|
|
5041
|
-
if (
|
|
5041
|
+
if (c2 === HYPHEN) {
|
|
5042
5042
|
flags |= F.LAST_BOUNDARY;
|
|
5043
|
-
} else if (
|
|
5043
|
+
} else if (c2 !== CR) {
|
|
5044
5044
|
return;
|
|
5045
5045
|
}
|
|
5046
5046
|
index++;
|
|
5047
5047
|
break;
|
|
5048
5048
|
} else if (index - 1 === boundary.length - 2) {
|
|
5049
|
-
if (flags & F.LAST_BOUNDARY &&
|
|
5049
|
+
if (flags & F.LAST_BOUNDARY && c2 === HYPHEN) {
|
|
5050
5050
|
state = S.END;
|
|
5051
5051
|
flags = 0;
|
|
5052
|
-
} else if (!(flags & F.LAST_BOUNDARY) &&
|
|
5052
|
+
} else if (!(flags & F.LAST_BOUNDARY) && c2 === LF) {
|
|
5053
5053
|
index = 0;
|
|
5054
5054
|
callback("onPartBegin");
|
|
5055
5055
|
state = S.HEADER_FIELD_START;
|
|
@@ -5058,10 +5058,10 @@ var init_multipart_parser = __esm({
|
|
|
5058
5058
|
}
|
|
5059
5059
|
break;
|
|
5060
5060
|
}
|
|
5061
|
-
if (
|
|
5061
|
+
if (c2 !== boundary[index + 2]) {
|
|
5062
5062
|
index = -2;
|
|
5063
5063
|
}
|
|
5064
|
-
if (
|
|
5064
|
+
if (c2 === boundary[index + 2]) {
|
|
5065
5065
|
index++;
|
|
5066
5066
|
}
|
|
5067
5067
|
break;
|
|
@@ -5070,16 +5070,16 @@ var init_multipart_parser = __esm({
|
|
|
5070
5070
|
mark("onHeaderField");
|
|
5071
5071
|
index = 0;
|
|
5072
5072
|
case S.HEADER_FIELD:
|
|
5073
|
-
if (
|
|
5073
|
+
if (c2 === CR) {
|
|
5074
5074
|
clear("onHeaderField");
|
|
5075
5075
|
state = S.HEADERS_ALMOST_DONE;
|
|
5076
5076
|
break;
|
|
5077
5077
|
}
|
|
5078
5078
|
index++;
|
|
5079
|
-
if (
|
|
5079
|
+
if (c2 === HYPHEN) {
|
|
5080
5080
|
break;
|
|
5081
5081
|
}
|
|
5082
|
-
if (
|
|
5082
|
+
if (c2 === COLON) {
|
|
5083
5083
|
if (index === 1) {
|
|
5084
5084
|
return;
|
|
5085
5085
|
}
|
|
@@ -5087,32 +5087,32 @@ var init_multipart_parser = __esm({
|
|
|
5087
5087
|
state = S.HEADER_VALUE_START;
|
|
5088
5088
|
break;
|
|
5089
5089
|
}
|
|
5090
|
-
cl = lower(
|
|
5090
|
+
cl = lower(c2);
|
|
5091
5091
|
if (cl < A || cl > Z) {
|
|
5092
5092
|
return;
|
|
5093
5093
|
}
|
|
5094
5094
|
break;
|
|
5095
5095
|
case S.HEADER_VALUE_START:
|
|
5096
|
-
if (
|
|
5096
|
+
if (c2 === SPACE) {
|
|
5097
5097
|
break;
|
|
5098
5098
|
}
|
|
5099
5099
|
mark("onHeaderValue");
|
|
5100
5100
|
state = S.HEADER_VALUE;
|
|
5101
5101
|
case S.HEADER_VALUE:
|
|
5102
|
-
if (
|
|
5102
|
+
if (c2 === CR) {
|
|
5103
5103
|
dataCallback("onHeaderValue", true);
|
|
5104
5104
|
callback("onHeaderEnd");
|
|
5105
5105
|
state = S.HEADER_VALUE_ALMOST_DONE;
|
|
5106
5106
|
}
|
|
5107
5107
|
break;
|
|
5108
5108
|
case S.HEADER_VALUE_ALMOST_DONE:
|
|
5109
|
-
if (
|
|
5109
|
+
if (c2 !== LF) {
|
|
5110
5110
|
return;
|
|
5111
5111
|
}
|
|
5112
5112
|
state = S.HEADER_FIELD_START;
|
|
5113
5113
|
break;
|
|
5114
5114
|
case S.HEADERS_ALMOST_DONE:
|
|
5115
|
-
if (
|
|
5115
|
+
if (c2 !== LF) {
|
|
5116
5116
|
return;
|
|
5117
5117
|
}
|
|
5118
5118
|
callback("onHeadersEnd");
|
|
@@ -5129,10 +5129,10 @@ var init_multipart_parser = __esm({
|
|
|
5129
5129
|
i2 += boundaryLength;
|
|
5130
5130
|
}
|
|
5131
5131
|
i2 -= boundaryEnd;
|
|
5132
|
-
|
|
5132
|
+
c2 = data[i2];
|
|
5133
5133
|
}
|
|
5134
5134
|
if (index < boundary.length) {
|
|
5135
|
-
if (boundary[index] ===
|
|
5135
|
+
if (boundary[index] === c2) {
|
|
5136
5136
|
if (index === 0) {
|
|
5137
5137
|
dataCallback("onPartData", true);
|
|
5138
5138
|
}
|
|
@@ -5142,9 +5142,9 @@ var init_multipart_parser = __esm({
|
|
|
5142
5142
|
}
|
|
5143
5143
|
} else if (index === boundary.length) {
|
|
5144
5144
|
index++;
|
|
5145
|
-
if (
|
|
5145
|
+
if (c2 === CR) {
|
|
5146
5146
|
flags |= F.PART_BOUNDARY;
|
|
5147
|
-
} else if (
|
|
5147
|
+
} else if (c2 === HYPHEN) {
|
|
5148
5148
|
flags |= F.LAST_BOUNDARY;
|
|
5149
5149
|
} else {
|
|
5150
5150
|
index = 0;
|
|
@@ -5152,7 +5152,7 @@ var init_multipart_parser = __esm({
|
|
|
5152
5152
|
} else if (index - 1 === boundary.length) {
|
|
5153
5153
|
if (flags & F.PART_BOUNDARY) {
|
|
5154
5154
|
index = 0;
|
|
5155
|
-
if (
|
|
5155
|
+
if (c2 === LF) {
|
|
5156
5156
|
flags &= ~F.PART_BOUNDARY;
|
|
5157
5157
|
callback("onPartEnd");
|
|
5158
5158
|
callback("onPartBegin");
|
|
@@ -5160,7 +5160,7 @@ var init_multipart_parser = __esm({
|
|
|
5160
5160
|
break;
|
|
5161
5161
|
}
|
|
5162
5162
|
} else if (flags & F.LAST_BOUNDARY) {
|
|
5163
|
-
if (
|
|
5163
|
+
if (c2 === HYPHEN) {
|
|
5164
5164
|
callback("onPartEnd");
|
|
5165
5165
|
state = S.END;
|
|
5166
5166
|
flags = 0;
|
|
@@ -5172,7 +5172,7 @@ var init_multipart_parser = __esm({
|
|
|
5172
5172
|
}
|
|
5173
5173
|
}
|
|
5174
5174
|
if (index > 0) {
|
|
5175
|
-
lookbehind[index - 1] =
|
|
5175
|
+
lookbehind[index - 1] = c2;
|
|
5176
5176
|
} else if (previousIndex > 0) {
|
|
5177
5177
|
const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);
|
|
5178
5178
|
callback("onPartData", 0, previousIndex, _lookbehind);
|
|
@@ -5500,7 +5500,7 @@ async function consumeBody(data) {
|
|
|
5500
5500
|
}
|
|
5501
5501
|
if (body.readableEnded === true || body._readableState.ended === true) {
|
|
5502
5502
|
try {
|
|
5503
|
-
if (accum.every((
|
|
5503
|
+
if (accum.every((c2) => typeof c2 === "string")) {
|
|
5504
5504
|
return import_node_buffer.Buffer.from(accum.join(""));
|
|
5505
5505
|
}
|
|
5506
5506
|
return import_node_buffer.Buffer.concat(accum, accumBytes);
|
|
@@ -6519,6 +6519,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
6519
6519
|
var import_cookie = __toESM(require("cookie"), 1);
|
|
6520
6520
|
var import_chii = require("chii");
|
|
6521
6521
|
var import_get_port_please = require("get-port-please");
|
|
6522
|
+
var cwd = import_node_process.default.cwd();
|
|
6522
6523
|
var config;
|
|
6523
6524
|
var colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
6524
6525
|
var resovedInfo = {
|
|
@@ -6551,17 +6552,18 @@ var unpluginFactory = (options) => {
|
|
|
6551
6552
|
port: resovedInfo.availablePort
|
|
6552
6553
|
});
|
|
6553
6554
|
}
|
|
6554
|
-
if (
|
|
6555
|
+
if (options == null ? void 0 : options.enable) {
|
|
6555
6556
|
const codes = [
|
|
6556
|
-
|
|
6557
|
-
import { devtools } from '@vue/devtools'
|
|
6558
|
-
devtools.connect(${(_b = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _b.host}, ${(_c = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _c.port})
|
|
6557
|
+
"/* eslint-disable */;",
|
|
6558
|
+
((_a4 = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _a4.enable) ? `import { devtools } from '@vue/devtools'
|
|
6559
|
+
devtools.connect(${(_b = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _b.host}, ${(_c = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _c.port});` : "",
|
|
6559
6560
|
(options == null ? void 0 : options.enable) && enableChii ? `(() => {
|
|
6560
6561
|
const script = document.createElement('script');
|
|
6561
6562
|
script.src="http://localhost:${resovedInfo.availablePort}/target.js";
|
|
6562
6563
|
document.body.appendChild(script);
|
|
6563
6564
|
})()` : "",
|
|
6564
|
-
|
|
6565
|
+
"/* eslint-enable */",
|
|
6566
|
+
`${_source};`
|
|
6565
6567
|
];
|
|
6566
6568
|
return {
|
|
6567
6569
|
code: codes.join("\n"),
|
|
@@ -6691,6 +6693,34 @@ var unpluginFactory = (options) => {
|
|
|
6691
6693
|
if (options == null ? void 0 : options.corpId) {
|
|
6692
6694
|
resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
6693
6695
|
}
|
|
6696
|
+
},
|
|
6697
|
+
async rspack(compiler) {
|
|
6698
|
+
var _a4, _b, _c, _d2, _e;
|
|
6699
|
+
if (!(options == null ? void 0 : options.enable)) {
|
|
6700
|
+
return;
|
|
6701
|
+
}
|
|
6702
|
+
const devServerOptions = __spreadValues(__spreadValues({
|
|
6703
|
+
host: "localhost",
|
|
6704
|
+
port: 8080
|
|
6705
|
+
}, compiler.options.devServer), (_c = (_b = await ((_a4 = await import("@rsbuild/core")) == null ? void 0 : _a4.loadConfig({
|
|
6706
|
+
cwd
|
|
6707
|
+
}))) == null ? void 0 : _b.content) == null ? void 0 : _c.server);
|
|
6708
|
+
const source = `${devServerOptions.host === "0.0.0.0" ? "127.0.0.1" : devServerOptions.host}:${devServerOptions.port}`;
|
|
6709
|
+
const base = compiler.options.output.publicPath || "/";
|
|
6710
|
+
const _targetUrl = (_d2 = options == null ? void 0 : options.targetUrl) != null ? _d2 : `http://${source}${base}`;
|
|
6711
|
+
resovedInfo.targetURL = new URL(_targetUrl);
|
|
6712
|
+
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
6713
|
+
if (options == null ? void 0 : options.corpId) {
|
|
6714
|
+
resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
6715
|
+
}
|
|
6716
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold(
|
|
6717
|
+
`Open in dingtalk${((_e = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _e.enable) ? " (with vue-devtools)" : ""}`
|
|
6718
|
+
)}: ${colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
6719
|
+
if (enableChii) {
|
|
6720
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold(
|
|
6721
|
+
"Click to open chrome devtools"
|
|
6722
|
+
)}: ${colorUrl(`http://${source}${base}__chrome_devtools`)}`);
|
|
6723
|
+
}
|
|
6694
6724
|
}
|
|
6695
6725
|
};
|
|
6696
6726
|
return unpluginDing;
|
|
@@ -6706,80 +6736,6 @@ var vite_default = (options) => {
|
|
|
6706
6736
|
return plugins;
|
|
6707
6737
|
};
|
|
6708
6738
|
|
|
6709
|
-
// src/webpack.ts
|
|
6710
|
-
var import_node_child_process2 = require("child_process");
|
|
6711
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
6712
|
-
var import_unplugin3 = require("unplugin");
|
|
6713
|
-
var import_cookie2 = __toESM(require("cookie"), 1);
|
|
6714
|
-
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
6715
|
-
var webpack_default = (options) => {
|
|
6716
|
-
function debug(...args) {
|
|
6717
|
-
if (options == null ? void 0 : options.debug) {
|
|
6718
|
-
console.log(` ${import_picocolors2.default.yellow("DEBUG")} `, ...args);
|
|
6719
|
-
}
|
|
6720
|
-
}
|
|
6721
|
-
const {
|
|
6722
|
-
chii: enableChii = true
|
|
6723
|
-
} = options || {};
|
|
6724
|
-
const injectSetupMiddlewares = (middlewares, devServer) => {
|
|
6725
|
-
if (options.debugCookies && options.debugCookies.length > 0) {
|
|
6726
|
-
devServer.app.use((req, res, next) => {
|
|
6727
|
-
const cookies = import_cookie2.default.parse(req.headers.cookie || "");
|
|
6728
|
-
for (const [name, value] of Object.entries(cookies)) {
|
|
6729
|
-
if (options.debugCookies && options.debugCookies.length > 0 && options.debugCookies.includes(name)) {
|
|
6730
|
-
const serializedCookie = import_cookie2.default.serialize(name, value, {
|
|
6731
|
-
httpOnly: false
|
|
6732
|
-
});
|
|
6733
|
-
res.setHeader("Set-Cookie", serializedCookie);
|
|
6734
|
-
}
|
|
6735
|
-
}
|
|
6736
|
-
next();
|
|
6737
|
-
});
|
|
6738
|
-
}
|
|
6739
|
-
if (enableChii) {
|
|
6740
|
-
devServer.app.get("/__chrome_devtools", async (_req, res) => {
|
|
6741
|
-
const availablePort = resovedInfo.availablePort;
|
|
6742
|
-
try {
|
|
6743
|
-
const raw = await fetch(`http://localhost:${availablePort}/targets`);
|
|
6744
|
-
const data = await raw.json();
|
|
6745
|
-
if ((data == null ? void 0 : data.targets.length) > 0) {
|
|
6746
|
-
const devToolsUrl = `http://localhost:${availablePort}/front_end/chii_app.html?ws=localhost:${availablePort}/client/${Math.random().toString(20).substring(2, 8)}?target=${data.targets[0].id}&rtc=false`;
|
|
6747
|
-
res.writeHead(302, { Location: devToolsUrl });
|
|
6748
|
-
res.end();
|
|
6749
|
-
}
|
|
6750
|
-
} catch (error) {
|
|
6751
|
-
debug(`${error}`);
|
|
6752
|
-
res.writeHead(502);
|
|
6753
|
-
res.end();
|
|
6754
|
-
}
|
|
6755
|
-
});
|
|
6756
|
-
}
|
|
6757
|
-
devServer.app.get("/open-dingtalk", (req, res) => {
|
|
6758
|
-
var _a4;
|
|
6759
|
-
const targetURL = resovedInfo.targetURL;
|
|
6760
|
-
console.debug(targetURL.toString());
|
|
6761
|
-
res.writeHead(302, {
|
|
6762
|
-
Location: `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(targetURL.toString())}`
|
|
6763
|
-
});
|
|
6764
|
-
if (((_a4 = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _a4.enable) && !resovedInfo.devtoolsInstance) {
|
|
6765
|
-
resovedInfo.devtoolsInstance = (0, import_node_child_process2.exec)("npx vue-devtools");
|
|
6766
|
-
console.log(` ${import_picocolors2.default.green("\u279C")} vue-devtools is running. If the devtools has no data, please refresh the page in dingtalk.`);
|
|
6767
|
-
resovedInfo.devtoolsInstance.on("exit", () => {
|
|
6768
|
-
resovedInfo.devtoolsInstance = void 0;
|
|
6769
|
-
});
|
|
6770
|
-
import_node_process2.default.on("exit", () => {
|
|
6771
|
-
if (resovedInfo.devtoolsInstance) {
|
|
6772
|
-
resovedInfo.devtoolsInstance.kill();
|
|
6773
|
-
}
|
|
6774
|
-
});
|
|
6775
|
-
}
|
|
6776
|
-
res.end();
|
|
6777
|
-
});
|
|
6778
|
-
return middlewares;
|
|
6779
|
-
};
|
|
6780
|
-
return [injectSetupMiddlewares, (0, import_unplugin3.createWebpackPlugin)(unpluginFactory)(options)];
|
|
6781
|
-
};
|
|
6782
|
-
|
|
6783
6739
|
// src/nuxt.ts
|
|
6784
6740
|
var import_schema = require("@nuxt/schema");
|
|
6785
6741
|
var nuxt_default = (0, import_kit.defineNuxtModule)({
|
|
@@ -6792,7 +6748,6 @@ var nuxt_default = (0, import_kit.defineNuxtModule)({
|
|
|
6792
6748
|
},
|
|
6793
6749
|
setup(options, _nuxt) {
|
|
6794
6750
|
(0, import_kit.addVitePlugin)(() => vite_default(options));
|
|
6795
|
-
(0, import_kit.addWebpackPlugin)(() => webpack_default(options));
|
|
6796
6751
|
}
|
|
6797
6752
|
});
|
|
6798
6753
|
/*! Bundled license information:
|
package/dist/nuxt.d.cts
CHANGED
package/dist/nuxt.d.ts
CHANGED
package/dist/nuxt.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
webpack_default
|
|
3
|
-
} from "./chunk-OVAVOVTT.js";
|
|
4
1
|
import {
|
|
5
2
|
vite_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2OB7UBRW.js";
|
|
4
|
+
import "./chunk-RDTWBIQD.js";
|
|
8
5
|
import "./chunk-PMOTCIQR.js";
|
|
9
6
|
|
|
10
7
|
// src/nuxt.ts
|
|
11
|
-
import { addVitePlugin,
|
|
8
|
+
import { addVitePlugin, defineNuxtModule } from "@nuxt/kit";
|
|
12
9
|
import "@nuxt/schema";
|
|
13
10
|
var nuxt_default = defineNuxtModule({
|
|
14
11
|
meta: {
|
|
@@ -20,7 +17,6 @@ var nuxt_default = defineNuxtModule({
|
|
|
20
17
|
},
|
|
21
18
|
setup(options, _nuxt) {
|
|
22
19
|
addVitePlugin(() => vite_default(options));
|
|
23
|
-
addWebpackPlugin(() => webpack_default(options));
|
|
24
20
|
}
|
|
25
21
|
});
|
|
26
22
|
export {
|
package/dist/rollup.cjs
CHANGED
|
@@ -6515,6 +6515,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
6515
6515
|
var import_cookie = __toESM(require("cookie"), 1);
|
|
6516
6516
|
var import_chii = require("chii");
|
|
6517
6517
|
var import_get_port_please = require("get-port-please");
|
|
6518
|
+
var cwd = import_node_process.default.cwd();
|
|
6518
6519
|
var config;
|
|
6519
6520
|
var colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
6520
6521
|
var resovedInfo = {
|
|
@@ -6547,17 +6548,18 @@ var unpluginFactory = (options) => {
|
|
|
6547
6548
|
port: resovedInfo.availablePort
|
|
6548
6549
|
});
|
|
6549
6550
|
}
|
|
6550
|
-
if (
|
|
6551
|
+
if (options == null ? void 0 : options.enable) {
|
|
6551
6552
|
const codes = [
|
|
6552
|
-
|
|
6553
|
-
import { devtools } from '@vue/devtools'
|
|
6554
|
-
devtools.connect(${(_b = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _b.host}, ${(_c = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _c.port})
|
|
6553
|
+
"/* eslint-disable */;",
|
|
6554
|
+
((_a4 = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _a4.enable) ? `import { devtools } from '@vue/devtools'
|
|
6555
|
+
devtools.connect(${(_b = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _b.host}, ${(_c = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _c.port});` : "",
|
|
6555
6556
|
(options == null ? void 0 : options.enable) && enableChii ? `(() => {
|
|
6556
6557
|
const script = document.createElement('script');
|
|
6557
6558
|
script.src="http://localhost:${resovedInfo.availablePort}/target.js";
|
|
6558
6559
|
document.body.appendChild(script);
|
|
6559
6560
|
})()` : "",
|
|
6560
|
-
|
|
6561
|
+
"/* eslint-enable */",
|
|
6562
|
+
`${_source};`
|
|
6561
6563
|
];
|
|
6562
6564
|
return {
|
|
6563
6565
|
code: codes.join("\n"),
|
|
@@ -6687,6 +6689,34 @@ var unpluginFactory = (options) => {
|
|
|
6687
6689
|
if (options == null ? void 0 : options.corpId) {
|
|
6688
6690
|
resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
6689
6691
|
}
|
|
6692
|
+
},
|
|
6693
|
+
async rspack(compiler) {
|
|
6694
|
+
var _a4, _b, _c, _d2, _e;
|
|
6695
|
+
if (!(options == null ? void 0 : options.enable)) {
|
|
6696
|
+
return;
|
|
6697
|
+
}
|
|
6698
|
+
const devServerOptions = __spreadValues(__spreadValues({
|
|
6699
|
+
host: "localhost",
|
|
6700
|
+
port: 8080
|
|
6701
|
+
}, compiler.options.devServer), (_c = (_b = await ((_a4 = await import("@rsbuild/core")) == null ? void 0 : _a4.loadConfig({
|
|
6702
|
+
cwd
|
|
6703
|
+
}))) == null ? void 0 : _b.content) == null ? void 0 : _c.server);
|
|
6704
|
+
const source = `${devServerOptions.host === "0.0.0.0" ? "127.0.0.1" : devServerOptions.host}:${devServerOptions.port}`;
|
|
6705
|
+
const base = compiler.options.output.publicPath || "/";
|
|
6706
|
+
const _targetUrl = (_d2 = options == null ? void 0 : options.targetUrl) != null ? _d2 : `http://${source}${base}`;
|
|
6707
|
+
resovedInfo.targetURL = new URL(_targetUrl);
|
|
6708
|
+
resovedInfo.targetURL.searchParams.append("ddtab", "true");
|
|
6709
|
+
if (options == null ? void 0 : options.corpId) {
|
|
6710
|
+
resovedInfo.targetURL.searchParams.append("corpId", options.corpId);
|
|
6711
|
+
}
|
|
6712
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold(
|
|
6713
|
+
`Open in dingtalk${((_e = options == null ? void 0 : options.vueDevtools) == null ? void 0 : _e.enable) ? " (with vue-devtools)" : ""}`
|
|
6714
|
+
)}: ${colorUrl(`http://${source}${base}open-dingtalk`)}`);
|
|
6715
|
+
if (enableChii) {
|
|
6716
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold(
|
|
6717
|
+
"Click to open chrome devtools"
|
|
6718
|
+
)}: ${colorUrl(`http://${source}${base}__chrome_devtools`)}`);
|
|
6719
|
+
}
|
|
6690
6720
|
}
|
|
6691
6721
|
};
|
|
6692
6722
|
return unpluginDing;
|
package/dist/rollup.d.cts
CHANGED
package/dist/rollup.d.ts
CHANGED