diff --git a/.tsconfig.json b/.tsconfig.json
deleted file mode 100644
index c5369ea..0000000
--- a/.tsconfig.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "files": [],
- "references": []
-}
diff --git a/examples/temp.html b/examples/temp.html
index 0a65a87..ed924f3 100644
--- a/examples/temp.html
+++ b/examples/temp.html
@@ -34,6 +34,7 @@
+
diff --git a/examples/testNode.js b/examples/testNode.js
new file mode 100644
index 0000000..3b64abb
--- /dev/null
+++ b/examples/testNode.js
@@ -0,0 +1,23 @@
+const { Account } = require('../packages/harmony-account/lib/index.js');
+const {
+ getAddressFromPublicKey,
+} = require('../packages/harmony-crypto/lib/index.js');
+const {
+ isAddress,
+ isPrivateKey,
+} = require('../packages/harmony-utils/lib/index.js');
+
+// const a = Account.new();
+
+// console.log(isAddress(a.checksumAddress));
+
+const importKey =
+ '0x87b3ec80f36f9553fb63624d0805d87cfe461145c7be972d23db95fb1a53b1e7';
+
+const c = Account.add(importKey);
+
+// console.log(isPrivateKey(importKey));
+
+console.log(c);
+
+console.log(getAddressFromPublicKey(c.publicKey));
diff --git a/package.json b/package.json
index 6ac8052..b630696 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
"build:ts": "tsc -b tsconfig.json",
"bundle": "ts-node -P scripts/tsconfig.json scripts/bundle.ts umd,esm",
"clean": "lerna clean --yes && lerna run clean && rimraf includes",
- "schema": "ts-node -P scripts/tsconfig.json scripts/schema.ts core",
+ "schema": "ts-node -P scripts/tsconfig.json scripts/typings/schema.ts core",
"test": "cross-env TEST_ENV=unit jest -c jest.config.js --rootDir=.",
"test:build": "cross-env TEST_ENV=unit jest -c jest.build.config.js",
"test:integration": "cross-env TEST_ENV=integration jest -c jest.iconfig.js --runInBand --verbose --collectCoverage=false",
@@ -93,12 +93,11 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"typescript": "^3.2",
- "typescript-json-schema": "^0.32.0",
+ "typescript-json-schema": "^0.36.0",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.20.2",
"webpack-command": "^0.4.1",
"webpack-node-externals": "^1.7.2"
},
- "dependencies": {
- }
+ "dependencies": {}
}
diff --git a/packages/harmony-account/package.json b/packages/harmony-account/package.json
index 07f53dd..25af07b 100644
--- a/packages/harmony-account/package.json
+++ b/packages/harmony-account/package.json
@@ -1,11 +1,16 @@
{
- "name": "harmony-account",
+ "name": "@harmony/account",
"version": "0.0.1",
"description": "account and wallet for harmony",
- "main": "index.js",
+ "main": "lib/index.js",
+ "typings":"lib/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "neeboo@firestack.one",
- "license": "ISC"
+ "license": "ISC",
+ "dependencies": {
+ "@harmony/crypto": "^0.0.1",
+ "@harmony/utils": "^0.0.1"
+ }
}
diff --git a/packages/harmony-account/src/account.ts b/packages/harmony-account/src/account.ts
index e69de29..add52ff 100644
--- a/packages/harmony-account/src/account.ts
+++ b/packages/harmony-account/src/account.ts
@@ -0,0 +1,55 @@
+import {
+ generatePrivateKey,
+ getAddressFromPrivateKey,
+ getPubkeyFromPrivateKey,
+ toChecksumAddress,
+} from '@harmony/crypto';
+
+import { isPrivateKey } from '@harmony/utils';
+
+class Account {
+ static new(): Account {
+ const newAcc = new Account()._new();
+ return newAcc;
+ }
+ static add(key: string): Account {
+ const newAcc = new Account()._import(key);
+ return newAcc;
+ }
+
+ privateKey?: string;
+ publicKey?: string;
+ address?: string;
+
+ get checksumAddress(): string {
+ return this.address ? toChecksumAddress(this.address) : '';
+ }
+ constructor(key?: string) {
+ if (key === null) {
+ this._new();
+ }
+ }
+
+ private _new(): Account {
+ const prv = generatePrivateKey();
+ if (!isPrivateKey(prv)) {
+ throw new Error('key gen failed');
+ }
+ this.privateKey = prv;
+ this.publicKey = getPubkeyFromPrivateKey(this.privateKey);
+ this.address = getAddressFromPrivateKey(this.privateKey);
+ return this;
+ }
+
+ private _import(key: string): Account {
+ if (!isPrivateKey(key)) {
+ throw new Error(`${key} is not PrivateKey`);
+ }
+ this.privateKey = key;
+ this.publicKey = getPubkeyFromPrivateKey(this.privateKey);
+ this.address = getAddressFromPrivateKey(this.privateKey);
+ return this;
+ }
+}
+
+export { Account };
diff --git a/packages/harmony-account/src/index.ts b/packages/harmony-account/src/index.ts
index e69de29..362a768 100644
--- a/packages/harmony-account/src/index.ts
+++ b/packages/harmony-account/src/index.ts
@@ -0,0 +1 @@
+export * from './account';
diff --git a/packages/harmony-account/src/types.ts b/packages/harmony-account/src/types.ts
new file mode 100644
index 0000000..e69de29
diff --git a/packages/harmony-account/tsconfig.json b/packages/harmony-account/tsconfig.json
new file mode 100644
index 0000000..20ea70f
--- /dev/null
+++ b/packages/harmony-account/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "baseUrl": ".",
+ "paths": { "*": ["types/*"] },
+ "outDir": "lib",
+ "rootDir": "src"
+ },
+ "include": ["src", "../../typings/**/*.d.ts"],
+ "references": [
+ { "path": "../harmony-crypto" },
+ { "path": "../harmony-utils" }
+ ]
+}
diff --git a/packages/harmony-crypto/package.json b/packages/harmony-crypto/package.json
index 5d5c52c..634dab6 100644
--- a/packages/harmony-crypto/package.json
+++ b/packages/harmony-crypto/package.json
@@ -1,12 +1,20 @@
{
- "name": "harmony-crypto",
+ "name": "@harmony/crypto",
"version": "0.0.1",
"description": "crypto libraries for harmony",
- "main": "index.js",
+ "main": "lib/index.js",
+ "node": "lib/index.js",
+ "browser": "dist/index.js",
+ "module": "dist/index.js",
+ "jsnext:main": "dist/index.js",
+ "typings":"lib/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "neeboo@firestack.one",
+ "publishConfig": {
+ "access": "public"
+ },
"license": "ISC",
"dependencies": {
"aes-js": "^3.1.2",
diff --git a/packages/harmony-crypto/src/bytes.ts b/packages/harmony-crypto/src/bytes.ts
index 57c0ed1..73e948f 100644
--- a/packages/harmony-crypto/src/bytes.ts
+++ b/packages/harmony-crypto/src/bytes.ts
@@ -31,7 +31,9 @@ function addSlice(array: Uint8Array): Uint8Array {
// tslint:disable-next-line: only-arrow-functions
array.slice = function() {
const args = Array.prototype.slice.call(arguments);
- return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));
+ return addSlice(
+ new Uint8Array(Array.prototype.slice.apply(array, [args[0], args[1]])),
+ );
};
return array;
@@ -59,7 +61,7 @@ export function isArrayish(value: any): value is Arrayish {
return true;
}
-export function arrayify(value: Arrayish | Hexable): Uint8Array {
+export function arrayify(value: Arrayish | Hexable): Uint8Array | null {
if (value == null) {
errors.throwError(
'cannot convert null value to array',
@@ -82,7 +84,7 @@ export function arrayify(value: Arrayish | Hexable): Uint8Array {
});
}
- if (match[1] !== '0x') {
+ if (match !== null && match[1] !== '0x') {
errors.throwError(
'hex string must have 0x prefix',
errors.INVALID_ARGUMENT,
@@ -116,11 +118,17 @@ export function arrayify(value: Arrayish | Hexable): Uint8Array {
}
export function concat(objects: Arrayish[]): Uint8Array {
+ if (objects === null) {
+ throw new Error(`concat objects is null`);
+ }
const arrays = [];
let length = 0;
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < objects.length; i++) {
const object = arrayify(objects[i]);
+ if (object == null) {
+ throw new Error('arrayify failed');
+ }
arrays.push(object);
length += object.length;
}
@@ -137,7 +145,11 @@ export function concat(objects: Arrayish[]): Uint8Array {
}
export function stripZeros(value: Arrayish): Uint8Array {
- let result: Uint8Array = arrayify(value);
+ let result: Uint8Array | null = arrayify(value);
+
+ if (result === null) {
+ throw new Error('arrayify failed');
+ }
if (result.length === 0) {
return result;
@@ -158,14 +170,16 @@ export function stripZeros(value: Arrayish): Uint8Array {
}
export function padZeros(value: Arrayish, length: number): Uint8Array {
- value = arrayify(value);
-
- if (length < value.length) {
+ const arrayifyValue = arrayify(value);
+ if (arrayifyValue === null) {
+ throw new Error('arrayify failed');
+ }
+ if (length < arrayifyValue.length) {
throw new Error('cannot pad');
}
const result = new Uint8Array(length);
- result.set(value, length - value.length);
+ result.set(arrayifyValue, length - arrayifyValue.length);
return addSlice(result);
}
@@ -230,7 +244,7 @@ export function hexlify(value: Arrayish | Hexable | number): string {
});
}
- if (match[1] !== '0x') {
+ if (match !== null && match[1] !== '0x') {
errors.throwError(
'hex string must have 0x prefix',
errors.INVALID_ARGUMENT,
@@ -326,7 +340,7 @@ function isSignature(value: any): value is Signature {
}
export function splitSignature(signature: Arrayish | Signature): Signature {
- let v = 0;
+ let v: number | undefined = 0;
let r = '0x';
let s = '0x';
@@ -346,13 +360,16 @@ export function splitSignature(signature: Arrayish | Signature): Signature {
v = parseInt(v, 16);
}
- let recoveryParam = signature.recoveryParam;
+ let recoveryParam = signature.recoveryParam || 1;
if (recoveryParam == null && signature.v != null) {
- recoveryParam = 1 - (v % 2);
+ recoveryParam = 1 - (typeof v !== 'number' ? 0 : v % 2);
}
v = 27 + recoveryParam;
} else {
- const bytes: Uint8Array = arrayify(signature);
+ const bytes: Uint8Array | null = arrayify(signature);
+ if (bytes === null) {
+ throw new Error('arrayify failed');
+ }
if (bytes.length !== 65) {
throw new Error('invalid signature');
}
diff --git a/packages/harmony-crypto/src/errors.ts b/packages/harmony-crypto/src/errors.ts
index f232fa0..0d531bf 100644
--- a/packages/harmony-crypto/src/errors.ts
+++ b/packages/harmony-crypto/src/errors.ts
@@ -62,7 +62,11 @@ let _permanentCensorErrors = false;
let _censorErrors = false;
// @TODO: Enum
-export function throwError(message: string, code: string, params: any): never {
+export function throwError(
+ message: string,
+ code: string | null | undefined,
+ params: any,
+): never {
if (_censorErrors) {
throw new Error('unknown error');
}
@@ -185,17 +189,17 @@ export function setLogLevel(logLevel: string): void {
LogLevel = level;
}
-function log(logLevel: string, args: any[]): void {
+function log(logLevel: string, args: [any?, ...any[]]): void {
if (LogLevel > LogLevels[logLevel]) {
return;
}
console.log.apply(console, args);
}
-export function warn(...args: any[]): void {
+export function warn(...args: [any?, ...any[]]): void {
log('warn', args);
}
-export function info(...args: any[]): void {
+export function info(...args: [any?, ...any[]]): void {
log('info', args);
}
diff --git a/packages/harmony-crypto/src/keccak256.ts b/packages/harmony-crypto/src/keccak256.ts
index 5b10553..8c34852 100644
--- a/packages/harmony-crypto/src/keccak256.ts
+++ b/packages/harmony-crypto/src/keccak256.ts
@@ -3,5 +3,9 @@ import * as sha3 from 'js-sha3';
import { arrayify, Arrayish } from './bytes';
export function keccak256(data: Arrayish): string {
- return '0x' + sha3.keccak_256(arrayify(data));
+ const arrayified = arrayify(data);
+ if (arrayified) {
+ return '0x' + sha3.keccak_256(arrayified);
+ }
+ throw new Error('arrayify failed');
}
diff --git a/packages/harmony-crypto/src/keyTool.ts b/packages/harmony-crypto/src/keyTool.ts
index 4bd6d7b..c091e20 100644
--- a/packages/harmony-crypto/src/keyTool.ts
+++ b/packages/harmony-crypto/src/keyTool.ts
@@ -1,11 +1,11 @@
import elliptic from 'elliptic';
import * as bytes from './bytes';
import * as errors from './errors';
+
import { keccak256 } from './keccak256';
import { randomBytes } from './random';
const secp256k1 = elliptic.ec('secp256k1');
-// const { curve } = secp256k1;
/**
* @function generatePrivateKey
@@ -32,10 +32,7 @@ export const generatePrivateKey = (): string => {
* @return {string}
*/
export const getPubkeyFromPrivateKey = (privateKey: string): string => {
- const buffer = new Buffer(privateKey.slice(2), 'hex');
- const ecKey = secp256k1.keyFromPrivate(buffer);
- const publicKey = '0x' + ecKey.getPublic(true, 'hex');
- return publicKey;
+ return '0x' + getPublic(privateKey, true);
};
/**
@@ -44,18 +41,26 @@ export const getPubkeyFromPrivateKey = (privateKey: string): string => {
* @return {string} address with `length = 40`
*/
export const getAddressFromPrivateKey = (privateKey: string): string => {
- const publicKey = getPubkeyFromPrivateKey(privateKey);
+ const publicHash = '0x' + getPublic(privateKey).slice(2);
+ const publicKey = keccak256(publicHash);
const address = '0x' + publicKey.slice(-40);
return address;
};
+export const getPublic = (privateKey: string, compress?: boolean): string => {
+ const ecKey = secp256k1.keyFromPrivate(privateKey.slice(2), 'hex');
+ return ecKey.getPublic(compress || false, 'hex');
+};
+
/**
* @function getAddressFromPublicKey
* @param {string} publicKey - public key string
* @return {string} address with `length = 40`
*/
export const getAddressFromPublicKey = (publicKey: string): string => {
- const address = '0x' + publicKey.slice(-40);
+ const ecKey = secp256k1.keyFromPublic(publicKey.slice(2), 'hex');
+ const publickHash = ecKey.getPublic(false, 'hex');
+ const address = '0x' + keccak256('0x' + publickHash.slice(2)).slice(-40);
return address;
};
@@ -80,7 +85,7 @@ export const toChecksumAddress = (address: string): string => {
for (let i = 0; i < 40; i++) {
hashed[i] = chars[i].charCodeAt(0);
}
- hashed = bytes.arrayify(keccak256(hashed));
+ hashed = bytes.arrayify(keccak256(hashed)) || hashed;
for (let i = 0; i < 40; i += 2) {
if (hashed[i >> 1] >> 4 >= 8) {
diff --git a/packages/harmony-crypto/src/types.ts b/packages/harmony-crypto/src/types.ts
new file mode 100644
index 0000000..e69de29
diff --git a/packages/harmony-crypto/tsconfig.json b/packages/harmony-crypto/tsconfig.json
index cfc18d3..10487be 100644
--- a/packages/harmony-crypto/tsconfig.json
+++ b/packages/harmony-crypto/tsconfig.json
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "lib",
+ "rootDir": "src"
+ },
"include": ["src", "../../typings/**/*.d.ts"]
}
diff --git a/packages/harmony-utils/package.json b/packages/harmony-utils/package.json
index 8ba0934..92c816f 100644
--- a/packages/harmony-utils/package.json
+++ b/packages/harmony-utils/package.json
@@ -1,8 +1,13 @@
{
- "name": "harmony-utils",
+ "name": "@harmony/utils",
"version": "0.0.1",
"description": "utils for harmony",
- "main": "index.js",
+ "main": "lib/index.js",
+ "node": "lib/index.js",
+ "browser": "dist/index.js",
+ "module": "dist/index.js",
+ "jsnext:main": "dist/index.js",
+ "typings":"lib/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
diff --git a/packages/harmony-utils/src/index.ts b/packages/harmony-utils/src/index.ts
index e69de29..011b41e 100644
--- a/packages/harmony-utils/src/index.ts
+++ b/packages/harmony-utils/src/index.ts
@@ -0,0 +1 @@
+export * from './validators';
diff --git a/packages/harmony-utils/src/validators.ts b/packages/harmony-utils/src/validators.ts
index e69de29..f601c33 100644
--- a/packages/harmony-utils/src/validators.ts
+++ b/packages/harmony-utils/src/validators.ts
@@ -0,0 +1,15 @@
+export const isKeyString = (keyString: string, lengh: number): boolean => {
+ return !!keyString.replace('0x', '').match(`^[0-9a-fA-F]{${lengh}}$`);
+};
+
+export const isAddress = (address: string): boolean => {
+ return isKeyString(address, 40);
+};
+
+export const isPrivateKey = (privateKey: string): boolean => {
+ return isKeyString(privateKey, 64);
+};
+
+export const isPublicKey = (publicKey: string): boolean => {
+ return isKeyString(publicKey, 66);
+};
diff --git a/packages/harmony-utils/tsconfig.json b/packages/harmony-utils/tsconfig.json
new file mode 100644
index 0000000..10487be
--- /dev/null
+++ b/packages/harmony-utils/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "lib",
+ "rootDir": "src"
+ },
+ "include": ["src", "../../typings/**/*.d.ts"]
+}
diff --git a/scripts/packages.js b/scripts/packages.js
index d47c2c2..a10ad93 100644
--- a/scripts/packages.js
+++ b/scripts/packages.js
@@ -1,6 +1,6 @@
export default [
- // 'harmony-account,
+ 'harmony-utils',
'harmony-crypto',
+ 'harmony-account',
// 'harmony-network',
- // 'harmony-utils',
];
diff --git a/scripts/packagesList.js b/scripts/packagesList.js
index f4ca21c..dbd5a9b 100644
--- a/scripts/packagesList.js
+++ b/scripts/packagesList.js
@@ -5,5 +5,7 @@ module.exports = [
// { name: 'LaksaWallet', dest: 'laksa-wallet' },
// { name: 'LaksaHDWallet', dest: 'laksa-hd-wallet' },
// { name: 'LaksaContract', dest: 'laksa-core-contract' },
+ { name: 'HarmonyUtils', dest: 'harmony-utils' },
{ name: 'HarmonyCrypto', dest: 'harmony-crypto' },
+ { name: 'HarmonyAccount', dest: 'harmony-account' },
];
diff --git a/scripts/packagesTs.ts b/scripts/packagesTs.ts
new file mode 100644
index 0000000..6b50330
--- /dev/null
+++ b/scripts/packagesTs.ts
@@ -0,0 +1,8 @@
+const packages = [
+ 'harmony-utils',
+ 'harmony-crypto',
+ 'harmony-account',
+ // 'harmony-network',
+];
+
+export { packages };
diff --git a/scripts/rollup/bundleBrowser.js b/scripts/rollup/bundleBrowser.js
index 966ca54..c877106 100644
--- a/scripts/rollup/bundleBrowser.js
+++ b/scripts/rollup/bundleBrowser.js
@@ -72,10 +72,9 @@ async function bundles() {
const external = getKeys(p);
const externalSetting = getKeys(p).length > 0 ? { external } : {};
const externalObject = external.reduce((g, pkg) => {
- g[`${pkg}`] = camelCase(pkg);
+ g[`${pkg}`] = pkg.startsWith('@harmony') ? pkg : camelCase(pkg);
return g;
}, {});
-
const normal = {
input: `packages/${p}/src/index.ts`,
plugins: [
@@ -112,7 +111,7 @@ async function bundles() {
}),
],
output: {
- file: `packages/${p}/lib/index.js`,
+ file: `packages/${p}/dist/index.js`,
exports: 'named',
format: 'umd',
sourcemap: true,
diff --git a/scripts/rollup/getDependencies.js b/scripts/rollup/getDependencies.js
index b88e752..10289a3 100644
--- a/scripts/rollup/getDependencies.js
+++ b/scripts/rollup/getDependencies.js
@@ -7,7 +7,7 @@ export function getKeys(p) {
const { dependencies } = JSON.parse(data);
const keys = dependencies
- ? Object.keys(dependencies).filter((d) => !/harmony/.test(d))
+ ? Object.keys(dependencies) //.filter((d) => !/harmony/.test(d))
: [];
return keys;
}
diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json
new file mode 100644
index 0000000..82b9a6a
--- /dev/null
+++ b/scripts/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "compilerOptions": {
+ "esModuleInterop": true,
+ "module": "commonjs",
+ "target": "es2015",
+ "resolveJsonModule": true
+ }
+}
diff --git a/scripts/typings/schema.ts b/scripts/typings/schema.ts
new file mode 100644
index 0000000..87b4e50
--- /dev/null
+++ b/scripts/typings/schema.ts
@@ -0,0 +1,49 @@
+import * as fs from 'fs';
+import * as path from 'path';
+// tslint:disable-next-line: no-implicit-dependencies
+import * as schemas from 'typescript-json-schema';
+
+import { packages } from '../packagesTs';
+import tsConfig from '../../tsconfig.base.json';
+
+const outputs = process.argv.slice(2)[0].split(',');
+
+const rootPath = path.resolve(__dirname, '../..');
+const includesPath = path.join(rootPath, 'includes');
+const packagesPath = path.join(rootPath, 'packages');
+
+async function generateSchemas() {
+ packages
+ // @ts-ignore
+ .filter((pkg) => {
+ return (
+ pkg !== 'harmony-' &&
+ outputs.indexOf(pkg.replace('harmony-', '')) !== -1
+ );
+ })
+ .forEach((pkg) => {
+ const pkgPath = path.join(packagesPath, pkg);
+ const pkgSrc = path.join(pkgPath, 'src');
+ const settings = {
+ ref: false,
+ };
+ // tslint:disable-next-line: no-shadowed-variable
+ const tsConfig: schemas.CompilerOptions = {
+ lib: ['es2015'],
+ };
+
+ const prog = schemas.getProgramFromFiles(
+ [path.resolve(path.join(pkgSrc, 'types.ts'))],
+ tsConfig,
+ );
+
+ const schema = schemas.generateSchema(prog, '*', settings);
+
+ fs.writeFileSync(
+ path.join(pkgPath, 'test', 'schema.json'),
+ JSON.stringify(schema, undefined, 2),
+ );
+ });
+}
+
+generateSchemas();
diff --git a/.tsconfig.base.json b/tsconfig.base.json
similarity index 100%
rename from .tsconfig.base.json
rename to tsconfig.base.json
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..0393cf1
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "files": [],
+ "references": [
+ { "path": "packages/harmony-account" },
+ { "path": "packages/harmony-crypto" }
+ { "path": "packages/harmony-utils" }
+ ]
+}
diff --git a/.tsconfig.test.json b/tsconfig.test.json
similarity index 100%
rename from .tsconfig.test.json
rename to tsconfig.test.json
diff --git a/webpack.config.js b/webpack.config.js
index 6a68770..cfb693f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -5,7 +5,7 @@ const packagesSettings = require('./scripts/packagesList');
function createBatchConfig(list) {
return list.map((l) => {
const entryBase = {};
- entryBase[l.name] = [`./packages/${l.dest}/lib/index.js`];
+ entryBase[l.name] = [`./packages/${l.dest}/dist/index.js`];
const batchBaseConfig = {
entry: entryBase,