UNPKG

@project-sunbird/sunbird-epub-player-v9

Version:

The Epub player library is powered by Angular. This player is primarily designed to be used on Sunbird consumption platforms _(mobile app, web portal, offline desktop app)_ to drive reusability and maintainability, hence reducing the redundant development

50 lines 2.4 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const schematics_1 = require("@angular-devkit/schematics"); const tasks_1 = require("@angular-devkit/schematics/tasks"); const workspace_1 = require("@schematics/angular/utility/workspace"); const messages = require("./messages"); const package_config_1 = require("../utils/package-config"); const VERSIONS = { // automatically filled from package.json during the build '@project-sunbird/sb-styles': '0.0.7', '@project-sunbird/client-services': '^3.4.8', epubjs: '0.3.88', }; /** * This is executed when `ng add @project-sunbird/sunbird-epub-player-v9` is run. * It installs all dependencies in the 'package.json' and runs 'ng-add-setup-project' schematic. */ function ngAdd(options) { return (tree, context) => __awaiter(this, void 0, void 0, function* () { // Checking that project exists const { project } = options; if (project) { const workspace = yield (0, workspace_1.getWorkspace)(tree); const projectWorkspace = workspace.projects.get(project); if (!projectWorkspace) { throw new schematics_1.SchematicsException(messages.noProject(project)); } } // Installing dependencies for (const key in VERSIONS) { if (VERSIONS.hasOwnProperty(key)) { (0, package_config_1.addPackageToPackageJson)(tree, key, VERSIONS[key]); } } context.addTask(new tasks_1.RunSchematicTask('ng-add-setup-project', options), [ context.addTask(new tasks_1.NodePackageInstallTask()), ]); }); } exports.default = ngAdd; //# sourceMappingURL=index.js.map