unplugin-dingtalk 1006.0.0 → 1007.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/{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 +459 -825
- package/dist/nuxt.d.cts +7 -10
- package/dist/nuxt.d.ts +7 -10
- package/dist/nuxt.js +474 -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-BVX_Roo9.js +364 -0
- package/dist/src-hLDO4Q22.cjs +394 -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-CKIDsKJ-.cjs +24 -0
- package/dist/vite-DoBUfGyY.js +18 -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 +12 -10
- 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/webpack.d.cts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'webpack-dev-server';
|
|
4
|
-
import 'node:http';
|
|
5
|
-
import 'vite-plugin-vconsole';
|
|
1
|
+
import { Options, SetupMiddlewares } from "./types-DodDHiEA.cjs";
|
|
2
|
+
import * as webpack0 from "webpack";
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
4
|
+
//#region src/webpack.d.ts
|
|
5
|
+
declare const _default: (options: Options) => readonly [SetupMiddlewares, webpack0.WebpackPluginInstance];
|
|
6
|
+
export = _default;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'webpack-dev-server';
|
|
4
|
-
import 'node:http';
|
|
5
|
-
import 'vite-plugin-vconsole';
|
|
1
|
+
import { Options, SetupMiddlewares } from "./types-D6mfGNG_.js";
|
|
2
|
+
import * as webpack0 from "webpack";
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
//#region src/webpack.d.ts
|
|
5
|
+
declare const _default: (options: Options) => readonly [SetupMiddlewares, webpack0.WebpackPluginInstance];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/webpack.js
CHANGED
|
@@ -1,72 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
unpluginFactory
|
|
5
|
-
} from "./chunk-EG2ZYJ3S.js";
|
|
6
|
-
import {
|
|
7
|
-
getChromeDevtoolsHtml
|
|
8
|
-
} from "./chunk-2YQKM4BX.js";
|
|
9
|
-
import "./chunk-5JBD5THX.js";
|
|
10
|
-
|
|
11
|
-
// src/webpack.ts
|
|
12
|
-
import { createWebpackPlugin } from "unplugin";
|
|
1
|
+
import { getChromeDevtoolsHtml } from "./__chrome_devtools-CIQ5zFZx.js";
|
|
2
|
+
import { createProxyMiddleware, resovedInfo, unpluginFactory } from "./src-BVX_Roo9.js";
|
|
3
|
+
import "./utils-Chlbb6jf.js";
|
|
13
4
|
import cookie from "cookie";
|
|
14
5
|
import c from "picocolors";
|
|
6
|
+
import { createWebpackPlugin } from "unplugin";
|
|
7
|
+
|
|
8
|
+
//#region src/webpack.ts
|
|
15
9
|
var webpack_default = (options) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const proxyMiddleware = createProxyMiddleware(debug);
|
|
56
|
-
devServer.app.use(proxyMiddleware(resovedInfo));
|
|
57
|
-
}
|
|
58
|
-
devServer.app.get("/open-dingtalk", (req, res) => {
|
|
59
|
-
const targetURL = resovedInfo.targetURL;
|
|
60
|
-
debug(targetURL.toString());
|
|
61
|
-
res.writeHead(302, {
|
|
62
|
-
Location: `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(targetURL.toString())}`
|
|
63
|
-
});
|
|
64
|
-
res.end();
|
|
65
|
-
});
|
|
66
|
-
return middlewares;
|
|
67
|
-
};
|
|
68
|
-
return [injectSetupMiddlewares, createWebpackPlugin(unpluginFactory)(options)];
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
webpack_default as default
|
|
10
|
+
function debug(...args) {
|
|
11
|
+
if (options?.debug) console.log(` ${c.yellow("DEBUG")} `, ...args);
|
|
12
|
+
}
|
|
13
|
+
const { chii } = options || {};
|
|
14
|
+
const enableChii = chii?.enable !== false;
|
|
15
|
+
const injectSetupMiddlewares = (middlewares, devServer) => {
|
|
16
|
+
if (!options?.enable) return middlewares;
|
|
17
|
+
if (options.debugCookies && options.debugCookies.length > 0) devServer.app.use((req, res, next) => {
|
|
18
|
+
const cookies = cookie.parse(req.headers.cookie || "");
|
|
19
|
+
for (const [name, value] of Object.entries(cookies)) if (value && options.debugCookies && options.debugCookies.length > 0 && options.debugCookies.includes(name)) {
|
|
20
|
+
const serializedCookie = cookie.serialize(name, value, { httpOnly: false });
|
|
21
|
+
res.setHeader("Set-Cookie", serializedCookie);
|
|
22
|
+
}
|
|
23
|
+
next();
|
|
24
|
+
});
|
|
25
|
+
if (enableChii) {
|
|
26
|
+
devServer.app.get("/__chrome_devtools", async (_req, res) => {
|
|
27
|
+
try {
|
|
28
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
29
|
+
res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
|
|
30
|
+
res.end();
|
|
31
|
+
} catch (error) {
|
|
32
|
+
debug(`${error}`);
|
|
33
|
+
res.writeHead(502);
|
|
34
|
+
res.end();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const proxyMiddleware = createProxyMiddleware(debug);
|
|
38
|
+
devServer.app.use(proxyMiddleware(resovedInfo));
|
|
39
|
+
}
|
|
40
|
+
devServer.app.get("/open-dingtalk", (req, res) => {
|
|
41
|
+
const targetURL = resovedInfo.targetURL;
|
|
42
|
+
debug(targetURL.toString());
|
|
43
|
+
res.writeHead(302, { Location: `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(targetURL.toString())}` });
|
|
44
|
+
res.end();
|
|
45
|
+
});
|
|
46
|
+
return middlewares;
|
|
47
|
+
};
|
|
48
|
+
return [injectSetupMiddlewares, createWebpackPlugin(unpluginFactory)(options)];
|
|
72
49
|
};
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { webpack_default as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-dingtalk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1007.0.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/zcf0508/unplugin-dingtalk#readme",
|
|
@@ -126,23 +126,26 @@
|
|
|
126
126
|
"z-chii": "1.15.5-beta.1"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@antfu/eslint-config": "^
|
|
129
|
+
"@antfu/eslint-config": "^6.0.0",
|
|
130
130
|
"@nuxt/kit": "^3.8.2",
|
|
131
131
|
"@nuxt/schema": "^3.8.2",
|
|
132
|
+
"@types/http-proxy": "^1.17.16",
|
|
132
133
|
"@types/node": "^20.10.3",
|
|
133
134
|
"@types/proper-lockfile": "^4.1.4",
|
|
134
135
|
"bumpp": "^9.2.0",
|
|
135
136
|
"chalk": "^5.3.0",
|
|
136
|
-
"eslint": "^
|
|
137
|
-
"eslint-plugin-security": "^3.0.
|
|
138
|
-
"esno": "^4.0.0",
|
|
137
|
+
"eslint": "^9.38.0",
|
|
138
|
+
"eslint-plugin-security": "^3.0.1",
|
|
139
139
|
"fast-glob": "^3.3.2",
|
|
140
140
|
"get-port-please": "^3.1.2",
|
|
141
|
+
"h3": "^1.15.4",
|
|
141
142
|
"nodemon": "^3.0.2",
|
|
142
143
|
"proper-lockfile": "^4.1.2",
|
|
143
144
|
"rimraf": "^5.0.5",
|
|
145
|
+
"rolldown": "1.0.0-beta.34",
|
|
144
146
|
"rollup": "^4.6.1",
|
|
145
|
-
"
|
|
147
|
+
"tsdown": "0.14.2",
|
|
148
|
+
"typescript": "~5.7.3",
|
|
146
149
|
"vite": "^5.0.4",
|
|
147
150
|
"vite-plugin-vconsole": "^2.1.1",
|
|
148
151
|
"vitest": "^1.6.0",
|
|
@@ -150,11 +153,10 @@
|
|
|
150
153
|
"webpack-dev-server": "^5.0.4"
|
|
151
154
|
},
|
|
152
155
|
"scripts": {
|
|
153
|
-
"build": "
|
|
154
|
-
"dev": "tsup --watch src",
|
|
155
|
-
"build:fix": "esno scripts/postbuild.ts",
|
|
156
|
+
"build": "tsdown",
|
|
156
157
|
"lint": "eslint .",
|
|
157
|
-
"play": "npm -C playground run dev",
|
|
158
|
+
"play": "npm -C playground/vite run dev",
|
|
159
|
+
"play:nuxt": "npm -C playground/nuxt run dev",
|
|
158
160
|
"release": "bumpp",
|
|
159
161
|
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
160
162
|
"test": "vitest"
|
package/dist/chunk-5JBD5THX.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
__spreadValues
|
|
20
|
-
};
|