aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 21:54:41 +0100
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 21:54:41 +0100
commit6c8128f9fd5a5d0be115806c35a21b3d683df8d6 (patch)
treef46c2f6b3b9b294ff32bd75c08ccdc9e7a8cc4ef /sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js
parent2400b84e95913665da6279114168148444b8f9ab (diff)
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into logo
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js113
1 files changed, 113 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js
new file mode 100644
index 00000000..2b3a4cc9
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js
@@ -0,0 +1,113 @@
+"use strict";
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FileSystemEngineHost = void 0;
+const fs_1 = require("fs");
+const path_1 = require("path");
+const rxjs_1 = require("rxjs");
+const operators_1 = require("rxjs/operators");
+const src_1 = require("../src");
+const export_ref_1 = require("./export-ref");
+const file_system_engine_host_base_1 = require("./file-system-engine-host-base");
+/**
+ * A simple EngineHost that uses a root with one directory per collection inside of it. The
+ * collection declaration follows the same rules as the regular FileSystemEngineHostBase.
+ */
+class FileSystemEngineHost extends file_system_engine_host_base_1.FileSystemEngineHostBase {
+ constructor(_root) {
+ super();
+ this._root = _root;
+ }
+ _resolveCollectionPath(name) {
+ try {
+ // Allow `${_root}/${name}.json` as a collection.
+ const maybePath = require.resolve((0, path_1.join)(this._root, name + '.json'));
+ if ((0, fs_1.existsSync)(maybePath)) {
+ return maybePath;
+ }
+ }
+ catch (error) { }
+ try {
+ // Allow `${_root}/${name}/collection.json.
+ const maybePath = require.resolve((0, path_1.join)(this._root, name, 'collection.json'));
+ if ((0, fs_1.existsSync)(maybePath)) {
+ return maybePath;
+ }
+ }
+ catch (error) { }
+ throw new file_system_engine_host_base_1.CollectionCannotBeResolvedException(name);
+ }
+ _resolveReferenceString(refString, parentPath) {
+ // Use the same kind of export strings as NodeModule.
+ const ref = new export_ref_1.ExportStringRef(refString, parentPath);
+ if (!ref.ref) {
+ return null;
+ }
+ return { ref: ref.ref, path: ref.module };
+ }
+ _transformCollectionDescription(name, desc) {
+ if (!desc.schematics || typeof desc.schematics != 'object') {
+ throw new file_system_engine_host_base_1.CollectionMissingSchematicsMapException(name);
+ }
+ return {
+ ...desc,
+ name,
+ };
+ }
+ _transformSchematicDescription(name, _collection, desc) {
+ if (!desc.factoryFn || !desc.path || !desc.description) {
+ throw new file_system_engine_host_base_1.SchematicMissingFieldsException(name);
+ }
+ return desc;
+ }
+ hasTaskExecutor(name) {
+ if (super.hasTaskExecutor(name)) {
+ return true;
+ }
+ try {
+ const maybePath = require.resolve((0, path_1.join)(this._root, name));
+ if ((0, fs_1.existsSync)(maybePath)) {
+ return true;
+ }
+ }
+ catch { }
+ return false;
+ }
+ createTaskExecutor(name) {
+ if (!super.hasTaskExecutor(name)) {
+ try {
+ const path = require.resolve((0, path_1.join)(this._root, name));
+ // Default handling code is for old tasks that incorrectly export `default` with non-ESM module
+ return (0, rxjs_1.from)(Promise.resolve().then(() => __importStar(require(path))).then((mod) => { var _a; return (((_a = mod.default) === null || _a === void 0 ? void 0 : _a.default) || mod.default)(); })).pipe((0, operators_1.catchError)(() => (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name))));
+ }
+ catch { }
+ }
+ return super.createTaskExecutor(name);
+ }
+}
+exports.FileSystemEngineHost = FileSystemEngineHost;