Skip to content

Commit 94c6db9

Browse files
committed
Merge pull request #500 from XhmikosR/master
Re-organize dist folders
2 parents c45c7e4 + e816f4f commit 94c6db9

27 files changed

+3968
-4341
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Auto detect text files and perform LF normalization
2-
* text=auto
2+
* text eol=lf
3+
*.jar binary

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/build/
21
/node_modules/
32
/npm-debug.log
4-
/release/npm/README.md
53
csslint.pnproj
64

75
# Diff files

.jshintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"camelcase": true,
33
"curly": true,
44
"eqeqeq": true,
5+
"es3": true,
56
"forin": true,
67
"immed": true,
78
"indent": 4,
@@ -15,7 +16,6 @@
1516
"undef": true,
1617
"unused": true,
1718
"globals": {
18-
"CSSLint": true,
19-
"YUITest": true
19+
"CSSLint": true
2020
}
21-
}
21+
}

Gruntfile.js

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44

55
module.exports = function(grunt) {
66

7+
// Force use of Unix newlines
8+
grunt.util.linefeed = "\n";
9+
710
// Project configuration.
811
grunt.initConfig({
912
// Metadata.
1013
pkg: grunt.file.readJSON("package.json"),
11-
banner: {
12-
compact: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
13-
"<%= grunt.template.today('yyyy-mm-dd') %>\n" +
14-
"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
15-
"* Copyright (c) <%= grunt.template.today('yyyy') %> Nicole Sullivan and Nicholas C. Zakas;\n" +
16-
"* Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> <%= _.pluck(pkg.licenses, 'url').join(', ') %> */\n",
17-
full: "/*!\n" +
18-
"CSSLint\n" +
14+
banner: "/*!\n" +
15+
"CSSLint v<%= pkg.version %>\n" +
1916
"Copyright (c) <%= grunt.template.today('yyyy') %> Nicole Sullivan and Nicholas C. Zakas. All rights reserved.\n" +
2017
"\n" +
2118
"Permission is hereby granted, free of charge, to any person obtaining a copy\n" +
@@ -35,10 +32,8 @@ module.exports = function(grunt) {
3532
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n" +
3633
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n" +
3734
"THE SOFTWARE.\n\n" +
38-
"*/\n" +
39-
"/* Build: v<%= pkg.version %> <%= grunt.template.today('dd-mmmm-yyyy hh:MM:ss') %> */"
40-
},
41-
build_dir: "build",
35+
"*/\n",
36+
build_dir: "dist",
4237
//Parser lib copy for versions that can't use requirejs
4338
parserlib: "node_modules/parserlib/lib/node-parserlib.js",
4439
//clone copy for versions that can't use requirejs
@@ -56,101 +51,91 @@ module.exports = function(grunt) {
5651
"<%= clone %>",
5752
"<%= csslint_files %>"
5853
],
54+
5955
// Task configuration.
6056
clean: {
61-
build: ["<%= build_dir %>"],
62-
release: ["release"]
57+
dist: "<%= build_dir %>"
6358
},
59+
6460
changelog: {
6561
dest: "CHANGELOG"
6662
},
63+
6764
concat: {
6865
core: {
6966
options: {
70-
banner: "<%= banner.full %>\n" +
71-
//Hack for using the node version of parserlib
72-
"var exports = exports || {};\n" +
67+
banner: "<%= banner %>\n" +
68+
// Hack for using the node version of parserlib and clone
69+
"var module = module || {},\n" +
70+
" exports = exports || {};\n\n" +
7371
"var CSSLint = (function(){\n",
7472
footer: "\nreturn CSSLint;\n})();"
7573
},
7674
src: [
7775
"<%= core_files %>"
7876
],
79-
dest: "<%= build_dir %>/<%= pkg.name %>.js"
77+
dest: "<%= build_dir %>/csslint.js"
8078
},//Build environment workers
8179
rhino: {
8280
src: [
8381
"<%= concat.core.dest %>",
8482
"src/cli/common.js",
8583
"src/cli/rhino.js"
8684
],
87-
dest: "<%= build_dir %>/<%= pkg.name %>-rhino.js"
85+
dest: "<%= build_dir %>/csslint-rhino.js"
8886
},
8987
node: {
9088
options: {
91-
banner: "<%= banner.full %>\n" +
89+
banner: "<%= banner %>" +
9290
"var clone = require('clone');\n" +
9391
"var parserlib = require('parserlib');\n",
9492
footer: "\nexports.CSSLint = CSSLint;"
9593
},
9694
files: {
97-
"<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"],
98-
"<%= build_dir %>/npm/lib/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
95+
"<%= build_dir %>/csslint-node.js": ["<%= csslint_files %>"]
9996
}
10097
},
10198
node_cli: {
10299
options: {
103-
banner: "#!/usr/bin/env node\n<%= banner.full %>"
100+
banner: "#!/usr/bin/env node\n<%= banner %>"
104101
},
105102
src: [
106103
"src/cli/common.js",
107104
"src/cli/node.js"
108105
],
109-
dest: "<%= build_dir %>/npm/cli.js"
106+
dest: "<%= build_dir %>/cli.js"
110107
},
111108
tests: {
112109
src: [
113110
"tests/**/*.js",
114111
"!tests/all-rules.js"
115112
],
116-
dest: "<%= build_dir %>/<%= pkg.name %>-tests.js"
113+
dest: "<%= build_dir %>/csslint-tests.js"
117114
},
118115
worker: {
119116
options: {
120-
banner: "<%= banner.full %>\n" +
117+
banner: "<%= banner %>" +
121118
//Hack for using the node version of parserlib
122119
"var exports = exports || {};\n"
123120
},
124121
src: [
125122
"<%= core_files %>",
126123
"src/worker/*.js"
127124
],
128-
dest: "<%= build_dir %>/<%= pkg.name %>-worker.js"
125+
dest: "<%= build_dir %>/csslint-worker.js"
129126
},
130127
wsh: {
131128
src: [
132129
"<%= concat.core.dest %>",
133130
"src/cli/common.js",
134131
"src/cli/wsh.js"
135132
],
136-
dest: "<%= build_dir %>/<%= pkg.name %>-wsh.js"
137-
}
138-
},
139-
copy: {
140-
build: {
141-
expand: true,
142-
cwd: "<%= build_dir %>/",
143-
src: "**/*",
144-
dest: "release/"
145-
},
146-
npm: {
147-
expand: true,
148-
src: ["README.md", "package.json"],
149-
dest: "release/npm/"
133+
dest: "<%= build_dir %>/csslint-wsh.js"
150134
}
151135
},
136+
152137
includereplace: {
153-
release: {
138+
dist: {
154139
options: {
155140
// Global variables available in all files
156141
globals: {
@@ -163,48 +148,55 @@ module.exports = function(grunt) {
163148
expand: true,
164149
cwd: "<%= build_dir %>/",
165150
src: "**/*",
166-
dest: "release/"
151+
dest: "<%= build_dir %>/"
167152
}]
168153
}
169154
},
155+
170156
jshint: {
171157
options: {
172158
jshintrc: ".jshintrc"
173159
},
174160
gruntfile: {
175161
src: ["Gruntfile.js", "tasks/*.js"]
176162
},
163+
core: {
164+
src: "src/**/*.js"
165+
},
177166
demo: {
178167
src: "demos/*.js"
179168
},
180-
all: {
181-
src: "src/**/*.js"
182-
},
183169
tests: {
170+
options: {
171+
jshintrc: "tests/.jshintrc"
172+
},
184173
src: "tests/**/*.js"
185174
}
186175
},
176+
187177
watch: {
188178
gruntfile: {
189179
files: "<%= jshint.gruntfile.src %>",
190-
tasks: ["jshint"]
180+
tasks: "jshint"
191181
},
192182
src: {
193183
files: "<%= jshint.all.src %>",
194-
tasks: ["jshint:all"]
184+
tasks: "jshint:core"
195185
},
196186
lib_test: {
197187
files: "<%= jshint.tests.src %>",
198-
tasks: ["jshint:tests"]
188+
tasks: "jshint:tests"
199189
}
200190
},
191+
201192
yuitest: {
202193
tests: {
203194
src: [
204195
"tests/**/*.js"
205196
]
206197
}
207198
},
199+
208200
test_rhino: {
209201
tests: {
210202
src: [
@@ -223,14 +215,17 @@ module.exports = function(grunt) {
223215
grunt.loadTasks("tasks");
224216

225217
// Default task.
226-
grunt.registerTask("default", ["test"]);
218+
grunt.registerTask("default", ["build", "test"]);
219+
220+
grunt.registerTask("build", ["clean", "concat", "includereplace"]);
227221

228-
// Alias for
229-
grunt.registerTask("lint", ["jshint"]);
222+
//Alias for
223+
grunt.registerTask("dist", "build");
224+
grunt.registerTask("lint", "jshint");
230225

231226
// Testing
232-
grunt.registerTask("test", ["clean:build", "jshint", "concat", "yuitest"]);
233-
grunt.registerTask("rhino", ["clean:build", "jshint", "concat", "test_rhino"]);
227+
grunt.registerTask("test", ["build", "jshint", "yuitest"]);
228+
grunt.registerTask("rhino", ["build", "jshint", "test_rhino"]);
234229

235-
grunt.registerTask("release", ["test", "clean:release", "copy", "includereplace:release", "changelog"]);
230+
grunt.registerTask("release", ["default", "changelog"]);
236231
};

demos/CSSLintDemo.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.error { color: #D9534F; font-weight: bold; }
99
.warning { color: #F0AD4E; }
1010
</style>
11-
<script src="../build/csslint.js"></script>
11+
<script src="../dist/csslint.js"></script>
1212
<script src="demo.js"></script>
1313
</head>
1414
<body>

0 commit comments

Comments
 (0)