@fireproof/vendor 0.0.0-smoke → 0.22.0-dev-preview
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/merge-package.ts +207 -0
- package/p-limit/index.d.ts +81 -0
- package/p-limit/index.js +104 -0
- package/p-limit/index.test-d.ts +19 -0
- package/p-limit/license +9 -0
- package/p-limit/package.json +59 -0
- package/p-limit/readme.md +128 -0
- package/p-limit/test.js +241 -0
- package/package.json +12 -9
- package/to-esm-transform.ts +42 -0
- package/patched/@ipld/dag-json/.github/dependabot.yml +0 -11
- package/patched/@ipld/dag-json/.github/workflows/js-test-and-release.yml +0 -28
- package/patched/@ipld/dag-json/CHANGELOG.md +0 -202
- package/patched/@ipld/dag-json/LICENSE +0 -4
- package/patched/@ipld/dag-json/LICENSE-APACHE +0 -5
- package/patched/@ipld/dag-json/LICENSE-MIT +0 -19
- package/patched/@ipld/dag-json/README.md +0 -58
- package/patched/@ipld/dag-json/ipld-dag-json-10.2.3.tgz +0 -0
- package/patched/@ipld/dag-json/package.json +0 -173
- package/patched/@ipld/dag-json/src/index.js +0 -291
- package/patched/@ipld/dag-json/test/test-basics.spec.js +0 -290
- package/patched/@ipld/dag-json/test/ts-use/package.json +0 -11
- package/patched/@ipld/dag-json/test/ts-use/src/main.ts +0 -54
- package/patched/@ipld/dag-json/test/ts-use/tsconfig.json +0 -9
- package/patched/@ipld/dag-json/tsconfig.json +0 -14
- package/patched/cborg/.github/dependabot.yml +0 -16
- package/patched/cborg/.github/workflows/test-and-release.yml +0 -52
- package/patched/cborg/CHANGELOG.md +0 -513
- package/patched/cborg/LICENSE +0 -13
- package/patched/cborg/README.md +0 -515
- package/patched/cborg/bench/bench.js +0 -117
- package/patched/cborg/bench/json.js +0 -124
- package/patched/cborg/bench/package.json +0 -8
- package/patched/cborg/cborg-4.2.7.tgz +0 -0
- package/patched/cborg/cborg.js +0 -31
- package/patched/cborg/example-bytestrings.js +0 -180
- package/patched/cborg/example-json.js +0 -6
- package/patched/cborg/example.js +0 -5
- package/patched/cborg/interface.ts +0 -56
- package/patched/cborg/lib/0uint.js +0 -227
- package/patched/cborg/lib/1negint.js +0 -111
- package/patched/cborg/lib/2bytes.js +0 -133
- package/patched/cborg/lib/3string.js +0 -90
- package/patched/cborg/lib/4array.js +0 -113
- package/patched/cborg/lib/5map.js +0 -113
- package/patched/cborg/lib/6tag.js +0 -80
- package/patched/cborg/lib/7float.js +0 -308
- package/patched/cborg/lib/bin.js +0 -189
- package/patched/cborg/lib/bl.js +0 -124
- package/patched/cborg/lib/byte-utils.js +0 -417
- package/patched/cborg/lib/common.js +0 -27
- package/patched/cborg/lib/decode.js +0 -209
- package/patched/cborg/lib/diagnostic.js +0 -156
- package/patched/cborg/lib/diagnostic_test.js +0 -117
- package/patched/cborg/lib/encode.js +0 -464
- package/patched/cborg/lib/is.js +0 -106
- package/patched/cborg/lib/json/decode.js +0 -462
- package/patched/cborg/lib/json/encode.js +0 -299
- package/patched/cborg/lib/json/json.js +0 -4
- package/patched/cborg/lib/jump.js +0 -209
- package/patched/cborg/lib/length.js +0 -61
- package/patched/cborg/lib/token.js +0 -76
- package/patched/cborg/package.json +0 -169
- package/patched/cborg/pnpm-lock.yaml +0 -6096
- package/patched/cborg/taglib.js +0 -73
- package/patched/cborg/test/appendix_a.js +0 -647
- package/patched/cborg/test/common.js +0 -18
- package/patched/cborg/test/node-test-bin.js +0 -402
- package/patched/cborg/test/noop-bin-test.js +0 -3
- package/patched/cborg/test/test-0uint.js +0 -103
- package/patched/cborg/test/test-1negint.js +0 -96
- package/patched/cborg/test/test-2bytes.js +0 -198
- package/patched/cborg/test/test-3string.js +0 -136
- package/patched/cborg/test/test-4array.js +0 -93
- package/patched/cborg/test/test-5map.js +0 -284
- package/patched/cborg/test/test-6tag.js +0 -85
- package/patched/cborg/test/test-7float.js +0 -131
- package/patched/cborg/test/test-bl.js +0 -37
- package/patched/cborg/test/test-cbor-vectors.js +0 -107
- package/patched/cborg/test/test-decode-errors.js +0 -65
- package/patched/cborg/test/test-fuzz.js +0 -42
- package/patched/cborg/test/test-json.js +0 -219
- package/patched/cborg/test/test-length.js +0 -65
- package/patched/cborg/test/test-partial.js +0 -111
- package/patched/cborg/tsconfig.json +0 -45
- package/patched/cborg/types/cborg.d.ts +0 -28
- package/patched/cborg/types/cborg.d.ts.map +0 -1
- package/patched/cborg/types/example.d.ts +0 -2
- package/patched/cborg/types/example.d.ts.map +0 -1
- package/patched/cborg/types/interface.d.ts +0 -47
- package/patched/cborg/types/interface.d.ts.map +0 -1
- package/patched/cborg/types/lib/0uint.d.ts +0 -100
- package/patched/cborg/types/lib/0uint.d.ts.map +0 -1
- package/patched/cborg/types/lib/1negint.d.ts +0 -58
- package/patched/cborg/types/lib/1negint.d.ts.map +0 -1
- package/patched/cborg/types/lib/2bytes.d.ts +0 -68
- package/patched/cborg/types/lib/2bytes.d.ts.map +0 -1
- package/patched/cborg/types/lib/3string.d.ts +0 -46
- package/patched/cborg/types/lib/3string.d.ts.map +0 -1
- package/patched/cborg/types/lib/4array.d.ts +0 -65
- package/patched/cborg/types/lib/4array.d.ts.map +0 -1
- package/patched/cborg/types/lib/5map.d.ts +0 -65
- package/patched/cborg/types/lib/5map.d.ts.map +0 -1
- package/patched/cborg/types/lib/6tag.d.ts +0 -61
- package/patched/cborg/types/lib/6tag.d.ts.map +0 -1
- package/patched/cborg/types/lib/7float.d.ts +0 -60
- package/patched/cborg/types/lib/7float.d.ts.map +0 -1
- package/patched/cborg/types/lib/bin.d.ts +0 -4
- package/patched/cborg/types/lib/bin.d.ts.map +0 -1
- package/patched/cborg/types/lib/bl.d.ts +0 -26
- package/patched/cborg/types/lib/bl.d.ts.map +0 -1
- package/patched/cborg/types/lib/byte-utils.d.ts +0 -53
- package/patched/cborg/types/lib/byte-utils.d.ts.map +0 -1
- package/patched/cborg/types/lib/common.d.ts +0 -10
- package/patched/cborg/types/lib/common.d.ts.map +0 -1
- package/patched/cborg/types/lib/decode.d.ts +0 -41
- package/patched/cborg/types/lib/decode.d.ts.map +0 -1
- package/patched/cborg/types/lib/diagnostic.d.ts +0 -12
- package/patched/cborg/types/lib/diagnostic.d.ts.map +0 -1
- package/patched/cborg/types/lib/diagnostic_test.d.ts +0 -2
- package/patched/cborg/types/lib/diagnostic_test.d.ts.map +0 -1
- package/patched/cborg/types/lib/encode.d.ts +0 -50
- package/patched/cborg/types/lib/encode.d.ts.map +0 -1
- package/patched/cborg/types/lib/is.d.ts +0 -6
- package/patched/cborg/types/lib/is.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/decode.d.ts +0 -67
- package/patched/cborg/types/lib/json/decode.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/encode.d.ts +0 -11
- package/patched/cborg/types/lib/json/encode.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/forward-cborg.d.ts +0 -6
- package/patched/cborg/types/lib/json/forward-cborg.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/json.d.ts +0 -6
- package/patched/cborg/types/lib/json/json.d.ts.map +0 -1
- package/patched/cborg/types/lib/jump.d.ts +0 -12
- package/patched/cborg/types/lib/jump.d.ts.map +0 -1
- package/patched/cborg/types/lib/length.d.ts +0 -27
- package/patched/cborg/types/lib/length.d.ts.map +0 -1
- package/patched/cborg/types/lib/token.d.ts +0 -59
- package/patched/cborg/types/lib/token.d.ts.map +0 -1
- package/patched/cborg/types/taglib.d.ts +0 -18
- package/patched/cborg/types/taglib.d.ts.map +0 -1
- package/patched/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/@ipld/car/car/LICENSE +0 -4
- package/src/@ipld/car/car/README.md +0 -1078
- package/src/@ipld/car/car/dist/index.min.js +0 -5
- package/src/@ipld/car/car/dist/src/api.d.ts +0 -72
- package/src/@ipld/car/car/dist/src/api.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts +0 -67
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts +0 -116
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts +0 -31
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts +0 -86
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/coding.d.ts +0 -49
- package/src/@ipld/car/car/dist/src/coding.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts +0 -43
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/decoder.d.ts +0 -87
- package/src/@ipld/car/car/dist/src/decoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/encoder.d.ts +0 -17
- package/src/@ipld/car/car/dist/src/encoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/header-validator.d.ts +0 -5
- package/src/@ipld/car/car/dist/src/header-validator.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/index-browser.d.ts +0 -10
- package/src/@ipld/car/car/dist/src/index-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/index.d.ts +0 -11
- package/src/@ipld/car/car/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts +0 -5
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts +0 -152
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexer.d.ts +0 -95
- package/src/@ipld/car/car/dist/src/indexer.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts +0 -7
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/iterator.d.ts +0 -174
- package/src/@ipld/car/car/dist/src/iterator.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts +0 -151
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/reader.d.ts +0 -35
- package/src/@ipld/car/car/dist/src/reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts +0 -155
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/writer.d.ts +0 -45
- package/src/@ipld/car/car/dist/src/writer.d.ts.map +0 -1
- package/src/@ipld/car/car/node_modules/.bin/cborg +0 -17
- package/src/@ipld/car/car/package.json +0 -235
- package/src/@ipld/car/car/src/api.ts +0 -90
- package/src/@ipld/car/car/src/buffer-decoder.js +0 -213
- package/src/@ipld/car/car/src/buffer-reader-browser.js +0 -144
- package/src/@ipld/car/car/src/buffer-reader.js +0 -51
- package/src/@ipld/car/car/src/buffer-writer.js +0 -286
- package/src/@ipld/car/car/src/coding.ts +0 -68
- package/src/@ipld/car/car/src/decoder-common.js +0 -82
- package/src/@ipld/car/car/src/decoder.js +0 -347
- package/src/@ipld/car/car/src/encoder.js +0 -76
- package/src/@ipld/car/car/src/header-validator.js +0 -214
- package/src/@ipld/car/car/src/header.ipldsch +0 -18
- package/src/@ipld/car/car/src/index-browser.js +0 -18
- package/src/@ipld/car/car/src/index.js +0 -21
- package/src/@ipld/car/car/src/indexed-reader-browser.js +0 -7
- package/src/@ipld/car/car/src/indexed-reader.js +0 -211
- package/src/@ipld/car/car/src/indexer.js +0 -130
- package/src/@ipld/car/car/src/iterator-channel.js +0 -91
- package/src/@ipld/car/car/src/iterator.js +0 -267
- package/src/@ipld/car/car/src/reader-browser.js +0 -194
- package/src/@ipld/car/car/src/reader.js +0 -56
- package/src/@ipld/car/car/src/writer-browser.js +0 -250
- package/src/@ipld/car/car/src/writer.js +0 -84
- package/src/@ipld/dag-cbor/dag-cbor/LICENSE +0 -4
- package/src/@ipld/dag-cbor/dag-cbor/README.md +0 -80
- package/src/@ipld/dag-cbor/dag-cbor/dist/index.min.js +0 -3
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts +0 -67
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-cbor/dag-cbor/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-cbor/dag-cbor/package.json +0 -171
- package/src/@ipld/dag-cbor/dag-cbor/src/index.js +0 -147
- package/src/@ipld/dag-json/dag-json/LICENSE +0 -4
- package/src/@ipld/dag-json/dag-json/README.md +0 -58
- package/src/@ipld/dag-json/dag-json/dist/index.min.js +0 -3
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts +0 -12
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-json/dag-json/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-json/dag-json/package.json +0 -173
- package/src/@ipld/dag-json/dag-json/src/index.js +0 -291
- package/src/@web3-storage/pail/pail/LICENSE.md +0 -232
- package/src/@web3-storage/pail/pail/README.md +0 -84
- package/src/@web3-storage/pail/pail/cli.js +0 -218
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts +0 -59
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts +0 -31
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts +0 -75
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts +0 -3
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts +0 -35
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts +0 -10
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts +0 -48
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts +0 -26
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts +0 -11
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts +0 -5
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts +0 -9
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts +0 -13
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts +0 -10
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts +0 -5
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts +0 -43
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/tsconfig.tsbuildinfo +0 -1
- package/src/@web3-storage/pail/pail/node_modules/.bin/pail +0 -17
- package/src/@web3-storage/pail/pail/package.json +0 -173
- package/src/@web3-storage/pail/pail/src/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/api.ts +0 -90
- package/src/@web3-storage/pail/pail/src/batch/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/batch/api.ts +0 -59
- package/src/@web3-storage/pail/pail/src/batch/index.js +0 -258
- package/src/@web3-storage/pail/pail/src/batch/shard.js +0 -13
- package/src/@web3-storage/pail/pail/src/block.js +0 -75
- package/src/@web3-storage/pail/pail/src/clock/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/clock/api.ts +0 -12
- package/src/@web3-storage/pail/pail/src/clock/index.js +0 -182
- package/src/@web3-storage/pail/pail/src/crdt/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/crdt/api.ts +0 -33
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.ts +0 -30
- package/src/@web3-storage/pail/pail/src/crdt/batch/index.js +0 -155
- package/src/@web3-storage/pail/pail/src/crdt/index.js +0 -354
- package/src/@web3-storage/pail/pail/src/diff.js +0 -151
- package/src/@web3-storage/pail/pail/src/index.js +0 -406
- package/src/@web3-storage/pail/pail/src/merge.js +0 -43
- package/src/@web3-storage/pail/pail/src/shard.js +0 -180
- package/src/cborg/cborg/.github/dependabot.yml +0 -16
- package/src/cborg/cborg/.github/workflows/test-and-release.yml +0 -52
- package/src/cborg/cborg/CHANGELOG.md +0 -513
- package/src/cborg/cborg/LICENSE +0 -13
- package/src/cborg/cborg/README.md +0 -515
- package/src/cborg/cborg/bench/bench.js +0 -117
- package/src/cborg/cborg/bench/json.js +0 -124
- package/src/cborg/cborg/bench/package.json +0 -8
- package/src/cborg/cborg/cborg.js +0 -31
- package/src/cborg/cborg/example-bytestrings.js +0 -180
- package/src/cborg/cborg/example-json.js +0 -6
- package/src/cborg/cborg/example.js +0 -5
- package/src/cborg/cborg/interface.ts +0 -56
- package/src/cborg/cborg/lib/0uint.js +0 -227
- package/src/cborg/cborg/lib/1negint.js +0 -111
- package/src/cborg/cborg/lib/2bytes.js +0 -133
- package/src/cborg/cborg/lib/3string.js +0 -90
- package/src/cborg/cborg/lib/4array.js +0 -113
- package/src/cborg/cborg/lib/5map.js +0 -113
- package/src/cborg/cborg/lib/6tag.js +0 -80
- package/src/cborg/cborg/lib/7float.js +0 -308
- package/src/cborg/cborg/lib/bin.js +0 -189
- package/src/cborg/cborg/lib/bl.js +0 -124
- package/src/cborg/cborg/lib/byte-utils.js +0 -417
- package/src/cborg/cborg/lib/common.js +0 -27
- package/src/cborg/cborg/lib/decode.js +0 -209
- package/src/cborg/cborg/lib/diagnostic.js +0 -156
- package/src/cborg/cborg/lib/diagnostic_test.js +0 -117
- package/src/cborg/cborg/lib/encode.js +0 -464
- package/src/cborg/cborg/lib/is.js +0 -106
- package/src/cborg/cborg/lib/json/decode.js +0 -462
- package/src/cborg/cborg/lib/json/encode.js +0 -299
- package/src/cborg/cborg/lib/json/json.js +0 -4
- package/src/cborg/cborg/lib/jump.js +0 -209
- package/src/cborg/cborg/lib/length.js +0 -61
- package/src/cborg/cborg/lib/token.js +0 -76
- package/src/cborg/cborg/node_modules/.bin/cborg +0 -17
- package/src/cborg/cborg/package.json +0 -168
- package/src/cborg/cborg/taglib.js +0 -73
- package/src/cborg/cborg/test/appendix_a.js +0 -647
- package/src/cborg/cborg/test/common.js +0 -18
- package/src/cborg/cborg/test/node-test-bin.js +0 -402
- package/src/cborg/cborg/test/noop-bin-test.js +0 -3
- package/src/cborg/cborg/test/test-0uint.js +0 -103
- package/src/cborg/cborg/test/test-1negint.js +0 -96
- package/src/cborg/cborg/test/test-2bytes.js +0 -198
- package/src/cborg/cborg/test/test-3string.js +0 -136
- package/src/cborg/cborg/test/test-4array.js +0 -93
- package/src/cborg/cborg/test/test-5map.js +0 -284
- package/src/cborg/cborg/test/test-6tag.js +0 -85
- package/src/cborg/cborg/test/test-7float.js +0 -131
- package/src/cborg/cborg/test/test-bl.js +0 -37
- package/src/cborg/cborg/test/test-cbor-vectors.js +0 -107
- package/src/cborg/cborg/test/test-decode-errors.js +0 -65
- package/src/cborg/cborg/test/test-fuzz.js +0 -42
- package/src/cborg/cborg/test/test-json.js +0 -219
- package/src/cborg/cborg/test/test-length.js +0 -65
- package/src/cborg/cborg/test/test-partial.js +0 -111
- package/src/cborg/cborg/tsconfig.json +0 -45
- package/src/cborg/cborg/types/cborg.d.ts +0 -28
- package/src/cborg/cborg/types/cborg.d.ts.map +0 -1
- package/src/cborg/cborg/types/example.d.ts +0 -2
- package/src/cborg/cborg/types/example.d.ts.map +0 -1
- package/src/cborg/cborg/types/interface.d.ts +0 -47
- package/src/cborg/cborg/types/interface.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/0uint.d.ts +0 -100
- package/src/cborg/cborg/types/lib/0uint.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/1negint.d.ts +0 -58
- package/src/cborg/cborg/types/lib/1negint.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/2bytes.d.ts +0 -68
- package/src/cborg/cborg/types/lib/2bytes.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/3string.d.ts +0 -46
- package/src/cborg/cborg/types/lib/3string.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/4array.d.ts +0 -65
- package/src/cborg/cborg/types/lib/4array.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/5map.d.ts +0 -65
- package/src/cborg/cborg/types/lib/5map.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/6tag.d.ts +0 -61
- package/src/cborg/cborg/types/lib/6tag.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/7float.d.ts +0 -60
- package/src/cborg/cborg/types/lib/7float.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/bin.d.ts +0 -4
- package/src/cborg/cborg/types/lib/bin.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/bl.d.ts +0 -26
- package/src/cborg/cborg/types/lib/bl.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/byte-utils.d.ts +0 -53
- package/src/cborg/cborg/types/lib/byte-utils.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/common.d.ts +0 -10
- package/src/cborg/cborg/types/lib/common.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/decode.d.ts +0 -41
- package/src/cborg/cborg/types/lib/decode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/diagnostic.d.ts +0 -12
- package/src/cborg/cborg/types/lib/diagnostic.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts +0 -2
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/encode.d.ts +0 -50
- package/src/cborg/cborg/types/lib/encode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/is.d.ts +0 -6
- package/src/cborg/cborg/types/lib/is.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/decode.d.ts +0 -67
- package/src/cborg/cborg/types/lib/json/decode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/encode.d.ts +0 -11
- package/src/cborg/cborg/types/lib/json/encode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts +0 -6
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/json.d.ts +0 -6
- package/src/cborg/cborg/types/lib/json/json.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/jump.d.ts +0 -12
- package/src/cborg/cborg/types/lib/jump.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/length.d.ts +0 -27
- package/src/cborg/cborg/types/lib/length.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/token.d.ts +0 -59
- package/src/cborg/cborg/types/lib/token.d.ts.map +0 -1
- package/src/cborg/cborg/types/taglib.d.ts +0 -18
- package/src/cborg/cborg/types/taglib.d.ts.map +0 -1
- package/src/cborg/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/LICENSE +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/README.md +0 -105
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/index.min.js +0 -3
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts +0 -57
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js +0 -73
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts +0 -355
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js +0 -197
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js +0 -38
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js +0 -30
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +0 -37
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +0 -29
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +0 -153
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +0 -59
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js +0 -25
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +0 -104
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts +0 -3
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +0 -20
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +0 -116
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js +0 -57
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js +0 -30
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/typedoc-urls.json +0 -58
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/package.json +0 -180
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/errors.ts +0 -87
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/index.ts +0 -498
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-cbor.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-json.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/identity.ts +0 -49
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/index.ts +0 -35
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/json.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/raw.ts +0 -49
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.ts +0 -39
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.ts +0 -198
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +0 -76
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.ts +0 -37
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.ts +0 -121
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/extract-data-from-block.ts +0 -24
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.ts +0 -149
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/resolve-object-path.ts +0 -62
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.ts +0 -38
package/merge-package.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as fs from "fs/promises";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
|
|
5
|
+
// import { glob } from "glob";
|
|
6
|
+
import { $, glob } from "zx";
|
|
7
|
+
import { command, flag, run, boolean, string, option, restPositionals } from "cmd-ts";
|
|
8
|
+
|
|
9
|
+
interface CommandArgs {
|
|
10
|
+
readonly verbose: boolean;
|
|
11
|
+
readonly prepare: boolean;
|
|
12
|
+
readonly buildBase: string;
|
|
13
|
+
readonly buildPackageJson: string;
|
|
14
|
+
readonly srcPackageJson: string;
|
|
15
|
+
readonly packagesStr: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function prepare(packages: PackageOptions[], { buildBase }: CommandArgs) {
|
|
19
|
+
await $`rm -rf ${buildBase}`;
|
|
20
|
+
await $`mkdir -p ${buildBase}/patched`;
|
|
21
|
+
await $`cp package.json ${buildBase}/package.json`;
|
|
22
|
+
|
|
23
|
+
await Promise.all(
|
|
24
|
+
packages
|
|
25
|
+
.filter((p): p is GitOptions => p.type === "git")
|
|
26
|
+
.map(async ({ name, url, npm }) => {
|
|
27
|
+
await fs.mkdir(`${buildBase}/patched/${name}`, { recursive: true });
|
|
28
|
+
await $`git clone ${url} ${buildBase}/patched/${name}`;
|
|
29
|
+
await $`cd ${buildBase}/patched/${name} && ${npm} install && ${npm} run build && ${npm} pack`;
|
|
30
|
+
await $`cd ${buildBase} && pnpm install -f patched/${name}/*.tgz`;
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
for (const { name: pkg, type } of packages as NamedOptions[]) {
|
|
34
|
+
if (type === "npm") {
|
|
35
|
+
await $`cd ${buildBase} && pnpm install ${pkg}`;
|
|
36
|
+
}
|
|
37
|
+
await $`cd ${buildBase} && rm -rf src/${pkg}`;
|
|
38
|
+
await $`cd ${buildBase} && mkdir -p src/${pkg}`;
|
|
39
|
+
await $`cd ${buildBase} && rsync -vaxH node_modules/${pkg}/ src/${pkg}/`;
|
|
40
|
+
}
|
|
41
|
+
const files = (
|
|
42
|
+
await Promise.all(
|
|
43
|
+
packages
|
|
44
|
+
.map(({ name }) => name)
|
|
45
|
+
.map((p) => `${buildBase}/src/${p}/**/*.[jt]s`)
|
|
46
|
+
.map((f) => glob(f)),
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
.flat()
|
|
50
|
+
.filter((f) => !f.endsWith(".d.ts"));
|
|
51
|
+
await $`jscodeshift --parser=ts -t=./to-esm-transform.ts ${files}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function patchVersion(packageJson: Record<string, unknown>) {
|
|
55
|
+
let version = "refs/tags/v0.0.0-smoke";
|
|
56
|
+
if (process.env.GITHUB_REF && process.env.GITHUB_REF.startsWith("refs/tags/v")) {
|
|
57
|
+
version = process.env.GITHUB_REF;
|
|
58
|
+
}
|
|
59
|
+
version = version.split("/").slice(-1)[0].replace(/^v/, "");
|
|
60
|
+
console.log(`Patch version ${version} in package.json`);
|
|
61
|
+
packageJson.version = version;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type Exports = Record<string, Record<string, string>>;
|
|
65
|
+
interface PackageJson {
|
|
66
|
+
name: string;
|
|
67
|
+
dependencies: Record<string, string>;
|
|
68
|
+
exports: Exports;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function pluginExports(name: string, exports: Exports, srcDir: string, buildBase: string): Exports {
|
|
72
|
+
const result: Exports = {};
|
|
73
|
+
// const base = path.relative(buildBase, srcDir)
|
|
74
|
+
const nested = {};
|
|
75
|
+
result[`./${name}`] = nested;
|
|
76
|
+
console.log(">>>>>=", name, srcDir);
|
|
77
|
+
// !exports && console.log(">>>>>=", name, srcDir)
|
|
78
|
+
for (const [key, value] of Object.entries(exports || {})) {
|
|
79
|
+
// const pluggedKey = `./${path.join(name, key)}`;
|
|
80
|
+
|
|
81
|
+
if (typeof value === "string") {
|
|
82
|
+
nested[key] = `./${path.join(path.relative(buildBase, srcDir), value)}`;
|
|
83
|
+
} else {
|
|
84
|
+
nested[key] = Object.entries(value).reduce(
|
|
85
|
+
(acc, [k, v]) => {
|
|
86
|
+
acc[k] = `./${path.join(path.relative(buildBase, srcDir), v)}`;
|
|
87
|
+
return acc;
|
|
88
|
+
},
|
|
89
|
+
{} as Record<string, string>,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function mergePackageJson(dest: PackageJson, src: PackageJson, srcDir: string, { buildBase }: CommandArgs) {
|
|
97
|
+
dest.dependencies = { ...dest.dependencies, ...src.dependencies };
|
|
98
|
+
dest.exports = {
|
|
99
|
+
...dest.exports,
|
|
100
|
+
...pluginExports(src.name, src.exports, srcDir, buildBase),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface PackageOptions {
|
|
105
|
+
readonly type: "npm" | "git";
|
|
106
|
+
readonly name: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface NamedOptions extends PackageOptions {
|
|
110
|
+
readonly type: "npm";
|
|
111
|
+
readonly name: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface GitOptions extends PackageOptions {
|
|
115
|
+
readonly type: "git";
|
|
116
|
+
readonly url: string;
|
|
117
|
+
readonly npm: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function toPackageOptions(packages: string): NamedOptions | GitOptions {
|
|
121
|
+
const [name, url, npm] = packages.split(",");
|
|
122
|
+
if (url) {
|
|
123
|
+
return { type: "git", name, url, npm: npm || "pnpm" };
|
|
124
|
+
}
|
|
125
|
+
return { type: "npm", name };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function main() {
|
|
129
|
+
const cmd = command({
|
|
130
|
+
name: "merge-package",
|
|
131
|
+
description: "merge a package.json to build a vendore package.json",
|
|
132
|
+
version: "1.0.0",
|
|
133
|
+
args: {
|
|
134
|
+
verbose: flag({
|
|
135
|
+
long: "verbose",
|
|
136
|
+
type: boolean,
|
|
137
|
+
}),
|
|
138
|
+
prepare: flag({
|
|
139
|
+
long: "prepare",
|
|
140
|
+
type: boolean,
|
|
141
|
+
}),
|
|
142
|
+
buildBase: option({
|
|
143
|
+
long: "build-base",
|
|
144
|
+
type: string,
|
|
145
|
+
description: "build base directory",
|
|
146
|
+
defaultValue: () => "./dist",
|
|
147
|
+
defaultValueIsSerializable: true,
|
|
148
|
+
}),
|
|
149
|
+
buildPackageJson: option({
|
|
150
|
+
long: "dest-package-json",
|
|
151
|
+
type: string,
|
|
152
|
+
description: "build destination",
|
|
153
|
+
defaultValue: () => "./dist/package.json",
|
|
154
|
+
defaultValueIsSerializable: true,
|
|
155
|
+
}),
|
|
156
|
+
srcPackageJson: option({
|
|
157
|
+
long: "src-package-json",
|
|
158
|
+
type: string,
|
|
159
|
+
description: "source package.json",
|
|
160
|
+
defaultValue: () => "./package.json",
|
|
161
|
+
defaultValueIsSerializable: true,
|
|
162
|
+
}),
|
|
163
|
+
packagesStr: restPositionals({
|
|
164
|
+
description:
|
|
165
|
+
"packages to merge, without anything it's pulled from npm, if package,url,npm its pulled from git and installed with npm",
|
|
166
|
+
}),
|
|
167
|
+
},
|
|
168
|
+
handler: async (args) => {
|
|
169
|
+
$.verbose = args.verbose;
|
|
170
|
+
const packages = args.packagesStr.map(toPackageOptions);
|
|
171
|
+
if (args.prepare) {
|
|
172
|
+
await prepare(packages, args);
|
|
173
|
+
}
|
|
174
|
+
await fs.mkdir(path.dirname(args.buildPackageJson), { recursive: true });
|
|
175
|
+
const packageJson = JSON.parse(await fs.readFile(args.srcPackageJson, "utf8"));
|
|
176
|
+
patchVersion(packageJson);
|
|
177
|
+
// await $`pwd ; find "dist/src/@ipld/dag-json" -type f -print`
|
|
178
|
+
for (const packageFile of packages.map((p) => `dist/src/${p.name}/package.json`)) {
|
|
179
|
+
const mPackageJson = JSON.parse(await fs.readFile(packageFile, "utf8"));
|
|
180
|
+
await fs.unlink(packageFile);
|
|
181
|
+
mergePackageJson(packageJson, mPackageJson, path.dirname(packageFile), args);
|
|
182
|
+
}
|
|
183
|
+
// filter our own packages
|
|
184
|
+
packageJson.dependencies = Object.entries(packageJson.dependencies).reduce(
|
|
185
|
+
(acc, [k]) => {
|
|
186
|
+
if (!packages.find((p) => p.name === k)) {
|
|
187
|
+
acc[k] = packageJson.dependencies[k];
|
|
188
|
+
}
|
|
189
|
+
return acc;
|
|
190
|
+
},
|
|
191
|
+
{} as Record<string, string>,
|
|
192
|
+
);
|
|
193
|
+
await fs.writeFile(args.buildPackageJson, JSON.stringify(packageJson, null, 2));
|
|
194
|
+
const projectRoot = path.resolve(dirname(args.srcPackageJson));
|
|
195
|
+
const gitignoreSrc = path.resolve(projectRoot, ".gitignore");
|
|
196
|
+
await $`cp ${gitignoreSrc} ${path.join(args.buildBase, ".npmignore")}`;
|
|
197
|
+
// await $`cp ../.gitignore ${args.buildBase}/.npmignore`;
|
|
198
|
+
await $`cd ${args.buildBase} && pnpm pack`;
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
await run(cmd, process.argv.slice(2));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
main().catch((a) => {
|
|
205
|
+
console.error(a);
|
|
206
|
+
process.exit(1);
|
|
207
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface LimitFunction {
|
|
2
|
+
/**
|
|
3
|
+
The number of promises that are currently running.
|
|
4
|
+
*/
|
|
5
|
+
readonly activeCount: number;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
|
9
|
+
*/
|
|
10
|
+
readonly pendingCount: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Get or set the concurrency limit.
|
|
14
|
+
*/
|
|
15
|
+
concurrency: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Discard pending promises that are waiting to run.
|
|
19
|
+
|
|
20
|
+
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
|
21
|
+
|
|
22
|
+
Note: This does not cancel promises that are already running.
|
|
23
|
+
*/
|
|
24
|
+
clearQueue: () => void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
@param fn - Promise-returning/async function.
|
|
28
|
+
@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
|
|
29
|
+
@returns The promise returned by calling `fn(...arguments)`.
|
|
30
|
+
*/
|
|
31
|
+
<Arguments extends unknown[], ReturnType>(
|
|
32
|
+
function_: (...arguments_: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
|
33
|
+
...arguments_: Arguments
|
|
34
|
+
): Promise<ReturnType>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
Run multiple promise-returning & async functions with limited concurrency.
|
|
39
|
+
|
|
40
|
+
@param concurrency - Concurrency limit. Minimum: `1`.
|
|
41
|
+
@returns A `limit` function.
|
|
42
|
+
*/
|
|
43
|
+
export default function pLimit(concurrency: number): LimitFunction;
|
|
44
|
+
|
|
45
|
+
export interface Options {
|
|
46
|
+
/**
|
|
47
|
+
Concurrency limit.
|
|
48
|
+
|
|
49
|
+
Minimum: `1`.
|
|
50
|
+
*/
|
|
51
|
+
readonly concurrency: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
Returns a function with limited concurrency.
|
|
56
|
+
|
|
57
|
+
The returned function manages its own concurrent executions, allowing you to call it multiple times without exceeding the specified concurrency limit.
|
|
58
|
+
|
|
59
|
+
Ideal for scenarios where you need to control the number of simultaneous executions of a single function, rather than managing concurrency across multiple functions.
|
|
60
|
+
|
|
61
|
+
@param function_ - Promise-returning/async function.
|
|
62
|
+
@return Function with limited concurrency.
|
|
63
|
+
|
|
64
|
+
@example
|
|
65
|
+
```
|
|
66
|
+
import {limitFunction} from 'p-limit';
|
|
67
|
+
|
|
68
|
+
const limitedFunction = limitFunction(async () => {
|
|
69
|
+
return doSomething();
|
|
70
|
+
}, {concurrency: 1});
|
|
71
|
+
|
|
72
|
+
const input = Array.from({length: 10}, limitedFunction);
|
|
73
|
+
|
|
74
|
+
// Only one promise is run at once.
|
|
75
|
+
await Promise.all(input);
|
|
76
|
+
```
|
|
77
|
+
*/
|
|
78
|
+
export function limitFunction<Arguments extends unknown[], ReturnType>(
|
|
79
|
+
function_: (...arguments_: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
|
80
|
+
option: Options,
|
|
81
|
+
): (...arguments_: Arguments) => Promise<ReturnType>;
|
package/p-limit/index.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import Queue from "yocto-queue";
|
|
2
|
+
|
|
3
|
+
export default function pLimit(concurrency) {
|
|
4
|
+
validateConcurrency(concurrency);
|
|
5
|
+
|
|
6
|
+
const queue = new Queue();
|
|
7
|
+
let activeCount = 0;
|
|
8
|
+
|
|
9
|
+
const resumeNext = () => {
|
|
10
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
11
|
+
queue.dequeue()();
|
|
12
|
+
// Since `pendingCount` has been decreased by one, increase `activeCount` by one.
|
|
13
|
+
activeCount++;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const next = () => {
|
|
18
|
+
activeCount--;
|
|
19
|
+
|
|
20
|
+
resumeNext();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const run = async (function_, resolve, arguments_) => {
|
|
24
|
+
const result = (async () => function_(...arguments_))();
|
|
25
|
+
|
|
26
|
+
resolve(result);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
await result;
|
|
30
|
+
} catch {
|
|
31
|
+
/* */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
next();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const enqueue = (function_, resolve, arguments_) => {
|
|
38
|
+
// Queue `internalResolve` instead of the `run` function
|
|
39
|
+
// to preserve asynchronous context.
|
|
40
|
+
new Promise((internalResolve) => {
|
|
41
|
+
queue.enqueue(internalResolve);
|
|
42
|
+
}).then(run.bind(undefined, function_, resolve, arguments_));
|
|
43
|
+
|
|
44
|
+
(async () => {
|
|
45
|
+
// This function needs to wait until the next microtask before comparing
|
|
46
|
+
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
47
|
+
// after the `internalResolve` function is dequeued and called. The comparison in the if-statement
|
|
48
|
+
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
49
|
+
await Promise.resolve();
|
|
50
|
+
|
|
51
|
+
if (activeCount < concurrency) {
|
|
52
|
+
resumeNext();
|
|
53
|
+
}
|
|
54
|
+
})();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const generator = (function_, ...arguments_) =>
|
|
58
|
+
new Promise((resolve) => {
|
|
59
|
+
enqueue(function_, resolve, arguments_);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
Object.defineProperties(generator, {
|
|
63
|
+
activeCount: {
|
|
64
|
+
get: () => activeCount,
|
|
65
|
+
},
|
|
66
|
+
pendingCount: {
|
|
67
|
+
get: () => queue.size,
|
|
68
|
+
},
|
|
69
|
+
clearQueue: {
|
|
70
|
+
value() {
|
|
71
|
+
queue.clear();
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
concurrency: {
|
|
75
|
+
get: () => concurrency,
|
|
76
|
+
|
|
77
|
+
set(newConcurrency) {
|
|
78
|
+
validateConcurrency(newConcurrency);
|
|
79
|
+
concurrency = newConcurrency;
|
|
80
|
+
|
|
81
|
+
queueMicrotask(() => {
|
|
82
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
83
|
+
resumeNext();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return generator;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function limitFunction(function_, option) {
|
|
94
|
+
const { concurrency } = option;
|
|
95
|
+
const limit = pLimit(concurrency);
|
|
96
|
+
|
|
97
|
+
return (...arguments_) => limit(() => function_(...arguments_));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function validateConcurrency(concurrency) {
|
|
101
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
102
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { expectType } from "tsd";
|
|
2
|
+
import pLimit from "./index.js";
|
|
3
|
+
|
|
4
|
+
const limit = pLimit(1);
|
|
5
|
+
|
|
6
|
+
const input = [limit(async () => "foo"), limit(async () => "bar"), limit(async () => undefined)];
|
|
7
|
+
|
|
8
|
+
expectType<Promise<(string | undefined)[]>>(Promise.all(input));
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
expectType<Promise<string>>(limit((a: string) => "", "test"));
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
expectType<Promise<string>>(limit(async (a: string, b: number) => "", "test", 1));
|
|
14
|
+
|
|
15
|
+
expectType<number>(limit.activeCount);
|
|
16
|
+
expectType<number>(limit.pendingCount);
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
19
|
+
expectType<void>(limit.clearQueue());
|
package/p-limit/license
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "p-limit",
|
|
3
|
+
"version": "6.2.0",
|
|
4
|
+
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/p-limit",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "echo vendor need this",
|
|
24
|
+
"test": "xo && ava && tsd"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"promise",
|
|
32
|
+
"limit",
|
|
33
|
+
"limited",
|
|
34
|
+
"concurrency",
|
|
35
|
+
"throttle",
|
|
36
|
+
"throat",
|
|
37
|
+
"rate",
|
|
38
|
+
"batch",
|
|
39
|
+
"ratelimit",
|
|
40
|
+
"task",
|
|
41
|
+
"queue",
|
|
42
|
+
"async",
|
|
43
|
+
"await",
|
|
44
|
+
"promises",
|
|
45
|
+
"bluebird"
|
|
46
|
+
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"yocto-queue": "^1.2.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"ava": "^6.1.3",
|
|
52
|
+
"delay": "^6.0.0",
|
|
53
|
+
"in-range": "^3.0.0",
|
|
54
|
+
"random-int": "^3.0.0",
|
|
55
|
+
"time-span": "^5.1.0",
|
|
56
|
+
"tsd": "^0.31.1",
|
|
57
|
+
"xo": "^0.58.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# p-limit
|
|
2
|
+
|
|
3
|
+
> Run multiple promise-returning & async functions with limited concurrency
|
|
4
|
+
|
|
5
|
+
_Works in Node.js and browsers._
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install p-limit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import pLimit from "p-limit";
|
|
17
|
+
|
|
18
|
+
const limit = pLimit(1);
|
|
19
|
+
|
|
20
|
+
const input = [limit(() => fetchSomething("foo")), limit(() => fetchSomething("bar")), limit(() => doSomething())];
|
|
21
|
+
|
|
22
|
+
// Only one promise is run at once
|
|
23
|
+
const result = await Promise.all(input);
|
|
24
|
+
console.log(result);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### pLimit(concurrency) <sup>default export</sup>
|
|
30
|
+
|
|
31
|
+
Returns a `limit` function.
|
|
32
|
+
|
|
33
|
+
#### concurrency
|
|
34
|
+
|
|
35
|
+
Type: `number`\
|
|
36
|
+
Minimum: `1`
|
|
37
|
+
|
|
38
|
+
Concurrency limit.
|
|
39
|
+
|
|
40
|
+
### limit(fn, ...args)
|
|
41
|
+
|
|
42
|
+
Returns the promise returned by calling `fn(...args)`.
|
|
43
|
+
|
|
44
|
+
#### fn
|
|
45
|
+
|
|
46
|
+
Type: `Function`
|
|
47
|
+
|
|
48
|
+
Promise-returning/async function.
|
|
49
|
+
|
|
50
|
+
#### args
|
|
51
|
+
|
|
52
|
+
Any arguments to pass through to `fn`.
|
|
53
|
+
|
|
54
|
+
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a _lot_ of functions.
|
|
55
|
+
|
|
56
|
+
### limit.activeCount
|
|
57
|
+
|
|
58
|
+
The number of promises that are currently running.
|
|
59
|
+
|
|
60
|
+
### limit.pendingCount
|
|
61
|
+
|
|
62
|
+
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
|
63
|
+
|
|
64
|
+
### limit.clearQueue()
|
|
65
|
+
|
|
66
|
+
Discard pending promises that are waiting to run.
|
|
67
|
+
|
|
68
|
+
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
|
69
|
+
|
|
70
|
+
Note: This does not cancel promises that are already running.
|
|
71
|
+
|
|
72
|
+
### limit.concurrency
|
|
73
|
+
|
|
74
|
+
Get or set the concurrency limit.
|
|
75
|
+
|
|
76
|
+
### limitFunction(fn, options) <sup>named export</sup>
|
|
77
|
+
|
|
78
|
+
Returns a function with limited concurrency.
|
|
79
|
+
|
|
80
|
+
The returned function manages its own concurrent executions, allowing you to call it multiple times without exceeding the specified concurrency limit.
|
|
81
|
+
|
|
82
|
+
Ideal for scenarios where you need to control the number of simultaneous executions of a single function, rather than managing concurrency across multiple functions.
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
import { limitFunction } from "p-limit";
|
|
86
|
+
|
|
87
|
+
const limitedFunction = limitFunction(
|
|
88
|
+
async () => {
|
|
89
|
+
return doSomething();
|
|
90
|
+
},
|
|
91
|
+
{ concurrency: 1 },
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const input = Array.from({ length: 10 }, limitedFunction);
|
|
95
|
+
|
|
96
|
+
// Only one promise is run at once.
|
|
97
|
+
await Promise.all(input);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### fn
|
|
101
|
+
|
|
102
|
+
Type: `Function`
|
|
103
|
+
|
|
104
|
+
Promise-returning/async function.
|
|
105
|
+
|
|
106
|
+
#### options
|
|
107
|
+
|
|
108
|
+
Type: `object`
|
|
109
|
+
|
|
110
|
+
#### concurrency
|
|
111
|
+
|
|
112
|
+
Type: `number`\
|
|
113
|
+
Minimum: `1`
|
|
114
|
+
|
|
115
|
+
Concurrency limit.
|
|
116
|
+
|
|
117
|
+
## FAQ
|
|
118
|
+
|
|
119
|
+
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
|
|
120
|
+
|
|
121
|
+
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
|
|
122
|
+
|
|
123
|
+
## Related
|
|
124
|
+
|
|
125
|
+
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
|
|
126
|
+
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
|
|
127
|
+
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
|
128
|
+
- [More…](https://github.com/sindresorhus/promise-fun)
|