unplugin-dingtalk 1006.0.0 → 1007.0.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/{chunk-2YQKM4BX.js → __chrome_devtools-CIQ5zFZx.js} +11 -12
- package/dist/__chrome_devtools-CJ3sXpVj.cjs +95 -0
- package/dist/__chrome_devtools.cjs +2 -114
- package/dist/__chrome_devtools.d.cts +3 -2
- package/dist/__chrome_devtools.d.ts +3 -2
- package/dist/__chrome_devtools.js +3 -7
- package/dist/astro.cjs +12 -676
- package/dist/astro.d.cts +7 -10
- package/dist/astro.d.ts +8 -10
- package/dist/astro.js +12 -17
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/esbuild.cjs +9 -667
- package/dist/esbuild.d.cts +5 -8
- package/dist/esbuild.d.ts +6 -8
- package/dist/esbuild.js +8 -10
- package/dist/index.cjs +10 -676
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +5 -16
- package/dist/inject-script.cjs +15 -0
- package/dist/inject-script.d.cts +3 -0
- package/dist/inject-script.d.ts +4 -0
- package/dist/inject-script.js +14 -0
- package/dist/main-BvTybYko.js +99 -0
- package/dist/main-DQgEHuwp.cjs +101 -0
- package/dist/nuxt.cjs +80 -842
- package/dist/nuxt.d.cts +7 -10
- package/dist/nuxt.d.ts +7 -10
- package/dist/nuxt.js +78 -24
- package/dist/rollup.cjs +9 -667
- package/dist/rollup.d.cts +5 -8
- package/dist/rollup.d.ts +6 -8
- package/dist/rollup.js +8 -10
- package/dist/rspack.cjs +54 -728
- package/dist/rspack.d.cts +5 -8
- package/dist/rspack.d.ts +6 -8
- package/dist/rspack.js +50 -74
- package/dist/src-CXHMJspk.cjs +393 -0
- package/dist/src-DJcUe9oP.js +363 -0
- package/dist/types-D6mfGNG_.d.ts +38 -0
- package/dist/types-DodDHiEA.d.cts +38 -0
- package/dist/types.cjs +0 -19
- package/dist/types.d.cts +2 -38
- package/dist/types.d.ts +2 -38
- package/dist/types.js +1 -0
- package/dist/utils-Chlbb6jf.js +23 -0
- package/dist/utils-CmfBxo4J.cjs +41 -0
- package/dist/utils.cjs +4 -33
- package/dist/utils.d.cts +6 -3
- package/dist/utils.d.ts +6 -3
- package/dist/utils.js +3 -7
- package/dist/vite-qeAmx9J4.js +18 -0
- package/dist/vite-ytxVicjL.cjs +24 -0
- package/dist/vite.cjs +5 -824
- package/dist/vite.d.cts +4 -7
- package/dist/vite.d.ts +5 -7
- package/dist/vite.js +6 -10
- package/dist/webpack.cjs +52 -722
- package/dist/webpack.d.cts +5 -8
- package/dist/webpack.d.ts +6 -8
- package/dist/webpack.js +48 -68
- package/package.json +13 -11
- package/dist/chunk-5JBD5THX.js +0 -20
- package/dist/chunk-EG2ZYJ3S.js +0 -542
- package/dist/chunk-KQOHODTC.js +0 -9
- package/dist/chunk-LMNMIIAV.js +0 -26
- package/dist/main-Q4R5NCQC.js +0 -129
package/dist/nuxt.d.cts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'webpack-dev-server';
|
|
4
|
-
import 'node:http';
|
|
5
|
-
import 'vite-plugin-vconsole';
|
|
1
|
+
import { Options } from "./types-DodDHiEA.cjs";
|
|
2
|
+
import * as _nuxt_schema0 from "@nuxt/schema";
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare const _default:
|
|
10
|
-
|
|
11
|
-
export {
|
|
4
|
+
//#region src/nuxt.d.ts
|
|
5
|
+
interface ModuleOptions extends Options {}
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModuleOptions, _default as default };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'webpack-dev-server';
|
|
4
|
-
import 'node:http';
|
|
5
|
-
import 'vite-plugin-vconsole';
|
|
1
|
+
import { Options } from "./types-D6mfGNG_.js";
|
|
2
|
+
import * as _nuxt_schema0 from "@nuxt/schema";
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare const _default:
|
|
10
|
-
|
|
11
|
-
export {
|
|
4
|
+
//#region src/nuxt.d.ts
|
|
5
|
+
interface ModuleOptions extends Options {}
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModuleOptions, _default as default };
|
package/dist/nuxt.js
CHANGED
|
@@ -1,27 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
4
|
-
import "./
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
|
|
9
|
-
// src/nuxt.ts
|
|
10
|
-
import { addVitePlugin, defineNuxtModule } from "@nuxt/kit";
|
|
1
|
+
import "./__chrome_devtools-CIQ5zFZx.js";
|
|
2
|
+
import { resovedInfo } from "./src-DJcUe9oP.js";
|
|
3
|
+
import { colorUrl, interopDefault } from "./utils-Chlbb6jf.js";
|
|
4
|
+
import { vite_default } from "./vite-qeAmx9J4.js";
|
|
5
|
+
import httpProxy from "http-proxy";
|
|
6
|
+
import c from "picocolors";
|
|
7
|
+
import { addDevServerHandler, addServerPlugin, addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
11
8
|
import "@nuxt/schema";
|
|
9
|
+
|
|
10
|
+
//#region src/nuxt.ts
|
|
12
11
|
var nuxt_default = defineNuxtModule({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
12
|
+
meta: {
|
|
13
|
+
name: "nuxt-unplugin-dingtalk",
|
|
14
|
+
configKey: "unpluginDingtalk"
|
|
15
|
+
},
|
|
16
|
+
defaults: {},
|
|
17
|
+
async setup(options, _nuxt) {
|
|
18
|
+
if (!_nuxt.options.dev) return;
|
|
19
|
+
if (!options.enable) return;
|
|
20
|
+
const { defineEventHandler, proxyRequest } = await interopDefault(await import("h3"));
|
|
21
|
+
function debug(...args) {
|
|
22
|
+
if (options?.debug) console.log(` ${c.yellow("DEBUG")} `, ...args);
|
|
23
|
+
}
|
|
24
|
+
const { chii } = options || {};
|
|
25
|
+
const enableChii = chii?.enable !== false;
|
|
26
|
+
_nuxt.options.runtimeConfig.unpluginDingtalk = { chiiEmbedded: chii?.embedded ?? false };
|
|
27
|
+
if (enableChii) {
|
|
28
|
+
const resolver = createResolver(import.meta.url);
|
|
29
|
+
addServerPlugin(resolver.resolve("./inject-script"));
|
|
30
|
+
let proxy = null;
|
|
31
|
+
addDevServerHandler({
|
|
32
|
+
route: "/__chii_proxy",
|
|
33
|
+
handler: defineEventHandler(async (event) => {
|
|
34
|
+
if (resovedInfo.availablePort) return proxyRequest(event, `http://localhost:${resovedInfo.availablePort}${event.path}`);
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
_nuxt.hook("listen", (server) => {
|
|
38
|
+
const originalUpgradeListeners = server.listeners("upgrade").slice();
|
|
39
|
+
server.removeAllListeners("upgrade");
|
|
40
|
+
server.on("upgrade", (req, socket, head) => {
|
|
41
|
+
if (req.url?.startsWith("/__chii_proxy")) {
|
|
42
|
+
debug("WS upgrade:", req.url);
|
|
43
|
+
if (!proxy && resovedInfo.availablePort) {
|
|
44
|
+
proxy = httpProxy.createProxyServer({
|
|
45
|
+
target: `http://localhost:${resovedInfo.availablePort}`,
|
|
46
|
+
ws: true
|
|
47
|
+
});
|
|
48
|
+
proxy.on("error", (err) => {
|
|
49
|
+
debug("Proxy error:", err.message);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (proxy) {
|
|
53
|
+
req.url = req.url.replace("/__chii_proxy", "");
|
|
54
|
+
socket.on("error", (err) => {
|
|
55
|
+
debug("Socket error:", err.message);
|
|
56
|
+
});
|
|
57
|
+
try {
|
|
58
|
+
proxy.ws(req, socket, head);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
debug("WS upgrade failed:", err.message);
|
|
61
|
+
socket.destroy();
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const listener of originalUpgradeListeners) listener.call(server, req, socket, head);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const vitePlugins = await vite_default(options);
|
|
71
|
+
addVitePlugin(vitePlugins);
|
|
72
|
+
_nuxt.hook("listen", (_, listener) => {
|
|
73
|
+
const url = listener.url;
|
|
74
|
+
const source = new URL(url).host;
|
|
75
|
+
if (enableChii) console.log(` ${c.green("➜")} ${c.bold("Click to open chrome devtools")}: ${colorUrl(`http://${source.replace("0.0.0.0", "localhost")}/__chrome_devtools`)}`);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
24
78
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { nuxt_default as default };
|