Skip to content

Commit

Permalink
build(schematics): removing explicit addition of ng-bootstrap to pack…
Browse files Browse the repository at this point in the history
…age.json

´ng add @ng-bootstrap/ng-bootstrap´ automatically adds ng-bootstrap to
package.json (unless we add "ng-add": {"save":false} to the package.json
of ng-bootstrap), so it is not needed to do it ourselves.
  • Loading branch information
divdavem authored and maxokorokov committed Feb 22, 2022
1 parent ec208f4 commit 1425962
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion schematics/ng-add/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe(`ng add '@ng-bootstrap/ng-bootstrap'`, () => {
const tree = await runner.runSchematicAsync('ng-add', {}, appTree).toPromise();
const {dependencies} = JSON.parse(getFileContent(tree, '/package.json'));

expect(dependencies['@ng-bootstrap/ng-bootstrap']).toBeDefined('@ng-bootstrap/ng-bootstrap should be installed');
expect(dependencies['bootstrap']).toBeDefined('bootstrap should be installed');
expect(dependencies['@angular/localize']).toBeDefined('@angular/localize should be installed');
expect(dependencies['@popperjs/core']).toBeDefined('@popperjs/core should be installed');
Expand Down
2 changes: 0 additions & 2 deletions schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {addPackageToPackageJson, getPackageVersionFromPackageJson} from '../util

const VERSIONS = {
// automatically filled from package.json during the build
NGBOOTSTRAP: "^0.0.0",
BOOTSTRAP: "^0.0.0",
POPPER: "^0.0.0"
};
Expand All @@ -39,7 +38,6 @@ export default function ngAdd(options: Schema): Rule {
const angularCoreVersion = getPackageVersionFromPackageJson(tree, '@angular/core') !;
const angularLocalizeVersion = getPackageVersionFromPackageJson(tree, '@angular/localize');

addPackageToPackageJson(tree, '@ng-bootstrap/ng-bootstrap', VERSIONS.NGBOOTSTRAP);
addPackageToPackageJson(tree, 'bootstrap', VERSIONS.BOOTSTRAP);
addPackageToPackageJson(tree, '@popperjs/core', VERSIONS.POPPER);

Expand Down
1 change: 0 additions & 1 deletion schematics/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = [
plugins: [
replace({
preventAssignment: true,
"VERSIONS.NGBOOTSTRAP": version(pkg.version),
"VERSIONS.BOOTSTRAP": version(pkg.devDependencies.bootstrap),
"VERSIONS.POPPER": version(pkg.devDependencies["@popperjs/core"]),
}),
Expand Down

0 comments on commit 1425962

Please sign in to comment.