Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit fbad33f

Browse files
committed
refactor(config): remove deprecated configuration options
1 parent fbf58de commit fbad33f

File tree

5 files changed

+3
-116
lines changed

5 files changed

+3
-116
lines changed

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,10 @@ npm run build --rollup ./config/rollup.config.js
9393

9494
| Config File | package.json Config | Cmd-line Flag |
9595
|-------------|---------------------|-----------------------|
96-
| Babili | `ionic_use_experimental_babili` | `--babili` |
9796
| CleanCss | `ionic_cleancss` | `--cleancss` or `-e` |
9897
| Copy | `ionic_copy` | `--copy` or `-y` |
99-
| Closure | `ionic_closure` | `--closure` or `-l` |
10098
| Generator | `ionic_generator` | `--generator` or `-g` |
10199
| NGC | `ionic_ngc` | `--ngc` or `-n` |
102-
| Rollup | `ionic_rollup` | `--rollup` or `-r` |
103100
| Sass | `ionic_sass` | `--sass` or `-s` |
104101
| TSLint | `ionic_tslint` | `--tslint` or `-i` |
105102
| UglifyJS | `ionic_uglifyjs` | `--uglifyjs` or `-u` |
@@ -131,14 +128,8 @@ npm run build --rollup ./config/rollup.config.js
131128
| bail on lint error | `ionic_bail_on_lint_error` | `--bailOnLintError` | `null` | Set to `true` to make stand-alone lint commands fail with non-zero status code |
132129
| enable type checking during lint | `ionic_type_check_on_lint` | `--typeCheckOnLint` | `null` | Set to `true` to enable [type checking](https://palantir.github.io/tslint/usage/type-checking) during lint |
133130
| write AoT files to disk | `ionic_aot_write_to_disk` | `--aotWriteToDisk` | `null` | Set to `true` to write files to disk for debugging |
134-
| print dependency tree | `ionic_print_original_dependency_tree` | `--printOriginalDependencyTree` | `null` | Set to `true` to print out the original dependency tree calculated during the optimize step |
135-
| print modified dependency tree | `ionic_print_modified_dependency_tree` | `--printModifiedDependencyTree` | `null` | Set to `true` to print out the modified dependency tree after purging unused modules |
136131
| print webpack dependency tree | `ionic_print_webpack_dependency_tree` | `--printWebpackDependencyTree` | `null` | Set to `true` to print out a dependency tree after running Webpack |
137132
| parse deeplink config | `ionic_parse_deeplinks` | `--parseDeepLinks` | `true` | Parses and extracts data from the `@IonicPage` decorator |
138-
| manual tree shaking | `ionic_manual_treeshaking` | `--manualTreeshaking` | `true` | Set to `true` to purge unused Ionic components/code |
139-
| purge decorators | `ionic_purge_decorators` | `--purgeDecorators` | `true` | Set to `true` to purge unneeded decorators to improve tree shakeability of code |
140-
| experimental closure compiler | `ionic_use_experimental_closure` | `--useExperimentalClosure` | `null` | Set to `true` to use closure compiler to minify the final bundle |
141-
| experimental babili | `ionic_use_experimental_babili` | `--useExperimentalBabili` | `null` | Set to `true` to use babili to minify es2015 code |
142133
| convert bundle to ES5 | `ionic_build_to_es5` | `--buildToEs5` | `true` | Convert bundle to ES5 for for production deployments |
143134
| default watch timeout | `ionic_start_watch_timeout` | `--startWatchTimeout` | `3000` | Milliseconds controlling the default watch timeout |
144135
| choose the polyfill | `ionic_polyfill_name` | `--polyfillName` | `polyfills` | Change with polyfills.modern or polyfills.ng (all options)[https://github.com/driftyco/ionic/tree/master/scripts/polyfill] |
@@ -179,14 +170,8 @@ These environment variables are automatically set to [Node's `process.env`](http
179170
| `IONIC_BAIL_ON_LINT_ERROR` | Boolean determining whether to exit with a non-zero status code on error |
180171
| `IONIC_TYPE_CHECK_ON_LINT` | Boolean determining whether to type check code during lint or not |
181172
| `IONIC_AOT_WRITE_TO_DISK` | `--aotWriteToDisk` | `null` | Set to `true` to write files to disk for debugging |
182-
| `IONIC_PRINT_ORIGINAL_DEPENDENCY_TREE` | boolean to print out the original dependency tree calculated during the optimize step |
183-
| `IONIC_PRINT_MODIFIED_DEPENDENCY_TREE` | boolean to print out the modified dependency tree after purging unused modules |
184173
| `IONIC_PRINT_WEBPACK_DEPENDENCY_TREE` | boolean to print out a dependency tree after running Webpack |
185174
| `IONIC_PARSE_DEEPLINKS` | boolean to enable parsing the Ionic 3.x deep links API for lazy loading |
186-
| `IONIC_MANUAL_TREESHAKING` | boolean to enable purging unused Ionic components/code |
187-
| `IONIC_PURGE_DECORATORS` | boolean to enable purging unneeded decorators from source code |
188-
| `IONIC_USE_EXPERIMENTAL_CLOSURE` | boolean to enable use of closure compiler to minify the final bundle |
189-
| `IONIC_USE_EXPERIMENTAL_BABILI` | boolean to enable use of babili to minify es2015 code |
190175
| `IONIC_BUILD_TO_ES5` | boolean to enable converting bundle to ES5 for for production deployments |
191176
| `IONIC_START_WATCH_TIMEOUT` | Milliseconds controlling the default watch timeout |
192177

@@ -240,7 +225,7 @@ npm run lint --bailOnLintError true
240225
- [Ionic Framework](https://ionicframework.com/)
241226
- [TypeScript Compiler](https://www.typescriptlang.org/)
242227
- [Angular Compiler (NGC)](https://github.com/angular/angular/tree/master/modules/%40angular/compiler-cli)
243-
- [Rollup Module Bundler](https://rollupjs.org/)
228+
- [Webpack Module Bundler](https://webpack.js.org/)
244229
- Ionic Component Sass
245230
- [Node Sass](https://www.npmjs.com/package/node-sass)
246231
- [Autoprefixer](https://github.com/postcss/autoprefixer)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/app-scripts",
3-
"version": "2.1.4",
3+
"version": "2.1.4-201709061759",
44
"description": "Scripts for Ionic Projects",
55
"homepage": "https://ionicframework.com/",
66
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",

src/util/config.spec.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,12 @@ describe('config', () => {
9999
expect(fakeConfig[Constants.ENV_APP_NG_MODULE_CLASS]).toEqual('AppModule');
100100
expect(fakeConfig[Constants.ENV_GLOB_UTIL]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'util', 'glob-util.js'));
101101
expect(fakeConfig[Constants.ENV_CLEAN_BEFORE_COPY]).toBeFalsy();
102-
expect(fakeConfig[Constants.ENV_CLOSURE_JAR]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'bin', 'closure-compiler.jar'));
103102
expect(fakeConfig[Constants.ENV_OUTPUT_JS_FILE_NAME]).toEqual('main.js');
104103
expect(fakeConfig[Constants.ENV_OUTPUT_CSS_FILE_NAME]).toEqual('main.css');
105104
expect(fakeConfig[Constants.ENV_WEBPACK_FACTORY]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'ionic-webpack-factory.js'));
106105
expect(fakeConfig[Constants.ENV_WEBPACK_LOADER]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'loader.js'));
107106
expect(fakeConfig[Constants.ENV_OPTIMIZATION_LOADER]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'optimization-loader.js'));
108107
expect(fakeConfig[Constants.ENV_AOT_WRITE_TO_DISK]).toBeFalsy();
109-
expect(fakeConfig[Constants.ENV_PRINT_ORIGINAL_DEPENDENCY_TREE]).toBeFalsy();
110-
expect(fakeConfig[Constants.ENV_PRINT_MODIFIED_DEPENDENCY_TREE]).toBeFalsy();
111108
expect(fakeConfig[Constants.ENV_PRINT_WEBPACK_DEPENDENCY_TREE]).toBeFalsy();
112109
expect(fakeConfig[Constants.ENV_TYPE_CHECK_ON_LINT]).toBeFalsy();
113110
expect(fakeConfig[Constants.ENV_BAIL_ON_LINT_ERROR]).toBeFalsy();
@@ -162,11 +159,6 @@ describe('config', () => {
162159
expect(fakeConfig[Constants.ENV_TOAST_COMPONENT_FACTORY_PATH]).toEqual(join(context.ionicAngularDir, 'components', 'toast', 'toast-component.ngfactory.js'));
163160

164161
expect(fakeConfig[Constants.ENV_PARSE_DEEPLINKS]).toBeTruthy();
165-
expect(fakeConfig[Constants.ENV_PURGE_DECORATORS]).toBeTruthy();
166-
expect(fakeConfig[Constants.ENV_MANUAL_TREESHAKING]).toBeTruthy();
167-
168-
expect(fakeConfig[Constants.ENV_USE_EXPERIMENTAL_CLOSURE]).toBeFalsy();
169-
expect(fakeConfig[Constants.ENV_USE_EXPERIMENTAL_BABILI]).toBeFalsy();
170162
expect(fakeConfig[Constants.ENV_BUILD_TO_ES5]).toEqual('true');
171163
expect(context.bundler).toEqual('webpack');
172164
});
@@ -303,42 +295,6 @@ describe('config', () => {
303295

304296
describe('config.bundlerStrategy', () => {
305297

306-
it('should get rollup by full arg', () => {
307-
config.addArgv('--rollup');
308-
config.addArgv('my.rollup.confg.js');
309-
const bundler = config.bundlerStrategy(context);
310-
expect(bundler).toEqual('rollup');
311-
});
312-
313-
it('should get rollup by short arg', () => {
314-
config.addArgv('-r');
315-
config.addArgv('my.rollup.confg.js');
316-
const bundler = config.bundlerStrategy(context);
317-
expect(bundler).toEqual('rollup');
318-
});
319-
320-
it('should get rollup by bundler arg', () => {
321-
config.addArgv('--bundler');
322-
config.addArgv('rollup');
323-
const bundler = config.bundlerStrategy(context);
324-
expect(bundler).toEqual('rollup');
325-
});
326-
327-
it('should get rollup by env var', () => {
328-
config.setProcessEnv({
329-
ionic_bundler: 'rollup'
330-
});
331-
config.setAppPackageJsonData({ config: { ionic_bundler: 'rollup' } });
332-
const bundler = config.bundlerStrategy(context);
333-
expect(bundler).toEqual('rollup');
334-
});
335-
336-
it('should get rollup by package.json config', () => {
337-
config.setAppPackageJsonData({ config: { ionic_bundler: 'rollup' } });
338-
const bundler = config.bundlerStrategy(context);
339-
expect(bundler).toEqual('rollup');
340-
});
341-
342298
it('should get webpack with invalid env var', () => {
343299
config.setProcessEnv({
344300
ionic_bundler: 'bobsBundler'
@@ -347,21 +303,6 @@ describe('config', () => {
347303
expect(bundler).toEqual('webpack');
348304
});
349305

350-
it('should get rollup by env var', () => {
351-
config.setProcessEnv({
352-
ionic_bundler: 'rollup'
353-
});
354-
config.setAppPackageJsonData({ config: { ionic_bundler: 'rollup' } });
355-
const bundler = config.bundlerStrategy(context);
356-
expect(bundler).toEqual('rollup');
357-
});
358-
359-
it('should get rollup by package.json config', () => {
360-
config.setAppPackageJsonData({ config: { ionic_bundler: 'rollup' } });
361-
const bundler = config.bundlerStrategy(context);
362-
expect(bundler).toEqual('rollup');
363-
});
364-
365306
it('should get webpack by default', () => {
366307
const bundler = config.bundlerStrategy(context);
367308
expect(bundler).toEqual('webpack');

src/util/config.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,6 @@ export function generateContext(context?: BuildContext): BuildContext {
213213
setProcessEnvVar(Constants.ENV_CLEAN_BEFORE_COPY, cleanBeforeCopy);
214214
Logger.debug(`cleanBeforeCopy set to ${cleanBeforeCopy}`);
215215

216-
const closureCompilerJarPath = join(getProcessEnvVar(Constants.ENV_VAR_APP_SCRIPTS_DIR), 'bin', 'closure-compiler.jar');
217-
setProcessEnvVar(Constants.ENV_CLOSURE_JAR, closureCompilerJarPath);
218-
Logger.debug(`closureCompilerJarPath set to ${closureCompilerJarPath}`);
219-
220216
context.outputJsFileName = getConfigValue(context, '--outputJsFileName', null, Constants.ENV_OUTPUT_JS_FILE_NAME, Constants.ENV_OUTPUT_JS_FILE_NAME.toLowerCase(), 'main.js');
221217
setProcessEnvVar(Constants.ENV_OUTPUT_JS_FILE_NAME, context.outputJsFileName);
222218
Logger.debug(`outputJsFileName set to ${context.outputJsFileName}`);
@@ -249,18 +245,9 @@ export function generateContext(context?: BuildContext): BuildContext {
249245
setProcessEnvVar(Constants.ENV_AOT_WRITE_TO_DISK, aotWriteToDisk);
250246
Logger.debug(`aotWriteToDisk set to ${aotWriteToDisk}`);
251247

252-
const printOriginalDependencyTree = getConfigValue(context, '--printOriginalDependencyTree', null, Constants.ENV_PRINT_ORIGINAL_DEPENDENCY_TREE, Constants.ENV_PRINT_ORIGINAL_DEPENDENCY_TREE.toLowerCase(), null);
253-
setProcessEnvVar(Constants.ENV_PRINT_ORIGINAL_DEPENDENCY_TREE, printOriginalDependencyTree);
254-
Logger.debug(`printOriginalDependencyTree set to ${printOriginalDependencyTree}`);
255-
256-
const printModifiedDependencyTree = getConfigValue(context, '--printModifiedDependencyTree', null, Constants.ENV_PRINT_MODIFIED_DEPENDENCY_TREE, Constants.ENV_PRINT_MODIFIED_DEPENDENCY_TREE.toLowerCase(), null);
257-
setProcessEnvVar(Constants.ENV_PRINT_MODIFIED_DEPENDENCY_TREE, printModifiedDependencyTree);
258-
Logger.debug(`printModifiedDependencyTree set to ${printModifiedDependencyTree}`);
259-
260248
const printWebpackDependencyTree = getConfigValue(context, '--printWebpackDependencyTree', null, Constants.ENV_PRINT_WEBPACK_DEPENDENCY_TREE, Constants.ENV_PRINT_WEBPACK_DEPENDENCY_TREE.toLowerCase(), null);
261249
setProcessEnvVar(Constants.ENV_PRINT_WEBPACK_DEPENDENCY_TREE, printWebpackDependencyTree);
262250
Logger.debug(`printWebpackDependencyTree set to ${printWebpackDependencyTree}`);
263-
264251
const typeCheckOnLint = getConfigValue(context, '--typeCheckOnLint', null, Constants.ENV_TYPE_CHECK_ON_LINT, Constants.ENV_TYPE_CHECK_ON_LINT.toLowerCase(), null);
265252
setProcessEnvVar(Constants.ENV_TYPE_CHECK_ON_LINT, typeCheckOnLint);
266253
Logger.debug(`typeCheckOnLint set to ${typeCheckOnLint}`);
@@ -342,27 +329,10 @@ export function generateContext(context?: BuildContext): BuildContext {
342329
setProcessEnvVar(Constants.ENV_PARSE_DEEPLINKS, parseDeepLinks);
343330
Logger.debug(`parseDeepLinks set to ${parseDeepLinks}`);
344331

345-
const purgeDecorators = getConfigValue(context, '--purgeDecorators', null, Constants.ENV_PURGE_DECORATORS, Constants.ENV_PURGE_DECORATORS.toLowerCase(), 'true');
346-
setProcessEnvVar(Constants.ENV_PURGE_DECORATORS, purgeDecorators);
347-
Logger.debug(`purgeDecorators set to ${purgeDecorators}`);
348-
349-
const manualTreeshaking = getConfigValue(context, '--manualTreeshaking', null, Constants.ENV_MANUAL_TREESHAKING, Constants.ENV_MANUAL_TREESHAKING.toLowerCase(), 'true');
350-
setProcessEnvVar(Constants.ENV_MANUAL_TREESHAKING, manualTreeshaking);
351-
Logger.debug(`manualTreeshaking set to ${manualTreeshaking}`);
352-
353-
/* Experimental Flags */
354-
const useExperimentalClosure = getConfigValue(context, '--useExperimentalClosure', null, Constants.ENV_USE_EXPERIMENTAL_CLOSURE, Constants.ENV_USE_EXPERIMENTAL_CLOSURE.toLowerCase(), null);
355-
setProcessEnvVar(Constants.ENV_USE_EXPERIMENTAL_CLOSURE, useExperimentalClosure);
356-
Logger.debug(`useExperimentalClosure set to ${useExperimentalClosure}`);
357-
358-
const useExperimentalBabili = getConfigValue(context, '--useExperimentalBabili', null, Constants.ENV_USE_EXPERIMENTAL_BABILI, Constants.ENV_USE_EXPERIMENTAL_BABILI.toLowerCase(), null);
359-
setProcessEnvVar(Constants.ENV_USE_EXPERIMENTAL_BABILI, useExperimentalBabili);
360-
Logger.debug(`useExperimentalBabili set to ${useExperimentalBabili}`);
361-
362332
// default stand-alone builds to default to es5
363333
// if closure is being used, don't worry about this as it already automatically converts to ES5
364334

365-
const buildToEs5 = getConfigValue(context, '--buildToEs5', null, Constants.ENV_BUILD_TO_ES5, Constants.ENV_BUILD_TO_ES5.toLowerCase(), useExperimentalClosure ? null : 'true');
335+
const buildToEs5 = getConfigValue(context, '--buildToEs5', null, Constants.ENV_BUILD_TO_ES5, Constants.ENV_BUILD_TO_ES5.toLowerCase(), 'true');
366336
setProcessEnvVar(Constants.ENV_BUILD_TO_ES5, buildToEs5);
367337
Logger.debug(`buildToEs5 set to ${buildToEs5}`);
368338

src/util/constants.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export const ENV_DIRECTIVES_NG_MODULE_PATH = 'IONIC_DIRECTIVES_NG_MODULE_PATH';
6464

6565
export const ENV_GLOB_UTIL = 'IONIC_GLOB_UTIL';
6666
export const ENV_CLEAN_BEFORE_COPY = 'IONIC_CLEAN_BEFORE_COPY';
67-
export const ENV_CLOSURE_JAR = 'IONIC_CLOSURE_JAR';
6867
export const ENV_READ_CONFIG_JSON = 'IONIC_READ_CONFIG_JSON';
6968
export const ENV_OUTPUT_JS_FILE_NAME = 'IONIC_OUTPUT_JS_FILE_NAME';
7069
export const ENV_OUTPUT_CSS_FILE_NAME = 'IONIC_OUTPUT_CSS_FILE_NAME';
@@ -82,18 +81,10 @@ export const ENV_DISABLE_LOGGING = 'IONIC_DISABLE_LOGGING';
8281
export const ENV_START_WATCH_TIMEOUT = 'IONIC_START_WATCH_TIMEOUT';
8382
export const ENV_NG_MODULE_FILE_NAME_SUFFIX = 'IONIC_NG_MODULE_FILENAME_SUFFIX';
8483
export const ENV_POLYFILL_FILE_NAME = 'IONIC_POLYFILL_FILE_NAME';
85-
86-
export const ENV_PRINT_ORIGINAL_DEPENDENCY_TREE = 'IONIC_PRINT_ORIGINAL_DEPENDENCY_TREE';
87-
export const ENV_PRINT_MODIFIED_DEPENDENCY_TREE = 'IONIC_PRINT_MODIFIED_DEPENDENCY_TREE';
8884
export const ENV_PRINT_WEBPACK_DEPENDENCY_TREE = 'IONIC_PRINT_WEBPACK_DEPENDENCY_TREE';
8985
export const ENV_PARSE_DEEPLINKS = 'IONIC_PARSE_DEEPLINKS';
90-
export const ENV_PURGE_DECORATORS = 'IONIC_PURGE_DECORATORS';
91-
export const ENV_MANUAL_TREESHAKING = 'IONIC_MANUAL_TREESHAKING';
9286

93-
/* Flags for experimental stuff */
9487

95-
export const ENV_USE_EXPERIMENTAL_CLOSURE = 'IONIC_USE_EXPERIMENTAL_CLOSURE';
96-
export const ENV_USE_EXPERIMENTAL_BABILI = 'IONIC_USE_EXPERIMENTAL_BABILI';
9788

9889
/* Providers */
9990
export const ENV_ACTION_SHEET_CONTROLLER_CLASSNAME = 'IONIC_ACTION_SHEET_CONTROLLER_CLASSNAME';

0 commit comments

Comments
 (0)