@aws-solutions-constructs/core 2.76.0 → 2.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/.jsii +98 -57
  2. package/lib/alb-defaults.js +2 -3
  3. package/lib/alb-helper.js +8 -10
  4. package/lib/apigateway-defaults.d.ts +6 -6
  5. package/lib/apigateway-defaults.js +17 -18
  6. package/lib/apigateway-helper.d.ts +2 -2
  7. package/lib/apigateway-helper.js +14 -17
  8. package/lib/cloudfront-distribution-defaults.js +4 -5
  9. package/lib/cloudfront-distribution-helper.js +7 -9
  10. package/lib/cloudwatch-log-group-defaults.js +2 -3
  11. package/lib/cloudwatch-log-group-helper.js +3 -6
  12. package/lib/cognito-defaults.d.ts +2 -2
  13. package/lib/cognito-defaults.js +6 -6
  14. package/lib/cognito-helper.js +8 -11
  15. package/lib/dynamodb-table-defaults.d.ts +3 -3
  16. package/lib/dynamodb-table-defaults.js +6 -6
  17. package/lib/dynamodb-table-helper.js +7 -8
  18. package/lib/elasticache-defaults.js +3 -4
  19. package/lib/elasticache-helper.js +4 -5
  20. package/lib/elasticsearch-defaults.js +2 -3
  21. package/lib/elasticsearch-helper.js +7 -8
  22. package/lib/eventbridge-helper.d.ts +2 -2
  23. package/lib/eventbridge-helper.js +6 -7
  24. package/lib/events-rule-defaults.d.ts +1 -1
  25. package/lib/events-rule-defaults.js +5 -6
  26. package/lib/fargate-defaults.js +6 -7
  27. package/lib/fargate-helper.js +7 -9
  28. package/lib/glue-database-defaults.js +4 -5
  29. package/lib/glue-database-helper.js +2 -3
  30. package/lib/glue-job-defaults.js +2 -3
  31. package/lib/glue-job-helper.js +9 -9
  32. package/lib/glue-table-defaults.js +7 -8
  33. package/lib/glue-table-helper.js +3 -4
  34. package/lib/iot-topic-rule-defaults.d.ts +1 -1
  35. package/lib/iot-topic-rule-defaults.js +7 -8
  36. package/lib/kendra-defaults.js +2 -3
  37. package/lib/kendra-helper.d.ts +1 -1
  38. package/lib/kendra-helper.js +5 -6
  39. package/lib/kinesis-analytics-defaults.d.ts +2 -2
  40. package/lib/kinesis-analytics-defaults.js +4 -4
  41. package/lib/kinesis-analytics-helper.js +3 -4
  42. package/lib/kinesis-firehose-s3-defaults.d.ts +1 -1
  43. package/lib/kinesis-firehose-s3-defaults.js +8 -9
  44. package/lib/kinesis-streams-defaults.d.ts +2 -2
  45. package/lib/kinesis-streams-defaults.js +4 -4
  46. package/lib/kinesis-streams-helper.js +5 -7
  47. package/lib/kms-defaults.d.ts +2 -2
  48. package/lib/kms-defaults.js +4 -4
  49. package/lib/kms-helper.js +3 -6
  50. package/lib/lambda-defaults.js +2 -3
  51. package/lib/lambda-event-source-mapping-defaults.d.ts +3 -3
  52. package/lib/lambda-event-source-mapping-defaults.js +16 -17
  53. package/lib/lambda-helper.js +6 -7
  54. package/lib/mediastore-defaults.js +2 -3
  55. package/lib/mediastore-helper.js +4 -6
  56. package/lib/opensearch-defaults.js +2 -3
  57. package/lib/opensearch-helper.js +5 -6
  58. package/lib/override-warning-service.js +10 -8
  59. package/lib/pipes-defaults.js +5 -6
  60. package/lib/pipes-helper.js +7 -7
  61. package/lib/s3-bucket-defaults.js +3 -3
  62. package/lib/s3-bucket-helper.js +13 -8
  63. package/lib/sagemaker-defaults.js +5 -6
  64. package/lib/sagemaker-helper.d.ts +5 -0
  65. package/lib/sagemaker-helper.js +17 -17
  66. package/lib/secretsmanager-defaults.d.ts +2 -2
  67. package/lib/secretsmanager-defaults.js +4 -4
  68. package/lib/secretsmanager-helper.js +4 -6
  69. package/lib/security-group-helper.js +3 -4
  70. package/lib/sns-defaults.d.ts +2 -2
  71. package/lib/sns-defaults.js +4 -4
  72. package/lib/sns-helper.js +4 -5
  73. package/lib/sqs-defaults.js +5 -5
  74. package/lib/sqs-helper.d.ts +1 -1
  75. package/lib/sqs-helper.js +5 -6
  76. package/lib/ssm-string-parameter-helper.js +2 -3
  77. package/lib/step-function-defaults.d.ts +1 -1
  78. package/lib/step-function-defaults.js +4 -5
  79. package/lib/step-function-helper.js +5 -5
  80. package/lib/utils.d.ts +1 -1
  81. package/lib/utils.js +32 -30
  82. package/lib/vpc-defaults.js +4 -5
  83. package/lib/vpc-helper.js +6 -8
  84. package/lib/waf-defaults.js +4 -5
  85. package/lib/waf-helper.js +4 -6
  86. package/lib/websocket-api-helper.js +4 -6
  87. package/package.json +6 -5
  88. package/test/apigateway-helper.test.js +3 -3
  89. package/test/cloudfront-distribution-api-gateway-helper.test.js +11 -11
  90. package/test/dynamo-table.test.js +9 -9
  91. package/test/glue-job-helper.test.js +7 -7
  92. package/test/glue-table-helper.test.js +5 -5
  93. package/test/kinesis-analytics.test.js +2 -2
  94. package/test/kinesis-streams-defaults.test.js +2 -2
  95. package/test/lambda-event-source.test.js +10 -10
  96. package/test/override-warning-service.test.js +25 -26
  97. package/test/pipes-helper.test.js +2 -2
  98. package/test/step-function-helper.test.js +5 -5
  99. package/test/test-helper.js +16 -16
  100. package/test/utils.test.js +11 -12
  101. package/.eslintignore +0 -9
  102. package/node_modules/ansi-regex/index.d.ts +0 -37
  103. package/node_modules/ansi-regex/index.js +0 -10
  104. package/node_modules/ansi-regex/license +0 -9
  105. package/node_modules/ansi-regex/package.json +0 -55
  106. package/node_modules/ansi-regex/readme.md +0 -78
  107. package/node_modules/aproba/LICENSE +0 -14
  108. package/node_modules/aproba/README.md +0 -94
  109. package/node_modules/aproba/index.js +0 -105
  110. package/node_modules/aproba/package.json +0 -35
  111. package/node_modules/are-we-there-yet/LICENSE.md +0 -18
  112. package/node_modules/are-we-there-yet/README.md +0 -208
  113. package/node_modules/are-we-there-yet/lib/index.js +0 -4
  114. package/node_modules/are-we-there-yet/lib/tracker-base.js +0 -13
  115. package/node_modules/are-we-there-yet/lib/tracker-group.js +0 -112
  116. package/node_modules/are-we-there-yet/lib/tracker-stream.js +0 -42
  117. package/node_modules/are-we-there-yet/lib/tracker.js +0 -34
  118. package/node_modules/are-we-there-yet/package.json +0 -53
  119. package/node_modules/color-support/LICENSE +0 -15
  120. package/node_modules/color-support/README.md +0 -129
  121. package/node_modules/color-support/bin.js +0 -3
  122. package/node_modules/color-support/browser.js +0 -14
  123. package/node_modules/color-support/index.js +0 -134
  124. package/node_modules/color-support/package.json +0 -36
  125. package/node_modules/console-control-strings/LICENSE +0 -13
  126. package/node_modules/console-control-strings/README.md +0 -145
  127. package/node_modules/console-control-strings/index.js +0 -125
  128. package/node_modules/console-control-strings/package.json +0 -27
  129. package/node_modules/deep-diff/.circleci/config.yml +0 -76
  130. package/node_modules/deep-diff/.eslintrc +0 -72
  131. package/node_modules/deep-diff/.vscode/launch.json +0 -30
  132. package/node_modules/deep-diff/.vscode/tasks.json +0 -12
  133. package/node_modules/deep-diff/ChangeLog.md +0 -63
  134. package/node_modules/deep-diff/LICENSE +0 -7
  135. package/node_modules/deep-diff/Readme.md +0 -239
  136. package/node_modules/deep-diff/dist/deep-diff.min.js +0 -1
  137. package/node_modules/deep-diff/dist/deep-diff.min.js.map +0 -1
  138. package/node_modules/deep-diff/examples/apply-diff-from-any.js +0 -39
  139. package/node_modules/deep-diff/examples/array-change.js +0 -45
  140. package/node_modules/deep-diff/examples/capture_change_apply_elsewhere.js +0 -53
  141. package/node_modules/deep-diff/examples/diff-ignoring-fun.js +0 -88
  142. package/node_modules/deep-diff/examples/diff-scenarios.js +0 -49
  143. package/node_modules/deep-diff/examples/example1.js +0 -41
  144. package/node_modules/deep-diff/examples/issue-111.js +0 -6
  145. package/node_modules/deep-diff/examples/issue-113-1.js +0 -14
  146. package/node_modules/deep-diff/examples/issue-113-2.js +0 -11
  147. package/node_modules/deep-diff/examples/issue-115.js +0 -17
  148. package/node_modules/deep-diff/examples/issue-124.js +0 -8
  149. package/node_modules/deep-diff/examples/issue-125.js +0 -19
  150. package/node_modules/deep-diff/examples/issue-126.js +0 -33
  151. package/node_modules/deep-diff/examples/issue-35.js +0 -11
  152. package/node_modules/deep-diff/examples/issue-47.js +0 -17
  153. package/node_modules/deep-diff/examples/issue-48.js +0 -48
  154. package/node_modules/deep-diff/examples/issue-62.js +0 -14
  155. package/node_modules/deep-diff/examples/issue-70.js +0 -6
  156. package/node_modules/deep-diff/examples/issue-71.js +0 -15
  157. package/node_modules/deep-diff/examples/issue-72.js +0 -21
  158. package/node_modules/deep-diff/examples/issue-74.js +0 -9
  159. package/node_modules/deep-diff/examples/issue-78.js +0 -24
  160. package/node_modules/deep-diff/examples/issue-83.js +0 -11
  161. package/node_modules/deep-diff/examples/issue-88.js +0 -26
  162. package/node_modules/deep-diff/examples/performance.js +0 -64
  163. package/node_modules/deep-diff/examples/practice-data.json +0 -2501
  164. package/node_modules/deep-diff/index.js +0 -526
  165. package/node_modules/deep-diff/package.json +0 -74
  166. package/node_modules/deep-diff/test/.eslintrc +0 -10
  167. package/node_modules/deep-diff/test/tests.html +0 -34
  168. package/node_modules/deep-diff/test/tests.js +0 -759
  169. package/node_modules/deepmerge/.editorconfig +0 -7
  170. package/node_modules/deepmerge/.eslintcache +0 -1
  171. package/node_modules/deepmerge/changelog.md +0 -167
  172. package/node_modules/deepmerge/dist/cjs.js +0 -133
  173. package/node_modules/deepmerge/dist/umd.js +0 -139
  174. package/node_modules/deepmerge/index.d.ts +0 -20
  175. package/node_modules/deepmerge/index.js +0 -106
  176. package/node_modules/deepmerge/license.txt +0 -21
  177. package/node_modules/deepmerge/package.json +0 -42
  178. package/node_modules/deepmerge/readme.md +0 -264
  179. package/node_modules/deepmerge/rollup.config.js +0 -22
  180. package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  181. package/node_modules/emoji-regex/README.md +0 -73
  182. package/node_modules/emoji-regex/es2015/index.js +0 -6
  183. package/node_modules/emoji-regex/es2015/text.js +0 -6
  184. package/node_modules/emoji-regex/index.d.ts +0 -23
  185. package/node_modules/emoji-regex/index.js +0 -6
  186. package/node_modules/emoji-regex/package.json +0 -50
  187. package/node_modules/emoji-regex/text.js +0 -6
  188. package/node_modules/gauge/LICENSE.md +0 -20
  189. package/node_modules/gauge/README.md +0 -402
  190. package/node_modules/gauge/lib/base-theme.js +0 -18
  191. package/node_modules/gauge/lib/error.js +0 -24
  192. package/node_modules/gauge/lib/has-color.js +0 -4
  193. package/node_modules/gauge/lib/index.js +0 -289
  194. package/node_modules/gauge/lib/plumbing.js +0 -50
  195. package/node_modules/gauge/lib/process.js +0 -3
  196. package/node_modules/gauge/lib/progress-bar.js +0 -41
  197. package/node_modules/gauge/lib/render-template.js +0 -222
  198. package/node_modules/gauge/lib/set-immediate.js +0 -7
  199. package/node_modules/gauge/lib/set-interval.js +0 -3
  200. package/node_modules/gauge/lib/spin.js +0 -5
  201. package/node_modules/gauge/lib/template-item.js +0 -87
  202. package/node_modules/gauge/lib/theme-set.js +0 -122
  203. package/node_modules/gauge/lib/themes.js +0 -56
  204. package/node_modules/gauge/lib/wide-truncate.js +0 -31
  205. package/node_modules/gauge/package.json +0 -68
  206. package/node_modules/has-unicode/LICENSE +0 -14
  207. package/node_modules/has-unicode/README.md +0 -43
  208. package/node_modules/has-unicode/index.js +0 -16
  209. package/node_modules/has-unicode/package.json +0 -30
  210. package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  211. package/node_modules/is-fullwidth-code-point/index.js +0 -50
  212. package/node_modules/is-fullwidth-code-point/license +0 -9
  213. package/node_modules/is-fullwidth-code-point/package.json +0 -42
  214. package/node_modules/is-fullwidth-code-point/readme.md +0 -39
  215. package/node_modules/npmlog/LICENSE.md +0 -20
  216. package/node_modules/npmlog/README.md +0 -216
  217. package/node_modules/npmlog/lib/log.js +0 -400
  218. package/node_modules/npmlog/package.json +0 -52
  219. package/node_modules/set-blocking/LICENSE.txt +0 -14
  220. package/node_modules/set-blocking/README.md +0 -31
  221. package/node_modules/set-blocking/index.js +0 -7
  222. package/node_modules/set-blocking/package.json +0 -42
  223. package/node_modules/signal-exit/LICENSE.txt +0 -16
  224. package/node_modules/signal-exit/README.md +0 -74
  225. package/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
  226. package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
  227. package/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  228. package/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
  229. package/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
  230. package/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
  231. package/node_modules/signal-exit/dist/cjs/index.js +0 -279
  232. package/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
  233. package/node_modules/signal-exit/dist/cjs/package.json +0 -3
  234. package/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
  235. package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
  236. package/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  237. package/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
  238. package/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
  239. package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
  240. package/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  241. package/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
  242. package/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
  243. package/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
  244. package/node_modules/signal-exit/dist/mjs/index.js +0 -275
  245. package/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
  246. package/node_modules/signal-exit/dist/mjs/package.json +0 -3
  247. package/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
  248. package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
  249. package/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  250. package/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
  251. package/node_modules/signal-exit/package.json +0 -106
  252. package/node_modules/string-width/index.d.ts +0 -29
  253. package/node_modules/string-width/index.js +0 -47
  254. package/node_modules/string-width/license +0 -9
  255. package/node_modules/string-width/package.json +0 -56
  256. package/node_modules/string-width/readme.md +0 -50
  257. package/node_modules/strip-ansi/index.d.ts +0 -17
  258. package/node_modules/strip-ansi/index.js +0 -4
  259. package/node_modules/strip-ansi/license +0 -9
  260. package/node_modules/strip-ansi/package.json +0 -54
  261. package/node_modules/strip-ansi/readme.md +0 -46
  262. package/node_modules/wide-align/LICENSE +0 -14
  263. package/node_modules/wide-align/README.md +0 -47
  264. package/node_modules/wide-align/align.js +0 -65
  265. package/node_modules/wide-align/package.json +0 -33
@@ -1,216 +0,0 @@
1
- # npmlog
2
-
3
- The logger util that npm uses.
4
-
5
- This logger is very basic. It does the logging for npm. It supports
6
- custom levels and colored output.
7
-
8
- By default, logs are written to stderr. If you want to send log messages
9
- to outputs other than streams, then you can change the `log.stream`
10
- member, or you can just listen to the events that it emits, and do
11
- whatever you want with them.
12
-
13
- # Installation
14
-
15
- ```console
16
- npm install npmlog --save
17
- ```
18
-
19
- # Basic Usage
20
-
21
- ```javascript
22
- var log = require('npmlog')
23
-
24
- // additional stuff ---------------------------+
25
- // message ----------+ |
26
- // prefix ----+ | |
27
- // level -+ | | |
28
- // v v v v
29
- log.info('fyi', 'I have a kitty cat: %j', myKittyCat)
30
- ```
31
-
32
- ## log.level
33
-
34
- * {String}
35
-
36
- The level to display logs at. Any logs at or above this level will be
37
- displayed. The special level `silent` will prevent anything from being
38
- displayed ever.
39
-
40
- ## log.record
41
-
42
- * {Array}
43
-
44
- An array of all the log messages that have been entered.
45
-
46
- ## log.maxRecordSize
47
-
48
- * {Number}
49
-
50
- The maximum number of records to keep. If log.record gets bigger than
51
- 10% over this value, then it is sliced down to 90% of this value.
52
-
53
- The reason for the 10% window is so that it doesn't have to resize a
54
- large array on every log entry.
55
-
56
- ## log.prefixStyle
57
-
58
- * {Object}
59
-
60
- A style object that specifies how prefixes are styled. (See below)
61
-
62
- ## log.headingStyle
63
-
64
- * {Object}
65
-
66
- A style object that specifies how the heading is styled. (See below)
67
-
68
- ## log.heading
69
-
70
- * {String} Default: ""
71
-
72
- If set, a heading that is printed at the start of every line.
73
-
74
- ## log.stream
75
-
76
- * {Stream} Default: `process.stderr`
77
-
78
- The stream where output is written.
79
-
80
- ## log.enableColor()
81
-
82
- Force colors to be used on all messages, regardless of the output
83
- stream.
84
-
85
- ## log.disableColor()
86
-
87
- Disable colors on all messages.
88
-
89
- ## log.enableProgress()
90
-
91
- Enable the display of log activity spinner and progress bar
92
-
93
- ## log.disableProgress()
94
-
95
- Disable the display of a progress bar
96
-
97
- ## log.enableUnicode()
98
-
99
- Force the unicode theme to be used for the progress bar.
100
-
101
- ## log.disableUnicode()
102
-
103
- Disable the use of unicode in the progress bar.
104
-
105
- ## log.setGaugeTemplate(template)
106
-
107
- Set a template for outputting the progress bar. See the [gauge documentation] for details.
108
-
109
- [gauge documentation]: https://npmjs.com/package/gauge
110
-
111
- ## log.setGaugeThemeset(themes)
112
-
113
- Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details.
114
-
115
- ## log.pause()
116
-
117
- Stop emitting messages to the stream, but do not drop them.
118
-
119
- ## log.resume()
120
-
121
- Emit all buffered messages that were written while paused.
122
-
123
- ## log.log(level, prefix, message, ...)
124
-
125
- * `level` {String} The level to emit the message at
126
- * `prefix` {String} A string prefix. Set to "" to skip.
127
- * `message...` Arguments to `util.format`
128
-
129
- Emit a log message at the specified level.
130
-
131
- ## log\[level](prefix, message, ...)
132
-
133
- For example,
134
-
135
- * log.silly(prefix, message, ...)
136
- * log.verbose(prefix, message, ...)
137
- * log.info(prefix, message, ...)
138
- * log.http(prefix, message, ...)
139
- * log.warn(prefix, message, ...)
140
- * log.error(prefix, message, ...)
141
-
142
- Like `log.log(level, prefix, message, ...)`. In this way, each level is
143
- given a shorthand, so you can do `log.info(prefix, message)`.
144
-
145
- ## log.addLevel(level, n, style, disp)
146
-
147
- * `level` {String} Level indicator
148
- * `n` {Number} The numeric level
149
- * `style` {Object} Object with fg, bg, inverse, etc.
150
- * `disp` {String} Optional replacement for `level` in the output.
151
-
152
- Sets up a new level with a shorthand function and so forth.
153
-
154
- Note that if the number is `Infinity`, then setting the level to that
155
- will cause all log messages to be suppressed. If the number is
156
- `-Infinity`, then the only way to show it is to enable all log messages.
157
-
158
- ## log.newItem(name, todo, weight)
159
-
160
- * `name` {String} Optional; progress item name.
161
- * `todo` {Number} Optional; total amount of work to be done. Default 0.
162
- * `weight` {Number} Optional; the weight of this item relative to others. Default 1.
163
-
164
- This adds a new `are-we-there-yet` item tracker to the progress tracker. The
165
- object returned has the `log[level]` methods but is otherwise an
166
- `are-we-there-yet` `Tracker` object.
167
-
168
- ## log.newStream(name, todo, weight)
169
-
170
- This adds a new `are-we-there-yet` stream tracker to the progress tracker. The
171
- object returned has the `log[level]` methods but is otherwise an
172
- `are-we-there-yet` `TrackerStream` object.
173
-
174
- ## log.newGroup(name, weight)
175
-
176
- This adds a new `are-we-there-yet` tracker group to the progress tracker. The
177
- object returned has the `log[level]` methods but is otherwise an
178
- `are-we-there-yet` `TrackerGroup` object.
179
-
180
- # Events
181
-
182
- Events are all emitted with the message object.
183
-
184
- * `log` Emitted for all messages
185
- * `log.<level>` Emitted for all messages with the `<level>` level.
186
- * `<prefix>` Messages with prefixes also emit their prefix as an event.
187
-
188
- # Style Objects
189
-
190
- Style objects can have the following fields:
191
-
192
- * `fg` {String} Color for the foreground text
193
- * `bg` {String} Color for the background
194
- * `bold`, `inverse`, `underline` {Boolean} Set the associated property
195
- * `bell` {Boolean} Make a noise (This is pretty annoying, probably.)
196
-
197
- # Message Objects
198
-
199
- Every log event is emitted with a message object, and the `log.record`
200
- list contains all of them that have been created. They have the
201
- following fields:
202
-
203
- * `id` {Number}
204
- * `level` {String}
205
- * `prefix` {String}
206
- * `message` {String} Result of `util.format()`
207
- * `messageRaw` {Array} Arguments to `util.format()`
208
-
209
- # Blocking TTYs
210
-
211
- We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set
212
- stderr and stdout blocking if they are tty's and have the setBlocking call.
213
- This is a work around for an issue in early versions of Node.js 6.x, which
214
- made stderr and stdout non-blocking on OSX. (They are always blocking
215
- Windows and were never blocking on Linux.) `npmlog` needs them to be blocking
216
- so that it can allow output to stdout and stderr to be interlaced.
@@ -1,400 +0,0 @@
1
- 'use strict'
2
- var Progress = require('are-we-there-yet')
3
- var Gauge = require('gauge')
4
- var EE = require('events').EventEmitter
5
- var log = exports = module.exports = new EE()
6
- var util = require('util')
7
-
8
- var setBlocking = require('set-blocking')
9
- var consoleControl = require('console-control-strings')
10
-
11
- setBlocking(true)
12
- var stream = process.stderr
13
- Object.defineProperty(log, 'stream', {
14
- set: function (newStream) {
15
- stream = newStream
16
- if (this.gauge) {
17
- this.gauge.setWriteTo(stream, stream)
18
- }
19
- },
20
- get: function () {
21
- return stream
22
- },
23
- })
24
-
25
- // by default, decide based on tty-ness.
26
- var colorEnabled
27
- log.useColor = function () {
28
- return colorEnabled != null ? colorEnabled : stream.isTTY
29
- }
30
-
31
- log.enableColor = function () {
32
- colorEnabled = true
33
- this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled })
34
- }
35
- log.disableColor = function () {
36
- colorEnabled = false
37
- this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled })
38
- }
39
-
40
- // default level
41
- log.level = 'info'
42
-
43
- log.gauge = new Gauge(stream, {
44
- enabled: false, // no progress bars unless asked
45
- theme: { hasColor: log.useColor() },
46
- template: [
47
- { type: 'progressbar', length: 20 },
48
- { type: 'activityIndicator', kerning: 1, length: 1 },
49
- { type: 'section', default: '' },
50
- ':',
51
- { type: 'logline', kerning: 1, default: '' },
52
- ],
53
- })
54
-
55
- log.tracker = new Progress.TrackerGroup()
56
-
57
- // we track this separately as we may need to temporarily disable the
58
- // display of the status bar for our own loggy purposes.
59
- log.progressEnabled = log.gauge.isEnabled()
60
-
61
- var unicodeEnabled
62
-
63
- log.enableUnicode = function () {
64
- unicodeEnabled = true
65
- this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled })
66
- }
67
-
68
- log.disableUnicode = function () {
69
- unicodeEnabled = false
70
- this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled })
71
- }
72
-
73
- log.setGaugeThemeset = function (themes) {
74
- this.gauge.setThemeset(themes)
75
- }
76
-
77
- log.setGaugeTemplate = function (template) {
78
- this.gauge.setTemplate(template)
79
- }
80
-
81
- log.enableProgress = function () {
82
- if (this.progressEnabled || this._paused) {
83
- return
84
- }
85
-
86
- this.progressEnabled = true
87
- this.tracker.on('change', this.showProgress)
88
- this.gauge.enable()
89
- }
90
-
91
- log.disableProgress = function () {
92
- if (!this.progressEnabled) {
93
- return
94
- }
95
- this.progressEnabled = false
96
- this.tracker.removeListener('change', this.showProgress)
97
- this.gauge.disable()
98
- }
99
-
100
- var trackerConstructors = ['newGroup', 'newItem', 'newStream']
101
-
102
- var mixinLog = function (tracker) {
103
- // mixin the public methods from log into the tracker
104
- // (except: conflicts and one's we handle specially)
105
- Object.keys(log).forEach(function (P) {
106
- if (P[0] === '_') {
107
- return
108
- }
109
-
110
- if (trackerConstructors.filter(function (C) {
111
- return C === P
112
- }).length) {
113
- return
114
- }
115
-
116
- if (tracker[P]) {
117
- return
118
- }
119
-
120
- if (typeof log[P] !== 'function') {
121
- return
122
- }
123
-
124
- var func = log[P]
125
- tracker[P] = function () {
126
- return func.apply(log, arguments)
127
- }
128
- })
129
- // if the new tracker is a group, make sure any subtrackers get
130
- // mixed in too
131
- if (tracker instanceof Progress.TrackerGroup) {
132
- trackerConstructors.forEach(function (C) {
133
- var func = tracker[C]
134
- tracker[C] = function () {
135
- return mixinLog(func.apply(tracker, arguments))
136
- }
137
- })
138
- }
139
- return tracker
140
- }
141
-
142
- // Add tracker constructors to the top level log object
143
- trackerConstructors.forEach(function (C) {
144
- log[C] = function () {
145
- return mixinLog(this.tracker[C].apply(this.tracker, arguments))
146
- }
147
- })
148
-
149
- log.clearProgress = function (cb) {
150
- if (!this.progressEnabled) {
151
- return cb && process.nextTick(cb)
152
- }
153
-
154
- this.gauge.hide(cb)
155
- }
156
-
157
- log.showProgress = function (name, completed) {
158
- if (!this.progressEnabled) {
159
- return
160
- }
161
-
162
- var values = {}
163
- if (name) {
164
- values.section = name
165
- }
166
-
167
- var last = log.record[log.record.length - 1]
168
- if (last) {
169
- values.subsection = last.prefix
170
- var disp = log.disp[last.level] || last.level
171
- var logline = this._format(disp, log.style[last.level])
172
- if (last.prefix) {
173
- logline += ' ' + this._format(last.prefix, this.prefixStyle)
174
- }
175
-
176
- logline += ' ' + last.message.split(/\r?\n/)[0]
177
- values.logline = logline
178
- }
179
- values.completed = completed || this.tracker.completed()
180
- this.gauge.show(values)
181
- }.bind(log) // bind for use in tracker's on-change listener
182
-
183
- // temporarily stop emitting, but don't drop
184
- log.pause = function () {
185
- this._paused = true
186
- if (this.progressEnabled) {
187
- this.gauge.disable()
188
- }
189
- }
190
-
191
- log.resume = function () {
192
- if (!this._paused) {
193
- return
194
- }
195
-
196
- this._paused = false
197
-
198
- var b = this._buffer
199
- this._buffer = []
200
- b.forEach(function (m) {
201
- this.emitLog(m)
202
- }, this)
203
- if (this.progressEnabled) {
204
- this.gauge.enable()
205
- }
206
- }
207
-
208
- log._buffer = []
209
-
210
- var id = 0
211
- log.record = []
212
- log.maxRecordSize = 10000
213
- log.log = function (lvl, prefix, message) {
214
- var l = this.levels[lvl]
215
- if (l === undefined) {
216
- return this.emit('error', new Error(util.format(
217
- 'Undefined log level: %j', lvl)))
218
- }
219
-
220
- var a = new Array(arguments.length - 2)
221
- var stack = null
222
- for (var i = 2; i < arguments.length; i++) {
223
- var arg = a[i - 2] = arguments[i]
224
-
225
- // resolve stack traces to a plain string.
226
- if (typeof arg === 'object' && arg instanceof Error && arg.stack) {
227
- Object.defineProperty(arg, 'stack', {
228
- value: stack = arg.stack + '',
229
- enumerable: true,
230
- writable: true,
231
- })
232
- }
233
- }
234
- if (stack) {
235
- a.unshift(stack + '\n')
236
- }
237
- message = util.format.apply(util, a)
238
-
239
- var m = {
240
- id: id++,
241
- level: lvl,
242
- prefix: String(prefix || ''),
243
- message: message,
244
- messageRaw: a,
245
- }
246
-
247
- this.emit('log', m)
248
- this.emit('log.' + lvl, m)
249
- if (m.prefix) {
250
- this.emit(m.prefix, m)
251
- }
252
-
253
- this.record.push(m)
254
- var mrs = this.maxRecordSize
255
- var n = this.record.length - mrs
256
- if (n > mrs / 10) {
257
- var newSize = Math.floor(mrs * 0.9)
258
- this.record = this.record.slice(-1 * newSize)
259
- }
260
-
261
- this.emitLog(m)
262
- }.bind(log)
263
-
264
- log.emitLog = function (m) {
265
- if (this._paused) {
266
- this._buffer.push(m)
267
- return
268
- }
269
- if (this.progressEnabled) {
270
- this.gauge.pulse(m.prefix)
271
- }
272
-
273
- var l = this.levels[m.level]
274
- if (l === undefined) {
275
- return
276
- }
277
-
278
- if (l < this.levels[this.level]) {
279
- return
280
- }
281
-
282
- if (l > 0 && !isFinite(l)) {
283
- return
284
- }
285
-
286
- // If 'disp' is null or undefined, use the lvl as a default
287
- // Allows: '', 0 as valid disp
288
- var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level
289
- this.clearProgress()
290
- m.message.split(/\r?\n/).forEach(function (line) {
291
- var heading = this.heading
292
- if (heading) {
293
- this.write(heading, this.headingStyle)
294
- this.write(' ')
295
- }
296
- this.write(disp, log.style[m.level])
297
- var p = m.prefix || ''
298
- if (p) {
299
- this.write(' ')
300
- }
301
-
302
- this.write(p, this.prefixStyle)
303
- this.write(' ' + line + '\n')
304
- }, this)
305
- this.showProgress()
306
- }
307
-
308
- log._format = function (msg, style) {
309
- if (!stream) {
310
- return
311
- }
312
-
313
- var output = ''
314
- if (this.useColor()) {
315
- style = style || {}
316
- var settings = []
317
- if (style.fg) {
318
- settings.push(style.fg)
319
- }
320
-
321
- if (style.bg) {
322
- settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1))
323
- }
324
-
325
- if (style.bold) {
326
- settings.push('bold')
327
- }
328
-
329
- if (style.underline) {
330
- settings.push('underline')
331
- }
332
-
333
- if (style.inverse) {
334
- settings.push('inverse')
335
- }
336
-
337
- if (settings.length) {
338
- output += consoleControl.color(settings)
339
- }
340
-
341
- if (style.beep) {
342
- output += consoleControl.beep()
343
- }
344
- }
345
- output += msg
346
- if (this.useColor()) {
347
- output += consoleControl.color('reset')
348
- }
349
-
350
- return output
351
- }
352
-
353
- log.write = function (msg, style) {
354
- if (!stream) {
355
- return
356
- }
357
-
358
- stream.write(this._format(msg, style))
359
- }
360
-
361
- log.addLevel = function (lvl, n, style, disp) {
362
- // If 'disp' is null or undefined, use the lvl as a default
363
- if (disp == null) {
364
- disp = lvl
365
- }
366
-
367
- this.levels[lvl] = n
368
- this.style[lvl] = style
369
- if (!this[lvl]) {
370
- this[lvl] = function () {
371
- var a = new Array(arguments.length + 1)
372
- a[0] = lvl
373
- for (var i = 0; i < arguments.length; i++) {
374
- a[i + 1] = arguments[i]
375
- }
376
-
377
- return this.log.apply(this, a)
378
- }.bind(this)
379
- }
380
- this.disp[lvl] = disp
381
- }
382
-
383
- log.prefixStyle = { fg: 'magenta' }
384
- log.headingStyle = { fg: 'white', bg: 'black' }
385
-
386
- log.style = {}
387
- log.levels = {}
388
- log.disp = {}
389
- log.addLevel('silly', -Infinity, { inverse: true }, 'sill')
390
- log.addLevel('verbose', 1000, { fg: 'cyan', bg: 'black' }, 'verb')
391
- log.addLevel('info', 2000, { fg: 'green' })
392
- log.addLevel('timing', 2500, { fg: 'green', bg: 'black' })
393
- log.addLevel('http', 3000, { fg: 'green', bg: 'black' })
394
- log.addLevel('notice', 3500, { fg: 'cyan', bg: 'black' })
395
- log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN')
396
- log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!')
397
- log.addLevel('silent', Infinity)
398
-
399
- // allow 'error' prefix
400
- log.on('error', function () {})
@@ -1,52 +0,0 @@
1
- {
2
- "author": "GitHub Inc.",
3
- "name": "npmlog",
4
- "description": "logger for npm",
5
- "version": "7.0.1",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/npm/npmlog.git"
9
- },
10
- "main": "lib/log.js",
11
- "files": [
12
- "bin/",
13
- "lib/"
14
- ],
15
- "scripts": {
16
- "test": "tap",
17
- "npmclilint": "npmcli-lint",
18
- "lint": "eslint \"**/*.js\"",
19
- "lintfix": "npm run lint -- --fix",
20
- "posttest": "npm run lint",
21
- "postsnap": "npm run lintfix --",
22
- "postlint": "template-oss-check",
23
- "snap": "tap",
24
- "template-oss-apply": "template-oss-apply --force"
25
- },
26
- "dependencies": {
27
- "are-we-there-yet": "^4.0.0",
28
- "console-control-strings": "^1.1.0",
29
- "gauge": "^5.0.0",
30
- "set-blocking": "^2.0.0"
31
- },
32
- "devDependencies": {
33
- "@npmcli/eslint-config": "^4.0.0",
34
- "@npmcli/template-oss": "4.6.1",
35
- "tap": "^16.0.1"
36
- },
37
- "license": "ISC",
38
- "engines": {
39
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
40
- },
41
- "tap": {
42
- "branches": 95,
43
- "nyc-arg": [
44
- "--exclude",
45
- "tap-snapshots/**"
46
- ]
47
- },
48
- "templateOSS": {
49
- "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
50
- "version": "4.6.1"
51
- }
52
- }
@@ -1,14 +0,0 @@
1
- Copyright (c) 2016, Contributors
2
-
3
- Permission to use, copy, modify, and/or distribute this software
4
- for any purpose with or without fee is hereby granted, provided
5
- that the above copyright notice and this permission notice
6
- appear in all copies.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
10
- OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
11
- LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
12
- OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
13
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
14
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,31 +0,0 @@
1
- # set-blocking
2
-
3
- [![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking)
4
- [![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking)
5
- [![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master)
6
- [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
7
-
8
- set blocking `stdio` and `stderr` ensuring that terminal output does not truncate.
9
-
10
- ```js
11
- const setBlocking = require('set-blocking')
12
- setBlocking(true)
13
- console.log(someLargeStringToOutput)
14
- ```
15
-
16
- ## Historical Context/Word of Warning
17
-
18
- This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on
19
- newer versions of Node.js (`0.12+`), truncating terminal output.
20
-
21
- You should be mindful of the side-effects caused by using `set-blocking`:
22
-
23
- * if your module sets blocking to `true`, it will effect other modules
24
- consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call
25
- `setBlocking(true)` once we already know we are about to call `process.exit(code)`.
26
- * this patch will not apply to subprocesses spawned with `isTTY = true`, this is
27
- the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
28
-
29
- ## License
30
-
31
- ISC