Skip to content

Commit

Permalink
feat(swc-plugin-canyon): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Oct 21, 2024
1 parent aae5e27 commit 0293076
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions plugins/swc-plugin-canyon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,36 @@ Install it:
npm install --save-dev swc-plugin-istanbul
```

Add it to `swc.config.js` in test mode:
Add it to `next.config.mjs` in test mode:

```js
module.exports = {
plugins:
process.env.CI_COMMIT_REF_NAME === 'test-coverage'? ['istanbul', 'canyon']:[]
}
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
swcPlugins: [
[
'swc-plugin-coverage-instrument', {},
'swc-plugin-canyon',
{
dsn: 'http://yourdomain.com/coverage/client',
reporter: 'your_token',
projectID: '230614',
sha: 'xxxxxxxxx',
reportID: 'case_id',
branch: 'master',
compareTarget: 'develop',
},
],
],
},
};

export default nextConfig;
```

查看 [Example](https://github.com/canyon-project/canyon/blob/main/examples/next-swc/next.config.mjs)


## Configuration

swc.config.js
Expand Down Expand Up @@ -55,4 +76,3 @@ module.exports = {
| reportID | Report ID, Used to distinguish between different test cases. | Optional |
| branch | Git repository branch, the plugin will detect the variables of the pipeline, which usually don't need to be configured. | Optional |
| compareTarget | Compare target, used as a baseline against current sha to calculate change line coverage. | Optional |

0 comments on commit 0293076

Please sign in to comment.