esperanto-source 0.6.11 → 0.6.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esperanto/source/version.rb +1 -1
- data/vendor/esperanto.browser.js +1 -1
- data/vendor/esperanto.js +74 -70
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d3a38527ae2716f01b7c709513abbde27bd53c1
|
4
|
+
data.tar.gz: 399a28496cfa10ad15a4e8e37deb4f0baece6a54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712611a44bc8d7c3932a49f1266c7f3b7df74fc789aa8ec179b55aa3c6157328873a62ded8e2231c9e9ebfb9b20065b97bbc97186446d4b94505a50c7df6ba40
|
7
|
+
data.tar.gz: 1e533cf64c625262113c8f04b83c905061ac823936a1c20cae772f4c6c1f606efdc3a297aa3f881adb01301b391e965b3a4711fd0378ca71825198ef358a4a91
|
data/vendor/esperanto.browser.js
CHANGED
data/vendor/esperanto.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.12 - 2015-02-09
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
@@ -1367,7 +1367,7 @@ function getBundle ( options ) {
|
|
1367
1367
|
var entry = options.entry.replace( /\.js$/, '' ),
|
1368
1368
|
modules = [],
|
1369
1369
|
moduleLookup = {},
|
1370
|
-
|
1370
|
+
promiseByPath = {},
|
1371
1371
|
skip = options.skip,
|
1372
1372
|
names = options.names,
|
1373
1373
|
base = ( options.base ? path.resolve( options.base ) : process.cwd() ) + '/',
|
@@ -1378,98 +1378,102 @@ function getBundle ( options ) {
|
|
1378
1378
|
entry = entry.substring( base.length );
|
1379
1379
|
}
|
1380
1380
|
|
1381
|
-
return
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1381
|
+
return resolvePath( base, entry, null ).then( function(entryPath ) {
|
1382
|
+
return fetchModule( entry, entryPath ).then( function() {
|
1383
|
+
var entryModule, bundle;
|
1384
|
+
|
1385
|
+
entryModule = moduleLookup[ entry ];
|
1386
|
+
modules = sortModules( entryModule, moduleLookup ); // TODO is this necessary? surely it's already sorted because of the fetch order? or do we need to prevent parallel reads?
|
1387
|
+
|
1388
|
+
bundle = {
|
1389
|
+
entry: entry,
|
1390
|
+
entryModule: entryModule,
|
1391
|
+
base: base,
|
1392
|
+
modules: modules,
|
1393
|
+
moduleLookup: moduleLookup,
|
1394
|
+
externalModules: externalModules,
|
1395
|
+
externalModuleLookup: externalModuleLookup,
|
1396
|
+
skip: skip,
|
1397
|
+
names: names,
|
1398
|
+
chains: resolveChains( modules, moduleLookup )
|
1399
|
+
};
|
1386
1400
|
|
1387
|
-
|
1388
|
-
entry: entry,
|
1389
|
-
entryModule: entryModule,
|
1390
|
-
base: base,
|
1391
|
-
modules: modules,
|
1392
|
-
moduleLookup: moduleLookup,
|
1393
|
-
externalModules: externalModules,
|
1394
|
-
externalModuleLookup: externalModuleLookup,
|
1395
|
-
skip: skip,
|
1396
|
-
names: names,
|
1397
|
-
chains: resolveChains( modules, moduleLookup )
|
1398
|
-
};
|
1401
|
+
combine( bundle );
|
1399
1402
|
|
1400
|
-
|
1403
|
+
return bundle;
|
1404
|
+
});
|
1405
|
+
}, function ( err ) {
|
1406
|
+
if ( err.code === 'ENOENT' ) {
|
1407
|
+
throw new Error( 'Could not find entry module (' + entry + ')' );
|
1408
|
+
}
|
1401
1409
|
|
1402
|
-
|
1410
|
+
throw err;
|
1403
1411
|
});
|
1404
1412
|
|
1405
|
-
function fetchModule ( moduleId,
|
1406
|
-
if ( !hasOwnProp.call(
|
1407
|
-
|
1408
|
-
|
1409
|
-
var module, promises;
|
1413
|
+
function fetchModule ( moduleId, modulePath ) {
|
1414
|
+
if ( !hasOwnProp.call( promiseByPath, modulePath ) ) {
|
1415
|
+
promiseByPath[ modulePath ] = sander.readFile( modulePath ).then( String ).then( function ( source ) {
|
1416
|
+
var module, promises;
|
1410
1417
|
|
1411
|
-
|
1412
|
-
|
1418
|
+
if ( options.transform ) {
|
1419
|
+
source = options.transform( source, modulePath );
|
1413
1420
|
|
1414
|
-
|
1415
|
-
|
1416
|
-
}
|
1421
|
+
if ( typeof source !== 'string' && !isThenable( source ) ) {
|
1422
|
+
throw new Error( 'transform should return String or Promise' );
|
1417
1423
|
}
|
1424
|
+
}
|
1418
1425
|
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1426
|
+
module = getModule({
|
1427
|
+
source: source,
|
1428
|
+
id: moduleId,
|
1429
|
+
relativePath: path.relative( base, modulePath ),
|
1430
|
+
path: modulePath
|
1431
|
+
});
|
1425
1432
|
|
1426
|
-
|
1427
|
-
|
1433
|
+
modules.push( module );
|
1434
|
+
moduleLookup[ moduleId ] = module;
|
1428
1435
|
|
1429
|
-
|
1430
|
-
|
1436
|
+
promises = module.imports.map( function(x ) {
|
1437
|
+
x.id = resolveId( x.path, module.relativePath );
|
1431
1438
|
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1439
|
+
if ( x.id === moduleId ) {
|
1440
|
+
throw new Error( 'A module (' + moduleId + ') cannot import itself' );
|
1441
|
+
}
|
1435
1442
|
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1443
|
+
// Some modules can be skipped
|
1444
|
+
if ( skip && ~skip.indexOf( x.id ) ) {
|
1445
|
+
return;
|
1446
|
+
}
|
1440
1447
|
|
1448
|
+
return resolvePath( base, x.id, modulePath, options.resolvePath ).then( function(modulePath ) {
|
1441
1449
|
// short-circuit cycles
|
1442
|
-
if ( hasOwnProp.call(
|
1450
|
+
if ( hasOwnProp.call( promiseByPath, modulePath ) ) {
|
1443
1451
|
return;
|
1444
1452
|
}
|
1445
1453
|
|
1446
1454
|
return fetchModule( x.id, modulePath );
|
1447
|
-
})
|
1448
|
-
|
1449
|
-
|
1455
|
+
}, function handleError ( err ) {
|
1456
|
+
if ( err.code === 'ENOENT' ) {
|
1457
|
+
// Most likely an external module
|
1458
|
+
if ( !hasOwnProp.call( externalModuleLookup, x.id ) ) {
|
1459
|
+
var externalModule = {
|
1460
|
+
id: x.id
|
1461
|
+
};
|
1462
|
+
|
1463
|
+
externalModules.push( externalModule );
|
1464
|
+
externalModuleLookup[ x.id ] = externalModule;
|
1465
|
+
}
|
1466
|
+
} else {
|
1467
|
+
throw err;
|
1468
|
+
}
|
1469
|
+
} );
|
1450
1470
|
});
|
1451
|
-
}, function ( err ) {
|
1452
|
-
if ( err.code === 'ENOENT' ) {
|
1453
|
-
if ( moduleId === entry ) {
|
1454
|
-
throw new Error( 'Could not find entry module (' + entry + ')' );
|
1455
|
-
}
|
1456
|
-
|
1457
|
-
// Most likely an external module
|
1458
|
-
if ( !hasOwnProp.call( externalModuleLookup, moduleId ) ) {
|
1459
|
-
var externalModule = {
|
1460
|
-
id: moduleId
|
1461
|
-
};
|
1462
1471
|
|
1463
|
-
|
1464
|
-
externalModuleLookup[ moduleId ] = externalModule;
|
1465
|
-
}
|
1466
|
-
} else {
|
1467
|
-
throw err;
|
1468
|
-
}
|
1472
|
+
return getBundle__Promise.all( promises );
|
1469
1473
|
});
|
1470
1474
|
}
|
1471
1475
|
|
1472
|
-
return
|
1476
|
+
return promiseByPath[ modulePath ];
|
1473
1477
|
}
|
1474
1478
|
}
|
1475
1479
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esperanto-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|