From 93e4068fa042cc79a6bd79ecc7d876812067c40d Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Tue, 22 Oct 2019 19:20:42 +0300 Subject: [PATCH] fix(types): handle Symbol.toStringTag closes #59 --- .releaserc.js | 30 -------------------------- .travis.yml | 2 +- package.json | 26 ++++++++++++++++++---- packages/abstract/package.json | 6 +++--- packages/types/package.json | 6 +++--- packages/types/src/main/ts/IPromise.ts | 3 ++- packages/types/src/test/ts/index.d.ts | 3 ++- yarn.lock | 12 +++++------ 8 files changed, 39 insertions(+), 49 deletions(-) delete mode 100644 .releaserc.js diff --git a/.releaserc.js b/.releaserc.js deleted file mode 100644 index e00a60e6f..000000000 --- a/.releaserc.js +++ /dev/null @@ -1,30 +0,0 @@ -const hooks = require('semantic-release-monorepo-hooks') -const output = hooks() - -module.exports = { - branch: 'master', - tagFormat: 'v${version}', - prepare: [ - '@semantic-release/changelog', - '@semantic-release/npm', - { - 'path': '@semantic-release/git', - 'message': 'chore(' + output.package + '): release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' - } - ], - publish: [ - '@semantic-release/npm' - ], - verifyConditions: [ - '@semantic-release/npm', - '@semantic-release/git' - ], - monorepo: { - analyzeCommits: [ - '@semantic-release/commit-analyzer' - ], - generateNotes: [ - '@semantic-release/release-notes-generator' - ] - } -}; \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d02a4b0d2..e02512576 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,4 +23,4 @@ deploy: provider: script skip_cleanup: true script: - - yarn lerna exec --concurrency 1 "npx --no-install semantic-release -e semantic-release-monorepo" && node -e "require('semantic-release-monorepo-hooks').hookAfterAll()" + - yarn release diff --git a/package.json b/package.json index 135f81c8c..55d064a9d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "codeclimate:push": "codeclimate-test-reporter < ./coverage/lcov.info", "coveralls:push": "cat ./coverage/lcov.info | coveralls", "lint": "tslint -c tslint.json -p tsconfig.json 'packages/**/src/main/*.ts' --fix | snazzy", - "docs": "typedoc packages/**/src/main --ignoreCompilerErrors || exit 0" + "docs": "typedoc packages/**/src/main --ignoreCompilerErrors || exit 0", + "release": "multi-semantic-release --execasync" }, "devDependencies": { "@types/jest": "^24.0.18", @@ -34,9 +35,6 @@ "lodash": "^4.17.15", "replace-in-file": "^4.1.3", "semantic-release": "15.13.21", - "semantic-release-monorepo": "6.1.1", - "semantic-release-monorepo-hooks": "2.9.5", - "semantic-release-plugin-decorators": "^2.0.0", "snazzy": "^8.0.0", "ts-jest": "^24.0.2", "tslint": "^5.19.0", @@ -51,5 +49,25 @@ "/packages/types/jest.config.json", "/packages/facade/jest.config.json" ] + }, + "release": { + "branch": "master", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/npm", + [ + "@semantic-release/git", + { + "assets": [ + "src/**/*.{js,css}", + "package.json" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + "@semantic-release/github" + ] } } diff --git a/packages/abstract/package.json b/packages/abstract/package.json index 0c845a08a..6c6ab4b34 100644 --- a/packages/abstract/package.json +++ b/packages/abstract/package.json @@ -35,7 +35,7 @@ "target" ], "devDependencies": { - "@qiwi/uniconfig": "^3.0.1", + "@qiwi/uniconfig": "^3.1.0", "@types/bluebird": "^3.5.27", "@types/config": "^0.0.34", "@types/jest": "^24.0.18", @@ -44,8 +44,8 @@ "@types/parsimmon": "^1.10.0", "@types/underscore": "^1.9.2", "bluebird": "^3.5.5", - "conf": "^4.1.0", - "config": "^3.1.0", + "conf": "^5.0.0", + "config": "^3.2.2", "dts-generator": "^3.0.0", "dtslint": "^0.9.1", "flowgen": "^1.10.0", diff --git a/packages/types/package.json b/packages/types/package.json index 6a6d75e58..4b0bd8e56 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -33,7 +33,7 @@ "target" ], "devDependencies": { - "@qiwi/uniconfig": "^3.0.1", + "@qiwi/uniconfig": "^3.1.0", "@types/bluebird": "^3.5.27", "@types/config": "^0.0.34", "@types/jest": "^24.0.18", @@ -42,8 +42,8 @@ "@types/parsimmon": "^1.10.0", "@types/underscore": "^1.9.2", "bluebird": "^3.5.5", - "conf": "^4.1.0", - "config": "^3.1.0", + "conf": "^5.0.0", + "config": "^3.2.2", "dts-generator": "^3.0.0", "dtslint": "^0.9.1", "flowgen": "^1.10.0", diff --git a/packages/types/src/main/ts/IPromise.ts b/packages/types/src/main/ts/IPromise.ts index 4c25e8a50..47bfc550a 100644 --- a/packages/types/src/main/ts/IPromise.ts +++ b/packages/types/src/main/ts/IPromise.ts @@ -11,7 +11,8 @@ export interface IPromiseConstructor { export interface IPromise { then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise catch: (onReject: (reason: TReason) => any) => IPromise - finally?: (onFinally: () => any) => IPromise + finally: (onFinally: () => any) => IPromise + readonly [Symbol.toStringTag]: string } // https://stackoverflow.com/questions/45902881/ts1055-when-using-async-await-using-a-type-alias diff --git a/packages/types/src/test/ts/index.d.ts b/packages/types/src/test/ts/index.d.ts index 0271ebcb4..e6d32b351 100644 --- a/packages/types/src/test/ts/index.d.ts +++ b/packages/types/src/test/ts/index.d.ts @@ -117,7 +117,8 @@ declare module '@qiwi/substrate-types/target/es5/IPromise' { interface IPromise { then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise; catch: (onReject: (reason: TReason) => any) => IPromise; - finally?: (onFinally: () => any) => IPromise; + finally: (onFinally: () => any) => IPromise; + readonly [Symbol.toStringTag]: string; } const IPromise: PromiseConstructor; } diff --git a/yarn.lock b/yarn.lock index 33b4243ac..27a657493 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1267,7 +1267,7 @@ js-yaml "^3.13.1" tslib "^1.10.0" -"@qiwi/uniconfig@^3.0.1": +"@qiwi/uniconfig@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@qiwi/uniconfig/-/uniconfig-3.1.0.tgz#02e8e5fee66e502b7aa333ef0aedf33c6a7a638d" integrity sha512-+K4qevFU+DgNXOAtGTsl9SPHa4aZeTXa3c0s1NSF7TOBDt+p7P1tmuqg7jhtCsHyjRLbjgOEQDVtWx9ragVj2Q== @@ -2455,10 +2455,10 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -conf@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/conf/-/conf-4.1.0.tgz#c7029f629d7158eaf03ae118484d100f878c28b2" - integrity sha512-/G++SsVVt4MkKYZ1E+XdNEyCYghM7e7SSgx4PA55lQrmJjUY1APGGfz42YX9YpRkhLFvlhkJ5S341FWsufZZ5w== +conf@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conf/-/conf-5.0.0.tgz#6530308a36041bf010ab96b05a0f4aff5101c65d" + integrity sha512-lRNyt+iRD4plYaOSVTxu1zPWpaH0EOxgFIR1l3mpC/DGZ7XzhoGFMKmbl54LAgXcSu6knqWgOwdINkqm58N85A== dependencies: ajv "^6.10.0" dot-prop "^5.0.0" @@ -2476,7 +2476,7 @@ config-chain@^1.1.11, config-chain@^1.1.12: ini "^1.3.4" proto-list "~1.2.1" -config@^3.1.0: +config@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/config/-/config-3.2.2.tgz#c7d31bb2a9d30013a905ff420101e3b1ba58eead" integrity sha512-rOsfIOAcG82AWouK4/vBS/OKz3UPl2T/kP0irExmXJJOoWg2CmdfPLdx56bCoMUMFNh+7soQkQWCUC8DyemiwQ==