-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update chalk, add semantic-release test cmd
Signed-off-by: Carina Ursu <[email protected]>
- Loading branch information
1 parent
2c0fe06
commit ef8abba
Showing
4 changed files
with
76 additions
and
27 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,8 @@ | |
"storybook": "start-storybook -p 6006", | ||
"test": "NODE_ENV=test BASE_URL=/console jest", | ||
"test:clear": "jest --clearCache", | ||
"test-coverage": "NODE_ENV=test BASE_URL=/console jest --coverage" | ||
"test-coverage": "NODE_ENV=test BASE_URL=/console jest --coverage", | ||
"test-release": "npx semantic-release --debug --no-ci --test-run" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
|
@@ -57,7 +58,7 @@ | |
"@types/react-dom": "^16.9.7", | ||
"@typescript-eslint/eslint-plugin": "^5.48.2", | ||
"@typescript-eslint/parser": "^5.48.2", | ||
"chalk": "^2.0.1", | ||
"chalk": "^4", | ||
"compression-webpack-plugin": "^9.2.0", | ||
"cookie-parser": "^1.4.3", | ||
"copy-webpack-plugin": "^11.0.0", | ||
|
@@ -135,7 +136,8 @@ | |
"@babel/preset-react": "~7.16.7", | ||
"@babel/preset-typescript": "~7.16.7", | ||
"minimist": "1.2.6", | ||
"@types/react": "16.14.34" | ||
"@types/react": "16.14.34", | ||
"npm/chalk": "^4" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
const { execSync } = require('child_process'); | ||
|
||
/** | ||
* | ||
* @returns Production release configuration | ||
*/ | ||
function getProdConfiguration() { | ||
return { | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
[ | ||
'@semantic-release/changelog', | ||
{ | ||
changelogTitle: | ||
'# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.', | ||
}, | ||
], | ||
['@semantic-release/npm', { npmPublish: false }], | ||
'@semantic-release/github', | ||
], | ||
}; | ||
} | ||
|
||
/** | ||
* | ||
* ################################################################ | ||
* ################################################################ | ||
* ################ FOR TESTING ########################## | ||
* ################################################################ | ||
* ################################################################ | ||
*/ | ||
function isTestRun() { | ||
return ( | ||
process.argv.includes('--dry-run') || process.argv.includes('--test-run') | ||
); | ||
} | ||
|
||
function getTestConfiguration() { | ||
const localGitRepoPath = `file://${process.cwd()}/.git`; | ||
const localBranchName = execSync('git branch --show-current') | ||
.toString() | ||
.trim(); | ||
|
||
return { | ||
repositoryUrl: localGitRepoPath, | ||
branches: localBranchName, | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
[ | ||
'@semantic-release/changelog', | ||
{ | ||
changelogTitle: | ||
'# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.', | ||
}, | ||
], | ||
['@semantic-release/npm', { npmPublish: false }], | ||
// ["@semantic-release/github", { | ||
// "verifyConditions": false, | ||
// "publish": false, | ||
// 'addReleases': false | ||
// }], | ||
], | ||
}; | ||
} | ||
|
||
module.exports = isTestRun() ? getTestConfiguration() : getProdConfiguration(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters