From a9fbe921a04d2828bd17a60598a3eee0ec63445b Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 15 Nov 2017 15:14:20 -0500 Subject: [PATCH 01/22] WIP --- package.json | 3 ++- packages/0x.js/package.json | 14 +++++------ packages/0x.js/scripts/postpublish.js | 32 ++++++++++++++++++++++++ packages/assert/package.json | 6 ++--- packages/json-schemas/package.json | 4 +-- packages/tslint-config/package.json | 2 +- yarn.lock | 36 +++++++++++++++++++++++++-- 7 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 packages/0x.js/scripts/postpublish.js diff --git a/package.json b/package.json index 49c97eff6f..baccee6b4b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ ], "scripts": { "testrpc": "testrpc -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"", - "lerna:run": "lerna run" + "lerna:run": "lerna run", + "lerna:publish": "lerna run clean; lerna run build; lerna publish" }, "config": { "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic" diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 0204d723fa..e2b19a4408 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,10 +14,8 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "prepublishOnly": "run-p build", - "postpublish": "run-s release docs:json upload_docs_json", - "release": "publish-release --assets _bundles/index.js,_bundles/index.min.js --tag $(git describe --tags) --owner 0xProject --repo 0x.js", - "upload_docs_json": "aws s3 cp docs/index.json s3://0xjs-docs-jsons/$(git describe --tags).json --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json", + "release": "publish-release --assets _bundles/index.js,_bundles/index.min.js --tag $LATEST_TAG --owner 0xProject --repo 0x.js", + "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", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test": "run-s clean test:commonjs", @@ -49,13 +47,14 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/tslint-config": "^0.1.0", + "@0xproject/tslint-config": "^0.1.3", "@types/jsonschema": "^1.1.1", "@types/lodash": "^4.14.64", "@types/mocha": "^2.2.41", "@types/node": "^8.0.1", "@types/sinon": "^2.2.2", "@types/uuid": "^3.4.2", + "async-child-process": "^1.1.1", "awesome-typescript-loader": "^3.1.3", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -73,6 +72,7 @@ "opn-cli": "^3.1.0", "request": "^2.81.0", "request-promise-native": "^1.0.4", + "semver-sort": "^0.0.4", "shx": "^0.2.2", "sinon": "^4.0.0", "source-map-support": "^0.5.0", @@ -87,8 +87,8 @@ "webpack": "^3.1.0" }, "dependencies": { - "@0xproject/assert": "^0.0.4", - "@0xproject/json-schemas": "^0.6.7", + "@0xproject/assert": "^0.0.7", + "@0xproject/json-schemas": "^0.6.10", "bignumber.js": "~4.1.0", "bn.js": "4.11.8", "compare-versions": "^3.0.1", diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js new file mode 100644 index 0000000000..c2dffa920c --- /dev/null +++ b/packages/0x.js/scripts/postpublish.js @@ -0,0 +1,32 @@ +const execAsync = require('async-child-process').execAsync; +const semverSort = require('semver-sort'); + +const packagePrefix = '0x.js@'; +const gitTagsCommand = 'git tags -l "' + packagePrefix + '*"'; +let latestTag; +execAsync(gitTagsCommand) + .then(function(result) { + if (result.stderr !== '') { + throw new Error(result.stderr); + } + const tags = result.stdout.trim().split('\n'); + const versions = tags.map(function(tag) { + return tag.slice(packagePrefix.length); + }); + const sortedVersions = semverSort.desc(versions); + latestTag = packagePrefix + sortedVersions[0]; + return execAsync('LATEST_TAG=' + latestTag + ' yarn release'); + }) + .then(function(result) { + if (result.stderr !== '') { + throw new Error(result.stderr); + } + return execAsync('yarn docs:json'); + }) + .then(function(result) { + if (result.stderr !== '') { + throw new Error(result.stderr); + } + const s3Url = 's3://0xjs-docs-jsons/v' + latestTag +'.json'; + return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json'); + }); diff --git a/packages/assert/package.json b/packages/assert/package.json index ed1d2a98bd..96f41e5529 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.0.4", + "version": "0.0.7", "description": "Provides a standard way of performing type and schema validation across 0x projects", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md", "devDependencies": { - "@0xproject/tslint-config": "^0.1.0", + "@0xproject/tslint-config": "^0.1.3", "@types/lodash": "^4.14.78", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -37,7 +37,7 @@ "typescript": "^2.4.2" }, "dependencies": { - "@0xproject/json-schemas": "^0.6.7", + "@0xproject/json-schemas": "^0.6.10", "bignumber.js": "~4.1.0", "ethereum-address": "^0.0.4", "lodash": "^4.17.4", diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 07ed20551c..aa7c5d5d17 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/json-schemas", - "version": "0.6.7", + "version": "0.6.10", "description": "0x-related json schemas", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", @@ -28,7 +28,7 @@ "lodash.values": "^4.3.0" }, "devDependencies": { - "@0xproject/tslint-config": "^0.1.0", + "@0xproject/tslint-config": "^0.1.3", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index ca46d63fce..50adae56f4 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.1.0", + "version": "0.1.3", "description": "Lint rules related to 0xProject for TSLint", "main": "tslint.json", "files": [ diff --git a/yarn.lock b/yarn.lock index d10468fed4..ade8366a0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,25 @@ # yarn lockfile v1 +"0x.js@^0.25.4": + version "0.25.1" + dependencies: + "@0xproject/assert" "^0.0.7" + "@0xproject/json-schemas" "^0.6.10" + bignumber.js "~4.1.0" + bn.js "4.11.8" + compare-versions "^3.0.1" + es6-promisify "^5.0.0" + ethereumjs-abi "^0.6.4" + ethereumjs-blockstream "^2.0.6" + ethereumjs-util "^5.1.1" + find-versions "^2.0.0" + js-sha3 "^0.6.1" + lodash "^4.17.4" + publish-release "^1.3.3" + uuid "^3.1.0" + web3 "^0.20.0" + "@types/fetch-mock@^5.12.1": version "5.12.2" resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-5.12.2.tgz#8c96517ff74303031c65c5da2d99858e34c844d2" @@ -323,6 +342,12 @@ assertion-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" +async-child-process@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/async-child-process/-/async-child-process-1.1.1.tgz#27d0a598b5738707f9898c048bd231340583747b" + dependencies: + babel-runtime "^6.11.6" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -740,7 +765,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -4979,7 +5004,14 @@ semver-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-1.0.0.tgz#92a4969065f9c70c694753d55248fc68f8f652c9" -"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@~5.4.1: +semver-sort@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/semver-sort/-/semver-sort-0.0.4.tgz#34fdbddc6a6b2b4161398c3c4dba56243bfeaa8b" + dependencies: + semver "^5.0.3" + semver-regex "^1.0.0" + +"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" From 6096fe75d338a82a614d663f7c32ada6c6c7574f Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 15 Nov 2017 15:14:30 -0500 Subject: [PATCH 02/22] WIP --- packages/0x.js/package.json | 2 +- packages/0x.js/scripts/postpublish.js | 76 ++++++++++++---- yarn.lock | 121 +++++++++++++++++++++----- 3 files changed, 159 insertions(+), 40 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index e2b19a4408..d09396a843 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,7 +14,6 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "release": "publish-release --assets _bundles/index.js,_bundles/index.min.js --tag $LATEST_TAG --owner 0xProject --repo 0x.js", "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", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", @@ -70,6 +69,7 @@ "npm-run-all": "^4.0.2", "nyc": "^11.0.1", "opn-cli": "^3.1.0", + "prompt": "^1.0.0", "request": "^2.81.0", "request-promise-native": "^1.0.4", "semver-sort": "^0.0.4", diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index c2dffa920c..ff425adbba 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -1,32 +1,72 @@ const execAsync = require('async-child-process').execAsync; const semverSort = require('semver-sort'); +const publishRelease = require('publish-release'); +const promisify = require('es6-promisify'); +const prompt = require('prompt'); -const packagePrefix = '0x.js@'; -const gitTagsCommand = 'git tags -l "' + packagePrefix + '*"'; -let latestTag; -execAsync(gitTagsCommand) +const publishReleaseAsync = promisify(publishRelease); +const promptGetAsync = promisify(prompt.get); +const subPackageName = '0x.js'; +const subPackagePrefix = subPackageName + '@'; +const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; +let tag; + +getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - if (result.stderr !== '') { - throw new Error(result.stderr); - } - const tags = result.stdout.trim().split('\n'); - const versions = tags.map(function(tag) { - return tag.slice(packagePrefix.length); - }); - const sortedVersions = semverSort.desc(versions); - latestTag = packagePrefix + sortedVersions[0]; - return execAsync('LATEST_TAG=' + latestTag + ' yarn release'); + console.log('POSTPUBLISH: Releasing...'); + tag = result.tag; + const releaseName = subPackageName + ' v' + result.version; + return publishReleaseAsync({ + token: githubPersonalAccessToken, + owner: '0xProject', + repo: '0x.js', + tag: tag, + name: releaseName, + notes: 'TODO', + draft: false, + prerelease: false, + reuseRelease: true, + reuseDraftOnly: false, + assets: ['_bundles/index.js', '_bundles/index.min.js'], + }); }) - .then(function(result) { - if (result.stderr !== '') { - throw new Error(result.stderr); + .then(function(err, release) { + if (err !== null) { + throw err; } + console.log('POSTPUBLISH: Release successful, generating docs...'); return execAsync('yarn docs:json'); }) .then(function(result) { if (result.stderr !== '') { throw new Error(result.stderr); } - const s3Url = 's3://0xjs-docs-jsons/v' + latestTag +'.json'; + console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); + const s3Url = 's3://0xjs-docs-jsons/v' + tag +'.json'; return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json'); }); + + // "release": "publish-release --assets _bundles/index.js,_bundles/index.min.js --tag $LATEST_TAG --owner 0xProject --repo 0x.js --notes TODO --name $RELEASE_NAME", + +function getLatestTagAndVersionAsync(subPackageName) { + const subPackagePrefix = subPackageName + '@'; + const gitTagsCommand = 'git tags -l "' + subPackagePrefix + '*"'; + console.log(gitTagsCommand); + return execAsync(gitTagsCommand) + .then(function(result) { + if (result.stderr !== '') { + throw new Error(result.stderr); + } + const tags = result.stdout.trim().split('\n'); + const versions = tags.map(function(tag) { + return tag.slice(subPackagePrefix.length); + }); + const sortedVersions = semverSort.desc(versions); + const latestVersion = sortedVersions[0]; + const latestTag = subPackagePrefix + latestVersion; + return { + tag: latestTag, + version: latestVersion + }; + }); +} diff --git a/yarn.lock b/yarn.lock index ade8366a0f..872a9bb3d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,24 +2,29 @@ # yarn lockfile v1 -"0x.js@^0.25.4": - version "0.25.1" +"@0xproject/assert@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.0.4.tgz#1f9b1de668a5cb2bf7b5ed17af771aee08e87532" dependencies: - "@0xproject/assert" "^0.0.7" - "@0xproject/json-schemas" "^0.6.10" + "@0xproject/json-schemas" "^0.6.7" bignumber.js "~4.1.0" - bn.js "4.11.8" - compare-versions "^3.0.1" - es6-promisify "^5.0.0" - ethereumjs-abi "^0.6.4" - ethereumjs-blockstream "^2.0.6" - ethereumjs-util "^5.1.1" - find-versions "^2.0.0" - js-sha3 "^0.6.1" + ethereum-address "^0.0.4" lodash "^4.17.4" - publish-release "^1.3.3" - uuid "^3.1.0" - web3 "^0.20.0" + valid-url "^1.0.9" + +"@0xproject/json-schemas@0.6.7": + version "0.6.7" + resolved "https://registry.yarnpkg.com/@0xproject/json-schemas/-/json-schemas-0.6.7.tgz#eebd51b92bc40fc7845bee825bded22067bcc6ab" + dependencies: + es6-promisify "^5.0.0" + jsonschema "^1.2.0" + lodash.values "^4.3.0" + +"@0xproject/tslint-config@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@0xproject/tslint-config/-/tslint-config-0.1.0.tgz#238289cb448d942f555ede3b5b1f5eeaaca19e11" + dependencies: + tslint-react "^3.2.0" "@types/fetch-mock@^5.12.1": version "5.12.2" @@ -364,7 +369,7 @@ async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a dependencies: async "^2.4.0" -async@^0.9.0: +async@^0.9.0, async@~0.9.0: version "0.9.2" resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" @@ -378,6 +383,10 @@ async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0: dependencies: lodash "^4.14.0" +async@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1319,6 +1328,10 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +colors@1.0.x: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + colors@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -1657,6 +1670,10 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" +cycle@1.0.x: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" + d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" @@ -1720,6 +1737,10 @@ deep-eql@^3.0.0: dependencies: type-detect "^4.0.0" +deep-equal@~0.2.1: + version "0.2.2" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" + deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2306,6 +2327,10 @@ extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" +eyes@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + fake-merkle-patricia-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" @@ -2896,6 +2921,10 @@ hyperquest@~1.2.0: duplexer2 "~0.0.2" through2 "~0.6.3" +i@0.3.x: + version "0.3.6" + resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" + iconv-lite@^0.4.17, iconv-lite@~0.4.13: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -3232,7 +3261,7 @@ isomorphic-fetch@^2.2.0, isomorphic-fetch@^2.2.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" -isstream@~0.1.2: +isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -3891,7 +3920,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^0.1.1" -mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@0.5.1, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3952,6 +3981,10 @@ nanomatch@^1.2.5: snapdragon "^0.8.1" to-regex "^3.0.1" +ncp@1.0.x: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" + nise@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/nise/-/nise-1.2.0.tgz#079d6cadbbcb12ba30e38f1c999f36ad4d6baa53" @@ -4421,10 +4454,14 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" -pkginfo@^0.3.0: +pkginfo@0.3.x, pkginfo@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" +pkginfo@0.x.x: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -4497,6 +4534,17 @@ promise-to-callback@^1.0.0: is-fn "^1.0.0" set-immediate-shim "^1.0.1" +prompt@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" + dependencies: + colors "^1.1.2" + pkginfo "0.x.x" + read "1.0.x" + revalidator "0.1.x" + utile "0.3.x" + winston "2.1.x" + prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" @@ -4659,7 +4707,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -read@~1.0.5: +read@1.0.x, read@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" dependencies: @@ -4908,13 +4956,17 @@ resumer@~0.0.0: dependencies: through "~2.3.4" +revalidator@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -5311,6 +5363,10 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +stack-trace@0.0.x: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -5891,6 +5947,17 @@ util@0.10.3, util@^0.10.3: dependencies: inherits "2.0.1" +utile@0.3.x: + version "0.3.0" + resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" + dependencies: + async "~0.9.0" + deep-equal "~0.2.1" + i "0.3.x" + mkdirp "0.x.x" + ncp "1.0.x" + rimraf "2.x.x" + uuid@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -6095,6 +6162,18 @@ window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" +winston@2.1.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" + dependencies: + async "~1.0.0" + colors "1.0.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + pkginfo "0.3.x" + stack-trace "0.0.x" + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" From 827c2457772bd2203307d87f864214c370383807 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 15 Nov 2017 16:19:33 -0500 Subject: [PATCH 03/22] postpublish script fixes --- packages/0x.js/scripts/postpublish.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index ff425adbba..deedee74c8 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -10,12 +10,13 @@ const subPackageName = '0x.js'; const subPackagePrefix = subPackageName + '@'; const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; let tag; - +let version; getLatestTagAndVersionAsync(subPackageName) .then(function(result) { console.log('POSTPUBLISH: Releasing...'); tag = result.tag; - const releaseName = subPackageName + ' v' + result.version; + version = result.version; + const releaseName = subPackageName + ' v' + result.version; return publishReleaseAsync({ token: githubPersonalAccessToken, owner: '0xProject', @@ -30,24 +31,19 @@ getLatestTagAndVersionAsync(subPackageName) assets: ['_bundles/index.js', '_bundles/index.min.js'], }); }) - .then(function(err, release) { - if (err !== null) { - throw err; - } - console.log('POSTPUBLISH: Release successful, generating docs...'); - return execAsync('yarn docs:json'); + .then(function(release) { + console.log('POSTPUBLISH: Release successful, generating docs...'); + return execAsync('yarn docs:json'); }) .then(function(result) { if (result.stderr !== '') { throw new Error(result.stderr); } - console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); - const s3Url = 's3://0xjs-docs-jsons/v' + tag +'.json'; - return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json'); + console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); + const s3Url = 's3://0xjs-docs-jsons/v' + version +'.json'; + return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json'); }); - // "release": "publish-release --assets _bundles/index.js,_bundles/index.min.js --tag $LATEST_TAG --owner 0xProject --repo 0x.js --notes TODO --name $RELEASE_NAME", - function getLatestTagAndVersionAsync(subPackageName) { const subPackagePrefix = subPackageName + '@'; const gitTagsCommand = 'git tags -l "' + subPackagePrefix + '*"'; From 9a57f71ee6fd7aef73811c18e71179e5dc94a417 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 15 Nov 2017 16:47:35 -0500 Subject: [PATCH 04/22] improve script --- packages/0x.js/package.json | 6 +----- packages/0x.js/scripts/postpublish.js | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index d09396a843..61039a8c03 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,7 +14,6 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "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", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test": "run-s clean test:commonjs", @@ -22,9 +21,6 @@ "test:coverage": "nyc npm run test --all", "report_test_coverage": "nyc report --reporter=text-lcov | coveralls", "update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json docs/index.json .", - "docs:generate": "typedoc --out docs .", - "docs:open": "opn docs/index.html", "clean": "shx rm -rf _bundles lib test_temp", "build:umd:dev": "webpack", "build:umd:prod": "NODE_ENV=production webpack", @@ -99,7 +95,7 @@ "find-versions": "^2.0.0", "js-sha3": "^0.6.1", "lodash": "^4.17.4", - "publish-release": "^1.3.3", + "publish-release": "0xproject/publish-release", "uuid": "^3.1.0", "web3": "^0.20.0" } diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index deedee74c8..b30c7eb3e1 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -28,12 +28,12 @@ getLatestTagAndVersionAsync(subPackageName) prerelease: false, reuseRelease: true, reuseDraftOnly: false, - assets: ['_bundles/index.js', '_bundles/index.min.js'], + assets: [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'], }); }) .then(function(release) { console.log('POSTPUBLISH: Release successful, generating docs...'); - return execAsync('yarn docs:json'); + return execAsync('typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..'); }) .then(function(result) { if (result.stderr !== '') { @@ -41,13 +41,12 @@ getLatestTagAndVersionAsync(subPackageName) } console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); const s3Url = 's3://0xjs-docs-jsons/v' + version +'.json'; - return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json'); + return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); }); function getLatestTagAndVersionAsync(subPackageName) { const subPackagePrefix = subPackageName + '@'; const gitTagsCommand = 'git tags -l "' + subPackagePrefix + '*"'; - console.log(gitTagsCommand); return execAsync(gitTagsCommand) .then(function(result) { if (result.stderr !== '') { From 1e5cc3b0e53aeb606140d0f735652aa464c2a4e7 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 15 Nov 2017 18:17:41 -0500 Subject: [PATCH 05/22] experiment with calling typedoc programatically --- packages/0x.js/scripts/postpublish.js | 24 ++++++++++++++++++++---- yarn.lock | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index b30c7eb3e1..d68fd8fa01 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -2,12 +2,10 @@ const execAsync = require('async-child-process').execAsync; const semverSort = require('semver-sort'); const publishRelease = require('publish-release'); const promisify = require('es6-promisify'); -const prompt = require('prompt'); +const typedoc = require('typedoc'); const publishReleaseAsync = promisify(publishRelease); -const promptGetAsync = promisify(prompt.get); const subPackageName = '0x.js'; -const subPackagePrefix = subPackageName + '@'; const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; let tag; let version; @@ -33,7 +31,23 @@ getLatestTagAndVersionAsync(subPackageName) }) .then(function(release) { console.log('POSTPUBLISH: Release successful, generating docs...'); - return execAsync('typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..'); + + // const rootDir = __dirname + '/../src/index.ts'; + // const typedocApp = new typedoc.Application({ + // excludePrivate: true, + // excludeExternals: true, + // target: 'ES5', + // }); + + // console.log(typedocApp.options); + // typedocApp.options.setValue('excludePrivate', true); + // typedocApp.options.setValue('excludeExternals', true); + // typedocApp.options.setValue('json', true); + // typedocApp.options.setValue('target', 'ES5'); + + + // return typedocApp.generateDocs([rootDir], __dirname + '/../docs/index.json'); + return execAsync('yarn typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..'); }) .then(function(result) { if (result.stderr !== '') { @@ -42,6 +56,8 @@ getLatestTagAndVersionAsync(subPackageName) console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); const s3Url = 's3://0xjs-docs-jsons/v' + version +'.json'; return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); + }).catch (function(error) { + throw error; }); function getLatestTagAndVersionAsync(subPackageName) { diff --git a/yarn.lock b/yarn.lock index 872a9bb3d6..1ea31d3a1b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4573,9 +4573,9 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -publish-release@^1.3.3: +publish-release@0xproject/publish-release: version "1.3.3" - resolved "https://registry.yarnpkg.com/publish-release/-/publish-release-1.3.3.tgz#6cd11df835e14c13b0e08a35d3fb992b918bec3c" + resolved "https://codeload.github.com/0xproject/publish-release/tar.gz/c67c546726deecabd0cb35f9873afc912f862bd3" dependencies: async "^0.9.0" ghauth "^2.0.0" From 7b61ad639b7410c9157e340a422b431b25dc620d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 12:23:27 -0500 Subject: [PATCH 06/22] small fixes --- packages/0x.js/scripts/postpublish.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index d68fd8fa01..e8ca99db9c 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -7,6 +7,7 @@ const typedoc = require('typedoc'); const publishReleaseAsync = promisify(publishRelease); const subPackageName = '0x.js'; const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; + let tag; let version; getLatestTagAndVersionAsync(subPackageName) @@ -32,20 +33,6 @@ getLatestTagAndVersionAsync(subPackageName) .then(function(release) { console.log('POSTPUBLISH: Release successful, generating docs...'); - // const rootDir = __dirname + '/../src/index.ts'; - // const typedocApp = new typedoc.Application({ - // excludePrivate: true, - // excludeExternals: true, - // target: 'ES5', - // }); - - // console.log(typedocApp.options); - // typedocApp.options.setValue('excludePrivate', true); - // typedocApp.options.setValue('excludeExternals', true); - // typedocApp.options.setValue('json', true); - // typedocApp.options.setValue('target', 'ES5'); - - // return typedocApp.generateDocs([rootDir], __dirname + '/../docs/index.json'); return execAsync('yarn typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..'); }) @@ -56,8 +43,8 @@ getLatestTagAndVersionAsync(subPackageName) console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); const s3Url = 's3://0xjs-docs-jsons/v' + version +'.json'; return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); - }).catch (function(error) { - throw error; + }).catch (function(err) { + throw err; }); function getLatestTagAndVersionAsync(subPackageName) { From 2e368b50ebb8080bad46412fcf8defbc34eabcef Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:24:15 -0500 Subject: [PATCH 07/22] print out file name in console --- packages/0x.js/scripts/postpublish.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index e8ca99db9c..519973f616 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -40,8 +40,9 @@ getLatestTagAndVersionAsync(subPackageName) if (result.stderr !== '') { throw new Error(result.stderr); } - console.log('POSTPUBLISH: Doc generation successful, uploading docs...'); - const s3Url = 's3://0xjs-docs-jsons/v' + version +'.json'; + const fileName = 'v' + version + '.json'; + console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName); + const s3Url = 's3://0xjs-docs-jsons/' + fileName; return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); }).catch (function(err) { throw err; From 50dc1d3db34c061fe6836273c1b80bc450b04d69 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:24:36 -0500 Subject: [PATCH 08/22] specify the current working directory in which to run the `yarn` command --- packages/0x.js/scripts/postpublish.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 519973f616..3f0502c64f 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -34,7 +34,12 @@ getLatestTagAndVersionAsync(subPackageName) console.log('POSTPUBLISH: Release successful, generating docs...'); // return typedocApp.generateDocs([rootDir], __dirname + '/../docs/index.json'); - return execAsync('yarn typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..'); + return execAsync( + 'yarn typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..', + { + cwd: __dirname + '/..', + } + ); }) .then(function(result) { if (result.stderr !== '') { From 2c055db0d702692d29c746fb60832ad88c04d90d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:24:49 -0500 Subject: [PATCH 09/22] update yarn.lock --- yarn.lock | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1ea31d3a1b..037c39ddf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,8 +31,8 @@ resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-5.12.2.tgz#8c96517ff74303031c65c5da2d99858e34c844d2" "@types/fs-extra@^4.0.0": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.4.tgz#72947e108f2cbeda5ab288a927399fdf6d02bd42" + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.5.tgz#8aa6033c0e87c653b09a6711686916864b48ec9e" dependencies: "@types/node" "*" @@ -77,7 +77,11 @@ version "0.0.28" resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.0.28.tgz#44ba754e9fa51432583e8eb30a7c4dd249b52faa" -"@types/minimatch@*", "@types/minimatch@^2.0.29": +"@types/minimatch@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.1.tgz#b683eb60be358304ef146f5775db4c0e3696a550" + +"@types/minimatch@^2.0.29": version "2.0.29" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" @@ -94,8 +98,8 @@ resolved "https://registry.yarnpkg.com/@types/query-string/-/query-string-5.0.1.tgz#6cb41c724cb1644d56c2d1dae7c7b204e706b39e" "@types/shelljs@^0.7.0": - version "0.7.5" - resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.5.tgz#5834fb7385d1137bd2be5842f2c278ac36a117f4" + version "0.7.6" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.6.tgz#4ac7ca01c191ba65b8e2bf50543c5560084d8d27" dependencies: "@types/glob" "*" "@types/node" "*" From e70c3976db61bfe2038b0d56ea196412215aae4f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:30:26 -0500 Subject: [PATCH 10/22] Use `yarn docs:json` command --- packages/0x.js/package.json | 1 + packages/0x.js/scripts/postpublish.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 61039a8c03..10ace55294 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,6 +14,7 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $1 $2", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test": "run-s clean test:commonjs", diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 3f0502c64f..1ec0ac2581 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -28,14 +28,13 @@ getLatestTagAndVersionAsync(subPackageName) reuseRelease: true, reuseDraftOnly: false, assets: [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'], - }); + }); }) .then(function(release) { console.log('POSTPUBLISH: Release successful, generating docs...'); - // return typedocApp.generateDocs([rootDir], __dirname + '/../docs/index.json'); return execAsync( - 'yarn typedoc --excludePrivate --excludeExternals --target ES5 --json ' + __dirname + '/../docs/index.json ' + __dirname + '/..', + 'yarn docs:json ' + __dirname + '/../docs/index.json ' + __dirname + '/..', { cwd: __dirname + '/..', } From 0402d3de802ba262bb820d582baa157ca9c8ba54 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:19:12 -0600 Subject: [PATCH 11/22] Move upload_docs_json back to npm script and pass in vars properly. --- packages/0x.js/package.json | 3 ++- packages/0x.js/scripts/postpublish.js | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 10ace55294..e1f0bb93ef 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,7 +14,8 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $1 $2", + "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", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test": "run-s clean test:commonjs", diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 1ec0ac2581..b9fe0bc9ae 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -4,6 +4,7 @@ const publishRelease = require('publish-release'); const promisify = require('es6-promisify'); const typedoc = require('typedoc'); +const cwd = __dirname + '/..'; const publishReleaseAsync = promisify(publishRelease); const subPackageName = '0x.js'; const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; @@ -34,9 +35,9 @@ getLatestTagAndVersionAsync(subPackageName) console.log('POSTPUBLISH: Release successful, generating docs...'); return execAsync( - 'yarn docs:json ' + __dirname + '/../docs/index.json ' + __dirname + '/..', + 'JSON_FILE_PATH=' + __dirname + '/../docs/index.json PROJECT_DIR=' + __dirname + '/.. yarn docs:json', { - cwd: __dirname + '/..', + cwd, } ); }) @@ -47,7 +48,9 @@ getLatestTagAndVersionAsync(subPackageName) const fileName = 'v' + version + '.json'; console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName); const s3Url = 's3://0xjs-docs-jsons/' + fileName; - return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); + return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', { + cwd, + }); }).catch (function(err) { throw err; }); From f25b2d9ab9bfc9410e17d1ee7a4bf0074aaa622c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 13:19:33 -0600 Subject: [PATCH 12/22] Set prerelease to true so that non of the releases are marked as "latest" --- packages/0x.js/scripts/postpublish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index b9fe0bc9ae..4512fb24c5 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -25,7 +25,7 @@ getLatestTagAndVersionAsync(subPackageName) name: releaseName, notes: 'TODO', draft: false, - prerelease: false, + prerelease: true, reuseRelease: true, reuseDraftOnly: false, assets: [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'], From 5277d4a2666a795d01b7d3d4d018ca6d0e42399f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:09:48 -0600 Subject: [PATCH 13/22] Move most of code for getting latest tag/version and calling publish_release to postpublish_utils script in top-level dir --- package.json | 6 +++- packages/0x.js/package.json | 3 -- packages/0x.js/scripts/postpublish.js | 52 +++++---------------------- scripts/postpublish_utils.js | 47 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 scripts/postpublish_utils.js diff --git a/package.json b/package.json index baccee6b4b..265e0459eb 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,10 @@ "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic" }, "devDependencies": { - "lerna": "^2.5.1" + "lerna": "^2.5.1", + "async-child-process": "^1.1.1", + "semver-sort": "^0.0.4", + "publish-release": "0xproject/publish-release", + "es6-promisify": "^5.0.0" } } diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index e1f0bb93ef..c381d38980 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -70,7 +70,6 @@ "prompt": "^1.0.0", "request": "^2.81.0", "request-promise-native": "^1.0.4", - "semver-sort": "^0.0.4", "shx": "^0.2.2", "sinon": "^4.0.0", "source-map-support": "^0.5.0", @@ -90,14 +89,12 @@ "bignumber.js": "~4.1.0", "bn.js": "4.11.8", "compare-versions": "^3.0.1", - "es6-promisify": "^5.0.0", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "find-versions": "^2.0.0", "js-sha3": "^0.6.1", "lodash": "^4.17.4", - "publish-release": "0xproject/publish-release", "uuid": "^3.1.0", "web3": "^0.20.0" } diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 4512fb24c5..e68302b33a 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -1,39 +1,25 @@ const execAsync = require('async-child-process').execAsync; -const semverSort = require('semver-sort'); -const publishRelease = require('publish-release'); -const promisify = require('es6-promisify'); -const typedoc = require('typedoc'); +const postpublish_utils = require('../../../scripts/postpublish_utils'); const cwd = __dirname + '/..'; -const publishReleaseAsync = promisify(publishRelease); const subPackageName = '0x.js'; -const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; let tag; let version; -getLatestTagAndVersionAsync(subPackageName) +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { console.log('POSTPUBLISH: Releasing...'); tag = result.tag; version = result.version; - const releaseName = subPackageName + ' v' + result.version; - return publishReleaseAsync({ - token: githubPersonalAccessToken, - owner: '0xProject', - repo: '0x.js', - tag: tag, - name: releaseName, - notes: 'TODO', - draft: false, - prerelease: true, - reuseRelease: true, - reuseDraftOnly: false, - assets: [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'], - }); + const releaseName = subPackageName + ' v' + version; + const assets = [ + __dirname + '/../_bundles/index.js', + __dirname + '/../_bundles/index.min.js', + ]; + return postpublish_utils.publishReleaseNotes(tag, releaseName, assets); }) .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', { @@ -54,25 +40,3 @@ getLatestTagAndVersionAsync(subPackageName) }).catch (function(err) { throw err; }); - -function getLatestTagAndVersionAsync(subPackageName) { - const subPackagePrefix = subPackageName + '@'; - const gitTagsCommand = 'git tags -l "' + subPackagePrefix + '*"'; - return execAsync(gitTagsCommand) - .then(function(result) { - if (result.stderr !== '') { - throw new Error(result.stderr); - } - const tags = result.stdout.trim().split('\n'); - const versions = tags.map(function(tag) { - return tag.slice(subPackagePrefix.length); - }); - const sortedVersions = semverSort.desc(versions); - const latestVersion = sortedVersions[0]; - const latestTag = subPackagePrefix + latestVersion; - return { - tag: latestTag, - version: latestVersion - }; - }); -} diff --git a/scripts/postpublish_utils.js b/scripts/postpublish_utils.js new file mode 100644 index 0000000000..6b7be4f0e2 --- /dev/null +++ b/scripts/postpublish_utils.js @@ -0,0 +1,47 @@ +const execAsync = require('async-child-process').execAsync; +const semverSort = require('semver-sort'); +const promisify = require('es6-promisify'); +const publishRelease = require('publish-release'); + +const publishReleaseAsync = promisify(publishRelease); +const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; + +module.exports = { + getLatestTagAndVersionAsync: function(subPackageName) { + const subPackagePrefix = subPackageName + '@'; + const gitTagsCommand = 'git tags -l "' + subPackagePrefix + '*"'; + return execAsync(gitTagsCommand) + .then(function(result) { + if (result.stderr !== '') { + throw new Error(result.stderr); + } + const tags = result.stdout.trim().split('\n'); + const versions = tags.map(function(tag) { + return tag.slice(subPackagePrefix.length); + }); + const sortedVersions = semverSort.desc(versions); + const latestVersion = sortedVersions[0]; + const latestTag = subPackagePrefix + latestVersion; + return { + tag: latestTag, + version: latestVersion + }; + }); + }, + publishReleaseNotes: function(tag, releaseName, assets) { + console.log('POSTPUBLISH: Releasing ', releaseName, '...'); + return publishReleaseAsync({ + token: githubPersonalAccessToken, + owner: '0xProject', + repo: '0x.js', + tag: tag, + name: releaseName, + notes: 'TODO', + draft: false, + prerelease: false, + reuseRelease: true, + reuseDraftOnly: false, + assets: assets, + }); + }, +}; From 5015f2d7d75974a5ce950e8f05d6a5ab481c488a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:10:18 -0600 Subject: [PATCH 14/22] Add postpublish scripts for all the subpackages so that they each publish a release to github --- packages/assert/scripts/postpublish.js | 13 +++++++++++++ packages/connect/scripts/postpublish.js | 13 +++++++++++++ packages/json-schemas/scripts/postpublish.js | 13 +++++++++++++ packages/tslint-config/scripts/postpublish.js | 13 +++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 packages/assert/scripts/postpublish.js create mode 100644 packages/connect/scripts/postpublish.js create mode 100644 packages/json-schemas/scripts/postpublish.js create mode 100644 packages/tslint-config/scripts/postpublish.js diff --git a/packages/assert/scripts/postpublish.js b/packages/assert/scripts/postpublish.js new file mode 100644 index 0000000000..b583155d2a --- /dev/null +++ b/packages/assert/scripts/postpublish.js @@ -0,0 +1,13 @@ +const postpublish_utils = require('../../../scripts/postpublish_utils'); + +const subPackageName = '0xproject/assert'; + +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = subPackageName + ' v' + result.version; + const assets = []; + return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); + }) + .catch (function(err) { + throw err; + }); diff --git a/packages/connect/scripts/postpublish.js b/packages/connect/scripts/postpublish.js new file mode 100644 index 0000000000..4323ed5c76 --- /dev/null +++ b/packages/connect/scripts/postpublish.js @@ -0,0 +1,13 @@ +const postpublish_utils = require('../../../scripts/postpublish_utils'); + +const subPackageName = '0xproject/connect'; + +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = subPackageName + ' v' + result.version; + const assets = []; + return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); + }) + .catch (function(err) { + throw err; + }); diff --git a/packages/json-schemas/scripts/postpublish.js b/packages/json-schemas/scripts/postpublish.js new file mode 100644 index 0000000000..8930521f10 --- /dev/null +++ b/packages/json-schemas/scripts/postpublish.js @@ -0,0 +1,13 @@ +const postpublish_utils = require('../../../scripts/postpublish_utils'); + +const subPackageName = '0xproject/json-schemas'; + +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = subPackageName + ' v' + result.version; + const assets = []; + return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); + }) + .catch (function(err) { + throw err; + }); diff --git a/packages/tslint-config/scripts/postpublish.js b/packages/tslint-config/scripts/postpublish.js new file mode 100644 index 0000000000..c6e1b36300 --- /dev/null +++ b/packages/tslint-config/scripts/postpublish.js @@ -0,0 +1,13 @@ +const postpublish_utils = require('../../../scripts/postpublish_utils'); + +const subPackageName = '0xproject/tslint-config'; + +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = subPackageName + ' v' + result.version; + const assets = []; + return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); + }) + .catch (function(err) { + throw err; + }); From cd0f6716e817a8b123d2b5203ea838ecf3a5e8d4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:33:28 -0600 Subject: [PATCH 15/22] remove unused imports --- packages/0x.js/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index c381d38980..341df882b6 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -51,7 +51,6 @@ "@types/node": "^8.0.1", "@types/sinon": "^2.2.2", "@types/uuid": "^3.4.2", - "async-child-process": "^1.1.1", "awesome-typescript-loader": "^3.1.3", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -67,7 +66,6 @@ "npm-run-all": "^4.0.2", "nyc": "^11.0.1", "opn-cli": "^3.1.0", - "prompt": "^1.0.0", "request": "^2.81.0", "request-promise-native": "^1.0.4", "shx": "^0.2.2", From 70f4453e3eb2818c883862f609885e077b6bc631 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:33:43 -0600 Subject: [PATCH 16/22] Get package name from package.json --- packages/0x.js/scripts/postpublish.js | 3 ++- packages/assert/scripts/postpublish.js | 3 ++- packages/connect/scripts/postpublish.js | 3 ++- packages/json-schemas/scripts/postpublish.js | 3 ++- packages/tslint-config/scripts/postpublish.js | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index e68302b33a..bf4c630323 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -1,8 +1,9 @@ const execAsync = require('async-child-process').execAsync; const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); const cwd = __dirname + '/..'; -const subPackageName = '0x.js'; +const subPackageName = packageJSON.name; let tag; let version; diff --git a/packages/assert/scripts/postpublish.js b/packages/assert/scripts/postpublish.js index b583155d2a..08458f038f 100644 --- a/packages/assert/scripts/postpublish.js +++ b/packages/assert/scripts/postpublish.js @@ -1,6 +1,7 @@ const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); -const subPackageName = '0xproject/assert'; +const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { diff --git a/packages/connect/scripts/postpublish.js b/packages/connect/scripts/postpublish.js index 4323ed5c76..08458f038f 100644 --- a/packages/connect/scripts/postpublish.js +++ b/packages/connect/scripts/postpublish.js @@ -1,6 +1,7 @@ const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); -const subPackageName = '0xproject/connect'; +const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { diff --git a/packages/json-schemas/scripts/postpublish.js b/packages/json-schemas/scripts/postpublish.js index 8930521f10..08458f038f 100644 --- a/packages/json-schemas/scripts/postpublish.js +++ b/packages/json-schemas/scripts/postpublish.js @@ -1,6 +1,7 @@ const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); -const subPackageName = '0xproject/json-schemas'; +const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { diff --git a/packages/tslint-config/scripts/postpublish.js b/packages/tslint-config/scripts/postpublish.js index c6e1b36300..08458f038f 100644 --- a/packages/tslint-config/scripts/postpublish.js +++ b/packages/tslint-config/scripts/postpublish.js @@ -1,6 +1,7 @@ const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); -const subPackageName = '0xproject/tslint-config'; +const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { From 6a83687f45db37cbb8bdb24a7bb090094a6cae08 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:44:44 -0600 Subject: [PATCH 17/22] reset all sub-package versions to latest actually published --- packages/0x.js/package.json | 6 +++--- packages/assert/package.json | 6 +++--- packages/json-schemas/package.json | 4 ++-- packages/tslint-config/package.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 341df882b6..8278a96f6b 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -44,7 +44,7 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/tslint-config": "^0.1.3", + "@0xproject/tslint-config": "^0.1.0", "@types/jsonschema": "^1.1.1", "@types/lodash": "^4.14.64", "@types/mocha": "^2.2.41", @@ -82,8 +82,8 @@ "webpack": "^3.1.0" }, "dependencies": { - "@0xproject/assert": "^0.0.7", - "@0xproject/json-schemas": "^0.6.10", + "@0xproject/assert": "^0.0.4", + "@0xproject/json-schemas": "^0.6.7", "bignumber.js": "~4.1.0", "bn.js": "4.11.8", "compare-versions": "^3.0.1", diff --git a/packages/assert/package.json b/packages/assert/package.json index 96f41e5529..ed1d2a98bd 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.0.7", + "version": "0.0.4", "description": "Provides a standard way of performing type and schema validation across 0x projects", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md", "devDependencies": { - "@0xproject/tslint-config": "^0.1.3", + "@0xproject/tslint-config": "^0.1.0", "@types/lodash": "^4.14.78", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -37,7 +37,7 @@ "typescript": "^2.4.2" }, "dependencies": { - "@0xproject/json-schemas": "^0.6.10", + "@0xproject/json-schemas": "^0.6.7", "bignumber.js": "~4.1.0", "ethereum-address": "^0.0.4", "lodash": "^4.17.4", diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index aa7c5d5d17..07ed20551c 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/json-schemas", - "version": "0.6.10", + "version": "0.6.7", "description": "0x-related json schemas", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", @@ -28,7 +28,7 @@ "lodash.values": "^4.3.0" }, "devDependencies": { - "@0xproject/tslint-config": "^0.1.3", + "@0xproject/tslint-config": "^0.1.0", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 50adae56f4..ca46d63fce 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.1.3", + "version": "0.1.0", "description": "Lint rules related to 0xProject for TSLint", "main": "tslint.json", "files": [ From 49ba456189bf43149a9f58aa01ecd820baa52082 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 14:49:46 -0600 Subject: [PATCH 18/22] Set S3 bucket path to variable --- packages/0x.js/scripts/postpublish.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index bf4c630323..3756b89844 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -4,6 +4,7 @@ const packageJSON = require('../package.json'); const cwd = __dirname + '/..'; const subPackageName = packageJSON.name; +const S3BucketPath = 's3://0xjs-docs-jsons/', let tag; let version; @@ -34,7 +35,7 @@ postpublish_utils.getLatestTagAndVersionAsync(subPackageName) } const fileName = 'v' + version + '.json'; console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName); - const s3Url = 's3://0xjs-docs-jsons/' + fileName; + const s3Url = S3BucketPath + fileName; return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', { cwd, }); From abee7d25a4e9bee81fa76d6bc0da31488aed16bc Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 16:43:15 -0600 Subject: [PATCH 19/22] Add back promisify --- packages/0x.js/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 8278a96f6b..7aa360954f 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -87,6 +87,7 @@ "bignumber.js": "~4.1.0", "bn.js": "4.11.8", "compare-versions": "^3.0.1", + "es6-promisify": "^5.0.0", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", From 7f595169c1bc02873d47a5b7411dfb7414c19041 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 16:44:56 -0600 Subject: [PATCH 20/22] Put release name generation into postpublish_utils --- packages/0x.js/scripts/postpublish.js | 3 +-- packages/assert/scripts/postpublish.js | 2 +- packages/connect/scripts/postpublish.js | 2 +- packages/json-schemas/scripts/postpublish.js | 2 +- packages/tslint-config/scripts/postpublish.js | 2 +- scripts/postpublish_utils.js | 3 +++ 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 3756b89844..d2ae86bbd5 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -10,10 +10,9 @@ let tag; let version; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - console.log('POSTPUBLISH: Releasing...'); tag = result.tag; version = result.version; - const releaseName = subPackageName + ' v' + version; + const releaseName = postpublish_utils.getReleaseName(subPackageName, version); const assets = [ __dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js', diff --git a/packages/assert/scripts/postpublish.js b/packages/assert/scripts/postpublish.js index 08458f038f..7fa452b081 100644 --- a/packages/assert/scripts/postpublish.js +++ b/packages/assert/scripts/postpublish.js @@ -5,7 +5,7 @@ const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - const releaseName = subPackageName + ' v' + result.version; + const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const assets = []; return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); }) diff --git a/packages/connect/scripts/postpublish.js b/packages/connect/scripts/postpublish.js index 08458f038f..7fa452b081 100644 --- a/packages/connect/scripts/postpublish.js +++ b/packages/connect/scripts/postpublish.js @@ -5,7 +5,7 @@ const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - const releaseName = subPackageName + ' v' + result.version; + const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const assets = []; return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); }) diff --git a/packages/json-schemas/scripts/postpublish.js b/packages/json-schemas/scripts/postpublish.js index 08458f038f..7fa452b081 100644 --- a/packages/json-schemas/scripts/postpublish.js +++ b/packages/json-schemas/scripts/postpublish.js @@ -5,7 +5,7 @@ const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - const releaseName = subPackageName + ' v' + result.version; + const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const assets = []; return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); }) diff --git a/packages/tslint-config/scripts/postpublish.js b/packages/tslint-config/scripts/postpublish.js index 08458f038f..7fa452b081 100644 --- a/packages/tslint-config/scripts/postpublish.js +++ b/packages/tslint-config/scripts/postpublish.js @@ -5,7 +5,7 @@ const subPackageName = packageJSON.name; postpublish_utils.getLatestTagAndVersionAsync(subPackageName) .then(function(result) { - const releaseName = subPackageName + ' v' + result.version; + const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const assets = []; return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); }) diff --git a/scripts/postpublish_utils.js b/scripts/postpublish_utils.js index 6b7be4f0e2..4c9882fa89 100644 --- a/scripts/postpublish_utils.js +++ b/scripts/postpublish_utils.js @@ -44,4 +44,7 @@ module.exports = { assets: assets, }); }, + getReleaseName(subPackageName, version) { + const releaseName = subPackageName + ' v' + version; + }, }; From a4ae3c1e14e735382422be3f3f08b13a6a4c9af3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 16:50:14 -0600 Subject: [PATCH 21/22] Updated yarn.lock --- yarn.lock | 110 +++--------------------------------------------------- 1 file changed, 6 insertions(+), 104 deletions(-) diff --git a/yarn.lock b/yarn.lock index 037c39ddf9..6bc4ccf1b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,30 +2,6 @@ # yarn lockfile v1 -"@0xproject/assert@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.0.4.tgz#1f9b1de668a5cb2bf7b5ed17af771aee08e87532" - dependencies: - "@0xproject/json-schemas" "^0.6.7" - bignumber.js "~4.1.0" - ethereum-address "^0.0.4" - lodash "^4.17.4" - valid-url "^1.0.9" - -"@0xproject/json-schemas@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@0xproject/json-schemas/-/json-schemas-0.6.7.tgz#eebd51b92bc40fc7845bee825bded22067bcc6ab" - dependencies: - es6-promisify "^5.0.0" - jsonschema "^1.2.0" - lodash.values "^4.3.0" - -"@0xproject/tslint-config@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@0xproject/tslint-config/-/tslint-config-0.1.0.tgz#238289cb448d942f555ede3b5b1f5eeaaca19e11" - dependencies: - tslint-react "^3.2.0" - "@types/fetch-mock@^5.12.1": version "5.12.2" resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-5.12.2.tgz#8c96517ff74303031c65c5da2d99858e34c844d2" @@ -373,7 +349,7 @@ async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a dependencies: async "^2.4.0" -async@^0.9.0, async@~0.9.0: +async@^0.9.0: version "0.9.2" resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" @@ -387,10 +363,6 @@ async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0: dependencies: lodash "^4.14.0" -async@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1332,10 +1304,6 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -colors@1.0.x: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - colors@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -1674,10 +1642,6 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -cycle@1.0.x: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" - d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" @@ -1741,10 +1705,6 @@ deep-eql@^3.0.0: dependencies: type-detect "^4.0.0" -deep-equal@~0.2.1: - version "0.2.2" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.2.2.tgz#84b745896f34c684e98f2ce0e42abaf43bba017d" - deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2331,10 +2291,6 @@ extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" -eyes@0.1.x: - version "0.1.8" - resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - fake-merkle-patricia-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" @@ -2925,10 +2881,6 @@ hyperquest@~1.2.0: duplexer2 "~0.0.2" through2 "~0.6.3" -i@0.3.x: - version "0.3.6" - resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" - iconv-lite@^0.4.17, iconv-lite@~0.4.13: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -3265,7 +3217,7 @@ isomorphic-fetch@^2.2.0, isomorphic-fetch@^2.2.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" -isstream@0.1.x, isstream@~0.1.2: +isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -3924,7 +3876,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^0.1.1" -mkdirp@0.5.1, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3985,10 +3937,6 @@ nanomatch@^1.2.5: snapdragon "^0.8.1" to-regex "^3.0.1" -ncp@1.0.x: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ncp/-/ncp-1.0.1.tgz#d15367e5cb87432ba117d2bf80fdf45aecfb4246" - nise@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/nise/-/nise-1.2.0.tgz#079d6cadbbcb12ba30e38f1c999f36ad4d6baa53" @@ -4458,14 +4406,10 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" -pkginfo@0.3.x, pkginfo@^0.3.0: +pkginfo@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" -pkginfo@0.x.x: - version "0.4.1" - resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -4538,17 +4482,6 @@ promise-to-callback@^1.0.0: is-fn "^1.0.0" set-immediate-shim "^1.0.1" -prompt@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe" - dependencies: - colors "^1.1.2" - pkginfo "0.x.x" - read "1.0.x" - revalidator "0.1.x" - utile "0.3.x" - winston "2.1.x" - prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" @@ -4711,7 +4644,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -read@1.0.x, read@~1.0.5: +read@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" dependencies: @@ -4960,17 +4893,13 @@ resumer@~0.0.0: dependencies: through "~2.3.4" -revalidator@0.1.x: - version "0.1.8" - resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" - right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -5367,10 +5296,6 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -stack-trace@0.0.x: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -5951,17 +5876,6 @@ util@0.10.3, util@^0.10.3: dependencies: inherits "2.0.1" -utile@0.3.x: - version "0.3.0" - resolved "https://registry.yarnpkg.com/utile/-/utile-0.3.0.tgz#1352c340eb820e4d8ddba039a4fbfaa32ed4ef3a" - dependencies: - async "~0.9.0" - deep-equal "~0.2.1" - i "0.3.x" - mkdirp "0.x.x" - ncp "1.0.x" - rimraf "2.x.x" - uuid@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -6166,18 +6080,6 @@ window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" -winston@2.1.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e" - dependencies: - async "~1.0.0" - colors "1.0.x" - cycle "1.0.x" - eyes "0.1.x" - isstream "0.1.x" - pkginfo "0.3.x" - stack-trace "0.0.x" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" From 37a9b64503edc8fe750dad02a7a45d8303f9ba04 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 17 Nov 2017 17:00:15 -0600 Subject: [PATCH 22/22] Small fixes --- packages/0x.js/scripts/postpublish.js | 2 +- scripts/postpublish_utils.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index d2ae86bbd5..ffc68afb48 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -4,7 +4,7 @@ const packageJSON = require('../package.json'); const cwd = __dirname + '/..'; const subPackageName = packageJSON.name; -const S3BucketPath = 's3://0xjs-docs-jsons/', +const S3BucketPath = 's3://0xjs-docs-jsons/'; let tag; let version; diff --git a/scripts/postpublish_utils.js b/scripts/postpublish_utils.js index 4c9882fa89..3fb079badd 100644 --- a/scripts/postpublish_utils.js +++ b/scripts/postpublish_utils.js @@ -46,5 +46,6 @@ module.exports = { }, getReleaseName(subPackageName, version) { const releaseName = subPackageName + ' v' + version; + return releaseName; }, };