-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
131 lines (123 loc) · 4.57 KB
/
gruntfile.js
File metadata and controls
131 lines (123 loc) · 4.57 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* ts-debug
* https://github.com/nevware21/ts-debug
*
* Copyright (c) 2022 Nevware21
* 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_debug": {
// Default ES5
tsconfig: "./dbg/tsconfig.json",
outDir: "./dbg/dist-es5"
},
"ts_debug_es6": {
tsconfig: "./dbg/tsconfig.es6.json",
outDir: "./dbg/dist-es6"
},
"ts_debug-test": {
tsconfig: "./dbg/test/tsconfig.test.json",
outDir: "./dbg/test-esm"
},
"ts_debug_providers": {
// Default ES5
tsconfig: "./providers/tsconfig.json",
outDir: "./providers/dist-es5"
},
"ts_debug_providers_es6": {
tsconfig: "./providers/tsconfig.es6.json",
outDir: "./providers/dist-es6"
},
"ts_debug_providers-test": {
tsconfig: "./providers/test/tsconfig.test.json",
outDir: "./providers/test-esm"
}
},
"lint": {
options: {
format: "codeframe",
suppressWarnings: false
},
"ts_debug": {
tsconfig: "./dbg/tsconfig.json",
ignoreFailures: true
},
"ts_debug-test": {
tsconfig: "./dbg/test/tsconfig.test.json",
ignoreFailures: true
},
"ts_debug-fix": {
options: {
tsconfig: "./dbg/tsconfig.json",
fix: true
}
},
"ts_debug-test-fix": {
options: {
tsconfig: "./dbg/test/tsconfig.test.json",
fix: true
}
},
"ts_debug_providers": {
tsconfig: "./providers/tsconfig.json",
ignoreFailures: true
},
"ts_debug_providers-test": {
tsconfig: "./providers/test/tsconfig.test.json",
ignoreFailures: true
},
"ts_debug_providers-fix": {
options: {
tsconfig: "./providers/tsconfig.json",
fix: true
}
},
"ts_debug_providers-test-fix": {
options: {
tsconfig: "./providers/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_debug", [ "lint:ts_debug-fix", "lint:ts_debug-test-fix", "ts:ts_debug", "ts:ts_debug_es6", "ts:ts_debug-test" ]);
grunt.registerTask("ts_debug-test", [ "lint:ts_debug-test-fix", "ts:ts_debug-test" ]);
grunt.registerTask("ts_debug-lint", [ "lint:ts_debug-fix", "lint:ts_debug-test-fix" ]);
grunt.registerTask("dolint", [ "lint:ts_debug", "lint:ts_debug-test" ]);
grunt.registerTask("ts_debug_providers", [ "lint:ts_debug_providers-fix", "lint:ts_debug_providers-test-fix", "ts:ts_debug_providers", "ts:ts_debug_providers_es6", "ts:ts_debug_providers-test" ]);
grunt.registerTask("ts_debug_providers-test", [ "lint:ts_debug_providers-test-fix", "ts:ts_debug_providers-test" ]);
grunt.registerTask("ts_debug_providers-lint", [ "lint:ts_debug_providers-fix", "lint:ts_debug_providers-test-fix" ]);
grunt.registerTask("dolint", [ "lint:ts_debug", "lint:ts_debug-test", "lint:ts_debug_providers", "lint:ts_debug_providers-test" ]);
grunt.registerTask("lint-fix", [ "lint:ts_debug-fix", "lint:ts_debug-test-fix", "lint:ts_debug_providers-fix", "lint:ts_debug_providers-test-fix" ]);
// By default, lint and run all tests.
grunt.registerTask("default", ["jshint" ]);
};