@prisma/migrate 6.6.0-dev.1 → 6.6.0-dev.100

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 (169) hide show
  1. package/dist/CLI.js +3 -3
  2. package/dist/Migrate.js +9 -7
  3. package/dist/SchemaEngine.js +0 -28
  4. package/dist/{chunk-RM5LJIEV.js → SchemaEngineCLI.js} +10 -16
  5. package/dist/{utils/getSchemaPathAndPrint.js → SchemaEngineWasm.js} +8 -8
  6. package/dist/bin.js +52 -53
  7. package/dist/chunk-23DZXSTI.js +62 -0
  8. package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
  9. package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
  10. package/dist/chunk-33LPBNDX.js +1399 -0
  11. package/dist/{chunk-MKK3GSDF.js → chunk-344G2PKM.js} +9 -9
  12. package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
  13. package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
  14. package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
  15. package/dist/{chunk-ZQ3OWSVS.js → chunk-A4FQW4A5.js} +54 -50
  16. package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
  17. package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
  18. package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
  19. package/dist/{chunk-LZOZZRHB.js → chunk-CLSF7VUT.js} +42 -38
  20. package/dist/{chunk-Q7M5ANIE.js → chunk-CNCVJ2IN.js} +379 -534
  21. package/dist/{chunk-IR55GBON.js → chunk-CU5UT2ED.js} +19 -18
  22. package/dist/{chunk-TPJISPJ5.js → chunk-CYEVXXRH.js} +51 -47
  23. package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
  24. package/dist/{chunk-5VDXAE53.js → chunk-EJUXYFV3.js} +26 -16
  25. package/dist/{chunk-X6KW7BYP.js → chunk-HIDSEBVV.js} +55 -54
  26. package/dist/{chunk-ZOEKRXDP.js → chunk-I3LT2PO3.js} +35 -57
  27. package/dist/{chunk-E7OXHCDR.js → chunk-IEEJZC3B.js} +56 -49
  28. package/dist/chunk-IINN7QUV.js +2565 -0
  29. package/dist/chunk-IK3BVD3Y.js +233 -0
  30. package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
  31. package/dist/{chunk-EX2UWGES.js → chunk-KW633S3Y.js} +56 -52
  32. package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
  33. package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
  34. package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
  35. package/dist/chunk-PQKZ53DW.js +76 -0
  36. package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
  37. package/dist/{chunk-X5N72JHI.js → chunk-SO3VXCZV.js} +93 -92
  38. package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
  39. package/dist/chunk-URKH6SE2.js +479 -0
  40. package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
  41. package/dist/{chunk-POKX77OK.js → chunk-W5SQWSLC.js} +380 -535
  42. package/dist/{chunk-A4BCLP6K.js → chunk-YBS5GSRF.js} +64 -69
  43. package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
  44. package/dist/chunk-YSWLN2IJ.js +890 -0
  45. package/dist/commands/DbCommand.js +3 -3
  46. package/dist/commands/DbDrop.js +4 -5
  47. package/dist/commands/DbExecute.js +10 -8
  48. package/dist/commands/DbPull.js +17 -16
  49. package/dist/commands/DbPush.js +12 -11
  50. package/dist/commands/DbSeed.js +4 -5
  51. package/dist/commands/MigrateCommand.js +3 -3
  52. package/dist/commands/MigrateDeploy.js +14 -13
  53. package/dist/commands/MigrateDev.js +17 -16
  54. package/dist/commands/MigrateDiff.js +13 -11
  55. package/dist/commands/MigrateReset.js +16 -15
  56. package/dist/commands/MigrateResolve.js +12 -11
  57. package/dist/commands/MigrateStatus.js +12 -11
  58. package/dist/index.js +58 -60
  59. package/dist/internals/src/Generator.d.ts +23 -5
  60. package/dist/internals/src/WasmSchemaEngineLoader.d.ts +5 -0
  61. package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
  62. package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
  63. package/dist/internals/src/cli/getSchema.d.ts +3 -28
  64. package/dist/internals/src/cli/hashes.d.ts +1 -2
  65. package/dist/internals/src/cli/schemaContext.d.ts +59 -0
  66. package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
  67. package/dist/internals/src/convertCredentials.d.ts +1 -1
  68. package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
  69. package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
  70. package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
  71. package/dist/internals/src/errorReporting.d.ts +0 -1
  72. package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
  73. package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
  74. package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
  75. package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
  76. package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
  77. package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
  78. package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
  79. package/dist/internals/src/index.d.ts +9 -8
  80. package/dist/internals/src/migrateTypes.d.ts +63 -0
  81. package/dist/internals/src/panic.d.ts +1 -4
  82. package/dist/internals/src/resolvePkg.d.ts +7 -0
  83. package/dist/internals/src/types.d.ts +1 -1
  84. package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
  85. package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
  86. package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
  87. package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
  88. package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
  89. package/dist/internals/src/wasm.d.ts +3 -1
  90. package/dist/migrate/src/Migrate.d.ts +18 -7
  91. package/dist/migrate/src/SchemaEngine.d.ts +20 -50
  92. package/dist/migrate/src/SchemaEngineCLI.d.ts +139 -0
  93. package/dist/migrate/src/SchemaEngineWasm.d.ts +134 -0
  94. package/dist/migrate/src/commands/DbExecute.d.ts +1 -1
  95. package/dist/migrate/src/commands/DbPull.d.ts +1 -1
  96. package/dist/migrate/src/commands/DbPush.d.ts +1 -1
  97. package/dist/migrate/src/commands/MigrateDeploy.d.ts +1 -1
  98. package/dist/migrate/src/commands/MigrateDev.d.ts +1 -1
  99. package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -1
  100. package/dist/migrate/src/commands/MigrateReset.d.ts +1 -1
  101. package/dist/migrate/src/commands/MigrateResolve.d.ts +1 -1
  102. package/dist/migrate/src/commands/MigrateStatus.d.ts +1 -1
  103. package/dist/migrate/src/index.d.ts +2 -2
  104. package/dist/migrate/src/types.d.ts +19 -19
  105. package/dist/migrate/src/utils/createMigration.d.ts +21 -0
  106. package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
  107. package/dist/migrate/src/utils/introspectSql.d.ts +3 -2
  108. package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
  109. package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
  110. package/dist/migrate/src/utils/seed.d.ts +0 -2
  111. package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
  112. package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
  113. package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
  114. package/dist/types.js +1 -1
  115. package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
  116. package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
  117. package/dist/utils/byline.js +1 -1
  118. package/dist/utils/captureStdout.js +3 -3
  119. package/dist/utils/countModelsAndTypes.js +1 -1
  120. package/dist/utils/createMigration.js +27 -0
  121. package/dist/utils/customColors.js +1 -1
  122. package/dist/utils/ensureDatabaseExists.js +7 -7
  123. package/dist/utils/errors.js +1 -1
  124. package/dist/utils/flagErrors.js +1 -1
  125. package/dist/utils/getDatabaseVersionSafe.js +10 -5
  126. package/dist/utils/handleEvaluateDataloss.js +1 -1
  127. package/dist/utils/introspectSql.js +10 -5
  128. package/dist/utils/isSchemaEmpty.js +1 -1
  129. package/dist/utils/listMigrations.js +25 -0
  130. package/dist/utils/now.js +1 -1
  131. package/dist/utils/printDatasource.js +1 -1
  132. package/dist/utils/printDatasources.js +5 -5
  133. package/dist/utils/printFiles.js +5 -5
  134. package/dist/utils/printIntrospectedSchema.js +1 -1
  135. package/dist/utils/printMigrationId.js +1 -1
  136. package/dist/utils/promptForMigrationName.js +3 -3
  137. package/dist/utils/removeSchemaFiles.js +1 -1
  138. package/dist/utils/replaceOrAddDatasource.js +1 -1
  139. package/dist/utils/replaceOrAddDatasource.test.js +1 -1
  140. package/dist/utils/saveSchemaFiles.js +1 -1
  141. package/dist/utils/seed.js +4 -7
  142. package/dist/utils/setupCockroach.js +3 -3
  143. package/dist/utils/setupMSSQL.js +1583 -710
  144. package/dist/utils/setupMongo.js +6563 -5984
  145. package/dist/utils/setupMysql.js +508 -563
  146. package/dist/utils/setupPostgres.js +3 -3
  147. package/dist/utils/spinner.js +4 -7
  148. package/dist/utils/test-handlePanic.js +1 -30
  149. package/dist/utils/unixSocket.js +1 -1
  150. package/dist/views/handleViewsIO.js +3 -3
  151. package/package.json +15 -14
  152. package/dist/chunk-6C7ESGWY.js +0 -1184
  153. package/dist/chunk-DIAO4W7O.js +0 -5774
  154. package/dist/chunk-GKDFIHM2.js +0 -45
  155. package/dist/chunk-J46BJQHT.js +0 -268
  156. package/dist/chunk-KXMACMQC.js +0 -660
  157. package/dist/chunk-YUCPBDWV.js +0 -131
  158. package/dist/chunk-YYPMC5FN.js +0 -1407
  159. package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
  160. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
  161. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
  162. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
  163. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
  164. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
  165. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
  166. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
  167. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
  168. package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
  169. package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_GKDFIHM2_exports = {};
30
- __export(chunk_GKDFIHM2_exports, {
31
- getSchemaPathAndPrint: () => getSchemaPathAndPrint,
32
- printSchemaLoadedMessage: () => printSchemaLoadedMessage
33
- });
34
- module.exports = __toCommonJS(chunk_GKDFIHM2_exports);
35
- var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
36
- var import_internals = require("@prisma/internals");
37
- var import_path = __toESM(require("path"));
38
- async function getSchemaPathAndPrint(schemaPathProvided, schemaPathFromConfig, options) {
39
- const schemaPathResult = await (0, import_internals.getSchemaWithPath)(schemaPathProvided, schemaPathFromConfig, options);
40
- printSchemaLoadedMessage(schemaPathResult.schemaPath);
41
- return schemaPathResult;
42
- }
43
- function printSchemaLoadedMessage(schemaPath) {
44
- process.stdout.write((0, import_chunk_SKRR5WT4.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath)}`) + "\n");
45
- }
@@ -1,268 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_J46BJQHT_exports = {};
20
- __export(chunk_J46BJQHT_exports, {
21
- require_onetime: () => require_onetime,
22
- require_signal_exit: () => require_signal_exit
23
- });
24
- module.exports = __toCommonJS(chunk_J46BJQHT_exports);
25
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
26
- var require_mimic_fn = (0, import_chunk_WWAWV7DQ.__commonJS)({
27
- "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports, module2) {
28
- "use strict";
29
- var mimicFn = (to, from) => {
30
- for (const prop of Reflect.ownKeys(from)) {
31
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
32
- }
33
- return to;
34
- };
35
- module2.exports = mimicFn;
36
- module2.exports.default = mimicFn;
37
- }
38
- });
39
- var require_onetime = (0, import_chunk_WWAWV7DQ.__commonJS)({
40
- "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports, module2) {
41
- "use strict";
42
- var mimicFn = require_mimic_fn();
43
- var calledFunctions = /* @__PURE__ */ new WeakMap();
44
- var onetime = (function_, options = {}) => {
45
- if (typeof function_ !== "function") {
46
- throw new TypeError("Expected a function");
47
- }
48
- let returnValue;
49
- let callCount = 0;
50
- const functionName = function_.displayName || function_.name || "<anonymous>";
51
- const onetime2 = function(...arguments_) {
52
- calledFunctions.set(onetime2, ++callCount);
53
- if (callCount === 1) {
54
- returnValue = function_.apply(this, arguments_);
55
- function_ = null;
56
- } else if (options.throw === true) {
57
- throw new Error(`Function \`${functionName}\` can only be called once`);
58
- }
59
- return returnValue;
60
- };
61
- mimicFn(onetime2, function_);
62
- calledFunctions.set(onetime2, callCount);
63
- return onetime2;
64
- };
65
- module2.exports = onetime;
66
- module2.exports.default = onetime;
67
- module2.exports.callCount = (function_) => {
68
- if (!calledFunctions.has(function_)) {
69
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
70
- }
71
- return calledFunctions.get(function_);
72
- };
73
- }
74
- });
75
- var require_signals = (0, import_chunk_WWAWV7DQ.__commonJS)({
76
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module2) {
77
- "use strict";
78
- module2.exports = [
79
- "SIGABRT",
80
- "SIGALRM",
81
- "SIGHUP",
82
- "SIGINT",
83
- "SIGTERM"
84
- ];
85
- if (process.platform !== "win32") {
86
- module2.exports.push(
87
- "SIGVTALRM",
88
- "SIGXCPU",
89
- "SIGXFSZ",
90
- "SIGUSR2",
91
- "SIGTRAP",
92
- "SIGSYS",
93
- "SIGQUIT",
94
- "SIGIOT"
95
- // should detect profiler and enable/disable accordingly.
96
- // see #21
97
- // 'SIGPROF'
98
- );
99
- }
100
- if (process.platform === "linux") {
101
- module2.exports.push(
102
- "SIGIO",
103
- "SIGPOLL",
104
- "SIGPWR",
105
- "SIGSTKFLT",
106
- "SIGUNUSED"
107
- );
108
- }
109
- }
110
- });
111
- var require_signal_exit = (0, import_chunk_WWAWV7DQ.__commonJS)({
112
- "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) {
113
- "use strict";
114
- var process2 = global.process;
115
- var processOk = function(process3) {
116
- return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
117
- };
118
- if (!processOk(process2)) {
119
- module2.exports = function() {
120
- return function() {
121
- };
122
- };
123
- } else {
124
- assert = (0, import_chunk_WWAWV7DQ.__require)("assert");
125
- signals = require_signals();
126
- isWin = /^win/i.test(process2.platform);
127
- EE = (0, import_chunk_WWAWV7DQ.__require)("events");
128
- if (typeof EE !== "function") {
129
- EE = EE.EventEmitter;
130
- }
131
- if (process2.__signal_exit_emitter__) {
132
- emitter = process2.__signal_exit_emitter__;
133
- } else {
134
- emitter = process2.__signal_exit_emitter__ = new EE();
135
- emitter.count = 0;
136
- emitter.emitted = {};
137
- }
138
- if (!emitter.infinite) {
139
- emitter.setMaxListeners(Infinity);
140
- emitter.infinite = true;
141
- }
142
- module2.exports = function(cb, opts) {
143
- if (!processOk(global.process)) {
144
- return function() {
145
- };
146
- }
147
- assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
148
- if (loaded === false) {
149
- load();
150
- }
151
- var ev = "exit";
152
- if (opts && opts.alwaysLast) {
153
- ev = "afterexit";
154
- }
155
- var remove = function() {
156
- emitter.removeListener(ev, cb);
157
- if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
158
- unload();
159
- }
160
- };
161
- emitter.on(ev, cb);
162
- return remove;
163
- };
164
- unload = function unload2() {
165
- if (!loaded || !processOk(global.process)) {
166
- return;
167
- }
168
- loaded = false;
169
- signals.forEach(function(sig) {
170
- try {
171
- process2.removeListener(sig, sigListeners[sig]);
172
- } catch (er) {
173
- }
174
- });
175
- process2.emit = originalProcessEmit;
176
- process2.reallyExit = originalProcessReallyExit;
177
- emitter.count -= 1;
178
- };
179
- module2.exports.unload = unload;
180
- emit = function emit2(event, code, signal) {
181
- if (emitter.emitted[event]) {
182
- return;
183
- }
184
- emitter.emitted[event] = true;
185
- emitter.emit(event, code, signal);
186
- };
187
- sigListeners = {};
188
- signals.forEach(function(sig) {
189
- sigListeners[sig] = function listener() {
190
- if (!processOk(global.process)) {
191
- return;
192
- }
193
- var listeners = process2.listeners(sig);
194
- if (listeners.length === emitter.count) {
195
- unload();
196
- emit("exit", null, sig);
197
- emit("afterexit", null, sig);
198
- if (isWin && sig === "SIGHUP") {
199
- sig = "SIGINT";
200
- }
201
- process2.kill(process2.pid, sig);
202
- }
203
- };
204
- });
205
- module2.exports.signals = function() {
206
- return signals;
207
- };
208
- loaded = false;
209
- load = function load2() {
210
- if (loaded || !processOk(global.process)) {
211
- return;
212
- }
213
- loaded = true;
214
- emitter.count += 1;
215
- signals = signals.filter(function(sig) {
216
- try {
217
- process2.on(sig, sigListeners[sig]);
218
- return true;
219
- } catch (er) {
220
- return false;
221
- }
222
- });
223
- process2.emit = processEmit;
224
- process2.reallyExit = processReallyExit;
225
- };
226
- module2.exports.load = load;
227
- originalProcessReallyExit = process2.reallyExit;
228
- processReallyExit = function processReallyExit2(code) {
229
- if (!processOk(global.process)) {
230
- return;
231
- }
232
- process2.exitCode = code || /* istanbul ignore next */
233
- 0;
234
- emit("exit", process2.exitCode, null);
235
- emit("afterexit", process2.exitCode, null);
236
- originalProcessReallyExit.call(process2, process2.exitCode);
237
- };
238
- originalProcessEmit = process2.emit;
239
- processEmit = function processEmit2(ev, arg) {
240
- if (ev === "exit" && processOk(global.process)) {
241
- if (arg !== void 0) {
242
- process2.exitCode = arg;
243
- }
244
- var ret = originalProcessEmit.apply(this, arguments);
245
- emit("exit", process2.exitCode, null);
246
- emit("afterexit", process2.exitCode, null);
247
- return ret;
248
- } else {
249
- return originalProcessEmit.apply(this, arguments);
250
- }
251
- };
252
- }
253
- var assert;
254
- var signals;
255
- var isWin;
256
- var EE;
257
- var emitter;
258
- var unload;
259
- var emit;
260
- var sigListeners;
261
- var loaded;
262
- var load;
263
- var originalProcessReallyExit;
264
- var processReallyExit;
265
- var originalProcessEmit;
266
- var processEmit;
267
- }
268
- });