Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Modularize #726

Merged
merged 11 commits into from
Oct 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
.tscache/
build/
bin/tslint-cli.js
lib/tslint.js
lib/
node_modules/
tscommand*.txt
92 changes: 14 additions & 78 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,18 @@ module.exports = function (grunt) {
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
typescriptBin: "node_modules/typescript/lib/typescriptServices.js",

clean: {
bin: ["bin/tslint-cli.js"],
core: ["build/rules/", "build/formatters", "lib/tslint.*"],
test: ["build/test/"],
},

concat: {
bin: {
src: ["<%= typescriptBin %>", "bin/tslint-cli.js"],
dest: "bin/tslint-cli.js"
},
core: {
src: ["<%= typescriptBin %>", "lib/tslint.js"],
dest: "lib/tslint.js"
},
test: {
src: ["lib/tslint.js", "build/tslint-tests.js"],
dest: "build/tslint-tests.js"
}
core: ["lib/**/*.js", "lib/**/*.d.ts"],
test: ["build/"]
},

mochaTest: {
test: {
options: {
reporter: "spec"
},
src: ["build/tslint-tests.js"]
src: ["build/test/**/*.js"]
}
},

Expand Down Expand Up @@ -80,95 +63,48 @@ module.exports = function (grunt) {
options: {
noImplicitAny: true,
sourceMap: false,
target: "es5"
},

bin: {
src: [
"typings/*.d.ts",
"src/language/walker/syntaxWalker.ts",
"src/language/walker/ruleWalker.ts",
"src/language/walker/scopeAwareRuleWalker.ts",
"src/language/**/*.ts",
"src/!(tslint-cli).ts",
"src/tslint-cli.ts"
],
out: "bin/tslint-cli.js"
target: "es5",
module: "commonjs"
},

core: {
options: {
declaration: true,
module: "commonjs"
declaration: true
},
src: [
"typings/*.d.ts",
"src/language/walker/syntaxWalker.ts",
"src/language/walker/ruleWalker.ts",
"src/language/walker/scopeAwareRuleWalker.ts",
"src/language/**/*.ts",
"src/*.ts",
"!src/tslint-cli.ts"
"src/**/*.ts",
],
out: "lib/tslint.js"
},

core_rules: {
options: {
base_path: "src/rules",
module: "commonjs"
},
src: [
"typings/*.d.ts",
"lib/tslint.d.ts",
"src/rules/*.ts"
],
outDir: "build/rules/"
},

core_formatters: {
options: {
base_path: "src/formatters",
module: "commonjs"
},
src: [
"typings/*.d.ts",
"lib/tslint.d.ts",
"src/formatters/*.ts"
],
outDir: "build/formatters/"
outDir: "lib/"
},

test: {
src: [
"typings/*.d.ts",
"lib/tslint.d.ts",
"src/**/*.ts",
"test/typings/*.d.ts",
"test/chaiAssert.d.ts",
"test/**/*.ts",
"!test/files/**/*.ts"
],
out: "build/tslint-tests.js"
outDir: "build/"
}
}
});

// load NPM tasks
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-jscs");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-run");
grunt.loadNpmTasks("grunt-tslint");
grunt.loadNpmTasks("grunt-ts");

// register custom tasks
grunt.registerTask("core", ["clean:core", "ts:core", "concat:core", "ts:core_rules", "ts:core_formatters"]);
grunt.registerTask("bin", ["clean:bin", "ts:bin", "tslint:src", "concat:bin"]);
grunt.registerTask("test", ["clean:test", "ts:test", "tslint:test", "concat:test", "mochaTest"]
grunt.registerTask("core", ["clean:core", "ts:core"]);
grunt.registerTask("test", ["clean:test", "ts:test", "tslint:test", "mochaTest"]
.concat(checkBinTest));

grunt.registerTask("concat-and-test", ["concat:test", "mochaTest"]);

// create default task
grunt.registerTask("default", ["jscs", "core", "bin", "test"]);
grunt.registerTask("default", ["jscs", "core", "test"]);
};
2 changes: 1 addition & 1 deletion bin/tslint
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require("./tslint-cli");
require("../lib/tslint-cli");
Empty file added lib/.gitkeep
Empty file.
Loading