Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Commit

Permalink
chore(build): Update to latest ngrx build process
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev committed Sep 27, 2016
1 parent 4c912d2 commit d75b9d2
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 97 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ __build__/**
# Build Artifacts #
release
.ngc
*.ngfactory.ts
4 changes: 4 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { Effect, mergeEffects } from './src/effects';
export { Actions } from './src/actions';
export { EffectsModule } from './src/effects.module';
export { EffectsSubscription } from './src/effects-subscription';
28 changes: 20 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ module.exports = function(karma) {
frameworks: ['jasmine'],

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

exclude: [],

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

reporters: ['mocha', 'coverage'],

coverageReporter: {
dir: 'coverage/',
subdir: '.',
reporters: [
{ type: 'text-summary' },
{ type: 'json' },
Expand All @@ -38,32 +37,45 @@ module.exports = function(karma) {
logLevel: karma.LOG_INFO,
autoWatch: true,
singleRun: false,

webpackServer: { noInfo: true },
webpack: {
devtool: 'inline-source-map',
resolve: {
root: __dirname,
extensions: ['', '.ts', '.js']
},
module: {
preLoaders: [
{
test: /\.ts$/,
loader: 'tslint-loader',
exclude: [
/node_modules/
]
}
],
loaders: [
{
test: /\.ts?$/,
exclude: /(node_modules)/,
loader: 'awesome-typescript'
loader: 'ts'
}
],
postLoaders: [
{
test: /\.ts?$/, loader: 'istanbul-instrumenter',
test: /\.(js|ts)$/, loader: 'istanbul-instrumenter',
include: path.resolve(__dirname, 'src'),
exclude: [
/\.(e2e|spec)\.ts$/,
/tests/,
/\.(e2e|spec|bundle)\.ts$/,
/node_modules/
]
}
]
},
tslint: {
emitErrors: false,
failOnHint: false,
resourcePath: 'src'
}
}
});
Expand Down
77 changes: 42 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,60 @@
"name": "@ngrx/effects",
"version": "2.0.0-beta.3",
"description": "Side effect model for @ngrx/store",
"main": "index.js",
"jsnext:main": "esm/index.js",
"main": "bundles/effects.umd.js",
"module": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ngrx/effects.git"
},
"scripts": {
"lint": "npm-run-all lint:*",
"lint:lib": "tslint lib/**.ts",
"lint:spec": "tslint spec/**.ts",
"clean": "rimraf ./release",
"prebuild": "npm-run-all clean karma",
"build": "npm-run-all build:*",
"build:cjs": "ngc -p tsconfig.cjs.json",
"build:esm": "ngc -p tsconfig.es2015.json",
"build:ts": "cpy src/*.ts release/src",
"prepare": "cpy ./{package.json,README.md,CHANGELOG.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",
"preversion": "npm run test",
"version": "npm run changelog && git add CHANGELOG.md",
"postversion": "npm run prepare"
"test": "npm run karma",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"clean:pre": "rimraf release",
"clean:post": "rimraf src/**/*.ngfactory.ts",
"copy": "cpy LICENSE package.json README.md release",
"build:js": "ngc -p tsconfig.dist.json",
"build:testing": "ngc -p tsconfig.testing.json",
"build:umd": "rollup -c rollup.config.js",
"build:umd:testing": "rollup -c rollup-testing.config.js",
"build:uglify": "uglifyjs -c --screw-ie8 --comments -o ./release/bundles/effects.min.umd.js ./release/bundles/effects.umd.js",
"build:uglify:testing": "uglifyjs -c --screw-ie8 --comments -o ./release/bundles/effects-testing.min.umd.js ./release/bundles/effects-testing.umd.js",
"bundle:main": "npm run build:js && npm run build:umd && npm run build:uglify",
"bundle:testing": "npm run build:testing && npm run build:umd:testing && npm run build:uglify:testing",
"prebuild": "npm run test && npm run clean:pre",
"postbuild": "npm run clean:post && npm run copy",
"build": "npm run bundle:main && npm run bundle:testing",
"version": "npm run changelog && git add CHANGELOG.md"
},
"authors": [
"Mike Ryan"
],
"license": "MIT",
"peerDependencies": {
"rxjs": "^5.0.0-beta.11",
"@angular/core": "^2.0.0-rc.5",
"@ngrx/store": "^2.0.0"
"rxjs": "^5.0.0-beta.12",
"@angular/core": "^2.0.0",
"@ngrx/store": "^1.5.0 || ^2.0.0"
},
"devDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/compiler-cli": "^0.6.0",
"@angular/core": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"@angular/platform-server": "^2.0.0-rc.5",
"@ngrx/core": "^1.1.0",
"@types/jasmine": "^2.2.31",
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/compiler-cli": "^0.6.1",
"@angular/core": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",
"@angular/router": "^3.0.0",
"@ngrx/core": "^1.2.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",
"cpy-cli": "^1.0.1",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "^2.4.1",
"jasmine-core": "^2.5.0",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-coverage": "^0.5.5",
Expand All @@ -62,12 +66,15 @@
"karma-webpack": "^1.7.0",
"npm-run-all": "^1.7.0",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.0.0-beta.11",
"rollup": "^0.34.13",
"rxjs": "^5.0.0-beta.12",
"source-map-loader": "^0.1.5",
"ts-loader": "^0.8.1",
"tslint": "^3.6.0",
"ts-loader": "^0.8.2",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "^2.0.2",
"uglifyjs": "^2.4.10",
"webpack": "^2.1.0-beta.21",
"zone.js": "^0.6.8"
"zone.js": "^0.6.17"
}
}
12 changes: 12 additions & 0 deletions rollup-testing.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
entry: './release/testing/index.js',
dest: './release/bundles/effects-testing.umd.js',
format: 'umd',
moduleName: 'ngrx.effects.testing',
globals: {
'@angular/core': 'ng.core',
'@ngrx/store': 'ngrx.store',
'@ngrx/effects': 'ngrx.effects',
'rxjs/ReplaySubject': 'Rx'
}
}
15 changes: 15 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
entry: './release/index.js',
dest: './release/bundles/effects.umd.js',
format: 'umd',
moduleName: 'ngrx.effects',
globals: {
'@angular/core': 'ng.core',
'@ngrx/store': 'ngrx.store',
'rxjs/Observable': 'Rx',
'rxjs/Subscription': 'Rx',
'rxjs/operator/filter': 'Rx.Observable.prototype',
'rxjs/operator/ignoreElements': 'Rx.Observable.prototype',
'rxjs/observable/merge': 'Rx.Observable'
}
}
1 change: 0 additions & 1 deletion src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { Injectable, Inject } from '@angular/core';
import { Action, Dispatcher } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Operator } from 'rxjs/Operator';
import { filter } from 'rxjs/operator/filter';


Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions src/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion testing/testing.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NgModule } from '@angular/core';
import { Actions } from '../src/actions';
import { Actions } from '@ngrx/effects';
import { EffectsTestRunner } from './runner';


Expand Down
9 changes: 6 additions & 3 deletions tests.ts → tests.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import 'core-js';
import 'core-js/es7/reflect';

import 'zone.js/dist/zone';
import 'zone.js/dist/proxy';
import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/proxy';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';



// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
Expand Down
22 changes: 0 additions & 22 deletions tsconfig.cjs.json

This file was deleted.

26 changes: 26 additions & 0 deletions tsconfig.dist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"noEmitOnError": false,
"outDir": "./release",
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"target": "es5",
"skipLibCheck": true
},
"files": [
"index.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}
22 changes: 0 additions & 22 deletions tsconfig.es2015.json

This file was deleted.

7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
"types": [
"jasmine",
"node"
]
],
"baseUrl": ".",
"rootDir": ".",
"paths": {
"@ngrx/effects": ["./"]
}
},
"exclude": [
"node_modules",
Expand Down
28 changes: 28 additions & 0 deletions tsconfig.testing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"noEmitOnError": false,
"outDir": "./release",
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es2015", "dom"],
"target": "es5",
"skipLibCheck": true,
"paths": {
"@ngrx/effects": ["./release"]
}
},
"files": [
"testing/index.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}

0 comments on commit d75b9d2

Please sign in to comment.