UNPKG

@o3r/third-party

Version:

This module provides a bridge to communicate with third parties via an iFrame solution.

38 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ngAdd = void 0; const fs = require("node:fs"); const path = require("node:path"); const schematics_1 = require("@angular-devkit/schematics"); const schematics_2 = require("@o3r/schematics"); /** * List of external dependencies to be added to the project as peer dependencies */ const dependenciesToInstall = [ 'rxjs' ]; /** * List of external dependencies to be added to the project as dev dependencies */ const devDependenciesToInstall = []; const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' })); /** * Add Otter third-party to an Angular Project * @param options */ function ngAddFn(options) { return (0, schematics_1.chain)([ (0, schematics_2.registerPackageCollectionSchematics)(packageJson), (0, schematics_2.ngAddDependenciesRule)(options, packageJsonPath, { dependenciesToInstall, devDependenciesToInstall }) ]); } /** * Add Otter third-party to an Angular Project * @param options */ const ngAdd = (options) => () => { return (0, schematics_2.createOtterSchematic)(ngAddFn)(options); }; exports.ngAdd = ngAdd; //# sourceMappingURL=index.js.map