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

gluejs

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gluejs - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

lib/require/Makefile

19

lib/glue.js

@@ -8,7 +8,4 @@ var fs = require('fs'),

var requireCode = fs.readFileSync(__dirname + '/require.js', 'utf8')
.replace(/\/*([^/]+)\/\n/g, '')
.replace(/\n/g, '')
.replace(/ +/g, ' ');
var requireCode = fs.readFileSync(__dirname + '/require/require.new.min.js', 'utf8')
.replace(/\/*([^/]+)\/\n/g, '');
var defaults = {

@@ -114,3 +111,5 @@ main: 'index.js',

this.build.render(result, function(pkgId) {
var relpath = self.build.main.replace(/^\.\//, '').replace(new RegExp('^'+self.build.basepath), '');
var relpath = self.build.main.replace(/^\.\//, '').replace(new RegExp('^' +
(path.sep == '\\' ? self.build.basepath.replace(/\\/g, '\\\\') : self.build.basepath ) // windows
), '');
onDone({

@@ -139,3 +138,3 @@ replaced: self.replaced,

+ requireCode
+ '\n'
+ '\nrequire.m = [];\n'
+ out.modules.reduce(function(str, o, counter) {

@@ -146,3 +145,3 @@ var keys = [];

});
return str + 'require.modules['+counter+'] = { ' + keys.join(',\n') + '};\n';
return str + 'require.m['+counter+'] = { ' + keys.join(',\n') + '};\n';
}, '')

@@ -182,3 +181,3 @@ // name to export

basepath = this._fullPath(basepath);
basepath += (basepath[basepath.length-1] !== '/' ? '/' : '');
basepath += (basepath[basepath.length-1] !== path.sep ? path.sep : '');
this.build.basepath = basepath;

@@ -189,3 +188,3 @@ }

if(p.substr(0, 1) == '.') {
p = path.normalize(this.options.reqpath + '/' + p);
p = path.normalize(this.options.reqpath + path.sep + p);
}

@@ -192,0 +191,0 @@ return p;

@@ -1,2 +0,3 @@

var fs = require('fs');
var fs = require('fs'),
path = require('path');

@@ -19,6 +20,7 @@ // A set of file/folder paths defined as:

paths.forEach(function(p) {
p = path.normalize(p); // for windows
var isDirectory = fs.statSync(p).isDirectory();
if (isDirectory) {
p += (p[p.length-1] !== '/' ? '/' : '');
p += (p[p.length-1] !== path.sep ? path.sep : '');
return fs.readdirSync(p).forEach(function (f) {

@@ -25,0 +27,0 @@ self.include(p + f);

@@ -63,3 +63,3 @@ var fs = require('fs'),

child.files = files;
child.main = main.replace(new RegExp('^'+basePath), '');
child.main = (main.substr(0, basePath.length) == basePath ? main.substr(basePath.length) : main);
child.basepath = basePath;

@@ -79,3 +79,7 @@ dependencies.forEach(function(dep) {

function relative(filename){
return filename.replace(new RegExp('^'+self.basepath), '');
var temp = (filename.substr(0, self.basepath.length) == self.basepath ? filename.substr(self.basepath.length) : filename);
if(path.sep != '/') {
temp = temp.replace(/\\/g, '/'); // windows
}
return temp;
}

@@ -149,4 +153,4 @@ var opts = { relative: relative },

result[selfId][child.name] = JSON.stringify({
context: childId,
main: (child.main.substr(0, 1) == '/' ? child.main : '/'+child.main)
c: childId, // context
m: (child.main.substr(0, 1) == '/' ? child.main : '/'+child.main) // main
});

@@ -153,0 +157,0 @@ done();

{
"name": "gluejs",
"description": "Build CommonJS modules for the browser via a chainable API",
"version": "0.1.1",
"version": "0.2.0",
"author": {

@@ -24,3 +24,3 @@ "name": "Mikito Takada",

"dependencies": {
"package-json-resolver": "git://github.com/mixu/package-json-resolver.git#master",
"package-json-resolver": "0.0.1",
"minilog": "0.0.4",

@@ -27,0 +27,0 @@ "argsparser": "0.0.6"

@@ -145,3 +145,3 @@ # gluejs

Note that source URLs require that scripts are wrapped in a eval block, which is a bit ugly, so you probably don't want that in production mode.
Note that source URLs require that scripts are wrapped in a eval block with a special comment, which is not supported by IE, so don't use source URLs for production builds.

@@ -148,0 +148,0 @@ ## Handling template files and compile-to-JS files

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