Alan Agius 745670fa6a feat(@schematics/angular): remove dependency on tsickle (#15603)
With this change we remove the requirement  to add tsickle as a dependency when having a workspace library.

Since the CTOR downlevel transformer which was previously provided via tsickle  is now in ng-packagr version 5.5.1+ We migrate existing libraries to remove the need for tsickle.
2019-09-18 14:50:29 +01:00

38 lines
1.2 KiB
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Rule, chain } from '@angular-devkit/schematics';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
import { updateLibraries } from './ivy-libraries';
import { updateNGSWConfig } from './ngsw-config';
import { removeTsickle } from './remove-tsickle';
import { updateApplicationTsConfigs } from './update-app-tsconfigs';
import { updateDependencies } from './update-dependencies';
import { updateServerMainFile } from './update-server-main-file';
import { updateWorkspaceConfig } from './update-workspace-config';
export default function(): Rule {
return () => {
return chain([
updateWorkspaceConfig(),
updateLibraries(),
updateNGSWConfig(),
updateApplicationTsConfigs(),
updateDependencies(),
updateServerMainFile(),
removeTsickle(),
(tree, context) => {
const packageChanges = tree.actions.some(a => a.path.endsWith('/package.json'));
if (packageChanges) {
context.addTask(new NodePackageInstallTask());
}
},
]);
};
}