diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..7898332 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +git-tag-version = false \ No newline at end of file diff --git a/README.md b/README.md index 9fac37e..5ba3318 100644 --- a/README.md +++ b/README.md @@ -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? diff --git a/bin/includes/echo-version-info.js b/bin/includes/echo-version-info.js index d5257f3..17c661b 100644 --- a/bin/includes/echo-version-info.js +++ b/bin/includes/echo-version-info.js @@ -1,4 +1,5 @@ const boxen = require('boxen'); +const chalk = require('chalk'); const browsers = require('./browsers.js'); const name = process.argv.slice(2)[0].split('=')[1]; @@ -6,21 +7,35 @@ 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); \ No newline at end of file diff --git a/package.json b/package.json index d8d8690..6f9ba06 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",