Remove runtime dependency on 'glob' so we have no runtime deps

- Clean up .npmignore a bit more
This commit is contained in:
slackersoft
2014-08-24 21:11:50 -07:00
parent 3c051fc291
commit b799f54bc9
3 changed files with 21 additions and 12 deletions

View File

@@ -1,6 +1,5 @@
dist/ dist/
grunt/ grunt/
images/
node_modules node_modules
release_notes/ release_notes/
spec/ spec/
@@ -15,6 +14,8 @@ jasmine-core.gemspec
.gitignore .gitignore
*.sh *.sh
Gruntfile.js Gruntfile.js
lib/jasmine-core.rb
lib/jasmine-core/boot/ lib/jasmine-core/boot/
lib/jasmine-core/spec lib/jasmine-core/spec
lib/jasmine-core/version.rb lib/jasmine-core/version.rb
lib/jasmine-core/*.py

View File

@@ -3,18 +3,28 @@ module.exports.boot = require('./jasmine-core/node_boot.js');
module.exports.files = (function() { module.exports.files = (function() {
var path = require('path'), var path = require('path'),
fs = require('fs'), fs = require('fs');
glob = require('glob');
var rootPath = path.join(__dirname, "jasmine-core"), var rootPath = path.join(__dirname, "jasmine-core"),
bootFiles = ['boot.js'], bootFiles = ['boot.js'],
nodeBootFiles = ['node_boot.js']; nodeBootFiles = ['node_boot.js'],
cssFiles = [],
jsFiles = [],
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, nodeBootFiles);
var cssFiles = glob.sync(path.join(rootPath, '*.css')).map(path.basename); fs.readdirSync(rootPath).forEach(function(file) {
var jsFiles = glob.sync(path.join(rootPath, '*.js')).map(path.basename); if(fs.statSync(path.join(rootPath, file)).isFile()) {
switch(path.extname(file)) {
['jasmine.js'].concat(bootFiles, nodeBootFiles).forEach(function(file) { case '.css':
jsFiles.splice(jsFiles.indexOf(file), 1); cssFiles.push(file);
break;
case '.js':
if (jsFilesToSkip.indexOf(file) < 0) {
jsFiles.push(file);
}
break;
}
}
}); });
return { return {

View File

@@ -9,9 +9,6 @@
"description": "Official packaging of Jasmine's core files for use by Node.js projects.", "description": "Official packaging of Jasmine's core files for use by Node.js projects.",
"homepage": "http://jasmine.github.io", "homepage": "http://jasmine.github.io",
"main": "./lib/jasmine-core.js", "main": "./lib/jasmine-core.js",
"dependencies": {
"glob": "~3.2.9"
},
"devDependencies": { "devDependencies": {
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.7.0", "grunt-contrib-jshint": "~0.7.0",
@@ -19,6 +16,7 @@
"grunt-contrib-compass": "~0.6.0", "grunt-contrib-compass": "~0.6.0",
"grunt-contrib-compress": "~0.5.2", "grunt-contrib-compress": "~0.5.2",
"shelljs": "~0.1.4", "shelljs": "~0.1.4",
"glob": "~3.2.9",
"jasmine": "https://github.com/pivotal/jasmine-npm/archive/master.tar.gz", "jasmine": "https://github.com/pivotal/jasmine-npm/archive/master.tar.gz",
"load-grunt-tasks": "^0.4.0" "load-grunt-tasks": "^0.4.0"
} }