Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #7 from ngrx/build-process
Browse files Browse the repository at this point in the history
chore: Upgrade build process to use ngc and new folder structure
  • Loading branch information
brandonroberts authored Aug 26, 2016
2 parents 2af0ed4 + dd4fcb5 commit 8ddfd46
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 121 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ __build__/**

# Build Artifacts #
release
.ngc
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
machine:
node:
version: 6.4.0
16 changes: 5 additions & 11 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ module.exports = function(karma) {
frameworks: ['jasmine'],

files: [
{ pattern: 'tests.js', watched: false }
{ pattern: 'tests.ts', watched: false }
],

exclude: [],

preprocessors: {
'tests.js': ['coverage', 'webpack', 'sourcemap']
'tests.ts': ['coverage', 'webpack', 'sourcemap']
},

reporters: ['mocha', 'coverage'],
Expand Down Expand Up @@ -50,27 +50,21 @@ module.exports = function(karma) {
{
test: /\.ts?$/,
exclude: /(node_modules)/,
loader: 'ts-loader?target=es5&module=commonjs'
loader: 'awesome-typescript'
}
],
postLoaders: [
{
test: /\.(js|ts)$/, loader: 'istanbul-instrumenter-loader',
include: path.resolve(__dirname, 'lib'),
include: path.resolve(__dirname, 'src'),
exclude: [
/\.(e2e|spec)\.ts$/,
/tests.ts$/,
/node_modules/
]
}
]
},
ts: {
configFileName: './spec/tsconfig.json'
}
},

webpackServer: {
noInfo: true
}
});
};
30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
"lint": "npm-run-all lint:*",
"lint:lib": "tslint lib/**.ts",
"lint:spec": "tslint spec/**.ts",
"typings": "typings install",
"clean": "npm-run-all clean:*",
"clean:release": "rm -rf ./release",
"clean:typings": "rm -rf ./typings",
"prebuild": "npm-run-all clean typings karma",
"build": "npm-run-all build:cjs build:es6",
"build:cjs": "tsc --p tsconfig.es5.json --diagnostics --pretty",
"build:es6": "tsc -m es2015 --outDir ./release/es6 --target ES6 -d --diagnostics --pretty",
"prebuild": "npm-run-all clean karma",
"build": "npm-run-all build:cjs build:esm",
"build:cjs": "ngc --p tsconfig.json",
"build:esm": "ngc -p tsconfig.esm.json",
"prepare": "npm-run-all prepare:*",
"prepare:es6": "cp -R ./release/es6 ./release/npm",
"prepare:package": "cp ./{package.json,README.md,LICENSE} ./release/npm",
"test": "npm-run-all clean typings karma",
"prepare:ts": "cp -R ./src ./release",
"prepare:package": "cp ./{package.json,README.md,LICENSE} ./release",
"test": "npm-run-all clean karma",
"karma": "karma start --single-run",
"karma:watch": "karma start",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
Expand All @@ -46,12 +44,17 @@
"devDependencies": {
"@angular/common": "^2.0.0-rc.5",
"@angular/compiler": "^2.0.0-rc.5",
"@angular/compiler-cli": "^0.5.0",
"@angular/core": "^2.0.0-rc.5",
"@angular/platform-browser": "^2.0.0-rc.5",
"@angular/platform-browser-dynamic": "^2.0.0-rc.5",
"@angular/platform-server": "^2.0.0-rc.5",
"@angular/router": "^3.0.0-rc.1",
"@ngrx/core": "^1.0.0",
"@ngrx/store": "^2.0.0",
"@types/jasmine": "^2.2.33",
"@types/node": "^6.0.38",
"awesome-typescript-loader": "^2.2.1",
"conventional-changelog-cli": "^1.1.1",
"core-js": "^2.2.2",
"istanbul-instrumenter-loader": "^0.2.0",
Expand All @@ -66,13 +69,12 @@
"karma-webpack": "^1.7.0",
"npm-run-all": "^1.7.0",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.0.0-beta.6",
"rxjs": "5.0.0-beta.6",
"source-map-loader": "^0.1.5",
"ts-loader": "^0.8.1",
"tslint": "^3.6.0",
"typescript": "^1.8.9",
"typings": "^1.3.0",
"webpack": "^1.12.14",
"zone.js": "0.6.14"
"typescript": "^2.0.0",
"webpack": "^2.1.0-beta.21",
"zone.js": "0.6.12"
}
}
2 changes: 1 addition & 1 deletion spec/actions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as actions from '../lib/actions';
import * as actions from '../src/actions';

describe('Actions', function() {
it('should provide a "go" action creator', function() {
Expand Down
6 changes: 3 additions & 3 deletions spec/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Router, NavigationEnd } from '@angular/router';
import { Store } from '@ngrx/store';

import { RouterState } from '../lib/reducer';
import * as routerActions from '../lib/actions';
import { listenForRouterMethodActions, connectRouterActions } from '../lib/connect';
import { RouterState } from '../src/reducer';
import * as routerActions from '../src/actions';
import { listenForRouterMethodActions, connectRouterActions } from '../src/connect';

describe('Router/Store Connectors', function() {
describe('listenForRouterMethodActions', function() {
Expand Down
4 changes: 2 additions & 2 deletions spec/reducer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { routerActions } from '../lib/actions';
import { routerReducer, RouterState } from '../lib/reducer';
import { routerActions } from '../src/actions';
import { routerReducer, RouterState } from '../src/reducer';


describe('routerReducer', function() {
Expand Down
26 changes: 0 additions & 26 deletions spec/tsconfig.json

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion lib/connect.ts → src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function listenForRouterMethodActions(router: Router, location: Location,
break;

case routerActions.REPLACE:
router.navigate(commands, { queryParams, replaceUrl: true });
router.navigate(commands, <any>({ queryParams, replaceUrl: true }));
break;

case routerActions.SEARCH:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 0 additions & 23 deletions tests.js

This file was deleted.

34 changes: 34 additions & 0 deletions tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'core-js';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/sync-test';

// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var System: any;

// Prevent Karma from running prematurely.
__karma__.loaded = function () {};


Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
])
// First, initialize the Angular testing environment.
.then(([testing, testingBrowser]) => {
testing.getTestBed().initTestEnvironment(
testingBrowser.BrowserDynamicTestingModule,
testingBrowser.platformBrowserDynamicTesting()
);
})
// Then we find all the tests.
.then(() => (<any>require).context('./spec', true, /\.spec\.ts/))
// And load the modules.
.then(context => context.keys().map(context))
// Finally, start Karma to run the tests.
.then(__karma__.start, __karma__.error);
22 changes: 0 additions & 22 deletions tsconfig.es5.json

This file was deleted.

22 changes: 22 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "2.0.0",
"compileOnSave": false,
"compilerOptions": {
"outDir": "./release/esm",
"target": "es5",
"module": "es2015",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"moduleResolution": "node",
"declaration": true,
"lib": ["dom", "es5", "es2015"]
},
"include": [
"src/**/*.ts"
],
"angularCompilerOptions": {
"genDir": ".ngc"
}
}
24 changes: 13 additions & 11 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"version": "1.8.0",
"version": "2.0.0",
"compileOnSave": false,
"compilerOptions": {
"outDir": "./release/es6",
"target": "es6",
"sourceMap": true,
"outDir": "./release",
"target": "es5",
"module": "commonjs",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"moduleResolution": "node",
"declaration": true
"declaration": true,
"lib": ["dom", "es5", "es2015"]
},
"exclude": [
"node_modules",
"spec",
"typings",
"release"
]
"include": [
"src/**/*.ts"
],
"angularCompilerOptions": {
"genDir": ".ngc"
}
}
7 changes: 0 additions & 7 deletions typings.json

This file was deleted.

0 comments on commit 8ddfd46

Please sign in to comment.