Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mess commits on style fix

  • Loading branch information...
commit 79b5b1fcbf530f90a42cb5227577c913fab3d6dd 1 parent 6110f3c
Hsiaoming Yang authored
View
1  .jshintignore
@@ -0,0 +1 @@
+lib/utils/tar.js
View
3  scripts/lint.json → .jshintrc
@@ -7,7 +7,8 @@
"undef": false,
"unused": false,
"trailing": true,
- "asi": true,
+ "lastsemic": true,
+ "asi": false,
"boss": true,
"strict": false,
"es5": true,
View
4 Makefile
@@ -10,9 +10,9 @@ test: clean
@node_modules/.bin/mocha --reporter ${reporter} ${specs}
-files := $(shell find . -name '*.js' ! -path "*node_modules/*" ! -path "*dist/*" ! -path "*tests/data/*" ! -path "*tests/cases/*" ! -path "*tests/issues/*")
+files := $(shell find . -name '*.js' ! -path "*node_modules/*" ! -path "*dist/*" ! -path "*tests/data/*" ! -path "*tests/*cases/*" ! -path "*tests/issues/*" ! -path "*.spm-build/*")
lint:
- @node_modules/.bin/jshint ${files} --config=scripts/lint.json
+ @node_modules/.bin/jshint ${files}
out = _site/coverage.html
coverage:
View
10 lib/commands/build.js
@@ -47,7 +47,7 @@ exports.run = function(commander) {
}
);
}
- }
+ };
if (scripts.prebuild) {
@@ -85,7 +85,7 @@ function compile(settings, callback) {
if (err) logging.error(err);
});
}
- })
+ });
if (!hasCompiler) {
q.push({Compiler: compiler.CopyCompiler, filepath: filepath}, function(err) {
if (err && !_.isEmpty(err)) logging.error(err);
@@ -97,7 +97,7 @@ function compile(settings, callback) {
// end of compiling
logging.end('compiled files are in %s', settings.buildDirectory || '.spm-build');
callback(null, settings);
- }
+ };
}
function distribute(settings, callback) {
@@ -149,7 +149,7 @@ function distribute(settings, callback) {
fs.deleteSync(settings.buildDirectory);
logging.end('distributed files are in %s', settings.outputDirectory);
callback(null, settings);
- }
+ };
}
function compress(settings, callback) {
@@ -180,7 +180,7 @@ function compress(settings, callback) {
q.drain = function() {
logging.end('compress files finished');
callback(null, settings);
- }
+ };
}
View
6 lib/sdk/ast.js
@@ -102,7 +102,7 @@ exports.getRequires = getRequires;
function replaceRequire(ast, fn, output) {
- output = output || 'string'
+ output = output || 'string';
ast = getAst(ast);
var trans = new UglifyJS.TreeTransformer(function(node, descend) {
@@ -124,7 +124,7 @@ function replaceRequire(ast, fn, output) {
return ast.print_to_string({
'beautify': true,
'comments': true
- })
+ });
}
exports.replaceRequire = replaceRequire;
@@ -151,7 +151,7 @@ function replaceDefine(ast, id, deps) {
exports.replaceDefine = replaceDefine;
function replaceAll(ast, fn) {
- ast = replaceRequire(ast, fn, 'ast')
+ ast = replaceRequire(ast, fn, 'ast');
var rets = parseDefines(ast);
var data = '';
View
2  lib/sdk/compressor.js
@@ -35,7 +35,7 @@ var UglifyCompressor = BaseCompressor.extend({
run: function(callback) {
if (!this.validate()) {
- callback()
+ callback();
return;
}
View
4 lib/sdk/dependency.js
@@ -8,7 +8,7 @@ var logging = require('colorful').logging;
exports.parse = function(file, obj) {
return getRelativeDependencies(file, obj || {});
-}
+};
function getModuleDependencies(id, encoding) {
encoding = encoding || 'utf8';
@@ -26,7 +26,7 @@ function getModuleDependencies(id, encoding) {
});
});
return deps;
- }
+ };
if (fs.existsSync(file)) {
data = fs.readFileSync(file, encoding);
return flatdeps(ast.parseDefines(data));
View
8 lib/sdk/yuan.js
@@ -23,7 +23,7 @@ function getAuthToken(options, callback) {
function registerProject(options, callback) {
- var urlpath = format('/package/%s/%s', options.root, options.name);
+ var urlpath = format('/repository/%s/%s', options.root, options.name);
var data = formatRequestData(urlpath, options);
request.post(data, function(error, response, body) {
if (error) {
@@ -34,7 +34,7 @@ function registerProject(options, callback) {
}
function registerPackage(options, callback) {
- var urlpath = format('/package/%s/%s/%s', options.root, options.name, options.version);
+ var urlpath = format('/repository/%s/%s/%s', options.root, options.name, options.version);
var data = formatRequestData(urlpath, options);
request.post(data, function(error, response, body) {
if (error) {
@@ -46,6 +46,10 @@ function registerPackage(options, callback) {
function publishPackage(options, callback) {
+ var urlpath = format('/repository/%s/%s/%s', options.root, options.name, options.version);
+ var distfile = options.distfile;
+ var data = formatRequestData(urlpath, options);
+ delete data.json;
}
View
2  lib/utils/index.js
@@ -48,4 +48,4 @@ exports.require = function(item) {
});
}
return module;
-}
+};
View
2  lib/utils/pathlib.js
@@ -36,5 +36,5 @@ var writeFileSync = function(filepath, data, encoding) {
fs.mkdirsSync(dirname);
}
return fs.writeFileSync(filepath, data, encoding);
-}
+};
exports.writeFileSync = writeFileSync;
View
2  tests/2.ast.test.js
@@ -1,5 +1,5 @@
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var ast = require('../lib/sdk/ast');
describe('ast.parseDefines', function() {
View
2  tests/2.cli.test.js
@@ -1,5 +1,5 @@
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var cli = require('../lib/sdk/cli');
describe('cli.getConfig', function() {
View
2  tests/2.iduri.test.js
@@ -1,6 +1,6 @@
var should = require('should');
var logging = require('colorful').logging;
-var require = require('./testutils');
+var require = require('./_require');
var iduri = require('../lib/sdk/iduri');
View
10 tests/3.dependency.test.js
@@ -1,6 +1,6 @@
var path = require('path');
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var dependency = require('../lib/sdk/dependency');
var datadir = path.join(__dirname, 'data');
@@ -8,18 +8,18 @@ var datadir = path.join(__dirname, 'data');
describe('dependency.parse', function() {
it('get no dependencies', function() {
var file = path.join(datadir, 'no-deps.js');
- var deps = dependency.parse(file)
+ var deps = dependency.parse(file);
deps.should.have.length(0);
});
it('get a relative dependency', function() {
var file = path.join(datadir, 'one-relative-dep.js');
- var deps = dependency.parse(file)
+ var deps = dependency.parse(file);
deps.should.have.length(1);
- deps.should.include('./no-deps')
+ deps.should.include('./no-deps');
});
it('get a chain of relative dependencies', function() {
var file = path.join(datadir, 'chain-dep4.js');
- var deps = dependency.parse(file)
+ var deps = dependency.parse(file);
deps.should.have.length(4);
});
});
View
2  tests/4.compiler.test.js
@@ -1,7 +1,7 @@
var fs = require('fs');
var path = require('path');
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var ast = require('../lib/sdk/ast');
var compiler = require('../lib/sdk/compiler');
View
4 tests/8.standard-cases-build.test.js
@@ -1,13 +1,13 @@
var fs = require('fs');
var path = require('path');
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var build = require('../lib/commands/build');
var casedir = path.join(__dirname, 'standard-cases');
var cases = fs.readdirSync(casedir).filter(function(dir) {
return fs.statSync(path.join(casedir, dir)).isDirectory();
-})
+});
describe('building cases', function() {
cases.forEach(function(name) {
View
0  tests/testutils.js → tests/_require.js
File renamed without changes
View
2  tests/config.test.js
@@ -1,5 +1,5 @@
var should = require('should');
-var require = require('./testutils');
+var require = require('./_require');
var config = require('../lib/commands/config');
describe('config', function() {
Please sign in to comment.
Something went wrong with that request. Please try again.