Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): change import for barrel file's, update seed doc #2990

Merged
merged 4 commits into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 25 additions & 17 deletions docs/getting-started/angular-seed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Documenting full steps to install and test with [angular-seed](https://github.com/mgechev/angular-seed)
# Documenting full steps to install and test with [angular-seed](https://github.com/mgechev/angular-seed)

```bash
npm install --save ngx-bootstrap bootstrap
```
Expand All @@ -9,7 +9,7 @@
```
//uncomment this
import { ExtendPackages } from './seed.config.interfaces';

// Add `NPM` third-party libraries to be injected/bundled.
this.NPM_DEPENDENCIES = [
...this.NPM_DEPENDENCIES,
Expand All @@ -20,33 +20,41 @@
{ src: 'bootstrap/dist/css/bootstrap-theme.min.css', inject: true }, // inject into css section
{ src: 'bootstrap/dist/css/bootstrap-theme.min.css.map', inject: true }, // inject into css section
];

// *towards the bottom, replace extended packages with this:

let additionalPackages: ExtendPackages[] = [
// required for dev build
// required for dev build
{
name:'ngx-bootstrap',
path:'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.min.js'
},

name: 'ngx-bootstrap',
path: 'node_modules/ngx-bootstrap',
packageMeta: {
main: 'bundles/ngx-bootstrap.umd.min.js',
defaultExtension: 'js'
}
},

// required for prod build
{
name:'ngx-bootstrap/*',
path:'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.min.js'
name: 'ngx-bootstrap/*',
path: 'node_modules/ngx-bootstrap/*',
packageMeta: {
main: 'bundles/ngx-bootstrap.umd.min.js',
defaultExtension: 'js'
}
}
];
];
this.addPackagesBundles(additionalPackages);
```


## Verify by adding an alert to the home module and html:

### In **home.module.ts:**

```
import { AlertModule } from 'ngx-bootstrap/alert';
import { AlertModule } from 'ngx-bootstrap';

@NgModule({
imports: [CommonModule, HomeRoutingModule, SharedModule, AlertModule.forRoot()],
declarations: [HomeComponent],
Expand All @@ -56,7 +64,7 @@
```

### In **home.component.html:**

```
<alert type="success">
<strong>Well done!</strong> You successfully read this important alert message.
Expand Down
4 changes: 2 additions & 2 deletions src/bs-moment/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// momentjs.com

import { formatFunctions, makeFormatFunction } from './format-functions';
import './locale';
import './units';
import './locale/index';
import './units/index';
import { Locale } from './locale/locale.class';
import { getLocale } from './locale/locales.service';
import { isDateValid } from './utils/type-checks';
Expand Down
2 changes: 1 addition & 1 deletion src/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
Component, EventEmitter, Input, NgZone, OnDestroy, Output
} from '@angular/core';

import { isBs3, LinkedList } from '../utils';
import { isBs3, LinkedList } from '../utils/index';
import { SlideComponent } from './slide.component';
import { CarouselConfig } from './carousel.config';

Expand Down
2 changes: 1 addition & 1 deletion src/component-loader/component-loader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Type,
ViewContainerRef
} from '@angular/core';
import { PositioningOptions, PositioningService } from '../positioning';
import { PositioningOptions, PositioningService } from '../positioning/index';
import { listenToTriggersV2, registerOutsideClick } from '../utils/triggers';
import { ContentRef } from './content-ref.class';
import { ListenOptions } from './listen-options.model';
Expand Down
2 changes: 1 addition & 1 deletion src/component-loader/component-loader.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
NgZone, Renderer2, ViewContainerRef
} from '@angular/core';
import { ComponentLoader } from './component-loader.class';
import { PositioningService } from '../positioning';
import { PositioningService } from '../positioning/index';

@Injectable()
export class ComponentLoaderFactory {
Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/bs-dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/filter';
import { ComponentLoader, ComponentLoaderFactory } from '../component-loader';
import { ComponentLoader, ComponentLoaderFactory } from '../component-loader/index';

import { BsDropdownConfig } from './bs-dropdown.config';
import { BsDropdownContainerComponent } from './bs-dropdown-container.component';
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/bs-dropdown.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ModuleWithProviders, NgModule } from '@angular/core';
import { ComponentLoaderFactory } from '../component-loader';
import { ComponentLoaderFactory } from '../component-loader/index';

import { PositioningService } from '../positioning';
import { PositioningService } from '../positioning/index';
import { BsDropdownContainerComponent } from './bs-dropdown-container.component';
import { BsDropdownMenuDirective } from './bs-dropdown-menu.directive';
import { BsDropdownToggleDirective } from './bs-dropdown-toggle.directive';
Expand Down
44 changes: 22 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ModalModule } from './modal/modal.module';
import { PaginationModule } from './pagination/pagination.module';
import { ProgressbarModule } from './progressbar/progressbar.module';
import { RatingModule } from './rating/rating.module';
import { SortableModule } from './sortable';
import { SortableModule } from './sortable/index';
import { TabsModule } from './tabs/tabs.module';
import { TimepickerModule } from './timepicker/timepicker.module';
import { TooltipModule } from './tooltip/tooltip.module';
Expand All @@ -24,24 +24,24 @@ export {
AccordionConfig,
AccordionModule,
AccordionPanelComponent
} from './accordion';
} from './accordion/index';

export { AlertComponent, AlertConfig, AlertModule } from './alert';
export { AlertComponent, AlertConfig, AlertModule } from './alert/index';

export {
ButtonCheckboxDirective,
ButtonRadioDirective,
ButtonsModule
} from './buttons';
} from './buttons/index';

export {
CarouselComponent,
CarouselConfig,
CarouselModule,
SlideComponent
} from './carousel';
} from './carousel/index';

export { CollapseDirective, CollapseModule } from './collapse';
export { CollapseDirective, CollapseModule } from './collapse/index';

export {
DateFormatter,
Expand All @@ -54,7 +54,7 @@ export {
BsDatepickerModule,
BsDatepickerConfig,
BsLocaleService
} from './datepicker';
} from './datepicker/index';

export {
ModalDirective,
Expand All @@ -64,7 +64,7 @@ export {
ModalModule,
BsModalRef,
BsModalService
} from './modal';
} from './modal/index';

export {
BsDropdownModule,
Expand All @@ -74,32 +74,32 @@ export {
BsDropdownDirective,
BsDropdownMenuDirective,
BsDropdownToggleDirective
} from './dropdown';
} from './dropdown/index';

export {
PagerComponent,
PaginationComponent,
PaginationConfig,
PaginationModule
} from './pagination';
} from './pagination/index';

export {
BarComponent,
ProgressbarComponent,
ProgressbarConfig,
ProgressbarModule,
ProgressDirective
} from './progressbar';
} from './progressbar/index';

export { RatingComponent, RatingModule } from './rating';
export { RatingComponent, RatingModule } from './rating/index';

export {
DraggableItem,
DraggableItemService,
SortableItem,
SortableComponent,
SortableModule
} from './sortable';
} from './sortable/index';

export {
NgTranscludeDirective,
Expand All @@ -108,52 +108,52 @@ export {
TabsetComponent,
TabsetConfig,
TabsModule
} from './tabs';
} from './tabs/index';

export {
TimepickerComponent,
TimepickerConfig,
TimepickerModule
} from './timepicker';
} from './timepicker/index';

export {
TooltipConfig,
TooltipContainerComponent,
TooltipDirective,
TooltipModule
} from './tooltip';
} from './tooltip/index';

export {
TypeaheadOptions,
TypeaheadContainerComponent,
TypeaheadDirective,
TypeaheadMatch,
TypeaheadModule
} from './typeahead';
} from './typeahead/index';

export {
PopoverConfig,
PopoverContainerComponent,
PopoverDirective,
PopoverModule
} from './popover';
} from './popover/index';

export { OnChange, LinkedList, isBs3, Trigger, Utils } from './utils';
export { OnChange, LinkedList, isBs3, Trigger, Utils } from './utils/index';

export {
ComponentLoader,
ComponentLoaderFactory,
ContentRef
} from './component-loader';
} from './component-loader/index';

export {
Positioning,
PositioningOptions,
PositioningService,
positionElements
} from './positioning';
} from './positioning/index';

export { defineLocale, getSetGlobalLocale, LocaleData } from './bs-moment';
export { defineLocale, getSetGlobalLocale, LocaleData } from './bs-moment/index';

export {
ar,
Expand Down
4 changes: 2 additions & 2 deletions src/modal/modal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { NgModule, ModuleWithProviders } from '@angular/core';

import { ModalBackdropComponent } from './modal-backdrop.component';
import { ModalDirective } from './modal.directive';
import { PositioningService } from '../positioning';
import { ComponentLoaderFactory } from '../component-loader';
import { PositioningService } from '../positioning/index';
import { ComponentLoaderFactory } from '../component-loader/index';
import { ModalContainerComponent } from './modal-container.component';
import { BsModalService } from './bs-modal.service';

Expand Down
2 changes: 1 addition & 1 deletion src/popover/popover.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Renderer2, TemplateRef, ViewContainerRef
} from '@angular/core';
import { PopoverConfig } from './popover.config';
import { ComponentLoader, ComponentLoaderFactory } from '../component-loader';
import { ComponentLoader, ComponentLoaderFactory } from '../component-loader/index';
import { PopoverContainerComponent } from './popover-container.component';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/popover/popover.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ComponentLoaderFactory } from '../component-loader';
import { PositioningService } from '../positioning';
import { ComponentLoaderFactory } from '../component-loader/index';
import { PositioningService } from '../positioning/index';
import { PopoverConfig } from './popover.config';
import { PopoverDirective } from './popover.directive';
import { PopoverContainerComponent } from './popover-container.component';
Expand Down
2 changes: 1 addition & 1 deletion src/progressbar/progressbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core';
import { ProgressbarConfig } from './progressbar.config';
import { isBs3 } from '../utils';
import { isBs3 } from '../utils/index';

@Component({
selector: 'progressbar',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/draggable-item.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { fakeAsync, inject, TestBed } from '@angular/core/testing';
import { DraggableItem, DraggableItemService, SortableItem } from '../sortable';
import { DraggableItem, DraggableItemService, SortableItem } from '../sortable/index';

@Component({
template: `<h1>Test</h1>`
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/alert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { TestBed, inject } from '@angular/core/testing';
import { createGenericTestComponent } from './test/common';
import { ChangeDetectorRef, Component } from '@angular/core';
import { AlertModule, AlertComponent, AlertConfig } from '../../alert';
import { AlertModule, AlertComponent, AlertConfig } from '../../alert/index';

@Component({
selector: 'test-cmp',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/carousel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { discardPeriodicTasks, fakeAsync, inject, TestBed, tick } from '@angular

import { By } from '@angular/platform-browser';

import { CarouselComponent, CarouselConfig, CarouselModule } from '../../carousel';
import { CarouselComponent, CarouselConfig, CarouselModule } from '../../carousel/index';
import { createGenericTestComponent } from './test/common';

@Component({selector: 'test-cmp', template: ''})
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/collapse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createGenericTestComponent } from './test/common';

import { Component } from '@angular/core';

import { CollapseModule } from '../../collapse';
import { CollapseModule } from '../../collapse/index';

@Component({ selector: 'test-cmp', template: '' })
class TestComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PopoverContainerComponent,
PopoverDirective,
PopoverConfig
} from '../../popover';
} from '../../popover/index';
import { createGenericTestComponent } from './test/common';

@Component({selector: 'test-cmpt', template: ``})
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/tooltip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { fakeAsync, inject, TestBed, tick } from '@angular/core/testing';

import { By } from '@angular/platform-browser';

import { TooltipConfig, TooltipContainerComponent, TooltipDirective, TooltipModule } from '../../tooltip';
import { TooltipConfig, TooltipContainerComponent, TooltipDirective, TooltipModule } from '../../tooltip/index';
import { createGenericTestComponent } from './test/common';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/spec/sortable.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, ComponentFixtureAutoDetect, fakeAsync, inject, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { DraggableItem, DraggableItemService, SortableComponent, SortableItem, SortableModule } from '../sortable';
import { DraggableItem, DraggableItemService, SortableComponent, SortableItem, SortableModule } from '../sortable/index';

const HEROES: string[] = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado'];
const HEROES_OBJ: any[] = [
Expand Down
Loading