Skip to content

Commit

Permalink
Merge pull request #19 from svoboda-rabstvo/ci/semantic
Browse files Browse the repository at this point in the history
ci: add semantic release
  • Loading branch information
romanrostislavovich authored Aug 21, 2018
2 parents 861a30b + 7a99e17 commit fbc2a21
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ Go to your fork in GitHub and then follow the [GitHub documentation][github-help
- A pull request must contain a description explaining what you did and how the effects can be seen.

[maintainers]: https://github.com/orgs/linterhub/teams/maintainers
[github-url]: https://github.com/linterhub/schema
[github-url-issue]: https://github.com/linterhub/schema/issues/new
[github-url]: https://github.com/linterhub/registry
[github-url-issue]: https://github.com/linterhub/registry/issues/new
[github-help-fork]: https://help.github.com/articles/fork-a-repo/#fork-an-example-repository
[github-help-pull-request]: https://help.github.com/articles/creating-a-pull-request
[github-url-commit-message]: https://github.com/linterhub/schema/blob/develop/docs/git/commit_message.md
[github-url-commit-message]: https://github.com/linterhub/registry/blob/develop/docs/git/commit_message.md
57 changes: 57 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"branch": "master",
"verifyConditions": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
],
"prepare": [
"@semantic-release/npm",
"@semantic-release/changelog"
],
"analyzeCommits": {
"releaseRules": [
{
"type": "docs",
"scope": ".*md",
"release": "patch"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "new",
"release": "minor"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "ci",
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "breaking",
"release": "major"
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
}
},
"publish": [
"@semantic-release/github",
"@semantic-release/npm"
]
}
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
language: node_js
node_js: "8"
install: npm install
script:
- npm run build
- npm run lint
- npm run test
cache:
directories:
- dist

jobs:
include:
- stage: build
node_js: "8"
script:
- npm run lint
- npm run test
- npm run build
- stage: release
node_js: "8"
if: branch = master AND type = push
script: npm run semantic-release
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ unified API for work with of various API.

Requirements:

- [Node.js][node-js] 7.4+
- [npm][npm] 4+
- [Node.js][node-js-url] 7.4+
- [npm][npm-url] 4+

```bash
npm install @linterhub/registry
Expand All @@ -44,8 +44,10 @@ Get meta-information of `packageName` from `npm` and output it to console:

```javascript
const registry = require('@linterhub/registry');
const manager = registry('npm');
console.log(manager.getMeta('package'));
const manager = registry.getManager('npm');
manager.getMeta('packageName').then((data) => {
console.log(data);
});
```

Supported package managers:
Expand All @@ -62,32 +64,38 @@ Supported package managers:
Get meta-information of package

Options:
`name`: string - package name by search
`version`: string - package version [`latest` by default]

Return: `Promise`
Promise: package meta-information, which include: `name`, `url`, `license` and e.t.c
- `name`: string - package name by search
- `version`: string - package version [`latest` by default]

Return:

- `Promise` - package meta-information, which include: `name`, `url`, `license` and e.t.c

#### getDeps(name, [version])

Get dependencies for a package

Options:
`name`: string - package name by search
`version`: string - package version [`latest` by default]

Return: `Promise`
Promise: objects array, where the object is one dependency.
- `name`: string - package name by search
- `version`: string - package version [`latest` by default]

Return:

- `Promise` - objects array, where the object is one dependency.

#### getVersions(name)

Get all versions by package name

Options:
`name`: string - package name by search

Returns: `Promise`
Promise: versions array
- `name`: string - package name by search

Returns:

- `Promise`- versions array

## Contribute

Expand All @@ -99,7 +107,7 @@ Please check our [contributing guidelines][repo-contributing].

[MIT][repo-license]

[repo-doc]: https://github.com/linterhub/registry/blob/master/doc
[repo-doc]: https://github.com/linterhub/registry/blob/master/docs
[repo-url]: https://github.com/linterhub/registry
[repo-npm]: https://www.npmjs.com/package/@linterhub/registry
[repo-license]: https://github.com/linterhub/registry/blob/master/LICENSE.md
Expand Down
4 changes: 2 additions & 2 deletions docs/git/commit_message.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Each commit message consists of a **header**, a [**body**](#body) and a [**foote
The header has a special format that includes a [type](#type) and a [subject](#subject):

```text
<type>:<subject> (<number of issue>)
<type>:<subject>
<BLANK LINE>
<body>
<BLANK LINE>
Expand Down Expand Up @@ -51,7 +51,7 @@ The footer should contain a [closing reference to an issue][github-help-close-is
## Example

```text
Test: Add missing tests for a linter (#456)
Test: Add missing tests for a linter
Adding missing tests for the linter:
- with full data
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@
"mocha": "./node_modules/mocha/bin/mocha",
"build": "tsc -p .",
"lint": "tslint -c tslint.json --project . -t codeFrame",
"test": "mocha -r ts-node/register test/test.**.ts"
"test": "mocha -r ts-node/register test/test.**.ts",
"semantic-release": "semantic-release"
},
"devDependencies": {
"@types/chai": "^4.1.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.5.5",
"@types/package-json": "^4.0.1",
"@types/request-promise": "^4.1.42",
"@semantic-release/changelog": "^3.0.0",
"@semantic-release/git": "^7.0.1",
"semantic-release": "^15.9.6",
"chai": "^4.1.2",
"mocha": "^5.2.0",
"ts-node": "^7.0.0",
Expand Down

0 comments on commit fbc2a21

Please sign in to comment.