Commit e1d86e21 authored by Romain Courteaud's avatar Romain Courteaud

Remove dependency to grunt-jslint.

parent 4aa32a41
/*
* Copyright 2013, Nexedi SA
*
* This program is free software: you can Use, Study, Modify and Redistribute
* it under the terms of the GNU General Public License version 3, or (at your
* option) any later version, as published by the Free Software Foundation.
*
* You can also Link and Combine this program with other software covered by
* the terms of any of the Free Software licenses or any of the Open Source
* Initiative approved licenses and Convey the resulting work. Corresponding
* source of such a combination shall include the source code for all other
* software used.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See COPYING file for full licensing terms.
* See https://www.nexedi.com/licensing for rationale and options.
*/
module.exports = function (grunt) {
"use strict";
grunt.loadNpmTasks('grunt-jslint');
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jslint: {
npm: {
src: ['package.json'],
directives: {
maxlen: 100,
indent: 2,
maxerr: 3,
predef: [
'module'
]
}
},
grunt: {
src: ['Gruntfile.js'],
directives: {
es5: true,
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'module',
'require'
]
}
},
jio: {
src: ['src/jio.js'],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
nomen: true
}
},
jio_storages: {
src: ['src/jio.storage/*.js'],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'define',
'exports',
'require',
'window',
'jIO',
'complex_queries'
]
}
},
jiodate: {
src: ['src/jio.date/jiodate.js'],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'jIO'
]
},
},
tests: {
src: ['test/**/*.js'],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'RSVP',
'QUnit',
'jIO'
]
},
},
queries: {
src: ['src/queries/*.js'],
exclude: [
'src/queries/parser-begin.js',
'src/queries/parser-end.js'
],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'jIO'
]
}
},
examples: {
src: ['examples/*.js'],
directives: {
maxlen: 80,
indent: 2,
maxerr: 3,
predef: [
'window',
'RSVP',
'rJS',
'QUnit',
'jIO'
]
},
},
}
});
grunt.registerTask('default', ['all']);
grunt.registerTask('all', ['lint']);
grunt.registerTask('lint', ['jslint']);
};
#############################################
# Copyright 2018, Nexedi SA
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
#############################################
include config.mk
DISTDIR = dist
SRCDIR = src
LINTDIR = lint
TESTDIR = test
EXAMPLEDIR = examples
VERSION = 3.32.1
JIOVERSION = ${DISTDIR}/jio-v${VERSION}.js
JIOLATEST = ${DISTDIR}/jio-latest.js
all: build
all: checktest build
#############################################
# Lint
#############################################
LINTOPTS = --maxlen 80 --indent 2 --maxerr 3
${LINTDIR}/jio.storage/%.js: ${SRCDIR}/jio.storage/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --predef jIO --predef window $<
cat $< > $@
${LINTDIR}/jio.js: ${SRCDIR}/jio.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --nomen true $<
cat $< > $@
${LINTDIR}/jio.date/%.js: ${SRCDIR}/jio.date/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} $<
cat $< > $@
${LINTDIR}/queries/query.js: ${SRCDIR}/queries/query.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} $<
cat $< > $@
${LINTDIR}/${TESTDIR}/jio.storage/%.js: ${TESTDIR}/jio.storage/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --predef QUnit --predef RSVP --predef jIO $<
cat $< > $@
${LINTDIR}/${TESTDIR}/queries/%.js: ${TESTDIR}/queries/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --predef QUnit --predef RSVP --predef jIO $<
cat $< > $@
${LINTDIR}/${TESTDIR}/jio/%.js: ${TESTDIR}/jio/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --predef QUnit --predef RSVP --predef jIO $<
cat $< > $@
${LINTDIR}/package.json: package.json
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --maxlen 100 $<
cat $< > $@
${LINTDIR}/${EXAMPLEDIR}/%.js: ${EXAMPLEDIR}/%.js
@mkdir -p $(@D)
${JSLINT} ${LINTOPTS} --predef RSVP --predef window --predef QUnit --predef jIO --predef rJS $<
cat $< > $@
#############################################
# Check test files
#############################################
checktest: $(patsubst ${TESTDIR}/jio.storage/%.js, ${LINTDIR}/${TESTDIR}/jio.storage/%.js, $(wildcard ${TESTDIR}/jio.storage/*.js)) \
$(patsubst ${TESTDIR}/queries/%.js, ${LINTDIR}/${TESTDIR}/queries/%.js, $(wildcard ${TESTDIR}/queries/*.js)) \
$(patsubst ${TESTDIR}/jio/%.js, ${LINTDIR}/${TESTDIR}/jio/%.js, $(wildcard ${TESTDIR}/jio/*.js)) \
$(patsubst ${EXAMPLEDIR}/%.js, ${LINTDIR}/${EXAMPLEDIR}/%.js, $(wildcard ${EXAMPLEDIR}/*.js)) \
${LINTDIR}/package.json
#############################################
# Build
#############################################
build: ${JIOLATEST}
${JIOLATEST}: ${JIOVERSION}
@echo copy
@mkdir -p $(@D)
cp $< $@
${JIOVERSION}: lib/uri/URI.js \
......@@ -20,36 +107,38 @@ ${JIOVERSION}: lib/uri/URI.js \
${SRCDIR}/queries/parser-begin.js \
${SRCDIR}/queries/build/parser.js \
${SRCDIR}/queries/parser-end.js \
${SRCDIR}/queries/query.js \
${SRCDIR}/jio.date/*.js \
${SRCDIR}/jio.js \
${LINTDIR}/queries/query.js \
${LINTDIR}/jio.date/jiodate.js \
${LINTDIR}/jio.js \
node_modules/rusha/rusha.js \
${SRCDIR}/jio.storage/replicatestorage.js \
${SRCDIR}/jio.storage/shastorage.js \
${SRCDIR}/jio.storage/uuidstorage.js \
${SRCDIR}/jio.storage/memorystorage.js \
${SRCDIR}/jio.storage/zipstorage.js \
${SRCDIR}/jio.storage/parserstorage.js \
${SRCDIR}/jio.storage/httpstorage.js \
${SRCDIR}/jio.storage/dropboxstorage.js \
${SRCDIR}/jio.storage/davstorage.js \
${SRCDIR}/jio.storage/gdrivestorage.js \
${SRCDIR}/jio.storage/unionstorage.js \
${SRCDIR}/jio.storage/erp5storage.js \
${SRCDIR}/jio.storage/querystorage.js \
${SRCDIR}/jio.storage/drivetojiomapping.js \
${SRCDIR}/jio.storage/documentstorage.js \
${SRCDIR}/jio.storage/localstorage.js \
${SRCDIR}/jio.storage/indexeddbstorage.js \
${SRCDIR}/jio.storage/cryptstorage.js \
${SRCDIR}/jio.storage/websqlstorage.js \
${SRCDIR}/jio.storage/fbstorage.js \
${SRCDIR}/jio.storage/cloudooostorage.js
${LINTDIR}/jio.storage/replicatestorage.js \
${LINTDIR}/jio.storage/shastorage.js \
${LINTDIR}/jio.storage/uuidstorage.js \
${LINTDIR}/jio.storage/memorystorage.js \
${LINTDIR}/jio.storage/zipstorage.js \
${LINTDIR}/jio.storage/parserstorage.js \
${LINTDIR}/jio.storage/httpstorage.js \
${LINTDIR}/jio.storage/dropboxstorage.js \
${LINTDIR}/jio.storage/davstorage.js \
${LINTDIR}/jio.storage/gdrivestorage.js \
${LINTDIR}/jio.storage/unionstorage.js \
${LINTDIR}/jio.storage/erp5storage.js \
${LINTDIR}/jio.storage/querystorage.js \
${LINTDIR}/jio.storage/drivetojiomapping.js \
${LINTDIR}/jio.storage/documentstorage.js \
${LINTDIR}/jio.storage/localstorage.js \
${LINTDIR}/jio.storage/indexeddbstorage.js \
${LINTDIR}/jio.storage/cryptstorage.js \
${LINTDIR}/jio.storage/websqlstorage.js \
${LINTDIR}/jio.storage/fbstorage.js \
${LINTDIR}/jio.storage/cloudooostorage.js
@echo concat
@mkdir -p $(@D)
cat $^ > $@
######################## JISON ########################
#############################################
# Jison
#############################################
# dir
QUERIES_DIR = src/queries
......@@ -69,6 +158,7 @@ compile:
.phony: clean
clean:
rm -rf ${LINTDIR}
find -name '*~' -delete
realclean:
......
......@@ -9,7 +9,7 @@ The documentation can be found on [https://jio.nexedi.com/](https://jio.nexedi.c
### jIO Quickstart
git clone https://lab.nexedi.com/nexedi/jio.git
npm install
grunt server
make
### jIO Code
......
......@@ -14,8 +14,8 @@
"test": "test"
},
"scripts": {
"lint": "./node_modules/.bin/grunt lint",
"prepublish": "make"
"lint": "make lint",
"prepublish": "make build"
},
"repository": {
"type": "git",
......@@ -35,10 +35,8 @@
},
"devDependencies": {
"renderjs": "git+https://lab.nexedi.com/romain/renderjs.git#wip",
"grunt": "0.4.x",
"grunt-cli": "~0.1.11",
"grunt-contrib-qunit": "~0.3.0",
"grunt-jslint": "~1.0.0",
"jslint": "0.9.2",
"lz-string": "^1.4.4",
"sinon": "~1.7.3",
"jison": "~0.4.16"
......
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