-
Notifications
You must be signed in to change notification settings - Fork 52
/
package.json
218 lines (218 loc) · 11 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
{
"name": "@bitauth/libauth",
"version": "3.0.0",
"description": "ultra-lightweight library for Bitcoin Cash, Bitcoin, and Bitauth",
"type": "module",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/bitauth/libauth.git"
},
"homepage": "https://libauth.org/",
"license": "MIT",
"keywords": [
"authentication",
"bitauth",
"Bitcoin Cash",
"Bitcoin",
"cryptocurrency",
"wasm",
"crypto",
"sha256",
"ripemd160",
"secp256k1",
"sha1",
"sha512",
"HMAC",
"wallet",
"blockchain",
"typescript",
"webassembly",
"BCH",
"BTC"
],
"scripts": {
"changeset": "changeset",
"compile:secp256k1": "docker build -f wasm/docker/secp256k1.Dockerfile . -t libauth-secp256k1 && docker run -it --mount type=bind,src=$(pwd)/src/lib,dst=/libauth/out,consistency=delegated libauth-secp256k1",
"compile:hashes": "docker build -f wasm/docker/hashes.Dockerfile . -t libauth-hashes && docker run -it --mount type=bind,src=$(pwd)/src/lib,dst=/libauth/out,consistency=delegated libauth-hashes",
"build": "yarn build:wasm && yarn build:tsc",
"build:tsc": "tsc -p tsconfig.json",
"build:wasm": "cpy --flat src/lib/bin/secp256k1/secp256k1.wasm build/lib/bin/secp256k1 && cpy --flat src/lib/bin/sha1/sha1.wasm build/lib/bin/sha1 && cpy --flat src/lib/bin/sha256/sha256.wasm build/lib/bin/sha256 && cpy --flat src/lib/bin/sha512/sha512.wasm build/lib/bin/sha512 && cpy --flat src/lib/bin/ripemd160/ripemd160.wasm build/lib/bin/ripemd160",
"compile:debug:secp256k1": "docker run -it libauth-secp256k1 bash",
"compile:debug:hashes": "docker run -it libauth-hashes bash",
"fix": "yarn fix:eslint && yarn fix:prettier",
"fix:prettier": "prettier . --write",
"fix:eslint": "yarn test:eslint --fix",
"gen:vmb-tests": "yarn build && yarn gen:vmb-tests:bch && yarn gen:vmb-tests-prettier",
"gen:vmb-tests-prettier": "prettier 'src/lib/vmb-tests/generated/**/*.json' --write",
"gen:vmb-tests:bch": "node 'build/lib/vmb-tests/bch-vmb-tests.spec.helper.js' 'src/lib/vmb-tests/generated/bch' && yarn run gen:vmb-tests:bch:reasons",
"gen:vmb-tests:bch:reasons": "node 'build/lib/vmb-tests/bch-vmb-tests-invalid.spec.helper.js'",
"wallet": "node 'build/lib/vmb-tests/bch-vmb-tests.live.spec.helper.js'",
"gen:schema": "yarn gen:schema:wallet-template && yarn gen:schema:bcmr",
"gen:schema:wallet-template": "ts-json-schema-generator --no-ref-encode --path 'src/lib/engine/types/template-types.ts' --type 'WalletTemplate' > src/lib/schema/wallet-template.schema.json && prettier 'src/lib/schema/wallet-template.schema.json' --write && ajv compile -s src/lib/schema/wallet-template.schema.json --allowUnionTypes -o src/lib/schema/ajv/validate-wallet-template.js && prettier 'src/lib/schema/ajv/validate-wallet-template.js' --write && node -e \"const fs = require('fs'), path = 'src/lib/schema/ajv/validate-wallet-template.js'; fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/'use strict'[\\s\\S]*module.exports.default =/, 'export default'), 'utf8')\"",
"gen:schema:bcmr": "ts-json-schema-generator --no-ref-encode --path 'src/lib/engine/types/bcmr-types.ts' --type 'MetadataRegistry' > src/lib/schema/bcmr.schema.json && prettier 'src/lib/schema/bcmr.schema.json' --write && ajv compile -s src/lib/schema/bcmr.schema.json --allowUnionTypes -o src/lib/schema/ajv/validate-bcmr.js && prettier 'src/lib/schema/ajv/validate-bcmr.js' --write && node -e \"const fs = require('fs'), path = 'src/lib/schema/ajv/validate-bcmr.js'; fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/'use strict'[\\s\\S]*module.exports.default =/, 'export default'), 'utf8')\"",
"gen:schema-TODO": "//TODO: use ajv compile --code-esm option after merge: https://github.com/ajv-validator/ajv-cli/pull/200",
"gen:templates": "yarn build && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'p2pkh' > src/lib/transaction/fixtures/templates/p2pkh.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' '2-of-3' > src/lib/transaction/fixtures/templates/2-of-3.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' '2-of-2-recoverable' > src/lib/transaction/fixtures/templates/2-of-2-recoverable.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'sig-of-sig' > src/lib/transaction/fixtures/templates/sig-of-sig.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'cash-channels-v1' > src/lib/transaction/fixtures/templates/cash-channels-v1.json && prettier 'src/lib/transaction/fixtures/templates/*.json' --write",
"gen:graph": "mkdir -p temp && madge --image temp/deps-$(date +\"%FT%H%M\").svg build/index.js",
"test": "yarn build && yarn test:policies && yarn test:unit",
"test:policies": "yarn test:deps && yarn test:schemas && yarn test:lint && yarn test:cycles",
"test:deps": "node -e \"import('./package.json', { assert: { type: 'json' } }).then(p => typeof p.dependencies === 'undefined' ? console.log('No dependencies found.') : (console.error('Dependencies are not allowed.') && process.exit(1)));\"",
"test:schemas:unchanged": "yarn gen:schema && node -e \"child_process.exec('git status src/lib/schema --porcelain | head -c1 | wc -c', (err, stdout) => stdout.trim() === '0' ? process.exit(0) : process.exit(1) )\"",
"test:schemas": "yarn test:schemas:unchanged && echo \"Schemas are up to date.\" || echo \"Error: one or more schemas are outdated. Please review and commit the changes in src/lib/schema.\"",
"test:lint": "yarn test:prettier && yarn test:eslint && yarn test:spelling",
"test:eslint": "eslint . -c .eslintrc",
"test:prettier": "prettier . --list-different",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
"test:cycles": "madge --circular build/index.js",
"test:unit": "c8 ava",
"test:fast": "echo '\n\nUsage:\n yarn test:fast src/lib/key/bip39.spec.ts # run a single test file \n yarn test:fast --match=\"!*crypto*\" --match=\"!*vmb_tests*\" # include/exclude tests with names matching pattern(s) \n\n' && ava -v",
"test:unit:script_tests": "c8 ava --match='*[script_tests]*' --serial",
"test:unit:vmb_tests": "c8 ava src/lib/vmb-tests/bch-vmb-tests.spec.ts --serial",
"test:unit:vmb_test": "node 'build/lib/vmb-tests/bch-vmb-test.spec.helper.js'",
"dev:vmb_tests": "yarn gen:vmb-tests && yarn build:tsc && ava src/lib/vmb-tests/bch-vmb-tests.spec.ts --serial --fail-fast",
"bench": "yarn build && yarn bench:browser-deps && yarn bench:test",
"bench:test": "ava --config .ava.bench.config.js --serial --timeout=2m 2>&1 | tee bench.log",
"bench:browser-deps": "cpy '.yarn/artifacts/*.js' build/bench",
"watch": "yarn build -w",
"watch:test": "echo '\n\nUsage:\n yarn watch:test src/lib/key/bip39.spec.ts # watch a single test file \n yarn watch:test --match=\"!*crypto*\" --match=\"!*vmb_tests*\" # include/exclude tests with names matching pattern(s) \n\n' && ava -v --watch",
"cov": "yarn build && yarn test:unit && yarn cov:html && yarn cov:lcov && open-cli coverage/index.html",
"cov:html": "c8 report --reporter=html",
"cov:lcov": "c8 report --reporter=lcov",
"doc": "yarn doc:html && yarn doc:html && open-cli build/docs/index.html",
"doc:assets": "cp assets/libauth.svg build/docs/assets/libauth.svg && mkdir build/docs/schemas && cp assets/schemas/wallet-template-v0.schema.json build/docs/schemas/wallet-template-v0.schema.json",
"doc:html": "typedoc src/index.ts --out build/docs",
"doc:next": "yarn build && yarn doc:extract && yarn doc:generate",
"doc:extract": "mkdir -p build/api && api-extractor run --local --typescript-compiler-folder node_modules/typescript",
"doc:generate": "api-documenter markdown -i temp -o build/api/markdown",
"doc:check-api": "api-extractor run --typescript-compiler-folder node_modules/typescript",
"changeset:version": "yarn changeset version && yarn fix:prettier",
"release": "yarn build && yarn changeset publish"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@fast-check/ava": "^1.2.1",
"@microsoft/api-documenter": "^7.23.16",
"@microsoft/api-extractor": "^7.39.1",
"@playwright/test": "^1.41.2",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/elliptic": "^6.4.18",
"@types/express": "^4.17.21",
"@types/node": "^20.11.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"ajv-cli": "^5.0.0",
"asmcrypto.js": "^2.3.2",
"ava": "^6.0.1",
"bip39": "^3.1.0",
"bitcore-lib-cash": "^10.0.23",
"c8": "^9.0.0",
"chuhai": "^1.2.0",
"cpy-cli": "^5.0.0",
"cspell": "^8.3.2",
"cz-conventional-changelog": "^3.3.0",
"elliptic": "^6.5.4",
"eslint": "8.56.0",
"eslint-config-bitauth": "5.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^6.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-tsdoc": "^0.2.17",
"express": "^4.18.2",
"fast-check": "^3.15.0",
"hash.js": "^1.1.7",
"madge": "^6.1.0",
"open-cli": "^8.0.0",
"prettier": "^3.1.1",
"rollup": "^4.9.4",
"secp256k1": "^5.0.0",
"source-map-support": "^0.5.21",
"ts-json-schema-generator": "^1.5.0",
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
},
"publishConfig": {
"provenance": true
},
"files": [
"build",
"!build/.tsbuildinfo",
"!build/**/*.map",
"!**/*.spec.*",
"!**/*.json",
"CHANGELOG.md",
"LICENSE",
"README.md",
"SECURITY.md"
],
"ava": {
"timeout": "60s",
"typescript": {
"compile": false,
"rewritePaths": {
"src/": "build/"
}
},
"nodeArguments": [
"--experimental-json-modules",
"--experimental-global-webcrypto",
"# ^ needed for node v18"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"prettier": {
"singleQuote": true,
"overrides": [
{
"files": [
"src/lib/vmb-tests/*bch-vmb-tests*.ts"
],
"options": {
"printWidth": 400
}
},
{
"files": [
"src/lib/vmb-tests/*bch-vmb-tests*.spec.*ts"
],
"options": {
"printWidth": 80
}
},
{
"files": [
"src/lib/vmb-tests/generated/**/*.json"
],
"options": {
"printWidth": 10000
}
}
]
},
"c8": {
"exclude": [
"**/*.bench.js",
"**/*.spec.js",
"**/*.spec.helper.js",
".pnp.*",
"**/ajv/validate-*.js"
]
},
"sideEffects": false,
"packageManager": "yarn@4.0.2",
"resolutions": {
"eslint-config-bitauth": "portal:./config/eslint-config-bitauth"
}
}