diff --git a/projects/nls-guilloche/ng-package.json b/projects/nls-guilloche/ng-package.json index a02ea77..d452f0b 100644 --- a/projects/nls-guilloche/ng-package.json +++ b/projects/nls-guilloche/ng-package.json @@ -1,6 +1,6 @@ { "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/nls-guilloche", + "dest": "../../dist/nls-guilloche-dev", "deleteDestPath": false, "lib": { "entryFile": "src/public_api.ts" diff --git a/projects/nls-guilloche/ng-package.prod.json b/projects/nls-guilloche/ng-package.prod.json index 2c144ad..c54317b 100644 --- a/projects/nls-guilloche/ng-package.prod.json +++ b/projects/nls-guilloche/ng-package.prod.json @@ -1,6 +1,6 @@ { "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/nls", + "dest": "../../dist/nls-guilloche", "lib": { "entryFile": "src/public_api.ts" } diff --git a/projects/nls-guilloche/package.json b/projects/nls-guilloche/package.json index 7212164..213548b 100644 --- a/projects/nls-guilloche/package.json +++ b/projects/nls-guilloche/package.json @@ -26,11 +26,9 @@ "url": "https://dailysh.it" } ], - "dependencies": { - "d3": "^5.3.0" - }, "peerDependencies": { "@angular/common": "^6.0.0-rc.0 || ^6.0.0", - "@angular/core": "^6.0.0-rc.0 || ^6.0.0" + "@angular/core": "^6.0.0-rc.0 || ^6.0.0", + "d3": "^5.3.0" } } diff --git a/projects/nls-guilloche/src/nls/nls-guilloche.module.ts b/projects/nls-guilloche/src/nls/nls-guilloche.module.ts new file mode 100644 index 0000000..e81c62e --- /dev/null +++ b/projects/nls-guilloche/src/nls/nls-guilloche.module.ts @@ -0,0 +1,30 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; + +import { NlsGraphsComponent } from './components/graphs.component'; +import { NlsGuillocheDirective } from './directives/guilloche.directive'; +import { NlsHistoryService } from './services/history.service'; +import { NlsCanvasService } from './services/canvas.service'; +import { NlsMathService } from './services/math.service'; +import { NlsGraphService } from './services/graph.service'; + +@NgModule({ + imports: [ + BrowserModule + ], + declarations: [ + NlsGraphsComponent, + NlsGuillocheDirective + ], + providers: [ + NlsHistoryService, + NlsCanvasService, + NlsMathService, + NlsGraphService, + ], + exports: [ + NlsGraphsComponent, + NlsGuillocheDirective + ] +}) +export class NlsGuillocheModule {} diff --git a/projects/nls-guilloche/src/public_api.ts b/projects/nls-guilloche/src/public_api.ts index e226448..dab7674 100644 --- a/projects/nls-guilloche/src/public_api.ts +++ b/projects/nls-guilloche/src/public_api.ts @@ -13,3 +13,4 @@ export * from './nls/services/canvas.service'; export * from './nls/services/graph.service'; export * from './nls/services/history.service'; export * from './nls/services/math.service'; +export * from './nls/nls-guilloche.module'; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c5cc5d4..106015f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -23,7 +23,7 @@ import 'moment/min/locales'; import { environment as env } from '../environments/environment'; import { NlsHistoryService } from 'projects/nls-guilloche/src/public_api'; -import { NlsGraphsComponent } from 'projects/nls-guilloche/src/public_api'; + @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5a4b5d3..c732d95 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,30 +20,20 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MomentModule } from 'ngx-moment'; import { AppComponent } from './app.component'; -import { NlsGraphsComponent } from 'projects/nls-guilloche/src/public_api'; -import { NlsHistoryService } from 'projects/nls-guilloche/src/public_api'; -import { NlsCanvasService } from 'projects/nls-guilloche/src/public_api'; -import { NlsMathService } from 'projects/nls-guilloche/src/public_api'; -import { NlsGraphService } from 'projects/nls-guilloche/src/public_api'; -import { NlsGuillocheDirective } from 'projects/nls-guilloche/src/public_api'; +import { NlsGuillocheModule } from 'projects/nls-guilloche/src/public_api'; @NgModule({ declarations: [ AppComponent, - NlsGraphsComponent, - NlsGuillocheDirective, ], imports: [ BrowserModule, ReactiveFormsModule, FormsModule, MomentModule, + NlsGuillocheModule ], providers: [ - NlsHistoryService, - NlsCanvasService, - NlsMathService, - NlsGraphService, ], bootstrap: [AppComponent] }) diff --git a/tsconfig.json b/tsconfig.json index 1ac28b9..5a10980 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "dom" ], "paths": { - "NlsGuilloche": [ + "nls-guilloche": [ "dist/nls-guilloche" ] }