@eggjs/mock 6.1.0-beta.9 → 7.0.0-beta.14

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 (104) hide show
  1. package/README.md +1 -1
  2. package/README.zh_CN.md +1 -1
  3. package/dist/_virtual/rolldown_runtime.js +1 -24
  4. package/dist/inject_mocha.d.ts +1 -1
  5. package/dist/inject_mocha.js +2 -3
  6. package/dist/lib/app.js +4 -1
  7. package/dist/lib/context.js +1 -3
  8. package/dist/lib/types.d.ts +4 -0
  9. package/package.json +9 -13
  10. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +0 -142
  11. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +0 -157
  12. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +0 -97
  13. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +0 -40
  14. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +0 -814
  15. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +0 -50
  16. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +0 -68
  17. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +0 -752
  18. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +0 -203
  19. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +0 -209
  20. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +0 -18
  21. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +0 -215
  22. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +0 -24
  23. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +0 -33
  24. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +0 -29
  25. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +0 -185
  26. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +0 -23
  27. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +0 -26
  28. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +0 -83
  29. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +0 -51
  30. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +0 -26
  31. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +0 -151
  32. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +0 -178
  33. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +0 -168
  34. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +0 -301
  35. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +0 -137
  36. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +0 -367
  37. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +0 -91
  38. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +0 -99
  39. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +0 -23
  40. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +0 -30
  41. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +0 -22
  42. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +0 -97
  43. package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +0 -14
  44. package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +0 -16
  45. package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +0 -4093
  46. package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +0 -14
  47. package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +0 -27
  48. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +0 -12
  49. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +0 -83
  50. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +0 -35
  51. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +0 -392
  52. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +0 -86
  53. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +0 -104
  54. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +0 -99
  55. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +0 -65
  56. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +0 -18
  57. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +0 -95
  58. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +0 -105
  59. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +0 -1037
  60. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +0 -24
  61. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +0 -152
  62. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +0 -74
  63. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +0 -22
  64. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +0 -329
  65. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +0 -314
  66. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +0 -22
  67. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +0 -417
  68. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +0 -79
  69. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +0 -75
  70. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +0 -283
  71. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +0 -40
  72. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +0 -90
  73. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +0 -145
  74. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +0 -107
  75. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +0 -77
  76. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +0 -106
  77. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +0 -57
  78. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +0 -233
  79. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +0 -92
  80. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +0 -91
  81. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +0 -261
  82. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +0 -166
  83. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +0 -346
  84. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +0 -922
  85. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +0 -72
  86. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +0 -517
  87. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +0 -105
  88. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +0 -505
  89. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +0 -225
  90. package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -124
  91. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +0 -11
  92. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +0 -114
  93. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +0 -76
  94. package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +0 -89
  95. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +0 -366
  96. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +0 -248
  97. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +0 -419
  98. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +0 -27
  99. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +0 -18
  100. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +0 -16
  101. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +0 -63
  102. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +0 -21
  103. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +0 -9
  104. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +0 -277
package/README.md CHANGED
@@ -16,7 +16,7 @@ Mock library for testing Egg applications, plugins and custom Egg frameworks wit
16
16
  ## Install
17
17
 
18
18
  ```bash
19
- npm i egg-mock --save-dev
19
+ npm i @eggjs/mock --save-dev
20
20
  ```
21
21
 
22
22
  ## Usage
package/README.zh_CN.md CHANGED
@@ -16,7 +16,7 @@
16
16
  ## Install
17
17
 
18
18
  ```bash
19
- npm i egg-mock --save-dev
19
+ npm i @eggjs/mock --save-dev
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -1,30 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
3
  //#region rolldown:runtime
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
5
 
29
6
  //#endregion
30
- export { __commonJS, __require, __toESM };
7
+ export { __require };
@@ -1 +1 @@
1
- export { };
1
+ import "mocha";
@@ -1,11 +1,10 @@
1
- import { __require, __toESM } from "./_virtual/rolldown_runtime.js";
1
+ import { __require } from "./_virtual/rolldown_runtime.js";
2
2
  import { injectContext } from "./lib/inject_context.js";
3
- import { require_mocha } from "./node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js";
4
3
  import { debuglog } from "node:util";
5
4
  import { getRequire } from "@eggjs/utils";
5
+ import "mocha";
6
6
 
7
7
  //#region src/inject_mocha.ts
8
- var import_mocha = /* @__PURE__ */ __toESM(require_mocha(), 1);
9
8
  const debug = debuglog("egg/mock/inject_mocha");
10
9
  /**
11
10
  * Find active node mocha instances.
package/dist/lib/app.js CHANGED
@@ -150,7 +150,10 @@ var MockApplicationWorker = class extends Base {
150
150
  }
151
151
  };
152
152
  function createApp(createOptions) {
153
- const options = formatOptions(createOptions);
153
+ const options = formatOptions({
154
+ ...createOptions,
155
+ mode: "all-in-one-process"
156
+ });
154
157
  debug("[createApp] options: %o", options);
155
158
  if (options.cache && apps.has(options.baseDir)) {
156
159
  const app = apps.get(options.baseDir);
@@ -1,8 +1,6 @@
1
- import { utils } from "@eggjs/core";
2
-
3
1
  //#region src/lib/context.ts
4
2
  const context = { runInBackground(scope) {
5
- const taskName = scope._name || scope.name || utils.getCalleeFromStack(true);
3
+ const taskName = scope._name || scope.name;
6
4
  if (taskName) scope._name = taskName;
7
5
  const promise = this._runInBackground(scope);
8
6
  this.app._backgroundTasks.push(promise);
@@ -3,6 +3,10 @@ import { MockAgent } from "urllib";
3
3
 
4
4
  //#region src/lib/types.d.ts
5
5
  interface MockOptions {
6
+ /**
7
+ * The mode of the application
8
+ */
9
+ mode?: 'all-in-one-process' | 'cluster' | 'single';
6
10
  /**
7
11
  * The directory of the application
8
12
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/mock",
3
- "version": "6.1.0-beta.9",
3
+ "version": "7.0.0-beta.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -63,7 +63,7 @@
63
63
  ],
64
64
  "author": "popomore <sakura9515@gmail.com>",
65
65
  "engines": {
66
- "node": ">= 20.19.0"
66
+ "node": ">=22.18.0"
67
67
  },
68
68
  "dependencies": {
69
69
  "coffee": "5",
@@ -75,15 +75,14 @@
75
75
  "merge-descriptors": "^2.0.0",
76
76
  "mm": "^4.0.2",
77
77
  "sdk-base": "^5.0.1",
78
- "urllib": "^4.6.11",
78
+ "urllib": "^4.8.2",
79
79
  "utility": "^2.5.0",
80
- "@eggjs/core": "6.6.0-beta.9",
81
- "@eggjs/extend2": "4.1.0-beta.9",
82
- "@eggjs/supertest": "8.3.0-beta.9",
83
- "@eggjs/utils": "4.5.0-beta.9"
80
+ "@eggjs/extend2": "5.0.0-beta.14",
81
+ "@eggjs/supertest": "9.0.0-beta.14",
82
+ "@eggjs/utils": "5.0.0-beta.14"
84
83
  },
85
84
  "peerDependencies": {
86
- "egg": "4.1.0-beta.9"
85
+ "egg": "4.1.0-beta.14"
87
86
  },
88
87
  "devDependencies": {
89
88
  "@eggjs/tegg": "^3.2.2",
@@ -91,14 +90,11 @@
91
90
  "@eggjs/tegg-controller-plugin": "^3.2.2",
92
91
  "@eggjs/tegg-plugin": "^3.2.2",
93
92
  "@types/methods": "^1.1.4",
94
- "@types/node": "24.5.2",
95
93
  "egg-errors": "^2.3.2",
96
94
  "egg-tracer": "^2.1.0",
97
- "pedding": "^2.0.1",
98
95
  "tsd": "^0.33.0",
99
- "tsdown": "0.15.3",
100
- "typescript": "5.9.2",
101
- "egg": "4.1.0-beta.9"
96
+ "tsdown": "^0.15.4",
97
+ "typescript": "5.9.2"
102
98
  },
103
99
  "scripts": {
104
100
  "build": "tsdown",
@@ -1,142 +0,0 @@
1
- import { __commonJS } from "../../../../../_virtual/rolldown_runtime.js";
2
- import { require_color_convert } from "../../../color-convert@2.0.1/node_modules/color-convert/index.js";
3
-
4
- //#region ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
5
- var require_ansi_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js": ((exports, module) => {
6
- const wrapAnsi16 = (fn, offset) => (...args) => {
7
- return `\u001B[${fn(...args) + offset}m`;
8
- };
9
- const wrapAnsi256 = (fn, offset) => (...args) => {
10
- const code = fn(...args);
11
- return `\u001B[${38 + offset};5;${code}m`;
12
- };
13
- const wrapAnsi16m = (fn, offset) => (...args) => {
14
- const rgb = fn(...args);
15
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
16
- };
17
- const ansi2ansi = (n) => n;
18
- const rgb2rgb = (r, g, b) => [
19
- r,
20
- g,
21
- b
22
- ];
23
- const setLazyProperty = (object, property, get) => {
24
- Object.defineProperty(object, property, {
25
- get: () => {
26
- const value = get();
27
- Object.defineProperty(object, property, {
28
- value,
29
- enumerable: true,
30
- configurable: true
31
- });
32
- return value;
33
- },
34
- enumerable: true,
35
- configurable: true
36
- });
37
- };
38
- /** @type {typeof import('color-convert')} */
39
- let colorConvert;
40
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
41
- if (colorConvert === void 0) colorConvert = require_color_convert();
42
- const offset = isBackground ? 10 : 0;
43
- const styles = {};
44
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
45
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
46
- if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
47
- else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
48
- }
49
- return styles;
50
- };
51
- function assembleStyles() {
52
- const codes = /* @__PURE__ */ new Map();
53
- const styles = {
54
- modifier: {
55
- reset: [0, 0],
56
- bold: [1, 22],
57
- dim: [2, 22],
58
- italic: [3, 23],
59
- underline: [4, 24],
60
- inverse: [7, 27],
61
- hidden: [8, 28],
62
- strikethrough: [9, 29]
63
- },
64
- color: {
65
- black: [30, 39],
66
- red: [31, 39],
67
- green: [32, 39],
68
- yellow: [33, 39],
69
- blue: [34, 39],
70
- magenta: [35, 39],
71
- cyan: [36, 39],
72
- white: [37, 39],
73
- blackBright: [90, 39],
74
- redBright: [91, 39],
75
- greenBright: [92, 39],
76
- yellowBright: [93, 39],
77
- blueBright: [94, 39],
78
- magentaBright: [95, 39],
79
- cyanBright: [96, 39],
80
- whiteBright: [97, 39]
81
- },
82
- bgColor: {
83
- bgBlack: [40, 49],
84
- bgRed: [41, 49],
85
- bgGreen: [42, 49],
86
- bgYellow: [43, 49],
87
- bgBlue: [44, 49],
88
- bgMagenta: [45, 49],
89
- bgCyan: [46, 49],
90
- bgWhite: [47, 49],
91
- bgBlackBright: [100, 49],
92
- bgRedBright: [101, 49],
93
- bgGreenBright: [102, 49],
94
- bgYellowBright: [103, 49],
95
- bgBlueBright: [104, 49],
96
- bgMagentaBright: [105, 49],
97
- bgCyanBright: [106, 49],
98
- bgWhiteBright: [107, 49]
99
- }
100
- };
101
- styles.color.gray = styles.color.blackBright;
102
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
103
- styles.color.grey = styles.color.blackBright;
104
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
105
- for (const [groupName, group] of Object.entries(styles)) {
106
- for (const [styleName, style] of Object.entries(group)) {
107
- styles[styleName] = {
108
- open: `\u001B[${style[0]}m`,
109
- close: `\u001B[${style[1]}m`
110
- };
111
- group[styleName] = styles[styleName];
112
- codes.set(style[0], style[1]);
113
- }
114
- Object.defineProperty(styles, groupName, {
115
- value: group,
116
- enumerable: false
117
- });
118
- }
119
- Object.defineProperty(styles, "codes", {
120
- value: codes,
121
- enumerable: false
122
- });
123
- styles.color.close = "\x1B[39m";
124
- styles.bgColor.close = "\x1B[49m";
125
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
126
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
127
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
128
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
129
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
130
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
131
- return styles;
132
- }
133
- Object.defineProperty(module, "exports", {
134
- enumerable: true,
135
- get: assembleStyles
136
- });
137
- }) });
138
-
139
- //#endregion
140
- export default require_ansi_styles();
141
-
142
- export { require_ansi_styles };
@@ -1,157 +0,0 @@
1
- import { __commonJS } from "../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_ansi_styles } from "../../../../ansi-styles@4.3.0/node_modules/ansi-styles/index.js";
3
- import { require_supports_color } from "../../../../supports-color@7.2.0/node_modules/supports-color/index.js";
4
- import { require_util } from "./util.js";
5
- import { require_templates } from "./templates.js";
6
-
7
- //#region ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
8
- var require_source = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js": ((exports, module) => {
9
- const ansiStyles = require_ansi_styles();
10
- const { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
11
- const { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
12
- const { isArray } = Array;
13
- const levelMapping = [
14
- "ansi",
15
- "ansi",
16
- "ansi256",
17
- "ansi16m"
18
- ];
19
- const styles = Object.create(null);
20
- const applyOptions = (object, options = {}) => {
21
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
22
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
23
- object.level = options.level === void 0 ? colorLevel : options.level;
24
- };
25
- var ChalkClass = class {
26
- constructor(options) {
27
- return chalkFactory(options);
28
- }
29
- };
30
- const chalkFactory = (options) => {
31
- const chalk$1 = {};
32
- applyOptions(chalk$1, options);
33
- chalk$1.template = (...arguments_) => chalkTag(chalk$1.template, ...arguments_);
34
- Object.setPrototypeOf(chalk$1, Chalk.prototype);
35
- Object.setPrototypeOf(chalk$1.template, chalk$1);
36
- chalk$1.template.constructor = () => {
37
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
38
- };
39
- chalk$1.template.Instance = ChalkClass;
40
- return chalk$1.template;
41
- };
42
- function Chalk(options) {
43
- return chalkFactory(options);
44
- }
45
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
46
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
47
- Object.defineProperty(this, styleName, { value: builder });
48
- return builder;
49
- } };
50
- styles.visible = { get() {
51
- const builder = createBuilder(this, this._styler, true);
52
- Object.defineProperty(this, "visible", { value: builder });
53
- return builder;
54
- } };
55
- const usedModels = [
56
- "rgb",
57
- "hex",
58
- "keyword",
59
- "hsl",
60
- "hsv",
61
- "hwb",
62
- "ansi",
63
- "ansi256"
64
- ];
65
- for (const model of usedModels) styles[model] = { get() {
66
- const { level } = this;
67
- return function(...arguments_) {
68
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
69
- return createBuilder(this, styler, this._isEmpty);
70
- };
71
- } };
72
- for (const model of usedModels) {
73
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
74
- styles[bgModel] = { get() {
75
- const { level } = this;
76
- return function(...arguments_) {
77
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
78
- return createBuilder(this, styler, this._isEmpty);
79
- };
80
- } };
81
- }
82
- const proto = Object.defineProperties(() => {}, {
83
- ...styles,
84
- level: {
85
- enumerable: true,
86
- get() {
87
- return this._generator.level;
88
- },
89
- set(level) {
90
- this._generator.level = level;
91
- }
92
- }
93
- });
94
- const createStyler = (open, close, parent) => {
95
- let openAll;
96
- let closeAll;
97
- if (parent === void 0) {
98
- openAll = open;
99
- closeAll = close;
100
- } else {
101
- openAll = parent.openAll + open;
102
- closeAll = close + parent.closeAll;
103
- }
104
- return {
105
- open,
106
- close,
107
- openAll,
108
- closeAll,
109
- parent
110
- };
111
- };
112
- const createBuilder = (self, _styler, _isEmpty) => {
113
- const builder = (...arguments_) => {
114
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
115
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
116
- };
117
- Object.setPrototypeOf(builder, proto);
118
- builder._generator = self;
119
- builder._styler = _styler;
120
- builder._isEmpty = _isEmpty;
121
- return builder;
122
- };
123
- const applyStyle = (self, string) => {
124
- if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
125
- let styler = self._styler;
126
- if (styler === void 0) return string;
127
- const { openAll, closeAll } = styler;
128
- if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
129
- string = stringReplaceAll(string, styler.close, styler.open);
130
- styler = styler.parent;
131
- }
132
- const lfIndex = string.indexOf("\n");
133
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
134
- return openAll + string + closeAll;
135
- };
136
- let template;
137
- const chalkTag = (chalk$1, ...strings) => {
138
- const [firstString] = strings;
139
- if (!isArray(firstString) || !isArray(firstString.raw)) return strings.join(" ");
140
- const arguments_ = strings.slice(1);
141
- const parts = [firstString.raw[0]];
142
- for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
143
- if (template === void 0) template = require_templates();
144
- return template(chalk$1, parts.join(""));
145
- };
146
- Object.defineProperties(Chalk.prototype, styles);
147
- const chalk = Chalk();
148
- chalk.supportsColor = stdoutColor;
149
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
150
- chalk.stderr.supportsColor = stderrColor;
151
- module.exports = chalk;
152
- }) });
153
-
154
- //#endregion
155
- export default require_source();
156
-
157
- export { require_source };
@@ -1,97 +0,0 @@
1
- import { __commonJS } from "../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
4
- var require_templates = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js": ((exports, module) => {
5
- const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
6
- const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
7
- const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
8
- const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
9
- const ESCAPES = new Map([
10
- ["n", "\n"],
11
- ["r", "\r"],
12
- ["t", " "],
13
- ["b", "\b"],
14
- ["f", "\f"],
15
- ["v", "\v"],
16
- ["0", "\0"],
17
- ["\\", "\\"],
18
- ["e", "\x1B"],
19
- ["a", "\x07"]
20
- ]);
21
- function unescape(c) {
22
- const u = c[0] === "u";
23
- const bracket = c[1] === "{";
24
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
25
- if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
26
- return ESCAPES.get(c) || c;
27
- }
28
- function parseArguments(name, arguments_) {
29
- const results = [];
30
- const chunks = arguments_.trim().split(/\s*,\s*/g);
31
- let matches;
32
- for (const chunk of chunks) {
33
- const number = Number(chunk);
34
- if (!Number.isNaN(number)) results.push(number);
35
- else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
36
- else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
37
- }
38
- return results;
39
- }
40
- function parseStyle(style) {
41
- STYLE_REGEX.lastIndex = 0;
42
- const results = [];
43
- let matches;
44
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
45
- const name = matches[1];
46
- if (matches[2]) {
47
- const args = parseArguments(name, matches[2]);
48
- results.push([name].concat(args));
49
- } else results.push([name]);
50
- }
51
- return results;
52
- }
53
- function buildStyle(chalk, styles) {
54
- const enabled = {};
55
- for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
56
- let current = chalk;
57
- for (const [styleName, styles$1] of Object.entries(enabled)) {
58
- if (!Array.isArray(styles$1)) continue;
59
- if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
60
- current = styles$1.length > 0 ? current[styleName](...styles$1) : current[styleName];
61
- }
62
- return current;
63
- }
64
- module.exports = (chalk, temporary) => {
65
- const styles = [];
66
- const chunks = [];
67
- let chunk = [];
68
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
69
- if (escapeCharacter) chunk.push(unescape(escapeCharacter));
70
- else if (style) {
71
- const string = chunk.join("");
72
- chunk = [];
73
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
74
- styles.push({
75
- inverse,
76
- styles: parseStyle(style)
77
- });
78
- } else if (close) {
79
- if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
80
- chunks.push(buildStyle(chalk, styles)(chunk.join("")));
81
- chunk = [];
82
- styles.pop();
83
- } else chunk.push(character);
84
- });
85
- chunks.push(chunk.join(""));
86
- if (styles.length > 0) {
87
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
88
- throw new Error(errMessage);
89
- }
90
- return chunks.join("");
91
- };
92
- }) });
93
-
94
- //#endregion
95
- export default require_templates();
96
-
97
- export { require_templates };
@@ -1,40 +0,0 @@
1
- import { __commonJS } from "../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
4
- var require_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js": ((exports, module) => {
5
- const stringReplaceAll = (string, substring, replacer) => {
6
- let index = string.indexOf(substring);
7
- if (index === -1) return string;
8
- const substringLength = substring.length;
9
- let endIndex = 0;
10
- let returnValue = "";
11
- do {
12
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
13
- endIndex = index + substringLength;
14
- index = string.indexOf(substring, endIndex);
15
- } while (index !== -1);
16
- returnValue += string.substr(endIndex);
17
- return returnValue;
18
- };
19
- const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
20
- let endIndex = 0;
21
- let returnValue = "";
22
- do {
23
- const gotCR = string[index - 1] === "\r";
24
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
25
- endIndex = index + 1;
26
- index = string.indexOf("\n", endIndex);
27
- } while (index !== -1);
28
- returnValue += string.substr(endIndex);
29
- return returnValue;
30
- };
31
- module.exports = {
32
- stringReplaceAll,
33
- stringEncaseCRLFWithFirstIndex
34
- };
35
- }) });
36
-
37
- //#endregion
38
- export default require_util();
39
-
40
- export { require_util };