Skip to content

Commit

Permalink
Merge pull request #20 from CaliStyle/upgrade-package
Browse files Browse the repository at this point in the history
Upgrade package
  • Loading branch information
scott-wyatt authored Mar 25, 2018
2 parents 707bd4c + 83eb1a9 commit c473f40
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 26 deletions.
4 changes: 2 additions & 2 deletions ng-package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"name": "ng-engine",
"version": "3.0.1",
"version": "3.1.2",
"licensePath": "LICENSE",
"lib": {
"entryFile": "public_api.ts",
"languageLevel": [ "dom", "es2017" ],
"externals": {
"lodash": "./node_modules/lodash/index.js",
"lodash": "./node_modules/lodash",
"core-js": "./node_modules/core-js/index.js"
},
"embedded": []
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-engine",
"version": "3.0.1",
"version": "3.1.2",
"license": "MIT",
"repository": "https://github.com/CaliStyle/NgEngine.git",
"keywords": [
Expand Down Expand Up @@ -47,7 +47,8 @@
"main": "./dist/ng-engine.js",
"peerDependencies": {
"@angular/core": ">=5.0.0 <6.0.0",
"@angular/router": ">=5.0.0 <6.0.0"
"@angular/router": ">=5.0.0 <6.0.0",
"lodash": "^4.11.1"
},
"devDependencies": {
"@angular/animations": "^5.2.9",
Expand Down Expand Up @@ -108,7 +109,7 @@
"ts-loader": "^3.1.1",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.7.1",
"typescript": ">=2.4.2 <2.7.0",
"webpack-node-externals": "^1.6.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion public_api.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './src/app/ngEngine'
export * from './src/app/ngEngine/index'
4 changes: 3 additions & 1 deletion src/app/ngEngine/ng-engine.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** Node 6 do not have entries or values and need to be shimmed for NgEngine */
/**
* Node 6 does not have entries or values and need to be shimmed for NgEngine
*/
import 'core-js/fn/object/entries'
import 'core-js/fn/object/values'

Expand Down
6 changes: 3 additions & 3 deletions src/app/ngEngine/ng-engine.interface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export interface NgEngineConfiguration {
environment?: any,
appConfig?: any
environment?: {[key: string]: any},
appConfig?: {[key: string]: any}
}

export const NgEngineConfiguration: NgEngineConfiguration = {
export const DefaultNgEngineConfiguration: NgEngineConfiguration = {
environment: {
development: true,
staging: false,
Expand Down
6 changes: 5 additions & 1 deletion src/app/ngEngine/ng-engine.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import {
NgPack
} from './ng-pack'
import { DefaultNgEngineConfiguration } from './ng-engine.interface'

@NgModule({
imports: [
Expand All @@ -32,7 +33,10 @@ import {
exports: [],
providers: [
NgEngine,
NgEngineService
NgEngineService,
{
provide: ENGINE_CONFIG, useValue: DefaultNgEngineConfiguration
}
]
})
export class NgEngineModule { }
Expand Down
11 changes: 3 additions & 8 deletions src/app/ngEngine/ng-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { omit, merge } from 'lodash'
import { NgEngineConfig } from './ng-engine.config'

// Configuration Interface
import { NgEngineConfiguration } from './ng-engine.interface'
import { DefaultNgEngineConfiguration, NgEngineConfiguration } from './ng-engine.interface'

// For browsers/terminals that don't implement the debug method, log will be used instead.
const CONSOLE_DEBUG_METHOD = console['debug'] ? 'debug' : 'log'

// Injection Token
export const ENGINE_CONFIG = new InjectionToken<NgEngineConfiguration>('engineConfig')
export const ENGINE_CONFIG = new InjectionToken<NgEngineConfiguration>('ENGINE_CONFIG')

@Injectable()
export class NgEngine {
Expand All @@ -28,12 +28,7 @@ export class NgEngine {
protected _engine: NgEngineConfiguration
) {
// Injected Environment or default values
const environment = _engine.environment || {
development: true,
staging: false,
testing: false,
production: false
}
const environment = _engine.environment || DefaultNgEngineConfiguration

// Set environment string
this.environment = this.environmentString(environment)
Expand Down
4 changes: 3 additions & 1 deletion src/app/packs/404/404.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { RouterTestingModule } from '@angular/router/testing'
import { StoreModule } from '@ngrx/store'

// NgEngine Module
import { NgEngineModule, NgEngineService, ENGINE_CONFIG } from '../../ngEngine'
import { NgEngineModule, NgEngineService,
ENGINE_CONFIG
} from '../../ngEngine'
// Environment shim from CLI
import { environment } from '../../../environments/environment'
// App Config for NgEngine
Expand Down
4 changes: 3 additions & 1 deletion src/app/packs/500/500.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { RouterTestingModule } from '@angular/router/testing'
import { StoreModule } from '@ngrx/store'

// NgEngine Module
import { NgEngineModule, NgEngineService, ENGINE_CONFIG } from '../../ngEngine'
import { NgEngineModule, NgEngineService,
ENGINE_CONFIG
} from '../../ngEngine'
// Environment shim from CLI
import { environment } from '../../../environments/environment'
// App Config for NgEngine
Expand Down
4 changes: 3 additions & 1 deletion src/app/packs/home/home.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { RouterTestingModule } from '@angular/router/testing'
import { StoreModule, combineReducers, Store } from '@ngrx/store'

// NgEngine Module
import { NgEngineModule, NgEngineService, ENGINE_CONFIG } from '../../ngEngine'
import { NgEngineModule, NgEngineService,
ENGINE_CONFIG
} from '../../ngEngine'
// Environment shim from CLI
import { environment } from '../../../environments/environment'
// App Config for NgEngine
Expand Down
6 changes: 4 additions & 2 deletions src/app/root/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { Location } from '@angular/common'
// NGRX
import { StoreModule } from '@ngrx/store'
import { EffectsModule } from '@ngrx/effects'

import { NgEngineModule, NgEngineService, ENGINE_CONFIG } from '../ngEngine'
// Ng Engine
import { NgEngineModule, NgEngineService,
ENGINE_CONFIG
} from '../ngEngine'
// Environment shim from CLI
import { environment } from '../../environments/environment'
// App Config for NgEngine
Expand Down
4 changes: 3 additions & 1 deletion src/app/root/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import * as fromRootReducers from './store/reducers'
import * as fromRootEffects from './store/effects'

// NgEngine for NgPacks
import { NgEngineModule, ENGINE_CONFIG } from '../ngEngine'
import { NgEngineModule,
ENGINE_CONFIG
} from '../ngEngine'
// Routing Module
import { AppRoutingModule } from './app.routing.module'
// Root Component
Expand Down
4 changes: 3 additions & 1 deletion src/app/root/app.server.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { RouterModule } from '@angular/router'
import { ModuleMapLoaderModule } from '@nguniversal/module-map-ngfactory-loader'
import { APP_BASE_HREF } from '@angular/common'
// NgEngine for NgPacks
import { NgEngineModule, ENGINE_CONFIG } from '../ngEngine'
import { NgEngineModule,
ENGINE_CONFIG
} from '../ngEngine'
// Root Module
import { AppModule } from './app.module'
// Root Component
Expand Down

0 comments on commit c473f40

Please sign in to comment.