mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-21 22:37:59 +00:00
ec06da0ebc
- Package namespace: @polkadot/* -> @pezkuwi/* - Repository: polkadot-js/common -> pezkuwichain/pezkuwi-common - Author: Pezkuwi Team <team@pezkuwichain.io> Core packages: - @pezkuwi/util (utilities) - @pezkuwi/util-crypto (crypto primitives) - @pezkuwi/keyring (account management) - @pezkuwi/networks (chain metadata) - @pezkuwi/hw-ledger (Ledger hardware wallet) - @pezkuwi/x-* (10 polyfill packages) Total: 14 packages Upstream: polkadot-js/common v14.0.1
66 lines
2.2 KiB
JavaScript
66 lines
2.2 KiB
JavaScript
// Copyright 2017-2025 @pezkuwi/util authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import path from 'node:path';
|
|
|
|
import { createBundle } from '@pezkuwi/dev/config/rollup';
|
|
|
|
const pkgs = [
|
|
'@pezkuwi/hw-ledger',
|
|
'@pezkuwi/keyring',
|
|
'@pezkuwi/util',
|
|
'@pezkuwi/util-crypto'
|
|
];
|
|
|
|
const external = [
|
|
...pkgs
|
|
];
|
|
|
|
const entries = ['hw-ledger-transports', 'networks', 'x-bigint', 'x-fetch', 'x-global', 'x-randomvalues', 'x-textdecoder', 'x-textencoder', 'x-ws'].reduce((all, p) => ({
|
|
...all,
|
|
[`@pezkuwi/${p}`]: path.resolve(process.cwd(), `packages/${p}/build`)
|
|
}), {});
|
|
|
|
const overrides = {
|
|
'@pezkuwi/hw-ledger': {
|
|
// these are all used in the un-shakeable (and unused inside @pezkuwi/*) hdDerivation
|
|
// functionality from the Zondax libs, disable it completely with empty stubs
|
|
entries: {
|
|
'bip32-ed25519': path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js'),
|
|
bip39: path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js'),
|
|
blakejs: path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js'),
|
|
bs58: path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js'),
|
|
events: path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js'),
|
|
'hash.js': path.resolve(process.cwd(), 'packages/x-bundle/build/empty.js')
|
|
}
|
|
},
|
|
'@pezkuwi/util-crypto': {
|
|
entries: {
|
|
'@pezkuwi/wasm-crypto': path.resolve(process.cwd(), 'node_modules/@pezkuwi/wasm-crypto/bundle.js'),
|
|
'bn.js': path.resolve(process.cwd(), 'packages/x-bundle/build/cjs/bn.js'),
|
|
buffer: path.resolve(process.cwd(), 'packages/x-bundle/build/buffer.js'),
|
|
crypto: path.resolve(process.cwd(), 'packages/x-bundle/build/crypto.js')
|
|
},
|
|
inject: {
|
|
Buffer: path.resolve(process.cwd(), 'packages/x-bundle/build/buffer.js'),
|
|
crypto: path.resolve(process.cwd(), 'packages/x-bundle/build/crypto.js'),
|
|
inherits: path.resolve(process.cwd(), 'packages/x-bundle/build/inherits.js')
|
|
},
|
|
polyfill: false
|
|
}
|
|
};
|
|
|
|
export default pkgs.map((pkg) => {
|
|
const override = (overrides[pkg] || {});
|
|
|
|
return createBundle({
|
|
external,
|
|
pkg,
|
|
...override,
|
|
entries: {
|
|
...entries,
|
|
...(override.entries || {})
|
|
}
|
|
});
|
|
});
|