From d6146c7aa0572be51288692634732ec54e65a72a Mon Sep 17 00:00:00 2001 From: Christian Crowhurst Date: Mon, 5 Dec 2016 20:49:08 +0000 Subject: [PATCH] refactor(ng-table): simplify module exports The problem with re-exports is now fixed in webpack making the [workaround](https://github.com/esvit/ng-table/commit/127c01f) no longer necessary --- index.ts | 26 +------------------------- npm-shrinkwrap.json | 4 ++-- package.json | 2 +- src/core/index.ts | 33 +++++---------------------------- 4 files changed, 9 insertions(+), 56 deletions(-) diff --git a/index.ts b/index.ts index 1292b524..66f0eb2c 100644 --- a/index.ts +++ b/index.ts @@ -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'; \ No newline at end of file diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4b9e5f95..1a9e3f0f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -7260,8 +7260,8 @@ }, "webpack": { "version": "2.1.0-beta.27", - "from": "webpack@2.1.0-beta.27", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.1.0-beta.27.tgz", + "from": "git+https://github.com/webpack/webpack.git#fbb8920f2ec8366659bb04de7c2c044a308a0925", + "resolved": "git+https://github.com/webpack/webpack.git#fbb8920f2ec8366659bb04de7c2c044a308a0925", "dev": true, "dependencies": { "async": { diff --git a/package.json b/package.json index fa2b1be3..84495d02 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/core/index.ts b/src/core/index.ts index baf6dd6b..e1270fab 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -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'; @@ -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'; - */ \ No newline at end of file