From fe1ab5e2e2e28ca00d158000c12b5a320758c146 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 21 Mar 2017 16:11:17 +0000 Subject: [PATCH] fix(build): show version correctly, build as part of release --- .babelrc | 3 +- doc/developer-notes.md | 18 +++++++++++ ...babel-plugin-inline-package-json_vx.x.x.js | 32 ------------------- package-scripts.js | 2 +- package.json | 1 - src/bin/commands/version.js | 5 +-- yarn.lock | 8 ++--- 7 files changed, 23 insertions(+), 46 deletions(-) delete mode 100644 flow-typed/npm/babel-plugin-inline-package-json_vx.x.x.js diff --git a/.babelrc b/.babelrc index 19b12a3..0874322 100644 --- a/.babelrc +++ b/.babelrc @@ -11,8 +11,7 @@ "plugins": [ "transform-runtime", "transform-flow-strip-types", - "transform-object-rest-spread", - "inline-package-json" + "transform-object-rest-spread" ], "env": { // jest needs this diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 7bd0aa8..368f2bd 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -15,6 +15,24 @@ $ nps f # or nps flow - check flow types $ nps f.t # or nps flow.typed - update all third-party types via flow-typed ``` +## Branches and merging + +When merging to master **Squash and Merge**. + +In the commit message, follow [conventional-changelog-standard conventions](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md) + + +## Releasing + +When ready to release to npm: + +1. `git checkout master` +1. `git pull origin master` +1. `nps release` +1. Engage pre-publication paranoia +1. `git push --follow-tags origin master` +1. `npm publish` + ## Tests diff --git a/flow-typed/npm/babel-plugin-inline-package-json_vx.x.x.js b/flow-typed/npm/babel-plugin-inline-package-json_vx.x.x.js deleted file mode 100644 index 13b4fbb..0000000 --- a/flow-typed/npm/babel-plugin-inline-package-json_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 55533a3e7abe6ffc2ae267732d4b1d1f -// flow-typed version: <>/babel-plugin-inline-package-json_v^2.0.0/flow_v0.42.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-plugin-inline-package-json' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-plugin-inline-package-json' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-plugin-inline-package-json/lib/index' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-plugin-inline-package-json/lib/index.js' { - declare module.exports: $Exports<'babel-plugin-inline-package-json/lib/index'>; -} diff --git a/package-scripts.js b/package-scripts.js index 1ace7d5..1c1f0f5 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -6,7 +6,7 @@ module.exports = { quick: 'nps clean && nps build.es5 && nps flow.copySource', es5: 'babel --copy-files --out-dir dist --ignore __tests__ src', }, - release: 'standard-version', + release: 'nps build && standard-version', lint: { default: 'concurrently "nps lint.js" "nps flow"', js: 'eslint src', diff --git a/package.json b/package.json index 4def6d6..937f37f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "babel-cli": "^6.24.0", "babel-eslint": "^7.2.0", "babel-jest": "^19.0.0", - "babel-plugin-inline-package-json": "^2.0.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.0", "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", diff --git a/src/bin/commands/version.js b/src/bin/commands/version.js index c5df62b..657a468 100755 --- a/src/bin/commands/version.js +++ b/src/bin/commands/version.js @@ -2,12 +2,9 @@ import chalk from 'chalk'; +import { name, version } from '../../../package.json'; import log from '../../lib/log'; -// babel-plugin-inline-package-json@2.0.0 only supports require, and only in this icky form. -const name = require('../../../package.json').name; -const version = require('../../../package.json').version; - export const command = 'version'; export const desc = 'Print version information'; diff --git a/yarn.lock b/yarn.lock index 0ebe110..174909c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -412,10 +412,6 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-inline-package-json@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-inline-package-json/-/babel-plugin-inline-package-json-2.0.0.tgz#1f9558d96667f4b8787e807d764e6e15b4f0cd07" - babel-plugin-istanbul@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" @@ -789,11 +785,11 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23 lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: +babylon@^6.11.0: version "6.15.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" -babylon@^6.16.1: +babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: version "6.16.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"