netlify-cli 12.0.4 → 12.0.5

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "12.0.4",
3
+ "version": "12.0.5",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "12.0.4",
9
+ "version": "12.0.5",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "12.0.4",
4
+ "version": "12.0.5",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -166,7 +166,7 @@
166
166
  "/src/**/*.sh",
167
167
  "/src/**/*.ps1",
168
168
  "/src/functions-templates/**",
169
- "/src/lib/functions/templates/**",
169
+ "/src/lib/templates/**",
170
170
  "!/src/**/node_modules/**",
171
171
  "!/src/**/*.test.js"
172
172
  ],
@@ -0,0 +1,311 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Invocation Failed</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <style>
7
+ :root {
8
+ --colorDefaultTextColor: #a3a9ac;
9
+ --colorDefaultTextColorCard: #2d3b41;
10
+ --colorBgApp: rgb(14, 30, 37);
11
+ --colorBgInverse: hsl(175, 48%, 98%);
12
+ --colorTextMuted: rgb(100, 110, 115);
13
+ --colorError: #d32254;
14
+ --colorBgCard: #fff;
15
+ --colorShadow: #0e1e251f;
16
+ --colorErrorText: rgb(142, 11, 48);
17
+ --colorCardTitleCard: #2d3b41;
18
+ --colorStackText: #222;
19
+ --colorCodeText: #f5f5f5;
20
+ }
21
+
22
+ body {
23
+ background-color: var(--colorBgApp);
24
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
25
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
26
+ color: var(--colorDefaultTextColor);
27
+ margin: 0;
28
+ }
29
+
30
+ main {
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ justify-content: center;
35
+ width: 100vw;
36
+ }
37
+
38
+ a,
39
+ a:visited,
40
+ a:hover,
41
+ a:focus {
42
+ color: var(--colorDefaultTextColor);
43
+ border-bottom: 1px solid var(--colorDefaultTextColor);
44
+ text-decoration: none;
45
+ }
46
+
47
+ section {
48
+ width: 80%;
49
+ max-width: 800px;
50
+ margin: 40px auto;
51
+ position: relative;
52
+ padding: 24px;
53
+ }
54
+
55
+ section.card {
56
+ border-radius: 8px;
57
+ background: var(--colorBgCard);
58
+ box-shadow: 0px 2px 4px rgba(14, 30, 37, 0.12);
59
+ border-top-width: 8px;
60
+ border-top-style: solid;
61
+ border-top-color: var(--colorError);
62
+ padding: 24px;
63
+ color: var(--colorDefaultTextColorCard);
64
+ }
65
+
66
+ .card h1 {
67
+ display: flex;
68
+ align-items: center;
69
+ margin-top: 0;
70
+ }
71
+ .card h1 svg {
72
+ margin-right: 16px;
73
+ }
74
+ .card a {
75
+ color: var(--colorDefaultTextColorCard);
76
+ }
77
+
78
+ p.error-message {
79
+ color: var(--colorErrorText);
80
+ }
81
+
82
+ h1 {
83
+ margin-bottom: 24px;
84
+ }
85
+
86
+ h2 {
87
+ font-size: 22px;
88
+ margin: 0;
89
+ }
90
+
91
+ .card h2,
92
+ .card h3,
93
+ .card h1 {
94
+ color: var(--colorCardTitleCard);
95
+ }
96
+
97
+ h3 {
98
+ font-size: 18px;
99
+ margin: 0;
100
+ color: var(--colorCardTitleCard);
101
+ }
102
+
103
+ pre {
104
+ background-color: var(--colorCodeText);
105
+ color: var(--colorStackText);
106
+ overflow: scroll;
107
+ padding: 8px 12px;
108
+ border-radius: 8px;
109
+ font-size: 16px;
110
+ }
111
+
112
+ .no-js pre {
113
+ white-space: pre-wrap;
114
+ }
115
+
116
+ .inline-code {
117
+ background-color: var(--colorCodeText);
118
+ color: var(--colorStackText);
119
+ overflow: scroll;
120
+ padding: 4px 8px;
121
+ border-radius: 8px;
122
+ font-size: 16px;
123
+ }
124
+
125
+ ul,
126
+ li {
127
+ list-style-type: none;
128
+ margin: 0;
129
+ padding: 0;
130
+ }
131
+
132
+ svg {
133
+ width: 40px;
134
+ height: 40px;
135
+ }
136
+
137
+ .sad path {
138
+ fill: #d32254;
139
+ }
140
+
141
+ .next-steps li {
142
+ margin: 16px 0;
143
+ }
144
+
145
+ .connection-details {
146
+ display: block;
147
+ margin-top: 32px;
148
+ }
149
+
150
+ .error-message-details {
151
+ font-family: monospace;
152
+ padding: 8px 12px;
153
+ }
154
+
155
+ .stack-trace {
156
+ margin-top: 32px;
157
+ }
158
+
159
+ .no-js .error-message-details,
160
+ .no-js .stack-trace {
161
+ display: none;
162
+ }
163
+
164
+ .raw-error-details,
165
+ .hidden {
166
+ display: none;
167
+ }
168
+
169
+ .no-js .raw-error-details {
170
+ display: block;
171
+ }
172
+ </style>
173
+ </head>
174
+
175
+ <body class="netlify-function-error-page no-js">
176
+ <script>
177
+ document.body.classList.remove('no-js')
178
+ </script>
179
+
180
+ <main>
181
+ <section class="card">
182
+ <header>
183
+ <h1>
184
+ <svg
185
+ class="sad"
186
+ aria-hidden="true"
187
+ width="22"
188
+ height="22"
189
+ viewBox="0 0 22 22"
190
+ fill="none"
191
+ xmlns="http://www.w3.org/2000/svg"
192
+ >
193
+ <path
194
+ fill-rule="evenodd"
195
+ clip-rule="evenodd"
196
+ d="M11 21.5C16.799 21.5 21.5 16.799 21.5 11C21.5 5.20101 16.799 0.5 11 0.5C5.20101 0.5 0.5 5.20101 0.5 11C0.5 16.799 5.20101 21.5 11 21.5ZM12.125 6.125C12.125 5.82663 12.0065 5.54048 11.7955 5.3295C11.5845 5.11853 11.2984 5 11 5C10.7016 5 10.4155 5.11853 10.2045 5.3295C9.99353 5.54048 9.875 5.82663 9.875 6.125V11.375C9.875 11.6734 9.99353 11.9595 10.2045 12.1705C10.4155 12.3815 10.7016 12.5 11 12.5C11.2984 12.5 11.5845 12.3815 11.7955 12.1705C12.0065 11.9595 12.125 11.6734 12.125 11.375V6.125ZM12.5 15.5C12.5 15.8978 12.342 16.2794 12.0607 16.5607C11.7794 16.842 11.3978 17 11 17C10.6022 17 10.2206 16.842 9.93934 16.5607C9.65804 16.2794 9.5 15.8978 9.5 15.5C9.5 15.1022 9.65804 14.7206 9.93934 14.4393C10.2206 14.158 10.6022 14 11 14C11.3978 14 11.7794 14.158 12.0607 14.4393C12.342 14.7206 12.5 15.1022 12.5 15.5Z"
197
+ fill="#900B31"
198
+ />
199
+ </svg>
200
+ This
201
+ <!--@FUNCTION-TYPE-->
202
+ has crashed
203
+ </h1>
204
+ <p>An unhandled error in the function code triggered the following message:</p>
205
+ <p class="error-message-details hidden inline-code">
206
+ <span class="error-type"></span><span class="error-message"></span>
207
+ </p>
208
+ </header>
209
+
210
+ <pre class="raw-error-details"><code><!--@ERROR-DETAILS--></code></pre>
211
+
212
+ <div class="stack-trace hidden">
213
+ <h3>Stack trace</h3>
214
+ <pre><code></code></pre>
215
+ </div>
216
+ </section>
217
+ <script>
218
+ /* eslint eslint-comments/no-use: off */
219
+ // eslint-disable-next-line func-names
220
+ ;(function () {
221
+ const rawErrorDetails = document.querySelector('.raw-error-details code').textContent
222
+ const errorMessageDetailsElement = document.querySelector('.error-message-details')
223
+ const errorTypeElement = document.querySelector('.error-type')
224
+ const errorMessageElement = document.querySelector('.error-message')
225
+ const stackTraceElement = document.querySelector('.stack-trace')
226
+ const stackTraceCodeElement = document.querySelector('.stack-trace code')
227
+
228
+ // Enriching the error details
229
+ let parsedErrorDetails
230
+ try {
231
+ parsedErrorDetails = JSON.parse(rawErrorDetails.trim())
232
+ } catch (error) {
233
+ console.error(error)
234
+ document.body.classList.add('no-js')
235
+ return
236
+ }
237
+
238
+ if (!parsedErrorDetails) {
239
+ return
240
+ }
241
+
242
+ const hasTrace =
243
+ (Array.isArray(parsedErrorDetails.trace) && parsedErrorDetails.trace.length !== 0) ||
244
+ (Array.isArray(parsedErrorDetails.stackTrace) && parsedErrorDetails.stackTrace.length !== 0)
245
+
246
+ if (parsedErrorDetails && hasTrace) {
247
+ stackTraceElement.classList.remove('hidden')
248
+ }
249
+
250
+ if (parsedErrorDetails.errorType) {
251
+ // enriching error types via allowing them to be linked to a relevant MDN article if they are in the known list
252
+ // https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/error#error_types
253
+ const errorTypes = [
254
+ 'EvalError',
255
+ 'RangeError',
256
+ 'ReferenceError',
257
+ 'SyntaxError',
258
+ 'TypeError',
259
+ 'URIError',
260
+ 'AggregateError',
261
+ 'InternalError',
262
+ ]
263
+ if (errorTypes.includes(parsedErrorDetails.errorType)) {
264
+ const mdnLink = document.createElement('a')
265
+ mdnLink.href = `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/${parsedErrorDetails.errorType}`
266
+ mdnLink.textContent = parsedErrorDetails.errorType
267
+ mdnLink.target = '_blank'
268
+ errorTypeElement.append(mdnLink)
269
+ } else {
270
+ errorTypeElement.textContent = parsedErrorDetails.errorType
271
+ }
272
+ }
273
+
274
+ if (parsedErrorDetails.errorMessage || parsedErrorDetails.errorType) {
275
+ errorMessageDetailsElement.classList.remove('hidden')
276
+ }
277
+
278
+ if (parsedErrorDetails.errorMessage) {
279
+ errorMessageElement.textContent =
280
+ (parsedErrorDetails.errorType ? ' - ' : ' ') + parsedErrorDetails.errorMessage
281
+ }
282
+
283
+ // Go errors currently use "stackTrace" with a different structure than "trace"
284
+ // map these into a shared format.
285
+ if (Array.isArray(parsedErrorDetails.stackTrace) && parsedErrorDetails.stackTrace.length !== 0) {
286
+ parsedErrorDetails.trace = parsedErrorDetails.stackTrace.reduce((newTrace, traceDetail) => {
287
+ let traceLine = ''
288
+ if (traceDetail.path) {
289
+ /* eslint-disable no-negated-condition */
290
+ traceLine += `${traceDetail.path}${traceDetail.line !== undefined ? `:${traceDetail.line}` : ''} ${
291
+ traceDetail.label !== undefined ? `${traceDetail.label} ` : ''
292
+ }`
293
+ /* eslint-enable no-negated-condition */
294
+ if (traceLine) {
295
+ newTrace.push(traceLine)
296
+ }
297
+ }
298
+ return newTrace
299
+ }, [])
300
+ }
301
+
302
+ if (Array.isArray(parsedErrorDetails.trace) && parsedErrorDetails.trace.length !== 0) {
303
+ stackTraceCodeElement.textContent = parsedErrorDetails.trace.join('\n')
304
+ } else {
305
+ stackTraceCodeElement.remove()
306
+ }
307
+ })()
308
+ </script>
309
+ </main>
310
+ </body>
311
+ </html>