@smartledger/bsv 6.1.2 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +38 -38
- package/SECURITY.md +39 -12
- package/bsv-anchor.min.js +18 -11
- package/bsv-covenant.min.js +2 -48
- package/bsv-didweb.min.js +18 -11
- package/bsv-ecies.min.js +2 -20
- package/bsv-gdaf.min.js +103 -45
- package/bsv-ltp.min.js +103 -45
- package/bsv-message.min.js +3 -10
- package/bsv-mnemonic.min.js +20 -11
- package/bsv-script-helper.min.js +2 -10
- package/bsv-security.min.js +2 -10
- package/bsv-shamir.min.js +20 -11
- package/bsv-smartcontract.min.js +26 -48
- package/bsv-statuslist.min.js +74 -17
- package/bsv-vcjwt.min.js +18 -11
- package/bsv.bundle.js +103 -45
- package/bsv.min.js +103 -45
- package/build/esbuild/empty.js +2 -0
- package/build/esbuild/globals.js +6 -0
- package/build/esbuild.js +129 -0
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/THREAT_MODEL.md +127 -0
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/index.js +3 -2
- package/lib/smart_contract/index.js +1 -1
- package/package.json +5 -23
- package/test/build/bundle_smoke.js +55 -0
- package/test/build/esbuild_main.js +65 -0
- package/test/build/version_sync.js +14 -0
- package/test/security/threat_model_coverage.js +31 -0
- package/version.js +3 -0
- package/build/webpack.anchor.config.js +0 -15
- package/build/webpack.base.js +0 -125
- package/build/webpack.bundle.config.js +0 -15
- package/build/webpack.config.js +0 -17
- package/build/webpack.covenant.config.js +0 -17
- package/build/webpack.didweb.config.js +0 -15
- package/build/webpack.ecies.config.js +0 -15
- package/build/webpack.gdaf.config.js +0 -15
- package/build/webpack.ltp.config.js +0 -15
- package/build/webpack.message.config.js +0 -15
- package/build/webpack.mnemonic.config.js +0 -15
- package/build/webpack.script-helper.config.js +0 -17
- package/build/webpack.security.config.js +0 -15
- package/build/webpack.shamir.config.js +0 -15
- package/build/webpack.smartcontract.config.js +0 -18
- package/build/webpack.statuslist.config.js +0 -15
- package/build/webpack.vcjwt.config.js +0 -15
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global describe, it */
|
|
4
|
+
|
|
5
|
+
// Cutover safety net for the webpack -> esbuild bundle migration: every SHIPPED bundle
|
|
6
|
+
// must load and expose an API. Each bundle is loaded in an ISOLATED child process (they
|
|
7
|
+
// are self-contained bsv builds; loading them all into one process would collide), with a
|
|
8
|
+
// global `bsv` present for the feature bundles that externalise it. Load/shape smoke only —
|
|
9
|
+
// full browser behaviour (window.crypto CSPRNG) is covered by the Chrome browser-smoke.
|
|
10
|
+
|
|
11
|
+
require('chai').should()
|
|
12
|
+
var path = require('path')
|
|
13
|
+
var execFileSync = require('child_process').execFileSync
|
|
14
|
+
|
|
15
|
+
var ROOT = path.resolve(__dirname, '../..')
|
|
16
|
+
|
|
17
|
+
// file -> a key that must be present on the loaded module (null = just needs a non-empty API).
|
|
18
|
+
var BUNDLES = {
|
|
19
|
+
'bsv.min.js': 'PrivateKey',
|
|
20
|
+
'bsv.bundle.js': 'PrivateKey',
|
|
21
|
+
'bsv-ecies.min.js': null,
|
|
22
|
+
'bsv-message.min.js': null,
|
|
23
|
+
'bsv-mnemonic.min.js': null,
|
|
24
|
+
'bsv-shamir.min.js': null,
|
|
25
|
+
'bsv-smartcontract.min.js': 'Covenant',
|
|
26
|
+
'bsv-covenant.min.js': null,
|
|
27
|
+
'bsv-script-helper.min.js': null,
|
|
28
|
+
'bsv-security.min.js': null,
|
|
29
|
+
'bsv-ltp.min.js': null,
|
|
30
|
+
'bsv-gdaf.min.js': null,
|
|
31
|
+
'bsv-didweb.min.js': null,
|
|
32
|
+
'bsv-vcjwt.min.js': null,
|
|
33
|
+
'bsv-statuslist.min.js': null,
|
|
34
|
+
'bsv-anchor.min.js': null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe('bundles: every shipped bundle loads (esbuild cutover)', function () {
|
|
38
|
+
this.timeout(20000)
|
|
39
|
+
|
|
40
|
+
Object.keys(BUNDLES).forEach(function (file) {
|
|
41
|
+
it(file + ' loads via require() and exposes an API', function () {
|
|
42
|
+
var key = BUNDLES[file]
|
|
43
|
+
var script =
|
|
44
|
+
'global.bsv=require(' + JSON.stringify(path.join(ROOT, 'index.js')) + ');' +
|
|
45
|
+
'var m=require(' + JSON.stringify(path.join(ROOT, file)) + ');' +
|
|
46
|
+
'if(m==null)process.exit(2);' +
|
|
47
|
+
'var ok=(typeof m==="function")||(typeof m==="object"&&Object.keys(m).length>0);' +
|
|
48
|
+
'if(!ok)process.exit(3);' +
|
|
49
|
+
(key ? 'if(m[' + JSON.stringify(key) + ']==null)process.exit(4);' : '') +
|
|
50
|
+
'process.exit(0)'
|
|
51
|
+
// execFileSync throws if the child exits non-zero (a broken/unloadable bundle).
|
|
52
|
+
execFileSync(process.execPath, ['-e', script], { stdio: 'pipe' })
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global describe, it */
|
|
4
|
+
|
|
5
|
+
// Build-integrity gate for the esbuild bundler migration. Proves every browser bundle
|
|
6
|
+
// (all 16) builds — esbuild resolves each Node-core polyfill and, for the feature bundles,
|
|
7
|
+
// externalises the bsv root to the global `bsv` — and that the output is a real UMD module
|
|
8
|
+
// (browser global + require()/AMD). Full browser behaviour (Shamir CSPRNG via window.crypto)
|
|
9
|
+
// is validated by the Chrome browser-smoke against the full bundle.
|
|
10
|
+
|
|
11
|
+
require('chai').should()
|
|
12
|
+
var fs = require('fs')
|
|
13
|
+
var os = require('os')
|
|
14
|
+
var path = require('path')
|
|
15
|
+
var E = require('../../build/esbuild')
|
|
16
|
+
|
|
17
|
+
describe('esbuild: all browser bundles build', function () {
|
|
18
|
+
this.timeout(60000)
|
|
19
|
+
|
|
20
|
+
it('all ' + E.BUNDLES.length + ' bundles build with no unresolved modules', function () {
|
|
21
|
+
return Promise.all(E.BUNDLES.map(function (cfg) {
|
|
22
|
+
return E.buildOne(cfg, { write: false, logLevel: 'silent' }).then(function (res) {
|
|
23
|
+
res.errors.length.should.equal(0)
|
|
24
|
+
var js = res.outputFiles[0].text
|
|
25
|
+
js.length.should.be.above(20000) // smallest bundle (message) ~31KB; a broken build is tiny
|
|
26
|
+
js.indexOf('var ' + cfg.global + '=').should.be.above(-1) // IIFE global assignment
|
|
27
|
+
})
|
|
28
|
+
}))
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// UMD contract: the full bundle must load via CommonJS require() (as the webpack UMD bundle
|
|
32
|
+
// did). Browser <script> global is validated by the Chrome browser-smoke.
|
|
33
|
+
it('the full bundle is require()-able (UMD) with a working static API', function () {
|
|
34
|
+
return E.buildFullBundle({ write: false, logLevel: 'silent' }).then(function (res) {
|
|
35
|
+
var tmp = path.join(os.tmpdir(), 'bsv-esbuild-full-' + process.pid + '.js')
|
|
36
|
+
fs.writeFileSync(tmp, res.outputFiles[0].text)
|
|
37
|
+
try {
|
|
38
|
+
var bsv = require(tmp)
|
|
39
|
+
;(typeof bsv.PrivateKey).should.equal('function')
|
|
40
|
+
bsv.version.should.be.a('string')
|
|
41
|
+
bsv.crypto.Hash.sha256(bsv.deps.Buffer.from('x')).length.should.equal(32)
|
|
42
|
+
;(!!bsv.Ordinals && !!bsv.SPV).should.equal(true)
|
|
43
|
+
} finally { delete require.cache[tmp]; fs.unlinkSync(tmp) }
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// A feature bundle that externalises bsv (bsv-covenant) must load against a global `bsv`.
|
|
48
|
+
it('a feature bundle (bsv-covenant) loads against the global bsv', function () {
|
|
49
|
+
var cfg = E.BUNDLES.filter(function (c) { return c.file === 'bsv-covenant.min.js' })[0]
|
|
50
|
+
return E.buildOne(cfg, { write: false, logLevel: 'silent' }).then(function (res) {
|
|
51
|
+
var tmp = path.join(os.tmpdir(), 'bsv-esbuild-cov-' + process.pid + '.js')
|
|
52
|
+
fs.writeFileSync(tmp, res.outputFiles[0].text)
|
|
53
|
+
var had = 'bsv' in global // Node: global === globalThis, which the bundle reads
|
|
54
|
+
global.bsv = require('../..')
|
|
55
|
+
try {
|
|
56
|
+
var cov = require(tmp)
|
|
57
|
+
;(cov == null).should.equal(false)
|
|
58
|
+
Object.keys(cov).length.should.be.above(0)
|
|
59
|
+
} finally {
|
|
60
|
+
delete require.cache[tmp]; fs.unlinkSync(tmp)
|
|
61
|
+
if (!had) delete global.bsv
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global describe, it */
|
|
4
|
+
|
|
5
|
+
// version.js is generated from package.json by the `version` npm hook so the bundles
|
|
6
|
+
// embed only the version string (not the whole package.json). Assert it hasn't drifted.
|
|
7
|
+
|
|
8
|
+
require('chai').should()
|
|
9
|
+
|
|
10
|
+
describe('version.js stays in sync with package.json', function () {
|
|
11
|
+
it('version.js === package.json.version', function () {
|
|
12
|
+
require('../../version').should.equal(require('../../package.json').version)
|
|
13
|
+
})
|
|
14
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global describe, it */
|
|
4
|
+
|
|
5
|
+
// Keeps docs/THREAT_MODEL.md honest: every `test/…js` the threat model cites as the
|
|
6
|
+
// enforcer of a security property must actually exist. If a security test is renamed
|
|
7
|
+
// or deleted, the threat model can no longer silently point at a ghost — this gate goes
|
|
8
|
+
// red. (Same "docs are tested claims" principle as the type-drift gate.)
|
|
9
|
+
|
|
10
|
+
require('chai').should()
|
|
11
|
+
var fs = require('fs')
|
|
12
|
+
var path = require('path')
|
|
13
|
+
|
|
14
|
+
var ROOT = path.resolve(__dirname, '../..')
|
|
15
|
+
var MODEL = path.join(ROOT, 'docs/THREAT_MODEL.md')
|
|
16
|
+
|
|
17
|
+
describe('security: threat model references real tests', function () {
|
|
18
|
+
var text = fs.readFileSync(MODEL, 'utf8')
|
|
19
|
+
// Every referenced test path, e.g. `test/security/fail_closed_contracts.js`.
|
|
20
|
+
var refs = (text.match(/test\/[A-Za-z0-9_./-]+\.js/g) || [])
|
|
21
|
+
var unique = refs.filter(function (r, i) { return refs.indexOf(r) === i })
|
|
22
|
+
|
|
23
|
+
it('cites a meaningful number of enforcing tests', function () {
|
|
24
|
+
unique.length.should.be.above(6)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('every cited test file exists', function () {
|
|
28
|
+
var missing = unique.filter(function (rel) { return !fs.existsSync(path.join(ROOT, rel)) })
|
|
29
|
+
missing.should.deep.equal([], 'THREAT_MODEL.md cites test files that do not exist:\n ' + missing.join('\n '))
|
|
30
|
+
})
|
|
31
|
+
})
|
package/version.js
ADDED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../anchor-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-anchor.min.js',
|
|
10
|
-
library: 'bsvAnchor',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
package/build/webpack.base.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
// Shared webpack 5 helpers. webpack 5 removed the automatic Node-core polyfills
|
|
4
|
-
// that webpack 4 provided, so every bundle must declare them explicitly:
|
|
5
|
-
// - bundlePolyfills(): for bundles that include bsv's own crypto (full bundle,
|
|
6
|
-
// feature bundles, Shamir CSPRNG via secrets.js) -> real browserify shims +
|
|
7
|
-
// Buffer/process globals.
|
|
8
|
-
// - externStubs(): for bundles that externalize bsv and don't need its crypto
|
|
9
|
-
// -> stub the Node-core modules to empty (the webpack 4 `node: {x:'empty'}`).
|
|
10
|
-
//
|
|
11
|
-
// Both also pin TerserPlugin with extractComments:false so no *.LICENSE.txt
|
|
12
|
-
// sidecar files are emitted (webpack 4 did not emit them; keeps the published
|
|
13
|
-
// file list unchanged).
|
|
14
|
-
|
|
15
|
-
const webpack = require('webpack')
|
|
16
|
-
const TerserPlugin = require('terser-webpack-plugin')
|
|
17
|
-
|
|
18
|
-
const FULL_FALLBACK = {
|
|
19
|
-
crypto: require.resolve('crypto-browserify'),
|
|
20
|
-
stream: require.resolve('stream-browserify'),
|
|
21
|
-
buffer: require.resolve('buffer/'),
|
|
22
|
-
process: require.resolve('process/browser'),
|
|
23
|
-
assert: require.resolve('assert/'),
|
|
24
|
-
util: require.resolve('util/'),
|
|
25
|
-
path: require.resolve('path-browserify'),
|
|
26
|
-
zlib: require.resolve('browserify-zlib'),
|
|
27
|
-
vm: require.resolve('vm-browserify'),
|
|
28
|
-
http: false,
|
|
29
|
-
https: false,
|
|
30
|
-
os: false,
|
|
31
|
-
url: false,
|
|
32
|
-
fs: false,
|
|
33
|
-
net: false,
|
|
34
|
-
tls: false,
|
|
35
|
-
readline: false,
|
|
36
|
-
child_process: false
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const STUB_FALLBACK = {
|
|
40
|
-
crypto: false,
|
|
41
|
-
stream: false,
|
|
42
|
-
buffer: false,
|
|
43
|
-
process: false,
|
|
44
|
-
assert: false,
|
|
45
|
-
util: false,
|
|
46
|
-
path: false,
|
|
47
|
-
zlib: false,
|
|
48
|
-
vm: false,
|
|
49
|
-
http: false,
|
|
50
|
-
https: false,
|
|
51
|
-
os: false,
|
|
52
|
-
url: false,
|
|
53
|
-
fs: false,
|
|
54
|
-
net: false,
|
|
55
|
-
tls: false,
|
|
56
|
-
readline: false,
|
|
57
|
-
child_process: false
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function applyOptimization (config) {
|
|
61
|
-
config.optimization = Object.assign({ minimize: true }, config.optimization, {
|
|
62
|
-
minimizer: [new TerserPlugin({ extractComments: false })]
|
|
63
|
-
})
|
|
64
|
-
// These are library bundles; the browser asset-size hints are noise here.
|
|
65
|
-
config.performance = Object.assign({ hints: false }, config.performance)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function merge (config, fallback, plugins) {
|
|
69
|
-
config.resolve = config.resolve || {}
|
|
70
|
-
// config-provided fallbacks win over the shared defaults.
|
|
71
|
-
config.resolve.fallback = Object.assign({}, fallback, config.resolve.fallback)
|
|
72
|
-
config.plugins = (config.plugins || []).concat(plugins)
|
|
73
|
-
// Hash module/chunk content with webpack's built-in xxhash64 instead of the default
|
|
74
|
-
// md4. md4 goes through Node's OpenSSL, which OpenSSL 3 (Node 17+) disables — the sole
|
|
75
|
-
// reason the build needed `--openssl-legacy-provider` and a pinned Node 18. xxhash64 is
|
|
76
|
-
// pure (no OpenSSL), so `build-all` runs natively on any modern Node with no flag.
|
|
77
|
-
config.output = config.output || {}
|
|
78
|
-
if (!config.output.hashFunction) config.output.hashFunction = 'xxhash64'
|
|
79
|
-
applyOptimization(config)
|
|
80
|
-
return config
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// For bundles that include bsv's crypto (need real Node-core shims).
|
|
84
|
-
function bundlePolyfills (config) {
|
|
85
|
-
// secrets.js-grempe (Shamir) is a UMD whose AMD branch calls its factory
|
|
86
|
-
// WITHOUT the crypto argument. webpack provides `define.amd`, so it takes that
|
|
87
|
-
// branch and secrets.js receives `crypto === undefined` — its CSPRNG init then
|
|
88
|
-
// throws ("Initialization failed") and Shamir is broken in the browser.
|
|
89
|
-
// Disabling AMD for it forces the CommonJS branch — factory(require('crypto'))
|
|
90
|
-
// — so it gets crypto-browserify and initialises correctly.
|
|
91
|
-
config.module = config.module || {}
|
|
92
|
-
config.module.rules = (config.module.rules || []).concat([
|
|
93
|
-
{ test: /secrets\.js-grempe/, parser: { amd: false } }
|
|
94
|
-
])
|
|
95
|
-
// crypto-browserify drags in the whole `elliptic` library via browserify-sign
|
|
96
|
-
// + create-ecdh (for crypto.createSign/createVerify/createECDH) — APIs bsv
|
|
97
|
-
// never calls (its EC crypto is @noble). Stub them so `elliptic` is not bundled
|
|
98
|
-
// (~140KB/bundle). randomBytes/createHash/createHmac (the Shamir CSPRNG and
|
|
99
|
-
// hashing) are unaffected.
|
|
100
|
-
config.resolve = config.resolve || {}
|
|
101
|
-
config.resolve.alias = Object.assign(
|
|
102
|
-
{ 'browserify-sign': false, 'create-ecdh': false },
|
|
103
|
-
config.resolve.alias
|
|
104
|
-
)
|
|
105
|
-
return merge(config, FULL_FALLBACK, [
|
|
106
|
-
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'], process: 'process/browser' })
|
|
107
|
-
])
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// For bundles that externalize/already-embed bsv and don't need its crypto
|
|
111
|
-
// polyfill: stub the heavy Node-core modules to empty (the webpack 4
|
|
112
|
-
// `node: {x:'empty'}`), but still provide the Buffer and process globals —
|
|
113
|
-
// webpack 4 provided both by default and the embedded bsv code relies on them
|
|
114
|
-
// (e.g. process.browser, Buffer).
|
|
115
|
-
function externStubs (config) {
|
|
116
|
-
const fallback = Object.assign({}, STUB_FALLBACK, {
|
|
117
|
-
buffer: require.resolve('buffer/'),
|
|
118
|
-
process: require.resolve('process/browser')
|
|
119
|
-
})
|
|
120
|
-
return merge(config, fallback, [
|
|
121
|
-
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'], process: 'process/browser' })
|
|
122
|
-
])
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
module.exports = { bundlePolyfills, externStubs }
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
// Everything-in-one bundle (bsv.bundle.js). Same polyfill posture as bsv.min.js.
|
|
5
|
-
module.exports = bundlePolyfills({
|
|
6
|
-
entry: path.join(__dirname, '../bundle-entry.js'),
|
|
7
|
-
output: {
|
|
8
|
-
library: 'bsv',
|
|
9
|
-
libraryTarget: 'umd',
|
|
10
|
-
globalObject: "typeof self !== 'undefined' ? self : this",
|
|
11
|
-
path: path.resolve(__dirname, '../'),
|
|
12
|
-
filename: 'bsv.bundle.js'
|
|
13
|
-
},
|
|
14
|
-
mode: 'production'
|
|
15
|
-
})
|
package/build/webpack.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var path = require('path')
|
|
2
|
-
var { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
// Full library bundle (bsv.min.js). webpack 5: Node-core polyfills are declared
|
|
5
|
-
// via bundlePolyfills (crypto-browserify so secrets.js/Shamir gets a CSPRNG in
|
|
6
|
-
// the browser; Buffer global preserved). bsv's own crypto stays pure-JS.
|
|
7
|
-
module.exports = bundlePolyfills({
|
|
8
|
-
entry: path.join(__dirname, '../index.js'),
|
|
9
|
-
output: {
|
|
10
|
-
library: 'bsv',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: "typeof self !== 'undefined' ? self : this",
|
|
13
|
-
path: path.resolve(__dirname, '../'),
|
|
14
|
-
filename: 'bsv.min.js'
|
|
15
|
-
},
|
|
16
|
-
mode: 'production'
|
|
17
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { externStubs } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = externStubs({
|
|
5
|
-
mode: 'production',
|
|
6
|
-
entry: path.join(__dirname, '../covenant-entry.js'),
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-covenant.min.js',
|
|
10
|
-
library: 'bsvCovenant',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: {
|
|
14
|
-
// Don't bundle BSV - it should be loaded separately
|
|
15
|
-
'../index.js': 'bsv'
|
|
16
|
-
}
|
|
17
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../didweb-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-didweb.min.js',
|
|
10
|
-
library: 'bsvDIDWeb',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../ecies/index.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-ecies.min.js',
|
|
10
|
-
library: 'bsvEcies',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: { '../../': 'bsv' },
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../gdaf-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-gdaf.min.js',
|
|
10
|
-
library: 'bsvGDAF',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../ltp-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-ltp.min.js',
|
|
10
|
-
library: 'bsvLTP',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../message/index.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-message.min.js',
|
|
10
|
-
library: 'bsvMessage',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: { '../../': 'bsv' },
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../mnemonic/index.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-mnemonic.min.js',
|
|
10
|
-
library: 'bsvMnemonic',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: { '../../': 'bsv' },
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { externStubs } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = externStubs({
|
|
5
|
-
mode: 'production',
|
|
6
|
-
entry: path.join(__dirname, '../script-helper-entry.js'),
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-script-helper.min.js',
|
|
10
|
-
library: 'bsvScriptHelper',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: {
|
|
14
|
-
// Don't bundle BSV - it should be loaded separately
|
|
15
|
-
'../index.js': 'bsv'
|
|
16
|
-
}
|
|
17
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
// security-entry embeds bsv (no externals) and needs the crypto polyfill so
|
|
5
|
-
// Shamir/secrets.js gets a CSPRNG in the browser -> full polyfills.
|
|
6
|
-
module.exports = bundlePolyfills({
|
|
7
|
-
mode: 'production',
|
|
8
|
-
entry: path.join(__dirname, '../security-entry.js'),
|
|
9
|
-
output: {
|
|
10
|
-
path: path.resolve(__dirname, '../'),
|
|
11
|
-
filename: 'bsv-security.min.js',
|
|
12
|
-
library: 'bsvSecurity',
|
|
13
|
-
libraryTarget: 'var'
|
|
14
|
-
}
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../shamir-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-shamir.min.js',
|
|
10
|
-
library: 'bsvShamir',
|
|
11
|
-
libraryTarget: 'var'
|
|
12
|
-
},
|
|
13
|
-
externals: { '../../': 'bsv' },
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { externStubs } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = externStubs({
|
|
5
|
-
entry: path.join(__dirname, '../smartcontract-entry.js'),
|
|
6
|
-
output: {
|
|
7
|
-
library: 'bsvSmartContract',
|
|
8
|
-
libraryTarget: 'umd',
|
|
9
|
-
globalObject: "typeof self !== 'undefined' ? self : this",
|
|
10
|
-
path: path.resolve(__dirname, '../'),
|
|
11
|
-
filename: 'bsv-smartcontract.min.js'
|
|
12
|
-
},
|
|
13
|
-
externals: {
|
|
14
|
-
// Don't bundle BSV - expect it to be loaded separately
|
|
15
|
-
'./index.js': 'bsv'
|
|
16
|
-
},
|
|
17
|
-
mode: 'production'
|
|
18
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../statuslist-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-statuslist.min.js',
|
|
10
|
-
library: 'bsvStatusList',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const { bundlePolyfills } = require('./webpack.base')
|
|
3
|
-
|
|
4
|
-
module.exports = bundlePolyfills({
|
|
5
|
-
entry: path.join(__dirname, '../vcjwt-entry.js'),
|
|
6
|
-
mode: 'production',
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, '../'),
|
|
9
|
-
filename: 'bsv-vcjwt.min.js',
|
|
10
|
-
library: 'bsvVcJwt',
|
|
11
|
-
libraryTarget: 'umd',
|
|
12
|
-
globalObject: 'this'
|
|
13
|
-
},
|
|
14
|
-
target: 'web'
|
|
15
|
-
})
|