wao 0.1.4 → 0.1.6

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 (40) hide show
  1. package/esm/package.json +3 -0
  2. package/package.json +4 -18
  3. package/.babelrc-cjs +0 -5
  4. package/.babelrc-esm +0 -5
  5. package/README.md +0 -589
  6. package/dist/package.json +0 -36
  7. package/make.js +0 -23
  8. package/src/.cache/opt.json +0 -1
  9. package/src/accounts.js +0 -91
  10. package/src/ao.js +0 -737
  11. package/src/aoconnect.js +0 -318
  12. package/src/ar.js +0 -243
  13. package/src/dirname.js +0 -1
  14. package/src/helpers.js +0 -161
  15. package/src/index.js +0 -4
  16. package/src/lua/aos2_0_1.wasm +0 -0
  17. package/src/test.js +0 -94
  18. package/src/utils.js +0 -324
  19. package/test/.cache/opt.json +0 -1
  20. package/test/test.js +0 -50
  21. /package/{dist/cjs → cjs}/accounts.js +0 -0
  22. /package/{dist/cjs → cjs}/ao.js +0 -0
  23. /package/{dist/cjs → cjs}/aoconnect.js +0 -0
  24. /package/{dist/cjs → cjs}/ar.js +0 -0
  25. /package/{dist/cjs → cjs}/dirname.js +0 -0
  26. /package/{dist/cjs → cjs}/helpers.js +0 -0
  27. /package/{dist/cjs → cjs}/index.js +0 -0
  28. /package/{dist/cjs → cjs}/lua/aos2_0_1.wasm +0 -0
  29. /package/{dist/cjs → cjs}/utils.js +0 -0
  30. /package/{dist/esm → esm}/.cache/opt.json +0 -0
  31. /package/{dist/esm → esm}/accounts.js +0 -0
  32. /package/{dist/esm → esm}/ao.js +0 -0
  33. /package/{dist/esm → esm}/aoconnect.js +0 -0
  34. /package/{dist/esm → esm}/ar.js +0 -0
  35. /package/{dist/esm → esm}/dirname.js +0 -0
  36. /package/{dist/esm → esm}/helpers.js +0 -0
  37. /package/{dist/esm → esm}/index.js +0 -0
  38. /package/{dist/esm → esm}/lua/aos2_0_1.wasm +0 -0
  39. /package/{dist/esm → esm}/test.js +0 -0
  40. /package/{dist/esm → esm}/utils.js +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,15 +1,9 @@
1
1
  {
2
2
  "name": "wao",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "",
5
- "type": "module",
6
- "main": "dist/cjs/index.js",
7
- "module": "dist/src/index.js",
8
- "scripts": {
9
- "build:cjs": "babel src --out-dir dist/cjs --config-file ./.babelrc-cjs && rm dist/cjs/test.js",
10
- "build": "rm -rf dist && npm run build:cjs && cp src -rf dist/esm && node make.js && cp .npmignore dist/ && cp src/lua dist/cjs/lua -rf",
11
- "test": "mocha --node-option=experimental-wasm-memory64"
12
- },
5
+ "main": "cjs/index.js",
6
+ "module": "esm/index.js",
13
7
  "exports": {
14
8
  ".": {
15
9
  "require": "./cjs/index.js",
@@ -38,13 +32,5 @@
38
32
  "arweave": "^1.15.1",
39
33
  "base64url": "^3.0.1",
40
34
  "ramda": "^0.30.1"
41
- },
42
- "devDependencies": {
43
- "@babel/cli": "^7.24.8",
44
- "@babel/core": "^7.25.2",
45
- "@babel/preset-env": "^7.25.3",
46
- "chai": "^5.1.1",
47
- "mocha": "^10.7.3",
48
- "yargs": "^17.7.2"
49
35
  }
50
- }
36
+ }
package/.babelrc-cjs DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env", { "modules": "commonjs" }]
4
- ]
5
- }
package/.babelrc-esm DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env", { "modules": false }]
4
- ]
5
- }
package/README.md DELETED
@@ -1,589 +0,0 @@
1
- # WAO SDK
2
-
3
- WAO SDK streamlines Arweave/AO development with elegant syntax enhancements and seamless message piping for an enjoyable coding experience. Additionally, it includes a drop-in replacement for `aoconnect`, allowing to test lua scripts 1000x faster than the mainnet by emulating AO units in-memory.
4
-
5
- - [Quick Start](#quick-start)
6
- - [Installation](#installation)
7
-
8
- - [API Reference](#api-reference)
9
- - [AR](#ar)
10
- - [AO](#ao)
11
-
12
- ## Quick Start
13
-
14
- ### Installation
15
-
16
- ```bash
17
- yarn add wao
18
- ```
19
- ### Drop-in `aoconnect` Replacement for Tests
20
-
21
- By replacing `aoconnect` with WAO connect, everything runs in-memory with zero latency and your tests execute 1000x faster. The APIs are identical. So there's no need to change anything else in your code.
22
-
23
- ```js
24
- //import { spawn, message, dryrun, assign, result } from "@permaweb/aoconnect"
25
- import { connect } from "wao/test/aoconnect.js"
26
- const { spawn, message, dryrun, assign, result } = connect()
27
- ```
28
-
29
- ```js
30
- import { AR, AO } from "wao"
31
- ```
32
- ### Setting up a Project
33
-
34
- It's super easy to set up a test AO project manually.
35
-
36
- ```bash
37
- mkdir wao-test && cd wao-test
38
- yarn init && yarn add wao && yarn add mocha chai --dev
39
- ```
40
-
41
- Add a `test` command to your `package.json`, and set `module` type to work with ES6.
42
-
43
- ```json
44
- {
45
- "name": "wao-test",
46
- "version": "1.0.0",
47
- "type": "module",
48
- "dependencies": {
49
- "wao": "^0.1.1"
50
- },
51
- "devDependencies": {
52
- "chai": "^5.1.2",
53
- "mocha": "^10.8.2"
54
- },
55
- "scripts": {
56
- "test": "mocha --node-option=experimental-wasm-memory64"
57
- }
58
- }
59
- ```
60
-
61
- Create `test` directory and `test.js` file.
62
-
63
- ```bash
64
- mkdir test && touch test.js
65
- ```
66
-
67
- ### Writing Tests
68
-
69
- Write a simple test in `test.js`.
70
-
71
- ```js
72
- import { expect } from "chai"
73
- import { connect } from "wao/test/aoconnect.js"
74
- const { accounts, spawn, message, dryrun } = connect()
75
- // import { utils } from "wao"
76
-
77
- const src_data = `
78
- Handlers.add("Hello", "Hello", function (msg)
79
- msg.reply({ Data = "Hello, World!" })
80
- end
81
- )
82
- `
83
- describe("WAO", function () {
84
- this.timeout(0)
85
- describe("Aoconnect Replacement", function () {
86
- it("should spawn a process and send messages", async () => {
87
- const pid = await spawn({ signer: accounts[0].signer })
88
-
89
- // on mainnet, you need to wait here till the process becomes available.
90
- // WAO automatically handles it. No need with in-memory tests.
91
- // await utils.wait({ pid })
92
-
93
- await message({
94
- process: pid,
95
- tags: [{ name: "Action", value: "Eval" }],
96
- data: src_data,
97
- signer,
98
- })
99
- const res = await dryrun({
100
- process: pid,
101
- tags: [{ name: "Action", value: "Hello" }],
102
- signer,
103
- })
104
- expect(res.Messages[0].Data).to.eql("Hello, World!")
105
- })
106
- })
107
- })
108
- ```
109
- Note that generating random Arweave wallets for every test takes time and slows down your test executions, so Wao connect provides pre-generated accounts for your tests, which saves hours if you are to run your tests thousands of times.
110
-
111
- - `accounts[0] = { jwk, addr, signer }`
112
-
113
- Run the test.
114
-
115
- ```js
116
- yarn test
117
- ```
118
-
119
- WAO comes with elegant syntactic sugar and makes writing AO projects absolute joy.
120
-
121
- The same test can be written as follows.
122
-
123
- ```js
124
- import { expect } from "chai"
125
- import { AO } from "wao"
126
-
127
- const src_data = `
128
- Handlers.add( "Hello", "Hello", function (msg)
129
- msg.reply({ Data = "Hello, World!" })
130
- end
131
- )
132
- `
133
- describe("WAO", function () {
134
- this.timeout(0)
135
- describe("AO Class", function () {
136
- it("should spawn a process send messages", async () => {
137
- const ao = await new AO({ in_memory: true }).init())
138
- const { p } = await ao.deploy({ src_data })
139
- expect(await p.d("Hello")).to.eql("Hello, World!")
140
- })
141
- })
142
- })
143
- ```
144
- The `AO` class is not only for tests, but also for production code. You just need to set `in_memory: true` to run the in-memory emulator when testing.
145
-
146
- ## API Reference
147
-
148
- ### AR
149
-
150
- `AR` handles operations on the base Arweave Storage layer as well as wallet connections.
151
-
152
- - [Instantiate](#instantiate)
153
- - [Set or Generate Wallet](#set-or-generate-wallet)
154
- - [toAddr](#toaddr)
155
- - [mine](#mine)
156
- - [balance | toAR | toWinston](#balance--toar--towinston)
157
- - [transfer](#transfer)
158
- - [checkWallet](#checkwallet)
159
- - [post](#post)
160
- - [tx](#tx)
161
- - [data](#data)
162
- - [bundle](#bundle)
163
-
164
- #### Instantiate
165
-
166
- ```js
167
- const ar = new AR()
168
- ```
169
- `host`, `port`, and `protocol` can be set to access a specific gateway rather than `https://arweave.net`.
170
-
171
- ```js
172
- const ar = new AR({ host: "localhost", port: 4000, protocol: "http" })
173
- ```
174
-
175
- In case of local gateways, you can only set `port` and the rest will be automatically figured out.
176
- ```js
177
- const ar = new AR({ port: 4000 })
178
- ```
179
-
180
- #### Set or Generate Wallet
181
-
182
- You can initialize AR with a wallet JWK or ArConnect.
183
-
184
- ```js
185
- const ar = await new AR().init(jwk || arweaveWallet)
186
- ```
187
-
188
- Or you can generate a new wallet. In case of ArLocal, you can mint AR at the same time.
189
-
190
- ```js
191
- const { jwk, addr, pub, balance } = await ar.gen("100") // mint 100 AR
192
- ```
193
-
194
- Once a wallet is set in one of these 3 ways, you cannot use the instance with another wallet unless you re-initialize it with another wallet. This is to prevent executing transactions with the wrong wallet when the browser connected active address has been changed unknowingly.
195
-
196
- You can go on without calling `init` or `gen`, in this case, AR generates a random wallet when needed, and also using different wallets will be allowed. This is useful, if you are only calling `dryrun` with AO, since AO requires a signature for `dryrun` too, but you don't want to bother the user by triggering the browser extension wallet for read only calls.
197
-
198
- Once a wallet is set, `ar.jwk` and `ar.addr` will be available.
199
-
200
- #### Token Related Methods
201
-
202
- ##### toAddr
203
-
204
- Convert a jwk to the corresponding address.
205
-
206
- ```js
207
- const addr = await ar.toAddr(jwk)
208
- ```
209
-
210
- ##### mine
211
-
212
- Mine pending blocks (only for arlocal).
213
-
214
- ```js
215
- await ar.mine()
216
- ```
217
-
218
- ##### balance | toAR | toWinston
219
-
220
- Get the current balance of the specified address in AR. `addr` will be `ar.addr` if omitted.
221
-
222
- ```js
223
- const balance_AR = await ar.balance() // get own balance
224
- const balance_Winston = ar.toWinston(balance_AR)
225
- const balance_AR2 = ar.toAR(balance_Winston)
226
- const balance_AR3 = await ar.balance(addr) // specify wallet address
227
- ```
228
-
229
- ##### transfer
230
-
231
- Transfer AR token. `amount` is in AR, not in winston for simplicity.
232
-
233
- ```js
234
- const { id } = await ar.transfer(amount, to)
235
- ```
236
-
237
- You can set a jwk to the 3rd parameter as a sender, otherwise the sender is `ar.jwk`.
238
-
239
- ```js
240
- const { id } = await ar.transfer(amount, to, jwk)
241
- ```
242
-
243
- For most write functions, `jwk` can be specified as the last parameter or a field like `{ data, tags, jwk }`.
244
-
245
-
246
- ##### checkWallet
247
-
248
- `checkWallet` is mostly used internally, but it returns `this.jwk` if a wallet has been assigned with `init`, or else it generates a random wallet to use. The following pattern is used in many places. With this pattern, if a wallet is set with `init` and the `jwk` the user is passing is different, `checkWallet` produces an error to prevent the wrong wallet. If no wallet has been set with `init` or `gen` and the `jwk` is not passed, it generates and returns a random wallet.
249
-
250
- ```js
251
- some_class_method({ jwk }){
252
- let err = null
253
- ;({ err, jwk } = await ar.checkWallet({ jwk }))
254
- if(!err){
255
- // do domething with the jwk
256
- }
257
- }
258
- ```
259
-
260
- #### Storage Related Methods
261
-
262
- ##### post
263
-
264
- Post a data to Arweave.
265
-
266
- ```js
267
- const { err, id } = await ar.post({ data, tags })
268
- ```
269
-
270
- `tags` are not an Array but a hash map Object for brevity.
271
-
272
- ```js
273
- const tags = { "Content-Type": "text/markdown", Type: "blog-post" }
274
- ```
275
-
276
- If you must use the same name for multiple tags, the value can be an Array.
277
-
278
- ```js
279
- const tags = { Name: [ "name-tag-1", "name-tag-2" ] }
280
- ```
281
-
282
-
283
- ##### tx
284
-
285
- Get a transaction.
286
-
287
- ```js
288
- const tx = await ar.tx(txid)
289
- ```
290
-
291
- ##### data
292
-
293
- Get a data.
294
-
295
- ```js
296
- const data = await ar.data(txid, true) // true if string
297
- ```
298
-
299
- ##### bundle
300
-
301
- Bundle ANS-104 dataitems.
302
-
303
- ```js
304
- const { err, id } = await ar.bundle(dataitems)
305
- ```
306
- `dataitems` are `[ [ data, tags ], [ data, tags ], [ data, tags ] ]`.
307
- ```js
308
- const { err, id } = await ar.bundle([
309
- [ "this is text", { "Content-Type": "text/plain" }],
310
- [ "# this is markdown", { "Content-Type": "text/markdown" }],
311
- [ png_image, { "Content-Type": "image/png" }]
312
- ])
313
- ```
314
-
315
- ### AO
316
-
317
- - [Instantiate](#instantiate-1)
318
- - [deploy](#deploy)
319
- - [msg](#msg)
320
- - [dry](#dry)
321
- - [asgn](#asgn)
322
- - [load](#load)
323
- - [eval](#eval)
324
- - [spwn](#spwn)
325
- - [aoconnect Functions](#aoconnect-functions)
326
- - [postModule](#postmodule)
327
- - [postScheduler](#postscheduler)
328
- - [wait](#wait)
329
- - [Function Piping](#function-piping)
330
-
331
- #### Instantiate
332
-
333
- You can initialize AO in the same way as AR.
334
-
335
- ```js
336
- const ao = await new AO().init(arweaveWallet || jwk)
337
- ```
338
- If you need to pass AR settings, use `ar`. `ao.ar` will be automatically available.
339
-
340
- ```js
341
- const ao = await new AO({ ar: { port: 4000 }}).init(arweaveWallet || jwk)
342
- const addr = ao.ar.addr
343
- await ao.ar.post({ data, tags })
344
- ```
345
-
346
- #### AO Core Functions
347
-
348
- ##### deploy
349
-
350
- Spawn a process, get a Lua source, and eval the script. `src` is an Arweave txid of the Lua script.
351
-
352
- ```js
353
- const { err, res, pid } = await ao.deploy({ data, tags, src, fills })
354
- ```
355
-
356
- `fills` replace the Lua source script from `src`.
357
-
358
- ```lua
359
- local replace_me = '<REPLACE_ME>'
360
- local replace_me_again = '<REPLACE_ME_AGAIN>'
361
- local replace_me_with_hello_again = '<REPLACE_ME>'
362
- ```
363
-
364
- ```js
365
- const fills = { REPLACE_ME: "hello", REPLACE_ME_AGAIN: "world" }
366
- ```
367
- This will end up in the following lua script.
368
-
369
- ```lua
370
- local replace_me = 'hello'
371
- local replace_me_again = 'world'
372
- local replace_me_with_hello_again = 'hello'
373
- ```
374
-
375
- In case you have multiple scripts, use `loads` and pass `src` and `fills` respectively.
376
-
377
- ```js
378
- await ao.deploy({ tags, loads: [ { src, fills }, { src: src2, fills: fills2 } ] })
379
- ```
380
-
381
-
382
- ##### msg
383
-
384
- Send a message.
385
-
386
-
387
- ```js
388
- const { err, mid, res, out } = await ao.msg({
389
- data, action, tags, check, checkData, get
390
- })
391
- ```
392
-
393
- `check` determins if the message call is successful by checking through `Tags` in `Messages` in `res`.
394
-
395
- ```js
396
- const check = { "Status" : "Success" } // succeeds if Status tag is "Success"
397
- const check2 = { "Status" : true } // succeeds if Status tag exists
398
- ```
399
-
400
-
401
- `checkData` checks `Data` field instead of `Tags`.
402
-
403
- ```js
404
- const checkData = "Success" // succeeds if Data field is "Success"
405
- const checkData2 = true // succeeds if Data field exists
406
- ```
407
-
408
- `get` will return specified data via `out`.
409
-
410
-
411
- ```js
412
- const get = "ID" // returns the value of "ID" tag
413
- const get2 = { name: "Profile", json: true } // "Profile" tag with JSON.parse()
414
- const get3 = { data: true, json: true } // returns Data field with JSON.parse()
415
- ```
416
-
417
- ##### dry
418
-
419
- Dryrun a message without writing to Arweave.
420
-
421
-
422
- ```js
423
- const { err, res, out } = await ao.dry({
424
- data, action, tags, check, checkData, get
425
- })
426
- ```
427
-
428
- ##### asgn
429
-
430
- Assign an existing message to a process.
431
-
432
- ```js
433
- const { err, mid, res, out } = await ao.asgn({ pid, mid, check, checkData, get })
434
- ```
435
-
436
- ##### load
437
-
438
- Get a Lua source script from Arweave and eval it on a process.
439
-
440
- ```js
441
- const { err, res, mid } = await ao.load({ src, fills, pid })
442
- ```
443
-
444
- ##### eval
445
-
446
- Eval a Lua script on a process.
447
-
448
- ```js
449
- const { err, res, mid } = await ao.eval({ pid, data })
450
- ```
451
-
452
- ##### spwn
453
-
454
- Spawn a process. `module` and `scheduler` are auto-set if omitted.
455
-
456
- ```js
457
- const { err, res, pid } = await ao.spwn({ module, scheduler, tags, data })
458
- ```
459
-
460
- #### aoconnect Functions
461
-
462
- The original aoconnect functions `message` | `spawn` | `result` | `assign` | `dryrun` are also available.
463
- `createDataItemSigner` is available as `toSigner`.
464
-
465
- ```js
466
- const signer = ao.toSigner(jwk)
467
- const process = await ao.spawn({ module, scheduler, signer, tags, data })
468
- const message = await ao.message({ process, signer, tags, data })
469
- const result = await ao.result({ process, message })
470
- ```
471
-
472
- #### Advanced Functions
473
-
474
- ##### postModule
475
-
476
- `data` should be wasm binary. `overwrite` to replace the default module set to the AO instance.
477
-
478
- ```js
479
- const { err, id: module } = await ao.postModule({ data, jwk, tags, overwrite })
480
-
481
- ```
482
-
483
- ##### postScheduler
484
-
485
- This will post `Scheduler-Location` with the `jwk` address as the returning `scheduler`.
486
-
487
- ```js
488
- const { err, scheduler } = await ao.postScheduler({ url, jwk, tags, overwrite })
489
- ```
490
-
491
- ##### wait
492
-
493
- `wait` untill the process becomes available after `spwn`. This is mostly used internally with `deploy`.
494
-
495
- ```js
496
- const { err } = await ao.wait({ pid })
497
- ```
498
-
499
- #### Function Piping
500
-
501
- Most functions return in the format of `{ err, res, out, pid, mid, id }`, and these function can be chained with `pipe`, which makes executing multiple messages a breeze.
502
-
503
- For example, following is how `deploy` uses `pipe` internally. The execusion will be immediately aborted if any of the functions in `fns` produces an error.
504
-
505
- ```js
506
- let fns = [
507
- {
508
- fn: "spwn",
509
- args: { module, scheduler, tags, data },
510
- then: { "args.pid": "pid" },
511
- },
512
- { fn: "wait", then: { "args.pid": "pid" } },
513
- { fn: "load", args: { src, fills }, then: { "args.pid": "pid" } }
514
- ]
515
- const { err, res, out, pid } = await this.pipe({ jwk, fns })
516
- ```
517
-
518
- ##### bind
519
-
520
- If the function comes from other instances rather than `AO`, use `bind`.
521
-
522
- ```js
523
- const fns = [{ fn: "post", bind: this.ar, args: { data, tags }}]
524
- ```
525
-
526
- ##### then
527
-
528
- You can pass values between functions with `then`. For instance, passing the result from the previous functions to the next function's arguments is a common operation.
529
-
530
- ```js
531
- const fns = [
532
- { fn: "post", bind: ao.ar, args: { data, tags }, then: ({ id, args, out })=>{
533
- args.tags.TxId = id // adding TxId tag to `msg` args
534
- out.txid = id // `out` will be returned at last with `pipe`
535
- }},
536
- { fn: "msg", args: { pid, tags }},
537
- ]
538
- const { out: { txid } } = await ao.pipe({ fns, jwk })
539
- ```
540
-
541
- If `then` returns a value, `pipe` will immediately return with that single value. You can also use `err` to abort `pipe` with an error.
542
-
543
- ```js
544
- const fns = [
545
- { fn: "msg", args: { pid, tags }, then: ({ inp })=>{
546
- if(inp.done) return inp.val
547
- }},
548
- { fn: "msg", args: { pid, tags }, err: ({ inp })=>{
549
- if(!inp.done) return "something went wrong"
550
- }},
551
- ]
552
- const val = await ao.pipe({ jwk, fns })
553
-
554
- ```
555
-
556
- `then` has many useful parameters.
557
-
558
- - `res` : `res` from the previous result
559
- - `args` : `args` for the next function
560
- - `out` : `out` the final `out` result from the `pipe` sequence
561
- - `inp` : `out` from the previous result
562
- - `_` : if values are assigned to the `_` fields, `pipe` returns them as top-level fields in the end
563
- - `pid` : `pid` will be passed if any previous functions returns `pid` ( e.g. `deploy` )
564
- - `mid` : `mid` will be passed if any previous functions returns `mid` ( e.g. `msg` )
565
- - `id` : `id` will be passed if any previous functions returns `id` ( e.g. `post` )
566
-
567
- `then` can be a simplified hashmap object.
568
-
569
- ```js
570
- let fns = [
571
- {
572
- fn: "msg",
573
- args: { tags },
574
- then: { "args.mid": "mid", "out.key": "inp.a", "_.val": "inp.b" },
575
- },
576
- { fn: "some_func", args: {} } // args.mid will be set from the previous `then`
577
- ]
578
- const { out: { key }, val } = await ao.pipe({ jwk, fns })
579
- ```
580
-
581
- ##### cb
582
-
583
- `cb` can report the current progress of `pipe` after every function execution.
584
-
585
- ```js
586
- await ao.pipe({ jwk, fns, cb: ({ i, fns, inp })=>{
587
- console.log(`${i} / ${fns.length} functions executed`)
588
- }})
589
- ```
package/dist/package.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "name": "wao",
3
- "version": "0.1.4",
4
- "description": "",
5
- "main": "cjs/index.js",
6
- "module": "esm/index.js",
7
- "exports": {
8
- ".": {
9
- "require": "./cjs/index.js",
10
- "import": "./esm/index.js"
11
- },
12
- "./utils": {
13
- "require": "./cjs/utils.js",
14
- "import": "./esm/utils.js"
15
- },
16
- "./connect": {
17
- "require": "./cjs/aoconnect.js",
18
- "import": "./esm/aoconnect.js"
19
- },
20
- "./test": {
21
- "require": "./cjs/helpers.js",
22
- "import": "./esm/helpers.js"
23
- }
24
- },
25
- "author": "",
26
- "license": "MIT",
27
- "dependencies": {
28
- "@babel/plugin-transform-modules-commonjs": "^7.24.8",
29
- "@permaweb/ao-loader": "^0.0.43",
30
- "@permaweb/aoconnect": "^0.0.61",
31
- "arbundles": "^0.11.1",
32
- "arweave": "^1.15.1",
33
- "base64url": "^3.0.1",
34
- "ramda": "^0.30.1"
35
- }
36
- }
package/make.js DELETED
@@ -1,23 +0,0 @@
1
- import { writeFileSync, readFileSync } from "fs"
2
- import { resolve } from "path"
3
-
4
- const packageJson = resolve(import.meta.dirname, "package.json")
5
- const packageJsonDist = resolve(import.meta.dirname, "dist/package.json")
6
- const packageJsonDist2 = resolve(import.meta.dirname, "dist/esm/package.json")
7
- const json = JSON.parse(readFileSync(packageJson, "utf8"))
8
- delete json.type
9
- delete json.devDependencies
10
- delete json.scripts
11
- json.main = "cjs/index.js"
12
- json.module = "esm/index.js"
13
-
14
- console.log(json)
15
- writeFileSync(packageJsonDist, JSON.stringify(json, undefined, 2))
16
-
17
- const json2 = JSON.parse(readFileSync(packageJson, "utf8"))
18
- json2.type = "module"
19
- delete json2.devDependencies
20
- delete json2.scripts
21
- delete json2.main
22
- json2.module = "index.js"
23
- //writeFileSync(packageJsonDist2, JSON.stringify(json2, undefined, 2))