From 552fa3fae84dd7c75315dffe6e0bc28afabc14ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sat, 7 Jan 2017 18:29:56 -0500 Subject: [PATCH] Make and document `npm run build` now a mandatory step of the install/build setup This has several reasons, benefits and consequences: - When running on root (which is not recommended anyway), `npm run build` was already necessary. - This allows to not use the `prepublish` hook, whose behavior is going to change in npm v5 and again in npm v6. - This allows to create both production and development builds when running from source. - It makes `npm run build` compatible with Windows again for development environments (lost in previous commit). - It uses the `prepublishOnly` hook added in npm v4. Since this hook is not available prior to that, deployment to npm from Travis has to be done on the Node.js v7 environment. --- .travis.yml | 5 ++++- README.md | 8 +++----- appveyor.yml | 1 + package.json | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8930fb9..5dbd8fee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,9 @@ cache: directories: - ~/.npm +before_script: + - npm run build + notifications: email: on_success: never @@ -23,6 +26,6 @@ deploy: api_key: secure: I9iN31GWI+Mz0xPw81N7qh1M6uidB+3BmiPUXt8QigX45zwp9EhvfZ0U/AIdUyQwzK2RK1zLRQSt+2/1jyeVi+U+AAsRRmaAUx8iqKaQPAkPnQtElolgRP04WSgo7fvNejfM7zS939bQNKG3RlSm04yPgu+ke2igf799p2bpFe2LtyoEeIiUfrUkBiMSpMguN9XF8a7jqCyIouTKjXHR24RmzJ9r7ZoMV27yQauS7XlD81bontzNRZxTytDKdJpZ+sxGIT9mbbtM4LUFX8MeNe3p/bjWavEhrO0ZIpkbOfS/L/w1375YDoNPXxCs288lnGUH+NbGNAEfn+BTz8cmUp7jI7QWR/kNACPeopdAX4OdZxT8wfQcfQZrfCuSpKciOMC7vGgPpQqjQ61t1RKcKs9VUnwC0SwWjyo8LlzkFKnP1ks0eDGYsSoPLdpC9+76UmePkQdxMhscO8TOgkOCcsTMLiyt6ABGOGKu2iE5SsjUYtPiSiRzSBAQENoO560+xBSVTKwqvvhzUAIt4AuAQSgsFjAylDdyzKoObHX12hBdALrqSOOSVwwIQ5/jTgNAsilURHo7KPD407PhRnLOsvumL0qg4sr9S1hjuUKnNla5dg9GY8FVjJ+b2t0A2vgfG1pR1e3vrJRXrpkfRorhmjvKAk2o5you5pQ1Itty7rM= on: - node: '4' + node: 7 tags: true repo: thelounge/lounge diff --git a/README.md b/README.md index e0439fbc..a40daffe 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,12 @@ The following commands install the development version of The Lounge: git clone https://github.com/thelounge/lounge.git cd lounge npm install +NODE_ENV=production npm run build npm start ``` -A word of caution: - -- While it is the most recent codebase, this is not production-ready! -- It is not recommended to run this as root. However, if you decide to do so, - you will have to run `npm run build`. +⚠️ While it is the most recent codebase, this is not production-ready! Run at +your own risk. It is also not recommended to run this as root. ## Development setup diff --git a/appveyor.yml b/appveyor.yml index bc44f000..e36f70f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,7 @@ environment: install: - ps: Install-Product node $env:nodejs_version - appveyor-retry npm install + - npm run build - npm install mocha-appveyor-reporter - echo --reporter mocha-appveyor-reporter >> test/mocha.opts diff --git a/package.json b/package.json index cdd0706f..254e334e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "lint": "npm-run-all -c lint:*", "lint:js": "eslint .", "lint:css": "stylelint \"**/*.css\"", - "prepublish": "NODE_ENV=production npm run build" + "prepublishOnly": "NODE_ENV=production npm run build" }, "keywords": [ "lounge",