@calvear/env 3.0.0 β 3.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.
- package/README.md +515 -661
- package/assets/logo.svg +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,661 +1,515 @@
|
|
|
1
|
-
<div id="top" align="center">
|
|
2
|
-
<img
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
| `-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
> env -e
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
|
|
416
|
-
"
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
if (env === 'dev')
|
|
517
|
-
return {
|
|
518
|
-
NODE_ENV: 'development',
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
// you can return a list of JSON environment variables for merge
|
|
522
|
-
return [
|
|
523
|
-
{
|
|
524
|
-
NODE_ENV: 'production',
|
|
525
|
-
ANY_VAR: 'ABC', // will be replaced by value below
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
ANY_VAR: 'ANY_VALUE',
|
|
529
|
-
ANY_GROUP: {
|
|
530
|
-
INNER_VAR: 12,
|
|
531
|
-
},
|
|
532
|
-
},
|
|
533
|
-
];
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
// (optional) call on pulling variables from provider store,
|
|
537
|
-
// config may pass in your config file
|
|
538
|
-
pull: ({ env, modes, ...options }, config) => {
|
|
539
|
-
// anyway you want for pulling variables to cache
|
|
540
|
-
},
|
|
541
|
-
|
|
542
|
-
// (optional) call on pushing/updating variables to provider store,
|
|
543
|
-
// config may pass in your config file
|
|
544
|
-
push: ({ env, modes, ...options }, config) => {
|
|
545
|
-
// anyway you should do for pushing or updating your variables
|
|
546
|
-
},
|
|
547
|
-
};
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
551
|
-
|
|
552
|
-
<!-- CONFIG -->
|
|
553
|
-
|
|
554
|
-
## π₯ **Config**
|
|
555
|
-
|
|
556
|
-
You can configure any config argument inside you config file, but commonly providers are designed for this purpose.
|
|
557
|
-
|
|
558
|
-
```javascript
|
|
559
|
-
{
|
|
560
|
-
"log": "silly",
|
|
561
|
-
// will hide values of keys SECRET and MY_API_KEY in logging
|
|
562
|
-
"logMaskValuesOfKeys": ["SECRET", "MY_API_KEY"],
|
|
563
|
-
// integrated providers and custom providers together
|
|
564
|
-
"providers": [
|
|
565
|
-
{
|
|
566
|
-
"path": "package-json",
|
|
567
|
-
"type": "integrated"
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
"path": "app-settings",
|
|
571
|
-
"type": "integrated"
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
"path": "secrets",
|
|
575
|
-
"type": "integrated"
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
"path": "local",
|
|
579
|
-
"type": "integrated"
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
// custom NPM package
|
|
583
|
-
"path": "@npm-package",
|
|
584
|
-
"type": "module",
|
|
585
|
-
"config": {
|
|
586
|
-
"any-config": "any value"
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
{
|
|
590
|
-
// custom script inside project
|
|
591
|
-
"path": "scripts/custom-loader.js",
|
|
592
|
-
"type": "script"
|
|
593
|
-
}
|
|
594
|
-
]
|
|
595
|
-
}
|
|
596
|
-
```
|
|
597
|
-
|
|
598
|
-
<!-- ROADMAP -->
|
|
599
|
-
|
|
600
|
-
## π Roadmap
|
|
601
|
-
|
|
602
|
-
- [x] Environment injection handling
|
|
603
|
-
- [x] Customizable variables store providers
|
|
604
|
-
- [x] Commands
|
|
605
|
-
- [x] `push` executes a pushing action over every providers
|
|
606
|
-
- [x] `pull` executes a pulling action over every providers
|
|
607
|
-
- [x] `schema` regenerates JSON schema using providers output
|
|
608
|
-
- [x] `export` exports environment variables in json or dotenv format
|
|
609
|
-
- [ ] `prepare` prepares environment (creates folder and files required)
|
|
610
|
-
- [ ] Improve documentation
|
|
611
|
-
- [ ] Providers pull history
|
|
612
|
-
- [ ] Providers pull and push difference calc and prompts
|
|
613
|
-
- [ ] Providers dependsOn option
|
|
614
|
-
- [ ] Programatic module
|
|
615
|
-
|
|
616
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
617
|
-
|
|
618
|
-
## π§Ώ **Linting**
|
|
619
|
-
|
|
620
|
-
Project uses ESLint, for code formatting and code styling normalizing.
|
|
621
|
-
|
|
622
|
-
- **eslint**: linter integrated with TypeScript.
|
|
623
|
-
|
|
624
|
-
For correct interpretation of linters, is recommended to use [Visual Studio Code](https://code.visualstudio.com/) as IDE and install the plugins in .vscode folder at 'extensions.json', as well as use the config provided in 'settings.json'
|
|
625
|
-
|
|
626
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
627
|
-
|
|
628
|
-
<!-- CHANGELOG -->
|
|
629
|
-
|
|
630
|
-
## π Changelog
|
|
631
|
-
|
|
632
|
-
For last changes see [CHANGELOG.md](CHANGELOG.md) file for details.
|
|
633
|
-
|
|
634
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
635
|
-
|
|
636
|
-
<!-- BUILT WITH -->
|
|
637
|
-
|
|
638
|
-
## π οΈ Built with
|
|
639
|
-
|
|
640
|
-
- [yargs](http://yargs.js.org/)
|
|
641
|
-
- [tslog](https://tslog.js.org/#/) (v4)
|
|
642
|
-
- [picocolors](https://github.com/alexeyraspopov/picocolors)
|
|
643
|
-
- [subslate](https://github.com/josh-hemphill/subslate)
|
|
644
|
-
- [merge-deep](https://github.com/jonschlinkert/merge-deep)
|
|
645
|
-
- [ajv](https://ajv.js.org/)
|
|
646
|
-
- [to-json-schema](https://www.npmjs.com/package/to-json-schema)
|
|
647
|
-
- [vite](https://vite.dev/) + [vitest](https://vitest.dev/) (build & test)
|
|
648
|
-
|
|
649
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
650
|
-
|
|
651
|
-
<!-- LICENSE -->
|
|
652
|
-
|
|
653
|
-
## π License
|
|
654
|
-
|
|
655
|
-
This project is licensed under the MIT License - see [LICENSE.md](LICENSE.md) file for details.
|
|
656
|
-
|
|
657
|
-
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
658
|
-
|
|
659
|
-
---
|
|
660
|
-
|
|
661
|
-
β¨ by [Alvear Candia, Cristopher Alejandro](https://github.com/calvear93)
|
|
1
|
+
<div id="top" align="center">
|
|
2
|
+
<img alt="@calvear/env logo" src="assets/logo.svg" width="150" />
|
|
3
|
+
|
|
4
|
+
<h1 align="center"><b>env</b></h1>
|
|
5
|
+
<h4 align="center">Environment variables made easy β load, validate, inject.</h4>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://img.shields.io/npm/v/@calvear/env?style=flat-square&color=2563eb&label=version" alt="version" />
|
|
9
|
+
|
|
10
|
+
<img src="https://img.shields.io/badge/module-ESM-f59e0b?style=flat-square" alt="esm" />
|
|
11
|
+
|
|
12
|
+
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white" alt="typescript" />
|
|
13
|
+
|
|
14
|
+
<img src="https://img.shields.io/badge/node->=20-339933?style=flat-square&logo=node.js&logoColor=white" alt="node engine" />
|
|
15
|
+
|
|
16
|
+
<img src="https://img.shields.io/badge/coverage-100%25-22c55e?style=flat-square" alt="coverage" />
|
|
17
|
+
|
|
18
|
+
<img src="https://img.shields.io/npm/l/@calvear/env?style=flat-square&color=eab308" alt="license" />
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<br />
|
|
23
|
+
|
|
24
|
+
<!-- ABOUT -->
|
|
25
|
+
|
|
26
|
+
## π About
|
|
27
|
+
|
|
28
|
+
`@calvear/env` eases **environment variable handling** for NodeJS apps β like
|
|
29
|
+
[env-cmd](https://www.npmjs.com/package/env-cmd) or
|
|
30
|
+
[dotenv](https://www.npmjs.com/package/dotenv), but with **powerful, extensible
|
|
31
|
+
features**: pluggable **providers** to `load`, `pull` and `push` variables from
|
|
32
|
+
different stores, **JSON Schema validation**, value **interpolation**, secret
|
|
33
|
+
**masking** and nested/shared keys.
|
|
34
|
+
|
|
35
|
+
### β¨ Features
|
|
36
|
+
|
|
37
|
+
- π§© **Provider plugins** β bundled `package-json`, `app-settings`, `secrets`
|
|
38
|
+
and `local` providers, plus your own (NPM package or local script).
|
|
39
|
+
- π **Injection** β load variables into `process.env` and run any command.
|
|
40
|
+
- β
**JSON Schema** β auto-generate and validate variables before injecting.
|
|
41
|
+
- πͺ **Nested & shared keys** β `GROUP__VAR` flattening and `$`-prefixed shared
|
|
42
|
+
keys.
|
|
43
|
+
- π§΅ **Interpolation** β reference other args/vars with `[[ ]]` delimiters.
|
|
44
|
+
- π **Masking** β hide secret values in logs.
|
|
45
|
+
- π€ **Export** β write the unified environment to a `.env` or JSON file.
|
|
46
|
+
|
|
47
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
48
|
+
|
|
49
|
+
<!-- REQUIREMENTS -->
|
|
50
|
+
|
|
51
|
+
## π Requirements
|
|
52
|
+
|
|
53
|
+
[NodeJS](https://nodejs.org/) **20 or higher**.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
> node -v
|
|
57
|
+
v20.0.0
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
61
|
+
|
|
62
|
+
<!-- ESM -->
|
|
63
|
+
|
|
64
|
+
## π¦ ESM only
|
|
65
|
+
|
|
66
|
+
Since **v3** this package is **ESM-only** (`"type": "module"`). Consumers must
|
|
67
|
+
use ESM `import` syntax, and custom providers must be ESM modules that `export`
|
|
68
|
+
their provider object.
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
// β
ESM
|
|
72
|
+
import { EnvProvider } from '@calvear/env';
|
|
73
|
+
|
|
74
|
+
// β CommonJS require is not supported
|
|
75
|
+
// const { EnvProvider } = require('@calvear/env');
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
79
|
+
|
|
80
|
+
<!-- QUICK START -->
|
|
81
|
+
|
|
82
|
+
## β‘οΈ Quick start
|
|
83
|
+
|
|
84
|
+
Install the package:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
> npm install @calvear/env
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Run the binary directly:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
> npx env --help
|
|
94
|
+
|
|
95
|
+
Usage: env [command] [options..] [: subcmd [:]] [options..]
|
|
96
|
+
|
|
97
|
+
Commands:
|
|
98
|
+
env [options..] [: <subcmd> :]
|
|
99
|
+
env pull [options..]
|
|
100
|
+
env push [options..]
|
|
101
|
+
env schema [options..]
|
|
102
|
+
env export [options..]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Or wire it into your **npm scripts**:
|
|
106
|
+
|
|
107
|
+
```jsonc
|
|
108
|
+
{
|
|
109
|
+
"scripts": {
|
|
110
|
+
// inject "dev" variables (debug mode) and start the app
|
|
111
|
+
"start:dev": "env -e dev -m debug : node dist/main.js",
|
|
112
|
+
// inject "prod" variables for the build
|
|
113
|
+
"build:prod": "env -e prod -m build : tsc",
|
|
114
|
+
// regenerate the validation schema
|
|
115
|
+
"env:schema": "env schema -e dev",
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Run it:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
> npm run start:dev
|
|
124
|
+
|
|
125
|
+
β‘ env v3.0.0 Β· π dev Β· π§© debug
|
|
126
|
+
|
|
127
|
+
π¦ package-json 6 vars
|
|
128
|
+
ποΈ app-settings 5 vars
|
|
129
|
+
π secrets 1 secrets
|
|
130
|
+
π local 1 vars
|
|
131
|
+
|
|
132
|
+
environment (12 variables)
|
|
133
|
+
ENV = dev
|
|
134
|
+
NODE_ENV = development
|
|
135
|
+
SECRET = ***
|
|
136
|
+
VERSION = 3.0.0
|
|
137
|
+
...
|
|
138
|
+
|
|
139
|
+
β 12 variables loaded in 142ms
|
|
140
|
+
|
|
141
|
+
βΆ node dist/main.js
|
|
142
|
+
My environment loaded is: dev
|
|
143
|
+
β finished in 168ms
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
147
|
+
|
|
148
|
+
<!-- COMMANDS AND OPTIONS -->
|
|
149
|
+
|
|
150
|
+
## βοΈ Commands & Options
|
|
151
|
+
|
|
152
|
+
> **Interpolation** β any option value can reference other arguments using `[[`
|
|
153
|
+
> and `]]` delimiters. With `root: "config"`, the value `[[root]]/file.json`
|
|
154
|
+
> resolves to `config/file.json`; with `env: "dev"`,
|
|
155
|
+
> `[[root]]/config.[[env]].json` resolves to `config/config.dev.json`.
|
|
156
|
+
|
|
157
|
+
### Global options
|
|
158
|
+
|
|
159
|
+
| Option | Description | Type | Default |
|
|
160
|
+
| ---------------------------------- | ------------------------------------------------- | ---------- | ------- |
|
|
161
|
+
| `--help` | Show help | `boolean` | |
|
|
162
|
+
| `-e, --env` | Environment to load (i.e. `dev`, `prod`) | `string` | |
|
|
163
|
+
| `-m, --modes` | Execution modes (i.e. `debug`, `test`) | `string[]` | `[]` |
|
|
164
|
+
| `--nd, --nestingDelimiter` | Nesting-level delimiter for flatten | `string` | `__` |
|
|
165
|
+
| `--arrDesc, --arrayDescomposition` | Serialize (`false`) or break down (`true`) arrays | `boolean` | `false` |
|
|
166
|
+
| `-x, --expand` | Interpolate environment variables using itself | `boolean` | `false` |
|
|
167
|
+
| `--ci` | Continuous Integration mode (skips local files) | `boolean` | auto |
|
|
168
|
+
|
|
169
|
+
### Workspace options
|
|
170
|
+
|
|
171
|
+
| Option | Description | Type | Default |
|
|
172
|
+
| ---------------------- | --------------------------------- | -------- | --------------------------------- |
|
|
173
|
+
| `--root` | Base environment folder path | `string` | `env` |
|
|
174
|
+
| `-c, --configFile` | Config JSON file path | `string` | `[[root]]/settings/settings.json` |
|
|
175
|
+
| `-s, --schemaFile` | Environment schema JSON file path | `string` | `[[root]]/settings/schema.json` |
|
|
176
|
+
| `--pkg, --packageJson` | `package.json` path | `string` | _cwd_ |
|
|
177
|
+
|
|
178
|
+
### JSON Schema options
|
|
179
|
+
|
|
180
|
+
| Option | Description | Type | Default |
|
|
181
|
+
| ---------------------- | ---------------------------------------------- | ------------------ | ------- |
|
|
182
|
+
| `-r, --resolve` | Merge new schema or override it | `merge`/`override` | `merge` |
|
|
183
|
+
| `--null, --nullable` | Whether variables are nullable by default | `boolean` | `true` |
|
|
184
|
+
| `--df, --detectFormat` | Include string formats in the generated schema | `boolean` | `false` |
|
|
185
|
+
|
|
186
|
+
### Logger options
|
|
187
|
+
|
|
188
|
+
| Option | Description | Type | Default |
|
|
189
|
+
| ------------------------------ | -------------------------------------- | --------------------------------------------- | ------- |
|
|
190
|
+
| `--log, --logLevel` | Log level | `silly`/`trace`/`debug`/`info`/`warn`/`error` | `info` |
|
|
191
|
+
| `--mvk, --logMaskValuesOfKeys` | Mask values of the given keys in logs | `string[]` | `[]` |
|
|
192
|
+
| `--mrx, --logMaskAnyRegEx` | Mask values matching the given regexes | `string[]` | `[]` |
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### `env`
|
|
197
|
+
|
|
198
|
+
Inject environment variables into `process.env` and execute a command (the
|
|
199
|
+
command goes after `:`).
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
env -e <env> [options..] [: <subcmd> :] [options..]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
> env -e dev -m test unit : npm test
|
|
207
|
+
> env -e dev -m debug : npm start : -c [[root]]/[[env]].env.json
|
|
208
|
+
> env -e prod -m build optimize : npm run build
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
| Option | Description | Type | Default |
|
|
212
|
+
| ------------------------------ | ------------------------------------------ | --------- | ------- |
|
|
213
|
+
| `--validate, --schemaValidate` | Validate variables against the JSON schema | `boolean` | `true` |
|
|
214
|
+
|
|
215
|
+
### `pull`
|
|
216
|
+
|
|
217
|
+
Pull environment variables from the providers' stores (for providers that
|
|
218
|
+
implement `pull`, i.e. custom remote providers).
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
env pull -e <env> [options..]
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
| Option | Description | Type | Default |
|
|
225
|
+
| ----------------- | ------------------------- | --------- | ------- |
|
|
226
|
+
| `-o, --overwrite` | Overwrite local variables | `boolean` | `false` |
|
|
227
|
+
|
|
228
|
+
### `push`
|
|
229
|
+
|
|
230
|
+
Push environment variables to the providers' stores (for providers that
|
|
231
|
+
implement `push`).
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
env push -e <env> [options..]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
| Option | Description | Type | Default |
|
|
238
|
+
| ------------- | ---------------------- | --------- | ------- |
|
|
239
|
+
| `-f, --force` | Force push for secrets | `boolean` | `false` |
|
|
240
|
+
|
|
241
|
+
### `schema`
|
|
242
|
+
|
|
243
|
+
Generate (or update) the validation schema from the providers' output.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
> env schema -e dev -m build
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `export`
|
|
250
|
+
|
|
251
|
+
Export the unified environment to a file.
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
env export -e <env> -m <modes> [options..]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
| Option | Description | Type | Default |
|
|
258
|
+
| --------------- | --------------------- | --------------- | -------- |
|
|
259
|
+
| `-u, -p, --uri` | Output file path | `string` | `.env` |
|
|
260
|
+
| `-f, --format` | Output format | `dotenv`/`json` | `dotenv` |
|
|
261
|
+
| `-q, --quotes` | Wrap values in quotes | `boolean` | `false` |
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
> env export -e dev -m build -f json --uri [[env]].env.json
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
268
|
+
|
|
269
|
+
<!-- PROVIDERS -->
|
|
270
|
+
|
|
271
|
+
## π‘ Providers
|
|
272
|
+
|
|
273
|
+
Providers are the core of this library. It ships with **four integrated
|
|
274
|
+
providers**, and you can add your own.
|
|
275
|
+
|
|
276
|
+
### `package-json`
|
|
277
|
+
|
|
278
|
+
Loads project info from your `package.json` (`version`, `project`, `name`,
|
|
279
|
+
`title`, `description`) into `ENV`, `VERSION`, `PROJECT`, `NAME`, `TITLE`,
|
|
280
|
+
`DESCRIPTION`.
|
|
281
|
+
|
|
282
|
+
| Option | Description | Type | Default |
|
|
283
|
+
| ------------------- | ------------------------------- | -------- | ------- |
|
|
284
|
+
| `--vp, --varPrefix` | Prefix for the loaded variables | `string` | `""` |
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# i.e. expose them as REACT_APP_* for CRA
|
|
288
|
+
> env -e dev -m build : react-scripts build : --vp REACT_APP_
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### `app-settings`
|
|
292
|
+
|
|
293
|
+
Non-secret loader for `appsettings.json`, organized by sections:
|
|
294
|
+
|
|
295
|
+
```jsonc
|
|
296
|
+
{
|
|
297
|
+
"|DEFAULT|": { "VAR1": "v1_default" },
|
|
298
|
+
"|MODE|": {
|
|
299
|
+
"build": { "NODE_ENV": "production" },
|
|
300
|
+
"debug": { "NODE_ENV": "development" },
|
|
301
|
+
},
|
|
302
|
+
"|ENV|": {
|
|
303
|
+
"dev": {
|
|
304
|
+
"C1": "V1",
|
|
305
|
+
"GROUP1": { "VAR2": "G1V2", "GROUP2": { "VAR1": "G1G2V1" } },
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
"|LOCAL|": { "dev": { "LOCAL_VAR": "only-local" } },
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
| Option | Description | Type | Default |
|
|
313
|
+
| ----------------- | ----------------------------- | -------- | --------------------------- |
|
|
314
|
+
| `--ef, --envFile` | Non-secret settings file path | `string` | `[[root]]/appsettings.json` |
|
|
315
|
+
|
|
316
|
+
### `secrets`
|
|
317
|
+
|
|
318
|
+
Loads secret variables from a per-environment JSON file
|
|
319
|
+
(`[[root]]/[[env]].env.json`). Keep this file out of version control.
|
|
320
|
+
|
|
321
|
+
| Option | Description | Type | Default |
|
|
322
|
+
| --------------------- | -------------------------- | -------- | --------------------------- |
|
|
323
|
+
| `--sf, --secretsFile` | Secret variables file path | `string` | `[[root]]/[[env]].env.json` |
|
|
324
|
+
|
|
325
|
+
### `local`
|
|
326
|
+
|
|
327
|
+
Loads local-only variables (never loaded in `--ci`). The file is auto-created
|
|
328
|
+
if missing.
|
|
329
|
+
|
|
330
|
+
| Option | Description | Type | Default |
|
|
331
|
+
| ------------------- | ------------------------- | -------- | --------------------------------- |
|
|
332
|
+
| `--lf, --localFile` | Local variables file path | `string` | `[[root]]/[[env]].local.env.json` |
|
|
333
|
+
|
|
334
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
335
|
+
|
|
336
|
+
<!-- CUSTOM PROVIDERS -->
|
|
337
|
+
|
|
338
|
+
## βοΈ Creating custom providers
|
|
339
|
+
|
|
340
|
+
Create a provider in two ways:
|
|
341
|
+
|
|
342
|
+
- **Local script** β a `.js` file that `export default`s your provider.
|
|
343
|
+
- **NPM package** β a published module that `export default`s your provider.
|
|
344
|
+
|
|
345
|
+
Both are wired in the [config file](#-config) via the `providers` list. A custom
|
|
346
|
+
provider can also implement `pull`/`push` to fetch and publish variables from a
|
|
347
|
+
remote store (i.e. a vault, a secrets manager or an API).
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
import type { CommandArguments, EnvProvider } from '@calvear/env';
|
|
351
|
+
import { logger, readJson, writeJson } from '@calvear/env/utils';
|
|
352
|
+
|
|
353
|
+
const KEY = 'my-unique-provider-key';
|
|
354
|
+
|
|
355
|
+
interface MyProviderArguments extends CommandArguments {
|
|
356
|
+
anyExtraOption: boolean;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const MyProvider: EnvProvider<MyProviderArguments> = {
|
|
360
|
+
// unique identifier
|
|
361
|
+
key: KEY,
|
|
362
|
+
|
|
363
|
+
// (optional) add custom options to the CLI via yargs
|
|
364
|
+
builder: (builder) => {
|
|
365
|
+
builder.options({
|
|
366
|
+
anyExtraOption: {
|
|
367
|
+
group: KEY,
|
|
368
|
+
alias: ['a', 'aeo'],
|
|
369
|
+
type: 'boolean',
|
|
370
|
+
default: false,
|
|
371
|
+
describe: 'Any option description',
|
|
372
|
+
},
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
// called on load β may be sync or async, and may return a list to merge
|
|
377
|
+
load: ({ env }) => {
|
|
378
|
+
if (env === 'dev') return { NODE_ENV: 'development' };
|
|
379
|
+
|
|
380
|
+
return [{ NODE_ENV: 'production' }, { ANY_GROUP: { INNER_VAR: 12 } }];
|
|
381
|
+
},
|
|
382
|
+
|
|
383
|
+
// (optional) called on `env pull`
|
|
384
|
+
pull: (argv, config) => {
|
|
385
|
+
/* fetch variables into your local cache */
|
|
386
|
+
},
|
|
387
|
+
|
|
388
|
+
// (optional) called on `env push`
|
|
389
|
+
push: (argv, config) => {
|
|
390
|
+
/* publish/update your variables */
|
|
391
|
+
},
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export default MyProvider;
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
398
|
+
|
|
399
|
+
<!-- CONFIG -->
|
|
400
|
+
|
|
401
|
+
## π₯ Config
|
|
402
|
+
|
|
403
|
+
Any CLI argument can be set in your config file
|
|
404
|
+
(`[[root]]/settings/settings.json` by default), but it is mainly used to declare
|
|
405
|
+
**providers**:
|
|
406
|
+
|
|
407
|
+
```jsonc
|
|
408
|
+
{
|
|
409
|
+
"log": "silly",
|
|
410
|
+
// hide values of these keys in the logs
|
|
411
|
+
"logMaskValuesOfKeys": ["SECRET", "MY_API_KEY"],
|
|
412
|
+
"providers": [
|
|
413
|
+
{ "path": "package-json" },
|
|
414
|
+
{ "path": "app-settings" },
|
|
415
|
+
{ "path": "secrets" },
|
|
416
|
+
{ "path": "local" },
|
|
417
|
+
// custom NPM package
|
|
418
|
+
{ "path": "@my-scope/my-provider", "type": "module", "config": {} },
|
|
419
|
+
// custom local script
|
|
420
|
+
{ "path": "scripts/custom-loader.js", "type": "script" },
|
|
421
|
+
],
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
> **Provider order matters** β providers are merged in declaration order, so
|
|
426
|
+
> later providers override earlier ones (`package-json` is the base, `local`
|
|
427
|
+
> wins).
|
|
428
|
+
|
|
429
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
430
|
+
|
|
431
|
+
<!-- SHARED / NESTED -->
|
|
432
|
+
|
|
433
|
+
## πͺ Shared & nested keys
|
|
434
|
+
|
|
435
|
+
Organize keys in nested objects. Declare **shared** keys (skipping group
|
|
436
|
+
separation) by prefixing them with `$`:
|
|
437
|
+
|
|
438
|
+
```jsonc
|
|
439
|
+
{
|
|
440
|
+
"$SHARED": "sharedValue",
|
|
441
|
+
"GROUP1": {
|
|
442
|
+
"$SHARED": "sharedValue2",
|
|
443
|
+
"VAR": "anyValue1",
|
|
444
|
+
},
|
|
445
|
+
"GROUP2": { "SUBGROUP1": { "VAR": "anyValue1" } },
|
|
446
|
+
"VAR3": "anyValue3",
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Consumed in your app as flattened keys (`__` separator by default):
|
|
451
|
+
|
|
452
|
+
```javascript
|
|
453
|
+
process.env.GROUP1__VAR; // "anyValue1"
|
|
454
|
+
process.env.GROUP2__SUBGROUP1__VAR; // "anyValue1"
|
|
455
|
+
process.env.VAR3; // "anyValue3"
|
|
456
|
+
// shared keys drop the `$` and the group prefix
|
|
457
|
+
process.env.SHARED; // "sharedValue"
|
|
458
|
+
process.env.GROUP1__SHARED; // "sharedValue2"
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### Priority (lowest β highest)
|
|
462
|
+
|
|
463
|
+
1. `package-json` info
|
|
464
|
+
2. `appsettings.json` (`app-settings`)
|
|
465
|
+
3. `<env>.env.json` (`secrets`)
|
|
466
|
+
4. `<env>.local.env.json` (`local`, skipped in `--ci`)
|
|
467
|
+
|
|
468
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
469
|
+
|
|
470
|
+
<!-- SCRIPTS -->
|
|
471
|
+
|
|
472
|
+
## π§° Development scripts
|
|
473
|
+
|
|
474
|
+
| Script | Description |
|
|
475
|
+
| -------------------- | ------------------------------------------------- |
|
|
476
|
+
| `pnpm build` | Build the library (Vite, ESM) into `dist/` |
|
|
477
|
+
| `pnpm test` | Run unit tests (Vitest) |
|
|
478
|
+
| `pnpm test:cov` | Run unit tests with coverage (100% threshold) |
|
|
479
|
+
| `pnpm test:int` | Run integration tests against the built binary |
|
|
480
|
+
| `pnpm typecheck` | Type-check with `tsc --noEmit` |
|
|
481
|
+
| `pnpm lint` | Lint with ESLint (flat config) |
|
|
482
|
+
| `pnpm format` | Format with Prettier |
|
|
483
|
+
| `pnpm run pub` | Gate + build + publish to npm (`latest`) |
|
|
484
|
+
| `pnpm run pub:alpha` | Gate + build + publish a prerelease (`alpha` tag) |
|
|
485
|
+
|
|
486
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
487
|
+
|
|
488
|
+
<!-- BUILT WITH -->
|
|
489
|
+
|
|
490
|
+
## π οΈ Built with
|
|
491
|
+
|
|
492
|
+
- [yargs](http://yargs.js.org/) β CLI argument parsing
|
|
493
|
+
- [ajv](https://ajv.js.org/) + [to-json-schema](https://www.npmjs.com/package/to-json-schema) β JSON Schema
|
|
494
|
+
- [tslog](https://tslog.js.org/#/) β logging
|
|
495
|
+
- [picocolors](https://github.com/alexeyraspopov/picocolors) β terminal colors
|
|
496
|
+
- [subslate](https://github.com/josh-hemphill/subslate) β interpolation
|
|
497
|
+
- [merge-deep](https://github.com/jonschlinkert/merge-deep) β deep merge
|
|
498
|
+
- [Vite](https://vite.dev/) β build Β· [Vitest](https://vitest.dev/) β testing
|
|
499
|
+
|
|
500
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
501
|
+
|
|
502
|
+
<!-- LICENSE -->
|
|
503
|
+
|
|
504
|
+
## π License
|
|
505
|
+
|
|
506
|
+
This project is licensed under the **MIT License** β see [LICENSE.md](LICENSE.md)
|
|
507
|
+
for details.
|
|
508
|
+
|
|
509
|
+
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
<p align="center">
|
|
514
|
+
β¨ with β€οΈ by <a href="https://github.com/calvear93">Alvear Candia, Cristopher Alejandro</a>
|
|
515
|
+
</p>
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="env">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="card" x1="32" y1="24" x2="224" y2="232" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#101A2E"/>
|
|
5
|
+
<stop offset="1" stop-color="#0A1120"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="accent" x1="72" y1="104" x2="184" y2="168" gradientUnits="userSpaceOnUse">
|
|
8
|
+
<stop stop-color="#34D399"/>
|
|
9
|
+
<stop offset="1" stop-color="#22D3EE"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- terminal card -->
|
|
14
|
+
<rect x="20" y="20" width="216" height="216" rx="46" fill="url(#card)"/>
|
|
15
|
+
<rect x="21" y="21" width="214" height="214" rx="45" fill="none" stroke="#22D3EE" stroke-opacity="0.18" stroke-width="2"/>
|
|
16
|
+
|
|
17
|
+
<!-- title bar dots -->
|
|
18
|
+
<circle cx="58" cy="62" r="7" fill="#F87171"/>
|
|
19
|
+
<circle cx="82" cy="62" r="7" fill="#FBBF24"/>
|
|
20
|
+
<circle cx="106" cy="62" r="7" fill="#34D399"/>
|
|
21
|
+
|
|
22
|
+
<!-- separator -->
|
|
23
|
+
<line x1="40" y1="86" x2="216" y2="86" stroke="#22D3EE" stroke-opacity="0.12" stroke-width="2"/>
|
|
24
|
+
|
|
25
|
+
<!-- [ > _ ] : env brackets + CLI prompt -->
|
|
26
|
+
<path d="M104 108 H82 V184 H104" stroke="url(#accent)" stroke-width="14" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
27
|
+
<path d="M152 108 H174 V184 H152" stroke="url(#accent)" stroke-width="14" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
28
|
+
<path d="M110 128 L132 146 L110 164" stroke="#E2F7F2" stroke-width="13" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
29
|
+
<rect x="128" y="158" width="22" height="11" rx="3" fill="#34D399"/>
|
|
30
|
+
</svg>
|
package/package.json
CHANGED