Commit 31ec56a9 authored by Phyks (Lucas Verney)'s avatar Phyks (Lucas Verney)
Browse files

Disable package-lock.json file in Kresus

Wwe are putting strict versions in the package.json file

Also add a comment about the `package.json` rule we are following in
`CONTRIBUTING.md` and a new linting check to enforce it.
parent b131f3d8
Pipeline #20084 passed with stage
in 2 minutes and 53 seconds
......@@ -22,6 +22,7 @@
nbproject
Thumbs.db
yarn.lock
package-lock.json
# Misc folders
logs
......
package-lock=false
......@@ -21,6 +21,12 @@ If watching doesn't work, under Unix based operating systems (Linux, MacOS),
you might need to [increase the number of inotify
nodes](https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit).
# About `package.json` file
We use `package.json` in a reproducible way, specifying the exact version to
use. Please make sure all version numbers are exact in `package.json`, thus
using no version ranges specifies like `~`, `>` etc.
# About branches
- `master` contains all changes in the current development version, including
......
......@@ -21,16 +21,16 @@ dev: build ## As build, but retriggers incremental compilation as the files are
./scripts/dev.sh
lint: ## Runs the linter for the server and the client, without warnings.
./scripts/lint.sh
./scripts/lint.sh --quiet
lint-full: ## Runs the linter for the server and the client, with warnings.
./scripts/lint-full.sh
./scripts/lint.sh
lint-client: ## Runs the linter on the client.
./scripts/lint-full.sh ./client
./scripts/lint.sh ./client
lint-server: ## Runs the linter on the server.
./scripts/lint-full.sh ./server
./scripts/lint.sh ./server
test: ## Runs all the tests.
./scripts/test.sh
......
......@@ -70,7 +70,8 @@
},
"scripts": {
"start": "node build/server/index.js",
"lint-full": "./scripts/lint-full.sh",
"lint": "./scripts/lint.sh --quiet",
"lint-full": "./scripts/lint.sh",
"test": "./scripts/test.sh",
"check": "./scripts/check.sh"
},
......
/* eslint no-process-exit: 0 */
import path from 'path';
import semver from 'semver';
import { makeLogger } from '../server/helpers';
import packageFile from '../package.json';
const logger = makeLogger('check-package-json');
process.exitCode = 0;
const dependencies = Object.assign({}, packageFile.dependencies, packageFile.devDependencies);
for (let [dependency, version] of Object.entries(dependencies)) {
if (semver.valid(version) === null) {
logger.error(`Dependency version specification must be exact for ${dependency}: ${version}.`);
process.exitCode = 1;
}
}
if (process.exitCode === 0) {
logger.info('Dependencies version numbers are exact.');
}
#!/bin/bash
set -e
./scripts/lint.sh && \
./scripts/test.sh && \
./scripts/lint.sh --quiet
./scripts/test.sh
echo "PASS!"
#!/bin/bash
if [ $# == 0 ]
then
target="./server ./client"
else
target=$1
fi
# Lint + warnings.
./node_modules/eslint/bin/eslint.js $target
#!/bin/bash
set -e
if [ $# == 0 ]
# Check package.json specifications
./node_modules/babel-cli/bin/babel-node.js scripts/check-package-json.js
QUIET=""
TARGET=""
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-q|--quiet)
QUIET="--quiet"
;;
*)
TARGET="$TARGET $key"
;;
esac
shift # past argument or value
done
if [ "$TARGET" == "" ]
then
target="./server ./client"
else
target=$1
TARGET="./server ./client"
fi
# Lint errors only.
./node_modules/eslint/bin/eslint.js --quiet $target
# Lint + warnings.
./node_modules/eslint/bin/eslint.js $QUIET $TARGET
#!/bin/bash
set -e
# Compare locales
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/compare-locales.js && \
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/compare-locales.js
# Check all bank related data is correct (logo, translation keys ...)
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/check-banks.js && \
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/check-banks.js
# Run proper tests
./node_modules/mocha/bin/mocha ./tests/ --recursive --require babel-register
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment