Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
},
"files.watcherExclude": {
"**/node_modules/**": true,
"frameworks/**": true
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"frameworks": true
}
}
16 changes: 0 additions & 16 deletions lib/appbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,9 +1216,7 @@ BT.AppBuilder = SC.Object.extend({
var fw = testFile.get('framework');
var tmp;

// var debugRef = this.sproutcoreRef + ":debug";
// var testingRef = this.sproutcoreRef + ":testing";
var debugRef = "sproutcore:debug";
var testingRef = "sproutcore:testing"; // for some reason this.sproutcoreRef suddenly contains double single quotes

var deps = [];
Expand Down Expand Up @@ -1261,25 +1259,11 @@ BT.AppBuilder = SC.Object.extend({
}
else fws.push(fw);

if (!fws.findProperty('ref', debugRef)) {
BT.Logger.trace("cannot find debug ref in fws, pushing");
tmp = this._fws.findProperty('ref', debugRef);
if (!tmp) {
BT.Logger.warn("BT.AppBuilder: Trying to wrap a test, but cannot find the debug framework!? This must be a sc_config error, most likely a missing testDependencies.");
BT.Logger.debug("all fws: " + this._fws.getEach('ref'));
BT.Logger.debug("this app: " + this.get('name'));
throw new Error();
}
BT.Logger.trace("tmp is " + tmp.get('ref'));
fws.push(tmp);
}
if (!fws.findProperty('ref', testingRef)) {
BT.Logger.debug("cannot find testingRef in fws, pushing");
fws.push(this._fws.findProperty('ref', testingRef));
}

BT.Logger.debug("debugRef : " + debugRef);

// assume that the current app loads all necessary frameworks, and that they are in order in _fws
//var fws = this._fws.slice(0, this._fws.indexOf(fw) + 1);
tmp = BT.AppBuilder.create({
Expand Down
4 changes: 2 additions & 2 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ BT.File = SC.Object.extend({
},

staticUrl: function () {
var app = this.getPath('framework.belongsTo');
var urlTemplate = app.urlTemplateFor(this);
var fw = this.get('framework');
var urlTemplate = fw.urlTemplateFor(this);
urlTemplate = (urlTemplate[urlTemplate.length - 1] === "/") ? urlTemplate.substr(0, urlTemplate.length - 1) : urlTemplate;
return urlTemplate.fmt(this);
}.property(),
Expand Down
6 changes: 4 additions & 2 deletions lib/file_types/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ BT.ScriptFile = BT.File.extend(BT.TraceurMixin, {

minify: function (str) {
if (BT.runBenchmarks) SC.Benchmark.start('scriptFile:minify');
var result = require('uglify-js').minify(str, {
var result = require('terser').minify(str, {
warnings: true,
output: { max_line_len: 1000 }
output: {
max_line_len: 1000
}
});
if (result.warning) {
BT.Logger.warn("Warning while minifying the script file '%@': %@".fmt(this.get('path'), result.warning));
Expand Down
11 changes: 11 additions & 0 deletions lib/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,17 @@ BT.Framework = SC.Object.extend({
return buildNumber;
}.property('contentHash').cacheable(),

/**
A delegate you can use to define specific URL templates depending
on the file.

@function
@param {BT.File} file The file requesting an URL template.
*/
urlTemplateFor: function(file) {
return this.get('belongsTo').urlTemplateFor(file);
}

});


Expand Down
Loading