@prosopo/scripts 3.0.17 → 3.1.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,528 @@
1
1
  # @prosopo/scripts
2
2
 
3
+ ## 3.1.20
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [c9d8fdf]
7
+ - Updated dependencies [b8185a4]
8
+ - Updated dependencies [3a027ef]
9
+ - Updated dependencies [3a027ef]
10
+ - @prosopo/common@3.1.21
11
+ - @prosopo/cli@3.4.13
12
+ - @prosopo/provider@3.12.10
13
+ - @prosopo/config@3.1.21
14
+ - @prosopo/datasets@3.0.38
15
+ - @prosopo/dotenv@3.0.26
16
+ - @prosopo/env@3.2.17
17
+ - @prosopo/keyring@2.8.31
18
+ - @prosopo/types-env@2.7.42
19
+ - @prosopo/workspace@3.1.14
20
+ - @prosopo/locale@3.1.21
21
+ - @prosopo/types@3.5.7
22
+ - @prosopo/util@3.1.6
23
+ - @prosopo/util-crypto@13.5.23
24
+
25
+ ## 3.1.19
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [8491159]
29
+ - @prosopo/provider@3.12.9
30
+ - @prosopo/cli@3.4.12
31
+
32
+ ## 3.1.18
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [5d11a81]
36
+ - @prosopo/provider@3.12.8
37
+ - @prosopo/types@3.5.6
38
+ - @prosopo/cli@3.4.11
39
+ - @prosopo/datasets@3.0.37
40
+ - @prosopo/env@3.2.16
41
+ - @prosopo/keyring@2.8.30
42
+ - @prosopo/types-env@2.7.41
43
+
44
+ ## 3.1.17
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [cbc5d8e]
48
+ - @prosopo/provider@3.12.7
49
+ - @prosopo/cli@3.4.10
50
+
51
+ ## 3.1.16
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [494c5a8]
55
+ - @prosopo/provider@3.12.6
56
+ - @prosopo/types@3.5.5
57
+ - @prosopo/cli@3.4.9
58
+ - @prosopo/datasets@3.0.36
59
+ - @prosopo/types-env@2.7.40
60
+ - @prosopo/env@3.2.15
61
+ - @prosopo/keyring@2.8.29
62
+
63
+ ## 3.1.15
64
+ ### Patch Changes
65
+
66
+ - 4ba029e: repo maintainance
67
+ - Updated dependencies [4ba029e]
68
+ - @prosopo/provider@3.12.5
69
+ - @prosopo/cli@3.4.8
70
+
71
+ ## 3.1.14
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [08ff50f]
75
+ - Updated dependencies [08ff50f]
76
+ - @prosopo/cli@3.4.7
77
+ - @prosopo/provider@3.12.4
78
+ - @prosopo/types@3.5.4
79
+ - @prosopo/datasets@3.0.35
80
+ - @prosopo/types-env@2.7.39
81
+ - @prosopo/env@3.2.14
82
+ - @prosopo/keyring@2.8.28
83
+
84
+ ## 3.1.13
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [04d0f1a]
88
+ - Updated dependencies [1e3a838]
89
+ - @prosopo/provider@3.12.3
90
+ - @prosopo/config@3.1.20
91
+ - @prosopo/cli@3.4.6
92
+ - @prosopo/workspace@3.1.13
93
+ - @prosopo/common@3.1.20
94
+ - @prosopo/datasets@3.0.34
95
+ - @prosopo/dotenv@3.0.25
96
+ - @prosopo/env@3.2.13
97
+ - @prosopo/keyring@2.8.27
98
+ - @prosopo/locale@3.1.20
99
+ - @prosopo/types@3.5.3
100
+ - @prosopo/types-env@2.7.38
101
+ - @prosopo/util@3.1.5
102
+ - @prosopo/util-crypto@13.5.22
103
+
104
+ ## 3.1.12
105
+ ### Patch Changes
106
+
107
+ - 5659b24: Release 3.4.4
108
+ - Updated dependencies [f912439]
109
+ - Updated dependencies [5659b24]
110
+ - @prosopo/common@3.1.19
111
+ - @prosopo/util-crypto@13.5.21
112
+ - @prosopo/types-env@2.7.37
113
+ - @prosopo/datasets@3.0.33
114
+ - @prosopo/provider@3.12.2
115
+ - @prosopo/keyring@2.8.26
116
+ - @prosopo/dotenv@3.0.24
117
+ - @prosopo/locale@3.1.19
118
+ - @prosopo/types@3.5.2
119
+ - @prosopo/workspace@3.1.12
120
+ - @prosopo/util@3.1.4
121
+ - @prosopo/cli@3.4.5
122
+ - @prosopo/env@3.2.12
123
+ - @prosopo/config@3.1.19
124
+
125
+ ## 3.1.11
126
+ ### Patch Changes
127
+
128
+ - 50c4120: Release 3.4.3
129
+ - Updated dependencies [52cd544]
130
+ - Updated dependencies [c72ecbd]
131
+ - Updated dependencies [b8cc590]
132
+ - Updated dependencies [b117ba3]
133
+ - Updated dependencies [50c4120]
134
+ - @prosopo/provider@3.12.1
135
+ - @prosopo/types@3.5.1
136
+ - @prosopo/dotenv@3.0.23
137
+ - @prosopo/util-crypto@13.5.20
138
+ - @prosopo/types-env@2.7.36
139
+ - @prosopo/datasets@3.0.32
140
+ - @prosopo/keyring@2.8.25
141
+ - @prosopo/common@3.1.18
142
+ - @prosopo/locale@3.1.18
143
+ - @prosopo/workspace@3.1.11
144
+ - @prosopo/util@3.1.3
145
+ - @prosopo/cli@3.4.4
146
+ - @prosopo/env@3.2.11
147
+ - @prosopo/config@3.1.18
148
+
149
+ ## 3.1.10
150
+ ### Patch Changes
151
+
152
+ - 618703f: Release 3.4.2
153
+ - Updated dependencies [618703f]
154
+ - Updated dependencies [e20ad6b]
155
+ - Updated dependencies [cf6c8a4]
156
+ - @prosopo/util-crypto@13.5.19
157
+ - @prosopo/types-env@2.7.35
158
+ - @prosopo/datasets@3.0.31
159
+ - @prosopo/provider@3.12.0
160
+ - @prosopo/keyring@2.8.24
161
+ - @prosopo/common@3.1.17
162
+ - @prosopo/dotenv@3.0.22
163
+ - @prosopo/locale@3.1.17
164
+ - @prosopo/types@3.5.0
165
+ - @prosopo/workspace@3.1.10
166
+ - @prosopo/util@3.1.2
167
+ - @prosopo/cli@3.4.3
168
+ - @prosopo/env@3.2.10
169
+ - @prosopo/config@3.1.17
170
+
171
+ ## 3.1.9
172
+ ### Patch Changes
173
+
174
+ - 11303d9: Release 3.4.0
175
+ - 18cb28b: Release 3.4.1
176
+ - Updated dependencies [7e5613a]
177
+ - Updated dependencies [11303d9]
178
+ - Updated dependencies [b6794f8]
179
+ - Updated dependencies [11303d9]
180
+ - Updated dependencies [18cb28b]
181
+ - Updated dependencies [11303d9]
182
+ - @prosopo/provider@3.11.1
183
+ - @prosopo/cli@3.4.2
184
+ - @prosopo/util-crypto@13.5.18
185
+ - @prosopo/types-env@2.7.34
186
+ - @prosopo/datasets@3.0.30
187
+ - @prosopo/keyring@2.8.23
188
+ - @prosopo/common@3.1.16
189
+ - @prosopo/dotenv@3.0.21
190
+ - @prosopo/locale@3.1.16
191
+ - @prosopo/types@3.4.1
192
+ - @prosopo/workspace@3.1.9
193
+ - @prosopo/util@3.1.1
194
+ - @prosopo/env@3.2.9
195
+ - @prosopo/config@3.1.16
196
+
197
+ ## 3.1.8
198
+ ### Patch Changes
199
+
200
+ - f3f7aec: Release 3.4.0
201
+ - Updated dependencies [f3f7aec]
202
+ - Updated dependencies [6768f14]
203
+ - @prosopo/util-crypto@13.5.17
204
+ - @prosopo/types-env@2.7.33
205
+ - @prosopo/datasets@3.0.29
206
+ - @prosopo/provider@3.11.0
207
+ - @prosopo/keyring@2.8.22
208
+ - @prosopo/common@3.1.15
209
+ - @prosopo/dotenv@3.0.20
210
+ - @prosopo/locale@3.1.15
211
+ - @prosopo/types@3.4.0
212
+ - @prosopo/workspace@3.1.8
213
+ - @prosopo/util@3.1.0
214
+ - @prosopo/cli@3.4.1
215
+ - @prosopo/env@3.2.8
216
+ - @prosopo/config@3.1.15
217
+
218
+ ## 3.1.7
219
+ ### Patch Changes
220
+
221
+ - Release 3.3.1
222
+ - 0824221: Release 3.2.4
223
+ - Updated dependencies [97edf3f]
224
+ - Updated dependencies
225
+ - Updated dependencies [0824221]
226
+ - @prosopo/provider@3.10.0
227
+ - @prosopo/types@3.3.0
228
+ - @prosopo/cli@3.4.0
229
+ - @prosopo/util-crypto@13.5.16
230
+ - @prosopo/types-env@2.7.32
231
+ - @prosopo/datasets@3.0.28
232
+ - @prosopo/keyring@2.8.21
233
+ - @prosopo/common@3.1.14
234
+ - @prosopo/dotenv@3.0.19
235
+ - @prosopo/locale@3.1.14
236
+ - @prosopo/workspace@3.1.7
237
+ - @prosopo/util@3.0.17
238
+ - @prosopo/env@3.2.7
239
+ - @prosopo/config@3.1.14
240
+
241
+ ## 3.1.6
242
+ ### Patch Changes
243
+
244
+ - 008d112: Release 3.3.0
245
+ - Updated dependencies [5137f01]
246
+ - Updated dependencies [94351db]
247
+ - Updated dependencies [bebb855]
248
+ - Updated dependencies [509be28]
249
+ - Updated dependencies [509be28]
250
+ - Updated dependencies [008d112]
251
+ - @prosopo/provider@3.9.1
252
+ - @prosopo/cli@3.3.1
253
+ - @prosopo/types@3.2.1
254
+ - @prosopo/util-crypto@13.5.15
255
+ - @prosopo/types-env@2.7.31
256
+ - @prosopo/datasets@3.0.27
257
+ - @prosopo/keyring@2.8.20
258
+ - @prosopo/common@3.1.13
259
+ - @prosopo/dotenv@3.0.18
260
+ - @prosopo/locale@3.1.13
261
+ - @prosopo/workspace@3.1.6
262
+ - @prosopo/util@3.0.16
263
+ - @prosopo/env@3.2.6
264
+ - @prosopo/config@3.1.13
265
+
266
+ ## 3.1.5
267
+ ### Patch Changes
268
+
269
+ - 0824221: Release 3.2.4
270
+ - Updated dependencies [cf48565]
271
+ - Updated dependencies [0824221]
272
+ - Updated dependencies [260de39]
273
+ - @prosopo/provider@3.9.0
274
+ - @prosopo/types@3.2.0
275
+ - @prosopo/util-crypto@13.5.14
276
+ - @prosopo/types-env@2.7.30
277
+ - @prosopo/datasets@3.0.26
278
+ - @prosopo/keyring@2.8.19
279
+ - @prosopo/common@3.1.12
280
+ - @prosopo/dotenv@3.0.17
281
+ - @prosopo/locale@3.1.12
282
+ - @prosopo/workspace@3.1.5
283
+ - @prosopo/util@3.0.15
284
+ - @prosopo/cli@3.3.0
285
+ - @prosopo/env@3.2.5
286
+ - @prosopo/config@3.1.12
287
+
288
+ ## 3.1.4
289
+ ### Patch Changes
290
+
291
+ - 0d1a33e: Adding ipcomparison service with user features
292
+ - 1a23649: Release 3.2.3
293
+ - Updated dependencies [0d1a33e]
294
+ - Updated dependencies [0d1a33e]
295
+ - Updated dependencies [1a23649]
296
+ - @prosopo/provider@3.8.4
297
+ - @prosopo/locale@3.1.11
298
+ - @prosopo/types@3.1.4
299
+ - @prosopo/cli@3.2.4
300
+ - @prosopo/util-crypto@13.5.13
301
+ - @prosopo/types-env@2.7.29
302
+ - @prosopo/datasets@3.0.25
303
+ - @prosopo/keyring@2.8.18
304
+ - @prosopo/common@3.1.11
305
+ - @prosopo/dotenv@3.0.16
306
+ - @prosopo/workspace@3.1.4
307
+ - @prosopo/util@3.0.14
308
+ - @prosopo/env@3.2.4
309
+ - @prosopo/config@3.1.11
310
+
311
+ ## 3.1.3
312
+ ### Patch Changes
313
+
314
+ - 657a827: Release 3.2.2
315
+ - Updated dependencies [36b23e0]
316
+ - Updated dependencies [657a827]
317
+ - Updated dependencies [4aac849]
318
+ - @prosopo/provider@3.8.3
319
+ - @prosopo/util-crypto@13.5.12
320
+ - @prosopo/types-env@2.7.28
321
+ - @prosopo/datasets@3.0.24
322
+ - @prosopo/keyring@2.8.17
323
+ - @prosopo/common@3.1.10
324
+ - @prosopo/dotenv@3.0.15
325
+ - @prosopo/locale@3.1.10
326
+ - @prosopo/types@3.1.3
327
+ - @prosopo/workspace@3.1.3
328
+ - @prosopo/util@3.0.13
329
+ - @prosopo/cli@3.2.3
330
+ - @prosopo/env@3.2.3
331
+ - @prosopo/config@3.1.10
332
+
333
+ ## 3.1.2
334
+ ### Patch Changes
335
+
336
+ - 4440947: fix type-only tsc compilation
337
+ - 7bdaca6: Release 3.2.1
338
+ - 809b984: make vite set esbuild jsx config based on env
339
+ - cd01a72: provider api sign script
340
+ - Updated dependencies [4440947]
341
+ - Updated dependencies [7bdaca6]
342
+ - Updated dependencies [809b984]
343
+ - Updated dependencies [1249ce0]
344
+ - Updated dependencies [809b984]
345
+ - @prosopo/util-crypto@13.5.11
346
+ - @prosopo/types-env@2.7.27
347
+ - @prosopo/datasets@3.0.23
348
+ - @prosopo/provider@3.8.2
349
+ - @prosopo/keyring@2.8.16
350
+ - @prosopo/common@3.1.9
351
+ - @prosopo/dotenv@3.0.14
352
+ - @prosopo/locale@3.1.9
353
+ - @prosopo/types@3.1.2
354
+ - @prosopo/workspace@3.1.2
355
+ - @prosopo/util@3.0.12
356
+ - @prosopo/cli@3.2.2
357
+ - @prosopo/env@3.2.2
358
+ - @prosopo/config@3.1.9
359
+
360
+ ## 3.1.1
361
+ ### Patch Changes
362
+
363
+ - 6fe8570: Release 3.2.0
364
+ - Updated dependencies [1f980c4]
365
+ - Updated dependencies [6fe8570]
366
+ - @prosopo/provider@3.8.1
367
+ - @prosopo/types@3.1.1
368
+ - @prosopo/util-crypto@13.5.10
369
+ - @prosopo/types-env@2.7.26
370
+ - @prosopo/datasets@3.0.22
371
+ - @prosopo/keyring@2.8.15
372
+ - @prosopo/common@3.1.8
373
+ - @prosopo/dotenv@3.0.13
374
+ - @prosopo/locale@3.1.8
375
+ - @prosopo/workspace@3.1.1
376
+ - @prosopo/util@3.0.11
377
+ - @prosopo/cli@3.2.1
378
+ - @prosopo/env@3.2.1
379
+ - @prosopo/config@3.1.8
380
+
381
+ ## 3.1.0
382
+ ### Minor Changes
383
+
384
+ - 8bdc7f0: Using detector to select provider
385
+
386
+ ### Patch Changes
387
+
388
+ - f304be9: Release 3.1.13
389
+ - Updated dependencies [181e0f5]
390
+ - Updated dependencies [f304be9]
391
+ - Updated dependencies [8bdc7f0]
392
+ - @prosopo/cli@3.2.0
393
+ - @prosopo/util-crypto@13.5.9
394
+ - @prosopo/types-env@2.7.25
395
+ - @prosopo/datasets@3.0.21
396
+ - @prosopo/provider@3.8.0
397
+ - @prosopo/keyring@2.8.14
398
+ - @prosopo/common@3.1.7
399
+ - @prosopo/dotenv@3.0.12
400
+ - @prosopo/locale@3.1.7
401
+ - @prosopo/types@3.1.0
402
+ - @prosopo/workspace@3.1.0
403
+ - @prosopo/util@3.0.10
404
+ - @prosopo/env@3.2.0
405
+ - @prosopo/config@3.1.7
406
+
407
+ ## 3.0.24
408
+ ### Patch Changes
409
+
410
+ - a07db04: Release 3.1.12
411
+ - Updated dependencies [9b92339]
412
+ - Updated dependencies [9eed772]
413
+ - Updated dependencies [a07db04]
414
+ - Updated dependencies [ebb0168]
415
+ - @prosopo/provider@3.7.0
416
+ - @prosopo/datasets@3.0.20
417
+ - @prosopo/config@3.1.6
418
+ - @prosopo/types-env@2.7.24
419
+ - @prosopo/cli@3.1.13
420
+ - @prosopo/env@3.1.11
421
+ - @prosopo/util@3.0.9
422
+ - @prosopo/workspace@3.0.7
423
+ - @prosopo/common@3.1.6
424
+ - @prosopo/dotenv@3.0.11
425
+ - @prosopo/keyring@2.8.13
426
+ - @prosopo/locale@3.1.6
427
+ - @prosopo/types@3.0.10
428
+ - @prosopo/util-crypto@13.5.8
429
+
430
+ ## 3.0.23
431
+ ### Patch Changes
432
+
433
+ - @prosopo/env@3.1.10
434
+ - @prosopo/provider@3.6.2
435
+ - @prosopo/cli@3.1.12
436
+ - @prosopo/datasets@3.0.19
437
+ - @prosopo/types-env@2.7.23
438
+
439
+ ## 3.0.22
440
+ ### Patch Changes
441
+
442
+ - 6960643: lint detect missing and unneccessary imports
443
+ - Updated dependencies [d8e855c]
444
+ - Updated dependencies [6960643]
445
+ - @prosopo/provider@3.6.1
446
+ - @prosopo/locale@3.1.5
447
+ - @prosopo/util-crypto@13.5.7
448
+ - @prosopo/types-env@2.7.22
449
+ - @prosopo/datasets@3.0.18
450
+ - @prosopo/keyring@2.8.12
451
+ - @prosopo/common@3.1.5
452
+ - @prosopo/dotenv@3.0.10
453
+ - @prosopo/types@3.0.9
454
+ - @prosopo/workspace@3.0.6
455
+ - @prosopo/util@3.0.8
456
+ - @prosopo/cli@3.1.11
457
+ - @prosopo/env@3.1.9
458
+
459
+ ## 3.0.21
460
+ ### Patch Changes
461
+
462
+ - Updated dependencies [dc5ce11]
463
+ - Updated dependencies [6b98f67]
464
+ - Updated dependencies [30e7d4d]
465
+ - @prosopo/provider@3.6.0
466
+ - @prosopo/datasets@3.0.17
467
+ - @prosopo/config@3.1.5
468
+ - @prosopo/cli@3.1.10
469
+ - @prosopo/account@2.7.14
470
+ - @prosopo/common@3.1.4
471
+ - @prosopo/dotenv@3.0.9
472
+ - @prosopo/env@3.1.8
473
+ - @prosopo/keyring@2.8.11
474
+ - @prosopo/types@3.0.8
475
+ - @prosopo/types-database@3.0.17
476
+ - @prosopo/types-env@2.7.21
477
+ - @prosopo/util@3.0.7
478
+
479
+ ## 3.0.20
480
+ ### Patch Changes
481
+
482
+ - 1f3a02f: Release 3.1.8
483
+ - Updated dependencies [3834a10]
484
+ - Updated dependencies [0c865a7]
485
+ - Updated dependencies [1f3a02f]
486
+ - @prosopo/provider@3.5.0
487
+ - @prosopo/types-database@3.0.16
488
+ - @prosopo/types-env@2.7.20
489
+ - @prosopo/datasets@3.0.16
490
+ - @prosopo/cli@3.1.9
491
+ - @prosopo/env@3.1.7
492
+
493
+ ## 3.0.19
494
+ ### Patch Changes
495
+
496
+ - Updated dependencies [926df8a]
497
+ - Updated dependencies [8cc6551]
498
+ - Updated dependencies [e0628d9]
499
+ - @prosopo/datasets@3.0.15
500
+ - @prosopo/provider@3.4.0
501
+ - @prosopo/cli@3.1.8
502
+ - @prosopo/types-database@3.0.15
503
+ - @prosopo/env@3.1.6
504
+ - @prosopo/types-env@2.7.19
505
+
506
+ ## 3.0.18
507
+ ### Patch Changes
508
+
509
+ - Updated dependencies [44ffda2]
510
+ - Updated dependencies [a49b538]
511
+ - Updated dependencies [e090e2f]
512
+ - @prosopo/config@3.1.4
513
+ - @prosopo/provider@3.3.1
514
+ - @prosopo/common@3.1.3
515
+ - @prosopo/account@2.7.13
516
+ - @prosopo/cli@3.1.7
517
+ - @prosopo/datasets@3.0.14
518
+ - @prosopo/dotenv@3.0.8
519
+ - @prosopo/env@3.1.5
520
+ - @prosopo/keyring@2.8.10
521
+ - @prosopo/types@3.0.7
522
+ - @prosopo/types-database@3.0.14
523
+ - @prosopo/types-env@2.7.18
524
+ - @prosopo/util@3.0.6
525
+
3
526
  ## 3.0.17
4
527
  ### Patch Changes
5
528
 
@@ -8,13 +8,11 @@ const types = require("@prosopo/types");
8
8
  const workspace = require("@prosopo/workspace");
9
9
  const yargs = require("yargs");
10
10
  const helpers = require("yargs/helpers");
11
- require("../contract/index.cjs");
12
11
  const setVersion = require("../scripts/setVersion.cjs");
13
12
  require("../setup/index.cjs");
14
13
  require("../util/index.cjs");
15
14
  const exec = require("../util/exec.cjs");
16
15
  const setup = require("../setup/setup.cjs");
17
- const _import = require("../contract/import.cjs");
18
16
  const rootDir = path.resolve(".");
19
17
  dotenv.loadEnv(rootDir);
20
18
  async function processArgs(args) {
@@ -51,21 +49,6 @@ async function processArgs(args) {
51
49
  log.info(() => ({ msg: "Running setup scripts" }));
52
50
  await setup.setup(argv.provider, argv.sites);
53
51
  }
54
- }).command({
55
- command: "import_contract",
56
- describe: "Import a contract into the contract package.",
57
- builder: (yargs2) => yargs2.option("in", {
58
- type: "string",
59
- demandOption: true,
60
- desc: "The path to the contract's abi"
61
- }).option("out", {
62
- type: "string",
63
- demandOption: true,
64
- desc: "The path to the output directory"
65
- }),
66
- handler: async (argv) => {
67
- await _import(argv.in, argv.out);
68
- }
69
52
  }).command({
70
53
  command: "version",
71
54
  describe: "Set the version of packages",
@@ -3,14 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./setup/index.cjs");
4
4
  require("./util/index.cjs");
5
5
  const index = require("./cli/index.cjs");
6
- require("./contract/index.cjs");
7
6
  const setup = require("./setup/setup.cjs");
8
7
  const provider = require("./setup/provider.cjs");
9
8
  const loadContractFiles = require("./util/loadContractFiles.cjs");
10
9
  const updateEnv = require("./util/updateEnv.cjs");
11
10
  const exec = require("./util/exec.cjs");
12
11
  const fluxLogDappDetails = require("./util/fluxLogDappDetails.cjs");
13
- const _import = require("./contract/import.cjs");
14
12
  exports.processArgs = index.processArgs;
15
13
  exports.setup = setup.setup;
16
14
  exports.updateEnvFile = setup.updateEnvFile;
@@ -22,4 +20,3 @@ exports.updateDemoHTMLFiles = updateEnv.updateDemoHTMLFiles;
22
20
  exports.updateEnvFiles = updateEnv.updateEnvFiles;
23
21
  exports.exec = exec.exec;
24
22
  exports.extractReferrersFromLogs = fluxLogDappDetails.extractReferrersFromLogs;
25
- exports.importContract = _import;
package/dist/cli/index.js CHANGED
@@ -3,16 +3,15 @@ import { isHex } from "@polkadot/util";
3
3
  import { LogLevel, getLogger, parseLogLevel } from "@prosopo/common";
4
4
  import { loadEnv, getEnv } from "@prosopo/dotenv";
5
5
  import { encodeProcaptchaOutput, decodeProcaptchaOutput } from "@prosopo/types";
6
- import { getScriptsPkgDir } from "@prosopo/workspace";
6
+ import "../workspace/dist/index.js";
7
7
  import yargs from "yargs";
8
8
  import { hideBin } from "yargs/helpers";
9
- import "../contract/index.js";
10
9
  import setVersion from "../scripts/setVersion.js";
11
10
  import "../setup/index.js";
12
11
  import "../util/index.js";
12
+ import { getScriptsPkgDir } from "../workspace/dist/projectInfo.js";
13
13
  import { exec } from "../util/exec.js";
14
14
  import { setup } from "../setup/setup.js";
15
- import importContract from "../contract/import.js";
16
15
  const rootDir = path.resolve(".");
17
16
  loadEnv(rootDir);
18
17
  async function processArgs(args) {
@@ -49,21 +48,6 @@ async function processArgs(args) {
49
48
  log.info(() => ({ msg: "Running setup scripts" }));
50
49
  await setup(argv.provider, argv.sites);
51
50
  }
52
- }).command({
53
- command: "import_contract",
54
- describe: "Import a contract into the contract package.",
55
- builder: (yargs2) => yargs2.option("in", {
56
- type: "string",
57
- demandOption: true,
58
- desc: "The path to the contract's abi"
59
- }).option("out", {
60
- type: "string",
61
- demandOption: true,
62
- desc: "The path to the output directory"
63
- }),
64
- handler: async (argv) => {
65
- await importContract(argv.in, argv.out);
66
- }
67
51
  }).command({
68
52
  command: "version",
69
53
  describe: "Set the version of packages",
package/dist/index.js CHANGED
@@ -1,21 +1,18 @@
1
1
  import "./setup/index.js";
2
2
  import "./util/index.js";
3
3
  import { processArgs } from "./cli/index.js";
4
- import "./contract/index.js";
5
4
  import { setup, updateEnvFile } from "./setup/setup.js";
6
5
  import { setupProvider } from "./setup/provider.js";
7
6
  import { AbiJSON, Wasm } from "./util/loadContractFiles.js";
8
7
  import { findEnvFiles, updateDemoHTMLFiles, updateEnvFiles } from "./util/updateEnv.js";
9
8
  import { exec } from "./util/exec.js";
10
9
  import { extractReferrersFromLogs } from "./util/fluxLogDappDetails.js";
11
- import { default as default2 } from "./contract/import.js";
12
10
  export {
13
11
  AbiJSON,
14
12
  Wasm,
15
13
  exec,
16
14
  extractReferrersFromLogs,
17
15
  findEnvFiles,
18
- default2 as importContract,
19
16
  processArgs,
20
17
  setup,
21
18
  setupProvider,
@@ -3,7 +3,8 @@ import path from "node:path";
3
3
  import { parse, stringify } from "@iarna/toml";
4
4
  import { parseLogLevel, getLogger } from "@prosopo/common";
5
5
  import { loadEnv } from "@prosopo/dotenv";
6
- import { getRootDir } from "@prosopo/workspace";
6
+ import "../workspace/dist/index.js";
7
+ import { getRootDir } from "../workspace/dist/projectInfo.js";
7
8
  loadEnv();
8
9
  const logLevel = parseLogLevel(process.env.PROSOPO_LOG_LEVEL);
9
10
  const log = getLogger(logLevel, "setVersion");
@@ -0,0 +1,40 @@
1
+ import { getAccountPkgDir, getApiPkgDir, getCacheDir, getCliPkgDir, getClientBundleExampleDir, getClientExampleDir, getClientExampleServerDir, getCommonPkgDir, getConfigPkgDir, getDappExampleDir, getDatabasePkgDir, getDatasetsFsPkgDir, getDatasetsPkgDir, getDemosDir, getDevDir, getDotEnvPkgDir, getEnvPkgDir, getFileServerPkgDir, getLocalePkgDir, getNodeModulesDir, getPackagesDir, getProcaptchaBundlePkgDir, getProcaptchaCommonPkgDir, getProcaptchaFrictionlessPkgDir, getProcaptchaPkgDir, getProcaptchaPoWPkgDir, getProcaptchaReactPkgDir, getProviderPkgDir, getRootDir, getScriptsPkgDir, getServerPkgDir, getTestResultsDir, getTypesDatabasePkgDir, getTypesEnvPkgDir, getTypesPkgDir, getUtilPkgDir, getWidgetSkeletonPkgDir } from "./projectInfo.js";
2
+ export {
3
+ getAccountPkgDir,
4
+ getApiPkgDir,
5
+ getCacheDir,
6
+ getCliPkgDir,
7
+ getClientBundleExampleDir,
8
+ getClientExampleDir,
9
+ getClientExampleServerDir,
10
+ getCommonPkgDir,
11
+ getConfigPkgDir,
12
+ getDappExampleDir,
13
+ getDatabasePkgDir,
14
+ getDatasetsFsPkgDir,
15
+ getDatasetsPkgDir,
16
+ getDemosDir,
17
+ getDevDir,
18
+ getDotEnvPkgDir,
19
+ getEnvPkgDir,
20
+ getFileServerPkgDir,
21
+ getLocalePkgDir,
22
+ getNodeModulesDir,
23
+ getPackagesDir,
24
+ getProcaptchaBundlePkgDir,
25
+ getProcaptchaCommonPkgDir,
26
+ getProcaptchaFrictionlessPkgDir,
27
+ getProcaptchaPkgDir,
28
+ getProcaptchaPoWPkgDir,
29
+ getProcaptchaReactPkgDir,
30
+ getProviderPkgDir,
31
+ getRootDir,
32
+ getScriptsPkgDir,
33
+ getServerPkgDir,
34
+ getTestResultsDir,
35
+ getTypesDatabasePkgDir,
36
+ getTypesEnvPkgDir,
37
+ getTypesPkgDir,
38
+ getUtilPkgDir,
39
+ getWidgetSkeletonPkgDir
40
+ };
@@ -0,0 +1,76 @@
1
+ const getRootDir = () => new URL("../../..", import.meta.url).pathname.slice(0, -1);
2
+ const getCacheDir = () => `${getRootDir()}/.cache`;
3
+ const getTestResultsDir = () => `${getCacheDir()}/test-results`;
4
+ const getDevDir = () => `${getRootDir()}/dev`;
5
+ const getDemosDir = () => `${getRootDir()}/demos`;
6
+ const getPackagesDir = () => `${getRootDir()}/packages`;
7
+ const getNodeModulesDir = () => `${getRootDir()}/node_modules`;
8
+ const getConfigPkgDir = () => `${getDevDir()}/config`;
9
+ const getScriptsPkgDir = () => `${getDevDir()}/scripts`;
10
+ const getClientExampleDir = () => `${getDemosDir()}/client-example`;
11
+ const getClientExampleServerDir = () => `${getDemosDir()}/client-example-server`;
12
+ const getClientBundleExampleDir = () => `${getDemosDir()}/client-bundle-example`;
13
+ const getDappExampleDir = () => `${getDemosDir()}/dapp-example`;
14
+ const getAccountPkgDir = () => `${getPackagesDir()}/account`;
15
+ const getApiPkgDir = () => `${getPackagesDir()}/api`;
16
+ const getCliPkgDir = () => `${getPackagesDir()}/cli`;
17
+ const getCommonPkgDir = () => `${getPackagesDir()}/common`;
18
+ const getDatabasePkgDir = () => `${getPackagesDir()}/database`;
19
+ const getDatasetsPkgDir = () => `${getPackagesDir()}/datasets`;
20
+ const getDatasetsFsPkgDir = () => `${getPackagesDir()}/datasets-fs`;
21
+ const getDotEnvPkgDir = () => `${getPackagesDir()}/dotenv`;
22
+ const getEnvPkgDir = () => `${getPackagesDir()}/env`;
23
+ const getFileServerPkgDir = () => `${getPackagesDir()}/file-server`;
24
+ const getProcaptchaPkgDir = () => `${getPackagesDir()}/procaptcha`;
25
+ const getProcaptchaBundlePkgDir = () => `${getPackagesDir()}/procaptcha-bundle`;
26
+ const getProcaptchaCommonPkgDir = () => `${getPackagesDir()}/procaptcha-common`;
27
+ const getProcaptchaFrictionlessPkgDir = () => `${getPackagesDir()}/procaptcha-frictionless`;
28
+ const getProcaptchaPoWPkgDir = () => `${getPackagesDir()}/procaptcha-pow`;
29
+ const getProcaptchaReactPkgDir = () => `${getPackagesDir()}/procaptcha-react`;
30
+ const getProviderPkgDir = () => `${getPackagesDir()}/provider`;
31
+ const getServerPkgDir = () => `${getPackagesDir()}/server`;
32
+ const getTypesPkgDir = () => `${getPackagesDir()}/types`;
33
+ const getTypesDatabasePkgDir = () => `${getPackagesDir()}/types-database`;
34
+ const getTypesEnvPkgDir = () => `${getPackagesDir()}/types-env`;
35
+ const getUtilPkgDir = () => `${getPackagesDir()}/util`;
36
+ const getWidgetSkeletonPkgDir = () => `${getPackagesDir()}/widget-skeleton`;
37
+ const getLocalePkgDir = () => `${getPackagesDir()}/locale`;
38
+ export {
39
+ getAccountPkgDir,
40
+ getApiPkgDir,
41
+ getCacheDir,
42
+ getCliPkgDir,
43
+ getClientBundleExampleDir,
44
+ getClientExampleDir,
45
+ getClientExampleServerDir,
46
+ getCommonPkgDir,
47
+ getConfigPkgDir,
48
+ getDappExampleDir,
49
+ getDatabasePkgDir,
50
+ getDatasetsFsPkgDir,
51
+ getDatasetsPkgDir,
52
+ getDemosDir,
53
+ getDevDir,
54
+ getDotEnvPkgDir,
55
+ getEnvPkgDir,
56
+ getFileServerPkgDir,
57
+ getLocalePkgDir,
58
+ getNodeModulesDir,
59
+ getPackagesDir,
60
+ getProcaptchaBundlePkgDir,
61
+ getProcaptchaCommonPkgDir,
62
+ getProcaptchaFrictionlessPkgDir,
63
+ getProcaptchaPkgDir,
64
+ getProcaptchaPoWPkgDir,
65
+ getProcaptchaReactPkgDir,
66
+ getProviderPkgDir,
67
+ getRootDir,
68
+ getScriptsPkgDir,
69
+ getServerPkgDir,
70
+ getTestResultsDir,
71
+ getTypesDatabasePkgDir,
72
+ getTypesEnvPkgDir,
73
+ getTypesPkgDir,
74
+ getUtilPkgDir,
75
+ getWidgetSkeletonPkgDir
76
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/scripts",
3
- "version": "3.0.17",
3
+ "version": "3.1.20",
4
4
  "description": "Dev scripts for working with prosopo packages",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "build": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
21
21
  "build:tsc": "tsc --build --verbose",
22
22
  "build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
23
- "typecheck": "tsc --build --declaration --emitDeclarationOnly",
23
+ "typecheck": "tsc --project tsconfig.types.json",
24
24
  "cli": "node dist/cli/index.js",
25
25
  "setup": "node dist/cli/index.js setup"
26
26
  },
@@ -30,39 +30,33 @@
30
30
  "@iarna/toml": "2.2.5",
31
31
  "@polkadot/api": "10.13.1",
32
32
  "@polkadot/api-contract": "10.13.1",
33
- "@polkadot/keyring": "12.6.2",
34
33
  "@polkadot/util": "12.6.2",
35
34
  "@polkadot/util-crypto": "12.6.2",
36
- "@prosopo/account": "2.7.12",
37
- "@prosopo/cli": "3.1.6",
38
- "@prosopo/common": "3.1.2",
39
- "@prosopo/config": "3.1.3",
40
- "@prosopo/datasets": "3.0.13",
41
- "@prosopo/dotenv": "3.0.7",
42
- "@prosopo/env": "3.1.4",
43
- "@prosopo/keyring": "2.8.9",
44
- "@prosopo/provider": "3.3.0",
45
- "@prosopo/types": "3.0.6",
46
- "@prosopo/types-database": "3.0.13",
47
- "@prosopo/types-env": "2.7.17",
48
- "@prosopo/util": "3.0.5",
49
- "@typegoose/auto-increment": "4.13.0",
50
- "axios": "1.10.0",
35
+ "@prosopo/cli": "3.4.13",
36
+ "@prosopo/common": "3.1.21",
37
+ "@prosopo/config": "3.1.21",
38
+ "@prosopo/datasets": "3.0.38",
39
+ "@prosopo/dotenv": "3.0.26",
40
+ "@prosopo/env": "3.2.17",
41
+ "@prosopo/keyring": "2.8.31",
42
+ "@prosopo/locale": "3.1.21",
43
+ "@prosopo/provider": "3.12.10",
44
+ "@prosopo/types": "3.5.7",
45
+ "@prosopo/types-env": "2.7.42",
46
+ "@prosopo/util": "3.1.6",
47
+ "@prosopo/util-crypto": "13.5.23",
48
+ "@prosopo/workspace": "3.1.14",
51
49
  "dotenv": "16.4.5",
52
- "esbuild": "0.25.6",
53
- "express": "4.21.2",
54
50
  "fast-glob": "3.3.2",
55
51
  "fs-extra": "11.2.0",
56
- "mongodb": "6.9.0",
57
- "yargs": "17.7.2",
58
- "openpgp": "5.11.3",
59
- "webpack-dev-server": "5.2.2"
52
+ "yargs": "17.7.2"
60
53
  },
61
54
  "overrides": {
62
55
  "@polkadot/keyring": "12.6.2"
63
56
  },
64
57
  "devDependencies": {
65
58
  "@types/fs-extra": "11.0.4",
59
+ "@types/node": "22.10.2",
66
60
  "@vitest/coverage-v8": "3.0.9",
67
61
  "concurrently": "9.0.1",
68
62
  "del-cli": "6.0.0",
@@ -1,183 +0,0 @@
1
- "use strict";
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
- const common = require("@prosopo/common");
5
- const lodash = require("@prosopo/util/lodash");
6
- require("../util/index.cjs");
7
- const exec = require("../util/exec.cjs");
8
- const replaceExtension = (file, ext) => {
9
- const parts = file.split(".");
10
- parts.pop();
11
- parts.push(ext);
12
- return parts.join(".");
13
- };
14
- async function importContract(pathToAbis, pathToOutput) {
15
- const verbose = false;
16
- pathToAbis = path.relative(process.cwd(), pathToAbis);
17
- pathToOutput = path.relative(process.cwd(), pathToOutput);
18
- if (!fs.existsSync(pathToAbis))
19
- throw new common.ProsopoEnvError("FS.FILE_NOT_FOUND", {
20
- context: { error: `Path to ABIs does not exist: ${pathToAbis}` }
21
- });
22
- await exec.exec(`mkdir -p ${pathToOutput}`);
23
- const cmd = `npx @prosopo/typechain-polkadot --in ${pathToAbis} --out ${pathToOutput}`;
24
- await exec.exec(cmd);
25
- const name = path.basename(pathToAbis);
26
- await exec.exec(`cp ${pathToAbis}/${name}.json ${pathToOutput}/${name}.json`);
27
- const _ = lodash.lodash();
28
- const writeIndexJsFiles = (src) => {
29
- const typeChainDirs = fs.readdirSync(src).filter((file2) => {
30
- return fs.lstatSync(`${src}/${file2}`).isDirectory();
31
- });
32
- const rootExports = [];
33
- const typeChainExports = [
34
- {
35
- dir: "build-extrinsic",
36
- defaultExportName: "extrinsics"
37
- },
38
- {
39
- dir: "constructors"
40
- },
41
- {
42
- dir: "contract-info",
43
- exports: [
44
- {
45
- name: "ContractAbi"
46
- },
47
- {
48
- name: "ContractFile"
49
- }
50
- ]
51
- },
52
- {
53
- dir: "contracts",
54
- defaultExportName: "contract"
55
- },
56
- {
57
- dir: "data"
58
- },
59
- {
60
- dir: "event-data"
61
- },
62
- // { // no events used so this is empty - not sure about structure so left out
63
- // dir: 'event-types'
64
- // },
65
- {
66
- dir: "events"
67
- },
68
- {
69
- dir: "mixed-methods",
70
- defaultExportName: "methods"
71
- },
72
- {
73
- dir: "query",
74
- defaultExportName: "query"
75
- },
76
- {
77
- dir: "tx-sign-and-send",
78
- defaultExportName: "tx"
79
- }
80
- ];
81
- let file = "";
82
- for (const typeChainExport of typeChainExports) {
83
- const dirPath = `${src}/${typeChainExport.dir}`;
84
- const files = fs.readdirSync(dirPath);
85
- if (files.length !== 1) {
86
- throw new common.ProsopoEnvError("FS.INVALID_DIR_FORMAT", {
87
- context: {
88
- error: `Expected 1 file in ${dirPath}, found ${files.length}`
89
- }
90
- });
91
- }
92
- file = files[0] || "";
93
- if (file === "") {
94
- throw new common.ProsopoEnvError("FS.FILE_NOT_FOUND", {
95
- context: { error: `No file found in ${dirPath}` }
96
- });
97
- }
98
- if (file.endsWith(".ts")) {
99
- file = replaceExtension(file, "js");
100
- }
101
- if (typeChainExport.defaultExportName !== void 0) {
102
- const name2 = _.upperFirst(
103
- _.camelCase(typeChainExport.defaultExportName || typeChainExport.dir)
104
- );
105
- rootExports.push(
106
- `export { default as ${name2} } from './${typeChainExport.dir}/${file}'`
107
- );
108
- }
109
- if (typeChainExport.exports !== void 0) {
110
- for (const namedExport of typeChainExport.exports) {
111
- const alias = namedExport.alias ? ` as ${namedExport.alias}` : "";
112
- rootExports.push(
113
- `export { ${namedExport.name}${alias} } from './${typeChainExport.dir}/${file}'`
114
- );
115
- }
116
- }
117
- }
118
- rootExports.push(`export * from './shared/utils.js'`);
119
- const regex = /export\s+([a-z]+)\s+(\w+)/g;
120
- const fileTs = replaceExtension(file, "ts");
121
- const typesArgumentsFileContent = fs.readFileSync(
122
- `${src}/types-arguments/${fileTs}`,
123
- "utf8"
124
- );
125
- const typesReturnsFileContent = fs.readFileSync(
126
- `${src}/types-returns/${fileTs}`,
127
- "utf8"
128
- );
129
- const argumentTypes = Array.from(
130
- typesArgumentsFileContent.matchAll(regex)
131
- ).map((match) => {
132
- return {
133
- name: match[2] || "",
134
- category: match[1] || ""
135
- };
136
- });
137
- const returnTypes = Array.from(
138
- typesReturnsFileContent.matchAll(regex)
139
- ).map((match) => {
140
- return {
141
- name: match[2] || "",
142
- category: match[1] || ""
143
- };
144
- });
145
- const argumentTypeNames = argumentTypes.map((entry) => entry.name);
146
- const uniqueTypes = [...argumentTypes];
147
- const locations = [...argumentTypes.map(() => "types-arguments")];
148
- for (const entry of returnTypes) {
149
- if (!argumentTypeNames.includes(entry.name)) {
150
- uniqueTypes.push(entry);
151
- locations.push("types-arguments");
152
- } else {
153
- locations.push("types-returns");
154
- }
155
- }
156
- uniqueTypes.forEach((entry, i) => {
157
- const location = locations[i];
158
- const prefix = entry.category === "type" || entry.category === "interface" ? " type" : "";
159
- rootExports.push(
160
- `export${prefix} { ${entry.name} } from './${location}/${file}'`
161
- );
162
- });
163
- fs.writeFileSync(`${src}/index.ts`, rootExports.join("\n"));
164
- };
165
- writeIndexJsFiles(pathToOutput);
166
- }
167
- const getExtension = (str) => {
168
- const i = str.indexOf("assert");
169
- if (i >= 0) {
170
- str = str.slice(0, i);
171
- }
172
- const arr = str.split(".");
173
- if (arr.length <= 1) {
174
- return "";
175
- }
176
- return arr.pop();
177
- };
178
- const getPath = (str) => {
179
- const j = Math.max(str.lastIndexOf('"'), str.lastIndexOf("'"));
180
- const i = Math.max(str.indexOf('"'), str.indexOf("'"));
181
- return str.slice(i + 1, j);
182
- };
183
- module.exports = importContract;
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const _import = require("./import.cjs");
4
- exports.importContract = _import;
@@ -1,184 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { ProsopoEnvError } from "@prosopo/common";
4
- import { lodash } from "@prosopo/util/lodash";
5
- import "../util/index.js";
6
- import { exec } from "../util/exec.js";
7
- const replaceExtension = (file, ext) => {
8
- const parts = file.split(".");
9
- parts.pop();
10
- parts.push(ext);
11
- return parts.join(".");
12
- };
13
- async function importContract(pathToAbis, pathToOutput) {
14
- const verbose = false;
15
- pathToAbis = path.relative(process.cwd(), pathToAbis);
16
- pathToOutput = path.relative(process.cwd(), pathToOutput);
17
- if (!fs.existsSync(pathToAbis))
18
- throw new ProsopoEnvError("FS.FILE_NOT_FOUND", {
19
- context: { error: `Path to ABIs does not exist: ${pathToAbis}` }
20
- });
21
- await exec(`mkdir -p ${pathToOutput}`);
22
- const cmd = `npx @prosopo/typechain-polkadot --in ${pathToAbis} --out ${pathToOutput}`;
23
- await exec(cmd);
24
- const name = path.basename(pathToAbis);
25
- await exec(`cp ${pathToAbis}/${name}.json ${pathToOutput}/${name}.json`);
26
- const _ = lodash();
27
- const writeIndexJsFiles = (src) => {
28
- const typeChainDirs = fs.readdirSync(src).filter((file2) => {
29
- return fs.lstatSync(`${src}/${file2}`).isDirectory();
30
- });
31
- const rootExports = [];
32
- const typeChainExports = [
33
- {
34
- dir: "build-extrinsic",
35
- defaultExportName: "extrinsics"
36
- },
37
- {
38
- dir: "constructors"
39
- },
40
- {
41
- dir: "contract-info",
42
- exports: [
43
- {
44
- name: "ContractAbi"
45
- },
46
- {
47
- name: "ContractFile"
48
- }
49
- ]
50
- },
51
- {
52
- dir: "contracts",
53
- defaultExportName: "contract"
54
- },
55
- {
56
- dir: "data"
57
- },
58
- {
59
- dir: "event-data"
60
- },
61
- // { // no events used so this is empty - not sure about structure so left out
62
- // dir: 'event-types'
63
- // },
64
- {
65
- dir: "events"
66
- },
67
- {
68
- dir: "mixed-methods",
69
- defaultExportName: "methods"
70
- },
71
- {
72
- dir: "query",
73
- defaultExportName: "query"
74
- },
75
- {
76
- dir: "tx-sign-and-send",
77
- defaultExportName: "tx"
78
- }
79
- ];
80
- let file = "";
81
- for (const typeChainExport of typeChainExports) {
82
- const dirPath = `${src}/${typeChainExport.dir}`;
83
- const files = fs.readdirSync(dirPath);
84
- if (files.length !== 1) {
85
- throw new ProsopoEnvError("FS.INVALID_DIR_FORMAT", {
86
- context: {
87
- error: `Expected 1 file in ${dirPath}, found ${files.length}`
88
- }
89
- });
90
- }
91
- file = files[0] || "";
92
- if (file === "") {
93
- throw new ProsopoEnvError("FS.FILE_NOT_FOUND", {
94
- context: { error: `No file found in ${dirPath}` }
95
- });
96
- }
97
- if (file.endsWith(".ts")) {
98
- file = replaceExtension(file, "js");
99
- }
100
- if (typeChainExport.defaultExportName !== void 0) {
101
- const name2 = _.upperFirst(
102
- _.camelCase(typeChainExport.defaultExportName || typeChainExport.dir)
103
- );
104
- rootExports.push(
105
- `export { default as ${name2} } from './${typeChainExport.dir}/${file}'`
106
- );
107
- }
108
- if (typeChainExport.exports !== void 0) {
109
- for (const namedExport of typeChainExport.exports) {
110
- const alias = namedExport.alias ? ` as ${namedExport.alias}` : "";
111
- rootExports.push(
112
- `export { ${namedExport.name}${alias} } from './${typeChainExport.dir}/${file}'`
113
- );
114
- }
115
- }
116
- }
117
- rootExports.push(`export * from './shared/utils.js'`);
118
- const regex = /export\s+([a-z]+)\s+(\w+)/g;
119
- const fileTs = replaceExtension(file, "ts");
120
- const typesArgumentsFileContent = fs.readFileSync(
121
- `${src}/types-arguments/${fileTs}`,
122
- "utf8"
123
- );
124
- const typesReturnsFileContent = fs.readFileSync(
125
- `${src}/types-returns/${fileTs}`,
126
- "utf8"
127
- );
128
- const argumentTypes = Array.from(
129
- typesArgumentsFileContent.matchAll(regex)
130
- ).map((match) => {
131
- return {
132
- name: match[2] || "",
133
- category: match[1] || ""
134
- };
135
- });
136
- const returnTypes = Array.from(
137
- typesReturnsFileContent.matchAll(regex)
138
- ).map((match) => {
139
- return {
140
- name: match[2] || "",
141
- category: match[1] || ""
142
- };
143
- });
144
- const argumentTypeNames = argumentTypes.map((entry) => entry.name);
145
- const uniqueTypes = [...argumentTypes];
146
- const locations = [...argumentTypes.map(() => "types-arguments")];
147
- for (const entry of returnTypes) {
148
- if (!argumentTypeNames.includes(entry.name)) {
149
- uniqueTypes.push(entry);
150
- locations.push("types-arguments");
151
- } else {
152
- locations.push("types-returns");
153
- }
154
- }
155
- uniqueTypes.forEach((entry, i) => {
156
- const location = locations[i];
157
- const prefix = entry.category === "type" || entry.category === "interface" ? " type" : "";
158
- rootExports.push(
159
- `export${prefix} { ${entry.name} } from './${location}/${file}'`
160
- );
161
- });
162
- fs.writeFileSync(`${src}/index.ts`, rootExports.join("\n"));
163
- };
164
- writeIndexJsFiles(pathToOutput);
165
- }
166
- const getExtension = (str) => {
167
- const i = str.indexOf("assert");
168
- if (i >= 0) {
169
- str = str.slice(0, i);
170
- }
171
- const arr = str.split(".");
172
- if (arr.length <= 1) {
173
- return "";
174
- }
175
- return arr.pop();
176
- };
177
- const getPath = (str) => {
178
- const j = Math.max(str.lastIndexOf('"'), str.lastIndexOf("'"));
179
- const i = Math.max(str.indexOf('"'), str.indexOf("'"));
180
- return str.slice(i + 1, j);
181
- };
182
- export {
183
- importContract as default
184
- };
@@ -1,4 +0,0 @@
1
- import { default as default2 } from "./import.js";
2
- export {
3
- default2 as importContract
4
- };