Skip to content

Commit 1424c38

Browse files
committed
Tests more shelled out, still not running correctly but I'm much closer
1 parent 302c81e commit 1424c38

File tree

10 files changed

+139
-201
lines changed

10 files changed

+139
-201
lines changed

addon/ng2/blueprints/ng2/files/config/karma.conf.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ module.exports = function (config) {
1414
}
1515
},
1616
files: [
17-
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
18-
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
19-
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
20-
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
21-
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
22-
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
23-
24-
{ pattern: 'config/karma-test-shim.js', included: true, watched: true },
17+
// { pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
18+
// { pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
19+
// { pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
20+
// { pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
21+
// { pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
22+
// { pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
23+
// { pattern: 'config/karma-test-shim.js', included: true, watched: true },
2524

2625
// Distribution folder.
27-
{ pattern: 'dist/**/*', included: false, watched: true }
26+
// { pattern: 'dist/**/*', included: false, watched: true }
2827
],
2928
exclude: [
3029
// Vendor packages might include spec files. We don't want to use those.

addon/ng2/blueprints/ng2/files/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@angular/http": "2.0.0-rc.2",
2020
"@angular/platform-browser": "2.0.0-rc.2",
2121
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
22-
"@angular/router": "3.0.0-alpha.5",
22+
"@angular/router": "3.0.0-alpha.7",
2323
"rxjs": "5.0.0-beta.6",
2424
"systemjs": "0.19.26",
2525
"core-js": "^2.4.0",
@@ -31,7 +31,6 @@
3131
"@angular/router-deprecated": "2.0.0-rc.2",
3232
"@angular/service-worker": "^0.2.0",
3333
"@angular/app-shell": "^0.0.0",
34-
"angular2-broccoli-prerender": "^0.11.0",
3534
"angular2-universal":"^0.100.3",
3635
"angular2-universal-polyfills": "^0.4.1",
3736
"preboot": "^2.0.10",<% } %>
@@ -46,7 +45,7 @@
4645
"protractor": "^3.3.0",
4746
"ts-node": "^0.5.5",
4847
"tslint": "^3.6.0",
49-
"typescript": "^1.9.0-dev.20160613-1.0",
48+
"typescript": "^1.9.0-dev.20160615-1.0",
5049
"typings": "^0.8.1"
5150
}
5251
}

addon/ng2/commands/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = Command.extend({
3434
run: function(commandOptions: BuildOptions) {
3535
let buildTask = commandOptions.watch ? new WebpackBuildWatch({options: commandOptions}) : new WebpackBuild({options: commandOptions});
3636

37-
return buildTask.run();
37+
return buildTask.run(commandOptions);
3838
}
3939
});
4040

addon/ng2/models/save-for-later.ts

+99
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,103 @@
7979
// chunksSortMode: 'dependency'
8080
// })
8181
// ];
82+
//
83+
//
84+
//
85+
//
86+
//
87+
// const webpack = require('webpack');
88+
// const HtmlWebpackPlugin = require('html-webpack-plugin');
89+
// const CopyWebpackPlugin = require('copy-webpack-plugin');
90+
// const path = require('path');
91+
// const ClosureCompilerPlugin = require('webpack-closure-compiler');
92+
// const autoprefixer = require('autoprefixer');
93+
// const cssnano = require('cssnano');
94+
// const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
95+
// // Resolve to the generated applications
96+
97+
98+
99+
100+
// let baseHtmlTemplateConfig = {
101+
// template: ngAppResolve('./src/index.html'),
102+
// chunksSortMode: 'dependency'
103+
// };
104+
// // These are the output
105+
// const webpackTestPartial = {
106+
// module: {
107+
// plugins: [
108+
// new ForkCheckerPlugin(),
109+
// new HtmlWebpackPlugin(baseHtmlTemplateConfig),
110+
// ],
111+
// preLoaders: [
112+
// {
113+
// test: /\.ts$/,
114+
// loader: 'tslint-loader',
115+
// exclude: ['node_modules']
116+
// },
117+
// {
118+
// test: /\.js$/,
119+
// loader: 'source-map-loader',
120+
// exclude: [
121+
// // these packages have problems with their sourcemaps
122+
// ngAppResolve('node_modules/rxjs'),
123+
// ngAppResolve('node_modules/@angular')
124+
// ]}
125+
// ],
126+
// loaders: [
127+
// {
128+
// test: /\.ts$/,
129+
// loaders: [
130+
// {
131+
// loader: 'awesome-typescript-loader',
132+
// query: {
133+
// useWebpackText: true,
134+
// tsconfig: ngAppResolve('./src/tsconfig.json'),
135+
// resolveGlobs: false,
136+
// module: "es2015",
137+
// target: "es5",
138+
// library: 'es6',
139+
// useForkChecker: true,
140+
// removeComments: true
141+
// }
142+
// },
143+
// {
144+
// loader: 'angular2-template-loader'
145+
// }
146+
// ],
147+
// exclude: [/\.(spec|e2e)\.ts$/]
148+
// },
149+
// { test: /\.json$/, loader: 'json-loader', exclude: [ngAppResolve('src/index.html')] },
150+
// { test: /\.css$/, loader: 'raw-loader', exclude: [ngAppResolve('src/index.html')] },
151+
// { test: /\.html$/, loader: 'raw-loader', exclude: [ngAppResolve('src/index.html')] }
152+
// ]
153+
// },
154+
// tslint: {
155+
// emitErrors: false,
156+
// failOnHint: false,
157+
// resourcePath: 'src'
158+
// },
159+
// node: {
160+
// global: 'window',
161+
// process: false,
162+
// crypto: 'empty',
163+
// module: false,
164+
// clearImmediate: false,
165+
// setImmediate: false
166+
// }
167+
// };
168+
169+
// Webpack Configuration Object
170+
// Used in build.ts
171+
172+
173+
174+
175+
176+
177+
178+
179+
180+
82181

addon/ng2/models/webpack-build-config.ts

-169
This file was deleted.

addon/ng2/tasks/build-webpack-watch.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import {webpackCommonConfig, webpackOutputOptions} from '../models/webpack-build-config';
1+
import {webpackOutputOptions, webpackDevConfig, webpackProdConfig} from '../models/';
2+
23
import {IServeTaskOptions} from '../commands/serve';
34

45
const Task = require('ember-cli/lib/models/task');
56
const webpack = require('webpack');
6-
const webpackCompiler = webpack(webpackCommonConfig);
7-
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
8-
9-
webpackCompiler.apply(new ProgressPlugin({
10-
profile: true
11-
}));
127

138
let lastHash = null;
149

1510
module.exports = Task.extend({
1611
run: () => {
1712
let commandOptions: IServeTaskOptions = this.options;
1813

14+
const webpackCompiler = webpack(webpackDevConfig);
15+
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
16+
17+
webpackCompiler.apply(new ProgressPlugin({
18+
profile: true
19+
}));
20+
1921
return new Promise( (resolve, reject) => {
2022
webpackCompiler.watch({}, (err, stats) => {
2123
if (err) {

addon/ng2/tasks/build-webpack.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
import {webpackCommonConfig, webpackOutputOptions} from '../models/webpack-build-config';
1+
import {webpackOutputOptions, webpackDevConfig, webpackProdConfig} from '../models/';
22

33
// Configure build and output;
44
const Task = require('ember-cli/lib/models/task');
55
const webpack = require('webpack');
6-
const webpackCompiler = webpack(webpackCommonConfig);
7-
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
8-
9-
webpackCompiler.apply(new ProgressPlugin({
10-
profile: true
11-
}));
12-
136

147
let lastHash = null;
158

@@ -18,6 +11,13 @@ module.exports = Task.extend({
1811
run: () => {
1912
let commandOptions = this.options;
2013

14+
const webpackCompiler = webpack(webpackProdConfig);
15+
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
16+
17+
webpackCompiler.apply(new ProgressPlugin({
18+
profile: true
19+
}));
20+
2121
return new Promise((resolve, reject) => {
2222
webpackCompiler.run((err, stats) => {
2323
// Don't keep cache

0 commit comments

Comments
 (0)