tasmota-webserial-esptool 6.0.1

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 (65) hide show
  1. package/.github/dependabot.yml +10 -0
  2. package/.github/workflows/build_upload.yml +31 -0
  3. package/.github/workflows/ci.yml +22 -0
  4. package/.prettierignore +1 -0
  5. package/README.md +18 -0
  6. package/css/dark.css +91 -0
  7. package/css/light.css +79 -0
  8. package/css/style.css +383 -0
  9. package/dist/const.d.ts +159 -0
  10. package/dist/const.js +252 -0
  11. package/dist/esp_loader.d.ts +166 -0
  12. package/dist/esp_loader.js +931 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.js +12 -0
  15. package/dist/struct.d.ts +2 -0
  16. package/dist/struct.js +105 -0
  17. package/dist/stubs/esp32.json +1 -0
  18. package/dist/stubs/esp32c3.json +1 -0
  19. package/dist/stubs/esp32s2.json +1 -0
  20. package/dist/stubs/esp32s3.json +1 -0
  21. package/dist/stubs/esp8266.json +1 -0
  22. package/dist/stubs/index.d.ts +10 -0
  23. package/dist/stubs/index.js +26 -0
  24. package/dist/util.d.ts +14 -0
  25. package/dist/util.js +46 -0
  26. package/dist/web/esp32-a2dcbc2e.js +1 -0
  27. package/dist/web/esp32c3-18e9678b.js +1 -0
  28. package/dist/web/esp32s2-3109ccc6.js +1 -0
  29. package/dist/web/esp32s3-c1dbd867.js +1 -0
  30. package/dist/web/esp8266-144419c0.js +1 -0
  31. package/dist/web/index.js +1 -0
  32. package/index.html +196 -0
  33. package/js/esptool.js +1292 -0
  34. package/js/modules/esp32-a2dcbc2e.js +1 -0
  35. package/js/modules/esp32c3-18e9678b.js +1 -0
  36. package/js/modules/esp32s2-3109ccc6.js +1 -0
  37. package/js/modules/esp32s3-c1dbd867.js +1 -0
  38. package/js/modules/esp8266-144419c0.js +1 -0
  39. package/js/modules/esptool.js +1 -0
  40. package/js/script.js +447 -0
  41. package/js/utilities.js +148 -0
  42. package/license.md +12 -0
  43. package/package.json +36 -0
  44. package/rollup.config.js +27 -0
  45. package/script/build +8 -0
  46. package/script/develop +17 -0
  47. package/script/stubgen.py +47 -0
  48. package/src/const.ts +315 -0
  49. package/src/esp_loader.ts +1204 -0
  50. package/src/index.ts +27 -0
  51. package/src/struct.ts +115 -0
  52. package/src/stubs/esp32.json +1 -0
  53. package/src/stubs/esp32c2.json +1 -0
  54. package/src/stubs/esp32c3.json +1 -0
  55. package/src/stubs/esp32h2.json +1 -0
  56. package/src/stubs/esp32s2.json +1 -0
  57. package/src/stubs/esp32s3.json +1 -0
  58. package/src/stubs/esp8266.json +1 -0
  59. package/src/stubs/index.ts +48 -0
  60. package/src/util.ts +49 -0
  61. package/stubs/esp32c2.json +1 -0
  62. package/stubs/esp32c3.json +1 -0
  63. package/stubs/esp32h2.json +1 -0
  64. package/stubs/esp32s3.json +1 -0
  65. package/tsconfig.json +19 -0
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: "npm"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,31 @@
1
+ name: Build and upload
2
+
3
+ on:
4
+ push:
5
+ workflow_dispatch:
6
+
7
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8
+ permissions:
9
+ contents: write
10
+ pages: write
11
+ id-token: write
12
+
13
+ # Allow one concurrent deployment
14
+ concurrency:
15
+ group: environment-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ deploy:
20
+ name: Deploy
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+ - uses: actions/setup-node@v3
25
+ with:
26
+ node-version: '16.x'
27
+ registry-url: 'https://registry.npmjs.org'
28
+ - run: npm ci
29
+ - run: npm publish
30
+ env:
31
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,22 @@
1
+ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
+
4
+ name: CI
5
+
6
+ on:
7
+ push:
8
+ pull_request:
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - name: Use Node.js
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 16
20
+ - run: npm ci
21
+ - run: script/build
22
+ - run: npm exec -- prettier --check src
@@ -0,0 +1 @@
1
+ src/stubs
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # Fork of Adafruit WebSerial ESPTool
2
+
3
+ JavaScript package to install firmware on ESP devices via the browser using WebSerial.
4
+
5
+ ## Changes done to upstream
6
+
7
+ - added auto download mode for CDC
8
+
9
+ ## Local development
10
+
11
+ - Clone this repository.
12
+ - Install dependencies with `npm`
13
+ - Run `script/develop`
14
+ - Open http://localhost:5004/
15
+
16
+ ## Origin
17
+
18
+ This project was originally written by [Melissa LeBlanc-Williams](https://github.com/makermelissa). [Nabu Casa](https://www.nabucasa.com) ported the code over to TypeScript and in March 2022 took over maintenance from Adafruit. In July 2022, the Nabucasa stopped maintaining the project in favor of an official, but very early release of Espressif's [esptool-js](https://github.com/espressif/esptool-js/). Due to the instability of the tool, Adafruit updated their fork with Nabucasa's changes in November 2022 and took over maintenance once again.
package/css/dark.css ADDED
@@ -0,0 +1,91 @@
1
+ .header {
2
+ background: #000;
3
+ color: #fff;
4
+ }
5
+
6
+ body {
7
+ background-color: #333;
8
+ color: #fff;
9
+ }
10
+
11
+ input, select, button {
12
+ background-color: #333;
13
+ color: #fff;
14
+ }
15
+
16
+ .footer button {
17
+ border-color: #fff;
18
+ background-color: #333;
19
+ color: #fff;
20
+ }
21
+
22
+ .footer button:hover {
23
+ background-color: #fff;
24
+ color: #333;
25
+ }
26
+
27
+ .remix button {
28
+ border-color: #fff;
29
+ color: #fff;
30
+ }
31
+
32
+ .remix button:hover {
33
+ background-color: #fff;
34
+ }
35
+
36
+
37
+ #commands button {
38
+ border-color: #fff;
39
+ background-color: #333;
40
+ color: #fff;
41
+ }
42
+
43
+ #commands button:hover {
44
+ background-color: #fff;
45
+ color: #333;
46
+ }
47
+
48
+ .notSupported, .notSupported a {
49
+ background-color: red;
50
+ color: white;
51
+ }
52
+
53
+ .firmware {
54
+ border-color: #fff;
55
+ color: #fff;
56
+ }
57
+
58
+ .firmware:focus,
59
+ .firmware:hover {
60
+ background-color: #fff;
61
+ color: #333;
62
+ }
63
+
64
+ .firmware:disabled {
65
+ color: #ccc;
66
+ border-color: #ccc;
67
+ }
68
+
69
+ .firmware:disabled:hover {
70
+ background-color: #fff;
71
+ }
72
+
73
+ input {
74
+ background-color: #fff;
75
+ color: #333;
76
+ }
77
+
78
+ #commands .buttons button:disabled,
79
+ #commands .buttons button:disabled:hover{
80
+ border-color: #999;
81
+ background-color: #888;
82
+ color: #ccc;
83
+ }
84
+
85
+ #commands .buttons button:hover {
86
+ background-color: #fff;
87
+ }
88
+
89
+ .progress-bar {
90
+ border-color: #fff;
91
+ }
package/css/light.css ADDED
@@ -0,0 +1,79 @@
1
+ .header {
2
+ background: #000;
3
+ color: #fff;
4
+ }
5
+
6
+ body {
7
+ background-color: #fff;
8
+ color: #000;
9
+ }
10
+
11
+ input, select, button {
12
+ background-color: #fff;
13
+ color: #000;
14
+ }
15
+
16
+ .notSupported, .notSupported a {
17
+ background-color: red;
18
+ color: white;
19
+ }
20
+
21
+ .footer button {
22
+ border-color: #63338f;
23
+ background-color: #fff;
24
+ color: #63338f;
25
+ }
26
+
27
+ .footer button:hover {
28
+ background-color: #63338f;
29
+ color: #fff;
30
+ }
31
+
32
+ .remix button {
33
+ border-color: #333;
34
+ color: #333;
35
+ }
36
+
37
+ .remix button:hover {
38
+ background-color: #333;
39
+ }
40
+
41
+ .firmware {
42
+ border-color: #63338f;
43
+ color: #63338f;
44
+ }
45
+
46
+ .firmware:focus,
47
+ .firmware:hover {
48
+ background-color: #63338f;
49
+ color: #fff;
50
+ }
51
+
52
+ .firmware:disabled {
53
+ background-color: #ddd;
54
+ color: #888;
55
+ }
56
+
57
+ .firmware:disabled:hover {
58
+ background-color: #ddd;
59
+ }
60
+
61
+ #commands .buttons button {
62
+ border-color: #333;
63
+ }
64
+
65
+ #commands .buttons button:disabled,
66
+ #commands .buttons button:disabled:hover {
67
+ border-color: #ccc;
68
+ background-color: #ddd;
69
+ color: #888;
70
+ }
71
+
72
+ #commands .buttons button:hover {
73
+ background-color: #333;
74
+ color: #fff;
75
+ }
76
+
77
+ .progress-bar {
78
+ border-color: #333;
79
+ }
package/css/style.css ADDED
@@ -0,0 +1,383 @@
1
+ /**
2
+ * Header
3
+ */
4
+
5
+ .header {
6
+ box-sizing: border-box;
7
+ font-size: 16px;
8
+ height: 85px;
9
+ line-height: 40px;
10
+ padding: 20px 70px 0px 70px; /* TRouBLe */
11
+ position: fixed;
12
+ width: 100%;
13
+ z-index: 1000;
14
+ margin: 0;
15
+ border-bottom: 5px solid #00a7e9;
16
+ }
17
+
18
+ .header h1 {
19
+ flex: 1;
20
+ font-size: 20px;
21
+ font-weight: 400;
22
+ }
23
+
24
+ .header button {
25
+ border: solid 2px #fff;
26
+ background-color: #000;
27
+ color: #fff;
28
+ margin-left: 20px;
29
+ height: 30px;
30
+ }
31
+
32
+ .header button:hover {
33
+ background-color: #fff;
34
+ color: #000;
35
+ }
36
+
37
+ button,
38
+ .firmware {
39
+ height: 25px;
40
+ font-size: 16px;
41
+ border-radius: 15px;
42
+ padding-left: 20px;
43
+ padding-right: 20px;
44
+ border-width: 2px;
45
+ }
46
+
47
+ body {
48
+ font-family: proxima-nova, sans-serif;
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ margin: 0;
52
+ }
53
+
54
+ p {
55
+ margin: 0;
56
+ }
57
+
58
+ input,
59
+ select,
60
+ button,
61
+ label {
62
+ font-weight: 600;
63
+ outline: none;
64
+ }
65
+
66
+ div.left {
67
+ float: left;
68
+ display: flex;
69
+ align-items: center;
70
+ }
71
+
72
+ div.right {
73
+ float: right;
74
+ display: flex;
75
+ align-items: center;
76
+ }
77
+
78
+ div.clear {
79
+ clear: both;
80
+ }
81
+
82
+ .main {
83
+ overflow-x: hidden;
84
+ overflow-y: auto;
85
+ padding-top: 80px;
86
+ }
87
+
88
+ .hidden {
89
+ display: none;
90
+ }
91
+
92
+ .notSupported {
93
+ padding: 1em;
94
+ margin-top: 1em;
95
+ margin-bottom: 1em;
96
+ }
97
+
98
+ .subheader {
99
+ height: 100px;
100
+ line-height: 100px;
101
+ padding-left: 70px;
102
+ padding-right: 70px;
103
+ }
104
+
105
+ .subheader .title {
106
+ font-size: 36px;
107
+ font-weight: 500;
108
+ }
109
+
110
+ #app.connected #commands {
111
+ height: 200px;
112
+ }
113
+
114
+ #app.connected #log {
115
+ height: calc(100vh - 530px);
116
+ }
117
+
118
+ #app #commands {
119
+ height: 0;
120
+ }
121
+
122
+ #app #log {
123
+ height: calc(100vh - 330px);
124
+ }
125
+
126
+ #commands,
127
+ #log {
128
+ transition: height 0.5s;
129
+ }
130
+
131
+ #commands {
132
+ position: relative;
133
+ margin: 0 auto;
134
+ overflow-y: auto;
135
+ padding: 0 60px;
136
+ }
137
+
138
+ #log {
139
+ max-width: 100%;
140
+ font-family: pt-mono, monospace;
141
+ font-style: normal;
142
+ font-weight: 400;
143
+ font-size: 16px;
144
+ overflow-x: hidden;
145
+ overflow-x: auto;
146
+ transition: color 0.1s linear;
147
+ padding: 0 50px;
148
+ border: 20px solid #000;
149
+ -ms-overflow-style: none;
150
+ scrollbar-width: none;
151
+ background-color: #000;
152
+ color: #cecece;
153
+ }
154
+
155
+ #log::-webkit-scrollbar {
156
+ display: none;
157
+ }
158
+
159
+ .footer {
160
+ padding-left: 70px;
161
+ padding-right: 70px;
162
+ }
163
+
164
+ .footer a {
165
+ color: blue;
166
+ }
167
+
168
+ .footer .controls {
169
+ line-height: 45px;
170
+ }
171
+
172
+ .footer button {
173
+ font-size: 14px;
174
+ margin: 0 10px;
175
+ }
176
+
177
+ .remix {
178
+ display: flex;
179
+ justify-content: center;
180
+ height: 60px;
181
+ position: relative;
182
+ }
183
+
184
+ .remix button {
185
+ position: absolute;
186
+ bottom: 11px;
187
+ }
188
+
189
+ #templates {
190
+ display: none;
191
+ }
192
+
193
+ /* On/Off Switch Widget */
194
+ .onoffswitch {
195
+ display: inline-block;
196
+ position: relative;
197
+ width: 50px;
198
+ -webkit-user-select: none;
199
+ -moz-user-select: none;
200
+ -ms-user-select: none;
201
+ margin-left: 10px;
202
+ }
203
+
204
+ .onoffswitch-checkbox {
205
+ display: none;
206
+ }
207
+
208
+ .onoffswitch-label {
209
+ display: block;
210
+ overflow: hidden;
211
+ cursor: pointer;
212
+ border: 1px solid #900;
213
+ border-radius: 15px;
214
+ transition: border 0.3s ease-in 0s;
215
+ }
216
+
217
+ .onoffswitch-inner {
218
+ display: block;
219
+ width: 200%;
220
+ margin-left: -100%;
221
+ transition: margin 0.3s ease-in 0s;
222
+ }
223
+
224
+ .onoffswitch-inner:before,
225
+ .onoffswitch-inner:after {
226
+ display: block;
227
+ float: left;
228
+ width: 50%;
229
+ height: 25px;
230
+ padding: 0;
231
+ line-height: 25px;
232
+ font-size: 14px;
233
+ color: white;
234
+ font-family: proxima-nova, sans-serif;
235
+ font-style: normal;
236
+ font-weight: 600;
237
+ box-sizing: border-box;
238
+ }
239
+
240
+ .onoffswitch-inner:before {
241
+ content: "on";
242
+ padding-left: 6px;
243
+ background-color: #8ec641;
244
+ color: #fff;
245
+ }
246
+
247
+ .onoffswitch-inner:after {
248
+ content: "off";
249
+ padding-right: 6px;
250
+ background-color: #c64141;
251
+ color: #fff;
252
+ text-align: right;
253
+ }
254
+
255
+ .onoffswitch-switch {
256
+ display: block;
257
+ width: 19px;
258
+ margin: 3px;
259
+ background: #fff;
260
+ position: absolute;
261
+ top: 0;
262
+ bottom: 0;
263
+ right: 23px;
264
+ border: 1px solid #900;
265
+ border-radius: 15px;
266
+ transition: all 0.3s ease-in 0s;
267
+ }
268
+
269
+ .onoffswitch-checkbox:checked + .onoffswitch-label {
270
+ border-color: #71ae1e;
271
+ }
272
+
273
+ .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
274
+ margin-left: 0;
275
+ }
276
+
277
+ .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
278
+ right: 0px;
279
+ border-color: #67ac38;
280
+ }
281
+
282
+ .footer .onoffswitch {
283
+ margin-right: 20px;
284
+ top: 7px;
285
+ }
286
+
287
+ #butClear {
288
+ margin-top: 10px;
289
+ }
290
+
291
+ #commands {
292
+ min-width: 600px;
293
+ justify-content: center;
294
+ position: relative;
295
+ align-items: center;
296
+ }
297
+
298
+ #commands .upload {
299
+ width: 600px;
300
+ display: flex;
301
+ align-items: center;
302
+ margin: 5px auto;
303
+ justify-content: center;
304
+ }
305
+
306
+ #commands .upload .offset {
307
+ width: 50px;
308
+ }
309
+
310
+ #commands .upload label {
311
+ white-space: nowrap;
312
+ }
313
+
314
+ .firmware > input {
315
+ width: 0.1px;
316
+ height: 0.1px;
317
+ opacity: 0;
318
+ overflow: hidden;
319
+ position: absolute;
320
+ z-index: -1;
321
+ }
322
+
323
+ .firmware {
324
+ border-style: solid;
325
+ margin-left: 20px;
326
+ margin-right: 20px;
327
+ display: flex;
328
+ align-items: center;
329
+ cursor: pointer;
330
+ }
331
+
332
+ .firmware > svg {
333
+ margin-right: 10px;
334
+ }
335
+
336
+ .debug-function {
337
+ color: #8ec641;
338
+ }
339
+
340
+ .error-message {
341
+ color: #c64141;
342
+ }
343
+
344
+ .timestamp {
345
+ color: #8ec641;
346
+ }
347
+
348
+ .progress-bar {
349
+ width: 100%;
350
+ height: 24px;
351
+ border-style: solid;
352
+ border-width: 2px;
353
+ border-radius: 10px;
354
+ padding: 0;
355
+ overflow: hidden;
356
+ }
357
+
358
+ .progress-bar > div {
359
+ height: 24px;
360
+ background-color: #71ae1e;
361
+ width: 0;
362
+ }
363
+
364
+ #commands .buttons {
365
+ display: flex;
366
+ justify-content: center;
367
+ width: 600px;
368
+ margin: 10px auto;
369
+ }
370
+
371
+ #commands .buttons button {
372
+ margin-left: 10px;
373
+ margin-right: 10px;
374
+ border-width: 2px;
375
+ border-style: solid;
376
+ }
377
+ .justify {
378
+ display: flex;
379
+ justify-content: space-between;
380
+ }
381
+ .center {
382
+ text-align: center;
383
+ }