unplugin-dingtalk 1000.0.0 → 1002.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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  - [x] 在钉钉内打开调试链接
9
9
  - [x] 可选注入 [vConsole](https://github.com/Tencent/vConsole) 用于调试 (仅支持 vite )
10
10
  - [x] 可选注入 [chii](https://github.com/liriliri/chii) 用于调试
11
- - [x] 可选打开 [vue-devtools](https://github.com/vuejs/devtools) 用于调试
11
+ - [x] ~~可选打开 [vue-devtools](https://github.com/vuejs/devtools) 用于调试~~ 已移除
12
12
  - [x] 支持调试 `HttpOnly` cookies
13
13
 
14
14
  ![images](https://github.com/zcf0508/unplugin-dingtalk/raw/main/images/Snipaste_2024-05-22_11-25-35.png)
@@ -35,11 +35,6 @@ interface Options {
35
35
  debugCookies?: string[]
36
36
  /** 默认值 `true` */
37
37
  chii?: boolean
38
- vueDevtools?: {
39
- enable?: boolean
40
- host?: string
41
- port?: number
42
- }
43
38
  }
44
39
  ```
45
40
 
package/dist/astro.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-6LTE4RPT.js";
4
4
  import "./chunk-ZEHXGFFH.js";
5
5
 
6
6
  // src/astro.ts
@@ -1306,7 +1306,261 @@ import c from "picocolors";
1306
1306
  import cookie from "cookie";
1307
1307
  import { start } from "z-chii";
1308
1308
  import dns2 from "dns2";
1309
- import { getRandomPort } from "get-port-please";
1309
+
1310
+ // node_modules/.pnpm/get-port-please@3.1.2/node_modules/get-port-please/dist/index.mjs
1311
+ import { createServer } from "node:net";
1312
+ import { networkInterfaces } from "node:os";
1313
+ var unsafePorts = /* @__PURE__ */ new Set([
1314
+ 1,
1315
+ // tcpmux
1316
+ 7,
1317
+ // echo
1318
+ 9,
1319
+ // discard
1320
+ 11,
1321
+ // systat
1322
+ 13,
1323
+ // daytime
1324
+ 15,
1325
+ // netstat
1326
+ 17,
1327
+ // qotd
1328
+ 19,
1329
+ // chargen
1330
+ 20,
1331
+ // ftp data
1332
+ 21,
1333
+ // ftp access
1334
+ 22,
1335
+ // ssh
1336
+ 23,
1337
+ // telnet
1338
+ 25,
1339
+ // smtp
1340
+ 37,
1341
+ // time
1342
+ 42,
1343
+ // name
1344
+ 43,
1345
+ // nicname
1346
+ 53,
1347
+ // domain
1348
+ 69,
1349
+ // tftp
1350
+ 77,
1351
+ // priv-rjs
1352
+ 79,
1353
+ // finger
1354
+ 87,
1355
+ // ttylink
1356
+ 95,
1357
+ // supdup
1358
+ 101,
1359
+ // hostriame
1360
+ 102,
1361
+ // iso-tsap
1362
+ 103,
1363
+ // gppitnp
1364
+ 104,
1365
+ // acr-nema
1366
+ 109,
1367
+ // pop2
1368
+ 110,
1369
+ // pop3
1370
+ 111,
1371
+ // sunrpc
1372
+ 113,
1373
+ // auth
1374
+ 115,
1375
+ // sftp
1376
+ 117,
1377
+ // uucp-path
1378
+ 119,
1379
+ // nntp
1380
+ 123,
1381
+ // NTP
1382
+ 135,
1383
+ // loc-srv /epmap
1384
+ 137,
1385
+ // netbios
1386
+ 139,
1387
+ // netbios
1388
+ 143,
1389
+ // imap2
1390
+ 161,
1391
+ // snmp
1392
+ 179,
1393
+ // BGP
1394
+ 389,
1395
+ // ldap
1396
+ 427,
1397
+ // SLP (Also used by Apple Filing Protocol)
1398
+ 465,
1399
+ // smtp+ssl
1400
+ 512,
1401
+ // print / exec
1402
+ 513,
1403
+ // login
1404
+ 514,
1405
+ // shell
1406
+ 515,
1407
+ // printer
1408
+ 526,
1409
+ // tempo
1410
+ 530,
1411
+ // courier
1412
+ 531,
1413
+ // chat
1414
+ 532,
1415
+ // netnews
1416
+ 540,
1417
+ // uucp
1418
+ 548,
1419
+ // AFP (Apple Filing Protocol)
1420
+ 554,
1421
+ // rtsp
1422
+ 556,
1423
+ // remotefs
1424
+ 563,
1425
+ // nntp+ssl
1426
+ 587,
1427
+ // smtp (rfc6409)
1428
+ 601,
1429
+ // syslog-conn (rfc3195)
1430
+ 636,
1431
+ // ldap+ssl
1432
+ 989,
1433
+ // ftps-data
1434
+ 990,
1435
+ // ftps
1436
+ 993,
1437
+ // ldap+ssl
1438
+ 995,
1439
+ // pop3+ssl
1440
+ 1719,
1441
+ // h323gatestat
1442
+ 1720,
1443
+ // h323hostcall
1444
+ 1723,
1445
+ // pptp
1446
+ 2049,
1447
+ // nfs
1448
+ 3659,
1449
+ // apple-sasl / PasswordServer
1450
+ 4045,
1451
+ // lockd
1452
+ 5060,
1453
+ // sip
1454
+ 5061,
1455
+ // sips
1456
+ 6e3,
1457
+ // X11
1458
+ 6566,
1459
+ // sane-port
1460
+ 6665,
1461
+ // Alternate IRC [Apple addition]
1462
+ 6666,
1463
+ // Alternate IRC [Apple addition]
1464
+ 6667,
1465
+ // Standard IRC [Apple addition]
1466
+ 6668,
1467
+ // Alternate IRC [Apple addition]
1468
+ 6669,
1469
+ // Alternate IRC [Apple addition]
1470
+ 6697,
1471
+ // IRC + TLS
1472
+ 10080
1473
+ // Amanda
1474
+ ]);
1475
+ function isUnsafePort(port) {
1476
+ return unsafePorts.has(port);
1477
+ }
1478
+ function isSafePort(port) {
1479
+ return !isUnsafePort(port);
1480
+ }
1481
+ var __defProp = Object.defineProperty;
1482
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1483
+ var __publicField = (obj, key, value) => {
1484
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1485
+ return value;
1486
+ };
1487
+ var GetPortError = class extends Error {
1488
+ constructor(message, opts) {
1489
+ super(message, opts);
1490
+ this.message = message;
1491
+ __publicField(this, "name", "GetPortError");
1492
+ }
1493
+ };
1494
+ function _log(verbose, message) {
1495
+ if (verbose) {
1496
+ console.log(`[get-port] ${message}`);
1497
+ }
1498
+ }
1499
+ function _tryPort(port, host) {
1500
+ return new Promise((resolve) => {
1501
+ const server = createServer();
1502
+ server.unref();
1503
+ server.on("error", () => {
1504
+ resolve(false);
1505
+ });
1506
+ server.listen({ port, host }, () => {
1507
+ const { port: port2 } = server.address();
1508
+ server.close(() => {
1509
+ resolve(isSafePort(port2) && port2);
1510
+ });
1511
+ });
1512
+ });
1513
+ }
1514
+ function _getLocalHosts(additional) {
1515
+ const hosts = new Set(additional);
1516
+ for (const _interface of Object.values(networkInterfaces())) {
1517
+ for (const config2 of _interface || []) {
1518
+ if (config2.address && !config2.internal && !config2.address.startsWith("fe80::")) {
1519
+ hosts.add(config2.address);
1520
+ }
1521
+ }
1522
+ }
1523
+ return [...hosts];
1524
+ }
1525
+ function _fmtOnHost(hostname) {
1526
+ return hostname ? `on host ${JSON.stringify(hostname)}` : "on any host";
1527
+ }
1528
+ var HOSTNAME_RE = new RegExp("^(?!-)[\\d.:A-Za-z-]{1,63}(?<!-)$");
1529
+ async function getRandomPort(host) {
1530
+ const port = await checkPort(0, host);
1531
+ if (port === false) {
1532
+ throw new GetPortError(`Unable to find a random port ${_fmtOnHost(host)}`);
1533
+ }
1534
+ return port;
1535
+ }
1536
+ async function checkPort(port, host = process.env.HOST, verbose) {
1537
+ if (!host) {
1538
+ host = _getLocalHosts([void 0, "0.0.0.0"]);
1539
+ }
1540
+ if (!Array.isArray(host)) {
1541
+ return _tryPort(port, host);
1542
+ }
1543
+ for (const _host of host) {
1544
+ const _port = await _tryPort(port, _host);
1545
+ if (_port === false) {
1546
+ if (port < 1024 && verbose) {
1547
+ _log(
1548
+ verbose,
1549
+ `Unable to listen to the privileged port ${port} ${_fmtOnHost(
1550
+ _host
1551
+ )}`
1552
+ );
1553
+ }
1554
+ return false;
1555
+ }
1556
+ if (port === 0 && _port !== 0) {
1557
+ port = _port;
1558
+ }
1559
+ }
1560
+ return port;
1561
+ }
1562
+
1563
+ // src/index.ts
1310
1564
  import httpProxy from "http-proxy";
1311
1565
  var cwd = process2.cwd();
1312
1566
  var config;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-6LTE4RPT.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-6LTE4RPT.js";
4
4
  import "./chunk-ZEHXGFFH.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  startDnsServer,
5
5
  unplugin,
6
6
  unpluginFactory
7
- } from "./chunk-W5UIO4ZZ.js";
7
+ } from "./chunk-6LTE4RPT.js";
8
8
  import "./chunk-ZEHXGFFH.js";
9
9
  export {
10
10
  index_default as default,
package/dist/nuxt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-WE6LHUBA.js";
4
- import "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-CTXK6UCW.js";
4
+ import "./chunk-6LTE4RPT.js";
5
5
  import "./chunk-ZEHXGFFH.js";
6
6
 
7
7
  // src/nuxt.ts
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-6LTE4RPT.js";
4
4
  import "./chunk-ZEHXGFFH.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/rspack.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  fetch,
3
3
  resovedInfo,
4
4
  unpluginFactory
5
- } from "./chunk-W5UIO4ZZ.js";
5
+ } from "./chunk-6LTE4RPT.js";
6
6
  import "./chunk-ZEHXGFFH.js";
7
7
 
8
8
  // src/rspack.ts
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-WE6LHUBA.js";
4
- import "./chunk-W5UIO4ZZ.js";
3
+ } from "./chunk-CTXK6UCW.js";
4
+ import "./chunk-6LTE4RPT.js";
5
5
  import "./chunk-ZEHXGFFH.js";
6
6
  export {
7
7
  vite_default as default
package/dist/webpack.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  fetch,
3
3
  resovedInfo,
4
4
  unpluginFactory
5
- } from "./chunk-W5UIO4ZZ.js";
5
+ } from "./chunk-6LTE4RPT.js";
6
6
  import "./chunk-ZEHXGFFH.js";
7
7
 
8
8
  // src/webpack.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-dingtalk",
3
3
  "type": "module",
4
- "version": "1000.0.0",
4
+ "version": "1002.0.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/zcf0508/unplugin-dingtalk#readme",
@@ -20,54 +20,18 @@
20
20
  "transform"
21
21
  ],
22
22
  "exports": {
23
- ".": {
24
- "types": "./dist/index.d.ts",
25
- "import": "./dist/index.js",
26
- "require": "./dist/index.cjs"
27
- },
28
- "./astro": {
29
- "types": "./dist/astro.d.ts",
30
- "import": "./dist/astro.js",
31
- "require": "./dist/astro.cjs"
32
- },
33
- "./rspack": {
34
- "types": "./dist/rspack.d.ts",
35
- "import": "./dist/rspack.js",
36
- "require": "./dist/rspack.cjs"
37
- },
38
- "./vite": {
39
- "types": "./dist/vite.d.ts",
40
- "import": "./dist/vite.js",
41
- "require": "./dist/vite.cjs"
42
- },
43
- "./webpack": {
44
- "types": "./dist/webpack.d.ts",
45
- "import": "./dist/webpack.js",
46
- "require": "./dist/webpack.cjs"
47
- },
48
- "./rollup": {
49
- "types": "./dist/rollup.d.ts",
50
- "import": "./dist/rollup.js",
51
- "require": "./dist/rollup.cjs"
52
- },
53
- "./esbuild": {
54
- "types": "./dist/esbuild.d.ts",
55
- "import": "./dist/esbuild.js",
56
- "require": "./dist/esbuild.cjs"
57
- },
58
- "./nuxt": {
59
- "types": "./dist/nuxt.d.ts",
60
- "import": "./dist/nuxt.js",
61
- "require": "./dist/nuxt.cjs"
62
- },
63
- "./types": {
64
- "types": "./dist/types.d.ts",
65
- "import": "./dist/types.js",
66
- "require": "./dist/types.cjs"
67
- },
23
+ ".": "./dist/index.js",
24
+ "./astro": "./dist/astro.js",
25
+ "./rspack": "./dist/rspack.js",
26
+ "./vite": "./dist/vite.js",
27
+ "./webpack": "./dist/webpack.js",
28
+ "./rollup": "./dist/rollup.js",
29
+ "./esbuild": "./dist/esbuild.js",
30
+ "./nuxt": "./dist/nuxt.js",
31
+ "./types": "./dist/types.js",
68
32
  "./*": "./*"
69
33
  },
70
- "main": "dist/index.cjs",
34
+ "main": "dist/index.js",
71
35
  "module": "dist/index.js",
72
36
  "types": "dist/index.d.ts",
73
37
  "typesVersions": {
@@ -118,11 +82,8 @@
118
82
  }
119
83
  },
120
84
  "dependencies": {
121
- "@antfu/eslint-config": "^2.18.1",
122
85
  "cookie": "^1.0.2",
123
86
  "dns2": "^2.1.0",
124
- "eslint-plugin-security": "^3.0.0",
125
- "get-port-please": "^3.1.2",
126
87
  "http-proxy": "^1.18.1",
127
88
  "picocolors": "^1.0.1",
128
89
  "unplugin": "^1.5.1",
@@ -130,6 +91,7 @@
130
91
  "z-chii": "1.15.5-beta.1"
131
92
  },
132
93
  "devDependencies": {
94
+ "@antfu/eslint-config": "^2.18.1",
133
95
  "@nuxt/kit": "^3.8.2",
134
96
  "@nuxt/schema": "^3.8.2",
135
97
  "@types/dns2": "^2.0.9",
@@ -137,8 +99,9 @@
137
99
  "bumpp": "^9.2.0",
138
100
  "chalk": "^5.3.0",
139
101
  "eslint": "^8.55.0",
140
- "esno": "^4.0.0",
102
+ "eslint-plugin-security": "^3.0.0",
141
103
  "fast-glob": "^3.3.2",
104
+ "get-port-please": "^3.1.2",
142
105
  "node-fetch": "^3.3.2",
143
106
  "nodemon": "^3.0.2",
144
107
  "rimraf": "^5.0.5",
@@ -152,7 +115,6 @@
152
115
  "scripts": {
153
116
  "build": "tsup",
154
117
  "dev": "tsup --watch src",
155
- "build:fix": "esno scripts/postbuild.ts",
156
118
  "lint": "eslint .",
157
119
  "play": "npm -C playground run dev",
158
120
  "release": "bumpp",