Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/up ncp limit #3

Merged
merged 7 commits into from Oct 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions .jscsrc
Expand Up @@ -4,10 +4,8 @@
]
, "requireLineFeedAtFileEnd": true
, "disallowMultipleLineBreaks": true
, "requireMultipleVarDecl": true
, "disallowEmptyBlocks": true
, "disallowSpaceAfterObjectKeys": true
, "disallowCommaBeforeLineBreak": true
, "disallowTrailingWhitespace": true
, "requireCapitalizedConstructors": true
, "requireSpacesInsideObjectBrackets": "all"
Expand All @@ -16,13 +14,10 @@
, "requireSpaceBeforeBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "try", "catch" ]
, "disallowLeftStickedOperators": [ "?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ]
, "disallowRightStickedOperators": [ "?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ]
, "disallowSpaceAfterPrefixUnaryOperators": [ "++", "--", "+", "-", "~", "!" ]
, "disallowSpaceBeforePostfixUnaryOperators": [ "++", "--" ]
, "requireSpaceBeforeBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "disallowKeywordsOnNewLine": [ "else" ]
, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }
}

7 changes: 7 additions & 0 deletions .jsinspectrc
@@ -0,0 +1,7 @@
{
"threshold": 30,
"identifiers": true,
"ignore": "test|build|lib/vendor",
"reporter": "default",
"suppress": 100
}
2 changes: 1 addition & 1 deletion lib/prepare-to-build.js
Expand Up @@ -10,7 +10,7 @@ module.exports = function createPrepareToBuild() {
}
context.emit('Copying prepare directory to build directory')
context.emit('cp -r ' + data.prepareDir + ' ' + data.finalBuildDir)
copy(data.prepareDir, data.finalBuildDir, function (error) {
copy(data.prepareDir, data.finalBuildDir, { limit: 256 }, function (error) {
callback(error, data)
})
}
Expand Down
22 changes: 12 additions & 10 deletions package.json
Expand Up @@ -10,25 +10,27 @@
"registry": "http://registry.npmjs.org"
},
"scripts": {
"lint": "./node_modules/.bin/jshint . --reporter=./node_modules/jshint-full-path/index.js",
"jscs": "./node_modules/.bin/jscs .",
"pretest": "npm run-script lint && npm run-script jscs",
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --recursive -R spec -r should",
"posttest": "./node_modules/.bin/istanbul check-coverage && rm -rf coverage"
"lint": "jshint . --reporter=./node_modules/jshint-full-path/index.js",
"jscs": "jscs .",
"inspect": "jsinspect .",
"pretest": "npm run lint && npm run jscs && npm run inspect",
"test": "istanbul cover ./node_modules/.bin/_mocha -- --recursive -R spec -r should",
"posttest": "istanbul check-coverage && rm -rf coverage"
},
"dependencies": {
"async": "~0.2.10",
"express": "^4.4.5",
"extend": "^1.2.1",
"async": "^2.1.2",
"express": "^4.14.0",
"extend": "^3.0.0",
"hat": "0.0.3",
"ncp": "^0.5.0",
"rmdir": "^1.0.4"
"ncp": "^2.0.0",
"rmdir": "^1.2.0"
},
"devDependencies": {
"istanbul": "~0.2.3",
"jscs": "~1.3",
"jshint": "~2.4.1",
"jshint-full-path": "~1.1.1",
"jsinspect": "^0.8.0",
"mocha": "~1.17.0",
"rewire": "^2.0.0",
"should": "~3.0.1",
Expand Down
16 changes: 9 additions & 7 deletions test/lib/prepare-to-build.test.js
Expand Up @@ -6,11 +6,14 @@ var sinon = require('sinon')

describe('prepare-to-build', function () {

before(function (done) {
fs.mkdir('/tmp/navy-clock-build-test', function () {
fs.writeFile('/tmp/navy-clock-build-test/test', 'hello', function () {
fs.mkdir('/tmp/navy-clock-build/', done)
})
before(function () {
fs.mkdirSync('/tmp/navy-clock-build-test')
fs.mkdirSync('/tmp/navy-clock-build')
var payload = (new Array(3000)).fill(1).map(function (v, i) { return i })
, content = payload.join()
payload.forEach(function (v) {
fs.mkdirSync('/tmp/navy-clock-build-test/dir_' + v)
fs.writeFileSync('/tmp/navy-clock-build-test/dir_' + v + '/test', content)
})
})

Expand All @@ -25,7 +28,7 @@ describe('prepare-to-build', function () {
prepareToBuild(context, data, function (error) {
should.not.exist(error)
emitSpy.calledTwice.should.equal(true)
var filePath = '/tmp/navy-clock-build/test'
var filePath = '/tmp/navy-clock-build/dir_0/test'
fs.exists(filePath, function (fileExists) {
fileExists.should.equal(true, filePath + ' does not exist')
done()
Expand Down Expand Up @@ -53,5 +56,4 @@ describe('prepare-to-build', function () {
})
})
})

})