Skip to content

Commit

Permalink
merge dev/2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelycs committed Jul 24, 2019
2 parents 85c54df + a0ff0f5 commit e305e72
Show file tree
Hide file tree
Showing 67 changed files with 437 additions and 106 deletions.
5 changes: 5 additions & 0 deletions build/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ files.forEach(val => {
}
}

const tsPath = path.join(firstP, 'tsconfig.json');
if (fs.existsSync(tsPath)) {
fs.unlinkSync(tsPath);
}

const fPath = path.join(firstP, 'dist');
if (!fs.existsSync(fPath)) {
return;
Expand Down
Empty file removed build/vitets.js
Empty file.
9 changes: 9 additions & 0 deletions build/writePkgJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const traversing = require('./traversing');

const packageJsonContent = require('../common/package.json');
const currPackageJsonContent = require('../package.json');
const currTsConfigJsonContent = require('../tsconfig.json');
const lernaJsonContent = require('../lerna.json');

// Change `dist/${packageName}.${"node"||"web"}.js` to `src/${packageName}/index.${"node"||"web"}.js`
Expand Down Expand Up @@ -42,4 +43,12 @@ function copyFile({ fromPath, name }) {

const packageFile = path.join(fromPath, './package.json');
fs.writeFileSync(packageFile, JSON.stringify(packageJsonContent));

const tsConfigFile = path.join(fromPath, './tsconfig.json');
delete currTsConfigJsonContent.compilerOptions.baseUrl;
delete currTsConfigJsonContent.compilerOptions.paths;
delete currTsConfigJsonContent.compilerOptions.outDir;
delete currTsConfigJsonContent.include;
delete currTsConfigJsonContent.exclude;
fs.writeFileSync(tsConfigFile, JSON.stringify(currTsConfigJsonContent));
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.6",
"version": "2.2.8",
"packages": [
"src/*"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vite/vitejs",
"version": "2.2.6",
"version": "2.2.8",
"description": "",
"scripts": {
"format-type": "node build/type",
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-http","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-http","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/HTTP/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/HTTP/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
2 changes: 1 addition & 1 deletion src/IPC/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-ipc","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-ipc","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/IPC/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/IPC/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
2 changes: 1 addition & 1 deletion src/WS/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-ws","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-ws","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/WS/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/WS/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
5 changes: 4 additions & 1 deletion src/abi/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function encodeParameters(types, params) {
throw new Error('[Error] Illegal inputs. Inputs should be array.');
}

// console.log(types);
if (!types.length) {
return '';
}
Expand Down Expand Up @@ -103,6 +104,8 @@ export function decodeParameter(typeStr, params) {
}

export function decodeParameters(types, params) {
// console.log('startDecode', types, params);

if (!isArray(types)) {
throw new Error('[Error] Illegal types. Should be array.');
}
Expand All @@ -117,7 +120,7 @@ export function decodeParameters(types, params) {

types.forEach(type => {
const typeObj = formatType(type);

// console.log(typeObj);
if (!typeObj.isDynamic && typeObj.isArr) {
let len = 0;
typeObj.arrLen.forEach(_l => {
Expand Down
12 changes: 8 additions & 4 deletions src/abi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ export const decodeParameter = _decodeParameter;

export function encodeParameters(types, params, mehtodName?: string) {
try {
const func = getFunction(types, mehtodName);
types = getTypes(func);
if (mehtodName || !isArray(types) && isObject(types)) {
const func = getFunction(types, mehtodName);
types = getTypes(func);
}
} catch (err) {}

return _encodeParameters(getTypes(types), params);
}
export function decodeParameters(types, params, mehtodName?: string) {
try {
const func = getFunction(types, mehtodName);
types = getTypes(func);
if (mehtodName || !isArray(types) && isObject(types)) {
const func = getFunction(types, mehtodName);
types = getTypes(func);
}
} catch (err) {}
return _decodeParameters(getTypes(types), params);
}
Expand Down
2 changes: 1 addition & 1 deletion src/abi/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-abi","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-abi","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/abi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/abi/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
2 changes: 1 addition & 1 deletion src/account/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-account","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-account","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/account/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/account/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
2 changes: 1 addition & 1 deletion src/accountBlock/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-accountblock","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-accountblock","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/accountBlock/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/accountBlock/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
2 changes: 1 addition & 1 deletion src/addrAccount/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-addraccount","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-addraccount","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/addrAccount/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
9 changes: 7 additions & 2 deletions src/addrAccount/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ export enum TxType {
'DexFundNewOrder',
'DexTradeCancelOrder',
'DexFundNewMarket',
'CreateContractReq',
'DexFundPledgeForVx',
'DexFundPledgeForVip',
'DexFundBindInviteCode',
'DexFundNewInviter',
'DexFundTransferTokenOwner',
'DexFundMarketOwnerConfig',
'CreateContractReq',
'TxReq',
'RewardReq',
'TxRes',
Expand Down Expand Up @@ -364,7 +368,8 @@ export enum dexfund {
'getAccountFundInfo' = 'dexfund_getAccountFundInfo',
'getAccountFundInfoByStatus' = 'dexfund_getAccountFundInfoByStatus',
'isPledgeVip' = 'dexfund_isPledgeVip',
'getMarketInfo' = 'dexfund_getMarketInfo'
'getMarketInfo' = 'dexfund_getMarketInfo',
'getCurrentDividendPools' = 'dexfund_getCurrentDividendPools'
}

export enum net {
Expand Down
3 changes: 3 additions & 0 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class ClientClass extends netProcessor {
list.push(item);
});

if (list.length > totalNum) {
console.warn('[client.getTxList] Please confirm that totalNum is correct.');
}
return { list, totalNum };
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@vite/vitejs-client","version":"2.2.6","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
{"name":"@vite/vitejs-client","version":"2.2.8","main":"dist/index.node.js","browser":"dist/index.web.js","typings":"index.ts","repository":{"type":"git","url":"git+https://github.com/vitelabs/vite.js.git"},"license":"ISC","bugs":{"url":"https://github.com/vitelabs/vite.js/issues"},"homepage":"https://github.com/vitelabs/vite.js#readme","publishConfig":{"access":"public"}}
1 change: 1 addition & 0 deletions src/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compilerOptions":{"allowSyntheticDefaultImports":true,"allowJs":true,"target":"es5","module":"commonjs","noImplicitAny":false,"removeComments":true,"preserveConstEnums":true,"sourceMap":false,"moduleResolution":"node","resolveJsonModule":true,"lib":["es5","es2017","es2015","es2017.typedarrays"]}}
Loading

0 comments on commit e305e72

Please sign in to comment.