|
52 | 52 | "gen:schema:authentication-template": "ts-json-schema-generator --no-ref-encode --path 'src/lib/compiler/template-types.ts' --type 'AuthenticationTemplate' > src/lib/schema/authentication-template.schema.json && prettier 'src/lib/schema/authentication-template.schema.json' --write && ajv compile -s src/lib/schema/authentication-template.schema.json --allowUnionTypes -o src/lib/schema/ajv/validate-authentication-template.js && prettier 'src/lib/schema/ajv/validate-authentication-template.js' --write && node -e \"const fs = require('fs'), path = 'src/lib/schema/ajv/validate-authentication-template.js'; fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/'use strict'[\\s\\S]*module.exports.default =/, 'export default'), 'utf8')\"",
|
53 | 53 | "gen:schema-TODO": "//TODO: use ajv compile --code-esm option after merge: https://github.com/ajv-validator/ajv-cli/pull/200",
|
54 | 54 | "gen:templates": "run-s 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' > src/lib/transaction/fixtures/templates/cash-channels.json && prettier 'src/lib/transaction/fixtures/templates/*.json' --write",
|
| 55 | + "gen:graph": "mkdir -p scratch && madge --image scratch/deps-$(date +\"%FT%H%M\").svg build/index.js", |
55 | 56 | "test": "run-s build test:*",
|
| 57 | + "test-node18": "NODE_OPTIONS=--openssl-legacy-provider run-s build test:*", |
56 | 58 | "test:deps": "node -e \"if(Object.keys(require('./package.json').dependencies).length > 0) { console.error('Dependencies are not allowed.'); process.exit(1); }\"",
|
57 | 59 | "test:schemas": "run-s gen:schema && if [ `git status src/lib/schema --porcelain | head -c1 | wc -c` -gt 0 ]; then echo \"Error: one or more schemas are outdated. Please review and commit the changes in src/lib/schema.\" && false; fi && echo \"Schemas are up to date.\"",
|
58 | 60 | "test:lint": "eslint . --ext .ts",
|
59 | 61 | "test:prettier": "prettier \"src/**/*.ts\" --list-different",
|
60 | 62 | "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
|
61 | 63 | "test:cycles": "madge --circular build/index.js",
|
62 |
| - "test:unit": "NODE_OPTIONS=--openssl-legacy-provider nyc --silent ava", |
63 |
| - "test:unit:fast": "nyc --silent ava --match='!*[fast-check]*' --match='!*[crypto]*' --match='!*[script_tests]*' --match='!*[signing-serialization tests]*' --match='!*[BCH compiler]*' --match='!*[BCH VM]*'", |
64 |
| - "test:unit:fast-check": "nyc --silent ava --match='*[fast-check]*", |
65 |
| - "test:unit:script_tests": "nyc --silent ava --match='*[script_tests]*' --serial", |
66 |
| - "test:unit:vmb_tests": "nyc --silent ava src/lib/vmb-tests/bch-vmb-tests.spec.ts --serial", |
| 64 | + "test:unit": "c8 ava", |
| 65 | + "test:unit:script_tests": "c8 ava --match='*[script_tests]*' --serial", |
| 66 | + "test:unit:vmb_tests": "c8 ava src/lib/vmb-tests/bch-vmb-tests.spec.ts --serial", |
67 | 67 | "test:unit:vmb_test": "node 'build/lib/vmb-tests/bch-vmb-test.spec.helper.js'",
|
68 | 68 | "bench": "run-s build bench:browser-deps bench:test",
|
69 |
| - "bench:test": "NODE_OPTIONS=--openssl-legacy-provider ava --config .ava.bench.config.js --serial --timeout=2m", |
| 69 | + "bench:test": "ava --config .ava.bench.config.js --serial --timeout=2m 2>&1 | tee bench.log", |
70 | 70 | "bench:browser-deps": "browserify node_modules/chuhai/index.js --standalone chuhai -o build/bench/chuhai.js && browserify node_modules/hash.js/lib/hash.js --standalone hash -o build/bench/hash.js",
|
71 | 71 | "watch": "run-s build:tsc build:wasm && yarn build:tsc -- -w",
|
72 | 72 | "watch:single": "echo 'Usage: yarn watch:single --match=\"*pattern*\"' && ava -v --watch",
|
73 | 73 | "watch:test": "yarn test:unit:fast -- --watch -v",
|
74 | 74 | "watch:test-slow": "yarn test:unit -- --watch -v",
|
75 | 75 | "cov": "run-s build test:unit cov:html cov:lcov && open-cli coverage/index.html",
|
76 |
| - "cov:html": "nyc report --reporter=html", |
77 |
| - "cov:lcov": "nyc report --reporter=lcov", |
| 76 | + "cov:html": "c8 report --reporter=html", |
| 77 | + "cov:lcov": "c8 report --reporter=lcov", |
78 | 78 | "cov:send": "run-s cov:lcov && codecov",
|
79 |
| - "cov:check": "nyc report && nyc check-coverage --lines 85 --functions 80 --branches 65", |
| 79 | + "cov:check": "c8 report && c8 check-coverage --lines 90 --functions 90 --branches 90", |
80 | 80 | "doc": "run-s doc:html && open-cli build/docs/index.html",
|
81 | 81 | "doc:logo": "cpy assets/libauth.svg build/docs",
|
82 | 82 | "doc:cname": "node -e \"console.log('libauth.org')\" > build/docs/CNAME",
|
|
88 | 88 | "doc:check-api": "api-extractor run --typescript-compiler-folder node_modules/typescript",
|
89 | 89 | "doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
|
90 | 90 | "version": "standard-version",
|
| 91 | + "version:alpha": "standard-version --prerelease alpha", |
91 | 92 | "reset": "git clean -dfx && git reset --hard && yarn",
|
92 |
| - "prepare-release": "run-s reset test cov:check doc:html doc:logo doc:cname version doc:publish" |
| 93 | + "prepare-release": "run-s reset test cov:check doc:html doc:logo doc:cname version doc:publish", |
| 94 | + "prepare-release:alpha": "run-s reset test cov:check version:alpha" |
93 | 95 | },
|
94 | 96 | "engines": {
|
95 | 97 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
96 | 98 | },
|
97 | 99 | "dependencies": {},
|
98 | 100 | "devDependencies": {
|
99 | 101 | "@ava/typescript": "^3.0.1",
|
100 |
| - "@bitjson/npm-scripts-info": "^1.0.0", |
101 |
| - "@istanbuljs/nyc-config-typescript": "^1.0.2", |
102 | 102 | "@microsoft/api-documenter": "^7.17.13",
|
103 | 103 | "@microsoft/api-extractor": "^7.23.2",
|
104 | 104 | "@rollup/plugin-alias": "^3.1.9",
|
|
116 | 116 | "ava-fast-check": "^5.0.0",
|
117 | 117 | "bcrypto": "^5.4.0",
|
118 | 118 | "bitcore-lib-cash": "^8.25.28",
|
119 |
| - "browserify": "17.0.0", |
| 119 | + "browserify": "16.5.1", |
| 120 | + "c8": "^7.11.2", |
120 | 121 | "chuhai": "^1.2.0",
|
121 | 122 | "codecov": "^3.8.3",
|
122 | 123 | "cpy-cli": "^4.1.0",
|
123 | 124 | "cspell": "^5.20.0",
|
124 | 125 | "cz-conventional-changelog": "^3.3.0",
|
125 | 126 | "elliptic": "^6.5.4",
|
126 | 127 | "eslint": "8.15.0",
|
| 128 | + "eslint-config-bitauth": "^3.0.0", |
127 | 129 | "eslint-config-prettier": "^8.5.0",
|
128 | 130 | "eslint-plugin-eslint-comments": "^3.2.0",
|
129 | 131 | "eslint-plugin-functional": "^4.2.1",
|
|
136 | 138 | "hash.js": "^1.1.5",
|
137 | 139 | "madge": "^5.0.1",
|
138 | 140 | "npm-run-all": "^4.1.5",
|
139 |
| - "nyc": "^15.1.0", |
140 | 141 | "open-cli": "^7.0.1",
|
141 | 142 | "prettier": "^2.6.2",
|
142 | 143 | "puppeteer": "^14.1.0",
|
143 | 144 | "rollup": "^2.73.0",
|
144 | 145 | "secp256k1": "^4.0.3",
|
145 | 146 | "source-map-support": "^0.5.21",
|
146 | 147 | "standard-version": "^9.3.2",
|
147 |
| - "trash-cli": "^5.0.0", |
148 | 148 | "ts-json-schema-generator": "^1.0.0",
|
149 |
| - "ts-node": "^10.7.0", |
150 | 149 | "typedoc": "^0.22.13",
|
151 | 150 | "typescript": "^4.6.4"
|
152 | 151 | },
|
|
205 | 204 | }
|
206 | 205 | ]
|
207 | 206 | },
|
208 |
| - "nyc": { |
209 |
| - "extends": "@istanbuljs/nyc-config-typescript", |
| 207 | + "c8": { |
210 | 208 | "exclude": [
|
211 | 209 | "**/*.bench.js",
|
212 | 210 | "**/*.spec.js",
|
213 |
| - "**/*.spec.helper.js", |
214 |
| - "**/*.spec.debug.js" |
| 211 | + "**/*.spec.helper.js" |
215 | 212 | ]
|
216 | 213 | },
|
217 | 214 | "sideEffects": false
|
|
0 commit comments