Permalink
Browse files

Re-organize dist directories.

There's now only a "dist" directory.
  • Loading branch information...
1 parent c45c7e4 commit 76ef3a08d97d98352bd0901c8fecc729c9966af4 @XhmikosR XhmikosR committed Apr 8, 2014
View
@@ -1,7 +1,5 @@
-/build/
/node_modules/
/npm-debug.log
-/release/npm/README.md
csslint.pnproj
# Diff files
View
@@ -38,7 +38,7 @@ module.exports = function(grunt) {
"*/\n" +
"/* Build: v<%= pkg.version %> <%= grunt.template.today('dd-mmmm-yyyy hh:MM:ss') %> */"
},
- build_dir: "build",
+ build_dir: "dist",
//Parser lib copy for versions that can't use requirejs
parserlib: "node_modules/parserlib/lib/node-parserlib.js",
//clone copy for versions that can't use requirejs
@@ -58,8 +58,7 @@ module.exports = function(grunt) {
],
// Task configuration.
clean: {
- build: ["<%= build_dir %>"],
- release: ["release"]
+ dist: "<%= build_dir %>"
},
changelog: {
dest: "CHANGELOG"
@@ -94,8 +93,7 @@ module.exports = function(grunt) {
footer: "\nexports.CSSLint = CSSLint;"
},
files: {
- "<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"],
- "<%= build_dir %>/npm/lib/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
+ "<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
}
},
node_cli: {
@@ -106,7 +104,7 @@ module.exports = function(grunt) {
"src/cli/common.js",
"src/cli/node.js"
],
- dest: "<%= build_dir %>/npm/cli.js"
+ dest: "<%= build_dir %>/cli.js"
},
tests: {
src: [
@@ -136,21 +134,8 @@ module.exports = function(grunt) {
dest: "<%= build_dir %>/<%= pkg.name %>-wsh.js"
}
},
- copy: {
- build: {
- expand: true,
- cwd: "<%= build_dir %>/",
- src: "**/*",
- dest: "release/"
- },
- npm: {
- expand: true,
- src: ["README.md", "package.json"],
- dest: "release/npm/"
- }
- },
includereplace: {
- release: {
+ dist: {
options: {
// Global variables available in all files
globals: {
@@ -163,7 +148,7 @@ module.exports = function(grunt) {
expand: true,
cwd: "<%= build_dir %>/",
src: "**/*",
- dest: "release/"
+ dest: "<%= build_dir %>/"
}]
}
},
@@ -223,14 +208,16 @@ module.exports = function(grunt) {
grunt.loadTasks("tasks");
// Default task.
- grunt.registerTask("default", ["test"]);
+ grunt.registerTask("default", ["build", "test"]);
+
+ grunt.registerTask("build", ["clean", "concat", "includereplace"]);
- // Alias for
+ //Alias for
grunt.registerTask("lint", ["jshint"]);
// Testing
- grunt.registerTask("test", ["clean:build", "jshint", "concat", "yuitest"]);
- grunt.registerTask("rhino", ["clean:build", "jshint", "concat", "test_rhino"]);
+ grunt.registerTask("test", ["build", "jshint", "yuitest"]);
+ grunt.registerTask("rhino", ["build", "jshint", "test_rhino"]);
- grunt.registerTask("release", ["test", "clean:release", "copy", "includereplace:release", "changelog"]);
+ grunt.registerTask("release", ["default", "changelog"]);
};
@@ -8,7 +8,7 @@
.error { color: #D9534F; font-weight: bold; }
.warning { color: #F0AD4E; }
</style>
- <script src="../build/csslint.js"></script>
+ <script src="../dist/csslint.js"></script>
<script src="demo.js"></script>
</head>
<body>
@@ -1,10 +1,10 @@
#!/usr/bin/env node
/*!
CSSLint
-Copyright (c) 2013 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
+Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
+of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
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
THE SOFTWARE.
*/
-/* Build: v0.10.0 15-August-2013 01:07:22 *//*
+/* Build: v0.10.0 11-April-2014 12:11:52 *//*
* Encapsulates all of the CLI functionality. The api argument simply
* provides environment-specific functionality.
*/
-/*global CSSLint*/
+
+/* exported cli */
+
function cli(api){
var globalOptions = {
@@ -195,8 +197,8 @@ function cli(api){
*/
function outputHelp(){
var lenToPad = 40,
- toPrint = '',
- formatString = '';
+ toPrint = "",
+ formatString = "";
api.print([
"\nUsage: csslint-rhino.js [options]* [file|dir]*",
@@ -209,14 +211,14 @@ function cli(api){
// Print the option name and the format if present
toPrint += " --" + optionName;
if (globalOptions[optionName].format !== "") {
- formatString = '=' + globalOptions[optionName].format;
+ formatString = "=" + globalOptions[optionName].format;
toPrint += formatString;
} else {
- formatString = '';
+ formatString = "";
}
// Pad out with the appropriate number of spaces
- toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(' ');
+ toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(" ");
// Print the description
toPrint += globalOptions[optionName].description + "\n";
@@ -306,18 +308,30 @@ function cli(api){
}
function validateOptions(options) {
- for (var option_key in options) {
- if (!globalOptions.hasOwnProperty(option_key) && option_key !== 'files') {
- api.print(option_key + ' is not a valid option. Exiting...');
+ for (var optionKey in options) {
+ if (!globalOptions.hasOwnProperty(optionKey) && optionKey !== "files") {
+ api.print(optionKey + " is not a valid option. Exiting...");
outputHelp();
api.quit(0);
}
}
}
function readConfigFile(options) {
- var data = api.readFile(api.getFullPath(".csslintrc"));
+ var data = api.readFile(api.getFullPath(".csslintrc")),
+ json;
if (data) {
+ if (data.charAt(0) === "{") {
+ try {
+ json = JSON.parse(data);
+ data = "";
+ for (var optionName in json) {
+ if (json.hasOwnProperty(optionName)) {
+ data += "--" + optionName + "=" + json[optionName].join();
+ }
+ }
+ } catch(e) {}
+ }
options = processArguments(data.split(/[\s\n\r]+/m), options);
}
@@ -365,12 +379,13 @@ function cli(api){
* CSSLint Node.js Command Line Interface
*/
-/*jshint node:true*/
-/*global cli*/
+/* jshint node:true */
+/* global cli */
+/* exported CSSLint */
var fs = require("fs"),
path = require("path"),
- CSSLint = require("./lib/csslint-node").CSSLint;
+ CSSLint = require("./csslint-node").CSSLint;
cli({
args: process.argv.slice(2),
Oops, something went wrong.

0 comments on commit 76ef3a0

Please sign in to comment.