Skip to content

Commit

Permalink
refactor(build): explicitly mention src folder in imports
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tbosch authored and alexeagle committed Feb 5, 2015
1 parent 9db13be commit 05ffdc9
Show file tree
Hide file tree
Showing 160 changed files with 619 additions and 627 deletions.
48 changes: 26 additions & 22 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var CJS_COMPILER_OPTIONS = {

var _HTLM_DEFAULT_SCRIPTS_JS = [
{src: '/deps/traceur-runtime.js', mimeType: 'text/javascript'},
{src: '/rtts_assert/lib/rtts_assert.js', mimeType: 'text/javascript'},
{src: '/rtts_assert/rtts_assert.js', mimeType: 'text/javascript'},
{src: '/deps/es6-module-loader-sans-promises.src.js', mimeType: 'text/javascript'},
{src: '/deps/zone.js', mimeType: 'text/javascript'},
{src: '/deps/long-stack-trace-zone.js', mimeType: 'text/javascript'},
Expand Down Expand Up @@ -78,11 +78,20 @@ var CONFIG = {
},
docs: 'dist/docs'
},
srcFolderMapping: {
'default': 'lib',
'**/benchmarks/**': 'web',
'**/benchmarks_external/**': 'web',
'**/example*/**': 'web'
srcFolderInsertion: {
js: {
'**': ''
},
dart: {
'**': 'lib',
'*/test/**': '',
'benchmarks/**': 'web',
'benchmarks/test/**': '',
'benchmarks_external/**': 'web',
'benchmarks_external/test/**': '',
'example*/**': 'web',
'example*/test/**': ''
}
},
deps: {
js: [
Expand Down Expand Up @@ -145,7 +154,7 @@ var CONFIG = {
},
scriptsPerFolder: {
js: {
default: _HTLM_DEFAULT_SCRIPTS_JS,
'**': _HTLM_DEFAULT_SCRIPTS_JS,
'benchmarks/**':
[
{ src: '/deps/url_params_to_form.js', mimeType: 'text/javascript' }
Expand All @@ -157,7 +166,7 @@ var CONFIG = {
].concat(_HTLM_DEFAULT_SCRIPTS_JS)
},
dart: {
default: _HTML_DEFAULT_SCRIPTS_DART,
'**': _HTML_DEFAULT_SCRIPTS_DART,
'benchmarks*/**':
[
{ src: '/deps/url_params_to_form.js', mimeType: 'text/javascript' }
Expand Down Expand Up @@ -221,7 +230,7 @@ gulp.task('build/transpile.js.dev', transpile(gulp, gulpPlugins, {
dest: CONFIG.dest.js.dev,
outputExt: 'js',
options: CONFIG.transpile.options.js.dev,
srcFolderMapping: CONFIG.srcFolderMapping
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));

gulp.task('build/transpile.js.prod', transpile(gulp, gulpPlugins, {
Expand All @@ -230,7 +239,7 @@ gulp.task('build/transpile.js.prod', transpile(gulp, gulpPlugins, {
dest: CONFIG.dest.js.prod,
outputExt: 'js',
options: CONFIG.transpile.options.js.prod,
srcFolderMapping: CONFIG.srcFolderMapping
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));

gulp.task('build/transpile.dart', transpile(gulp, gulpPlugins, {
Expand All @@ -239,7 +248,7 @@ gulp.task('build/transpile.dart', transpile(gulp, gulpPlugins, {
dest: CONFIG.dest.dart,
outputExt: 'dart',
options: CONFIG.transpile.options.dart,
srcFolderMapping: CONFIG.srcFolderMapping
srcFolderInsertion: CONFIG.srcFolderInsertion.dart
}));

gulp.task('build/transpile/tools.cjs', transpile(gulp, gulpPlugins, {
Expand All @@ -248,9 +257,7 @@ gulp.task('build/transpile/tools.cjs', transpile(gulp, gulpPlugins, {
dest: CONFIG.dest.cjs.tools,
outputExt: 'js',
options: CONFIG.transpile.options.cjs,
srcFolderMapping: {
'default': 'src'
}
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));

gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
Expand All @@ -259,9 +266,7 @@ gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
dest: CONFIG.dest.cjs.e2eTest,
outputExt: 'js',
options: CONFIG.transpile.options.cjs,
srcFolderMapping: {
'default': 'src'
}
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));

// ------------
Expand All @@ -270,21 +275,21 @@ gulp.task('build/transpile/e2eTest.cjs', transpile(gulp, gulpPlugins, {
gulp.task('build/html.js.dev', html(gulp, gulpPlugins, {
src: CONFIG.html.src.js,
dest: CONFIG.dest.js.dev,
srcFolderMapping: CONFIG.srcFolderMapping,
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
}));

gulp.task('build/html.js.prod', html(gulp, gulpPlugins, {
src: CONFIG.html.src.js,
dest: CONFIG.dest.js.prod,
srcFolderMapping: CONFIG.srcFolderMapping,
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
}));

gulp.task('build/html.dart', html(gulp, gulpPlugins, {
src: CONFIG.html.src.dart,
dest: CONFIG.dest.dart,
srcFolderMapping: CONFIG.srcFolderMapping,
srcFolderInsertion: CONFIG.srcFolderInsertion.dart,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.dart
}));

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

gulp.task('build/analyze.dart', dartanalyzer(gulp, gulpPlugins, {
dest: CONFIG.dest.dart,
command: DART_SDK.ANALYZER,
srcFolderMapping: CONFIG.srcFolderMapping
command: DART_SDK.ANALYZER
}));

// ------------
Expand Down
16 changes: 8 additions & 8 deletions karma-dart.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ module.exports = function(config) {
'/packages/path': 'http://localhost:9877/base/packages/path',

// Local dependencies, transpiled from the source.
'/packages/angular': 'http://localhost:9877/base/modules/angular/src',
'/packages/core': 'http://localhost:9877/base/modules/core/src',
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection/src',
'/packages/reflection': 'http://localhost:9877/base/modules/reflection/src',
'/packages/di': 'http://localhost:9877/base/modules/di/src',
'/packages/directives': 'http://localhost:9877/base/modules/directives/src',
'/packages/facade': 'http://localhost:9877/base/modules/facade/src',
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib/src',
'/packages/angular': 'http://localhost:9877/base/modules/angular',
'/packages/core': 'http://localhost:9877/base/modules/core',
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection',
'/packages/reflection': 'http://localhost:9877/base/modules/reflection',
'/packages/di': 'http://localhost:9877/base/modules/di',
'/packages/directives': 'http://localhost:9877/base/modules/directives',
'/packages/facade': 'http://localhost:9877/base/modules/facade',
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib',
},

preprocessors: {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/change_detection_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

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

var URL = 'benchmarks/web/change_detection/change_detection_benchmark.html';
var URL = 'benchmarks/src/change_detection/change_detection_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/change_detection_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

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

var URL = 'benchmarks/web/change_detection/change_detection_benchmark.html';
var URL = 'benchmarks/src/change_detection/change_detection_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/compiler_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

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

var URL = 'benchmarks/web/compiler/compiler_benchmark.html';
var URL = 'benchmarks/src/compiler/compiler_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/compiler_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

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

var URL = 'benchmarks/web/compiler/compiler_benchmark.html';
var URL = 'benchmarks/src/compiler/compiler_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/di_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

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

var URL = 'benchmarks/web/di/di_benchmark.html';
var URL = 'benchmarks/src/di/di_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/di_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

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

var URL = 'benchmarks/web/di/di_benchmark.html';
var URL = 'benchmarks/src/di/di_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/element_injector_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

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

var URL = 'benchmarks/web/element_injector/element_injector_benchmark.html';
var URL = 'benchmarks/src/element_injector/element_injector_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/element_injector_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

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

var URL = 'benchmarks/web/element_injector/element_injector_benchmark.html';
var URL = 'benchmarks/src/element_injector/element_injector_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/selector_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

describe('ng2 selector benchmark', function () {

var URL = 'benchmarks/web/compiler/selector_benchmark.html';
var URL = 'benchmarks/src/compiler/selector_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/selector_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

describe('ng2 selector benchmark', function () {

var URL = 'benchmarks/web/compiler/selector_benchmark.html';
var URL = 'benchmarks/src/compiler/selector_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/tree_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

describe('ng2 tree benchmark', function () {

var URL = 'benchmarks/web/tree/tree_benchmark.html';
var URL = 'benchmarks/src/tree/tree_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test/tree_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

describe('ng2 tree benchmark', function () {

var URL = 'benchmarks/web/tree/tree_benchmark.html';
var URL = 'benchmarks/src/tree/tree_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ListWrapper, MapWrapper} from 'facade/collection';
import {reflector} from 'reflection/reflection';
import {isPresent} from 'facade/lang';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {ListWrapper, MapWrapper} from 'facade/src/collection';
import {reflector} from 'reflection/src/reflection';
import {isPresent} from 'facade/src/lang';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

import {
Lexer,
Expand Down
22 changes: 11 additions & 11 deletions modules/benchmarks/src/compiler/compiler_benchmark.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {DOM, document} from 'facade/dom';
import {isBlank, Type} from 'facade/lang';
import {MapWrapper} from 'facade/collection';
import {DirectiveMetadata} from 'core/compiler/directive_metadata';
import {DOM, document} from 'facade/src/dom';
import {isBlank, Type} from 'facade/src/lang';
import {MapWrapper} from 'facade/src/collection';
import {DirectiveMetadata} from 'core/src/compiler/directive_metadata';

import {Parser, Lexer, ProtoRecordRange, dynamicChangeDetection} from 'change_detection/change_detection';

import {Compiler, CompilerCache} from 'core/compiler/compiler';
import {DirectiveMetadataReader} from 'core/compiler/directive_metadata_reader';
import {Compiler, CompilerCache} from 'core/src/compiler/compiler';
import {DirectiveMetadataReader} from 'core/src/compiler/directive_metadata_reader';

import {Component} from 'core/annotations/annotations';
import {Decorator} from 'core/annotations/annotations';
import {TemplateConfig} from 'core/annotations/template_config';
import {Component} from 'core/src/annotations/annotations';
import {Decorator} from 'core/src/annotations/annotations';
import {TemplateConfig} from 'core/src/annotations/template_config';

import {reflector} from 'reflection/reflection';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {reflector} from 'reflection/src/reflection';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

function setupReflector() {
reflector.registerType(BenchmarkComponent, {
Expand Down
10 changes: 5 additions & 5 deletions modules/benchmarks/src/compiler/selector_benchmark.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {SelectorMatcher} from "core/compiler/selector";
import {CssSelector} from "core/compiler/selector";
import {StringWrapper, Math} from 'facade/lang';
import {ListWrapper} from 'facade/collection';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {SelectorMatcher} from "core/src/compiler/selector";
import {CssSelector} from "core/src/compiler/selector";
import {StringWrapper, Math} from 'facade/src/lang';
import {ListWrapper} from 'facade/src/collection';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

export function main() {
var count = getIntParameter('selectors');
Expand Down
4 changes: 2 additions & 2 deletions modules/benchmarks/src/di/di_benchmark.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Injector, Key} from "di/di";
import {reflector} from 'reflection/reflection';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {reflector} from 'reflection/src/reflection';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

var count = 0;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {reflector} from 'reflection/reflection';
import {reflector} from 'reflection/src/reflection';
import {Injector} from 'di/di';
import {ProtoElementInjector} from 'core/compiler/element_injector';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {ProtoElementInjector} from 'core/src/compiler/element_injector';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

var count = 0;

Expand Down
18 changes: 9 additions & 9 deletions modules/benchmarks/src/tree/tree_benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import {Parser, Lexer, ChangeDetector, ChangeDetection, jitChangeDetection}

import {bootstrap, Component, Template, TemplateConfig, ViewPort, Compiler} from 'angular/angular';

import {CompilerCache} from 'core/compiler/compiler';
import {DirectiveMetadataReader} from 'core/compiler/directive_metadata_reader';
import {TemplateLoader} from 'core/compiler/template_loader';
import {LifeCycle} from 'core/life_cycle/life_cycle';

import {reflector} from 'reflection/reflection';
import {DOM, document, window, Element, gc} from 'facade/dom';
import {isPresent} from 'facade/lang';
import {getIntParameter, bindAction} from 'e2e_test_lib/benchmark_util';
import {CompilerCache} from 'core/src/compiler/compiler';
import {DirectiveMetadataReader} from 'core/src/compiler/directive_metadata_reader';
import {TemplateLoader} from 'core/src/compiler/template_loader';
import {LifeCycle} from 'core/src/life_cycle/life_cycle';

import {reflector} from 'reflection/src/reflection';
import {DOM, document, window, Element, gc} from 'facade/src/dom';
import {isPresent} from 'facade/src/lang';
import {getIntParameter, bindAction} from 'e2e_test_lib/src/benchmark_util';

function setupReflector() {
// TODO: Put the general calls to reflector.register... in a shared file
Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks_external/e2e_test/compiler_perf.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

describe('ng1.x compiler benchmark', function () {

var URL = 'benchmarks_external/web/compiler/compiler_benchmark.html';
var URL = 'benchmarks_external/src/compiler/compiler_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks_external/e2e_test/compiler_spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var testUtil = require('../../e2e_test_lib/e2e_test/test_util');

describe('ng1.x compiler benchmark', function () {

var URL = 'benchmarks_external/web/compiler/compiler_benchmark.html';
var URL = 'benchmarks_external/src/compiler/compiler_benchmark.html';

afterEach(testUtil.verifyNoBrowserErrors);

Expand Down
2 changes: 1 addition & 1 deletion modules/benchmarks_external/e2e_test/largetable_perf.es6
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var perfUtil = require('../../e2e_test_lib/e2e_test/perf_util');

describe('ng1.x largetable benchmark', function () {
var URL = 'benchmarks_external/web/largetable/largetable_benchmark.html';
var URL = 'benchmarks_external/src/largetable/largetable_benchmark.html';

afterEach(perfUtil.verifyNoBrowserErrors);

Expand Down
Loading

0 comments on commit 05ffdc9

Please sign in to comment.