UNPKG

@o3r/third-party

Version:

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

33 lines 1.22 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"); /** * Add Otter third-party to an Angular Project * @param options */ function ngAddFn(options) { return (tree) => { const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' })); return (0, schematics_1.chain)([ (0, schematics_2.registerPackageCollectionSchematics)(packageJson), (0, schematics_2.setupDependencies)({ projectName: options.projectName, dependencies: (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion) }) ]); }; } /** * 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