Skip to content

Commit 76ef3a0

Browse files
committed
Re-organize dist directories.
There's now only a "dist" directory.
1 parent c45c7e4 commit 76ef3a0

17 files changed

+1644
-3783
lines changed

.gitignore

-2
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

Gruntfile.js

+13-26
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function(grunt) {
3838
"*/\n" +
3939
"/* Build: v<%= pkg.version %> <%= grunt.template.today('dd-mmmm-yyyy hh:MM:ss') %> */"
4040
},
41-
build_dir: "build",
41+
build_dir: "dist",
4242
//Parser lib copy for versions that can't use requirejs
4343
parserlib: "node_modules/parserlib/lib/node-parserlib.js",
4444
//clone copy for versions that can't use requirejs
@@ -58,8 +58,7 @@ module.exports = function(grunt) {
5858
],
5959
// Task configuration.
6060
clean: {
61-
build: ["<%= build_dir %>"],
62-
release: ["release"]
61+
dist: "<%= build_dir %>"
6362
},
6463
changelog: {
6564
dest: "CHANGELOG"
@@ -94,8 +93,7 @@ module.exports = function(grunt) {
9493
footer: "\nexports.CSSLint = CSSLint;"
9594
},
9695
files: {
97-
"<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"],
98-
"<%= build_dir %>/npm/lib/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
96+
"<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
9997
}
10098
},
10199
node_cli: {
@@ -106,7 +104,7 @@ module.exports = function(grunt) {
106104
"src/cli/common.js",
107105
"src/cli/node.js"
108106
],
109-
dest: "<%= build_dir %>/npm/cli.js"
107+
dest: "<%= build_dir %>/cli.js"
110108
},
111109
tests: {
112110
src: [
@@ -136,21 +134,8 @@ module.exports = function(grunt) {
136134
dest: "<%= build_dir %>/<%= pkg.name %>-wsh.js"
137135
}
138136
},
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/"
150-
}
151-
},
152137
includereplace: {
153-
release: {
138+
dist: {
154139
options: {
155140
// Global variables available in all files
156141
globals: {
@@ -163,7 +148,7 @@ module.exports = function(grunt) {
163148
expand: true,
164149
cwd: "<%= build_dir %>/",
165150
src: "**/*",
166-
dest: "release/"
151+
dest: "<%= build_dir %>/"
167152
}]
168153
}
169154
},
@@ -223,14 +208,16 @@ module.exports = function(grunt) {
223208
grunt.loadTasks("tasks");
224209

225210
// Default task.
226-
grunt.registerTask("default", ["test"]);
211+
grunt.registerTask("default", ["build", "test"]);
212+
213+
grunt.registerTask("build", ["clean", "concat", "includereplace"]);
227214

228-
// Alias for
215+
//Alias for
229216
grunt.registerTask("lint", ["jshint"]);
230217

231218
// Testing
232-
grunt.registerTask("test", ["clean:build", "jshint", "concat", "yuitest"]);
233-
grunt.registerTask("rhino", ["clean:build", "jshint", "concat", "test_rhino"]);
219+
grunt.registerTask("test", ["build", "jshint", "yuitest"]);
220+
grunt.registerTask("rhino", ["build", "jshint", "test_rhino"]);
234221

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

demos/CSSLintDemo.htm

+1-1
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>

release/npm/cli.js dist/cli.js

+32-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env node
22
/*!
33
CSSLint
4-
Copyright (c) 2013 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
4+
Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
7-
of this software and associated documentation files (the "Software"), to deal
7+
of this software and associated documentation files (the 'Software'), to deal
88
in the Software without restriction, including without limitation the rights
99
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1010
copies of the Software, and to permit persons to whom the Software is
@@ -13,7 +13,7 @@ furnished to do so, subject to the following conditions:
1313
The above copyright notice and this permission notice shall be included in
1414
all copies or substantial portions of the Software.
1515
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1717
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1818
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1919
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -22,11 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
THE SOFTWARE.
2323
2424
*/
25-
/* Build: v0.10.0 15-August-2013 01:07:22 *//*
25+
/* Build: v0.10.0 11-April-2014 12:11:52 *//*
2626
* Encapsulates all of the CLI functionality. The api argument simply
2727
* provides environment-specific functionality.
2828
*/
29-
/*global CSSLint*/
29+
30+
/* exported cli */
31+
3032
function cli(api){
3133

3234
var globalOptions = {
@@ -195,8 +197,8 @@ function cli(api){
195197
*/
196198
function outputHelp(){
197199
var lenToPad = 40,
198-
toPrint = '',
199-
formatString = '';
200+
toPrint = "",
201+
formatString = "";
200202

201203
api.print([
202204
"\nUsage: csslint-rhino.js [options]* [file|dir]*",
@@ -209,14 +211,14 @@ function cli(api){
209211
// Print the option name and the format if present
210212
toPrint += " --" + optionName;
211213
if (globalOptions[optionName].format !== "") {
212-
formatString = '=' + globalOptions[optionName].format;
214+
formatString = "=" + globalOptions[optionName].format;
213215
toPrint += formatString;
214216
} else {
215-
formatString = '';
217+
formatString = "";
216218
}
217219

218220
// Pad out with the appropriate number of spaces
219-
toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(' ');
221+
toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(" ");
220222

221223
// Print the description
222224
toPrint += globalOptions[optionName].description + "\n";
@@ -306,18 +308,30 @@ function cli(api){
306308
}
307309

308310
function validateOptions(options) {
309-
for (var option_key in options) {
310-
if (!globalOptions.hasOwnProperty(option_key) && option_key !== 'files') {
311-
api.print(option_key + ' is not a valid option. Exiting...');
311+
for (var optionKey in options) {
312+
if (!globalOptions.hasOwnProperty(optionKey) && optionKey !== "files") {
313+
api.print(optionKey + " is not a valid option. Exiting...");
312314
outputHelp();
313315
api.quit(0);
314316
}
315317
}
316318
}
317319

318320
function readConfigFile(options) {
319-
var data = api.readFile(api.getFullPath(".csslintrc"));
321+
var data = api.readFile(api.getFullPath(".csslintrc")),
322+
json;
320323
if (data) {
324+
if (data.charAt(0) === "{") {
325+
try {
326+
json = JSON.parse(data);
327+
data = "";
328+
for (var optionName in json) {
329+
if (json.hasOwnProperty(optionName)) {
330+
data += "--" + optionName + "=" + json[optionName].join();
331+
}
332+
}
333+
} catch(e) {}
334+
}
321335
options = processArguments(data.split(/[\s\n\r]+/m), options);
322336
}
323337

@@ -365,12 +379,13 @@ function cli(api){
365379
* CSSLint Node.js Command Line Interface
366380
*/
367381

368-
/*jshint node:true*/
369-
/*global cli*/
382+
/* jshint node:true */
383+
/* global cli */
384+
/* exported CSSLint */
370385

371386
var fs = require("fs"),
372387
path = require("path"),
373-
CSSLint = require("./lib/csslint-node").CSSLint;
388+
CSSLint = require("./csslint-node").CSSLint;
374389

375390
cli({
376391
args: process.argv.slice(2),

0 commit comments

Comments
 (0)