commonplace
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -9,3 +9,2 @@ var fs = require('fs'); | ||
'require.js', | ||
'require-config.js', | ||
'localforage.js', | ||
@@ -38,4 +37,14 @@ 'settings_inferno.js', | ||
function(file) { | ||
if (blacklist.indexOf(path.basename(file)) !== -1) return; | ||
output += fs.readFileSync(file) + '\n'; | ||
if (blacklist.indexOf(path.basename(file)) !== -1) { | ||
// Don't include blacklisted files. | ||
return; | ||
} | ||
// Automatically name anonymous modules. | ||
var module_name = path.basename(file).replace('.js', ''); | ||
var js = fs.readFileSync(file).toString(); | ||
js = js.replace('define([', "define('" + module_name + "', ["); | ||
js = js.replace('define(function', "define('" + module_name + "', [], function"); | ||
output += js + '\n'; | ||
}, function() { | ||
@@ -42,0 +51,0 @@ callback(output); |
@@ -606,28 +606,15 @@ var child_process = require('child_process'); | ||
(function read_require_js() { | ||
// Read assets/require.js into a string to build. | ||
fs.readFile(path.resolve(__dirname, 'assets', 'require.js'), function(err, require_js) { | ||
// Load in require.js. | ||
(function read_almond_js() { | ||
// Read assets/almond.js into a string to build. | ||
fs.readFile(path.resolve(__dirname, 'assets', 'almond.js'), function(err, almond_js) { | ||
// Load in almond.js. | ||
if (err) { | ||
console.warn('Error reading `require.js`.', err); | ||
console.warn('Error reading `almond.js`.', err); | ||
return; | ||
} | ||
read_require_config_js(require_js.toString()); | ||
read_init_js(almond_js.toString()); | ||
}); | ||
})(); | ||
function read_require_config_js(require_code) { | ||
// Read assets/require-config.js, append it to assets/require.js, and | ||
// pass it on. | ||
fs.readFile(path.resolve(__dirname, 'assets', 'require-config.js'), function(err, require_config_js) { | ||
// Load in require-config.js. | ||
if (err) { | ||
console.warn('Error reading `require-config.js`.', err); | ||
return; | ||
} | ||
read_init_js(require_code + require_config_js.toString()); | ||
}); | ||
} | ||
function read_init_js(require_code) { | ||
function read_init_js(almond_code) { | ||
// Read assets/init.js (it ```require```s the main module). | ||
@@ -641,3 +628,3 @@ // Passes the require.js/require-config.js code and itself to build. | ||
} | ||
build_js(require_code, init_js.toString()); | ||
build_js(almond_code, init_js.toString()); | ||
}); | ||
@@ -644,0 +631,0 @@ } |
{ | ||
"name": "commonplace", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"preferGlobal": true, | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -9,3 +9,3 @@ // Alert any errors during testing. | ||
casper.start("http://localhost:8888/tests", function() { | ||
casper.start("http://localhost:8675/tests", function() { | ||
console.log('Started initial navigation.'); | ||
@@ -12,0 +12,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
13122
3
11
6
956827
85