Prepare connect package for publishing
This commit is contained in:
parent
0e03ef385b
commit
a61a7b688a
@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "A javascript library for interacting with the standard relayer api",
|
"description": "A javascript library for interacting with the standard relayer api",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"0x-connect",
|
"connect",
|
||||||
"0xproject",
|
"0xproject",
|
||||||
"ethereum",
|
"ethereum",
|
||||||
"tokens",
|
"tokens",
|
||||||
@ -14,9 +14,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"clean": "shx rm -rf _bundles lib test_temp",
|
"clean": "shx rm -rf _bundles lib test_temp",
|
||||||
|
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
||||||
|
"upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json",
|
||||||
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
||||||
"lint": "tslint src/**/*.ts test/**/*.ts",
|
"lint": "tslint src/**/*.ts test/**/*.ts",
|
||||||
"prepublishOnly": "run-p build",
|
|
||||||
"run_mocha": "mocha lib/test/**/*_test.js",
|
"run_mocha": "mocha lib/test/**/*_test.js",
|
||||||
"test": "run-s clean build copy_test_fixtures run_mocha",
|
"test": "run-s clean build copy_test_fixtures run_mocha",
|
||||||
"test:circleci": "yarn test"
|
"test:circleci": "yarn test"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
"npm-run-all": "^4.0.2",
|
"npm-run-all": "^4.0.2",
|
||||||
"shx": "^0.2.2",
|
"shx": "^0.2.2",
|
||||||
"tslint": "5.8.0",
|
"tslint": "5.8.0",
|
||||||
|
"typedoc": "~0.8.0",
|
||||||
"typescript": "~2.6.1",
|
"typescript": "~2.6.1",
|
||||||
"web3-typescript-typings": "^0.7.1"
|
"web3-typescript-typings": "^0.7.1"
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,39 @@
|
|||||||
|
const execAsync = require('async-child-process').execAsync;
|
||||||
const postpublish_utils = require('../../../scripts/postpublish_utils');
|
const postpublish_utils = require('../../../scripts/postpublish_utils');
|
||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
|
const cwd = __dirname + '/..';
|
||||||
const subPackageName = packageJSON.name;
|
const subPackageName = packageJSON.name;
|
||||||
|
const S3BucketPath = 's3://connect-docs-jsons/';
|
||||||
|
|
||||||
|
let tag;
|
||||||
|
let version;
|
||||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||||
.then(function(result) {
|
.then(function(result) {
|
||||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
|
tag = result.tag;
|
||||||
const assets = [];
|
version = result.version;
|
||||||
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
|
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||||
|
return postpublish_utils.publishReleaseNotes(tag, releaseName);
|
||||||
})
|
})
|
||||||
.catch (function(err) {
|
.then(function(release) {
|
||||||
|
console.log('POSTPUBLISH: Release successful, generating docs...');
|
||||||
|
return execAsync(
|
||||||
|
'JSON_FILE_PATH=' + __dirname + '/../docs/index.json PROJECT_DIR=' + __dirname + '/.. yarn docs:json',
|
||||||
|
{
|
||||||
|
cwd,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.then(function(result) {
|
||||||
|
if (result.stderr !== '') {
|
||||||
|
throw new Error(result.stderr);
|
||||||
|
}
|
||||||
|
const fileName = 'v' + version + '.json';
|
||||||
|
console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName);
|
||||||
|
const s3Url = S3BucketPath + fileName;
|
||||||
|
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
|
||||||
|
cwd,
|
||||||
|
});
|
||||||
|
}).catch (function(err) {
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
@ -18,6 +18,10 @@ import {
|
|||||||
import {schemas as clientSchemas} from './schemas/schemas';
|
import {schemas as clientSchemas} from './schemas/schemas';
|
||||||
import {typeConverters} from './utils/type_converters';
|
import {typeConverters} from './utils/type_converters';
|
||||||
|
|
||||||
|
BigNumber.config({
|
||||||
|
EXPONENTIAL_AT: 1000,
|
||||||
|
});
|
||||||
|
|
||||||
interface RequestOptions {
|
interface RequestOptions {
|
||||||
params?: object;
|
params?: object;
|
||||||
payload?: object;
|
payload?: object;
|
||||||
@ -157,9 +161,10 @@ export class HttpClient implements Client {
|
|||||||
const headers = new Headers({
|
const headers = new Headers({
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
});
|
});
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: requestType,
|
method: requestType,
|
||||||
body: payload,
|
body: JSON.stringify(payload),
|
||||||
headers,
|
headers,
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
export {HttpClient} from './http_client';
|
export {HttpClient} from './http_client';
|
||||||
export {WebSocketOrderbookChannel} from './ws_orderbook_channel';
|
|
||||||
export {
|
export {
|
||||||
Client,
|
Client,
|
||||||
FeesRequest,
|
FeesRequest,
|
||||||
FeesResponse,
|
FeesResponse,
|
||||||
OrderbookChannel,
|
|
||||||
OrderbookChannelHandler,
|
|
||||||
OrderbookChannelSubscriptionOpts,
|
|
||||||
OrderbookRequest,
|
OrderbookRequest,
|
||||||
OrderbookResponse,
|
OrderbookResponse,
|
||||||
OrdersRequest,
|
OrdersRequest,
|
||||||
|
@ -4,7 +4,7 @@ import * as dirtyChai from 'dirty-chai';
|
|||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import {
|
import {
|
||||||
WebSocketOrderbookChannel,
|
WebSocketOrderbookChannel,
|
||||||
} from '../src/index';
|
} from '../src/ws_orderbook_channel';
|
||||||
|
|
||||||
chai.config.includeStack = true;
|
chai.config.includeStack = true;
|
||||||
chai.use(dirtyChai);
|
chai.use(dirtyChai);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user