Setup js dev environment

This commit is contained in:
Bartek Fabiszewski 2019-11-14 16:11:43 +01:00
parent 982c0dde78
commit f40e042268
3 changed files with 3044 additions and 1620 deletions

45
karma.conf.js Normal file
View File

@ -0,0 +1,45 @@
/* eslint-disable no-undef,no-process-env */
// noinspection NpmUsedModulesInstalled
process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function(config) {
config.set({
basePath: 'js/',
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [ 'jasmine' ],
// list of files / patterns to load in the browser
files: [
{ pattern: 'test/*.test.js', type: 'module' },
{ pattern: 'src/*.js', type: 'module', included: false }
],
// list of files / patterns to exclude
exclude: [],
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/*.js': [ 'karma-coverage-istanbul-instrumenter' ]
},
coverageIstanbulInstrumenter: {
esModules: true
},
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: [ 'progress', 'coverage-istanbul' ],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [ 'ChromeHeadless' ],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// how many browser should be started simultaneous
concurrency: Infinity
})
};

4573
package-lock.json generated

File diff suppressed because it is too large Load Diff

46
package.json Normal file
View File

@ -0,0 +1,46 @@
{
"name": "ulogger-server",
"version": "1.0.0",
"description": "This is a web application for real-time collection of geolocation data, tracks viewing and management. Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android) it may be used as a complete self hosted serverclient solution for logging and monitoring users' geolocation.",
"main": "js/ulogger.js",
"scripts": {
"test": "karma start karma.conf.js",
"start": "parcel index.html",
"build": "parcel build --public-url . js/ulogger.js"
},
"repository": {
"type": "git",
"url": "ssh://git@git.fabiszewski.net/~/ulogger-server.git"
},
"author": "Bartek Fabiszewski",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"babel-loader": "^8.0.6",
"babel-minify-webpack-plugin": "^0.3.1",
"browserlist": "^1.0.1",
"core-js": "^3.4.1",
"eslint": "^6.6.0",
"eslint-plugin-jasmine": "^4.0.0",
"jasmine": "^3.5.0",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-instrumenter": "^1.0.1",
"karma-coverage-istanbul-reporter": "^2.1.0",
"karma-jasmine": "^2.0.1",
"parcel-bundler": "^1.12.4",
"puppeteer": "^2.0.0",
"regenerator-runtime": "^0.13.3",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
},
"dependencies": {
"ol": "^5.3.3"
},
"browserslist": [
"defaults"
]
}