mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
feature(package) gulp -> npm scripts
This commit is contained in:
parent
83a1e9a7ea
commit
8066cab451
8 changed files with 87 additions and 61 deletions
|
|
@ -5,7 +5,6 @@ node_js:
|
|||
- 0.12
|
||||
|
||||
script:
|
||||
- npm run yaspeller
|
||||
- npm test
|
||||
|
||||
notifications:
|
||||
|
|
|
|||
36
gulp/docs.js → bin/release.js
Normal file → Executable file
36
gulp/docs.js → bin/release.js
Normal file → Executable file
|
|
@ -1,15 +1,24 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var DIR = '../',
|
||||
Info = require(DIR + 'package'),
|
||||
|
||||
cl = require('./cl'),
|
||||
minor = require('minor'),
|
||||
place = require('place'),
|
||||
rendy = require('rendy'),
|
||||
shortdate = require('shortdate'),
|
||||
Info = require(DIR + 'package');
|
||||
|
||||
module.exports = function(callback) {
|
||||
ERROR = Error('ERROR: version is missing. release --patch|--minor|--major');
|
||||
|
||||
main(function(error) {
|
||||
if (error)
|
||||
console.error(error.message);
|
||||
});
|
||||
|
||||
function main(callback) {
|
||||
var history = 'Version history\n---------------\n',
|
||||
link = '//github.com/cloudcmd/archive/raw/master/cloudcmd',
|
||||
template = '- *{{ date }}*, ' +
|
||||
|
|
@ -32,7 +41,7 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function replaceVersion(name, version, versionNew, callback) {
|
||||
place(name, version, versionNew, function(error) {
|
||||
|
|
@ -44,4 +53,23 @@
|
|||
callback(error, msg);
|
||||
});
|
||||
}
|
||||
|
||||
function cl(callback) {
|
||||
var versionNew, error,
|
||||
argv = process.argv,
|
||||
length = argv.length - 1,
|
||||
last = process.argv[length],
|
||||
regExp = /^--(major|minor|patch)$/,
|
||||
match = last.match(regExp);
|
||||
|
||||
if (!regExp.test(last))
|
||||
error = ERROR;
|
||||
else if (match[1])
|
||||
versionNew = minor(match[1], Info.version);
|
||||
else
|
||||
versionNew = last.substr(3);
|
||||
|
||||
callback(error, versionNew);
|
||||
}
|
||||
})();
|
||||
|
||||
14
bower.json
14
bower.json
|
|
@ -8,12 +8,20 @@
|
|||
"description": "orthodox web file manager with console and editor",
|
||||
"main": "bin/cloudcmd.js",
|
||||
"keywords": [
|
||||
"console",
|
||||
"editor",
|
||||
"file",
|
||||
"file manager",
|
||||
"folder",
|
||||
"orthodox",
|
||||
"file",
|
||||
"manager"
|
||||
"view",
|
||||
"copy",
|
||||
"rename",
|
||||
"move",
|
||||
"delete",
|
||||
"file operation"
|
||||
],
|
||||
"license": "MIT",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
|
|
|
|||
33
gulp/cl.js
33
gulp/cl.js
|
|
@ -1,33 +0,0 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
var DIR = '../',
|
||||
minor = require('minor'),
|
||||
Info = require(DIR + 'package'),
|
||||
ERROR = Error('ERROR: version is missing. gulp package --v<version> or --major --minor --patch'),
|
||||
|
||||
Version;
|
||||
|
||||
module.exports = function(callback) {
|
||||
var versionNew, error,
|
||||
argv = process.argv,
|
||||
length = argv.length - 1,
|
||||
last = process.argv[length],
|
||||
regExp = /^--(major|minor|patch)?/,
|
||||
match = last.match(regExp);
|
||||
|
||||
if (!Version)
|
||||
if (!regExp.test(last)) {
|
||||
error = ERROR;
|
||||
} else {
|
||||
if (match[1])
|
||||
versionNew = minor(match[1], Info.version);
|
||||
else
|
||||
versionNew = last.substr(3);
|
||||
|
||||
Version = versionNew;
|
||||
}
|
||||
|
||||
callback(error, Version);
|
||||
};
|
||||
})();
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
// jscs:disable
|
||||
/* jshint ignore:start */
|
||||
window.olark || (function (c) {
|
||||
var f = window,
|
||||
d = document,
|
||||
|
|
@ -84,4 +86,7 @@ window.olark || (function (c) {
|
|||
methods: ["configure", "extend", "declare", "identify"]
|
||||
});
|
||||
/* custom configuration goes here (www.olark.com/documentation) */
|
||||
olark.identify('6216-545-10-4223');
|
||||
olark.identify('6216-545-10-4223');
|
||||
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
|
|
|||
10
lib/util.js
10
lib/util.js
|
|
@ -1,17 +1,17 @@
|
|||
(function(scope) {
|
||||
'use strict';
|
||||
|
||||
var Scope = scope.window ? window : global;
|
||||
|
||||
/* global rendy */
|
||||
|
||||
var exec;
|
||||
var exec,
|
||||
rendy,
|
||||
Scope = scope.window ? window : global;
|
||||
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
exec = require('execon');
|
||||
rendy = require('rendy');
|
||||
module.exports = new UtilProto(exec);
|
||||
} else if (!Scope.Util) {
|
||||
exec = window.exec;
|
||||
rendy = window.rendy;
|
||||
Scope.Util = new UtilProto(exec);
|
||||
}
|
||||
|
||||
|
|
|
|||
35
package.json
35
package.json
|
|
@ -14,20 +14,32 @@
|
|||
"file",
|
||||
"file manager",
|
||||
"folder",
|
||||
"orthodox"
|
||||
"orthodox",
|
||||
"view",
|
||||
"copy",
|
||||
"rename",
|
||||
"move",
|
||||
"delete",
|
||||
"file operation"
|
||||
],
|
||||
"bin": {
|
||||
"cloudcmd": "bin/cloudcmd.js"
|
||||
},
|
||||
"config": {
|
||||
"dirs": "bin lib test"
|
||||
},
|
||||
"scripts": {
|
||||
"bower": "bower",
|
||||
"bupdate": "bupdate",
|
||||
"gulp": "gulp",
|
||||
"nupdate": "nupdate",
|
||||
"start": "node bin/cloudcmd.js",
|
||||
"test": "gulp default",
|
||||
"wisdom": "gulp release",
|
||||
"yaspeller": "yaspeller ."
|
||||
"test": "npm-run-all --parallel lint:* codestyle spell mocha",
|
||||
"lint:css": "recess css/*.css",
|
||||
"lint:js": "jshint $npm_package_config_dirs",
|
||||
"codestyle": "jscs --esnext $npm_package_config_dirs",
|
||||
"mocha": "mocha test/lib",
|
||||
"spell": "yaspeller .",
|
||||
"wisdom": "bin/release.js"
|
||||
},
|
||||
"directories": {
|
||||
"man": "man"
|
||||
|
|
@ -72,17 +84,16 @@
|
|||
"devDependencies": {
|
||||
"bower": "^1.5.3",
|
||||
"bupdate": "^1.0.4",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-jscs": "^3.0.0",
|
||||
"gulp-jshint": "^2.0.0",
|
||||
"gulp-mocha": "^2.2.0",
|
||||
"gulp-recess": "^1.2.0",
|
||||
"jscs": "^2.7.0",
|
||||
"jshint": "^2.8.0",
|
||||
"minor": "~1.2.2",
|
||||
"minor": "^1.2.2",
|
||||
"mocha": "^2.3.4",
|
||||
"morgan": "~1.6.0",
|
||||
"npm-run-all": "^1.4.0",
|
||||
"nupdate": "^2.1.0",
|
||||
"place": "~1.1.2",
|
||||
"shortdate": "~1.0.1",
|
||||
"recess": "^1.1.9",
|
||||
"shortdate": "^1.0.1",
|
||||
"should": "^8.0.0",
|
||||
"yaspeller": "^2.6.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
/* global describe, it */
|
||||
|
||||
var DIR = __dirname + '/../../',
|
||||
LIBDIR = DIR + 'lib/',
|
||||
TMPLDIR = DIR + 'tmpl/',
|
||||
|
|
@ -49,8 +51,14 @@
|
|||
'</a>/X11/' +
|
||||
'</span>' +
|
||||
'</div>';
|
||||
|
||||
describe('cloudfunc', function() {
|
||||
it('should check', function() {
|
||||
check();
|
||||
});
|
||||
});
|
||||
|
||||
exports.check = function() {
|
||||
function check() {
|
||||
var paths = {},
|
||||
|
||||
filesList = TMPL_PATH.map(function(name) {
|
||||
|
|
@ -114,5 +122,5 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue