Skip to content

Commit

Permalink
Changed version update lifecycle scripts to skip auto tagging
Browse files Browse the repository at this point in the history
- Added a local .npmrc
- Set a reminder for windows environment setup
- Added chalk for better logging
  • Loading branch information
xkema committed Sep 20, 2020
1 parent a422849 commit 8e6eea2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git-tag-version = false
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ A browser extension to intercept network requests.

Load extension folder to browser as an unpacked extension to the browser.

`@todo` - update for windows environmnt

## Others

too many redirects?
Expand Down
25 changes: 20 additions & 5 deletions bin/includes/echo-version-info.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
const boxen = require('boxen');
const chalk = require('chalk');
const browsers = require('./browsers.js');

const name = process.argv.slice(2)[0].split('=')[1];
const version = process.argv.slice(2)[1].split('=')[1];

const bundleList = browsers.map(browser => ` - dist/${name}-${browser.name}-${version}.zip`).join('\n');

const info = `# You need to take some extra actions manually to finish version update:
const info = `# You need to take some extra actions manually to finish version update
- - -
1. Run \`git push && git push --tags\` to push recent changes to the repository
2. Upload created zip bundles to the GitHub release as binaries
You've just run ${chalk.green('npm version patch|minor|major')} on development branch, this did:
- Update ${chalk.bold('package.json')} and ${chalk.bold('package-lock.json')} versions
- Run unit tests for ${chalk.bold('extension')} directory
- Create bundle zip files and run bundle linters for ${chalk.bold('dist')} directory
- Commit ${chalk.bold('package.json')} and ${chalk.bold('package-lock.json')} changes
... and you should:
1. Switch to the ${chalk.bold('master')} branch, merge these version changes onto it
2. Tag ${chalk.bold('master')} branch manually with ${chalk.green('git tag -a v' + version + ' -m "Version update"')}
- ${chalk.bold('npm')}'s auto tagging feature is disabled by ${chalk.dim('git-tag-version = false')} config in ${chalk.bold('.npmrc')}
3. Run ${chalk.green('git push && git push --tags')} to push version changes to the origin
4. Upload created zip bundles created under ${chalk.bold('dist/*')} directory to the ${chalk.bold('GitHub')} as release binaries
${bundleList}
3. Continue to do whatever you were doing before deployment :)`;
5. Continue to do whatever you were doing before deployment :)`;

const output = boxen(info, {
padding: 1,
dimBorder: true,
margin: { bottom: 1 }
margin: { top: 1, bottom: 1 }
});

console.log(output);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": "jest --watchAll",
"preversion": "jest --bail",
"version": "node bin/bundle.js",
"postversion": "node bin/includes/echo-version-info.js name=$npm_package_name version=$npm_package_version"
"postversion": "git add package.json package-lock.json && git commit -m\"Updated to v$npm_package_version\" && node bin/includes/echo-version-info.js name=$npm_package_name version=$npm_package_version"
},
"author": "Kemal Yılmaz",
"license": "ISC",
Expand All @@ -18,6 +18,7 @@
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"addons-linter": "^2.1.0",
"boxen": "^4.2.0",
"chalk": "^4.1.0",
"chokidar": "^3.4.2",
"deep-extend": "^0.6.0",
"eslint": "^7.8.1",
Expand Down

0 comments on commit 8e6eea2

Please sign in to comment.