Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commonplace

Package Overview
Dependencies
Maintainers
7
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonplace - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

lib/assets/almond.js

15

lib/build.js

@@ -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);

29

lib/commonplace.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc