From 45d9e9e205a4462bb48fdc7a834ecfadf95104ec Mon Sep 17 00:00:00 2001 From: Xymorot Date: Thu, 14 May 2020 22:01:37 +0200 Subject: [PATCH] meta: add engines key in package.json and related documentation --- CONTRIBUTING.md | 11 ++++++++++- package.json | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdd0634..8e85b84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,7 @@ Table of Content: 1. [Database](CONTRIBUTING.md#database) 1. [Formatting and Linters](CONTRIBUTING.md#formatting-and-linters) 1. [Testing](CONTRIBUTING.md#testing) + 1. [Updating](CONTRIBUTING.md#updating-dependencies) 1. [Design](CONTRIBUTING.md#design) ## Currently Most Wanted @@ -52,7 +53,7 @@ Every contribution is valuable. Open a ticket [here](https://git.fuwafuwa.moe/Xy Things to install: -- [Node.js](https://nodejs.org) (this also installs npm) +- [Node.js](https://nodejs.org) (use the version written under `engines` in [package.json](package.json)) - [Git](https://git-scm.com/) Then [use git to clone this repository](https://www.google.com/search?q=how+to+clone+a+repository+with+git). @@ -166,6 +167,14 @@ Mocha does [not have a separate tagging feature](https://github.com/mochajs/moch Code coverage is provided by [nyc](https://github.com/istanbuljs/nyc). The detailed code coverage can be found under `.nyc_output/coverage/index.html` after running the coverage script `npm run coverage` (open in browser). The coverage script is separate because it does not allow simple debugging.\ The code coverage does not work with Spectron since that runs in its own node process. +### Updating Dependencies + +In the best case a simple `npm update` does the trick, but to upgrade to a new major version of a dependency a manual `npm install @` is necessary. All code changes to work with the new dependency must be in the same commit. + +#### Electron + +Updating Electron also updated the Node.js and Chromium version it uses internally. When upgrading to a new major Node version, the Node.js version in the development environment should also be updated. This also means updating the `node` version key under `engines` in [package.json](package.json). + ## Design Before implementation comes design (at least for a bit, until they run in parallel). The [workspace folder](workspace) is the space where all the documents for application design should go. diff --git a/package.json b/package.json index e27deda..56771a4 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,9 @@ "email": "xymorot@mailbox.org" }, "main": "src/main.js", + "engines": { + "node": "12" + }, "scripts": { "postinstall": "npm run rebuild", "start": "electron . --enable-logging --dev",