ember-cli-assets 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db0580fdbc3e2800782d775b381bf168faee080e
4
- data.tar.gz: f56b5a337dda26b2c18fc4f9c2b32b53e1143955
3
+ metadata.gz: 5fdd9cfb5e56a14cc568cc507903ccb6dafd6d45
4
+ data.tar.gz: 0c00f11c41aeeb0ba6e0d89ce1fdc2c3e08b03bf
5
5
  SHA512:
6
- metadata.gz: 048fef0a3b71f8f4231569e6b367124a5ba899ef3c02f3599f0b522ce27001e4e0c01895b71f2aa80ea02d4eb93ea63f7afd1488d036ee2c8c1dee81f2c8eb13
7
- data.tar.gz: 82be016399576b7d357c0053c4649b5a2afced4c90fee5ba45848589a78c9988c0c631109e625bd86015d447552ed3480b7294c62208955e2a9ab7e4379a63af
6
+ metadata.gz: d0f377af23c5c35cb984fa80522dca7695c3e6eaaa6d61a47b6ba501cae7f4e515b6ee68edd8b4c839f7ff149d115c8691e679579cc08405f27753a08e7122f2
7
+ data.tar.gz: 1e262b3dc9e7dd07f3e106291f1b5c5fcc0b5d7e4730a672ae0758f7c29405b4eb09143cc046fe125ae3694f3b0e109707917f08cacded5b2ce3246c4e6b12fc
@@ -1,7 +1,7 @@
1
1
  module Ember
2
2
  module CLI
3
3
  module Assets
4
- VERSION = '0.0.32'
4
+ VERSION = '0.0.33'
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Ember
2
2
  module CLI
3
3
  module Loader
4
- VERSION = '4.0.7'
4
+ VERSION = '4.0.8'
5
5
  end
6
6
  end
7
7
  end
@@ -14,7 +14,14 @@ var loader, define, requireModule, require, requirejs;
14
14
 
15
15
  requirejs = require = requireModule = function(name) {
16
16
  stats.require++;
17
- return findModule(name, '(require)').module.exports;
17
+ var pending = [];
18
+ var mod = findModule(name, '(require)', pending);
19
+
20
+ for (var i = pending.length - 1; i >= 0; i--) {
21
+ pending[i].exports();
22
+ }
23
+
24
+ return mod.module.exports;
18
25
  };
19
26
 
20
27
  function resetStats() {
@@ -22,10 +29,9 @@ var loader, define, requireModule, require, requirejs;
22
29
  define: 0,
23
30
  require: 0,
24
31
  reify: 0,
25
- build: 0,
32
+ findDeps: 0,
26
33
  modules: 0,
27
34
  exports: 0,
28
- ensureBuild: 0,
29
35
  resolve: 0,
30
36
  resolveRelative: 0,
31
37
  findModule: 0,
@@ -64,8 +70,6 @@ var loader, define, requireModule, require, requirejs;
64
70
 
65
71
  var registry = {};
66
72
  var seen = {};
67
- var FAILED = false;
68
- var LOADED = true;
69
73
 
70
74
  var uuid = 0;
71
75
 
@@ -83,11 +87,11 @@ var loader, define, requireModule, require, requirejs;
83
87
  this.deps = !deps.length && callback.length ? defaultDeps : deps;
84
88
  this.module = { exports: {} };
85
89
  this.callback = callback;
86
- this.state = undefined;
87
90
  this.finalized = false;
88
91
  this.hasExportsAsDep = false;
89
92
  this.isAlias = alias;
90
93
  this.reified = new Array(deps.length);
94
+ this._foundDeps = false;
91
95
  }
92
96
 
93
97
  Module.prototype.makeDefaultExport = function() {
@@ -100,46 +104,63 @@ var loader, define, requireModule, require, requirejs;
100
104
  };
101
105
 
102
106
  Module.prototype.exports = function() {
103
- stats.exports ++;
104
- if (this.finalized) {
105
- return this.module.exports;
106
- } else {
107
- if (loader.wrapModules) {
108
- this.callback = loader.wrapModules(this.name, this.callback);
109
- }
110
- var result = this.callback.apply(this, this.reified);
111
- if (!(this.hasExportsAsDep && result === undefined)) {
112
- this.module.exports = result;
113
- }
114
- this.makeDefaultExport();
115
- this.finalized = true;
116
- return this.module.exports;
107
+ if (this.finalized) { return this.module.exports; }
108
+ stats.exports++;
109
+
110
+ this.finalized = true;
111
+
112
+ if (loader.wrapModules) {
113
+ this.callback = loader.wrapModules(this.name, this.callback);
114
+ }
115
+
116
+ this.reify();
117
+
118
+ var result = this.callback.apply(this, this.reified);
119
+
120
+ if (!(this.hasExportsAsDep && result === undefined)) {
121
+ this.module.exports = result;
117
122
  }
123
+ this.makeDefaultExport();
124
+ return this.module.exports;
118
125
  };
119
126
 
120
127
  Module.prototype.unsee = function() {
121
128
  this.finalized = false;
122
- this.state = undefined;
129
+ this._foundDeps = false;
123
130
  this.module = { exports: {}};
124
131
  };
125
132
 
126
133
  Module.prototype.reify = function() {
127
134
  stats.reify++;
128
- var deps = this.deps;
129
- var dep;
130
135
  var reified = this.reified;
136
+ for (var i = 0; i < reified.length; i++) {
137
+ var mod = reified[i];
138
+ reified[i] = mod.exports ? mod.exports : mod.module.exports();
139
+ }
140
+ };
141
+
142
+ Module.prototype.findDeps = function(pending) {
143
+ if (this._foundDeps) {
144
+ return;
145
+ }
146
+
147
+ stats.findDeps++;
148
+ this._foundDeps = true;
149
+
150
+ var deps = this.deps;
131
151
 
132
152
  for (var i = 0; i < deps.length; i++) {
133
- dep = deps[i];
153
+ var dep = deps[i];
154
+ var entry = this.reified[i] = { exports: undefined, module: undefined };
134
155
  if (dep === 'exports') {
135
156
  this.hasExportsAsDep = true;
136
- reified[i] = this.module.exports;
157
+ entry.exports = this.module.exports;
137
158
  } else if (dep === 'require') {
138
- reified[i] = this.makeRequire();
159
+ entry.exports = this.makeRequire();
139
160
  } else if (dep === 'module') {
140
- reified[i] = this.module;
161
+ entry.exports = this.module;
141
162
  } else {
142
- reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;
163
+ entry.module = findModule(resolve(dep, this.name), this.name, pending);
143
164
  }
144
165
  }
145
166
  };
@@ -156,16 +177,6 @@ var loader, define, requireModule, require, requirejs;
156
177
  return r;
157
178
  };
158
179
 
159
- Module.prototype.build = function() {
160
- stats.ensureBuild++;
161
- if (this.state === FAILED || this.state === LOADED) { return; }
162
- stats.build++;
163
- this.state = FAILED;
164
- this.reify()
165
- this.exports();
166
- this.state = LOADED;
167
- };
168
-
169
180
  define = function(name, deps, callback) {
170
181
  stats.define++;
171
182
  if (arguments.length < 2) {
@@ -201,7 +212,7 @@ var loader, define, requireModule, require, requirejs;
201
212
  throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`');
202
213
  }
203
214
 
204
- function findModule(name, referrer) {
215
+ function findModule(name, referrer, pending) {
205
216
  stats.findModule++;
206
217
  var mod = registry[name] || registry[name + '/index'];
207
218
 
@@ -211,7 +222,10 @@ var loader, define, requireModule, require, requirejs;
211
222
 
212
223
  if (!mod) { missingModule(name, referrer); }
213
224
 
214
- mod.build();
225
+ if (pending) {
226
+ mod.findDeps(pending);
227
+ pending.push(mod);
228
+ }
215
229
  return mod;
216
230
  }
217
231
 
@@ -247,7 +261,7 @@ var loader, define, requireModule, require, requirejs;
247
261
  requirejs.entries = requirejs._eak_seen = registry;
248
262
  requirejs.has = has;
249
263
  requirejs.unsee = function(moduleName) {
250
- findModule(moduleName, '(unsee)').unsee();
264
+ findModule(moduleName, '(unsee)', false).unsee();
251
265
  };
252
266
 
253
267
  requirejs.clear = function() {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-cli-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryunosuke SATO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-23 00:00:00.000000000 Z
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler