Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
feat(reason): add semantic-release (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
believer authored Sep 2, 2019
1 parent 20e3de8 commit 624a039
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands/reason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export const reason = async ({ name }: CLIProps) => {
output: `${projectName}/src/index.js`,
})

// Creates .releaserc for @semantic-release
await create({
templateName: 'reason/releaserc',
output: `${projectName}/.releaserc`,
})

// Move and overwrite index html
spinner.text = 'Updating base files'
await execa.command('mkdir public', projectFolder)
Expand Down
2 changes: 2 additions & 0 deletions src/templates/reason/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"reason-react": "0.7.0"
},
"devDependencies": {
"@semantic-release/changelog": "3.0.4",
"@semantic-release/git": "7.0.16",
"autoprefixer": "9.6.1",
"bs-platform": "5.0.6",
"cross-env": "5.2.0",
Expand Down
12 changes: 12 additions & 0 deletions src/templates/reason/releaserc.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
["@semantic-release/npm", {
"npmPublish": false
}],
"@semantic-release/git"
]
}

9 changes: 9 additions & 0 deletions test/commands/reason.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ test('create tailwind config', async () => {
})
})

test('creates releaserc for semantic release', async () => {
await reason({ name: 'test', flags: {} })

expect(create).toHaveBeenCalledWith({
templateName: 'reason/releaserc',
output: 'test/.releaserc',
})
})

test('move and replace index.html', async () => {
await reason({ name: 'test', flags: {} })

Expand Down

0 comments on commit 624a039

Please sign in to comment.