cloudstructs 0.9.28 → 0.9.30

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 (149) hide show
  1. package/.jsii +4 -4
  2. package/assets/slack-textract/detect.lambda/index.js +63 -34
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/dmarc/index.js +1 -1
  5. package/lib/ecs-service-roller/index.js +2 -2
  6. package/lib/email-receiver/receiver.js +1 -1
  7. package/lib/email-receiver/whitelist-function.js +2 -2
  8. package/lib/mjml-template/index.js +1 -1
  9. package/lib/saml-identity-provider/index.js +2 -2
  10. package/lib/slack-app/manifest.js +1 -1
  11. package/lib/slack-app/provider-function.js +2 -2
  12. package/lib/slack-app/slack-app.js +2 -2
  13. package/lib/slack-events/events-function.js +2 -2
  14. package/lib/slack-events/index.js +1 -1
  15. package/lib/slack-textract/detect-function.js +2 -2
  16. package/lib/slack-textract/index.js +1 -1
  17. package/lib/ssl-server-test/analyze-function.js +2 -2
  18. package/lib/ssl-server-test/extract-grade-function.js +2 -2
  19. package/lib/ssl-server-test/index.js +1 -1
  20. package/lib/state-machine-cr-provider/index.js +1 -1
  21. package/lib/static-website/index.js +1 -1
  22. package/lib/static-website/origin-request-function.js +2 -2
  23. package/lib/toolkit-cleaner/clean-images-function.js +2 -2
  24. package/lib/toolkit-cleaner/clean-objects-function.js +2 -2
  25. package/lib/toolkit-cleaner/extract-template-hashes-function.js +2 -2
  26. package/lib/toolkit-cleaner/get-stack-names-function.js +2 -2
  27. package/lib/toolkit-cleaner/index.js +1 -1
  28. package/lib/url-shortener/index.js +1 -1
  29. package/lib/url-shortener/redirect-function.js +2 -2
  30. package/lib/url-shortener/shortener-function.js +2 -2
  31. package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +4 -3
  32. package/node_modules/@babel/runtime/helpers/wrapRegExp.js +4 -3
  33. package/node_modules/@babel/runtime/package.json +1 -1
  34. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  35. package/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  36. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +4 -11
  37. package/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +14 -12
  38. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +36 -1
  39. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +4 -4
  40. package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -2
  41. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -1
  42. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +936 -1005
  43. package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  44. package/node_modules/@slack/web-api/README.md +4 -4
  45. package/node_modules/@slack/web-api/dist/WebClient.d.ts +30 -1
  46. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  47. package/node_modules/@slack/web-api/dist/WebClient.js +15 -2
  48. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  49. package/node_modules/@slack/web-api/dist/methods.d.ts +1 -1
  50. package/node_modules/@slack/web-api/dist/methods.js +1 -1
  51. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  52. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  53. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +4 -11
  54. package/node_modules/@slack/web-api/node_modules/@types/node/constants.d.ts +14 -12
  55. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +36 -1
  56. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +4 -4
  57. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  58. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -1
  59. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +936 -1005
  60. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  61. package/node_modules/@slack/web-api/package.json +8 -6
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +4 -11
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +14 -12
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +36 -1
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +4 -4
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -1
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +936 -1005
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  72. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  73. package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  74. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +4 -11
  75. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +14 -12
  76. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +36 -1
  77. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +4 -4
  78. package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -2
  79. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -1
  80. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +936 -1005
  81. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  82. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  83. package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +112 -38
  84. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +4 -11
  85. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +14 -12
  86. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +36 -1
  87. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +4 -4
  88. package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
  89. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -1
  90. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +936 -1005
  91. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +107 -35
  92. package/node_modules/abbrev/package.json +9 -11
  93. package/node_modules/axios/CHANGELOG.md +97 -0
  94. package/node_modules/axios/README.md +35 -13
  95. package/node_modules/axios/dist/axios.js +14 -25
  96. package/node_modules/axios/dist/axios.js.map +1 -1
  97. package/node_modules/axios/dist/axios.min.js +2 -1
  98. package/node_modules/axios/dist/axios.min.js.map +1 -1
  99. package/node_modules/axios/dist/browser/axios.cjs +14 -28
  100. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  101. package/node_modules/axios/dist/esm/axios.js +14 -28
  102. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  103. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  104. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  105. package/node_modules/axios/dist/node/axios.cjs +44 -31
  106. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  107. package/node_modules/axios/index.d.cts +1 -0
  108. package/node_modules/axios/index.d.ts +1 -0
  109. package/node_modules/axios/lib/adapters/http.js +1 -1
  110. package/node_modules/axios/lib/core/Axios.js +10 -1
  111. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  112. package/node_modules/axios/lib/env/data.js +1 -1
  113. package/node_modules/axios/lib/helpers/formDataToStream.js +3 -2
  114. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  115. package/node_modules/axios/lib/platform/node/index.js +26 -0
  116. package/node_modules/axios/lib/utils.js +0 -22
  117. package/node_modules/axios/package.json +4 -4
  118. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +0 -1
  119. package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +1 -1
  120. package/node_modules/foreground-child/dist/commonjs/index.d.ts +1 -8
  121. package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +1 -1
  122. package/node_modules/foreground-child/dist/commonjs/index.js +2 -2
  123. package/node_modules/foreground-child/dist/commonjs/index.js.map +1 -1
  124. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +0 -1
  125. package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +1 -1
  126. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +0 -1
  127. package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +1 -1
  128. package/node_modules/foreground-child/dist/esm/all-signals.d.ts +0 -1
  129. package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +1 -1
  130. package/node_modules/foreground-child/dist/esm/index.d.ts +1 -8
  131. package/node_modules/foreground-child/dist/esm/index.d.ts.map +1 -1
  132. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +0 -1
  133. package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +1 -1
  134. package/node_modules/foreground-child/dist/esm/watchdog.d.ts +0 -1
  135. package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +1 -1
  136. package/node_modules/foreground-child/package.json +6 -11
  137. package/node_modules/js-beautify/README.md +8 -8
  138. package/node_modules/js-beautify/package.json +2 -2
  139. package/node_modules/nopt/README.md +8 -9
  140. package/node_modules/nopt/lib/nopt-lib.js +5 -40
  141. package/node_modules/nopt/lib/nopt.js +0 -4
  142. package/node_modules/nopt/package.json +9 -10
  143. package/package.json +19 -19
  144. package/node_modules/axios/SECURITY.md +0 -6
  145. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/index.d.ts +0 -0
  146. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/index.js +0 -0
  147. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/license +0 -0
  148. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/package.json +0 -0
  149. /package/node_modules/{path-key → cross-spawn/node_modules/path-key}/readme.md +0 -0
@@ -376,6 +376,7 @@ declare namespace axios {
376
376
  url?: string;
377
377
  method?: Method | string;
378
378
  baseURL?: string;
379
+ allowAbsoluteUrls?: boolean;
379
380
  transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
380
381
  transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
381
382
  headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
@@ -317,6 +317,7 @@ export interface AxiosRequestConfig<D = any> {
317
317
  url?: string;
318
318
  method?: Method | string;
319
319
  baseURL?: string;
320
+ allowAbsoluteUrls?: boolean;
320
321
  transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
321
322
  transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
322
323
  headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
@@ -228,7 +228,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
228
228
  }
229
229
 
230
230
  // Parse url
231
- const fullPath = buildFullPath(config.baseURL, config.url);
231
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
232
232
  const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
233
233
  const protocol = parsed.protocol || supportedProtocols[0];
234
234
 
@@ -97,6 +97,15 @@ class Axios {
97
97
  }
98
98
  }
99
99
 
100
+ // Set config.allowAbsoluteUrls
101
+ if (config.allowAbsoluteUrls !== undefined) {
102
+ // do nothing
103
+ } else if (this.defaults.allowAbsoluteUrls !== undefined) {
104
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
105
+ } else {
106
+ config.allowAbsoluteUrls = true;
107
+ }
108
+
100
109
  validator.assertOptions(config, {
101
110
  baseUrl: validators.spelling('baseURL'),
102
111
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -192,7 +201,7 @@ class Axios {
192
201
 
193
202
  getUri(config) {
194
203
  config = mergeConfig(this.defaults, config);
195
- const fullPath = buildFullPath(config.baseURL, config.url);
204
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
196
205
  return buildURL(fullPath, config.params, config.paramsSerializer);
197
206
  }
198
207
  }
@@ -13,8 +13,9 @@ import combineURLs from '../helpers/combineURLs.js';
13
13
  *
14
14
  * @returns {string} The combined full path
15
15
  */
16
- export default function buildFullPath(baseURL, requestedURL) {
17
- if (baseURL && !isAbsoluteURL(requestedURL)) {
16
+ export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
17
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
18
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
18
19
  return combineURLs(baseURL, requestedURL);
19
20
  }
20
21
  return requestedURL;
@@ -1 +1 @@
1
- export const VERSION = "1.7.9";
1
+ export const VERSION = "1.8.4";
@@ -2,8 +2,9 @@ import util from 'util';
2
2
  import {Readable} from 'stream';
3
3
  import utils from "../utils.js";
4
4
  import readBlob from "./readBlob.js";
5
+ import platform from "../platform/index.js";
5
6
 
6
- const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
7
+ const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
7
8
 
8
9
  const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
9
10
 
@@ -63,7 +64,7 @@ const formDataToStream = (form, headersHandler, options) => {
63
64
  const {
64
65
  tag = 'form-data-boundary',
65
66
  size = 25,
66
- boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)
67
+ boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
67
68
  } = options || {};
68
69
 
69
70
  if(!utils.isFormData(form)) {
@@ -14,7 +14,7 @@ export default (config) => {
14
14
 
15
15
  newConfig.headers = headers = AxiosHeaders.from(headers);
16
16
 
17
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
17
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
18
18
 
19
19
  // HTTP basic authentication
20
20
  if (auth) {
@@ -1,6 +1,30 @@
1
+ import crypto from 'crypto';
1
2
  import URLSearchParams from './classes/URLSearchParams.js'
2
3
  import FormData from './classes/FormData.js'
3
4
 
5
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
6
+
7
+ const DIGIT = '0123456789';
8
+
9
+ const ALPHABET = {
10
+ DIGIT,
11
+ ALPHA,
12
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
13
+ }
14
+
15
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
16
+ let str = '';
17
+ const {length} = alphabet;
18
+ const randomValues = new Uint32Array(size);
19
+ crypto.randomFillSync(randomValues);
20
+ for (let i = 0; i < size; i++) {
21
+ str += alphabet[randomValues[i] % length];
22
+ }
23
+
24
+ return str;
25
+ }
26
+
27
+
4
28
  export default {
5
29
  isNode: true,
6
30
  classes: {
@@ -8,5 +32,7 @@ export default {
8
32
  FormData,
9
33
  Blob: typeof Blob !== 'undefined' && Blob || null
10
34
  },
35
+ ALPHABET,
36
+ generateString,
11
37
  protocols: [ 'http', 'https', 'file', 'data' ]
12
38
  };
@@ -602,26 +602,6 @@ const toFiniteNumber = (value, defaultValue) => {
602
602
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
603
603
  }
604
604
 
605
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
606
-
607
- const DIGIT = '0123456789';
608
-
609
- const ALPHABET = {
610
- DIGIT,
611
- ALPHA,
612
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
613
- }
614
-
615
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
616
- let str = '';
617
- const {length} = alphabet;
618
- while (size--) {
619
- str += alphabet[Math.random() * length|0]
620
- }
621
-
622
- return str;
623
- }
624
-
625
605
  /**
626
606
  * If the thing is a FormData object, return true, otherwise return false.
627
607
  *
@@ -749,8 +729,6 @@ export default {
749
729
  findKey,
750
730
  global: _global,
751
731
  isContextDefined,
752
- ALPHABET,
753
- generateString,
754
732
  isSpecCompliantForm,
755
733
  toJSONObject,
756
734
  isAsyncFn,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.7.9",
3
+ "version": "1.8.4",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -163,14 +163,14 @@
163
163
  "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
164
164
  "Jay (https://github.com/jasonsaayman)",
165
165
  "Emily Morehouse (https://github.com/emilyemorehouse)",
166
- "Justin Beckwith (https://github.com/JustinBeckwith)",
167
166
  "Rubén Norte (https://github.com/rubennorte)",
167
+ "Justin Beckwith (https://github.com/JustinBeckwith)",
168
168
  "Martti Laine (https://github.com/codeclown)",
169
169
  "Xianming Zhong (https://github.com/chinesedfan)",
170
170
  "Remco Haszing (https://github.com/remcohaszing)",
171
171
  "Rikki Gibson (https://github.com/RikkiGibson)",
172
- "Yasu Flores (https://github.com/yasuf)",
173
- "Ben Carp (https://github.com/carpben)"
172
+ "Ben Carp (https://github.com/carpben)",
173
+ "Yasu Flores (https://github.com/yasuf)"
174
174
  ],
175
175
  "sideEffects": false,
176
176
  "release-it": {
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
1
  export declare const allSignals: NodeJS.Signals[];
3
2
  //# sourceMappingURL=all-signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";AACA,eAAO,MAAM,UAAU,kBASA,CAAA"}
1
+ {"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAShB,MAAM,CAAC,OAAO,EAAE,CAAA"}
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { ChildProcessByStdio, SpawnOptions, ChildProcess } from 'child_process';
4
2
  /**
5
3
  * The signature for the cleanup method.
@@ -41,12 +39,7 @@ export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanu
41
39
  *
42
40
  * @internal
43
41
  */
44
- export declare const normalizeFgArgs: (fgArgs: FgArgs) => [
45
- program: string,
46
- args: string[],
47
- spawnOpts: SpawnOptions,
48
- cleanup: Cleanup
49
- ];
42
+ export declare const normalizeFgArgs: (fgArgs: FgArgs) => [program: string, args: string[], spawnOpts: SpawnOptions, cleanup: Cleanup];
50
43
  /**
51
44
  * Spawn the specified program as a "foreground" process, or at least as
52
45
  * close as is possible given node's lack of exec-without-fork.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,mBAAmB,EAInB,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAA;AAUtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,OAAO,EAC7B,WAAW,EAAE;IACX,WAAW,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;CAClC,KAEC,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,CAAC,OAAO,GACd,KAAK,GACL,OAAO,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,CAAA;AAE/D,MAAM,MAAM,MAAM,GACd,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,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IAAI,EAAE,IAAI,CAAC,CAAA"}
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.foregroundChild = exports.normalizeFgArgs = void 0;
6
+ exports.normalizeFgArgs = void 0;
7
+ exports.foregroundChild = foregroundChild;
7
8
  const child_process_1 = require("child_process");
8
9
  const cross_spawn_1 = __importDefault(require("cross-spawn"));
9
10
  const signal_exit_1 = require("signal-exit");
@@ -118,6 +119,5 @@ function foregroundChild(...fgArgs) {
118
119
  }
119
120
  return child;
120
121
  }
121
- exports.foregroundChild = foregroundChild;
122
122
  const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function';
123
123
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iDAOsB;AACtB,8DAAoC;AACpC,6CAAoC;AACpC,yDAAiD;AACjD,+CAAwC;AAExC,qBAAqB;AACrB,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAU,CAAC,CAAC,CAAC,qBAAS,CAAA;AAsDpE;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAc,EAMd,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,GAAG,MAAM,CAAA;IACrE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,GAAG,IAAI,CAAA;QACd,SAAS,GAAG,EAAE,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAA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AAC,GAAG,EAAE,MAAM,CAAC,CAAA;gBACjC,qBAAqB;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YACtC,CAAC;YACD,oBAAoB;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAzFD,0CAyFC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n ChildProcess,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n processInfo: {\n watchdogPid?: ChildProcess['pid']\n },\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise<void | undefined | number | NodeJS.Signals | false>\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio<null, null, null> {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n const dog = watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal, {\n watchdogPid: dog.pid,\n })\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise<any> =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAuIA,0CAyFC;AAhOD,iDAOsB;AACtB,8DAAoC;AACpC,6CAAoC;AACpC,yDAAiD;AACjD,+CAAwC;AAExC,qBAAqB;AACrB,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAU,CAAC,CAAC,CAAC,qBAAS,CAAA;AAsDpE;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAc,EAMd,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,GAAG,MAAM,CAAA;IACrE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,GAAG,IAAI,CAAA;QACd,SAAS,GAAG,EAAE,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,IAAI,OAAO,SAAS,KAAK,UAAU;YAAE,OA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AE,CAAC;gBACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YACtC,CAAC;YACD,oBAAoB;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n ChildProcess,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n processInfo: {\n watchdogPid?: ChildProcess['pid']\n },\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise<void | undefined | number | NodeJS.Signals | false>\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio<null, null, null>\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio<null, null, null> {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n const dog = watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal, {\n watchdogPid: dog.pid,\n })\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise<any> =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { type ChildProcess } from 'child_process';
3
2
  /**
4
3
  * Starts forwarding signals to `child` through `parent`.
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"}
1
+ {"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { ChildProcess } from 'child_process';
3
2
  /**
4
3
  * Pass in a ChildProcess, and this will spawn a watchdog process that
@@ -1 +1 @@
1
- {"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"}
1
+ {"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"}
@@ -1,3 +1,2 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  export declare const allSignals: NodeJS.Signals[];
3
2
  //# sourceMappingURL=all-signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";AACA,eAAO,MAAM,UAAU,kBASA,CAAA"}
1
+ {"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAShB,MAAM,CAAC,OAAO,EAAE,CAAA"}
@@ -1,5 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
1
  import { ChildProcessByStdio, SpawnOptions, ChildProcess } from 'child_process';
4
2
  /**
5
3
  * The signature for the cleanup method.
@@ -41,12 +39,7 @@ export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanu
41
39
  *
42
40
  * @internal
43
41
  */
44
- export declare const normalizeFgArgs: (fgArgs: FgArgs) => [
45
- program: string,
46
- args: string[],
47
- spawnOpts: SpawnOptions,
48
- cleanup: Cleanup
49
- ];
42
+ export declare const normalizeFgArgs: (fgArgs: FgArgs) => [program: string, args: string[], spawnOpts: SpawnOptions, cleanup: Cleanup];
50
43
  /**
51
44
  * Spawn the specified program as a "foreground" process, or at least as
52
45
  * close as is possible given node's lack of exec-without-fork.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,mBAAmB,EAInB,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAA;AAUtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,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AE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { type ChildProcess } from 'child_process';
3
2
  /**
4
3
  * Starts forwarding signals to `child` through `parent`.
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"}
1
+ {"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { ChildProcess } from 'child_process';
3
2
  /**
4
3
  * Pass in a ChildProcess, and this will spawn a watchdog process that
@@ -1 +1 @@
1
- {"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"}
1
+ {"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"}
@@ -1,30 +1,26 @@
1
1
  {
2
2
  "name": "foreground-child",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "types": "./dist/commonjs/index.d.ts",
7
7
  "exports": {
8
8
  "./watchdog": {
9
9
  "import": {
10
- "source": "./src/watchdog.ts",
11
10
  "types": "./dist/esm/watchdog.d.ts",
12
11
  "default": "./dist/esm/watchdog.js"
13
12
  },
14
13
  "require": {
15
- "source": "./src/watchdog.ts",
16
14
  "types": "./dist/commonjs/watchdog.d.ts",
17
15
  "default": "./dist/commonjs/watchdog.js"
18
16
  }
19
17
  },
20
18
  "./proxy-signals": {
21
19
  "import": {
22
- "source": "./src/proxy-signals.ts",
23
20
  "types": "./dist/esm/proxy-signals.d.ts",
24
21
  "default": "./dist/esm/proxy-signals.js"
25
22
  },
26
23
  "require": {
27
- "source": "./src/proxy-signals.ts",
28
24
  "types": "./dist/commonjs/proxy-signals.d.ts",
29
25
  "default": "./dist/commonjs/proxy-signals.js"
30
26
  }
@@ -32,12 +28,10 @@
32
28
  "./package.json": "./package.json",
33
29
  ".": {
34
30
  "import": {
35
- "source": "./src/index.ts",
36
31
  "types": "./dist/esm/index.d.ts",
37
32
  "default": "./dist/esm/index.js"
38
33
  },
39
34
  "require": {
40
- "source": "./src/index.ts",
41
35
  "types": "./dist/commonjs/index.d.ts",
42
36
  "default": "./dist/commonjs/index.js"
43
37
  }
@@ -50,7 +44,7 @@
50
44
  "node": ">=14"
51
45
  },
52
46
  "dependencies": {
53
- "cross-spawn": "^7.0.0",
47
+ "cross-spawn": "^7.0.6",
54
48
  "signal-exit": "^4.0.1"
55
49
  },
56
50
  "scripts": {
@@ -91,8 +85,8 @@
91
85
  "@types/node": "^18.15.11",
92
86
  "@types/tap": "^15.0.8",
93
87
  "prettier": "^3.3.2",
94
- "tap": "^19.2.5",
95
- "tshy": "^1.15.1",
88
+ "tap": "^21.1.0",
89
+ "tshy": "^3.0.2",
96
90
  "typedoc": "^0.24.2",
97
91
  "typescript": "^5.0.2"
98
92
  },
@@ -107,5 +101,6 @@
107
101
  ".": "./src/index.ts"
108
102
  }
109
103
  },
110
- "type": "module"
104
+ "type": "module",
105
+ "module": "./dist/esm/index.js"
111
106
  }
@@ -58,13 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries
58
58
 
59
59
  To pull the latest version from one of these services include one set of the script tags below in your document:
60
60
  ```html
61
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify.js"></script>
62
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify-css.js"></script>
63
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify-html.js"></script>
61
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify.js"></script>
62
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify-css.js"></script>
63
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify-html.js"></script>
64
64
 
65
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify.min.js"></script>
66
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify-css.min.js"></script>
67
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify-html.min.js"></script>
65
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify.min.js"></script>
66
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify-css.min.js"></script>
67
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify-html.min.js"></script>
68
68
  ```
69
69
 
70
70
  Example usage of a JS tag in html:
@@ -76,7 +76,7 @@ Example usage of a JS tag in html:
76
76
 
77
77
  . . .
78
78
 
79
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.3/beautify.min.js"></script>
79
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.4/beautify.min.js"></script>
80
80
  <script src="script.js"></script>
81
81
  </body>
82
82
  </html>
@@ -445,4 +445,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
445
445
  Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
446
446
  Mathias Bynens, Vittorio Gambaletta and others.
447
447
 
448
- (README.md: js-beautify@1.15.3)
448
+ (README.md: js-beautify@1.15.4)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-beautify",
3
- "version": "1.15.3",
3
+ "version": "1.15.4",
4
4
  "description": "beautifier.io for node",
5
5
  "main": "js/index.js",
6
6
  "bin": {
@@ -53,7 +53,7 @@
53
53
  "editorconfig": "^1.0.4",
54
54
  "glob": "^10.4.2",
55
55
  "js-cookie": "^3.0.5",
56
- "nopt": "^8.0.0"
56
+ "nopt": "^7.2.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "ansi-regex": "^6.0.1",
@@ -141,15 +141,14 @@ config object and remove its invalid properties.
141
141
 
142
142
  ## Error Handling
143
143
 
144
- By default nopt logs debug messages if `DEBUG_NOPT` or `NOPT_DEBUG` are set in the environment.
145
-
146
- You can assign the following methods to `nopt` for a more granular notification of invalid, unknown, and expanding options:
147
-
148
- `nopt.invalidHandler(key, value, type, data)` - Called when a value is invalid for its option.
149
- `nopt.unknownHandler(key, next)` - Called when an option is found that has no configuration. In certain situations the next option on the command line will be parsed on its own instead of as part of the unknown option. In this case `next` will contain that option.
150
- `nopt.abbrevHandler(short, long)` - Called when an option is automatically translated via abbreviations.
151
-
152
- You can also set any of these to `false` to disable the debugging messages that they generate.
144
+ By default, nopt outputs a warning to standard error when invalid values for
145
+ known options are found. You can change this behavior by assigning a method
146
+ to `nopt.invalidHandler`. This method will be called with
147
+ the offending `nopt.invalidHandler(key, val, types)`.
148
+
149
+ If no `nopt.invalidHandler` is assigned, then it will console.error
150
+ its whining. If it is assigned to boolean `false` then the warning is
151
+ suppressed.
153
152
 
154
153
  ## Abbreviations
155
154