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.
Files changed (67) hide show
  1. package/dist/{chunk-2YQKM4BX.js → __chrome_devtools-CIQ5zFZx.js} +11 -12
  2. package/dist/__chrome_devtools-CJ3sXpVj.cjs +95 -0
  3. package/dist/__chrome_devtools.cjs +2 -114
  4. package/dist/__chrome_devtools.d.cts +3 -2
  5. package/dist/__chrome_devtools.d.ts +3 -2
  6. package/dist/__chrome_devtools.js +3 -7
  7. package/dist/astro.cjs +12 -676
  8. package/dist/astro.d.cts +7 -10
  9. package/dist/astro.d.ts +8 -10
  10. package/dist/astro.js +12 -17
  11. package/dist/chunk-CUT6urMc.cjs +30 -0
  12. package/dist/esbuild.cjs +9 -667
  13. package/dist/esbuild.d.cts +5 -8
  14. package/dist/esbuild.d.ts +6 -8
  15. package/dist/esbuild.js +8 -10
  16. package/dist/index.cjs +10 -676
  17. package/dist/index.d.cts +11 -13
  18. package/dist/index.d.ts +11 -13
  19. package/dist/index.js +5 -16
  20. package/dist/inject-script.cjs +15 -0
  21. package/dist/inject-script.d.cts +3 -0
  22. package/dist/inject-script.d.ts +4 -0
  23. package/dist/inject-script.js +14 -0
  24. package/dist/main-BvTybYko.js +99 -0
  25. package/dist/main-DQgEHuwp.cjs +101 -0
  26. package/dist/nuxt.cjs +80 -842
  27. package/dist/nuxt.d.cts +7 -10
  28. package/dist/nuxt.d.ts +7 -10
  29. package/dist/nuxt.js +78 -24
  30. package/dist/rollup.cjs +9 -667
  31. package/dist/rollup.d.cts +5 -8
  32. package/dist/rollup.d.ts +6 -8
  33. package/dist/rollup.js +8 -10
  34. package/dist/rspack.cjs +54 -728
  35. package/dist/rspack.d.cts +5 -8
  36. package/dist/rspack.d.ts +6 -8
  37. package/dist/rspack.js +50 -74
  38. package/dist/src-CXHMJspk.cjs +393 -0
  39. package/dist/src-DJcUe9oP.js +363 -0
  40. package/dist/types-D6mfGNG_.d.ts +38 -0
  41. package/dist/types-DodDHiEA.d.cts +38 -0
  42. package/dist/types.cjs +0 -19
  43. package/dist/types.d.cts +2 -38
  44. package/dist/types.d.ts +2 -38
  45. package/dist/types.js +1 -0
  46. package/dist/utils-Chlbb6jf.js +23 -0
  47. package/dist/utils-CmfBxo4J.cjs +41 -0
  48. package/dist/utils.cjs +4 -33
  49. package/dist/utils.d.cts +6 -3
  50. package/dist/utils.d.ts +6 -3
  51. package/dist/utils.js +3 -7
  52. package/dist/vite-qeAmx9J4.js +18 -0
  53. package/dist/vite-ytxVicjL.cjs +24 -0
  54. package/dist/vite.cjs +5 -824
  55. package/dist/vite.d.cts +4 -7
  56. package/dist/vite.d.ts +5 -7
  57. package/dist/vite.js +6 -10
  58. package/dist/webpack.cjs +52 -722
  59. package/dist/webpack.d.cts +5 -8
  60. package/dist/webpack.d.ts +6 -8
  61. package/dist/webpack.js +48 -68
  62. package/package.json +13 -11
  63. package/dist/chunk-5JBD5THX.js +0 -20
  64. package/dist/chunk-EG2ZYJ3S.js +0 -542
  65. package/dist/chunk-KQOHODTC.js +0 -9
  66. package/dist/chunk-LMNMIIAV.js +0 -26
  67. package/dist/main-Q4R5NCQC.js +0 -129
@@ -1,9 +1,6 @@
1
- import * as webpack from 'webpack';
2
- import { Options, SetupMiddlewares } from './types.cjs';
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
- declare const _default: (options: Options) => readonly [SetupMiddlewares, webpack.WebpackPluginInstance];
8
-
9
- export { _default as default };
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 * as webpack from 'webpack';
2
- import { Options, SetupMiddlewares } from './types.js';
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
- declare const _default: (options: Options) => readonly [SetupMiddlewares, webpack.WebpackPluginInstance];
8
-
9
- export { _default as default };
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
- createProxyMiddleware,
3
- resovedInfo,
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-DJcUe9oP.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
- function debug(...args) {
17
- if (options == null ? void 0 : options.debug) {
18
- console.log(` ${c.yellow("DEBUG")} `, ...args);
19
- }
20
- }
21
- const {
22
- chii
23
- } = options || {};
24
- const enableChii = (chii == null ? void 0 : chii.enable) !== false;
25
- const injectSetupMiddlewares = (middlewares, devServer) => {
26
- if (!(options == null ? void 0 : options.enable)) {
27
- return middlewares;
28
- }
29
- if (options.debugCookies && options.debugCookies.length > 0) {
30
- devServer.app.use((req, res, next) => {
31
- const cookies = cookie.parse(req.headers.cookie || "");
32
- for (const [name, value] of Object.entries(cookies)) {
33
- if (value && options.debugCookies && options.debugCookies.length > 0 && options.debugCookies.includes(name)) {
34
- const serializedCookie = cookie.serialize(name, value, {
35
- httpOnly: false
36
- });
37
- res.setHeader("Set-Cookie", serializedCookie);
38
- }
39
- }
40
- next();
41
- });
42
- }
43
- if (enableChii) {
44
- devServer.app.get("/__chrome_devtools", async (_req, res) => {
45
- try {
46
- res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
47
- res.write(getChromeDevtoolsHtml(resovedInfo.availablePort));
48
- res.end();
49
- } catch (error) {
50
- debug(`${error}`);
51
- res.writeHead(502);
52
- res.end();
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": "1006.0.0",
4
+ "version": "1007.0.1",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/zcf0508/unplugin-dingtalk#readme",
@@ -120,29 +120,32 @@
120
120
  },
121
121
  "dependencies": {
122
122
  "cookie": "^1.0.2",
123
+ "h3": "^1.15.4",
123
124
  "http-proxy": "^1.18.1",
124
125
  "picocolors": "^1.0.1",
125
126
  "unplugin": "2.2.0",
126
- "z-chii": "1.15.5-beta.1"
127
+ "z-chii": "1.15.5-beta.5"
127
128
  },
128
129
  "devDependencies": {
129
- "@antfu/eslint-config": "^2.18.1",
130
+ "@antfu/eslint-config": "^6.0.0",
130
131
  "@nuxt/kit": "^3.8.2",
131
132
  "@nuxt/schema": "^3.8.2",
133
+ "@types/http-proxy": "^1.17.16",
132
134
  "@types/node": "^20.10.3",
133
135
  "@types/proper-lockfile": "^4.1.4",
134
136
  "bumpp": "^9.2.0",
135
137
  "chalk": "^5.3.0",
136
- "eslint": "^8.55.0",
137
- "eslint-plugin-security": "^3.0.0",
138
- "esno": "^4.0.0",
138
+ "eslint": "^9.38.0",
139
+ "eslint-plugin-security": "^3.0.1",
139
140
  "fast-glob": "^3.3.2",
140
141
  "get-port-please": "^3.1.2",
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
- "tsup": "^8.0.1",
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": "tsup",
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"
@@ -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
- };