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.
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 +459 -825
  27. package/dist/nuxt.d.cts +7 -10
  28. package/dist/nuxt.d.ts +7 -10
  29. package/dist/nuxt.js +474 -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-BVX_Roo9.js +364 -0
  39. package/dist/src-hLDO4Q22.cjs +394 -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-CKIDsKJ-.cjs +24 -0
  53. package/dist/vite-DoBUfGyY.js +18 -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 +12 -10
  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
package/dist/index.d.cts CHANGED
@@ -1,19 +1,17 @@
1
- import * as _unplugin from 'unplugin';
2
- import { UnpluginFactory } from 'unplugin';
3
- import { Connect } from 'vite';
4
- import { Options } from './types.cjs';
5
- import 'webpack-dev-server';
6
- import 'node:http';
7
- import 'vite-plugin-vconsole';
1
+ import { Options } from "./types-DodDHiEA.cjs";
2
+ import * as unplugin0 from "unplugin";
3
+ import { UnpluginFactory } from "unplugin";
4
+ import { Connect } from "vite";
8
5
 
6
+ //#region src/index.d.ts
9
7
  declare const resovedInfo: {
10
- availablePort: number | undefined;
11
- targetURL: undefined | URL;
8
+ availablePort: number | undefined;
9
+ targetURL: undefined | URL;
12
10
  };
13
11
  declare function createProxyMiddleware(debug: typeof console.debug): (resolvedInfo: {
14
- availablePort?: number;
12
+ availablePort?: number;
15
13
  }) => Connect.NextHandleFunction;
16
14
  declare const unpluginFactory: UnpluginFactory<Options | undefined, boolean>;
17
- declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
18
-
19
- export { createProxyMiddleware, unplugin as default, resovedInfo, unplugin, unpluginFactory };
15
+ declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
16
+ //#endregion
17
+ export { createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,17 @@
1
- import * as _unplugin from 'unplugin';
2
- import { UnpluginFactory } from 'unplugin';
3
- import { Connect } from 'vite';
4
- import { Options } from './types.js';
5
- import 'webpack-dev-server';
6
- import 'node:http';
7
- import 'vite-plugin-vconsole';
1
+ import { Options } from "./types-D6mfGNG_.js";
2
+ import * as unplugin0 from "unplugin";
3
+ import { UnpluginFactory } from "unplugin";
4
+ import { Connect } from "vite";
8
5
 
6
+ //#region src/index.d.ts
9
7
  declare const resovedInfo: {
10
- availablePort: number | undefined;
11
- targetURL: undefined | URL;
8
+ availablePort: number | undefined;
9
+ targetURL: undefined | URL;
12
10
  };
13
11
  declare function createProxyMiddleware(debug: typeof console.debug): (resolvedInfo: {
14
- availablePort?: number;
12
+ availablePort?: number;
15
13
  }) => Connect.NextHandleFunction;
16
14
  declare const unpluginFactory: UnpluginFactory<Options | undefined, boolean>;
17
- declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
18
-
19
- export { createProxyMiddleware, unplugin as default, resovedInfo, unplugin, unpluginFactory };
15
+ declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
16
+ //#endregion
17
+ export { createProxyMiddleware, unplugin as default, unplugin, resovedInfo, unpluginFactory };
package/dist/index.js CHANGED
@@ -1,16 +1,5 @@
1
- import {
2
- createProxyMiddleware,
3
- index_default,
4
- resovedInfo,
5
- unplugin,
6
- unpluginFactory
7
- } from "./chunk-EG2ZYJ3S.js";
8
- import "./chunk-2YQKM4BX.js";
9
- import "./chunk-5JBD5THX.js";
10
- export {
11
- createProxyMiddleware,
12
- index_default as default,
13
- resovedInfo,
14
- unplugin,
15
- unpluginFactory
16
- };
1
+ import "./__chrome_devtools-CIQ5zFZx.js";
2
+ import { createProxyMiddleware, resovedInfo, src_default, unplugin, unpluginFactory } from "./src-BVX_Roo9.js";
3
+ import "./utils-Chlbb6jf.js";
4
+
5
+ export { createProxyMiddleware, src_default as default, resovedInfo, unplugin, unpluginFactory };
@@ -0,0 +1,15 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const __imports = require_chunk.__toESM(require("#imports"));
3
+
4
+ //#region src/inject-script.ts
5
+ var inject_script_default = (0, __imports.defineNitroPlugin)((nitroApp) => {
6
+ nitroApp.hooks.hook("render:html", (html) => {
7
+ const config = (0, __imports.useRuntimeConfig)();
8
+ const embedded = config.unpluginDingtalk?.chiiEmbedded ?? false;
9
+ const scriptTag = embedded ? "<script src=\"/__chii_proxy/target.js\" embedded=\"true\"><\/script>" : "<script src=\"/__chii_proxy/target.js\"><\/script>";
10
+ html.bodyAppend.push(scriptTag);
11
+ });
12
+ });
13
+
14
+ //#endregion
15
+ module.exports = inject_script_default;
@@ -0,0 +1,3 @@
1
+ //#region src/inject-script.d.ts
2
+ declare const _default: any;
3
+ export = _default;
@@ -0,0 +1,4 @@
1
+ //#region src/inject-script.d.ts
2
+ declare const _default: any;
3
+ //#endregion
4
+ export { _default as default };
@@ -0,0 +1,14 @@
1
+ import { defineNitroPlugin, useRuntimeConfig } from "#imports";
2
+
3
+ //#region src/inject-script.ts
4
+ var inject_script_default = defineNitroPlugin((nitroApp) => {
5
+ nitroApp.hooks.hook("render:html", (html) => {
6
+ const config = useRuntimeConfig();
7
+ const embedded = config.unpluginDingtalk?.chiiEmbedded ?? false;
8
+ const scriptTag = embedded ? "<script src=\"/__chii_proxy/target.js\" embedded=\"true\"><\/script>" : "<script src=\"/__chii_proxy/target.js\"><\/script>";
9
+ html.bodyAppend.push(scriptTag);
10
+ });
11
+ });
12
+
13
+ //#endregion
14
+ export { inject_script_default as default };
@@ -0,0 +1,99 @@
1
+ //#region node_modules/.pnpm/vite-plugin-vconsole@2.1.1/node_modules/vite-plugin-vconsole/dist/main.mjs
2
+ var parseVConsoleOptions = (config) => Object.keys(config).reduce((code, key) => {
3
+ const value = config[key];
4
+ if (typeof value === "function") if (/^[(f]/.test(value.toString())) {
5
+ code += `${key}: ${value},`;
6
+ return code;
7
+ } else {
8
+ code += `${value},`;
9
+ return code;
10
+ }
11
+ code += `${key}: ${JSON.stringify(config[key])},`;
12
+ return code;
13
+ }, "");
14
+ var getEventItems = (event, id) => {
15
+ return event.map((ele) => `
16
+ ${id}.on('${ele.eventName}', ${ele.callback})
17
+ `).join(";");
18
+ };
19
+ var getDynamicConfig = (dynamicConfig) => {
20
+ let configString = "";
21
+ if (!dynamicConfig) return configString;
22
+ for (const key in dynamicConfig) if (typeof dynamicConfig[key] === "string") configString += `${key}: ${dynamicConfig[key]},`;
23
+ return configString;
24
+ };
25
+ var getPlugins = (plugin) => {
26
+ let plugins = "";
27
+ if (plugin && plugin.length) plugins = plugin.map((e) => `
28
+ const ${e.id} = new VConsole.VConsolePlugin('${e.id}', '${e.name}');
29
+ ${getEventItems(e.event, e.id)}
30
+ vConsole.addPlugin(${e.id})
31
+ `).join(";");
32
+ return plugins;
33
+ };
34
+ function viteVConsole(opt) {
35
+ const { entry, enabled = true, config = {}, plugin, customHide = false, dynamicConfig = {}, eventListener = "" } = opt;
36
+ let entryPath = Array.isArray(entry) ? entry : [entry];
37
+ if (process.platform === "win32") entryPath = entryPath.map((item) => item.replace(/\\/g, "/"));
38
+ const enabledTruly = enabled;
39
+ return {
40
+ name: "vite:vconsole",
41
+ enforce: "pre",
42
+ transform(_source, id) {
43
+ if (entryPath.includes(id) && enabledTruly) {
44
+ const code = `/* eslint-disable */;
45
+ import VConsole from 'vconsole';
46
+ // config
47
+ const vConsole = new VConsole({${parseVConsoleOptions(config)}});
48
+ window.vConsole = vConsole;
49
+
50
+ // plugins
51
+ ${getPlugins(plugin)}
52
+
53
+ // dynamic config
54
+ window.vConsole.dynamicFunction = function() {
55
+ if (${getDynamicConfig(dynamicConfig).length > 0}) {
56
+ vConsole.setOption({${getDynamicConfig(dynamicConfig)}});
57
+ }
58
+ };
59
+
60
+ window.vConsole.dynamicChange = {
61
+ value: new Date().getTime()
62
+ };
63
+
64
+ window.vConsole.dynamicFunction();
65
+
66
+ if (${customHide}) {
67
+ vConsole.hideSwitch();
68
+ }
69
+
70
+ // In order to be compatible with old equipment, I used defineProperty. In the future, when proxy covers enough devices, proxy will be used.
71
+ Object.defineProperty(window.vConsole.dynamicChange, 'value', {
72
+ get: function() {
73
+ return this._value;
74
+ },
75
+ set: function(newValue) {
76
+ window.vConsole.dynamicFunction();
77
+ this._value = newValue;
78
+ }
79
+ });
80
+
81
+ // eventListener
82
+ ${eventListener}
83
+ /* eslint-enable */${_source}`;
84
+ return {
85
+ code,
86
+ map: null
87
+ };
88
+ }
89
+ return {
90
+ code: _source,
91
+ map: null
92
+ };
93
+ }
94
+ };
95
+ }
96
+ var main_default = viteVConsole;
97
+
98
+ //#endregion
99
+ export { main_default as default, viteVConsole };
@@ -0,0 +1,101 @@
1
+
2
+ //#region node_modules/.pnpm/vite-plugin-vconsole@2.1.1/node_modules/vite-plugin-vconsole/dist/main.mjs
3
+ var parseVConsoleOptions = (config) => Object.keys(config).reduce((code, key) => {
4
+ const value = config[key];
5
+ if (typeof value === "function") if (/^[(f]/.test(value.toString())) {
6
+ code += `${key}: ${value},`;
7
+ return code;
8
+ } else {
9
+ code += `${value},`;
10
+ return code;
11
+ }
12
+ code += `${key}: ${JSON.stringify(config[key])},`;
13
+ return code;
14
+ }, "");
15
+ var getEventItems = (event, id) => {
16
+ return event.map((ele) => `
17
+ ${id}.on('${ele.eventName}', ${ele.callback})
18
+ `).join(";");
19
+ };
20
+ var getDynamicConfig = (dynamicConfig) => {
21
+ let configString = "";
22
+ if (!dynamicConfig) return configString;
23
+ for (const key in dynamicConfig) if (typeof dynamicConfig[key] === "string") configString += `${key}: ${dynamicConfig[key]},`;
24
+ return configString;
25
+ };
26
+ var getPlugins = (plugin) => {
27
+ let plugins = "";
28
+ if (plugin && plugin.length) plugins = plugin.map((e) => `
29
+ const ${e.id} = new VConsole.VConsolePlugin('${e.id}', '${e.name}');
30
+ ${getEventItems(e.event, e.id)}
31
+ vConsole.addPlugin(${e.id})
32
+ `).join(";");
33
+ return plugins;
34
+ };
35
+ function viteVConsole(opt) {
36
+ const { entry, enabled = true, config = {}, plugin, customHide = false, dynamicConfig = {}, eventListener = "" } = opt;
37
+ let entryPath = Array.isArray(entry) ? entry : [entry];
38
+ if (process.platform === "win32") entryPath = entryPath.map((item) => item.replace(/\\/g, "/"));
39
+ const enabledTruly = enabled;
40
+ return {
41
+ name: "vite:vconsole",
42
+ enforce: "pre",
43
+ transform(_source, id) {
44
+ if (entryPath.includes(id) && enabledTruly) {
45
+ const code = `/* eslint-disable */;
46
+ import VConsole from 'vconsole';
47
+ // config
48
+ const vConsole = new VConsole({${parseVConsoleOptions(config)}});
49
+ window.vConsole = vConsole;
50
+
51
+ // plugins
52
+ ${getPlugins(plugin)}
53
+
54
+ // dynamic config
55
+ window.vConsole.dynamicFunction = function() {
56
+ if (${getDynamicConfig(dynamicConfig).length > 0}) {
57
+ vConsole.setOption({${getDynamicConfig(dynamicConfig)}});
58
+ }
59
+ };
60
+
61
+ window.vConsole.dynamicChange = {
62
+ value: new Date().getTime()
63
+ };
64
+
65
+ window.vConsole.dynamicFunction();
66
+
67
+ if (${customHide}) {
68
+ vConsole.hideSwitch();
69
+ }
70
+
71
+ // In order to be compatible with old equipment, I used defineProperty. In the future, when proxy covers enough devices, proxy will be used.
72
+ Object.defineProperty(window.vConsole.dynamicChange, 'value', {
73
+ get: function() {
74
+ return this._value;
75
+ },
76
+ set: function(newValue) {
77
+ window.vConsole.dynamicFunction();
78
+ this._value = newValue;
79
+ }
80
+ });
81
+
82
+ // eventListener
83
+ ${eventListener}
84
+ /* eslint-enable */${_source}`;
85
+ return {
86
+ code,
87
+ map: null
88
+ };
89
+ }
90
+ return {
91
+ code: _source,
92
+ map: null
93
+ };
94
+ }
95
+ };
96
+ }
97
+ var main_default = viteVConsole;
98
+
99
+ //#endregion
100
+ exports.default = main_default;
101
+ exports.viteVConsole = viteVConsole;