Skip to content

Commit

Permalink
fix(documentation): improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Kopriwa committed Apr 1, 2019
1 parent 73b2942 commit 5bc027e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
8 changes: 8 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
You can deploy test result to public sonarcloud.

| Environment variable | Description |
|----------------------|---------------------------------------------|
| `SONAR_TOKEN` | token to be used |
| `LCOV_INFO_PATH` | the `lcov.info` path (`coverage/lcov.info`) |

This is auto configured for you if you use rollup-umd.
31 changes: 31 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$PACKAGE_NAME contain the job test stage for all rollup-umd project.

You can run the build stage by doing:

```bash
npx $PACKAGE_NAME
```

It should be installed as a `devDependencies` so we can follow the version used by the rollup-umd project.

To use it, just use the script within your `.travis.yml`:


```yml
# Job: Test
- stage: test
node_js:
- 'lts/*'
- '10'
- '8'
addons:
sonarcloud:
organization: $(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}')
script:
- npx $PACKAGE_NAME
```
Note:
`organization` is necessary to use the travis sonarcloud driver.
Using `$(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}')` we set it to the github namespace of the project.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,4 @@
},
"declinationId": "cli",
"contributors": []
}
}
9 changes: 8 additions & 1 deletion src/cli/cmds/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ export const builder = (yargs) => yargs
});
export const command = ['*', 'test'];
export const desc = 'Run test jobs';
export const handler = (argv) => test(argv);
export const handler = (argv) => () => {
test(argv, (err, code) => {
if (code !== 0) {
console.log(`ps process exited with code ${code}`);
process.exitCode = code;
}
});
};
10 changes: 9 additions & 1 deletion styleguide/styleguide.ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"name": "Installation",
"content": "docs/installation.md"
},
{
"name": "Getting started",
"content": "docs/getting-started.md"
},
{
"name": "Configuration",
"content": "docs/configuration.md"
},
{
"name": "JSdoc",
"description": "This part is generated from the JSdoc annotations in the source code.",
Expand Down Expand Up @@ -50,4 +58,4 @@
"url": "https://github.com/rollup-umd/test",
"text": "Fork us on GitHub"
}
}
}

0 comments on commit 5bc027e

Please sign in to comment.