X Tutup
Skip to content

Commit 05ffdc9

Browse files
tboschalexeagle
authored andcommitted
refactor(build): explicitly mention src folder in imports
Export files are now directly under the module folder, e.g. `core/core.js`. With this, an import like `core/core` won’t need a path mapping (e.g. via `System.paths`) any more. This adds the `src` folder to all other import statements as well.
1 parent 9db13be commit 05ffdc9

File tree

160 files changed

+619
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+619
-627
lines changed

gulpfile.js

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var CJS_COMPILER_OPTIONS = {
4444

4545
var _HTLM_DEFAULT_SCRIPTS_JS = [
4646
{src: '/deps/traceur-runtime.js', mimeType: 'text/javascript'},
47-
{src: '/rtts_assert/lib/rtts_assert.js', mimeType: 'text/javascript'},
47+
{src: '/rtts_assert/rtts_assert.js', mimeType: 'text/javascript'},
4848
{src: '/deps/es6-module-loader-sans-promises.src.js', mimeType: 'text/javascript'},
4949
{src: '/deps/zone.js', mimeType: 'text/javascript'},
5050
{src: '/deps/long-stack-trace-zone.js', mimeType: 'text/javascript'},
@@ -78,11 +78,20 @@ var CONFIG = {
7878
},
7979
docs: 'dist/docs'
8080
},
81-
srcFolderMapping: {
82-
'default': 'lib',
83-
'**/benchmarks/**': 'web',
84-
'**/benchmarks_external/**': 'web',
85-
'**/example*/**': 'web'
81+
srcFolderInsertion: {
82+
js: {
83+
'**': ''
84+
},
85+
dart: {
86+
'**': 'lib',
87+
'*/test/**': '',
88+
'benchmarks/**': 'web',
89+
'benchmarks/test/**': '',
90+
'benchmarks_external/**': 'web',
91+
'benchmarks_external/test/**': '',
92+
'example*/**': 'web',
93+
'example*/test/**': ''
94+
}
8695
},
8796
deps: {
8897
js: [
@@ -145,7 +154,7 @@ var CONFIG = {
145154
},
146155
scriptsPerFolder: {
147156
js: {
148-
default: _HTLM_DEFAULT_SCRIPTS_JS,
157+
'**': _HTLM_DEFAULT_SCRIPTS_JS,
149158
'benchmarks/**':
150159
[
151160
{ src: '/deps/url_params_to_form.js', mimeType: 'text/javascript' }
@@ -157,7 +166,7 @@ var CONFIG = {
157166
].concat(_HTLM_DEFAULT_SCRIPTS_JS)
158167
},
159168
dart: {
160-
default: _HTML_DEFAULT_SCRIPTS_DART,
169+
'**': _HTML_DEFAULT_SCRIPTS_DART,
161170
'benchmarks*/**':
162171
[
163172
{ src: '/deps/url_params_to_form.js', mimeType: 'text/javascript' }
@@ -221,7 +230,7 @@ gulp.task('build/transpile.js.dev', transpile(gulp, gulpPlugins, {
221230
dest: CONFIG.dest.js.dev,
222231
outputExt: 'js',
223232
options: CONFIG.transpile.options.js.dev,
224-
srcFolderMapping: CONFIG.srcFolderMapping
233+
srcFolderInsertion: CONFIG.srcFolderInsertion.js
225234
}));
226235

227236
gulp.task('build/transpile.js.prod', transpile(gulp, gulpPlugins, {
@@ -230,7 +239,7 @@ gulp.task('build/transpile.js.prod', transpile(gulp, gulpPlugins, {
230239
dest: CONFIG.dest.js.prod,
231240
outputExt: 'js',
232241
options: CONFIG.transpile.options.js.prod,
233-
srcFolderMapping: CONFIG.srcFolderMapping
242+
srcFolderInsertion: CONFIG.srcFolderInsertion.js
234243
}));
235244

236245
gulp.task('build/transpile.dart', transpile(gulp, gulpPlugins, {
@@ -239,7 +248,7 @@ gulp.task('build/transpile.dart', transpile(gulp, gulpPlugins, {
239248
dest: CONFIG.dest.dart,
240249
outputExt: 'dart',
241250
options: CONFIG.transpile.options.dart,
242-
srcFolderMapping: CONFIG.srcFolderMapping
251+
srcFolderInsertion: CONFIG.srcFolderInsertion.dart
243252
}));
244253

245254
gulp.task('build/transpile/tools.cjs', transpile(gulp, gulpPlugins, {
@@ -248,9 +257,7 @@ gulp.task('build/transpile/tools.cjs', transpile(gulp, gulpPlugins, {
248257
dest: CONFIG.dest.cjs.tools,
249258
outputExt: 'js',
250259
options: CONFIG.transpile.options.cjs,
251-
srcFolderMapping: {
252-
'default': 'src'
253-
}
260+
srcFolderInsertion: CONFIG.srcFolderInsertion.js
254261
}));
255262

256263
gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
@@ -259,9 +266,7 @@ gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
259266
dest: CONFIG.dest.cjs.e2eTest,
260267
outputExt: 'js',
261268
options: CONFIG.transpile.options.cjs,
262-
srcFolderMapping: {
263-
'default': 'src'
264-
}
269+
srcFolderInsertion: CONFIG.srcFolderInsertion.js
265270
}));
266271

267272
// ------------
@@ -270,21 +275,21 @@ gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
270275
gulp.task('build/html.js.dev', html(gulp, gulpPlugins, {
271276
src: CONFIG.html.src.js,
272277
dest: CONFIG.dest.js.dev,
273-
srcFolderMapping: CONFIG.srcFolderMapping,
278+
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
274279
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
275280
}));
276281

277282
gulp.task('build/html.js.prod', html(gulp, gulpPlugins, {
278283
src: CONFIG.html.src.js,
279284
dest: CONFIG.dest.js.prod,
280-
srcFolderMapping: CONFIG.srcFolderMapping,
285+
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
281286
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
282287
}));
283288

284289
gulp.task('build/html.dart', html(gulp, gulpPlugins, {
285290
src: CONFIG.html.src.dart,
286291
dest: CONFIG.dest.dart,
287-
srcFolderMapping: CONFIG.srcFolderMapping,
292+
srcFolderInsertion: CONFIG.srcFolderInsertion.dart,
288293
scriptsPerFolder: CONFIG.html.scriptsPerFolder.dart
289294
}));
290295

@@ -302,8 +307,7 @@ gulp.task('build/pubspec.dart', pubspec(gulp, gulpPlugins, {
302307

303308
gulp.task('build/analyze.dart', dartanalyzer(gulp, gulpPlugins, {
304309
dest: CONFIG.dest.dart,
305-
command: DART_SDK.ANALYZER,
306-
srcFolderMapping: CONFIG.srcFolderMapping
310+
command: DART_SDK.ANALYZER
307311
}));
308312

309313
// ------------

karma-dart.conf.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ module.exports = function(config) {
4242
'/packages/path': 'http://localhost:9877/base/packages/path',
4343

4444
// Local dependencies, transpiled from the source.
45-
'/packages/angular': 'http://localhost:9877/base/modules/angular/src',
46-
'/packages/core': 'http://localhost:9877/base/modules/core/src',
47-
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection/src',
48-
'/packages/reflection': 'http://localhost:9877/base/modules/reflection/src',
49-
'/packages/di': 'http://localhost:9877/base/modules/di/src',
50-
'/packages/directives': 'http://localhost:9877/base/modules/directives/src',
51-
'/packages/facade': 'http://localhost:9877/base/modules/facade/src',
52-
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib/src',
45+
'/packages/angular': 'http://localhost:9877/base/modules/angular',
46+
'/packages/core': 'http://localhost:9877/base/modules/core',
47+
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection',
48+
'/packages/reflection': 'http://localhost:9877/base/modules/reflection',
49+
'/packages/di': 'http://localhost:9877/base/modules/di',
50+
'/packages/directives': 'http://localhost:9877/base/modules/directives',
51+
'/packages/facade': 'http://localhost:9877/base/modules/facade',
52+
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib',
5353
},
5454

5555
preprocessors: {

modules/benchmarks/e2e_test/change_detection_perf.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');
22

33
describe('ng2 change detection benchmark', function () {
44

5-
var URL = 'benchmarks/web/change_detection/change_detection_benchmark.html';
5+
var URL = 'benchmarks/src/change_detection/change_detection_benchmark.html';
66

77
afterEach(perfUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/change_detection_spec.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');
22

33
describe('ng2 change detection benchmark', function () {
44

5-
var URL = 'benchmarks/web/change_detection/change_detection_benchmark.html';
5+
var URL = 'benchmarks/src/change_detection/change_detection_benchmark.html';
66

77
afterEach(testUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/compiler_perf.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');
22

33
describe('ng2 compiler benchmark', function () {
44

5-
var URL = 'benchmarks/web/compiler/compiler_benchmark.html';
5+
var URL = 'benchmarks/src/compiler/compiler_benchmark.html';
66

77
afterEach(perfUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/compiler_spec.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');
22

33
describe('ng2 compiler benchmark', function () {
44

5-
var URL = 'benchmarks/web/compiler/compiler_benchmark.html';
5+
var URL = 'benchmarks/src/compiler/compiler_benchmark.html';
66

77
afterEach(testUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/di_perf.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');
22

33
describe('ng2 di benchmark', function () {
44

5-
var URL = 'benchmarks/web/di/di_benchmark.html';
5+
var URL = 'benchmarks/src/di/di_benchmark.html';
66

77
afterEach(perfUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/di_spec.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');
22

33
describe('ng2 di benchmark', function () {
44

5-
var URL = 'benchmarks/web/di/di_benchmark.html';
5+
var URL = 'benchmarks/src/di/di_benchmark.html';
66

77
afterEach(testUtil.verifyNoBrowserErrors);
88

modules/benchmarks/e2e_test/element_injector_perf.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');
22

33
describe('ng2 element injector benchmark', function () {
44

5-
var URL = 'benchmarks/web/element_injector/element_injector_benchmark.html';
5+
var URL = 'benchmarks/src/element_injector/element_injector_benchmark.html';
66

77
afterEach(perfUtil.verifyNoBrowserErrors);
88

0 commit comments

Comments
 (0)
X Tutup