Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cf04a93
build: use webpack for building apps.
TheLarkInn Jul 14, 2016
7786ed3
chore(lint) Corrected any eslint errors and cleaned up unused files
TheLarkInn Jul 14, 2016
cf441a7
chore(cleanup) additional cleanup tasks performed. Removed unneeded c…
TheLarkInn Jul 15, 2016
541d698
chore: remove bind from serve command
filipesilva Jul 15, 2016
0d1c633
chore: simplify test command
filipesilva Jul 15, 2016
4189b9b
chore: fix test warnings
filipesilva Jul 15, 2016
41653cf
chore: revert whitespace changes
filipesilva Jul 15, 2016
f0e6e51
chore: re-add mapRoot to tsconfig
filipesilva Jul 15, 2016
bdb8690
chore: remove unused import
filipesilva Jul 15, 2016
8ea2e72
bugfix: fix broken tests
filipesilva Jul 15, 2016
8b6fdc9
fix: fix mobile-specific feature test
filipesilva Jul 15, 2016
87b4cbd
bugfix: fix public folder test
filipesilva Jul 15, 2016
860526c
fix: fixes for path mappings, tests, and coverage (#1359)
TheLarkInn Jul 17, 2016
435cd18
fix: add environment configuration replacement (#1364)
TheLarkInn Jul 18, 2016
18318a2
fix(tests): re-enable sass/less/stylus tests (#1363)
filipesilva Jul 19, 2016
de98a64
chore: remove systemjs (#1376)
filipesilva Jul 19, 2016
89b4dd5
chore: remove vendor.ts (#1383)
filipesilva Jul 19, 2016
a144db1
chore: remove material2 test option (#1385)
filipesilva Jul 19, 2016
30fd942
fix(build): re-add support for sourceDir (#1378)
filipesilva Jul 20, 2016
aef92b4
chore(build): remove broccoli (#1386)
filipesilva Jul 20, 2016
05b5ca3
chore: remove windows elevation check (#1384)
filipesilva Jul 20, 2016
86c425c
fix(test): add missing sourceDir (#1387)
filipesilva Jul 20, 2016
5b21617
fix: update node polyfill support properties for prod config to allow…
TheLarkInn Jul 20, 2016
e6bdf50
chore(tests): add prod env e2e test (#1394)
filipesilva Jul 20, 2016
1a68ce6
chore: cleanup of new files (#1388)
filipesilva Jul 20, 2016
4cfc463
fix(serve): disable HMR (#1402)
filipesilva Jul 21, 2016
698ba0c
chore: review docs (#1407)
filipesilva Jul 21, 2016
23e5eb9
feat(env): decouple build from env file (#1404)
filipesilva Jul 22, 2016
06fc077
fix: fix tsconfig for editors (#1420)
filipesilva Jul 22, 2016
8695be4
chore: Merge master into webpack
hansl Jul 22, 2016
6562f78
chore: fix webpack branch after merge conflicts (#1423)
hansl Jul 22, 2016
29f899c
fix: update to awesome-typescript-loader 2.1.0 (#1425)
TheLarkInn Jul 22, 2016
b8f502e
chore(blueprints): remove module.id (#1426)
filipesilva Jul 22, 2016
930785f
feat: add host flag support for ng serve (#1442)
TheLarkInn Jul 25, 2016
c3fe959
feat(test): add karma plugin (#1437)
filipesilva Jul 25, 2016
8a2e0e5
chore(blueprints): re-add outDir (#1428)
filipesilva Jul 25, 2016
3d22394
feat: use @types instead of typings (#1449)
filipesilva Jul 26, 2016
9d42071
fix: make sourcemaps work in test (#1447)
TheLarkInn Jul 26, 2016
a3b1bf4
feat: add utilities for typescript ast (#1159) (#1453)
hansl Jul 26, 2016
755fb7a
Merge branch 'master' into webpack
hansl Jul 26, 2016
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
Prev Previous commit
Next Next commit
fix: fixes for path mappings, tests, and coverage (#1359)
* fix(): Multiple fixes for path mappings:

* Removed invalid test case that was throwing path mappings  tests because of a typescript bug.
* Readded PathsPlugin for Path Mappings
* Removed coverage preprocessor which was throwing bad type errors against ts code when it shouldn't be.
* Added sourcemap support for istanbul instrumenter. Coverage files are still being generated.

* fix: fix the way the build command runs for mobile tests

* fix: fix the way the build command runs for mobile tests

* fix: replaced promise based ng command with sh.exec to allow mappings test to run correctly against mobile

* fix: replaced promise based ng command with sh.exec to allow mappings test to run correctly against mobile
  • Loading branch information
TheLarkInn authored and hansl committed Jul 17, 2016
commit 860526c8ec9578dbee68d5b823cc2d6c6acc03d5
16 changes: 6 additions & 10 deletions addon/ng2/blueprints/ng2/files/__path__/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ Promise.all([
let testing = providers[0];
let testingBrowser = providers[1];

testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
testing.setBaseTestProviders(
testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
);
});

let testContext = require.context('../src', true, /\.spec\.ts/);

/*
* get all the files, for each file, call the context function
* that will require the file and load it up here. Context will
* loop and require those spec files here
*/
function requireAll(requireContext) {
let testContext: any = require.context('../src', true, /\.spec\.ts/);
function requireAll(requireContext: any) {
return requireContext.keys().map(requireContext);
}

Expand Down
7 changes: 1 addition & 6 deletions addon/ng2/blueprints/ng2/files/__path__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@
"rootDir": ".",
"sourceMap": true,
"target": "es5",
"mapRoot": "/",
"inlinesource": true
"mapRoot": "/"
},
"compileOnSave": false,
"buildOnSave": false,
"exclude": [
"node_modules",
"bower_components"
],
"includes": [
"**.d.ts"
]
Expand Down
7 changes: 5 additions & 2 deletions addon/ng2/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as webpack from 'webpack';
import {LoaderConfig} from '../utilities/ts-path-mappings-webpack-plugin';
import {LoaderConfig, PathsPlugin} from '../utilities/ts-path-mappings-webpack-plugin';

const path = require('path');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
Expand All @@ -18,7 +18,10 @@ export function getWebpackCommonConfig(projectRoot: string) {
resolve: {
extensions: ['', '.ts', '.js'],
root: path.resolve(projectRoot, './src'),
moduleDirectories: ['node_modules']
moduleDirectories: ['node_modules'],
plugins: [
new PathsPlugin(awesomeTypescriptLoaderConfig);
]
},
context: path.resolve(__dirname, './'),
entry: {
Expand Down
3 changes: 1 addition & 2 deletions addon/ng2/models/webpack-build-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const getWebpackTestConfig = function(projectRoot: string) {
query: {
useWebpackText: true,
tsconfig: path.resolve(projectRoot, './src/tsconfig.json'),
// resolveGlobs: false,
module: "commonjs",
target: "es5",
useForkChecker: true,
Expand All @@ -67,7 +66,7 @@ export const getWebpackTestConfig = function(projectRoot: string) {
],
postLoaders: [
{
test: /\.(js|ts)$/, loader: 'istanbul-instrumenter-loader',
test: /\.(js|ts)$/, loader: 'sourcemap-istanbul-instrumenter-loader',
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
Expand Down
2 changes: 1 addition & 1 deletion addon/ng2/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = Task.extend({

// Single test entry file. Will run the test.ts bundle and track it.
options.files = [{ pattern: './src/test.ts', watched: false }];
options.preprocessors = { './src/test.ts': ['coverage','webpack','sourcemap'] };
options.preprocessors = { './src/test.ts': ['webpack','sourcemap'] };
options.webpack = webpackTestConfig(projectRoot);
options.webpackMiddleware = {
noInfo: true, // Hide webpack output because its noisy.
Expand Down
3 changes: 0 additions & 3 deletions addon/ng2/utilities/ts-path-mappings-webpack-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ export class PathsPlugin implements ResolverPlugin {
this.baseUrl
);

console.log("CONFIG FILE AND BASE URL");
console.log(this.configFilePath, this.absoluteBaseUrl);

this.mappings = [];
let paths = this.options.paths || {};
Object.keys(paths).forEach(alias => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"shelljs": "^0.7.0",
"silent-error": "^1.0.0",
"source-map-loader": "^0.1.5",
"sourcemap-istanbul-instrumenter-loader": "^0.2.0",
"style-loader": "^0.13.1",
"stylus": "^0.54.5",
"stylus-loader": "^2.1.0",
Expand All @@ -97,7 +98,7 @@
"typescript": "^2.0.0",
"typings": "^0.8.1",
"url-loader": "^0.5.7",
"webpack": "2.1.0-beta.17",
"webpack": "2.1.0-beta.18",
"webpack-dev-server": "2.1.0-beta.0",
"webpack-md5-hash": "0.0.5",
"webpack-merge": "^0.14.0"
Expand Down
43 changes: 22 additions & 21 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Basic end-to-end Workflow', function () {
this.timeout(300000);

sh.exec('npm link', { silent: true });

return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
expect(existsSync(path.join(process.cwd(), 'bin', 'ng')));
Expand Down Expand Up @@ -446,36 +446,37 @@ describe('Basic end-to-end Workflow', function () {
});
});

xit('Turn on path mapping in tsconfig.json and rebuild', function () {
it('Turn on path mapping in tsconfig.json and rebuild', function () {
this.timeout(420000);

const configFilePath = path.join(process.cwd(), 'src', 'tsconfig.json');
let config = require(configFilePath);

config.compilerOptions.baseUrl = '';

// This should fail.
// #TODO: When https://github.com/Microsoft/TypeScript/issues/9772 is fixed this should fail.
config.compilerOptions.paths = { '@angular/*': [] };
fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2), 'utf8');

return ng(['build'])
.catch(() => {
return true;
})
.then((passed) => {
expect(passed).to.equal(true);
})
.then(() => {
// This should succeed.
config.compilerOptions.paths = {
'@angular/*': [ '*' ]
};
fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2), 'utf8');
})
.then(() => ng(['build']))
.catch(() => {
expect('build failed where it should have succeeded').to.equal('');
});
sh.exec(`${ngBin} build`);
// #TODO: Uncomment these lines when https://github.com/Microsoft/TypeScript/issues/9772 is fixed.
// .catch(() => {
// return true;
// })
// .then((passed) => {
// expect(passed).to.equal(true);
// })

// This should succeed.
config.compilerOptions.paths = {
'@angular/*': [ '../node_modules/@angular/*' ]
};
fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2), 'utf8');
sh.exec(`${ngBin} build`);

expect(existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true);
const indexHtml = fs.readFileSync(path.join(process.cwd(), 'dist/index.html'), 'utf-8');
expect(indexHtml).to.include('main.bundle.js');
});

it('Serve and run e2e tests after all other commands', function () {
Expand Down