Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.3alpha21 - preliminary dependencies.noWeb

  • Loading branch information...
commit 1bf1a8193fad5ddc531b44bd48f5f0d7ccbd1bd1 1 parent ce46ce4
@anodynos authored
View
20 build/code/process/BundleBuilder.js
@@ -61,8 +61,9 @@ BundleBuilder = (function() {
}
BundleBuilder.prototype._constructor = function() {
- var be, cfgFilename, config, configs, varNames, _base, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
+ var be, cfgFilename, config, configs, varNames, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
configs = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ this.configs = configs;
this.bundleCfg = {};
this.buildCfg = {};
this.buildCfg.done = ((_ref = configs[0]) != null ? _ref.done : void 0) || function() {};
@@ -79,11 +80,9 @@ BundleBuilder = (function() {
_ref1 = _B.arrayize(config.configFiles);
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
cfgFilename = _ref1[_j];
- if (!(cfgFilename)) {
- continue;
+ if (cfgFilename) {
+ this.storeCfgDefaults(require(_fs.realpathSync(cfgFilename)));
}
- (_base = this.bundleCfg).bundlePath || (_base.bundlePath = upath.dirname(cfgFilename));
- this.storeCfgDefaults(require(_fs.realpathSync(cfgFilename)));
}
}
/*
@@ -179,9 +178,16 @@ BundleBuilder = (function() {
};
BundleBuilder.prototype.isCheckAndFixPaths = function() {
+ var cfgFile, _ref;
if (!this.bundleCfg.bundlePath) {
- l.err("Quitting build, no bundlePath specified.\nUse -h for help");
- return false;
+ if (cfgFile = (_ref = this.configs[0]) != null ? _ref.configFiles[0] : void 0) {
+ l.debug(40, "Assuming bundlePath = '" + (upath.dirname(cfgFile)) + "' from 1st configFile: '" + cfgFile + "'");
+ this.bundleCfg.bundlePath = upath.dirname(cfgFile);
+ return true;
+ } else {
+ l.err("Quitting build, no bundlePath specified.\nUse -h for help");
+ return false;
+ }
} else {
if (this.buildCfg.forceOverwriteSources) {
this.buildCfg.outputPath = this.bundleCfg.bundlePath;
View
4 build/code/urequireCmd.js
@@ -1,8 +1,8 @@
#!/usr/bin/env node
/*!
-* urequire - version 0.3.0alpha21
-* Compiled on 2013-02-13
+* urequire - version 0.3.0alpha22
+* Compiled on 2013-04-04
* git://github.com/anodynos/urequire
* Copyright(c) 2013 Agelos Pikoulas (agelos.pikoulas@gmail.com )
* Licensed MIT http://www.opensource.org/licenses/mit-license.php
View
2  build/code/utils/Logger.js
@@ -1,4 +1,4 @@
-var VERSION = '0.3.0alpha21'; //injected by grunt:concat
+var VERSION = '0.3.0alpha22'; //injected by grunt:concat
// Generated by CoffeeScript 1.4.0
var Logger, _,
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "urequire",
"description": "Module converter: write modular code once, convert to UMD and run/test on AMD (browser/requirejs) & nodejs.",
- "version": "0.3.0alpha21",
+ "version": "0.3.0alpha22",
"homepage": "https://github.com/anodynos/urequire",
"author": {
"name": "Agelos Pikoulas",
View
18 source/code/process/BundleBuilder.coffee
@@ -26,7 +26,7 @@ class BundleBuilder
Function::staticProperty = (p)=> Object.defineProperty @::, n, d for n, d of p
constructor: -> @_constructor.apply @, arguments
- _constructor: (configs...)->
+ _constructor: (@configs...)->
# Create our 2 main config objects : 'bundle' & 'build'
@bundleCfg = {}
@@ -45,8 +45,6 @@ class BundleBuilder
# in each config, we might have nested configFiles
# todo: read configFiles with the proper recursion above
for cfgFilename in _B.arrayize config.configFiles when cfgFilename # no nulls/empty strings
- # assume bundlePath, if its empty, from the 1st configFile that comes along
- @bundleCfg.bundlePath or= upath.dirname cfgFilename
# get deep defaults to current configuration
@storeCfgDefaults require _fs.realpathSync cfgFilename
# ? add configFile to exclude'd files ?
@@ -155,10 +153,16 @@ class BundleBuilder
isCheckAndFixPaths: ->
if not @bundleCfg.bundlePath
- l.err """
- Quitting build, no bundlePath specified.
- Use -h for help"""
- return false
+ # assume bundlePath, from the 1st configFile that come along
+ if cfgFile = @configs[0]?.configFiles[0]
+ l.debug 40, "Assuming bundlePath = '#{upath.dirname cfgFile}' from 1st configFile: '#{cfgFile}'"
+ @bundleCfg.bundlePath = upath.dirname cfgFile
+ return true
+ else
+ l.err """
+ Quitting build, no bundlePath specified.
+ Use -h for help"""
+ return false
else
if @buildCfg.forceOverwriteSources
@buildCfg.outputPath = @bundleCfg.bundlePath
Please sign in to comment.
Something went wrong with that request. Please try again.