From c4dadf4bfd5b955221d5e8cd5e702720efd7873b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 17:49:06 +0100 Subject: Combine imports --- .../src/contract_wrappers/contract_wrapper.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index 490a6c50a..ba36afea1 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -1,7 +1,14 @@ import { AbiDecoder, intervalUtils, logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import { ContractArtifact } from 'ethereum-types'; -import { BlockParamLiteral, ContractAbi, FilterObject, LogEntry, LogWithDecodedArgs, RawLog } from 'ethereum-types'; +import { + BlockParamLiteral, + ContractAbi, + ContractArtifact, + FilterObject, + LogEntry, + LogWithDecodedArgs, + RawLog, +} from 'ethereum-types'; import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream'; import * as _ from 'lodash'; -- cgit From 09d64961359cb63ff0bf1496b5f30840f030d8db Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 20:53:21 +0100 Subject: Change exit code to failure --- packages/monorepo-scripts/src/test_installation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index 87c4ad1d7..e626fb891 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -85,7 +85,7 @@ function logIfDefined(x: any): void { logIfDefined(packageError.error.stdout); logIfDefined(packageError.error.stack); }); - process.exit(0); + process.exit(1); } })().catch(err => { utils.log(`Unexpected error: ${err.message}`); -- cgit From 40cf805e5ec0b49b6b193bad941b97049864ba0b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 20:54:15 +0100 Subject: Also use failure exit code if unexpected error occurs --- packages/monorepo-scripts/src/test_installation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index e626fb891..10709af25 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -86,10 +86,12 @@ function logIfDefined(x: any): void { logIfDefined(packageError.error.stack); }); process.exit(1); + } else { + process.exit(0); } })().catch(err => { utils.log(`Unexpected error: ${err.message}`); - process.exit(0); + process.exit(1); }); async function testInstallPackageAsync( -- cgit From 52fde551e47c774c115c6b6fae085025dc742196 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 21:16:32 +0100 Subject: Remove check since this method is now used in multiple places --- packages/monorepo-scripts/src/utils/changelog_utils.ts | 5 ----- 1 file changed, 5 deletions(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/utils/changelog_utils.ts b/packages/monorepo-scripts/src/utils/changelog_utils.ts index 4781b3b7d..8058d222b 100644 --- a/packages/monorepo-scripts/src/utils/changelog_utils.ts +++ b/packages/monorepo-scripts/src/utils/changelog_utils.ts @@ -19,11 +19,6 @@ CHANGELOG export const changelogUtils = { getChangelogMdTitle(versionChangelog: VersionChangelog): string { - if (_.isUndefined(versionChangelog.timestamp)) { - throw new Error( - 'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version', - ); - } const date = moment(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY'); const title = `\n## v${versionChangelog.version} - _${date}_\n\n`; return title; -- cgit From db54588d055cc2cc6b7f1a99c7438f6fd2053765 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 22:00:51 +0100 Subject: Add BlockParamLiteral to template --- packages/contract_templates/contract.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars index 5c36a765d..466893aa7 100644 --- a/packages/contract_templates/contract.handlebars +++ b/packages/contract_templates/contract.handlebars @@ -2,7 +2,7 @@ // tslint:disable:no-unused-variable // tslint:disable:no-unbound-method import { BaseContract } from '@0xproject/base-contract'; -import { BlockParam, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types'; +import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types'; import { BigNumber, classUtils, logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as ethers from 'ethers'; -- cgit From 3a5c6ed00fb96488897fa95fbf267f71def24fc4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:05:04 +0100 Subject: Fix sra-spec `main` and `types` in package.json --- packages/sra-spec/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index 706f9f0aa..ccb7ccb71 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -5,8 +5,8 @@ "node": ">=6.12" }, "description": "Standard Relayer API Open API Spec", - "main": "lib/src/index.js", - "types": "lib/src/index.d.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "serve": "redoc-cli serve lib/api.json --watch", "watch_without_deps": "run-p build-json:watch serve", -- cgit From 6a6b424c86b507d4dbfe5821ef81e7f76b818ef9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:35:47 +0100 Subject: Move md files to lib folder during build --- packages/sra-spec/package.json | 4 +++- packages/sra-spec/src/md/index.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index ccb7ccb71..9a192d46f 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -17,9 +17,10 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", "clean": "shx rm -rf lib", - "build": "tsc && yarn build-json", + "build": "tsc && copy_md_files && yarn build-json", "build-json": "ts-node build_scripts/buildJson.ts", "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ", + "copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/md", "deploy-site": "discharge deploy" }, "repository": { @@ -42,6 +43,7 @@ "@types/node": "^10.5.3", "chai": "^4.0.1", "chokidar-cli": "^1.2.0", + "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "discharge": "^0.7.1", "mocha": "^4.0.1", diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 076c3c45c..0d1147aa0 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('src/md/introduction.md').toString(), + introduction: readFileSync('lib/md/introduction.md').toString(), }; -- cgit From 41559c39b9b4fac9c512309f3271796bb9fb0fb0 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 26 Aug 2018 23:43:19 +0100 Subject: Fix command --- packages/sra-spec/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json index 9a192d46f..f0820e136 100644 --- a/packages/sra-spec/package.json +++ b/packages/sra-spec/package.json @@ -17,7 +17,7 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", "clean": "shx rm -rf lib", - "build": "tsc && copy_md_files && yarn build-json", + "build": "tsc && yarn copy_md_files && yarn build-json", "build-json": "ts-node build_scripts/buildJson.ts", "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ", "copy_md_files": "copyfiles -u 2 './src/md/**/*.md' ./lib/md", -- cgit From 9fc8a6e214279cb156fa467fbada2b7d5368d616 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:09:51 +0100 Subject: Try relative path --- packages/sra-spec/src/md/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 0d1147aa0..076c3c45c 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('lib/md/introduction.md').toString(), + introduction: readFileSync('src/md/introduction.md').toString(), }; -- cgit From 90c9e3496a6db59c39265d1974f766fed30c7877 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:10:07 +0100 Subject: Actual relative path --- packages/sra-spec/src/md/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index 076c3c45c..d82e7061f 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'fs'; export const md = { - introduction: readFileSync('src/md/introduction.md').toString(), + introduction: readFileSync('introduction.md').toString(), }; -- cgit From 4ac43a9fd2d3cc75b4f9aed92d85f722f28d34cb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 10:38:06 +0100 Subject: Try relative to root dir --- packages/sra-spec/src/md/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index d82e7061f..b32cba6f4 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,5 +1,7 @@ import { readFileSync } from 'fs'; +console.log('DIR', __dirname); + export const md = { - introduction: readFileSync('introduction.md').toString(), + introduction: readFileSync('lib/md/introduction.md').toString(), }; -- cgit From e4fc8a84145d14084c389f5c4e8307e84ebf0c41 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 12:05:55 +0100 Subject: Use absolute path --- packages/sra-spec/src/md/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/sra-spec/src/md/index.ts b/packages/sra-spec/src/md/index.ts index b32cba6f4..4e778e073 100644 --- a/packages/sra-spec/src/md/index.ts +++ b/packages/sra-spec/src/md/index.ts @@ -1,7 +1,5 @@ import { readFileSync } from 'fs'; -console.log('DIR', __dirname); - export const md = { - introduction: readFileSync('lib/md/introduction.md').toString(), + introduction: readFileSync(`${__dirname}/introduction.md`).toString(), }; -- cgit From 6174d9ebb78b46d98a3e994ae00eea05a92bc84a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 12:34:34 +0100 Subject: Fix typo --- packages/monorepo-scripts/src/test_installation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index 10709af25..be39b1878 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -146,7 +146,7 @@ async function testInstallPackageAsync( const transpiledIndexFilePath = path.join(testDirectory, 'index.js'); utils.log(`Running test script with ${packageName} imported`); await execAsync(`node ${transpiledIndexFilePath}`); - utils.log(`Successfilly ran test script with ${packageName} imported`); + utils.log(`Successfully ran test script with ${packageName} imported`); } await rimrafAsync(testDirectory); } -- cgit From bc4149683e2dda2b36c29cc81fadf1ae4de7d8b1 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 12:39:10 +0100 Subject: Skip doc generation for local publishes since we test this in a separate CI test --- packages/monorepo-scripts/src/publish.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 7e2e64536..646818c58 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -74,9 +74,11 @@ async function confirmAsync(message: string): Promise { }); utils.log(`Calling 'lerna publish'...`); await lernaPublishAsync(packageToNextVersion); - const isStaging = false; - const shouldUploadDocs = !configs.IS_LOCAL_PUBLISH; - await generateAndUploadDocJsonsAsync(packagesWithDocs, isStaging, shouldUploadDocs); + if (!configs.IS_LOCAL_PUBLISH) { + const isStaging = false; + const shouldUploadDocs = true; + await generateAndUploadDocJsonsAsync(packagesWithDocs, isStaging, shouldUploadDocs); + } const isDryRun = configs.IS_LOCAL_PUBLISH; await publishReleaseNotesAsync(updatedPublicPackages, isDryRun); })().catch(err => { -- cgit