secondary-entry-points-rule.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. /**
  3. * Use of this source code is governed by an MIT-style license that can be
  4. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. exports.SecondaryEntryPointsRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const ts = require("typescript");
  10. class SecondaryEntryPointsRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = false;
  14. }
  15. visitNode(declaration) {
  16. if (!ts.isImportDeclaration(declaration) ||
  17. !ts.isStringLiteralLike(declaration.moduleSpecifier)) {
  18. return;
  19. }
  20. const importLocation = declaration.moduleSpecifier.text;
  21. if (importLocation === 'ng-zorro-antd/core') {
  22. this.createFailureAtNode(declaration, 'The entry-point "ng-zorro-antd/core" is removed, ' +
  23. 'use "ng-zorro-antd/core/**" instead.');
  24. }
  25. if (importLocation === 'ng-zorro-antd') {
  26. this.createFailureAtNode(declaration, 'The entry-point "ng-zorro-antd" is removed, ' +
  27. 'use "ng-zorro-antd/**" instead.');
  28. }
  29. }
  30. }
  31. exports.SecondaryEntryPointsRule = SecondaryEntryPointsRule;
  32. //# sourceMappingURL=secondary-entry-points-rule.js.map