Skip to content

Commit

Permalink
refactor(ng-table): simplify module exports
Browse files Browse the repository at this point in the history
The problem with re-exports is now fixed in webpack making the
[workaround](127c01f)
no longer necessary
  • Loading branch information
ccrowhurstram committed Dec 6, 2016
1 parent b7a2aa6 commit d6146c7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 56 deletions.
26 changes: 1 addition & 25 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,5 @@ import { ngTableBrowserModule } from './src/browser';
const ngTableModule = ng1.module('ngTable', [ngTableCoreModule.name, ngTableBrowserModule.name]);

export { ngTableModule };


// todo: replace individual exports below with commented out export below once webpack produces a working bundle
// to track the progress of this, see https://github.com/webpack/webpack/issues/3415

// export * from './src/core';
export { IDefaults } from './src/core/ngTableDefaults';
export * from './src/core/ngTableEventsChannel';
export { InternalTableParams, NgTableParams, IParamValues } from './src/core/ngTableParams';
export { ISettings } from './src/core/ngTableSettings';
export { IDataSettings } from './src/core/data/dataSettings';
export { IGetDataFunc, IInterceptableGetDataFunc } from './src/core/data/getData';
export { IInterceptor } from './src/core/data/interceptor';
export { IDefaultGetData, NgTableDefaultGetDataProvider } from './src/core/data/ngTableDefaultGetData';
export { DataResult, DataResults, IDataRowGroup, GroupedDataResults } from './src/core/data/results';
export { FilterComparator, IFilterComparatorFunc } from './src/core/filtering/filterComparator';
export { IFilterValues, IFilterFunc } from './src/core/filtering/filterFunc';
export { FilterLayout, IFilterSettings } from './src/core/filtering/filterSettings';
export { IGetGroupFunc } from './src/core/grouping/getGroup';
export { Grouping, GroupSort, IGroupingFunc, IGroupValues } from './src/core/grouping/groupingFunc';
export { IGroupSettings } from './src/core/grouping/groupSettings';
export { IPageButton } from './src/core/paging';
export { SortDirection, ISortingValues} from './src/core/sorting';
export { ngTableCoreModule };

export * from './src/core';
export * from './src/browser';
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"typescript": "2.0.3",
"url-loader": "^0.5.7",
"validate-commit-msg": "^2.8.2",
"webpack": "^2.1.0-beta.27",
"webpack": "git+https://github.com/webpack/webpack.git#fbb8920f2ec8366659bb04de7c2c044a308a0925",
"webpack-dev-server": "^2.1.0-beta.9",
"webpack-merge": "^0.14.1",
"webpack-validator": "^2.2.9"
Expand Down
33 changes: 5 additions & 28 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import * as angular from 'angular';

import { IDefaultGetData, NgTableDefaultGetDataProvider } from './data/ngTableDefaultGetData';
import { IGroupSettings } from './grouping/groupSettings';
import { ngTableDefaultGetGroups } from './grouping/ngTableDefaultGetGroups';
// import { NgTableDefaultGetDataProvider, IDefaultGetData } from './data';
// import { IGroupSettings, ngTableDefaultGetGroups } from './grouping';
import { NgTableDefaultGetDataProvider, IDefaultGetData } from './data';
import { IGroupSettings, ngTableDefaultGetGroups } from './grouping';
import { ngTableDefaults, IDefaults } from './ngTableDefaults';
import { NgTableSettings, ISettings } from './ngTableSettings';
import { NgTableParams } from './ngTableParams';
Expand All @@ -22,33 +18,14 @@ const ngTableCoreModule = angular.module('ngTable-core', [])
// import { NgTableParams } from 'ng-table';
ngTableCoreModule.value('NgTableParams', NgTableParams)

export { ngTableCoreModule };

export { IDefaults } from './ngTableDefaults';
export * from './ngTableEventsChannel';
// note: having to export as individual modules rather than `*` to avoid webpack (bug?) causing
// the final bundle to throw an error `Cannot redefine property: NgTableParams`
export { InternalTableParams, NgTableParams, IParamValues } from './ngTableParams';
export { ISettings } from './ngTableSettings';
export { IDataSettings } from './data/dataSettings';
export { IGetDataFunc, IInterceptableGetDataFunc } from './data/getData';
export { IInterceptor } from './data/interceptor';
export { IDefaultGetData, NgTableDefaultGetDataProvider } from './data/ngTableDefaultGetData';
export { DataResult, DataResults, IDataRowGroup, GroupedDataResults } from './data/results';
export { FilterComparator, IFilterComparatorFunc } from './filtering/filterComparator';
export { IFilterValues, IFilterFunc } from './filtering/filterFunc';
export { FilterLayout, IFilterSettings } from './filtering/filterSettings';
export { IGetGroupFunc } from './grouping/getGroup';
export { Grouping, GroupSort, IGroupingFunc, IGroupValues } from './grouping/groupingFunc';
export { IGroupSettings } from './grouping/groupSettings';
export { IPageButton } from './paging';
export { SortDirection, ISortingValues} from './sorting';
export { ngTableCoreModule };

// todo: replace individual exports above with commented out exports below once webpack produces a working bundle
// to track the progress of this, see https://github.com/webpack/webpack/issues/3415
/*
export * from './ngTableParams';
export * from './data';
export * from './filtering';
export * from './grouping/publicExports';
export * from './paging';
export * from './sorting';
*/

0 comments on commit d6146c7

Please sign in to comment.