-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
96 lines (88 loc) · 2.87 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* ts-utils
* https://github.com/nevware21/ts-utils
*
* Copyright (c) 2022 NevWare21 Solutions LLC
* Licensed under the MIT license.
*/
"use strict";
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
"Gruntfile.js",
"<%= nodeunit.tests %>"
],
options: {
jshintrc: ".jshintrc"
}
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ["tmp"]
},
// Unit tests.
nodeunit: {
tests: ["test/*_test.js"]
},
ts: {
options: {
debug: true,
logOutput: true
},
"ts_utils": {
// Default ES5
tsconfig: "./lib/tsconfig.json",
outDir: "./lib/build/es5/mod"
},
"ts_utils_es6": {
tsconfig: "./lib/tsconfig.es6.json",
outDir: "./lib/build/es6/mod"
},
"ts_utils-test": {
tsconfig: "./lib/test/tsconfig.test.json",
outDir: "./lib/test/build-es5"
}
},
"lint": {
options: {
format: "codeframe",
suppressWarnings: false
},
"ts_utils": {
tsconfig: "./lib/tsconfig.json",
ignoreFailures: true
},
"ts_utils-test": {
tsconfig: "./lib/test/tsconfig.test.json",
ignoreFailures: true
},
"ts_utils-fix": {
options: {
tsconfig: "./lib/tsconfig.json",
fix: true
}
},
"ts_utils-test-fix": {
options: {
tsconfig: "./lib/test/tsconfig.test.json",
fix: true
}
}
}
});
// Actually load this plugin's task(s).
grunt.loadNpmTasks("@nevware21/grunt-ts-plugin");
grunt.loadNpmTasks("@nevware21/grunt-eslint-ts");
grunt.registerTask("rollupuglify", ["ts:rollupuglify" ]);
grunt.registerTask("ts_utils", [ "lint:ts_utils-fix", "lint:ts_utils-test-fix", "ts:ts_utils", "ts:ts_utils_es6" ]);
grunt.registerTask("ts_utils-lint", [ "lint:ts_utils-fix", "lint:ts_utils-test-fix" ]);
grunt.registerTask("dolint", [ "lint:ts_utils", "lint:ts_utils-test" ]);
grunt.registerTask("lint-fix", [ "lint:ts_utils-fix", "lint:ts_utils-test-fix" ]);
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
// grunt.registerTask('ts_utils_test', ['clean', 'ts_utils']);
// By default, lint and run all tests.
grunt.registerTask("default", ["jshint" ]);
};