From 291803c31f829fe0d32bb3207bc11def95a7408c Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 20:05:50 +0100 Subject: Urađena test aplikacija. Povezan front i back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@angular-devkit/schematics/LICENSE | 21 ++ .../@angular-devkit/schematics/README.md | 204 +++++++++++ .../schematics/collection-schema.json | 70 ++++ .../@angular-devkit/schematics/package.json | 42 +++ .../schematics/src/engine/engine.d.ts | 77 ++++ .../schematics/src/engine/engine.js | 295 +++++++++++++++ .../schematics/src/engine/index.d.ts | 10 + .../@angular-devkit/schematics/src/engine/index.js | 22 ++ .../schematics/src/engine/interface.d.ts | 157 ++++++++ .../schematics/src/engine/interface.js | 9 + .../schematics/src/engine/schematic.d.ts | 24 ++ .../schematics/src/engine/schematic.js | 67 ++++ .../schematics/src/exception/exception.d.ts | 31 ++ .../schematics/src/exception/exception.js | 58 +++ .../schematics/src/formats/format-validator.d.ts | 10 + .../schematics/src/formats/format-validator.js | 20 + .../schematics/src/formats/html-selector.d.ts | 9 + .../schematics/src/formats/html-selector.js | 44 +++ .../schematics/src/formats/index.d.ts | 11 + .../schematics/src/formats/index.js | 17 + .../schematics/src/formats/path.d.ts | 9 + .../@angular-devkit/schematics/src/formats/path.js | 24 ++ .../@angular-devkit/schematics/src/index.d.ts | 41 +++ .../@angular-devkit/schematics/src/index.js | 75 ++++ .../@angular-devkit/schematics/src/rules/base.d.ts | 38 ++ .../@angular-devkit/schematics/src/rules/base.js | 155 ++++++++ .../@angular-devkit/schematics/src/rules/call.d.ts | 22 ++ .../@angular-devkit/schematics/src/rules/call.js | 110 ++++++ .../@angular-devkit/schematics/src/rules/move.d.ts | 9 + .../@angular-devkit/schematics/src/rules/move.js | 37 ++ .../schematics/src/rules/random.d.ts | 14 + .../@angular-devkit/schematics/src/rules/random.js | 40 ++ .../schematics/src/rules/rename.d.ts | 10 + .../@angular-devkit/schematics/src/rules/rename.js | 26 ++ .../schematics/src/rules/schematic.d.ts | 23 ++ .../schematics/src/rules/schematic.js | 51 +++ .../schematics/src/rules/template.d.ts | 39 ++ .../schematics/src/rules/template.js | 151 ++++++++ .../@angular-devkit/schematics/src/rules/url.d.ts | 9 + .../@angular-devkit/schematics/src/rules/url.js | 16 + .../schematics/src/sink/dryrun.d.ts | 50 +++ .../@angular-devkit/schematics/src/sink/dryrun.js | 80 ++++ .../@angular-devkit/schematics/src/sink/host.d.ts | 29 ++ .../@angular-devkit/schematics/src/sink/host.js | 76 ++++ .../@angular-devkit/schematics/src/sink/sink.d.ts | 35 ++ .../@angular-devkit/schematics/src/sink/sink.js | 116 ++++++ .../schematics/src/tree/action.d.ts | 50 +++ .../@angular-devkit/schematics/src/tree/action.js | 140 +++++++ .../schematics/src/tree/delegate.d.ts | 30 ++ .../schematics/src/tree/delegate.js | 71 ++++ .../@angular-devkit/schematics/src/tree/empty.d.ts | 11 + .../@angular-devkit/schematics/src/tree/empty.js | 17 + .../@angular-devkit/schematics/src/tree/entry.d.ts | 25 ++ .../@angular-devkit/schematics/src/tree/entry.js | 37 ++ .../schematics/src/tree/host-tree.d.ts | 63 ++++ .../schematics/src/tree/host-tree.js | 406 +++++++++++++++++++++ .../schematics/src/tree/interface.d.ts | 61 ++++ .../schematics/src/tree/interface.js | 47 +++ .../@angular-devkit/schematics/src/tree/null.d.ts | 43 +++ .../@angular-devkit/schematics/src/tree/null.js | 92 +++++ .../schematics/src/tree/recorder.d.ts | 29 ++ .../schematics/src/tree/recorder.js | 74 ++++ .../schematics/src/tree/scoped.d.ts | 47 +++ .../@angular-devkit/schematics/src/tree/scoped.js | 169 +++++++++ .../schematics/src/tree/static.d.ts | 13 + .../@angular-devkit/schematics/src/tree/static.js | 38 ++ .../src/utility/environment-options.d.ts | 8 + .../schematics/src/utility/environment-options.js | 20 + .../schematics/src/utility/linked-list.d.ts | 19 + .../schematics/src/utility/linked-list.js | 68 ++++ .../schematics/src/utility/update-buffer.d.ts | 118 ++++++ .../schematics/src/utility/update-buffer.js | 324 ++++++++++++++++ .../schematics/src/workflow/base.d.ts | 51 +++ .../schematics/src/workflow/base.js | 138 +++++++ .../schematics/src/workflow/index.d.ts | 9 + .../schematics/src/workflow/index.js | 21 ++ .../schematics/src/workflow/interface.d.ts | 27 ++ .../schematics/src/workflow/interface.js | 9 + .../@angular-devkit/schematics/tasks/BUILD.bazel | 35 ++ .../@angular-devkit/schematics/tasks/index.d.ts | 11 + .../@angular-devkit/schematics/tasks/index.js | 18 + .../schematics/tasks/node/BUILD.bazel | 32 ++ .../schematics/tasks/node/index.d.ts | 15 + .../@angular-devkit/schematics/tasks/node/index.js | 47 +++ .../schematics/tasks/package-manager/executor.d.ts | 14 + .../schematics/tasks/package-manager/executor.js | 144 ++++++++ .../tasks/package-manager/install-task.d.ts | 27 ++ .../tasks/package-manager/install-task.js | 51 +++ .../tasks/package-manager/link-task.d.ts | 16 + .../schematics/tasks/package-manager/link-task.js | 30 ++ .../schematics/tasks/package-manager/options.d.ts | 23 ++ .../schematics/tasks/package-manager/options.js | 11 + .../@angular-devkit/schematics/tasks/package.json | 5 + .../schematics/tasks/repo-init/executor.d.ts | 10 + .../schematics/tasks/repo-init/executor.js | 90 +++++ .../schematics/tasks/repo-init/init-task.d.ts | 20 + .../schematics/tasks/repo-init/init-task.js | 30 ++ .../schematics/tasks/repo-init/options.d.ts | 18 + .../schematics/tasks/repo-init/options.js | 11 + .../schematics/tasks/run-schematic/executor.d.ts | 10 + .../schematics/tasks/run-schematic/executor.js | 29 ++ .../schematics/tasks/run-schematic/options.d.ts | 13 + .../schematics/tasks/run-schematic/options.js | 11 + .../schematics/tasks/run-schematic/task.d.ts | 17 + .../schematics/tasks/run-schematic/task.js | 34 ++ .../@angular-devkit/schematics/testing/BUILD.bazel | 28 ++ .../@angular-devkit/schematics/testing/index.d.ts | 8 + .../@angular-devkit/schematics/testing/index.js | 20 + .../schematics/testing/package.json | 5 + .../schematics/testing/schematic-test-runner.d.ts | 29 ++ .../schematics/testing/schematic-test-runner.js | 82 +++++ .../@angular-devkit/schematics/tools/BUILD.bazel | 67 ++++ .../schematics/tools/description.d.ts | 41 +++ .../schematics/tools/description.js | 9 + .../schematics/tools/export-ref.d.ts | 16 + .../@angular-devkit/schematics/tools/export-ref.js | 35 ++ .../schematics/tools/fallback-engine-host.d.ts | 36 ++ .../schematics/tools/fallback-engine-host.js | 86 +++++ .../tools/file-system-engine-host-base.d.ts | 75 ++++ .../tools/file-system-engine-host-base.js | 261 +++++++++++++ .../schematics/tools/file-system-engine-host.d.ts | 28 ++ .../schematics/tools/file-system-engine-host.js | 113 ++++++ .../schematics/tools/file-system-utility.d.ts | 9 + .../schematics/tools/file-system-utility.js | 26 ++ .../@angular-devkit/schematics/tools/index.d.ts | 15 + .../@angular-devkit/schematics/tools/index.js | 33 ++ .../schematics/tools/node-module-engine-host.d.ts | 29 ++ .../schematics/tools/node-module-engine-host.js | 107 ++++++ .../tools/node-modules-test-engine-host.d.ts | 23 ++ .../tools/node-modules-test-engine-host.js | 47 +++ .../@angular-devkit/schematics/tools/package.json | 5 + .../schematics/tools/schema-option-transform.d.ts | 14 + .../schematics/tools/schema-option-transform.js | 38 ++ .../schematics/tools/workflow/node-workflow.d.ts | 35 ++ .../schematics/tools/workflow/node-workflow.js | 69 ++++ 135 files changed, 6919 insertions(+) create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/LICENSE create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/README.md create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/collection-schema.json create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/package.json create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/BUILD.bazel create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/BUILD.bazel create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package.json create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/BUILD.bazel create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/package.json create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/BUILD.bazel create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/package.json create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js (limited to 'sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics') diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/LICENSE b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/LICENSE new file mode 100644 index 00000000..8876c32c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017 Google, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/README.md b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/README.md new file mode 100644 index 00000000..7fce70c8 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/README.md @@ -0,0 +1,204 @@ +# Schematics + +> A scaffolding library for the modern web. + +## Description + +Schematics are generators that transform an existing filesystem. They can create files, refactor existing files, or move files around. + +What distinguishes Schematics from other generators, such as Yeoman or Yarn Create, is that schematics are purely descriptive; no changes are applied to the actual filesystem until everything is ready to be committed. There is no side effect, by design, in Schematics. + +# Glossary + +| Term | Description | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Schematics** | A generator that executes descriptive code without side effects on an existing file system. | +| **Collection** | A list of schematics metadata. Schematics can be referred by name inside a collection. | +| **Tool** | The code using the Schematics library. | +| **Tree** | A staging area for changes, containing the original file system, and a list of changes to apply to it. | +| **Rule** | A function that applies actions to a `Tree`. It returns a new `Tree` that will contain all transformations to be applied. | +| **Source** | A function that creates an entirely new `Tree` from an empty filesystem. For example, a file source could read files from disk and create a Create Action for each of those. | +| **Action** | An atomic operation to be validated and committed to a filesystem or a `Tree`. Actions are created by schematics. | +| **Sink** | The final destination of all `Action`s. | + +# Tooling + +Schematics is a library, and does not work by itself. A [reference CLI](https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics_cli/bin/schematics.ts) is available on this repository, and is published on NPM at [@angular-devkit/schematics-cli](https://www.npmjs.com/package/@angular-devkit/schematics-cli). This document explains the library usage and the tooling API, but does not go into the tool implementation itself. + +The tooling is responsible for the following tasks: + +1. Create the Schematic Engine, and pass in a Collection and Schematic loader. +1. Understand and respect the Schematics metadata and dependencies between collections. Schematics can refer to dependencies, and it's the responsibility of the tool to honor those dependencies. The reference CLI uses NPM packages for its collections. +1. Create the Options object. Options can be anything, but the schematics can specify a JSON Schema that should be respected. The reference CLI, for example, parses the arguments as a JSON object and validates it with the Schema specified by the collection. +1. Schematics provides some JSON Schema formats for validation that tooling should add. These validate paths, html selectors and app names. Please check the reference CLI for how these can be added. +1. Call the schematics with the original Tree. The tree should represent the initial state of the filesystem. The reference CLI uses the current directory for this. +1. Create a Sink and commit the result of the schematics to the Sink. Many sinks are provided by the library; FileSystemSink and DryRunSink are examples. +1. Output any logs propagated by the library, including debugging information. + +The tooling API is composed of the following pieces: + +## Engine + +The `SchematicEngine` is responsible for loading and constructing `Collection`s and `Schematics`. When creating an engine, the tooling provides an `EngineHost` interface that understands how to create a `CollectionDescription` from a name, and how to create a `SchematicDescription`. + +# Schematics (Generators) + +Schematics are generators and part of a `Collection`. + +## Collection + +A Collection is defined by a `collection.json` file (in the reference CLI). This JSON defines the following properties: + +| Prop Name | Type | Description | +| ----------- | -------- | --------------------------- | +| **name** | `string` | The name of the collection. | +| **version** | `string` | Unused field. | + +## Schematic + +# Operators, Sources and Rules + +A `Source` is a generator of a `Tree`; it creates an entirely new root tree from nothing. A `Rule` is a transformation from one `Tree` to another. A `Schematic` (at the root) is a `Rule` that is normally applied on the filesystem. + +## Operators + +`FileOperator`s apply changes to a single `FileEntry` and return a new `FileEntry`. The result follows these rules: + +1. If the `FileEntry` returned is null, a `DeleteAction` will be added to the action list. +1. If the path changed, a `RenameAction` will be added to the action list. +1. If the content changed, an `OverwriteAction` will be added to the action list. + +It is impossible to create files using a `FileOperator`. + +## Provided Operators + +The Schematics library provides multiple `Operator` factories by default that cover basic use cases: + +| FileOperator | Description | +| -------------------------------- | -------------------------------------------------------------------- | +| `contentTemplate(options: T)` | Apply a content template (see the [Templating](#templating) section) | +| `pathTemplate(options: T)` | Apply a path template (see the [Templating](#templating) section) | + +## Provided Sources + +The Schematics library additionally provides multiple `Source` factories by default: + +| Source | Description | +| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `empty()` | Creates a source that returns an empty `Tree`. | +| `source(tree: Tree)` | Creates a `Source` that returns the `Tree` passed in as argument. | +| `url(url: string)` | Loads a list of files from the given URL and returns a `Tree` with the files as `CreateAction` applied to an empty `Tree`. | +| `apply(source: Source, rules: Rule[])` | Apply a list of `Rule`s to a source, and return the resulting `Source`. | + +## Provided Rules + +The schematics library also provides `Rule` factories by default: + +| Rule | Description | +| ------------------------------------------- | -------------------------------------------------------------------------------------- | +| `noop()` | Returns the input `Tree` as is. | +| `chain(rules: Rule[])` | Returns a `Rule` that's the concatenation of other `Rule`s. | +| `forEach(op: FileOperator)` | Returns a `Rule` that applies an operator to every file of the input `Tree`. | +| `move(root: string)` | Moves all the files from the input to a subdirectory. | +| `merge(other: Tree)` | Merge the input `Tree` with the other `Tree`. | +| `contentTemplate(options: T)` | Apply a content template (see the Template section) to the entire `Tree`. | +| `pathTemplate(options: T)` | Apply a path template (see the Template section) to the entire `Tree`. | +| `template(options: T)` | Apply both path and content templates (see the Template section) to the entire `Tree`. | +| `filter(predicate: FilePredicate)` | Returns the input `Tree` with files that do not pass the `FilePredicate`. | + +# Templating + +As referenced above, some functions are based upon a file templating system, which consists of path and content templating. + +The system operates on placeholders defined inside files or their paths as loaded in the `Tree` and fills these in as defined in the following, using values passed into the `Rule` which applies the templating (i.e. `template(options: T)`). + +## Path Templating + +| Placeholder | Description | +| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `__variable__` | Replaced with the value of `variable`. | +| `__variable@function__` | Replaced with the result of the call `function(variable)`. Can be chained to the left (`__variable@function1@function2__ ` etc). | + +## Content Templating + +| Placeholder | Description | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `<%= expression %>` | Replaced with the result of the call of the given expression. This only supports direct expressions, no structural (for/if/...) JavaScript. | +| `<%- expression %>` | Same as above, but the value of the result will be escaped for HTML when inserted (i.e. replacing '<' with '\<') | +| `<% inline code %>` | Inserts the given code into the template structure, allowing to insert structural JavaScript. | +| `<%# text %>` | A comment, which gets entirely dropped. | + +# Examples + +## Simple + +An example of a simple Schematics which creates a "hello world" file, using an option to determine its path: + +```typescript +import { Tree } from '@angular-devkit/schematics'; + +export default function MySchematic(options: any) { + return (tree: Tree) => { + tree.create(options.path + '/hi', 'Hello world!'); + return tree; + }; +} +``` + +A few things from this example: + +1. The function receives the list of options from the tooling. +1. It returns a [`Rule`](src/engine/interface.ts#L73), which is a transformation from a `Tree` to another `Tree`. + +## Templating + +A simplified example of a Schematics which creates a file containing a new Class, using an option to determine its name: + +```typescript +// files/__name@dasherize__.ts + +export class <%= classify(name) %> { +} +``` + +```typescript +// index.ts + +import { strings } from '@angular-devkit/core'; +import { + Rule, + SchematicContext, + SchematicsException, + Tree, + apply, + branchAndMerge, + mergeWith, + template, + url, +} from '@angular-devkit/schematics'; +import { Schema as ClassOptions } from './schema'; + +export default function (options: ClassOptions): Rule { + return (tree: Tree, context: SchematicContext) => { + if (!options.name) { + throw new SchematicsException('Option (name) is required.'); + } + + const templateSource = apply(url('./files'), [ + template({ + ...strings, + ...options, + }), + ]); + + return branchAndMerge(mergeWith(templateSource)); + }; +} +``` + +Additional things from this example: + +1. `strings` provides the used `dasherize` and `classify` functions, among others. +1. The files are on-disk in the same root directory as the `index.ts` and loaded into a `Tree`. +1. Then the `template` `Rule` fills in the specified templating placeholders. For this, it only knows about the variables and functions passed to it via the options-object. +1. Finally, the resulting `Tree`, containing the new file, is merged with the existing files of the project which the Schematic is run on. diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/collection-schema.json b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/collection-schema.json new file mode 100644 index 00000000..64892804 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/collection-schema.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "SchematicsCollectionSchema", + "title": "Collection Schema for validating a 'collection.json'.", + "type": "object", + "properties": { + "extends": { + "oneOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + } + ] + }, + "schematics": { + "type": "object", + "description": "A map of schematic names to schematic details", + "additionalProperties": { + "type": "object", + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "factory": { + "type": "string", + "description": "A folder or file path to the schematic factory" + }, + "description": { + "type": "string", + "description": "A description for the schematic" + }, + "extends": { + "type": "string", + "description": "An schematic override. It can be a local schematic or from another collection (in the format 'collection:schematic')" + }, + "schema": { + "type": "string", + "description": "Location of the schema.json file of the schematic" + }, + "hidden": { + "type": "boolean", + "default": false, + "description": "Whether or not this schematic should be listed by the tooling. This does not prevent the tooling to run this schematic, just removes its name from listSchematicNames()." + }, + "private": { + "type": "boolean", + "default": false, + "description": "Whether or not this schematic can be called from an external schematic, or a tool. This implies hidden: true." + } + }, + "required": ["factory", "description"] + } + }, + "version": { + "type": "string" + } + }, + "required": ["schematics"] +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/package.json b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/package.json new file mode 100644 index 00000000..b62a765d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/package.json @@ -0,0 +1,42 @@ +{ + "name": "@angular-devkit/schematics", + "version": "13.2.5", + "description": "Angular Schematics - Library", + "main": "src/index.js", + "typings": "src/index.d.ts", + "keywords": [ + "angular", + "Angular CLI", + "devkit", + "sdk", + "Angular DevKit", + "blueprints", + "scaffolding", + "template", + "tooling", + "code generation", + "schematics" + ], + "dependencies": { + "@angular-devkit/core": "13.2.5", + "jsonc-parser": "3.0.0", + "magic-string": "0.25.7", + "ora": "5.4.1", + "rxjs": "6.6.7" + }, + "repository": { + "type": "git", + "url": "https://github.com/angular/angular-cli.git" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "author": "Angular Authors", + "license": "MIT", + "bugs": { + "url": "https://github.com/angular/angular-cli/issues" + }, + "homepage": "https://github.com/angular/angular-cli" +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.d.ts new file mode 100644 index 00000000..02063733 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.d.ts @@ -0,0 +1,77 @@ +/** + * @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 + */ +/// +import { BaseException } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { Url } from 'url'; +import { MergeStrategy } from '../tree/interface'; +import { Workflow } from '../workflow/interface'; +import { Collection, CollectionDescription, Engine, EngineHost, ExecutionOptions, Schematic, SchematicContext, SchematicDescription, Source, TaskConfiguration, TaskId, TaskInfo, TypedSchematicContext } from './interface'; +export declare class UnknownUrlSourceProtocol extends BaseException { + constructor(url: string); +} +export declare class UnknownCollectionException extends BaseException { + constructor(name: string); +} +export declare class CircularCollectionException extends BaseException { + constructor(name: string); +} +export declare class UnknownSchematicException extends BaseException { + constructor(name: string, collection: CollectionDescription<{}>); +} +export declare class PrivateSchematicException extends BaseException { + constructor(name: string, collection: CollectionDescription<{}>); +} +export declare class SchematicEngineConflictingException extends BaseException { + constructor(); +} +export declare class UnregisteredTaskException extends BaseException { + constructor(name: string, schematic?: SchematicDescription<{}, {}>); +} +export declare class UnknownTaskDependencyException extends BaseException { + constructor(id: TaskId); +} +export declare class CollectionImpl implements Collection { + private _description; + private _engine; + readonly baseDescriptions?: CollectionDescription[] | undefined; + constructor(_description: CollectionDescription, _engine: SchematicEngine, baseDescriptions?: CollectionDescription[] | undefined); + get description(): CollectionDescription; + get name(): string; + createSchematic(name: string, allowPrivate?: boolean): Schematic; + listSchematicNames(): string[]; +} +export declare class TaskScheduler { + private _context; + private _queue; + private _taskIds; + private static _taskIdCounter; + constructor(_context: SchematicContext); + private _calculatePriority; + private _mapDependencies; + schedule(taskConfiguration: TaskConfiguration): TaskId; + finalize(): ReadonlyArray; +} +export declare class SchematicEngine implements Engine { + private _host; + protected _workflow?: Workflow | undefined; + private _collectionCache; + private _schematicCache; + private _taskSchedulers; + constructor(_host: EngineHost, _workflow?: Workflow | undefined); + get workflow(): Workflow | null; + get defaultMergeStrategy(): MergeStrategy; + createCollection(name: string, requester?: Collection): Collection; + private _createCollectionDescription; + createContext(schematic: Schematic, parent?: Partial>, executionOptions?: Partial): TypedSchematicContext; + createSchematic(name: string, collection: Collection, allowPrivate?: boolean): Schematic; + listSchematicNames(collection: Collection): string[]; + transformOptions(schematic: Schematic, options: OptionT, context?: TypedSchematicContext): Observable; + createSourceFromUrl(url: Url, context: TypedSchematicContext): Source; + executePostTasks(): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.js new file mode 100644 index 00000000..64941062 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/engine.js @@ -0,0 +1,295 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchematicEngine = exports.TaskScheduler = exports.CollectionImpl = exports.UnknownTaskDependencyException = exports.UnregisteredTaskException = exports.SchematicEngineConflictingException = exports.PrivateSchematicException = exports.UnknownSchematicException = exports.CircularCollectionException = exports.UnknownCollectionException = exports.UnknownUrlSourceProtocol = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const interface_1 = require("../tree/interface"); +const null_1 = require("../tree/null"); +const static_1 = require("../tree/static"); +const schematic_1 = require("./schematic"); +class UnknownUrlSourceProtocol extends core_1.BaseException { + constructor(url) { + super(`Unknown Protocol on url "${url}".`); + } +} +exports.UnknownUrlSourceProtocol = UnknownUrlSourceProtocol; +class UnknownCollectionException extends core_1.BaseException { + constructor(name) { + super(`Unknown collection "${name}".`); + } +} +exports.UnknownCollectionException = UnknownCollectionException; +class CircularCollectionException extends core_1.BaseException { + constructor(name) { + super(`Circular collection reference "${name}".`); + } +} +exports.CircularCollectionException = CircularCollectionException; +class UnknownSchematicException extends core_1.BaseException { + constructor(name, collection) { + super(`Schematic "${name}" not found in collection "${collection.name}".`); + } +} +exports.UnknownSchematicException = UnknownSchematicException; +class PrivateSchematicException extends core_1.BaseException { + constructor(name, collection) { + super(`Schematic "${name}" not found in collection "${collection.name}".`); + } +} +exports.PrivateSchematicException = PrivateSchematicException; +class SchematicEngineConflictingException extends core_1.BaseException { + constructor() { + super(`A schematic was called from a different engine as its parent.`); + } +} +exports.SchematicEngineConflictingException = SchematicEngineConflictingException; +class UnregisteredTaskException extends core_1.BaseException { + constructor(name, schematic) { + const addendum = schematic ? ` in schematic "${schematic.name}"` : ''; + super(`Unregistered task "${name}"${addendum}.`); + } +} +exports.UnregisteredTaskException = UnregisteredTaskException; +class UnknownTaskDependencyException extends core_1.BaseException { + constructor(id) { + super(`Unknown task dependency [ID: ${id.id}].`); + } +} +exports.UnknownTaskDependencyException = UnknownTaskDependencyException; +class CollectionImpl { + constructor(_description, _engine, baseDescriptions) { + this._description = _description; + this._engine = _engine; + this.baseDescriptions = baseDescriptions; + } + get description() { + return this._description; + } + get name() { + return this.description.name || ''; + } + createSchematic(name, allowPrivate = false) { + return this._engine.createSchematic(name, this, allowPrivate); + } + listSchematicNames() { + return this._engine.listSchematicNames(this); + } +} +exports.CollectionImpl = CollectionImpl; +class TaskScheduler { + constructor(_context) { + this._context = _context; + this._queue = new core_1.PriorityQueue((x, y) => x.priority - y.priority); + this._taskIds = new Map(); + } + _calculatePriority(dependencies) { + if (dependencies.size === 0) { + return 0; + } + const prio = [...dependencies].reduce((prio, task) => prio + task.priority, 1); + return prio; + } + _mapDependencies(dependencies) { + if (!dependencies) { + return new Set(); + } + const tasks = dependencies.map((dep) => { + const task = this._taskIds.get(dep); + if (!task) { + throw new UnknownTaskDependencyException(dep); + } + return task; + }); + return new Set(tasks); + } + schedule(taskConfiguration) { + const dependencies = this._mapDependencies(taskConfiguration.dependencies); + const priority = this._calculatePriority(dependencies); + const task = { + id: TaskScheduler._taskIdCounter++, + priority, + configuration: taskConfiguration, + context: this._context, + }; + this._queue.push(task); + const id = { id: task.id }; + this._taskIds.set(id, task); + return id; + } + finalize() { + const tasks = this._queue.toArray(); + this._queue.clear(); + this._taskIds.clear(); + return tasks; + } +} +exports.TaskScheduler = TaskScheduler; +TaskScheduler._taskIdCounter = 1; +class SchematicEngine { + constructor(_host, _workflow) { + this._host = _host; + this._workflow = _workflow; + this._collectionCache = new Map(); + this._schematicCache = new WeakMap(); + this._taskSchedulers = new Array(); + } + get workflow() { + return this._workflow || null; + } + get defaultMergeStrategy() { + return this._host.defaultMergeStrategy || interface_1.MergeStrategy.Default; + } + createCollection(name, requester) { + let collection = this._collectionCache.get(name); + if (collection) { + return collection; + } + const [description, bases] = this._createCollectionDescription(name, requester === null || requester === void 0 ? void 0 : requester.description); + collection = new CollectionImpl(description, this, bases); + this._collectionCache.set(name, collection); + this._schematicCache.set(collection, new Map()); + return collection; + } + _createCollectionDescription(name, requester, parentNames) { + const description = this._host.createCollectionDescription(name, requester); + if (!description) { + throw new UnknownCollectionException(name); + } + if (parentNames && parentNames.has(description.name)) { + throw new CircularCollectionException(name); + } + const bases = new Array(); + if (description.extends) { + parentNames = (parentNames || new Set()).add(description.name); + for (const baseName of description.extends) { + const [base, baseBases] = this._createCollectionDescription(baseName, description, new Set(parentNames)); + bases.unshift(base, ...baseBases); + } + } + return [description, bases]; + } + createContext(schematic, parent, executionOptions) { + // Check for inconsistencies. + if (parent && parent.engine && parent.engine !== this) { + throw new SchematicEngineConflictingException(); + } + let interactive = true; + if (executionOptions && executionOptions.interactive != undefined) { + interactive = executionOptions.interactive; + } + else if (parent && parent.interactive != undefined) { + interactive = parent.interactive; + } + let context = { + debug: (parent && parent.debug) || false, + engine: this, + logger: (parent && parent.logger && parent.logger.createChild(schematic.description.name)) || + new core_1.logging.NullLogger(), + schematic, + strategy: parent && parent.strategy !== undefined ? parent.strategy : this.defaultMergeStrategy, + interactive, + addTask, + }; + const maybeNewContext = this._host.transformContext(context); + if (maybeNewContext) { + context = maybeNewContext; + } + const taskScheduler = new TaskScheduler(context); + const host = this._host; + this._taskSchedulers.push(taskScheduler); + function addTask(task, dependencies) { + const config = task.toConfiguration(); + if (!host.hasTaskExecutor(config.name)) { + throw new UnregisteredTaskException(config.name, schematic.description); + } + config.dependencies = config.dependencies || []; + if (dependencies) { + config.dependencies.unshift(...dependencies); + } + return taskScheduler.schedule(config); + } + return context; + } + createSchematic(name, collection, allowPrivate = false) { + const schematicMap = this._schematicCache.get(collection); + let schematic = schematicMap === null || schematicMap === void 0 ? void 0 : schematicMap.get(name); + if (schematic) { + return schematic; + } + let collectionDescription = collection.description; + let description = this._host.createSchematicDescription(name, collection.description); + if (!description) { + if (collection.baseDescriptions) { + for (const base of collection.baseDescriptions) { + description = this._host.createSchematicDescription(name, base); + if (description) { + collectionDescription = base; + break; + } + } + } + if (!description) { + // Report the error for the top level schematic collection + throw new UnknownSchematicException(name, collection.description); + } + } + if (description.private && !allowPrivate) { + throw new PrivateSchematicException(name, collection.description); + } + const factory = this._host.getSchematicRuleFactory(description, collectionDescription); + schematic = new schematic_1.SchematicImpl(description, factory, collection, this); + schematicMap === null || schematicMap === void 0 ? void 0 : schematicMap.set(name, schematic); + return schematic; + } + listSchematicNames(collection) { + const names = this._host.listSchematicNames(collection.description); + if (collection.baseDescriptions) { + for (const base of collection.baseDescriptions) { + names.push(...this._host.listSchematicNames(base)); + } + } + // remove duplicates + return [...new Set(names)].sort(); + } + transformOptions(schematic, options, context) { + return this._host.transformOptions(schematic.description, options, context); + } + createSourceFromUrl(url, context) { + switch (url.protocol) { + case 'null:': + return () => new null_1.NullTree(); + case 'empty:': + return () => (0, static_1.empty)(); + default: + const hostSource = this._host.createSourceFromUrl(url, context); + if (!hostSource) { + throw new UnknownUrlSourceProtocol(url.toString()); + } + return hostSource; + } + } + executePostTasks() { + const executors = new Map(); + const taskObservable = (0, rxjs_1.from)(this._taskSchedulers).pipe((0, operators_1.concatMap)((scheduler) => scheduler.finalize()), (0, operators_1.concatMap)((task) => { + const { name, options } = task.configuration; + const executor = executors.get(name); + if (executor) { + return executor(options, task.context); + } + return this._host.createTaskExecutor(name).pipe((0, operators_1.concatMap)((executor) => { + executors.set(name, executor); + return executor(options, task.context); + })); + })); + return taskObservable; + } +} +exports.SchematicEngine = SchematicEngine; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.d.ts new file mode 100644 index 00000000..666c8c40 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.d.ts @@ -0,0 +1,10 @@ +/** + * @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 + */ +export * from './engine'; +export * from './interface'; +export * from './schematic'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.js new file mode 100644 index 00000000..c2ca0f07 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/index.js @@ -0,0 +1,22 @@ +"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 __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./engine"), exports); +__exportStar(require("./interface"), exports); +__exportStar(require("./schematic"), exports); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.d.ts new file mode 100644 index 00000000..790cfbfb --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.d.ts @@ -0,0 +1,157 @@ +/** + * @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 + */ +/// +import { analytics, logging } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { Url } from 'url'; +import { FileEntry, MergeStrategy, Tree } from '../tree/interface'; +import { Workflow } from '../workflow/interface'; +export interface TaskConfiguration { + name: string; + dependencies?: Array; + options?: T; +} +export interface TaskConfigurationGenerator { + toConfiguration(): TaskConfiguration; +} +export declare type TaskExecutor = (options: T | undefined, context: SchematicContext) => Promise | Observable; +export interface TaskExecutorFactory { + readonly name: string; + create(options?: T): Promise | Observable; +} +export interface TaskId { + readonly id: number; +} +export interface TaskInfo { + readonly id: number; + readonly priority: number; + readonly configuration: TaskConfiguration; + readonly context: SchematicContext; +} +export interface ExecutionOptions { + scope: string; + interactive: boolean; +} +/** + * The description (metadata) of a collection. This type contains every information the engine + * needs to run. The CollectionMetadataT type parameter contains additional metadata that you + * want to store while remaining type-safe. + */ +export declare type CollectionDescription = CollectionMetadataT & { + readonly name: string; + readonly extends?: string[]; +}; +/** + * The description (metadata) of a schematic. This type contains every information the engine + * needs to run. The SchematicMetadataT and CollectionMetadataT type parameters contain additional + * metadata that you want to store while remaining type-safe. + */ +export declare type SchematicDescription = SchematicMetadataT & { + readonly collection: CollectionDescription; + readonly name: string; + readonly private?: boolean; + readonly hidden?: boolean; +}; +/** + * The Host for the Engine. Specifically, the piece of the tooling responsible for resolving + * collections and schematics descriptions. The SchematicMetadataT and CollectionMetadataT type + * parameters contain additional metadata that you want to store while remaining type-safe. + */ +export interface EngineHost { + createCollectionDescription(name: string, requester?: CollectionDescription): CollectionDescription; + listSchematicNames(collection: CollectionDescription): string[]; + createSchematicDescription(name: string, collection: CollectionDescription): SchematicDescription | null; + getSchematicRuleFactory(schematic: SchematicDescription, collection: CollectionDescription): RuleFactory; + createSourceFromUrl(url: Url, context: TypedSchematicContext): Source | null; + transformOptions(schematic: SchematicDescription, options: OptionT, context?: TypedSchematicContext): Observable; + transformContext(context: TypedSchematicContext): TypedSchematicContext | void; + createTaskExecutor(name: string): Observable; + hasTaskExecutor(name: string): boolean; + readonly defaultMergeStrategy?: MergeStrategy; +} +/** + * The root Engine for creating and running schematics and collections. Everything related to + * a schematic execution starts from this interface. + * + * CollectionMetadataT is, by default, a generic Collection metadata type. This is used throughout + * the engine typings so that you can use a type that's merged into descriptions, while being + * type-safe. + * + * SchematicMetadataT is a type that contains additional typing for the Schematic Description. + */ +export interface Engine { + createCollection(name: string, requester?: Collection): Collection; + createContext(schematic: Schematic, parent?: Partial>, executionOptions?: Partial): TypedSchematicContext; + createSchematic(name: string, collection: Collection): Schematic; + createSourceFromUrl(url: Url, context: TypedSchematicContext): Source; + transformOptions(schematic: Schematic, options: OptionT, context?: TypedSchematicContext): Observable; + executePostTasks(): Observable; + readonly defaultMergeStrategy: MergeStrategy; + readonly workflow: Workflow | null; +} +/** + * A Collection as created by the Engine. This should be used by the tool to create schematics, + * or by rules to create other schematics as well. + */ +export interface Collection { + readonly description: CollectionDescription; + readonly baseDescriptions?: Array>; + createSchematic(name: string, allowPrivate?: boolean): Schematic; + listSchematicNames(): string[]; +} +/** + * A Schematic as created by the Engine. This should be used by the tool to execute the main + * schematics, or by rules to execute other schematics as well. + */ +export interface Schematic { + readonly description: SchematicDescription; + readonly collection: Collection; + call(options: OptionT, host: Observable, parentContext?: Partial>, executionOptions?: Partial): Observable; +} +/** + * A SchematicContext. Contains information necessary for Schematics to execute some rules, for + * example when using another schematics, as we need the engine and collection. + */ +export interface TypedSchematicContext { + readonly debug: boolean; + readonly engine: Engine; + readonly logger: logging.LoggerApi; + readonly schematic: Schematic; + readonly strategy: MergeStrategy; + readonly interactive: boolean; + addTask(task: TaskConfigurationGenerator, dependencies?: Array): TaskId; + /** @deprecated since version 11 - as it's unused. */ + readonly analytics?: analytics.Analytics; +} +/** + * This is used by the Schematics implementations in order to avoid needing to have typing from + * the tooling. Schematics are not specific to a tool. + */ +export declare type SchematicContext = TypedSchematicContext<{}, {}>; +/** + * A rule factory, which is normally the way schematics are implemented. Returned by the tooling + * after loading a schematic description. + */ +export declare type RuleFactory = (options: T) => Rule; +/** + * A FileOperator applies changes synchronously to a FileEntry. An async operator returns + * asynchronously. We separate them so that the type system can catch early errors. + */ +export declare type FileOperator = (entry: FileEntry) => FileEntry | null; +export declare type AsyncFileOperator = (tree: FileEntry) => Observable; +/** + * A source is a function that generates a Tree from a specific context. A rule transforms a tree + * into another tree from a specific context. In both cases, an Observable can be returned if + * the source or the rule are asynchronous. Only the last Tree generated in the observable will + * be used though. + * + * We obfuscate the context of Source and Rule because the schematic implementation should not + * know which types is the schematic or collection metadata, as they are both tooling specific. + */ +export declare type Source = (context: SchematicContext) => Tree | Observable; +export declare type Rule = (tree: Tree, context: SchematicContext) => Tree | Observable | Rule | Promise | void; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.js new file mode 100644 index 00000000..b599b96d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/interface.js @@ -0,0 +1,9 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.d.ts new file mode 100644 index 00000000..718b6849 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.d.ts @@ -0,0 +1,24 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { Tree } from '../tree/interface'; +import { Collection, Engine, ExecutionOptions, RuleFactory, Schematic, SchematicDescription, TypedSchematicContext } from './interface'; +export declare class InvalidSchematicsNameException extends BaseException { + constructor(name: string); +} +export declare class SchematicImpl implements Schematic { + private _description; + private _factory; + private _collection; + private _engine; + constructor(_description: SchematicDescription, _factory: RuleFactory<{}>, _collection: Collection, _engine: Engine); + get description(): SchematicDescription; + get collection(): Collection; + call(options: OptionT, host: Observable, parentContext?: Partial>, executionOptions?: Partial): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.js new file mode 100644 index 00000000..2b33c2f5 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/engine/schematic.js @@ -0,0 +1,67 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchematicImpl = exports.InvalidSchematicsNameException = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const call_1 = require("../rules/call"); +const scoped_1 = require("../tree/scoped"); +class InvalidSchematicsNameException extends core_1.BaseException { + constructor(name) { + super(`Schematics has invalid name: "${name}".`); + } +} +exports.InvalidSchematicsNameException = InvalidSchematicsNameException; +class SchematicImpl { + constructor(_description, _factory, _collection, _engine) { + this._description = _description; + this._factory = _factory; + this._collection = _collection; + this._engine = _engine; + if (!_description.name.match(/^[-@/_.a-zA-Z0-9]+$/)) { + throw new InvalidSchematicsNameException(_description.name); + } + } + get description() { + return this._description; + } + get collection() { + return this._collection; + } + call(options, host, parentContext, executionOptions) { + const context = this._engine.createContext(this, parentContext, executionOptions); + return host.pipe((0, operators_1.first)(), (0, operators_1.concatMap)((tree) => this._engine + .transformOptions(this, options, context) + .pipe((0, operators_1.map)((o) => [tree, o]))), (0, operators_1.concatMap)(([tree, transformedOptions]) => { + let input; + let scoped = false; + if (executionOptions && executionOptions.scope) { + scoped = true; + input = new scoped_1.ScopedTree(tree, executionOptions.scope); + } + else { + input = tree; + } + return (0, call_1.callRule)(this._factory(transformedOptions), (0, rxjs_1.of)(input), context).pipe((0, operators_1.map)((output) => { + if (output === input) { + return tree; + } + else if (scoped) { + tree.merge(output); + return tree; + } + else { + return output; + } + })); + })); + } +} +exports.SchematicImpl = SchematicImpl; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.d.ts new file mode 100644 index 00000000..269b0e0d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.d.ts @@ -0,0 +1,31 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +export declare class SchematicsException extends BaseException { +} +export declare class FileDoesNotExistException extends BaseException { + constructor(path: string); +} +export declare class FileAlreadyExistException extends BaseException { + constructor(path: string); +} +export declare class ContentHasMutatedException extends BaseException { + constructor(path: string); +} +export declare class InvalidUpdateRecordException extends BaseException { + constructor(); +} +export declare class MergeConflictException extends BaseException { + constructor(path: string); +} +export declare class UnsuccessfulWorkflowExecution extends BaseException { + constructor(); +} +export declare class UnimplementedException extends BaseException { + constructor(); +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.js new file mode 100644 index 00000000..b04bc343 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/exception/exception.js @@ -0,0 +1,58 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnimplementedException = exports.UnsuccessfulWorkflowExecution = exports.MergeConflictException = exports.InvalidUpdateRecordException = exports.ContentHasMutatedException = exports.FileAlreadyExistException = exports.FileDoesNotExistException = exports.SchematicsException = void 0; +const core_1 = require("@angular-devkit/core"); +// Used by schematics to throw exceptions. +class SchematicsException extends core_1.BaseException { +} +exports.SchematicsException = SchematicsException; +// Exceptions +class FileDoesNotExistException extends core_1.BaseException { + constructor(path) { + super(`Path "${path}" does not exist.`); + } +} +exports.FileDoesNotExistException = FileDoesNotExistException; +class FileAlreadyExistException extends core_1.BaseException { + constructor(path) { + super(`Path "${path}" already exist.`); + } +} +exports.FileAlreadyExistException = FileAlreadyExistException; +class ContentHasMutatedException extends core_1.BaseException { + constructor(path) { + super(`Content at path "${path}" has changed between the start and the end of an update.`); + } +} +exports.ContentHasMutatedException = ContentHasMutatedException; +class InvalidUpdateRecordException extends core_1.BaseException { + constructor() { + super(`Invalid record instance.`); + } +} +exports.InvalidUpdateRecordException = InvalidUpdateRecordException; +class MergeConflictException extends core_1.BaseException { + constructor(path) { + super(`A merge conflicted on path "${path}".`); + } +} +exports.MergeConflictException = MergeConflictException; +class UnsuccessfulWorkflowExecution extends core_1.BaseException { + constructor() { + super('Workflow did not execute successfully.'); + } +} +exports.UnsuccessfulWorkflowExecution = UnsuccessfulWorkflowExecution; +class UnimplementedException extends core_1.BaseException { + constructor() { + super('This function is unimplemented.'); + } +} +exports.UnimplementedException = UnimplementedException; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.d.ts new file mode 100644 index 00000000..88952600 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.d.ts @@ -0,0 +1,10 @@ +/** + * @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 + */ +import { JsonObject, JsonValue, schema } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +export declare function formatValidator(data: JsonValue, dataSchema: JsonObject, formats: schema.SchemaFormat[]): Observable; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.js new file mode 100644 index 00000000..208e1d14 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/format-validator.js @@ -0,0 +1,20 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatValidator = void 0; +const core_1 = require("@angular-devkit/core"); +const operators_1 = require("rxjs/operators"); +function formatValidator(data, dataSchema, formats) { + const registry = new core_1.schema.CoreSchemaRegistry(); + for (const format of formats) { + registry.addFormat(format); + } + return registry.compile(dataSchema).pipe((0, operators_1.mergeMap)((validator) => validator(data))); +} +exports.formatValidator = formatValidator; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.d.ts new file mode 100644 index 00000000..95616881 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +import { schema } from '@angular-devkit/core'; +export declare const htmlSelectorFormat: schema.SchemaFormat; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.js new file mode 100644 index 00000000..8005c035 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/html-selector.js @@ -0,0 +1,44 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.htmlSelectorFormat = void 0; +// As per https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name +// * Without mandatory `-` as the application prefix will generally cover its inclusion +// * And an allowance for upper alpha characters +// NOTE: This should eventually be broken out into two formats: full and partial (allows for prefix) +const unicodeRanges = [ + [0xc0, 0xd6], + [0xd8, 0xf6], + [0xf8, 0x37d], + [0x37f, 0x1fff], + [0x200c, 0x200d], + [0x203f, 0x2040], + [0x2070, 0x218f], + [0x2c00, 0x2fef], + [0x3001, 0xd7ff], + [0xf900, 0xfdcf], + [0xfdf0, 0xfffd], + [0x10000, 0xeffff], +]; +function isValidElementName(name) { + let regex = '^[a-zA-Z]['; + regex += '-.0-9_a-zA-Z\\u{B7}'; + for (const range of unicodeRanges) { + regex += `\\u{${range[0].toString(16)}}-\\u{${range[1].toString(16)}}`; + } + regex += ']*$'; + return new RegExp(regex, 'u').test(name); +} +exports.htmlSelectorFormat = { + name: 'html-selector', + formatter: { + async: false, + validate: (name) => typeof name === 'string' && isValidElementName(name), + }, +}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.d.ts new file mode 100644 index 00000000..a3b4bd37 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.d.ts @@ -0,0 +1,11 @@ +/** + * @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 + */ +import { schema } from '@angular-devkit/core'; +export { htmlSelectorFormat } from './html-selector'; +export { pathFormat } from './path'; +export declare const standardFormats: schema.SchemaFormat[]; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.js new file mode 100644 index 00000000..1fce3ace --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/index.js @@ -0,0 +1,17 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.standardFormats = exports.pathFormat = exports.htmlSelectorFormat = void 0; +const html_selector_1 = require("./html-selector"); +const path_1 = require("./path"); +var html_selector_2 = require("./html-selector"); +Object.defineProperty(exports, "htmlSelectorFormat", { enumerable: true, get: function () { return html_selector_2.htmlSelectorFormat; } }); +var path_2 = require("./path"); +Object.defineProperty(exports, "pathFormat", { enumerable: true, get: function () { return path_2.pathFormat; } }); +exports.standardFormats = [html_selector_1.htmlSelectorFormat, path_1.pathFormat]; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.d.ts new file mode 100644 index 00000000..9957e37c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +import { schema } from '@angular-devkit/core'; +export declare const pathFormat: schema.SchemaFormat; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.js new file mode 100644 index 00000000..3a9d1240 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/formats/path.js @@ -0,0 +1,24 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pathFormat = void 0; +const core_1 = require("@angular-devkit/core"); +exports.pathFormat = { + name: 'path', + formatter: { + async: false, + validate: (path) => { + // Check path is normalized already. + return path === (0, core_1.normalize)(path); + // TODO: check if path is valid (is that just checking if it's normalized?) + // TODO: check path is from root of schematics even if passed absolute + // TODO: error out if path is outside of host + }, + }, +}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.d.ts new file mode 100644 index 00000000..5d8c7b5a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.d.ts @@ -0,0 +1,41 @@ +/** + * @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 + */ +import * as formats from './formats/index'; +import { FilePredicate, MergeStrategy, Tree as TreeInterface } from './tree/interface'; +import * as workflow from './workflow/index'; +export { SchematicsException } from './exception/exception'; +export * from './tree/action'; +export * from './engine/index'; +export * from './exception/exception'; +export * from './tree/interface'; +export * from './rules/base'; +export * from './rules/call'; +export * from './rules/move'; +export * from './rules/random'; +export * from './rules/schematic'; +export * from './rules/template'; +export * from './rules/url'; +export * from './tree/delegate'; +export * from './tree/empty'; +export * from './tree/host-tree'; +export { UpdateRecorder } from './tree/interface'; +export * from './engine/schematic'; +export * from './sink/dryrun'; +export * from './sink/host'; +export * from './sink/sink'; +export { formats }; +export { workflow }; +export interface TreeConstructor { + empty(): TreeInterface; + branch(tree: TreeInterface): TreeInterface; + merge(tree: TreeInterface, other: TreeInterface, strategy?: MergeStrategy): TreeInterface; + partition(tree: TreeInterface, predicate: FilePredicate): [TreeInterface, TreeInterface]; + optimize(tree: TreeInterface): TreeInterface; +} +export declare type Tree = TreeInterface; +export declare const Tree: TreeConstructor; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.js new file mode 100644 index 00000000..738fbad7 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/index.js @@ -0,0 +1,75 @@ +"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; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Tree = exports.workflow = exports.formats = exports.SchematicsException = void 0; +const formats = __importStar(require("./formats/index")); +exports.formats = formats; +const interface_1 = require("./tree/interface"); +const static_1 = require("./tree/static"); +const workflow = __importStar(require("./workflow/index")); +exports.workflow = workflow; +var exception_1 = require("./exception/exception"); +Object.defineProperty(exports, "SchematicsException", { enumerable: true, get: function () { return exception_1.SchematicsException; } }); +__exportStar(require("./tree/action"), exports); +__exportStar(require("./engine/index"), exports); +__exportStar(require("./exception/exception"), exports); +__exportStar(require("./tree/interface"), exports); +__exportStar(require("./rules/base"), exports); +__exportStar(require("./rules/call"), exports); +__exportStar(require("./rules/move"), exports); +__exportStar(require("./rules/random"), exports); +__exportStar(require("./rules/schematic"), exports); +__exportStar(require("./rules/template"), exports); +__exportStar(require("./rules/url"), exports); +__exportStar(require("./tree/delegate"), exports); +__exportStar(require("./tree/empty"), exports); +__exportStar(require("./tree/host-tree"), exports); +__exportStar(require("./engine/schematic"), exports); +__exportStar(require("./sink/dryrun"), exports); +__exportStar(require("./sink/host"), exports); +__exportStar(require("./sink/sink"), exports); +exports.Tree = { + empty() { + return (0, static_1.empty)(); + }, + branch(tree) { + return (0, static_1.branch)(tree); + }, + merge(tree, other, strategy = interface_1.MergeStrategy.Default) { + return (0, static_1.merge)(tree, other, strategy); + }, + partition(tree, predicate) { + return (0, static_1.partition)(tree, predicate); + }, + optimize(tree) { + return tree; + }, +}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.d.ts new file mode 100644 index 00000000..f78b3895 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.d.ts @@ -0,0 +1,38 @@ +/** + * @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 + */ +import { FileOperator, Rule, Source } from '../engine/interface'; +import { FilePredicate, MergeStrategy, Tree } from '../tree/interface'; +/** + * A Source that returns an tree as its single value. + */ +export declare function source(tree: Tree): Source; +/** + * A source that returns an empty tree. + */ +export declare function empty(): Source; +/** + * Chain multiple rules into a single rule. + */ +export declare function chain(rules: Rule[]): Rule; +/** + * Apply multiple rules to a source, and returns the source transformed. + */ +export declare function apply(source: Source, rules: Rule[]): Source; +/** + * Merge an input tree with the source passed in. + */ +export declare function mergeWith(source: Source, strategy?: MergeStrategy): Rule; +export declare function noop(): Rule; +export declare function filter(predicate: FilePredicate): Rule; +export declare function asSource(rule: Rule): Source; +export declare function branchAndMerge(rule: Rule, strategy?: MergeStrategy): Rule; +export declare function when(predicate: FilePredicate, operator: FileOperator): FileOperator; +export declare function partitionApplyMerge(predicate: FilePredicate, ruleYes: Rule, ruleNo?: Rule): Rule; +export declare function forEach(operator: FileOperator): Rule; +export declare function composeFileOperators(operators: FileOperator[]): FileOperator; +export declare function applyToSubtree(path: string, rules: Rule[]): Rule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.js new file mode 100644 index 00000000..fdcae77a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/base.js @@ -0,0 +1,155 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyToSubtree = exports.composeFileOperators = exports.forEach = exports.partitionApplyMerge = exports.when = exports.branchAndMerge = exports.asSource = exports.filter = exports.noop = exports.mergeWith = exports.apply = exports.chain = exports.empty = exports.source = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const exception_1 = require("../exception/exception"); +const host_tree_1 = require("../tree/host-tree"); +const interface_1 = require("../tree/interface"); +const scoped_1 = require("../tree/scoped"); +const static_1 = require("../tree/static"); +const call_1 = require("./call"); +/** + * A Source that returns an tree as its single value. + */ +function source(tree) { + return () => tree; +} +exports.source = source; +/** + * A source that returns an empty tree. + */ +function empty() { + return () => (0, static_1.empty)(); +} +exports.empty = empty; +/** + * Chain multiple rules into a single rule. + */ +function chain(rules) { + return (tree, context) => { + return rules.reduce((acc, curr) => (0, call_1.callRule)(curr, acc, context), tree); + }; +} +exports.chain = chain; +/** + * Apply multiple rules to a source, and returns the source transformed. + */ +function apply(source, rules) { + return (context) => (0, call_1.callRule)(chain(rules), (0, call_1.callSource)(source, context), context); +} +exports.apply = apply; +/** + * Merge an input tree with the source passed in. + */ +function mergeWith(source, strategy = interface_1.MergeStrategy.Default) { + return (tree, context) => { + return (0, call_1.callSource)(source, context).pipe((0, operators_1.map)((sourceTree) => tree.merge(sourceTree, strategy || context.strategy)), (0, operators_1.mapTo)(tree)); + }; +} +exports.mergeWith = mergeWith; +function noop() { + return () => { }; +} +exports.noop = noop; +function filter(predicate) { + return (tree) => { + if (host_tree_1.HostTree.isHostTree(tree)) { + return new host_tree_1.FilterHostTree(tree, predicate); + } + else { + throw new exception_1.SchematicsException('Tree type is not supported.'); + } + }; +} +exports.filter = filter; +function asSource(rule) { + return (context) => (0, call_1.callRule)(rule, (0, static_1.empty)(), context); +} +exports.asSource = asSource; +function branchAndMerge(rule, strategy = interface_1.MergeStrategy.Default) { + return (tree, context) => { + return (0, call_1.callRule)(rule, tree.branch(), context).pipe((0, operators_1.map)((branch) => tree.merge(branch, strategy || context.strategy)), (0, operators_1.mapTo)(tree)); + }; +} +exports.branchAndMerge = branchAndMerge; +function when(predicate, operator) { + return (entry) => { + if (predicate(entry.path, entry)) { + return operator(entry); + } + else { + return entry; + } + }; +} +exports.when = when; +function partitionApplyMerge(predicate, ruleYes, ruleNo) { + return (tree, context) => { + const [yes, no] = (0, static_1.partition)(tree, predicate); + return (0, rxjs_1.concat)((0, call_1.callRule)(ruleYes, yes, context), (0, call_1.callRule)(ruleNo || noop(), no, context)).pipe((0, operators_1.toArray)(), (0, operators_1.map)(([yesTree, noTree]) => { + yesTree.merge(noTree, context.strategy); + return yesTree; + })); + }; +} +exports.partitionApplyMerge = partitionApplyMerge; +function forEach(operator) { + return (tree) => { + tree.visit((path, entry) => { + if (!entry) { + return; + } + const newEntry = operator(entry); + if (newEntry === entry) { + return; + } + if (newEntry === null) { + tree.delete(path); + return; + } + if (newEntry.path != path) { + tree.rename(path, newEntry.path); + } + if (!newEntry.content.equals(entry.content)) { + tree.overwrite(newEntry.path, newEntry.content); + } + }); + }; +} +exports.forEach = forEach; +function composeFileOperators(operators) { + return (entry) => { + let current = entry; + for (const op of operators) { + current = op(current); + if (current === null) { + // Deleted, just return. + return null; + } + } + return current; + }; +} +exports.composeFileOperators = composeFileOperators; +function applyToSubtree(path, rules) { + return (tree, context) => { + const scoped = new scoped_1.ScopedTree(tree, path); + return (0, call_1.callRule)(chain(rules), scoped, context).pipe((0, operators_1.map)((result) => { + if (result === scoped) { + return tree; + } + else { + throw new exception_1.SchematicsException('Original tree must be returned from all rules when using "applyToSubtree".'); + } + })); + }; +} +exports.applyToSubtree = applyToSubtree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.d.ts new file mode 100644 index 00000000..b978109a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.d.ts @@ -0,0 +1,22 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { Rule, SchematicContext, Source } from '../engine/interface'; +import { Tree } from '../tree/interface'; +/** + * When a rule or source returns an invalid value. + */ +export declare class InvalidRuleResultException extends BaseException { + constructor(value?: {}); +} +export declare class InvalidSourceResultException extends BaseException { + constructor(value?: {}); +} +export declare function callSource(source: Source, context: SchematicContext): Observable; +export declare function callRule(rule: Rule, input: Tree | Observable, context: SchematicContext): Observable; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.js new file mode 100644 index 00000000..caeb25ad --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/call.js @@ -0,0 +1,110 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callRule = exports.callSource = exports.InvalidSourceResultException = exports.InvalidRuleResultException = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const interface_1 = require("../tree/interface"); +function _getTypeOfResult(value) { + if (value === undefined) { + return 'undefined'; + } + else if (value === null) { + return 'null'; + } + else if (typeof value == 'function') { + return `Function()`; + } + else if (typeof value != 'object') { + return `${typeof value}(${JSON.stringify(value)})`; + } + else { + if (Object.getPrototypeOf(value) == Object) { + return `Object(${JSON.stringify(value)})`; + } + else if (value.constructor) { + return `Instance of class ${value.constructor.name}`; + } + else { + return 'Unknown Object'; + } + } +} +/** + * When a rule or source returns an invalid value. + */ +class InvalidRuleResultException extends core_1.BaseException { + constructor(value) { + super(`Invalid rule result: ${_getTypeOfResult(value)}.`); + } +} +exports.InvalidRuleResultException = InvalidRuleResultException; +class InvalidSourceResultException extends core_1.BaseException { + constructor(value) { + super(`Invalid source result: ${_getTypeOfResult(value)}.`); + } +} +exports.InvalidSourceResultException = InvalidSourceResultException; +function callSource(source, context) { + const result = source(context); + if ((0, rxjs_1.isObservable)(result)) { + // Only return the last Tree, and make sure it's a Tree. + return result.pipe((0, operators_1.defaultIfEmpty)(), (0, operators_1.last)(), (0, operators_1.tap)((inner) => { + if (!inner || !(interface_1.TreeSymbol in inner)) { + throw new InvalidSourceResultException(inner); + } + })); + } + else if (result && interface_1.TreeSymbol in result) { + return (0, rxjs_1.of)(result); + } + else { + return (0, rxjs_1.throwError)(new InvalidSourceResultException(result)); + } +} +exports.callSource = callSource; +function callRule(rule, input, context) { + return ((0, rxjs_1.isObservable)(input) ? input : (0, rxjs_1.of)(input)).pipe((0, operators_1.mergeMap)((inputTree) => { + const result = rule(inputTree, context); + if (!result) { + return (0, rxjs_1.of)(inputTree); + } + else if (typeof result == 'function') { + // This is considered a Rule, chain the rule and return its output. + return callRule(result, inputTree, context); + } + else if ((0, rxjs_1.isObservable)(result)) { + // Only return the last Tree, and make sure it's a Tree. + return result.pipe((0, operators_1.defaultIfEmpty)(), (0, operators_1.last)(), (0, operators_1.tap)((inner) => { + if (!inner || !(interface_1.TreeSymbol in inner)) { + throw new InvalidRuleResultException(inner); + } + })); + } + else if ((0, core_1.isPromise)(result)) { + return (0, rxjs_1.from)(result).pipe((0, operators_1.mergeMap)((inner) => { + if (typeof inner === 'function') { + // This is considered a Rule, chain the rule and return its output. + return callRule(inner, inputTree, context); + } + else { + return (0, rxjs_1.of)(inputTree); + } + })); + } + else if (interface_1.TreeSymbol in result) { + return (0, rxjs_1.of)(result); + } + else { + return (0, rxjs_1.throwError)(new InvalidRuleResultException(result)); + } + })); +} +exports.callRule = callRule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.d.ts new file mode 100644 index 00000000..16687aa6 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +import { Rule } from '../engine/interface'; +export declare function move(from: string, to?: string): Rule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.js new file mode 100644 index 00000000..6a2f7f08 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/move.js @@ -0,0 +1,37 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.move = void 0; +const core_1 = require("@angular-devkit/core"); +const base_1 = require("./base"); +function move(from, to) { + if (to === undefined) { + to = from; + from = '/'; + } + const fromPath = (0, core_1.normalize)('/' + from); + const toPath = (0, core_1.normalize)('/' + to); + if (fromPath === toPath) { + return base_1.noop; + } + return (tree) => { + if (tree.exists(fromPath)) { + // fromPath is a file + tree.rename(fromPath, toPath); + } + else { + // fromPath is a directory + tree.getDir(fromPath).visit((path) => { + tree.rename(path, (0, core_1.join)(toPath, path.substr(fromPath.length))); + }); + } + return tree; + }; +} +exports.move = move; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.d.ts new file mode 100644 index 00000000..0abc730f --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.d.ts @@ -0,0 +1,14 @@ +/** + * @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 + */ +import { Source } from '../engine/interface'; +export interface RandomOptions { + root?: string; + multi?: boolean | number; + multiFiles?: boolean | number; +} +export default function (options: RandomOptions): Source; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.js new file mode 100644 index 00000000..b0ec3fb7 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/random.js @@ -0,0 +1,40 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const host_tree_1 = require("../tree/host-tree"); +function generateStringOfLength(l) { + return new Array(l) + .fill(0) + .map((_x) => { + return 'abcdefghijklmnopqrstuvwxyz'[Math.floor(Math.random() * 26)]; + }) + .join(''); +} +function random(from, to) { + return Math.floor(Math.random() * (to - from)) + from; +} +function default_1(options) { + return () => { + const root = 'root' in options ? options.root : '/'; + const map = new host_tree_1.HostTree(); + const nbFiles = 'multiFiles' in options + ? typeof options.multiFiles == 'number' + ? options.multiFiles + : random(2, 12) + : 1; + for (let i = 0; i < nbFiles; i++) { + const path = 'a/b/c/d/e/f'.slice(Math.random() * 10); + const fileName = generateStringOfLength(20); + const content = generateStringOfLength(100); + map.create(root + '/' + path + '/' + fileName, content); + } + return map; + }; +} +exports.default = default_1; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.d.ts new file mode 100644 index 00000000..75e8e42e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.d.ts @@ -0,0 +1,10 @@ +/** + * @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 + */ +import { Rule } from '../engine/interface'; +import { FilePredicate } from '../tree/interface'; +export declare function rename(match: FilePredicate, to: FilePredicate): Rule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.js new file mode 100644 index 00000000..a02a96d1 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/rename.js @@ -0,0 +1,26 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rename = void 0; +const core_1 = require("@angular-devkit/core"); +const base_1 = require("./base"); +function rename(match, to) { + return (0, base_1.forEach)((entry) => { + if (match(entry.path, entry)) { + return { + content: entry.content, + path: (0, core_1.normalize)(to(entry.path, entry)), + }; + } + else { + return entry; + } + }); +} +exports.rename = rename; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.d.ts new file mode 100644 index 00000000..c840fb9c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.d.ts @@ -0,0 +1,23 @@ +/** + * @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 + */ +import { ExecutionOptions, Rule } from '../engine/interface'; +/** + * Run a schematic from a separate collection. + * + * @param collectionName The name of the collection that contains the schematic to run. + * @param schematicName The name of the schematic to run. + * @param options The options to pass as input to the RuleFactory. + */ +export declare function externalSchematic(collectionName: string, schematicName: string, options: OptionT, executionOptions?: Partial): Rule; +/** + * Run a schematic from the same collection. + * + * @param schematicName The name of the schematic to run. + * @param options The options to pass as input to the RuleFactory. + */ +export declare function schematic(schematicName: string, options: OptionT, executionOptions?: Partial): Rule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.js new file mode 100644 index 00000000..01f69a4e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/schematic.js @@ -0,0 +1,51 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.schematic = exports.externalSchematic = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const interface_1 = require("../tree/interface"); +const static_1 = require("../tree/static"); +/** + * Run a schematic from a separate collection. + * + * @param collectionName The name of the collection that contains the schematic to run. + * @param schematicName The name of the schematic to run. + * @param options The options to pass as input to the RuleFactory. + */ +function externalSchematic(collectionName, schematicName, options, executionOptions) { + return (input, context) => { + const collection = context.engine.createCollection(collectionName, context.schematic.collection); + const schematic = collection.createSchematic(schematicName); + return schematic.call(options, (0, rxjs_1.of)((0, static_1.branch)(input)), context, executionOptions).pipe((0, operators_1.last)(), (0, operators_1.map)((x) => { + input.merge(x, interface_1.MergeStrategy.AllowOverwriteConflict); + return input; + })); + }; +} +exports.externalSchematic = externalSchematic; +/** + * Run a schematic from the same collection. + * + * @param schematicName The name of the schematic to run. + * @param options The options to pass as input to the RuleFactory. + */ +function schematic(schematicName, options, executionOptions) { + return (input, context) => { + const collection = context.schematic.collection; + const schematic = collection.createSchematic(schematicName, true); + return schematic.call(options, (0, rxjs_1.of)((0, static_1.branch)(input)), context, executionOptions).pipe((0, operators_1.last)(), (0, operators_1.map)((x) => { + // We allow overwrite conflict here because they're the only merge conflict we particularly + // don't want to deal with; the input tree might have an OVERWRITE which the sub + input.merge(x, interface_1.MergeStrategy.AllowOverwriteConflict); + return input; + })); + }; +} +exports.schematic = schematic; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.d.ts new file mode 100644 index 00000000..45335160 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.d.ts @@ -0,0 +1,39 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +import { FileOperator, Rule } from '../engine/interface'; +export declare const TEMPLATE_FILENAME_RE: RegExp; +export declare class OptionIsNotDefinedException extends BaseException { + constructor(name: string); +} +export declare class UnknownPipeException extends BaseException { + constructor(name: string); +} +export declare class InvalidPipeException extends BaseException { + constructor(name: string); +} +export declare type PathTemplateValue = boolean | string | number | undefined; +export declare type PathTemplatePipeFunction = (x: string) => PathTemplateValue; +export declare type PathTemplateData = { + [key: string]: PathTemplateValue | PathTemplateData | PathTemplatePipeFunction; +}; +export interface PathTemplateOptions { + interpolationStart: string; + interpolationEnd: string; + pipeSeparator?: string; +} +export declare function applyContentTemplate(options: T): FileOperator; +export declare function contentTemplate(options: T): Rule; +export declare function applyPathTemplate(data: T, options?: PathTemplateOptions): FileOperator; +export declare function pathTemplate(options: T): Rule; +/** + * Remove every `.template` suffix from file names. + */ +export declare function renameTemplateFiles(): Rule; +export declare function template(options: T): Rule; +export declare function applyTemplates(options: T): Rule; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.js new file mode 100644 index 00000000..8fc87bc2 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/template.js @@ -0,0 +1,151 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyTemplates = exports.template = exports.renameTemplateFiles = exports.pathTemplate = exports.applyPathTemplate = exports.contentTemplate = exports.applyContentTemplate = exports.InvalidPipeException = exports.UnknownPipeException = exports.OptionIsNotDefinedException = exports.TEMPLATE_FILENAME_RE = void 0; +const core_1 = require("@angular-devkit/core"); +const util_1 = require("util"); +const base_1 = require("./base"); +const rename_1 = require("./rename"); +exports.TEMPLATE_FILENAME_RE = /\.template$/; +class OptionIsNotDefinedException extends core_1.BaseException { + constructor(name) { + super(`Option "${name}" is not defined.`); + } +} +exports.OptionIsNotDefinedException = OptionIsNotDefinedException; +class UnknownPipeException extends core_1.BaseException { + constructor(name) { + super(`Pipe "${name}" is not defined.`); + } +} +exports.UnknownPipeException = UnknownPipeException; +class InvalidPipeException extends core_1.BaseException { + constructor(name) { + super(`Pipe "${name}" is invalid.`); + } +} +exports.InvalidPipeException = InvalidPipeException; +const decoder = new util_1.TextDecoder('utf-8', { fatal: true }); +function applyContentTemplate(options) { + return (entry) => { + const { path, content } = entry; + try { + const decodedContent = decoder.decode(content); + return { + path, + content: Buffer.from((0, core_1.template)(decodedContent, {})(options)), + }; + } + catch (e) { + if (e.code === 'ERR_ENCODING_INVALID_ENCODED_DATA') { + return entry; + } + throw e; + } + }; +} +exports.applyContentTemplate = applyContentTemplate; +function contentTemplate(options) { + return (0, base_1.forEach)(applyContentTemplate(options)); +} +exports.contentTemplate = contentTemplate; +function applyPathTemplate(data, options = { + interpolationStart: '__', + interpolationEnd: '__', + pipeSeparator: '@', +}) { + const is = options.interpolationStart; + const ie = options.interpolationEnd; + const isL = is.length; + const ieL = ie.length; + return (entry) => { + let path = entry.path; + const content = entry.content; + const original = path; + let start = path.indexOf(is); + // + 1 to have at least a length 1 name. `____` is not valid. + let end = path.indexOf(ie, start + isL + 1); + while (start != -1 && end != -1) { + const match = path.substring(start + isL, end); + let replacement = data[match]; + if (!options.pipeSeparator) { + if (typeof replacement == 'function') { + replacement = replacement.call(data, original); + } + if (replacement === undefined) { + throw new OptionIsNotDefinedException(match); + } + } + else { + const [name, ...pipes] = match.split(options.pipeSeparator); + replacement = data[name]; + if (typeof replacement == 'function') { + replacement = replacement.call(data, original); + } + if (replacement === undefined) { + throw new OptionIsNotDefinedException(name); + } + replacement = pipes.reduce((acc, pipe) => { + if (!pipe) { + return acc; + } + if (!(pipe in data)) { + throw new UnknownPipeException(pipe); + } + if (typeof data[pipe] != 'function') { + throw new InvalidPipeException(pipe); + } + // Coerce to string. + return '' + data[pipe](acc); + }, '' + replacement); + } + path = path.substring(0, start) + replacement + path.substring(end + ieL); + start = path.indexOf(options.interpolationStart); + // See above. + end = path.indexOf(options.interpolationEnd, start + isL + 1); + } + return { path: (0, core_1.normalize)(path), content }; + }; +} +exports.applyPathTemplate = applyPathTemplate; +function pathTemplate(options) { + return (0, base_1.forEach)(applyPathTemplate(options)); +} +exports.pathTemplate = pathTemplate; +/** + * Remove every `.template` suffix from file names. + */ +function renameTemplateFiles() { + return (0, rename_1.rename)((path) => !!path.match(exports.TEMPLATE_FILENAME_RE), (path) => path.replace(exports.TEMPLATE_FILENAME_RE, '')); +} +exports.renameTemplateFiles = renameTemplateFiles; +function template(options) { + return (0, base_1.chain)([ + contentTemplate(options), + // Force cast to PathTemplateData. We need the type for the actual pathTemplate() call, + // but in this case we cannot do anything as contentTemplate are more permissive. + // Since values are coerced to strings in PathTemplates it will be fine in the end. + pathTemplate(options), + ]); +} +exports.template = template; +function applyTemplates(options) { + return (0, base_1.forEach)((0, base_1.when)((path) => path.endsWith('.template'), (0, base_1.composeFileOperators)([ + applyContentTemplate(options), + // See above for this weird cast. + applyPathTemplate(options), + (entry) => { + return { + content: entry.content, + path: entry.path.replace(exports.TEMPLATE_FILENAME_RE, ''), + }; + }, + ]))); +} +exports.applyTemplates = applyTemplates; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.d.ts new file mode 100644 index 00000000..d56462f3 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +import { Source } from '../engine/interface'; +export declare function url(urlString: string): Source; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.js new file mode 100644 index 00000000..4328f74e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/rules/url.js @@ -0,0 +1,16 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.url = void 0; +const url_1 = require("url"); +function url(urlString) { + const url = (0, url_1.parse)(urlString); + return (context) => context.engine.createSourceFromUrl(url, context)(context); +} +exports.url = url; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.d.ts new file mode 100644 index 00000000..bb7ab7d1 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.d.ts @@ -0,0 +1,50 @@ +/** + * @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 + */ +/// +import { virtualFs } from '@angular-devkit/core'; +import { Observable, Subject } from 'rxjs'; +import { HostSink } from './host'; +export interface DryRunErrorEvent { + kind: 'error'; + description: 'alreadyExist' | 'doesNotExist'; + path: string; +} +export interface DryRunDeleteEvent { + kind: 'delete'; + path: string; +} +export interface DryRunCreateEvent { + kind: 'create'; + path: string; + content: Buffer; +} +export interface DryRunUpdateEvent { + kind: 'update'; + path: string; + content: Buffer; +} +export interface DryRunRenameEvent { + kind: 'rename'; + path: string; + to: string; +} +export declare type DryRunEvent = DryRunErrorEvent | DryRunDeleteEvent | DryRunCreateEvent | DryRunUpdateEvent | DryRunRenameEvent; +export declare class DryRunSink extends HostSink { + protected _subject: Subject; + protected _fileDoesNotExistExceptionSet: Set; + protected _fileAlreadyExistExceptionSet: Set; + readonly reporter: Observable; + /** + * @param {host} dir The host to use to output. This should be scoped. + * @param {boolean} force Whether to force overwriting files that already exist. + */ + constructor(host: virtualFs.Host, force?: boolean); + protected _fileAlreadyExistException(path: string): void; + protected _fileDoesNotExistException(path: string): void; + _done(): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.js new file mode 100644 index 00000000..7ff91540 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/dryrun.js @@ -0,0 +1,80 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DryRunSink = void 0; +const core_1 = require("@angular-devkit/core"); +const node_1 = require("@angular-devkit/core/node"); +const rxjs_1 = require("rxjs"); +const host_1 = require("./host"); +class DryRunSink extends host_1.HostSink { + constructor(host, force = false) { + super(typeof host == 'string' + ? new core_1.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), (0, core_1.normalize)(host)) + : host, force); + this._subject = new rxjs_1.Subject(); + this._fileDoesNotExistExceptionSet = new Set(); + this._fileAlreadyExistExceptionSet = new Set(); + this.reporter = this._subject.asObservable(); + } + _fileAlreadyExistException(path) { + this._fileAlreadyExistExceptionSet.add(path); + } + _fileDoesNotExistException(path) { + this._fileDoesNotExistExceptionSet.add(path); + } + _done() { + this._fileAlreadyExistExceptionSet.forEach((path) => { + this._subject.next({ + kind: 'error', + description: 'alreadyExist', + path, + }); + }); + this._fileDoesNotExistExceptionSet.forEach((path) => { + this._subject.next({ + kind: 'error', + description: 'doesNotExist', + path, + }); + }); + this._filesToDelete.forEach((path) => { + // Check if this is a renaming. + for (const [from] of this._filesToRename) { + if (from == path) { + // The event is sent later on. + return; + } + } + this._subject.next({ kind: 'delete', path }); + }); + this._filesToRename.forEach(([path, to]) => { + this._subject.next({ kind: 'rename', path, to }); + }); + this._filesToCreate.forEach((content, path) => { + // Check if this is a renaming. + for (const [, to] of this._filesToRename) { + if (to == path) { + // The event is sent later on. + return; + } + } + if (this._fileAlreadyExistExceptionSet.has(path) || + this._fileDoesNotExistExceptionSet.has(path)) { + return; + } + this._subject.next({ kind: 'create', path, content: content.generate() }); + }); + this._filesToUpdate.forEach((content, path) => { + this._subject.next({ kind: 'update', path, content: content.generate() }); + }); + this._subject.complete(); + return (0, rxjs_1.of)(undefined); + } +} +exports.DryRunSink = DryRunSink; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.d.ts new file mode 100644 index 00000000..3f2934c4 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.d.ts @@ -0,0 +1,29 @@ +/** + * @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 + */ +/// +import { Path, virtualFs } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { CreateFileAction } from '../tree/action'; +import { UpdateBufferBase } from '../utility/update-buffer'; +import { SimpleSinkBase } from './sink'; +export declare class HostSink extends SimpleSinkBase { + protected _host: virtualFs.Host; + protected _force: boolean; + protected _filesToDelete: Set; + protected _filesToRename: Set<[Path, Path]>; + protected _filesToCreate: Map; + protected _filesToUpdate: Map; + constructor(_host: virtualFs.Host, _force?: boolean); + protected _validateCreateAction(action: CreateFileAction): Observable; + protected _validateFileExists(p: Path): Observable; + protected _overwriteFile(path: Path, content: Buffer): Observable; + protected _createFile(path: Path, content: Buffer): Observable; + protected _renameFile(from: Path, to: Path): Observable; + protected _deleteFile(path: Path): Observable; + _done(): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.js new file mode 100644 index 00000000..a5bb10b3 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/host.js @@ -0,0 +1,76 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HostSink = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const update_buffer_1 = require("../utility/update-buffer"); +const sink_1 = require("./sink"); +class HostSink extends sink_1.SimpleSinkBase { + constructor(_host, _force = false) { + super(); + this._host = _host; + this._force = _force; + this._filesToDelete = new Set(); + this._filesToRename = new Set(); + this._filesToCreate = new Map(); + this._filesToUpdate = new Map(); + } + _validateCreateAction(action) { + return this._force ? rxjs_1.EMPTY : super._validateCreateAction(action); + } + _validateFileExists(p) { + if (this._filesToCreate.has(p) || this._filesToUpdate.has(p)) { + return (0, rxjs_1.of)(true); + } + if (this._filesToDelete.has(p)) { + return (0, rxjs_1.of)(false); + } + for (const [from, to] of this._filesToRename.values()) { + switch (p) { + case from: + return (0, rxjs_1.of)(false); + case to: + return (0, rxjs_1.of)(true); + } + } + return this._host.exists(p); + } + _overwriteFile(path, content) { + this._filesToUpdate.set(path, update_buffer_1.UpdateBufferBase.create(content)); + return rxjs_1.EMPTY; + } + _createFile(path, content) { + this._filesToCreate.set(path, update_buffer_1.UpdateBufferBase.create(content)); + return rxjs_1.EMPTY; + } + _renameFile(from, to) { + this._filesToRename.add([from, to]); + return rxjs_1.EMPTY; + } + _deleteFile(path) { + if (this._filesToCreate.has(path)) { + this._filesToCreate.delete(path); + this._filesToUpdate.delete(path); + } + else { + this._filesToDelete.add(path); + } + return rxjs_1.EMPTY; + } + _done() { + // Really commit everything to the actual filesystem. + return (0, rxjs_1.concat)((0, rxjs_1.from)([...this._filesToDelete.values()]).pipe((0, operators_1.concatMap)((path) => this._host.delete(path))), (0, rxjs_1.from)([...this._filesToRename.entries()]).pipe((0, operators_1.concatMap)(([_, [path, to]]) => this._host.rename(path, to))), (0, rxjs_1.from)([...this._filesToCreate.entries()]).pipe((0, operators_1.concatMap)(([path, buffer]) => { + return this._host.write(path, buffer.generate()); + })), (0, rxjs_1.from)([...this._filesToUpdate.entries()]).pipe((0, operators_1.concatMap)(([path, buffer]) => { + return this._host.write(path, buffer.generate()); + }))).pipe((0, operators_1.reduce)(() => { })); + } +} +exports.HostSink = HostSink; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.d.ts new file mode 100644 index 00000000..9e441f2a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.d.ts @@ -0,0 +1,35 @@ +/** + * @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 + */ +/// +import { Observable } from 'rxjs'; +import { Action, CreateFileAction, DeleteFileAction, OverwriteFileAction, RenameFileAction } from '../tree/action'; +import { Tree } from '../tree/interface'; +export interface Sink { + commit(tree: Tree): Observable; +} +export declare abstract class SimpleSinkBase implements Sink { + preCommitAction: (action: Action) => void | Action | PromiseLike | Observable; + postCommitAction: (action: Action) => void | Observable; + preCommit: () => void | Observable; + postCommit: () => void | Observable; + protected abstract _validateFileExists(p: string): Observable; + protected abstract _overwriteFile(path: string, content: Buffer): Observable; + protected abstract _createFile(path: string, content: Buffer): Observable; + protected abstract _renameFile(path: string, to: string): Observable; + protected abstract _deleteFile(path: string): Observable; + protected abstract _done(): Observable; + protected _fileAlreadyExistException(path: string): void; + protected _fileDoesNotExistException(path: string): void; + protected _validateOverwriteAction(action: OverwriteFileAction): Observable; + protected _validateCreateAction(action: CreateFileAction): Observable; + protected _validateRenameAction(action: RenameFileAction): Observable; + protected _validateDeleteAction(action: DeleteFileAction): Observable; + validateSingleAction(action: Action): Observable; + commitSingleAction(action: Action): Observable; + commit(tree: Tree): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.js new file mode 100644 index 00000000..80b42052 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/sink/sink.js @@ -0,0 +1,116 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SimpleSinkBase = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const exception_1 = require("../exception/exception"); +const action_1 = require("../tree/action"); +const Noop = function () { }; +class SimpleSinkBase { + constructor() { + this.preCommitAction = Noop; + this.postCommitAction = Noop; + this.preCommit = Noop; + this.postCommit = Noop; + } + _fileAlreadyExistException(path) { + throw new exception_1.FileAlreadyExistException(path); + } + _fileDoesNotExistException(path) { + throw new exception_1.FileDoesNotExistException(path); + } + _validateOverwriteAction(action) { + return this._validateFileExists(action.path).pipe((0, operators_1.map)((b) => { + if (!b) { + this._fileDoesNotExistException(action.path); + } + })); + } + _validateCreateAction(action) { + return this._validateFileExists(action.path).pipe((0, operators_1.map)((b) => { + if (b) { + this._fileAlreadyExistException(action.path); + } + })); + } + _validateRenameAction(action) { + return this._validateFileExists(action.path).pipe((0, operators_1.map)((b) => { + if (!b) { + this._fileDoesNotExistException(action.path); + } + }), (0, operators_1.mergeMap)(() => this._validateFileExists(action.to)), (0, operators_1.map)((b) => { + if (b) { + this._fileAlreadyExistException(action.to); + } + })); + } + _validateDeleteAction(action) { + return this._validateFileExists(action.path).pipe((0, operators_1.map)((b) => { + if (!b) { + this._fileDoesNotExistException(action.path); + } + })); + } + validateSingleAction(action) { + switch (action.kind) { + case 'o': + return this._validateOverwriteAction(action); + case 'c': + return this._validateCreateAction(action); + case 'r': + return this._validateRenameAction(action); + case 'd': + return this._validateDeleteAction(action); + default: + throw new action_1.UnknownActionException(action); + } + } + commitSingleAction(action) { + return (0, rxjs_1.concat)(this.validateSingleAction(action), new rxjs_1.Observable((observer) => { + let committed = null; + switch (action.kind) { + case 'o': + committed = this._overwriteFile(action.path, action.content); + break; + case 'c': + committed = this._createFile(action.path, action.content); + break; + case 'r': + committed = this._renameFile(action.path, action.to); + break; + case 'd': + committed = this._deleteFile(action.path); + break; + } + if (committed) { + committed.subscribe(observer); + } + else { + observer.complete(); + } + })).pipe((0, operators_1.ignoreElements)()); + } + commit(tree) { + const actions = (0, rxjs_1.from)(tree.actions); + return (0, rxjs_1.concat)(this.preCommit() || (0, rxjs_1.of)(null), (0, rxjs_1.defer)(() => actions).pipe((0, operators_1.concatMap)((action) => { + const maybeAction = this.preCommitAction(action); + if ((0, rxjs_1.isObservable)(maybeAction) || isPromiseLike(maybeAction)) { + return maybeAction; + } + return (0, rxjs_1.of)(maybeAction || action); + }), (0, operators_1.concatMap)((action) => { + return (0, rxjs_1.concat)(this.commitSingleAction(action).pipe((0, operators_1.ignoreElements)()), (0, rxjs_1.of)(action)); + }), (0, operators_1.concatMap)((action) => this.postCommitAction(action) || (0, rxjs_1.of)(null))), (0, rxjs_1.defer)(() => this._done()), (0, rxjs_1.defer)(() => this.postCommit() || (0, rxjs_1.of)(null))).pipe((0, operators_1.ignoreElements)()); + } +} +exports.SimpleSinkBase = SimpleSinkBase; +function isPromiseLike(value) { + return !!value && typeof value.then === 'function'; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.d.ts new file mode 100644 index 00000000..12bc3b8b --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.d.ts @@ -0,0 +1,50 @@ +/** + * @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 + */ +/// +import { BaseException, Path } from '@angular-devkit/core'; +export declare class UnknownActionException extends BaseException { + constructor(action: Action); +} +export declare type Action = CreateFileAction | OverwriteFileAction | RenameFileAction | DeleteFileAction; +export interface ActionBase { + readonly id: number; + readonly parent: number; + readonly path: Path; +} +export declare class ActionList implements Iterable { + private _actions; + protected _action(action: Partial): void; + create(path: Path, content: Buffer): void; + overwrite(path: Path, content: Buffer): void; + rename(path: Path, to: Path): void; + delete(path: Path): void; + optimize(): void; + push(action: Action): void; + get(i: number): Action; + has(action: Action): boolean; + find(predicate: (value: Action) => boolean): Action | null; + forEach(fn: (value: Action, index: number, array: Action[]) => void, thisArg?: {}): void; + get length(): number; + [Symbol.iterator](): IterableIterator; +} +export declare function isContentAction(action: Action): action is CreateFileAction | OverwriteFileAction; +export interface CreateFileAction extends ActionBase { + readonly kind: 'c'; + readonly content: Buffer; +} +export interface OverwriteFileAction extends ActionBase { + readonly kind: 'o'; + readonly content: Buffer; +} +export interface RenameFileAction extends ActionBase { + readonly kind: 'r'; + readonly to: Path; +} +export interface DeleteFileAction extends ActionBase { + readonly kind: 'd'; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.js new file mode 100644 index 00000000..b5815892 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/action.js @@ -0,0 +1,140 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isContentAction = exports.ActionList = exports.UnknownActionException = void 0; +const core_1 = require("@angular-devkit/core"); +class UnknownActionException extends core_1.BaseException { + constructor(action) { + super(`Unknown action: "${action.kind}".`); + } +} +exports.UnknownActionException = UnknownActionException; +let _id = 1; +class ActionList { + constructor() { + this._actions = []; + } + _action(action) { + var _a, _b; + this._actions.push({ + ...action, + id: _id++, + parent: (_b = (_a = this._actions[this._actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0, + }); + } + create(path, content) { + this._action({ kind: 'c', path, content }); + } + overwrite(path, content) { + this._action({ kind: 'o', path, content }); + } + rename(path, to) { + this._action({ kind: 'r', path, to }); + } + delete(path) { + this._action({ kind: 'd', path }); + } + optimize() { + const toCreate = new Map(); + const toRename = new Map(); + const toOverwrite = new Map(); + const toDelete = new Set(); + for (const action of this._actions) { + switch (action.kind) { + case 'c': + toCreate.set(action.path, action.content); + break; + case 'o': + if (toCreate.has(action.path)) { + toCreate.set(action.path, action.content); + } + else { + toOverwrite.set(action.path, action.content); + } + break; + case 'd': + toDelete.add(action.path); + break; + case 'r': + const maybeCreate = toCreate.get(action.path); + const maybeOverwrite = toOverwrite.get(action.path); + if (maybeCreate) { + toCreate.delete(action.path); + toCreate.set(action.to, maybeCreate); + } + if (maybeOverwrite) { + toOverwrite.delete(action.path); + toOverwrite.set(action.to, maybeOverwrite); + } + let maybeRename = undefined; + for (const [from, to] of toRename.entries()) { + if (to == action.path) { + maybeRename = from; + break; + } + } + if (maybeRename) { + toRename.set(maybeRename, action.to); + } + if (!maybeCreate && !maybeOverwrite && !maybeRename) { + toRename.set(action.path, action.to); + } + break; + } + } + this._actions = []; + toDelete.forEach((x) => { + this.delete(x); + }); + toRename.forEach((to, from) => { + this.rename(from, to); + }); + toCreate.forEach((content, path) => { + this.create(path, content); + }); + toOverwrite.forEach((content, path) => { + this.overwrite(path, content); + }); + } + push(action) { + this._actions.push(action); + } + get(i) { + return this._actions[i]; + } + has(action) { + for (let i = 0; i < this._actions.length; i++) { + const a = this._actions[i]; + if (a.id == action.id) { + return true; + } + if (a.id > action.id) { + return false; + } + } + return false; + } + find(predicate) { + return this._actions.find(predicate) || null; + } + forEach(fn, thisArg) { + this._actions.forEach(fn, thisArg); + } + get length() { + return this._actions.length; + } + [Symbol.iterator]() { + return this._actions[Symbol.iterator](); + } +} +exports.ActionList = ActionList; +function isContentAction(action) { + return action.kind == 'c' || action.kind == 'o'; +} +exports.isContentAction = isContentAction; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.d.ts new file mode 100644 index 00000000..2ffc446e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.d.ts @@ -0,0 +1,30 @@ +/** + * @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 + */ +/// +import { Action } from './action'; +import { DirEntry, FileEntry, FileVisitor, MergeStrategy, Tree, UpdateRecorder } from './interface'; +export declare class DelegateTree implements Tree { + protected _other: Tree; + constructor(_other: Tree); + branch(): Tree; + merge(other: Tree, strategy?: MergeStrategy): void; + get root(): DirEntry; + read(path: string): Buffer | null; + exists(path: string): boolean; + get(path: string): FileEntry | null; + getDir(path: string): DirEntry; + visit(visitor: FileVisitor): void; + overwrite(path: string, content: Buffer | string): void; + beginUpdate(path: string): UpdateRecorder; + commitUpdate(record: UpdateRecorder): void; + create(path: string, content: Buffer | string): void; + delete(path: string): void; + rename(from: string, to: string): void; + apply(action: Action, strategy?: MergeStrategy): void; + get actions(): Action[]; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.js new file mode 100644 index 00000000..f63990b1 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/delegate.js @@ -0,0 +1,71 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DelegateTree = void 0; +const interface_1 = require("./interface"); +class DelegateTree { + constructor(_other) { + this._other = _other; + } + branch() { + return this._other.branch(); + } + merge(other, strategy) { + this._other.merge(other, strategy); + } + get root() { + return this._other.root; + } + // Readonly. + read(path) { + return this._other.read(path); + } + exists(path) { + return this._other.exists(path); + } + get(path) { + return this._other.get(path); + } + getDir(path) { + return this._other.getDir(path); + } + visit(visitor) { + return this._other.visit(visitor); + } + // Change content of host files. + overwrite(path, content) { + return this._other.overwrite(path, content); + } + beginUpdate(path) { + return this._other.beginUpdate(path); + } + commitUpdate(record) { + return this._other.commitUpdate(record); + } + // Structural methods. + create(path, content) { + return this._other.create(path, content); + } + delete(path) { + return this._other.delete(path); + } + rename(from, to) { + return this._other.rename(from, to); + } + apply(action, strategy) { + return this._other.apply(action, strategy); + } + get actions() { + return this._other.actions; + } + [interface_1.TreeSymbol]() { + return this; + } +} +exports.DelegateTree = DelegateTree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.d.ts new file mode 100644 index 00000000..bd29a84e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.d.ts @@ -0,0 +1,11 @@ +/** + * @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 + */ +import { HostTree } from './host-tree'; +export declare class EmptyTree extends HostTree { + constructor(); +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.js new file mode 100644 index 00000000..73ed6391 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/empty.js @@ -0,0 +1,17 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EmptyTree = void 0; +const host_tree_1 = require("./host-tree"); +class EmptyTree extends host_tree_1.HostTree { + constructor() { + super(); + } +} +exports.EmptyTree = EmptyTree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.d.ts new file mode 100644 index 00000000..4fb16d1c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.d.ts @@ -0,0 +1,25 @@ +/** + * @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 + */ +/// +import { Path } from '@angular-devkit/core'; +import { FileEntry } from './interface'; +export declare class SimpleFileEntry implements FileEntry { + private _path; + private _content; + constructor(_path: Path, _content: Buffer); + get path(): Path; + get content(): Buffer; +} +export declare class LazyFileEntry implements FileEntry { + private _path; + private _load; + private _content; + constructor(_path: Path, _load: (path?: Path) => Buffer); + get path(): Path; + get content(): Buffer; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.js new file mode 100644 index 00000000..cfe7ada6 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/entry.js @@ -0,0 +1,37 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyFileEntry = exports.SimpleFileEntry = void 0; +class SimpleFileEntry { + constructor(_path, _content) { + this._path = _path; + this._content = _content; + } + get path() { + return this._path; + } + get content() { + return this._content; + } +} +exports.SimpleFileEntry = SimpleFileEntry; +class LazyFileEntry { + constructor(_path, _load) { + this._path = _path; + this._load = _load; + this._content = null; + } + get path() { + return this._path; + } + get content() { + return this._content || (this._content = this._load(this._path)); + } +} +exports.LazyFileEntry = LazyFileEntry; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.d.ts new file mode 100644 index 00000000..dd370e91 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.d.ts @@ -0,0 +1,63 @@ +/** + * @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 + */ +/// +import { Path, PathFragment, virtualFs } from '@angular-devkit/core'; +import { Action } from './action'; +import { DirEntry, FileEntry, FilePredicate, FileVisitor, MergeStrategy, Tree, UpdateRecorder } from './interface'; +export declare class HostDirEntry implements DirEntry { + readonly parent: DirEntry | null; + readonly path: Path; + protected _host: virtualFs.SyncDelegateHost; + protected _tree: Tree; + constructor(parent: DirEntry | null, path: Path, _host: virtualFs.SyncDelegateHost, _tree: Tree); + get subdirs(): PathFragment[]; + get subfiles(): PathFragment[]; + dir(name: PathFragment): DirEntry; + file(name: PathFragment): FileEntry | null; + visit(visitor: FileVisitor): void; + private getSubfilesRecursively; +} +export declare class HostTree implements Tree { + protected _backend: virtualFs.ReadonlyHost<{}>; + private readonly _id; + private _record; + private _recordSync; + private _ancestry; + private _dirCache; + static isHostTree(tree: Tree): tree is HostTree; + constructor(_backend?: virtualFs.ReadonlyHost<{}>); + protected _normalizePath(path: string): Path; + protected _willCreate(path: Path): boolean; + protected _willOverwrite(path: Path): boolean; + protected _willDelete(path: Path): boolean; + protected _willRename(path: Path): boolean; + branch(): Tree; + private isAncestorOf; + merge(other: Tree, strategy?: MergeStrategy): void; + get root(): DirEntry; + read(path: string): Buffer | null; + exists(path: string): boolean; + get(path: string): FileEntry | null; + getDir(path: string): DirEntry; + visit(visitor: FileVisitor): void; + overwrite(path: string, content: Buffer | string): void; + beginUpdate(path: string): UpdateRecorder; + commitUpdate(record: UpdateRecorder): void; + create(path: string, content: Buffer | string): void; + delete(path: string): void; + rename(from: string, to: string): void; + apply(action: Action, strategy?: MergeStrategy): void; + private generateActions; + get actions(): Action[]; +} +export declare class HostCreateTree extends HostTree { + constructor(host: virtualFs.ReadonlyHost); +} +export declare class FilterHostTree extends HostTree { + constructor(tree: HostTree, filter?: FilePredicate); +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.js new file mode 100644 index 00000000..8cde1dfa --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/host-tree.js @@ -0,0 +1,406 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FilterHostTree = exports.HostCreateTree = exports.HostTree = exports.HostDirEntry = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const exception_1 = require("../exception/exception"); +const delegate_1 = require("./delegate"); +const entry_1 = require("./entry"); +const interface_1 = require("./interface"); +const recorder_1 = require("./recorder"); +const scoped_1 = require("./scoped"); +let _uniqueId = 0; +class HostDirEntry { + constructor(parent, path, _host, _tree) { + this.parent = parent; + this.path = path; + this._host = _host; + this._tree = _tree; + } + get subdirs() { + return this._host + .list(this.path) + .filter((fragment) => this._host.isDirectory((0, core_1.join)(this.path, fragment))); + } + get subfiles() { + return this._host + .list(this.path) + .filter((fragment) => this._host.isFile((0, core_1.join)(this.path, fragment))); + } + dir(name) { + return this._tree.getDir((0, core_1.join)(this.path, name)); + } + file(name) { + return this._tree.get((0, core_1.join)(this.path, name)); + } + visit(visitor) { + try { + this.getSubfilesRecursively().forEach((file) => visitor(file.path, file)); + } + catch (e) { + if (e !== interface_1.FileVisitorCancelToken) { + throw e; + } + } + } + getSubfilesRecursively() { + function _recurse(entry) { + return entry.subdirs.reduce((files, subdir) => [...files, ..._recurse(entry.dir(subdir))], entry.subfiles.map((subfile) => entry.file(subfile))); + } + return _recurse(this); + } +} +exports.HostDirEntry = HostDirEntry; +class HostTree { + constructor(_backend = new core_1.virtualFs.Empty()) { + this._backend = _backend; + this._id = --_uniqueId; + this._ancestry = new Set(); + this._dirCache = new Map(); + this._record = new core_1.virtualFs.CordHost(new core_1.virtualFs.SafeReadonlyHost(_backend)); + this._recordSync = new core_1.virtualFs.SyncDelegateHost(this._record); + } + [interface_1.TreeSymbol]() { + return this; + } + static isHostTree(tree) { + if (tree instanceof HostTree) { + return true; + } + if (typeof tree === 'object' && typeof tree._ancestry === 'object') { + return true; + } + return false; + } + _normalizePath(path) { + return (0, core_1.normalize)('/' + path); + } + _willCreate(path) { + return this._record.willCreate(path); + } + _willOverwrite(path) { + return this._record.willOverwrite(path); + } + _willDelete(path) { + return this._record.willDelete(path); + } + _willRename(path) { + return this._record.willRename(path); + } + branch() { + const branchedTree = new HostTree(this._backend); + branchedTree._record = this._record.clone(); + branchedTree._recordSync = new core_1.virtualFs.SyncDelegateHost(branchedTree._record); + branchedTree._ancestry = new Set(this._ancestry).add(this._id); + return branchedTree; + } + isAncestorOf(tree) { + if (tree instanceof HostTree) { + return tree._ancestry.has(this._id); + } + if (tree instanceof delegate_1.DelegateTree) { + return this.isAncestorOf(tree._other); + } + if (tree instanceof scoped_1.ScopedTree) { + return this.isAncestorOf(tree._base); + } + return false; + } + merge(other, strategy = interface_1.MergeStrategy.Default) { + if (other === this) { + // Merging with yourself? Tsk tsk. Nothing to do at least. + return; + } + if (this.isAncestorOf(other)) { + // Workaround for merging a branch back into one of its ancestors + // More complete branch point tracking is required to avoid + strategy |= interface_1.MergeStrategy.Overwrite; + } + const creationConflictAllowed = (strategy & interface_1.MergeStrategy.AllowCreationConflict) == interface_1.MergeStrategy.AllowCreationConflict; + const overwriteConflictAllowed = (strategy & interface_1.MergeStrategy.AllowOverwriteConflict) == interface_1.MergeStrategy.AllowOverwriteConflict; + const deleteConflictAllowed = (strategy & interface_1.MergeStrategy.AllowDeleteConflict) == interface_1.MergeStrategy.AllowDeleteConflict; + other.actions.forEach((action) => { + switch (action.kind) { + case 'c': { + const { path, content } = action; + if (this._willCreate(path) || this._willOverwrite(path) || this.exists(path)) { + const existingContent = this.read(path); + if (existingContent && content.equals(existingContent)) { + // Identical outcome; no action required + return; + } + if (!creationConflictAllowed) { + throw new exception_1.MergeConflictException(path); + } + this._record.overwrite(path, content).subscribe(); + } + else { + this._record.create(path, content).subscribe(); + } + return; + } + case 'o': { + const { path, content } = action; + if (this._willDelete(path) && !overwriteConflictAllowed) { + throw new exception_1.MergeConflictException(path); + } + // Ignore if content is the same (considered the same change). + if (this._willOverwrite(path)) { + const existingContent = this.read(path); + if (existingContent && content.equals(existingContent)) { + // Identical outcome; no action required + return; + } + if (!overwriteConflictAllowed) { + throw new exception_1.MergeConflictException(path); + } + } + // We use write here as merge validation has already been done, and we want to let + // the CordHost do its job. + this._record.write(path, content).subscribe(); + return; + } + case 'r': { + const { path, to } = action; + if (this._willDelete(path)) { + throw new exception_1.MergeConflictException(path); + } + if (this._willRename(path)) { + if (this._record.willRenameTo(path, to)) { + // Identical outcome; no action required + return; + } + // No override possible for renaming. + throw new exception_1.MergeConflictException(path); + } + this.rename(path, to); + return; + } + case 'd': { + const { path } = action; + if (this._willDelete(path)) { + // TODO: This should technically check the content (e.g., hash on delete) + // Identical outcome; no action required + return; + } + if (!this.exists(path) && !deleteConflictAllowed) { + throw new exception_1.MergeConflictException(path); + } + this._recordSync.delete(path); + return; + } + } + }); + } + get root() { + return this.getDir('/'); + } + // Readonly. + read(path) { + const entry = this.get(path); + return entry ? entry.content : null; + } + exists(path) { + return this._recordSync.isFile(this._normalizePath(path)); + } + get(path) { + const p = this._normalizePath(path); + if (this._recordSync.isDirectory(p)) { + throw new core_1.PathIsDirectoryException(p); + } + if (!this._recordSync.exists(p)) { + return null; + } + return new entry_1.LazyFileEntry(p, () => Buffer.from(this._recordSync.read(p))); + } + getDir(path) { + const p = this._normalizePath(path); + if (this._recordSync.isFile(p)) { + throw new core_1.PathIsFileException(p); + } + let maybeCache = this._dirCache.get(p); + if (!maybeCache) { + let parent = (0, core_1.dirname)(p); + if (p === parent) { + parent = null; + } + maybeCache = new HostDirEntry(parent && this.getDir(parent), p, this._recordSync, this); + this._dirCache.set(p, maybeCache); + } + return maybeCache; + } + visit(visitor) { + this.root.visit((path, entry) => { + visitor(path, entry); + }); + } + // Change content of host files. + overwrite(path, content) { + const p = this._normalizePath(path); + if (!this._recordSync.exists(p)) { + throw new exception_1.FileDoesNotExistException(p); + } + const c = typeof content == 'string' ? Buffer.from(content) : content; + this._record.overwrite(p, c).subscribe(); + } + beginUpdate(path) { + const entry = this.get(path); + if (!entry) { + throw new exception_1.FileDoesNotExistException(path); + } + return recorder_1.UpdateRecorderBase.createFromFileEntry(entry); + } + commitUpdate(record) { + if (record instanceof recorder_1.UpdateRecorderBase) { + const path = record.path; + const entry = this.get(path); + if (!entry) { + throw new exception_1.ContentHasMutatedException(path); + } + else { + const newContent = record.apply(entry.content); + if (!newContent.equals(entry.content)) { + this.overwrite(path, newContent); + } + } + } + else { + throw new exception_1.InvalidUpdateRecordException(); + } + } + // Structural methods. + create(path, content) { + const p = this._normalizePath(path); + if (this._recordSync.exists(p)) { + throw new exception_1.FileAlreadyExistException(p); + } + const c = typeof content == 'string' ? Buffer.from(content) : content; + this._record.create(p, c).subscribe(); + } + delete(path) { + this._recordSync.delete(this._normalizePath(path)); + } + rename(from, to) { + this._recordSync.rename(this._normalizePath(from), this._normalizePath(to)); + } + apply(action, strategy) { + throw new exception_1.SchematicsException('Apply not implemented on host trees.'); + } + *generateActions() { + for (const record of this._record.records()) { + switch (record.kind) { + case 'create': + yield { + id: this._id, + parent: 0, + kind: 'c', + path: record.path, + content: Buffer.from(record.content), + }; + break; + case 'overwrite': + yield { + id: this._id, + parent: 0, + kind: 'o', + path: record.path, + content: Buffer.from(record.content), + }; + break; + case 'rename': + yield { + id: this._id, + parent: 0, + kind: 'r', + path: record.from, + to: record.to, + }; + break; + case 'delete': + yield { + id: this._id, + parent: 0, + kind: 'd', + path: record.path, + }; + break; + } + } + } + get actions() { + // Create a list of all records until we hit our original backend. This is to support branches + // that diverge from each others. + return Array.from(this.generateActions()); + } +} +exports.HostTree = HostTree; +class HostCreateTree extends HostTree { + constructor(host) { + super(); + const tempHost = new HostTree(host); + tempHost.visit((path) => { + const content = tempHost.read(path); + if (content) { + this.create(path, content); + } + }); + } +} +exports.HostCreateTree = HostCreateTree; +class FilterHostTree extends HostTree { + constructor(tree, filter = () => true) { + const newBackend = new core_1.virtualFs.SimpleMemoryHost(); + // cast to allow access + const originalBackend = tree._backend; + const recurse = (base) => { + return originalBackend.list(base).pipe((0, operators_1.mergeMap)((x) => x), (0, operators_1.map)((path) => (0, core_1.join)(base, path)), (0, operators_1.concatMap)((path) => { + let isDirectory = false; + originalBackend.isDirectory(path).subscribe((val) => (isDirectory = val)); + if (isDirectory) { + return recurse(path); + } + let isFile = false; + originalBackend.isFile(path).subscribe((val) => (isFile = val)); + if (!isFile || !filter(path)) { + return rxjs_1.EMPTY; + } + let content = null; + originalBackend.read(path).subscribe((val) => (content = val)); + if (!content) { + return rxjs_1.EMPTY; + } + return newBackend.write(path, content); + })); + }; + recurse((0, core_1.normalize)('/')).subscribe(); + super(newBackend); + for (const action of tree.actions) { + if (!filter(action.path)) { + continue; + } + switch (action.kind) { + case 'c': + this.create(action.path, action.content); + break; + case 'd': + this.delete(action.path); + break; + case 'o': + this.overwrite(action.path, action.content); + break; + case 'r': + this.rename(action.path, action.to); + break; + } + } + } +} +exports.FilterHostTree = FilterHostTree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.d.ts new file mode 100644 index 00000000..168e0591 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.d.ts @@ -0,0 +1,61 @@ +/** + * @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 + */ +/// +import { Path, PathFragment } from '@angular-devkit/core'; +import { Action } from './action'; +export declare enum MergeStrategy { + AllowOverwriteConflict = 2, + AllowCreationConflict = 4, + AllowDeleteConflict = 8, + Default = 0, + Error = 1, + ContentOnly = 2, + Overwrite = 14 +} +export declare const FileVisitorCancelToken: symbol; +export declare type FileVisitor = FilePredicate; +export interface FileEntry { + readonly path: Path; + readonly content: Buffer; +} +export interface DirEntry { + readonly parent: DirEntry | null; + readonly path: Path; + readonly subdirs: PathFragment[]; + readonly subfiles: PathFragment[]; + dir(name: PathFragment): DirEntry; + file(name: PathFragment): FileEntry | null; + visit(visitor: FileVisitor): void; +} +export interface FilePredicate { + (path: Path, entry?: Readonly | null): T; +} +export declare const TreeSymbol: symbol; +export interface Tree { + branch(): Tree; + merge(other: Tree, strategy?: MergeStrategy): void; + readonly root: DirEntry; + read(path: string): Buffer | null; + exists(path: string): boolean; + get(path: string): FileEntry | null; + getDir(path: string): DirEntry; + visit(visitor: FileVisitor): void; + overwrite(path: string, content: Buffer | string): void; + beginUpdate(path: string): UpdateRecorder; + commitUpdate(record: UpdateRecorder): void; + create(path: string, content: Buffer | string): void; + delete(path: string): void; + rename(from: string, to: string): void; + apply(action: Action, strategy?: MergeStrategy): void; + readonly actions: Action[]; +} +export interface UpdateRecorder { + insertLeft(index: number, content: Buffer | string): UpdateRecorder; + insertRight(index: number, content: Buffer | string): UpdateRecorder; + remove(index: number, length: number): UpdateRecorder; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.js new file mode 100644 index 00000000..b8ac1141 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/interface.js @@ -0,0 +1,47 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TreeSymbol = exports.FileVisitorCancelToken = exports.MergeStrategy = void 0; +var MergeStrategy; +(function (MergeStrategy) { + MergeStrategy[MergeStrategy["AllowOverwriteConflict"] = 2] = "AllowOverwriteConflict"; + MergeStrategy[MergeStrategy["AllowCreationConflict"] = 4] = "AllowCreationConflict"; + MergeStrategy[MergeStrategy["AllowDeleteConflict"] = 8] = "AllowDeleteConflict"; + // Uses the default strategy. + MergeStrategy[MergeStrategy["Default"] = 0] = "Default"; + // Error out if 2 files have the same path. It is useful to have a different value than + // Default in this case as the tooling Default might differ. + MergeStrategy[MergeStrategy["Error"] = 1] = "Error"; + // Only content conflicts are overwritten. + MergeStrategy[MergeStrategy["ContentOnly"] = 2] = "ContentOnly"; + // Overwrite everything with the latest change. + MergeStrategy[MergeStrategy["Overwrite"] = 14] = "Overwrite"; +})(MergeStrategy = exports.MergeStrategy || (exports.MergeStrategy = {})); +// eslint-disable-next-line @typescript-eslint/no-inferrable-types +exports.FileVisitorCancelToken = Symbol(); +exports.TreeSymbol = (function () { + const globalSymbol = (typeof window == 'object' && window.window === window && window.Symbol) || + (typeof self == 'object' && self.self === self && self.Symbol) || + (typeof global == 'object' && global.global === global && global.Symbol); + if (!globalSymbol) { + return Symbol('schematic-tree'); + } + if (!globalSymbol.schematicTree) { + globalSymbol.schematicTree = Symbol('schematic-tree'); + } + return globalSymbol.schematicTree; +})(); +// eslint-disable-next-line @typescript-eslint/no-namespace +var Tree; +(function (Tree) { + function isTree(maybeTree) { + return exports.TreeSymbol in maybeTree; + } + Tree.isTree = isTree; +})(Tree || (Tree = {})); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.d.ts new file mode 100644 index 00000000..0a7ac06a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.d.ts @@ -0,0 +1,43 @@ +/** + * @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 + */ +/// +import { BaseException, Path, PathFragment } from '@angular-devkit/core'; +import { Action } from './action'; +import { DirEntry, MergeStrategy, Tree, UpdateRecorder } from './interface'; +export declare class CannotCreateFileException extends BaseException { + constructor(path: string); +} +export declare class NullTreeDirEntry implements DirEntry { + readonly path: Path; + get parent(): DirEntry | null; + constructor(path: Path); + readonly subdirs: PathFragment[]; + readonly subfiles: PathFragment[]; + dir(name: PathFragment): DirEntry; + file(_name: PathFragment): null; + visit(): void; +} +export declare class NullTree implements Tree { + branch(): Tree; + merge(_other: Tree, _strategy?: MergeStrategy): void; + readonly root: DirEntry; + exists(_path: string): boolean; + read(_path: string): null; + get(_path: string): null; + getDir(path: string): NullTreeDirEntry; + visit(): void; + beginUpdate(path: string): never; + commitUpdate(record: UpdateRecorder): never; + copy(path: string, _to: string): never; + delete(path: string): never; + create(path: string, _content: Buffer | string): never; + rename(path: string, _to: string): never; + overwrite(path: string, _content: Buffer | string): never; + apply(_action: Action, _strategy?: MergeStrategy): void; + get actions(): Action[]; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.js new file mode 100644 index 00000000..007e5bbe --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/null.js @@ -0,0 +1,92 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NullTree = exports.NullTreeDirEntry = exports.CannotCreateFileException = void 0; +const core_1 = require("@angular-devkit/core"); +const exception_1 = require("../exception/exception"); +const interface_1 = require("./interface"); +const recorder_1 = require("./recorder"); +class CannotCreateFileException extends core_1.BaseException { + constructor(path) { + super(`Cannot create file "${path}".`); + } +} +exports.CannotCreateFileException = CannotCreateFileException; +class NullTreeDirEntry { + constructor(path) { + this.path = path; + this.subdirs = []; + this.subfiles = []; + } + get parent() { + return this.path == '/' ? null : new NullTreeDirEntry((0, core_1.dirname)(this.path)); + } + dir(name) { + return new NullTreeDirEntry((0, core_1.join)(this.path, name)); + } + file(_name) { + return null; + } + visit() { } +} +exports.NullTreeDirEntry = NullTreeDirEntry; +class NullTree { + constructor() { + this.root = new NullTreeDirEntry((0, core_1.normalize)('/')); + } + [interface_1.TreeSymbol]() { + return this; + } + branch() { + return new NullTree(); + } + merge(_other, _strategy) { } + // Simple readonly file system operations. + exists(_path) { + return false; + } + read(_path) { + return null; + } + get(_path) { + return null; + } + getDir(path) { + return new NullTreeDirEntry((0, core_1.normalize)('/' + path)); + } + visit() { } + // Change content of host files. + beginUpdate(path) { + throw new exception_1.FileDoesNotExistException(path); + } + commitUpdate(record) { + throw new exception_1.FileDoesNotExistException(record instanceof recorder_1.UpdateRecorderBase ? record.path : ''); + } + // Change structure of the host. + copy(path, _to) { + throw new exception_1.FileDoesNotExistException(path); + } + delete(path) { + throw new exception_1.FileDoesNotExistException(path); + } + create(path, _content) { + throw new CannotCreateFileException(path); + } + rename(path, _to) { + throw new exception_1.FileDoesNotExistException(path); + } + overwrite(path, _content) { + throw new exception_1.FileDoesNotExistException(path); + } + apply(_action, _strategy) { } + get actions() { + return []; + } +} +exports.NullTree = NullTree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.d.ts new file mode 100644 index 00000000..21dc6b6e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.d.ts @@ -0,0 +1,29 @@ +/** + * @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 + */ +/// +import { UpdateBufferBase } from '../utility/update-buffer'; +import { FileEntry, UpdateRecorder } from './interface'; +export declare class UpdateRecorderBase implements UpdateRecorder { + protected _path: string; + protected _original: Buffer; + protected _content: UpdateBufferBase; + constructor(entry: FileEntry); + static createFromFileEntry(entry: FileEntry): UpdateRecorderBase; + get path(): string; + insertLeft(index: number, content: Buffer | string): UpdateRecorder; + insertRight(index: number, content: Buffer | string): UpdateRecorder; + remove(index: number, length: number): UpdateRecorder; + apply(content: Buffer): Buffer; +} +export declare class UpdateRecorderBom extends UpdateRecorderBase { + private _delta; + constructor(entry: FileEntry, _delta?: number); + insertLeft(index: number, content: Buffer | string): UpdateRecorder; + insertRight(index: number, content: Buffer | string): UpdateRecorder; + remove(index: number, length: number): UpdateRecorder; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.js new file mode 100644 index 00000000..b05ef116 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/recorder.js @@ -0,0 +1,74 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UpdateRecorderBom = exports.UpdateRecorderBase = void 0; +const exception_1 = require("../exception/exception"); +const update_buffer_1 = require("../utility/update-buffer"); +class UpdateRecorderBase { + constructor(entry) { + this._original = Buffer.from(entry.content); + this._content = update_buffer_1.UpdateBufferBase.create(entry.content); + this._path = entry.path; + } + static createFromFileEntry(entry) { + const c0 = entry.content.byteLength > 0 && entry.content.readUInt8(0); + const c1 = entry.content.byteLength > 1 && entry.content.readUInt8(1); + const c2 = entry.content.byteLength > 2 && entry.content.readUInt8(2); + // Check if we're BOM. + if (c0 == 0xef && c1 == 0xbb && c2 == 0xbf) { + return new UpdateRecorderBom(entry); + } + else if (c0 === 0xff && c1 == 0xfe) { + return new UpdateRecorderBom(entry); + } + else if (c0 === 0xfe && c1 == 0xff) { + return new UpdateRecorderBom(entry); + } + return new UpdateRecorderBase(entry); + } + get path() { + return this._path; + } + // These just record changes. + insertLeft(index, content) { + this._content.insertLeft(index, typeof content == 'string' ? Buffer.from(content) : content); + return this; + } + insertRight(index, content) { + this._content.insertRight(index, typeof content == 'string' ? Buffer.from(content) : content); + return this; + } + remove(index, length) { + this._content.remove(index, length); + return this; + } + apply(content) { + if (!content.equals(this._content.original)) { + throw new exception_1.ContentHasMutatedException(this.path); + } + return this._content.generate(); + } +} +exports.UpdateRecorderBase = UpdateRecorderBase; +class UpdateRecorderBom extends UpdateRecorderBase { + constructor(entry, _delta = 1) { + super(entry); + this._delta = _delta; + } + insertLeft(index, content) { + return super.insertLeft(index + this._delta, content); + } + insertRight(index, content) { + return super.insertRight(index + this._delta, content); + } + remove(index, length) { + return super.remove(index + this._delta, length); + } +} +exports.UpdateRecorderBom = UpdateRecorderBom; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.d.ts new file mode 100644 index 00000000..4884d693 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.d.ts @@ -0,0 +1,47 @@ +/** + * @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 + */ +/// +import { Path, PathFragment } from '@angular-devkit/core'; +import { Action } from './action'; +import { DirEntry, FileEntry, FileVisitor, MergeStrategy, Tree, UpdateRecorder } from './interface'; +declare class ScopedDirEntry implements DirEntry { + private _base; + readonly scope: Path; + constructor(_base: DirEntry, scope: Path); + get parent(): DirEntry | null; + get path(): Path; + get subdirs(): PathFragment[]; + get subfiles(): PathFragment[]; + dir(name: PathFragment): DirEntry; + file(name: PathFragment): FileEntry | null; + visit(visitor: FileVisitor): void; +} +export declare class ScopedTree implements Tree { + private _base; + readonly _root: ScopedDirEntry; + constructor(_base: Tree, scope: string); + get root(): DirEntry; + branch(): Tree; + merge(other: Tree, strategy?: MergeStrategy): void; + read(path: string): Buffer | null; + exists(path: string): boolean; + get(path: string): FileEntry | null; + getDir(path: string): DirEntry; + visit(visitor: FileVisitor): void; + overwrite(path: string, content: Buffer | string): void; + beginUpdate(path: string): UpdateRecorder; + commitUpdate(record: UpdateRecorder): void; + create(path: string, content: Buffer | string): void; + delete(path: string): void; + rename(from: string, to: string): void; + apply(action: Action, strategy?: MergeStrategy): void; + get actions(): Action[]; + private _fullPath; + private _fullPathAction; +} +export {}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js new file mode 100644 index 00000000..61cc0049 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/scoped.js @@ -0,0 +1,169 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopedTree = void 0; +const core_1 = require("@angular-devkit/core"); +const delegate_1 = require("./delegate"); +const interface_1 = require("./interface"); +class ScopedFileEntry { + constructor(_base, scope) { + this._base = _base; + this.scope = scope; + } + get path() { + return (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, this._base.path)); + } + get content() { + return this._base.content; + } +} +class ScopedDirEntry { + constructor(_base, scope) { + this._base = _base; + this.scope = scope; + } + get parent() { + if (!this._base.parent || this._base.path == this.scope) { + return null; + } + return new ScopedDirEntry(this._base.parent, this.scope); + } + get path() { + return (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, this._base.path)); + } + get subdirs() { + return this._base.subdirs; + } + get subfiles() { + return this._base.subfiles; + } + dir(name) { + const entry = this._base.dir(name); + return entry && new ScopedDirEntry(entry, this.scope); + } + file(name) { + const entry = this._base.file(name); + return entry && new ScopedFileEntry(entry, this.scope); + } + visit(visitor) { + return this._base.visit((path, entry) => { + visitor((0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this.scope, path)), entry && new ScopedFileEntry(entry, this.scope)); + }); + } +} +class ScopedTree { + constructor(_base, scope) { + this._base = _base; + const normalizedScope = (0, core_1.normalize)('/' + scope); + this._root = new ScopedDirEntry(this._base.getDir(normalizedScope), normalizedScope); + } + get root() { + return this._root; + } + branch() { + return new ScopedTree(this._base.branch(), this._root.scope); + } + merge(other, strategy) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + const delegate = new (class extends delegate_1.DelegateTree { + get actions() { + return other.actions.map((action) => self._fullPathAction(action)); + } + })(other); + this._base.merge(delegate, strategy); + } + // Readonly. + read(path) { + return this._base.read(this._fullPath(path)); + } + exists(path) { + return this._base.exists(this._fullPath(path)); + } + get(path) { + const entry = this._base.get(this._fullPath(path)); + return entry && new ScopedFileEntry(entry, this._root.scope); + } + getDir(path) { + const entry = this._base.getDir(this._fullPath(path)); + return entry && new ScopedDirEntry(entry, this._root.scope); + } + visit(visitor) { + return this._root.visit(visitor); + } + // Change content of host files. + overwrite(path, content) { + return this._base.overwrite(this._fullPath(path), content); + } + beginUpdate(path) { + return this._base.beginUpdate(this._fullPath(path)); + } + commitUpdate(record) { + return this._base.commitUpdate(record); + } + // Structural methods. + create(path, content) { + return this._base.create(this._fullPath(path), content); + } + delete(path) { + return this._base.delete(this._fullPath(path)); + } + rename(from, to) { + return this._base.rename(this._fullPath(from), this._fullPath(to)); + } + apply(action, strategy) { + return this._base.apply(this._fullPathAction(action), strategy); + } + get actions() { + const scopedActions = []; + for (const action of this._base.actions) { + if (!action.path.startsWith(this._root.scope + '/')) { + continue; + } + if (action.kind !== 'r') { + scopedActions.push({ + ...action, + path: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.path)), + }); + } + else if (action.to.startsWith(this._root.scope + '/')) { + scopedActions.push({ + ...action, + path: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.path)), + to: (0, core_1.join)(core_1.NormalizedRoot, (0, core_1.relative)(this._root.scope, action.to)), + }); + } + } + return scopedActions; + } + [interface_1.TreeSymbol]() { + return this; + } + _fullPath(path) { + return (0, core_1.join)(this._root.scope, (0, core_1.normalize)('/' + path)); + } + _fullPathAction(action) { + let fullPathAction; + if (action.kind === 'r') { + fullPathAction = { + ...action, + path: this._fullPath(action.path), + to: this._fullPath(action.to), + }; + } + else { + fullPathAction = { + ...action, + path: this._fullPath(action.path), + }; + } + return fullPathAction; + } +} +exports.ScopedTree = ScopedTree; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.d.ts new file mode 100644 index 00000000..9b7062ab --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.d.ts @@ -0,0 +1,13 @@ +/** + * @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 + */ +import { HostTree } from './host-tree'; +import { FilePredicate, MergeStrategy, Tree } from './interface'; +export declare function empty(): HostTree; +export declare function branch(tree: Tree): Tree; +export declare function merge(tree: Tree, other: Tree, strategy?: MergeStrategy): Tree; +export declare function partition(tree: Tree, predicate: FilePredicate): [Tree, Tree]; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.js new file mode 100644 index 00000000..70b5293c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/tree/static.js @@ -0,0 +1,38 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.partition = exports.merge = exports.branch = exports.empty = void 0; +const exception_1 = require("../exception/exception"); +const host_tree_1 = require("./host-tree"); +const interface_1 = require("./interface"); +function empty() { + return new host_tree_1.HostTree(); +} +exports.empty = empty; +function branch(tree) { + return tree.branch(); +} +exports.branch = branch; +function merge(tree, other, strategy = interface_1.MergeStrategy.Default) { + tree.merge(other, strategy); + return tree; +} +exports.merge = merge; +function partition(tree, predicate) { + if (tree instanceof host_tree_1.HostTree) { + return [ + new host_tree_1.FilterHostTree(tree, predicate), + new host_tree_1.FilterHostTree(tree, (path, entry) => !predicate(path, entry)), + ]; + } + else { + throw new exception_1.SchematicsException('Tree type is not supported.'); + } +} +exports.partition = partition; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.d.ts new file mode 100644 index 00000000..01f356cb --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.d.ts @@ -0,0 +1,8 @@ +/** + * @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 + */ +export declare const updateBufferV2Enabled: boolean; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.js new file mode 100644 index 00000000..a33531c4 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/environment-options.js @@ -0,0 +1,20 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateBufferV2Enabled = void 0; +function isEnabled(variable) { + return variable === '1' || variable.toLowerCase() === 'true'; +} +function isPresent(variable) { + return typeof variable === 'string' && variable !== ''; +} +// Use UpdateBuffer2, which uses magic-string internally. +// TODO: Switch this for the next major release to use UpdateBuffer2 by default. +const updateBufferV2 = process.env['NG_UPDATE_BUFFER_V2']; +exports.updateBufferV2Enabled = isPresent(updateBufferV2) && isEnabled(updateBufferV2); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.d.ts new file mode 100644 index 00000000..721aa6b7 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.d.ts @@ -0,0 +1,19 @@ +/** + * @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 + */ +export declare class LinkedList { + private _head; + constructor(_head: T); + get(l: number): T | null; + get head(): T; + get length(): number; + reduce(accumulator: (acc: R, value: T, index?: number) => R, seed: R): R; + find(predicate: (value: T, index?: number) => boolean): T | null; + forEach(visitor: (value: T, index?: number) => void): void; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.js new file mode 100644 index 00000000..847cdcd8 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/linked-list.js @@ -0,0 +1,68 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LinkedList = void 0; +class LinkedList { + constructor(_head) { + this._head = _head; + } + get(l) { + let c = this._head; + while (c && l > 0) { + l--; + c = c.next; + } + return c; + } + get head() { + return this._head; + } + get length() { + let c = this._head; + let i = 0; + while (c) { + i++; + c = c.next; + } + return i; + } + reduce(accumulator, seed) { + let c = this._head; + let acc = seed; + let i = 0; + while (c) { + acc = accumulator(acc, c, i); + i++; + c = c.next; + } + return acc; + } + find(predicate) { + let c = this._head; + let i = 0; + while (c) { + if (predicate(c, i)) { + break; + } + i++; + c = c.next; + } + return c; + } + forEach(visitor) { + let c = this._head; + let i = 0; + while (c) { + visitor(c, i); + i++; + c = c.next; + } + } +} +exports.LinkedList = LinkedList; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.d.ts new file mode 100644 index 00000000..7a7ec1bf --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.d.ts @@ -0,0 +1,118 @@ +/** + * @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 + */ +/// +import { BaseException } from '@angular-devkit/core'; +import MagicString from 'magic-string'; +import { LinkedList } from './linked-list'; +export declare class IndexOutOfBoundException extends BaseException { + constructor(index: number, min: number, max?: number); +} +/** @deprecated Since v13.0 */ +export declare class ContentCannotBeRemovedException extends BaseException { + constructor(); +} +/** + * A Chunk description, including left/right content that has been inserted. + * If _left/_right is null, this means that content was deleted. If the _content is null, + * it means the content itself was deleted. + * + * @see UpdateBuffer + * @deprecated Since v13.0 + */ +export declare class Chunk { + start: number; + end: number; + originalContent: Buffer; + private _content; + private _left; + private _right; + private _assertLeft; + private _assertRight; + next: Chunk | null; + constructor(start: number, end: number, originalContent: Buffer); + get length(): number; + toString(encoding?: BufferEncoding): string; + slice(start: number): Chunk; + append(buffer: Buffer, essential: boolean): void; + prepend(buffer: Buffer, essential: boolean): void; + assert(left: boolean, _content: boolean, right: boolean): void; + remove(left: boolean, content: boolean, right: boolean): void; + copy(target: Buffer, start: number): number; +} +/** + * Base class for an update buffer implementation that allows buffers to be inserted to the _right + * or _left, or deleted, while keeping indices to the original buffer. + */ +export declare abstract class UpdateBufferBase { + protected _originalContent: Buffer; + constructor(_originalContent: Buffer); + abstract get length(): number; + abstract get original(): Buffer; + abstract toString(encoding?: string): string; + abstract generate(): Buffer; + abstract insertLeft(index: number, content: Buffer, assert?: boolean): void; + abstract insertRight(index: number, content: Buffer, assert?: boolean): void; + abstract remove(index: number, length: number): void; + /** + * Creates an UpdateBufferBase instance. Depending on the NG_UPDATE_BUFFER_V2 + * environment variable, will either create an UpdateBuffer or an UpdateBuffer2 + * instance. + * + * See: https://github.com/angular/angular-cli/issues/21110 + * + * @param originalContent The original content of the update buffer instance. + * @returns An UpdateBufferBase instance. + */ + static create(originalContent: Buffer): UpdateBufferBase; +} +/** + * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while + * keeping indices to the original buffer. + * + * The constructor takes an original buffer, and keeps it into a linked list of chunks, smaller + * buffers that keep track of _content inserted to the _right or _left of it. + * + * Since the Node Buffer structure is non-destructive when slicing, we try to use slicing to create + * new chunks, and always keep chunks pointing to the original content. + * + * @deprecated Since v13.0 + */ +export declare class UpdateBuffer extends UpdateBufferBase { + protected _linkedList: LinkedList; + constructor(originalContent: Buffer); + protected _assertIndex(index: number): void; + protected _slice(start: number): [Chunk, Chunk]; + /** + * Gets the position in the content based on the position in the string. + * Some characters might be wider than one byte, thus we have to determine the position using + * string functions. + */ + protected _getTextPosition(index: number): number; + get length(): number; + get original(): Buffer; + toString(encoding?: BufferEncoding): string; + generate(): Buffer; + insertLeft(index: number, content: Buffer, assert?: boolean): void; + insertRight(index: number, content: Buffer, assert?: boolean): void; + remove(index: number, length: number): void; +} +/** + * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while + * keeping indices to the original buffer. + */ +export declare class UpdateBuffer2 extends UpdateBufferBase { + protected _mutatableContent: MagicString; + protected _assertIndex(index: number): void; + get length(): number; + get original(): Buffer; + toString(): string; + generate(): Buffer; + insertLeft(index: number, content: Buffer): void; + insertRight(index: number, content: Buffer): void; + remove(index: number, length: number): void; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.js new file mode 100644 index 00000000..03f20846 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/utility/update-buffer.js @@ -0,0 +1,324 @@ +"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 __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UpdateBuffer2 = exports.UpdateBuffer = exports.UpdateBufferBase = exports.Chunk = exports.ContentCannotBeRemovedException = exports.IndexOutOfBoundException = void 0; +const core_1 = require("@angular-devkit/core"); +const magic_string_1 = __importDefault(require("magic-string")); +const environment_options_1 = require("./environment-options"); +const linked_list_1 = require("./linked-list"); +class IndexOutOfBoundException extends core_1.BaseException { + constructor(index, min, max = Infinity) { + super(`Index ${index} outside of range [${min}, ${max}].`); + } +} +exports.IndexOutOfBoundException = IndexOutOfBoundException; +/** @deprecated Since v13.0 */ +class ContentCannotBeRemovedException extends core_1.BaseException { + constructor() { + super(`User tried to remove content that was marked essential.`); + } +} +exports.ContentCannotBeRemovedException = ContentCannotBeRemovedException; +/** + * A Chunk description, including left/right content that has been inserted. + * If _left/_right is null, this means that content was deleted. If the _content is null, + * it means the content itself was deleted. + * + * @see UpdateBuffer + * @deprecated Since v13.0 + */ +class Chunk { + constructor(start, end, originalContent) { + this.start = start; + this.end = end; + this.originalContent = originalContent; + this._left = Buffer.alloc(0); + this._right = Buffer.alloc(0); + this._assertLeft = false; + this._assertRight = false; + this.next = null; + this._content = originalContent.slice(start, end); + } + get length() { + return ((this._left ? this._left.length : 0) + + (this._content ? this._content.length : 0) + + (this._right ? this._right.length : 0)); + } + toString(encoding = 'utf-8') { + return ((this._left ? this._left.toString(encoding) : '') + + (this._content ? this._content.toString(encoding) : '') + + (this._right ? this._right.toString(encoding) : '')); + } + slice(start) { + if (start < this.start || start > this.end) { + throw new IndexOutOfBoundException(start, this.start, this.end); + } + // Update _content to the new indices. + const newChunk = new Chunk(start, this.end, this.originalContent); + // If this chunk has _content, reslice the original _content. We move the _right so we are not + // losing any data here. If this chunk has been deleted, the next chunk should also be deleted. + if (this._content) { + this._content = this.originalContent.slice(this.start, start); + } + else { + newChunk._content = this._content; + if (this._right === null) { + newChunk._left = null; + } + } + this.end = start; + // Move _right to the new chunk. + newChunk._right = this._right; + this._right = this._right && Buffer.alloc(0); + // Update essentials. + if (this._assertRight) { + newChunk._assertRight = true; + this._assertRight = false; + } + // Update the linked list. + newChunk.next = this.next; + this.next = newChunk; + return newChunk; + } + append(buffer, essential) { + if (!this._right) { + if (essential) { + throw new ContentCannotBeRemovedException(); + } + return; + } + const outro = this._right; + this._right = Buffer.alloc(outro.length + buffer.length); + outro.copy(this._right, 0); + buffer.copy(this._right, outro.length); + if (essential) { + this._assertRight = true; + } + } + prepend(buffer, essential) { + if (!this._left) { + if (essential) { + throw new ContentCannotBeRemovedException(); + } + return; + } + const intro = this._left; + this._left = Buffer.alloc(intro.length + buffer.length); + intro.copy(this._left, 0); + buffer.copy(this._left, intro.length); + if (essential) { + this._assertLeft = true; + } + } + assert(left, _content, right) { + if (left && this._assertLeft) { + throw new ContentCannotBeRemovedException(); + } + if (right && this._assertRight) { + throw new ContentCannotBeRemovedException(); + } + } + remove(left, content, right) { + if (left) { + if (this._assertLeft) { + throw new ContentCannotBeRemovedException(); + } + this._left = null; + } + if (content) { + this._content = null; + } + if (right) { + if (this._assertRight) { + throw new ContentCannotBeRemovedException(); + } + this._right = null; + } + } + copy(target, start) { + if (this._left) { + this._left.copy(target, start); + start += this._left.length; + } + if (this._content) { + this._content.copy(target, start); + start += this._content.length; + } + if (this._right) { + this._right.copy(target, start); + start += this._right.length; + } + return start; + } +} +exports.Chunk = Chunk; +/** + * Base class for an update buffer implementation that allows buffers to be inserted to the _right + * or _left, or deleted, while keeping indices to the original buffer. + */ +class UpdateBufferBase { + constructor(_originalContent) { + this._originalContent = _originalContent; + } + /** + * Creates an UpdateBufferBase instance. Depending on the NG_UPDATE_BUFFER_V2 + * environment variable, will either create an UpdateBuffer or an UpdateBuffer2 + * instance. + * + * See: https://github.com/angular/angular-cli/issues/21110 + * + * @param originalContent The original content of the update buffer instance. + * @returns An UpdateBufferBase instance. + */ + static create(originalContent) { + return environment_options_1.updateBufferV2Enabled + ? new UpdateBuffer2(originalContent) + : new UpdateBuffer(originalContent); + } +} +exports.UpdateBufferBase = UpdateBufferBase; +/** + * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while + * keeping indices to the original buffer. + * + * The constructor takes an original buffer, and keeps it into a linked list of chunks, smaller + * buffers that keep track of _content inserted to the _right or _left of it. + * + * Since the Node Buffer structure is non-destructive when slicing, we try to use slicing to create + * new chunks, and always keep chunks pointing to the original content. + * + * @deprecated Since v13.0 + */ +class UpdateBuffer extends UpdateBufferBase { + constructor(originalContent) { + super(originalContent); + this._linkedList = new linked_list_1.LinkedList(new Chunk(0, originalContent.length, originalContent)); + } + _assertIndex(index) { + if (index < 0 || index > this._originalContent.length) { + throw new IndexOutOfBoundException(index, 0, this._originalContent.length); + } + } + _slice(start) { + let index; + if (start >= this._originalContent.length) { + index = start; + } + else if (start < 0) { + index = this._originalContent.length + start; + } + else { + index = this._getTextPosition(start); + } + this._assertIndex(index); + // Find the chunk by going through the list. + const h = this._linkedList.find((chunk) => index <= chunk.end); + if (!h) { + throw Error('Chunk cannot be found.'); + } + if (index == h.end && h.next !== null) { + return [h, h.next]; + } + return [h, h.slice(index)]; + } + /** + * Gets the position in the content based on the position in the string. + * Some characters might be wider than one byte, thus we have to determine the position using + * string functions. + */ + _getTextPosition(index) { + return Buffer.from(this._originalContent.toString().substring(0, index)).length; + } + get length() { + return this._linkedList.reduce((acc, chunk) => acc + chunk.length, 0); + } + get original() { + return this._originalContent; + } + toString(encoding = 'utf-8') { + return this._linkedList.reduce((acc, chunk) => acc + chunk.toString(encoding), ''); + } + generate() { + const result = Buffer.allocUnsafe(this.length); + let i = 0; + this._linkedList.forEach((chunk) => { + chunk.copy(result, i); + i += chunk.length; + }); + return result; + } + insertLeft(index, content, assert = false) { + this._slice(index)[0].append(content, assert); + } + insertRight(index, content, assert = false) { + this._slice(index)[1].prepend(content, assert); + } + remove(index, length) { + if (length === 0) { + return; + } + const end = index + length; + const first = this._slice(index)[1]; + const last = this._slice(end)[1]; + let curr; + for (curr = first; curr && curr !== last; curr = curr.next) { + curr.assert(curr !== first, curr !== last, curr === first); + } + for (curr = first; curr && curr !== last; curr = curr.next) { + curr.remove(curr !== first, curr !== last, curr === first); + } + if (curr) { + curr.remove(true, false, false); + } + } +} +exports.UpdateBuffer = UpdateBuffer; +/** + * An utility class that allows buffers to be inserted to the _right or _left, or deleted, while + * keeping indices to the original buffer. + */ +class UpdateBuffer2 extends UpdateBufferBase { + constructor() { + super(...arguments); + this._mutatableContent = new magic_string_1.default(this._originalContent.toString()); + } + _assertIndex(index) { + if (index < 0 || index > this._originalContent.length) { + throw new IndexOutOfBoundException(index, 0, this._originalContent.length); + } + } + get length() { + return this._mutatableContent.length(); + } + get original() { + return this._originalContent; + } + toString() { + return this._mutatableContent.toString(); + } + generate() { + return Buffer.from(this.toString()); + } + insertLeft(index, content) { + this._assertIndex(index); + this._mutatableContent.appendLeft(index, content.toString()); + } + insertRight(index, content) { + this._assertIndex(index); + this._mutatableContent.appendRight(index, content.toString()); + } + remove(index, length) { + this._assertIndex(index); + this._mutatableContent.remove(index, index + length); + } +} +exports.UpdateBuffer2 = UpdateBuffer2; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.d.ts new file mode 100644 index 00000000..532f88e6 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.d.ts @@ -0,0 +1,51 @@ +/** + * @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 + */ +import { schema, virtualFs } from '@angular-devkit/core'; +import { Observable, Subject } from 'rxjs'; +import { Engine, EngineHost } from '../engine'; +import { DryRunEvent } from '../sink/dryrun'; +import { Sink } from '../sink/sink'; +import { LifeCycleEvent, RequiredWorkflowExecutionContext, Workflow, WorkflowExecutionContext } from './interface'; +export interface BaseWorkflowOptions { + host: virtualFs.Host; + engineHost: EngineHost<{}, {}>; + registry?: schema.CoreSchemaRegistry; + force?: boolean; + dryRun?: boolean; +} +/** + * Base class for workflows. Even without abstract methods, this class should not be used without + * surrounding some initialization for the registry and host. This class only adds life cycle and + * dryrun/force support. You need to provide any registry and task executors that you need to + * support. + * See {@see NodeWorkflow} implementation for how to make a specialized subclass of this. + * TODO: add default set of CoreSchemaRegistry transforms. Once the job refactor is done, use that + * as the support for tasks. + * + * @public + */ +export declare abstract class BaseWorkflow implements Workflow { + protected _engine: Engine<{}, {}>; + protected _engineHost: EngineHost<{}, {}>; + protected _registry: schema.CoreSchemaRegistry; + protected _host: virtualFs.Host; + protected _reporter: Subject; + protected _lifeCycle: Subject; + protected _context: WorkflowExecutionContext[]; + protected _force: boolean; + protected _dryRun: boolean; + constructor(options: BaseWorkflowOptions); + get context(): Readonly; + get engine(): Engine<{}, {}>; + get engineHost(): EngineHost<{}, {}>; + get registry(): schema.SchemaRegistry; + get reporter(): Observable; + get lifeCycle(): Observable; + protected _createSinks(): Sink[]; + execute(options: Partial & RequiredWorkflowExecutionContext): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.js new file mode 100644 index 00000000..5847c0dc --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/base.js @@ -0,0 +1,138 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseWorkflow = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const engine_1 = require("../engine"); +const exception_1 = require("../exception/exception"); +const formats_1 = require("../formats"); +const dryrun_1 = require("../sink/dryrun"); +const host_1 = require("../sink/host"); +const host_tree_1 = require("../tree/host-tree"); +/** + * Base class for workflows. Even without abstract methods, this class should not be used without + * surrounding some initialization for the registry and host. This class only adds life cycle and + * dryrun/force support. You need to provide any registry and task executors that you need to + * support. + * See {@see NodeWorkflow} implementation for how to make a specialized subclass of this. + * TODO: add default set of CoreSchemaRegistry transforms. Once the job refactor is done, use that + * as the support for tasks. + * + * @public + */ +class BaseWorkflow { + constructor(options) { + this._reporter = new rxjs_1.Subject(); + this._lifeCycle = new rxjs_1.Subject(); + this._host = options.host; + this._engineHost = options.engineHost; + if (options.registry) { + this._registry = options.registry; + } + else { + this._registry = new core_1.schema.CoreSchemaRegistry(formats_1.standardFormats); + this._registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults); + } + this._engine = new engine_1.SchematicEngine(this._engineHost, this); + this._context = []; + this._force = options.force || false; + this._dryRun = options.dryRun || false; + } + get context() { + const maybeContext = this._context[this._context.length - 1]; + if (!maybeContext) { + throw new Error('Cannot get context when workflow is not executing...'); + } + return maybeContext; + } + get engine() { + return this._engine; + } + get engineHost() { + return this._engineHost; + } + get registry() { + return this._registry; + } + get reporter() { + return this._reporter.asObservable(); + } + get lifeCycle() { + return this._lifeCycle.asObservable(); + } + _createSinks() { + let error = false; + const dryRunSink = new dryrun_1.DryRunSink(this._host, this._force); + const dryRunSubscriber = dryRunSink.reporter.subscribe((event) => { + this._reporter.next(event); + error = error || event.kind == 'error'; + }); + // We need two sinks if we want to output what will happen, and actually do the work. + return [ + dryRunSink, + // Add a custom sink that clean ourselves and throws an error if an error happened. + { + commit() { + dryRunSubscriber.unsubscribe(); + if (error) { + return (0, rxjs_1.throwError)(new exception_1.UnsuccessfulWorkflowExecution()); + } + return (0, rxjs_1.of)(); + }, + }, + // Only add a HostSink if this is not a dryRun. + ...(!this._dryRun ? [new host_1.HostSink(this._host, this._force)] : []), + ]; + } + execute(options) { + const parentContext = this._context[this._context.length - 1]; + if (!parentContext) { + this._lifeCycle.next({ kind: 'start' }); + } + /** Create the collection and the schematic. */ + const collection = this._engine.createCollection(options.collection); + // Only allow private schematics if called from the same collection. + const allowPrivate = options.allowPrivate || (parentContext && parentContext.collection === options.collection); + const schematic = collection.createSchematic(options.schematic, allowPrivate); + const sinks = this._createSinks(); + this._lifeCycle.next({ kind: 'workflow-start' }); + const context = { + ...options, + debug: options.debug || false, + logger: options.logger || (parentContext && parentContext.logger) || new core_1.logging.NullLogger(), + parentContext, + }; + this._context.push(context); + return schematic + .call(options.options, (0, rxjs_1.of)(new host_tree_1.HostTree(this._host)), { logger: context.logger }) + .pipe((0, operators_1.concatMap)((tree) => { + // Process all sinks. + return (0, rxjs_1.concat)((0, rxjs_1.from)(sinks).pipe((0, operators_1.concatMap)((sink) => sink.commit(tree)), (0, operators_1.ignoreElements)()), (0, rxjs_1.of)(tree)); + }), (0, operators_1.concatMap)(() => { + if (this._dryRun) { + return rxjs_1.EMPTY; + } + this._lifeCycle.next({ kind: 'post-tasks-start' }); + return this._engine + .executePostTasks() + .pipe((0, operators_1.tap)({ complete: () => this._lifeCycle.next({ kind: 'post-tasks-end' }) }), (0, operators_1.defaultIfEmpty)(), (0, operators_1.last)()); + }), (0, operators_1.tap)({ + complete: () => { + this._lifeCycle.next({ kind: 'workflow-end' }); + this._context.pop(); + if (this._context.length == 0) { + this._lifeCycle.next({ kind: 'end' }); + } + }, + })); + } +} +exports.BaseWorkflow = BaseWorkflow; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.d.ts new file mode 100644 index 00000000..3abed265 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +export * from './base'; +export * from './interface'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.js new file mode 100644 index 00000000..5bb1e71d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/index.js @@ -0,0 +1,21 @@ +"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 __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./base"), exports); +__exportStar(require("./interface"), exports); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.d.ts new file mode 100644 index 00000000..a1b71c37 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.d.ts @@ -0,0 +1,27 @@ +/** + * @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 + */ +import { logging } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +export interface RequiredWorkflowExecutionContext { + collection: string; + schematic: string; + options: object; +} +export interface WorkflowExecutionContext extends RequiredWorkflowExecutionContext { + debug: boolean; + logger: logging.Logger; + parentContext?: Readonly; + allowPrivate?: boolean; +} +export interface LifeCycleEvent { + kind: 'start' | 'end' | 'workflow-start' | 'workflow-end' | 'post-tasks-start' | 'post-tasks-end'; +} +export interface Workflow { + readonly context: Readonly; + execute(options: Partial & RequiredWorkflowExecutionContext): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.js new file mode 100644 index 00000000..b599b96d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/src/workflow/interface.js @@ -0,0 +1,9 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/BUILD.bazel b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/BUILD.bazel new file mode 100644 index 00000000..09f1ba24 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/BUILD.bazel @@ -0,0 +1,35 @@ +load("//tools:defaults.bzl", "ts_library") + +# Copyright Google Inc. 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 +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "tasks", + srcs = glob( + include = ["**/*.ts"], + exclude = [ + "node/**/*.ts", + "**/*_spec.ts", + "**/*_benchmark.ts", + ], + ), + data = ["package.json"], + module_name = "@angular-devkit/schematics/tasks", + module_root = "index.d.ts", + # The attribute below is needed in g3 to turn off strict typechecking + # strict_checks = False, + deps = [ + "//packages/angular_devkit/core", + "//packages/angular_devkit/core/node", + "//packages/angular_devkit/schematics", + "@npm//@types/node", + "@npm//ora", + "@npm//rxjs", + "@npm//typescript", + ], +) diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.d.ts new file mode 100644 index 00000000..36c11571 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.d.ts @@ -0,0 +1,11 @@ +/** + * @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 + */ +export { NodePackageInstallTask } from './package-manager/install-task'; +export { NodePackageLinkTask } from './package-manager/link-task'; +export { RepositoryInitializerTask } from './repo-init/init-task'; +export { RunSchematicTask } from './run-schematic/task'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.js new file mode 100644 index 00000000..d43e7a11 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/index.js @@ -0,0 +1,18 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunSchematicTask = exports.RepositoryInitializerTask = exports.NodePackageLinkTask = exports.NodePackageInstallTask = void 0; +var install_task_1 = require("./package-manager/install-task"); +Object.defineProperty(exports, "NodePackageInstallTask", { enumerable: true, get: function () { return install_task_1.NodePackageInstallTask; } }); +var link_task_1 = require("./package-manager/link-task"); +Object.defineProperty(exports, "NodePackageLinkTask", { enumerable: true, get: function () { return link_task_1.NodePackageLinkTask; } }); +var init_task_1 = require("./repo-init/init-task"); +Object.defineProperty(exports, "RepositoryInitializerTask", { enumerable: true, get: function () { return init_task_1.RepositoryInitializerTask; } }); +var task_1 = require("./run-schematic/task"); +Object.defineProperty(exports, "RunSchematicTask", { enumerable: true, get: function () { return task_1.RunSchematicTask; } }); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/BUILD.bazel b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/BUILD.bazel new file mode 100644 index 00000000..230f2f37 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/BUILD.bazel @@ -0,0 +1,32 @@ +load("//tools:defaults.bzl", "ts_library") + +# Copyright Google Inc. 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 +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "node", + srcs = glob( + include = ["**/*.ts"], + exclude = [ + "**/*_spec.ts", + "**/*_benchmark.ts", + ], + ), + module_name = "@angular-devkit/schematics/tasks/node", + module_root = "index.d.ts", + # The attribute below is needed in g3 to turn off strict typechecking + # strict_checks = False, + deps = [ + "//packages/angular_devkit/core", + "//packages/angular_devkit/core/node", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics/tasks", + "@npm//@types/node", + "@npm//rxjs", + ], +) diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.d.ts new file mode 100644 index 00000000..0bebe160 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.d.ts @@ -0,0 +1,15 @@ +/** + * @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 + */ +import { TaskExecutorFactory } from '../../src'; +import { NodePackageTaskFactoryOptions } from '../package-manager/options'; +import { RepositoryInitializerTaskFactoryOptions } from '../repo-init/options'; +export declare class BuiltinTaskExecutor { + static readonly NodePackage: TaskExecutorFactory; + static readonly RepositoryInitializer: TaskExecutorFactory; + static readonly RunSchematic: TaskExecutorFactory<{}>; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.js new file mode 100644 index 00000000..54120661 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/node/index.js @@ -0,0 +1,47 @@ +"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.BuiltinTaskExecutor = void 0; +const options_1 = require("../package-manager/options"); +const options_2 = require("../repo-init/options"); +const options_3 = require("../run-schematic/options"); +class BuiltinTaskExecutor { +} +exports.BuiltinTaskExecutor = BuiltinTaskExecutor; +BuiltinTaskExecutor.NodePackage = { + name: options_1.NodePackageName, + create: (options) => Promise.resolve().then(() => __importStar(require('../package-manager/executor'))).then((mod) => mod.default(options)), +}; +BuiltinTaskExecutor.RepositoryInitializer = { + name: options_2.RepositoryInitializerName, + create: (options) => Promise.resolve().then(() => __importStar(require('../repo-init/executor'))).then((mod) => mod.default(options)), +}; +BuiltinTaskExecutor.RunSchematic = { + name: options_3.RunSchematicName, + create: () => Promise.resolve().then(() => __importStar(require('../run-schematic/executor'))).then((mod) => mod.default()), +}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.d.ts new file mode 100644 index 00000000..4fa6cca4 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.d.ts @@ -0,0 +1,14 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +import { TaskExecutor } from '../../src'; +import { NodePackageTaskFactoryOptions, NodePackageTaskOptions } from './options'; +export declare class UnknownPackageManagerException extends BaseException { + constructor(name: string); +} +export default function (factoryOptions?: NodePackageTaskFactoryOptions): TaskExecutor; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js new file mode 100644 index 00000000..bc656111 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js @@ -0,0 +1,144 @@ +"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; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownPackageManagerException = void 0; +const core_1 = require("@angular-devkit/core"); +const child_process_1 = require("child_process"); +const ora_1 = __importDefault(require("ora")); +const path = __importStar(require("path")); +const rxjs_1 = require("rxjs"); +const src_1 = require("../../src"); +const packageManagers = { + 'npm': { + quietArgument: '--quiet', + commands: { + installAll: 'install', + installPackage: 'install', + }, + }, + 'cnpm': { + commands: { + installAll: 'install', + installPackage: 'install', + }, + }, + 'yarn': { + quietArgument: '--silent', + commands: { + installPackage: 'add', + }, + }, + 'pnpm': { + quietArgument: '--silent', + commands: { + installAll: 'install', + installPackage: 'install', + }, + }, +}; +class UnknownPackageManagerException extends core_1.BaseException { + constructor(name) { + super(`Unknown package manager "${name}".`); + } +} +exports.UnknownPackageManagerException = UnknownPackageManagerException; +function default_1(factoryOptions = {}) { + const packageManagerName = factoryOptions.packageManager || 'npm'; + const packageManagerProfile = packageManagers[packageManagerName]; + if (!packageManagerProfile) { + throw new UnknownPackageManagerException(packageManagerName); + } + const rootDirectory = factoryOptions.rootDirectory || process.cwd(); + return (options = { command: 'install' }) => { + let taskPackageManagerProfile = packageManagerProfile; + let taskPackageManagerName = packageManagerName; + if (factoryOptions.allowPackageManagerOverride && options.packageManager) { + taskPackageManagerProfile = packageManagers[options.packageManager]; + if (!taskPackageManagerProfile) { + throw new UnknownPackageManagerException(options.packageManager); + } + taskPackageManagerName = options.packageManager; + } + const bufferedOutput = []; + const spawnOptions = { + stdio: options.hideOutput ? 'pipe' : 'inherit', + shell: true, + cwd: path.join(rootDirectory, options.workingDirectory || ''), + }; + const args = []; + if (options.packageName) { + if (options.command === 'install') { + args.push(taskPackageManagerProfile.commands.installPackage); + } + args.push(options.packageName); + } + else if (options.command === 'install' && taskPackageManagerProfile.commands.installAll) { + args.push(taskPackageManagerProfile.commands.installAll); + } + if (options.quiet && taskPackageManagerProfile.quietArgument) { + args.push(taskPackageManagerProfile.quietArgument); + } + if (factoryOptions.registry) { + args.push(`--registry="${factoryOptions.registry}"`); + } + if (factoryOptions.force) { + args.push('--force'); + } + return new rxjs_1.Observable((obs) => { + var _a, _b; + const spinner = (0, ora_1.default)({ + text: `Installing packages (${taskPackageManagerName})...`, + // Workaround for https://github.com/sindresorhus/ora/issues/136. + discardStdin: process.platform != 'win32', + }).start(); + const childProcess = (0, child_process_1.spawn)(taskPackageManagerName, args, spawnOptions).on('close', (code) => { + if (code === 0) { + spinner.succeed('Packages installed successfully.'); + spinner.stop(); + obs.next(); + obs.complete(); + } + else { + if (options.hideOutput) { + bufferedOutput.forEach(({ stream, data }) => stream.write(data)); + } + spinner.fail('Package install failed, see above.'); + obs.error(new src_1.UnsuccessfulWorkflowExecution()); + } + }); + if (options.hideOutput) { + (_a = childProcess.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => bufferedOutput.push({ stream: process.stdout, data: data })); + (_b = childProcess.stderr) === null || _b === void 0 ? void 0 : _b.on('data', (data) => bufferedOutput.push({ stream: process.stderr, data: data })); + } + }); + }; +} +exports.default = default_1; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts new file mode 100644 index 00000000..69924a69 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.d.ts @@ -0,0 +1,27 @@ +/** + * @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 + */ +import { TaskConfiguration, TaskConfigurationGenerator } from '../../src'; +import { NodePackageTaskOptions } from './options'; +interface NodePackageInstallTaskOptions { + packageManager?: string; + packageName?: string; + workingDirectory?: string; + quiet?: boolean; + hideOutput?: boolean; +} +export declare class NodePackageInstallTask implements TaskConfigurationGenerator { + quiet: boolean; + hideOutput: boolean; + workingDirectory?: string; + packageManager?: string; + packageName?: string; + constructor(workingDirectory?: string); + constructor(options: NodePackageInstallTaskOptions); + toConfiguration(): TaskConfiguration; +} +export {}; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js new file mode 100644 index 00000000..ae02887b --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/install-task.js @@ -0,0 +1,51 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodePackageInstallTask = void 0; +const options_1 = require("./options"); +class NodePackageInstallTask { + constructor(options) { + this.quiet = true; + this.hideOutput = true; + if (typeof options === 'string') { + this.workingDirectory = options; + } + else if (typeof options === 'object') { + if (options.quiet != undefined) { + this.quiet = options.quiet; + } + if (options.hideOutput != undefined) { + this.hideOutput = options.hideOutput; + } + if (options.workingDirectory != undefined) { + this.workingDirectory = options.workingDirectory; + } + if (options.packageManager != undefined) { + this.packageManager = options.packageManager; + } + if (options.packageName != undefined) { + this.packageName = options.packageName; + } + } + } + toConfiguration() { + return { + name: options_1.NodePackageName, + options: { + command: 'install', + quiet: this.quiet, + hideOutput: this.hideOutput, + workingDirectory: this.workingDirectory, + packageManager: this.packageManager, + packageName: this.packageName, + }, + }; + } +} +exports.NodePackageInstallTask = NodePackageInstallTask; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.d.ts new file mode 100644 index 00000000..c7d2b63c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.d.ts @@ -0,0 +1,16 @@ +/** + * @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 + */ +import { TaskConfiguration, TaskConfigurationGenerator } from '../../src'; +import { NodePackageTaskOptions } from './options'; +export declare class NodePackageLinkTask implements TaskConfigurationGenerator { + packageName?: string | undefined; + workingDirectory?: string | undefined; + quiet: boolean; + constructor(packageName?: string | undefined, workingDirectory?: string | undefined); + toConfiguration(): TaskConfiguration; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.js new file mode 100644 index 00000000..2518b4cb --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/link-task.js @@ -0,0 +1,30 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodePackageLinkTask = void 0; +const options_1 = require("./options"); +class NodePackageLinkTask { + constructor(packageName, workingDirectory) { + this.packageName = packageName; + this.workingDirectory = workingDirectory; + this.quiet = true; + } + toConfiguration() { + return { + name: options_1.NodePackageName, + options: { + command: 'link', + quiet: this.quiet, + workingDirectory: this.workingDirectory, + packageName: this.packageName, + }, + }; + } +} +exports.NodePackageLinkTask = NodePackageLinkTask; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts new file mode 100644 index 00000000..60c1253f --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.d.ts @@ -0,0 +1,23 @@ +/** + * @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 + */ +export declare const NodePackageName = "node-package"; +export interface NodePackageTaskFactoryOptions { + rootDirectory?: string; + packageManager?: string; + allowPackageManagerOverride?: boolean; + registry?: string; + force?: boolean; +} +export interface NodePackageTaskOptions { + command: string; + quiet?: boolean; + hideOutput?: boolean; + workingDirectory?: string; + packageName?: string; + packageManager?: string; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js new file mode 100644 index 00000000..3b33121f --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package-manager/options.js @@ -0,0 +1,11 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodePackageName = void 0; +exports.NodePackageName = 'node-package'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package.json b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package.json new file mode 100644 index 00000000..075ac40a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/package.json @@ -0,0 +1,5 @@ +{ + "name": "@angular-devkit/schematics/tasks", + "main": "index.js", + "typings": "index.d.ts" +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts new file mode 100644 index 00000000..e412a64b --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts @@ -0,0 +1,10 @@ +/** + * @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 + */ +import { TaskExecutor } from '../../src'; +import { RepositoryInitializerTaskFactoryOptions, RepositoryInitializerTaskOptions } from './options'; +export default function (factoryOptions?: RepositoryInitializerTaskFactoryOptions): TaskExecutor; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js new file mode 100644 index 00000000..4acf4f56 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js @@ -0,0 +1,90 @@ +"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 }); +const core_1 = require("@angular-devkit/core"); +const child_process_1 = require("child_process"); +const path = __importStar(require("path")); +function default_1(factoryOptions = {}) { + const rootDirectory = factoryOptions.rootDirectory || process.cwd(); + return async (options = {}, context) => { + const authorName = options.authorName; + const authorEmail = options.authorEmail; + const execute = (args, ignoreErrorStream) => { + const outputStream = 'ignore'; + const errorStream = ignoreErrorStream ? 'ignore' : process.stderr; + const spawnOptions = { + stdio: [process.stdin, outputStream, errorStream], + shell: true, + cwd: path.join(rootDirectory, options.workingDirectory || ''), + env: { + ...process.env, + ...(authorName ? { GIT_AUTHOR_NAME: authorName, GIT_COMMITTER_NAME: authorName } : {}), + ...(authorEmail + ? { GIT_AUTHOR_EMAIL: authorEmail, GIT_COMMITTER_EMAIL: authorEmail } + : {}), + }, + }; + return new Promise((resolve, reject) => { + (0, child_process_1.spawn)('git', args, spawnOptions).on('close', (code) => { + if (code === 0) { + resolve(); + } + else { + reject(code); + } + }); + }); + }; + const hasCommand = await execute(['--version']).then(() => true, () => false); + if (!hasCommand) { + return; + } + const insideRepo = await execute(['rev-parse', '--is-inside-work-tree'], true).then(() => true, () => false); + if (insideRepo) { + context.logger.info(core_1.tags.oneLine ` + Directory is already under version control. + Skipping initialization of git. + `); + return; + } + // if git is not found or an error was thrown during the `git` + // init process just swallow any errors here + // NOTE: This will be removed once task error handling is implemented + try { + await execute(['init']); + await execute(['add', '.']); + if (options.commit) { + const message = options.message || 'initial commit'; + await execute(['commit', `-m "${message}"`]); + } + context.logger.info('Successfully initialized git.'); + } + catch { } + }; +} +exports.default = default_1; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts new file mode 100644 index 00000000..08fd4040 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts @@ -0,0 +1,20 @@ +/** + * @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 + */ +import { TaskConfiguration, TaskConfigurationGenerator } from '../../src'; +import { RepositoryInitializerTaskOptions } from './options'; +export interface CommitOptions { + message?: string; + name?: string; + email?: string; +} +export declare class RepositoryInitializerTask implements TaskConfigurationGenerator { + workingDirectory?: string | undefined; + commitOptions?: CommitOptions | undefined; + constructor(workingDirectory?: string | undefined, commitOptions?: CommitOptions | undefined); + toConfiguration(): TaskConfiguration; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js new file mode 100644 index 00000000..8809b29f --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js @@ -0,0 +1,30 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RepositoryInitializerTask = void 0; +const options_1 = require("./options"); +class RepositoryInitializerTask { + constructor(workingDirectory, commitOptions) { + this.workingDirectory = workingDirectory; + this.commitOptions = commitOptions; + } + toConfiguration() { + return { + name: options_1.RepositoryInitializerName, + options: { + commit: !!this.commitOptions, + workingDirectory: this.workingDirectory, + authorName: this.commitOptions && this.commitOptions.name, + authorEmail: this.commitOptions && this.commitOptions.email, + message: this.commitOptions && this.commitOptions.message, + }, + }; + } +} +exports.RepositoryInitializerTask = RepositoryInitializerTask; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts new file mode 100644 index 00000000..93816617 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts @@ -0,0 +1,18 @@ +/** + * @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 + */ +export declare const RepositoryInitializerName = "repo-init"; +export interface RepositoryInitializerTaskFactoryOptions { + rootDirectory?: string; +} +export interface RepositoryInitializerTaskOptions { + workingDirectory?: string; + commit?: boolean; + message?: string; + authorName?: string; + authorEmail?: string; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js new file mode 100644 index 00000000..2185b470 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js @@ -0,0 +1,11 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RepositoryInitializerName = void 0; +exports.RepositoryInitializerName = 'repo-init'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts new file mode 100644 index 00000000..f445760e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.d.ts @@ -0,0 +1,10 @@ +/** + * @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 + */ +import { TaskExecutor } from '../../src'; +import { RunSchematicTaskOptions } from './options'; +export default function (): TaskExecutor>; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js new file mode 100644 index 00000000..9b93e152 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/executor.js @@ -0,0 +1,29 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +function default_1() { + return (options, context) => { + if (!(options === null || options === void 0 ? void 0 : options.name)) { + throw new Error('RunSchematicTask requires an options object with a non-empty name property.'); + } + const maybeWorkflow = context.engine.workflow; + const collection = options.collection || context.schematic.collection.description.name; + if (!maybeWorkflow) { + throw new Error('Need Workflow to support executing schematics as post tasks.'); + } + return maybeWorkflow.execute({ + collection: collection, + schematic: options.name, + options: options.options, + // Allow private when calling from the same collection. + allowPrivate: collection == context.schematic.collection.description.name, + }); + }; +} +exports.default = default_1; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.d.ts new file mode 100644 index 00000000..1dca95da --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.d.ts @@ -0,0 +1,13 @@ +/** + * @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 + */ +export declare const RunSchematicName = "run-schematic"; +export interface RunSchematicTaskOptions { + collection: string | null; + name: string; + options: T; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js new file mode 100644 index 00000000..d77ec6a6 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/options.js @@ -0,0 +1,11 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunSchematicName = void 0; +exports.RunSchematicName = 'run-schematic'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts new file mode 100644 index 00000000..2ff0e5bf --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.d.ts @@ -0,0 +1,17 @@ +/** + * @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 + */ +import { TaskConfiguration, TaskConfigurationGenerator } from '../../src'; +import { RunSchematicTaskOptions } from './options'; +export declare class RunSchematicTask implements TaskConfigurationGenerator> { + protected _collection: string | null; + protected _schematic: string; + protected _options: T; + constructor(s: string, o: T); + constructor(c: string, s: string, o: T); + toConfiguration(): TaskConfiguration>; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.js new file mode 100644 index 00000000..595848b5 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/run-schematic/task.js @@ -0,0 +1,34 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunSchematicTask = void 0; +const options_1 = require("./options"); +class RunSchematicTask { + constructor(c, s, o) { + if (arguments.length == 2 || typeof s !== 'string') { + o = s; + s = c; + c = null; + } + this._collection = c; + this._schematic = s; + this._options = o; + } + toConfiguration() { + return { + name: options_1.RunSchematicName, + options: { + collection: this._collection, + name: this._schematic, + options: this._options, + }, + }; + } +} +exports.RunSchematicTask = RunSchematicTask; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/BUILD.bazel b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/BUILD.bazel new file mode 100644 index 00000000..5442ff4b --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/BUILD.bazel @@ -0,0 +1,28 @@ +load("//tools:defaults.bzl", "ts_library") + +# Copyright Google Inc. 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 +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "testing", + srcs = glob( + include = ["**/*.ts"], + ), + data = ["package.json"], + module_name = "@angular-devkit/schematics/testing", + module_root = "index.d.ts", + deps = [ + "//packages/angular_devkit/core", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics/tasks", + "//packages/angular_devkit/schematics/tasks/node", + "//packages/angular_devkit/schematics/tools", + "@npm//@types/node", + "@npm//rxjs", + ], +) diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.d.ts new file mode 100644 index 00000000..3c315c83 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.d.ts @@ -0,0 +1,8 @@ +/** + * @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 + */ +export * from './schematic-test-runner'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.js new file mode 100644 index 00000000..a01e5efa --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/index.js @@ -0,0 +1,20 @@ +"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 __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./schematic-test-runner"), exports); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/package.json b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/package.json new file mode 100644 index 00000000..05a24826 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/package.json @@ -0,0 +1,5 @@ +{ + "name": "@angular-devkit/schematics/testing", + "main": "index.js", + "typings": "index.d.ts" +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.d.ts new file mode 100644 index 00000000..055448af --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.d.ts @@ -0,0 +1,29 @@ +/** + * @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 + */ +import { logging } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { DelegateTree, Rule, SchematicContext, SchematicEngine, TaskConfiguration, Tree } from '../src'; +export declare class UnitTestTree extends DelegateTree { + get files(): string[]; + readContent(path: string): string; +} +export declare class SchematicTestRunner { + private _collectionName; + private _engineHost; + private _engine; + private _collection; + private _logger; + constructor(_collectionName: string, collectionPath: string); + get engine(): SchematicEngine<{}, {}>; + get logger(): logging.Logger; + get tasks(): TaskConfiguration[]; + registerCollection(collectionName: string, collectionPath: string): void; + runSchematicAsync(schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Observable; + runExternalSchematicAsync(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Observable; + callRule(rule: Rule, tree: Tree, parentContext?: Partial): Observable; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.js new file mode 100644 index 00000000..e5146ac9 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/testing/schematic-test-runner.js @@ -0,0 +1,82 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchematicTestRunner = exports.UnitTestTree = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const src_1 = require("../src"); +const call_1 = require("../src/rules/call"); +const node_1 = require("../tasks/node"); +const tools_1 = require("../tools"); +class UnitTestTree extends src_1.DelegateTree { + get files() { + const result = []; + this.visit((path) => result.push(path)); + return result; + } + readContent(path) { + const buffer = this.read(path); + if (buffer === null) { + return ''; + } + return buffer.toString(); + } +} +exports.UnitTestTree = UnitTestTree; +class SchematicTestRunner { + constructor(_collectionName, collectionPath) { + this._collectionName = _collectionName; + this._engineHost = new tools_1.NodeModulesTestEngineHost(); + this._engine = new src_1.SchematicEngine(this._engineHost); + this._engineHost.registerCollection(_collectionName, collectionPath); + this._logger = new core_1.logging.Logger('test'); + const registry = new core_1.schema.CoreSchemaRegistry(src_1.formats.standardFormats); + registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults); + this._engineHost.registerOptionsTransform((0, tools_1.validateOptionsWithSchema)(registry)); + this._engineHost.registerTaskExecutor(node_1.BuiltinTaskExecutor.NodePackage); + this._engineHost.registerTaskExecutor(node_1.BuiltinTaskExecutor.RepositoryInitializer); + this._engineHost.registerTaskExecutor(node_1.BuiltinTaskExecutor.RunSchematic); + this._collection = this._engine.createCollection(this._collectionName); + } + get engine() { + return this._engine; + } + get logger() { + return this._logger; + } + get tasks() { + return [...this._engineHost.tasks]; + } + registerCollection(collectionName, collectionPath) { + this._engineHost.registerCollection(collectionName, collectionPath); + } + runSchematicAsync(schematicName, opts, tree) { + const schematic = this._collection.createSchematic(schematicName, true); + const host = (0, rxjs_1.of)(tree || new src_1.HostTree()); + this._engineHost.clearTasks(); + return schematic + .call(opts || {}, host, { logger: this._logger }) + .pipe((0, operators_1.map)((tree) => new UnitTestTree(tree))); + } + runExternalSchematicAsync(collectionName, schematicName, opts, tree) { + const externalCollection = this._engine.createCollection(collectionName); + const schematic = externalCollection.createSchematic(schematicName, true); + const host = (0, rxjs_1.of)(tree || new src_1.HostTree()); + this._engineHost.clearTasks(); + return schematic + .call(opts || {}, host, { logger: this._logger }) + .pipe((0, operators_1.map)((tree) => new UnitTestTree(tree))); + } + callRule(rule, tree, parentContext) { + const context = this._engine.createContext({}, parentContext); + return (0, call_1.callRule)(rule, (0, rxjs_1.of)(tree), context); + } +} +exports.SchematicTestRunner = SchematicTestRunner; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/BUILD.bazel b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/BUILD.bazel new file mode 100644 index 00000000..c7514fb5 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/BUILD.bazel @@ -0,0 +1,67 @@ +load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") +load("//tools:defaults.bzl", "ts_library") + +# Copyright Google Inc. 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 +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "tools", + srcs = glob( + include = ["**/*.ts"], + exclude = [ + "**/*_spec.ts", + "**/*_benchmark.ts", + "test/**/*.ts", + ], + ), + data = ["package.json"], + module_name = "@angular-devkit/schematics/tools", + module_root = "index.d.ts", + # The attribute below is needed in g3 to turn off strict typechecking + # strict_checks = False, + deps = [ + "//packages/angular_devkit/core", + "//packages/angular_devkit/core/node", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics/tasks", + "//packages/angular_devkit/schematics/tasks/node", + "@npm//@types/node", + "@npm//jsonc-parser", + "@npm//rxjs", + ], +) + +ts_library( + name = "tools_test_lib", + testonly = True, + srcs = glob( + include = [ + "**/*_spec.ts", + "test/**/*.ts", + ], + ), + deps = [ + ":tools", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core/node", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics/tasks", + "//packages/angular_devkit/schematics/testing", + "//tests/angular_devkit/schematics/tools/file-system-engine-host:file_system_engine_host_test_lib", + "@npm//rxjs", + ], +) + +jasmine_node_test( + name = "tools_test", + srcs = [":tools_test_lib"], + deps = [ + "@npm//jasmine", + "@npm//source-map", + ], +) diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.d.ts new file mode 100644 index 00000000..5390481d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.d.ts @@ -0,0 +1,41 @@ +/** + * @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 + */ +import { JsonObject } from '@angular-devkit/core'; +import { Collection, CollectionDescription, Engine, EngineHost, RuleFactory, Schematic, SchematicDescription, TypedSchematicContext } from '../src'; +export interface FileSystemCollectionDescription { + readonly name: string; + readonly path: string; + readonly version?: string; + readonly schematics: { + [name: string]: FileSystemSchematicDesc; + }; +} +export interface FileSystemSchematicJsonDescription { + readonly aliases?: string[]; + readonly factory: string; + readonly name: string; + readonly collection: FileSystemCollectionDescription; + readonly description: string; + readonly schema?: string; + readonly extends?: string; +} +export interface FileSystemSchematicDescription extends FileSystemSchematicJsonDescription { + readonly path: string; + readonly schemaJson?: JsonObject; + readonly factoryFn: RuleFactory<{}>; +} +/** + * Used to simplify typings. + */ +export declare type FileSystemEngine = Engine; +export declare type FileSystemEngineHost = EngineHost; +export declare type FileSystemCollection = Collection; +export declare type FileSystemSchematic = Schematic; +export declare type FileSystemCollectionDesc = CollectionDescription; +export declare type FileSystemSchematicDesc = SchematicDescription; +export declare type FileSystemSchematicContext = TypedSchematicContext; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.js new file mode 100644 index 00000000..b599b96d --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/description.js @@ -0,0 +1,9 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.d.ts new file mode 100644 index 00000000..06428cea --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.d.ts @@ -0,0 +1,16 @@ +/** + * @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 + */ +export declare class ExportStringRef { + private _ref?; + private _module; + private _path; + constructor(ref: string, parentPath?: string, inner?: boolean); + get ref(): T | undefined; + get module(): string; + get path(): string; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.js new file mode 100644 index 00000000..1c88d8ee --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/export-ref.js @@ -0,0 +1,35 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportStringRef = void 0; +const path_1 = require("path"); +class ExportStringRef { + constructor(ref, parentPath = process.cwd(), inner = true) { + const [path, name] = ref.split('#', 2); + this._module = path[0] == '.' ? (0, path_1.resolve)(parentPath, path) : path; + this._module = require.resolve(this._module); + this._path = (0, path_1.dirname)(this._module); + if (inner) { + this._ref = require(this._module)[name || 'default']; + } + else { + this._ref = require(this._module); + } + } + get ref() { + return this._ref; + } + get module() { + return this._module; + } + get path() { + return this._path; + } +} +exports.ExportStringRef = ExportStringRef; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.d.ts new file mode 100644 index 00000000..8a915a5e --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.d.ts @@ -0,0 +1,36 @@ +/** + * @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 + */ +/// +import { Observable } from 'rxjs'; +import { Url } from 'url'; +import { CollectionDescription, EngineHost, RuleFactory, SchematicDescription, Source, TaskExecutor, TypedSchematicContext } from '../src'; +export declare type FallbackCollectionDescription = { + host: EngineHost<{}, {}>; + description: CollectionDescription<{}>; +}; +export declare type FallbackSchematicDescription = { + description: SchematicDescription<{}, {}>; +}; +export declare type FallbackContext = TypedSchematicContext; +/** + * An EngineHost that support multiple hosts in a fallback configuration. If a host does not + * have a collection/schematics, use the following host before giving up. + */ +export declare class FallbackEngineHost implements EngineHost<{}, {}> { + private _hosts; + addHost(host: EngineHost): void; + createCollectionDescription(name: string, requester?: CollectionDescription<{}>): CollectionDescription; + createSchematicDescription(name: string, collection: CollectionDescription): SchematicDescription | null; + getSchematicRuleFactory(schematic: SchematicDescription, collection: CollectionDescription): RuleFactory; + createSourceFromUrl(url: Url, context: FallbackContext): Source | null; + transformOptions(schematic: SchematicDescription, options: OptionT, context?: FallbackContext): Observable; + transformContext(context: FallbackContext): FallbackContext; + listSchematicNames(collection: CollectionDescription): string[]; + createTaskExecutor(name: string): Observable; + hasTaskExecutor(name: string): boolean; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js new file mode 100644 index 00000000..bf2f5a98 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/fallback-engine-host.js @@ -0,0 +1,86 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FallbackEngineHost = void 0; +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const src_1 = require("../src"); +/** + * An EngineHost that support multiple hosts in a fallback configuration. If a host does not + * have a collection/schematics, use the following host before giving up. + */ +class FallbackEngineHost { + constructor() { + this._hosts = []; + } + addHost(host) { + this._hosts.push(host); + } + createCollectionDescription(name, requester) { + for (const host of this._hosts) { + try { + const description = host.createCollectionDescription(name, requester); + return { name, host, description }; + } + catch (_) { } + } + throw new src_1.UnknownCollectionException(name); + } + createSchematicDescription(name, collection) { + const description = collection.host.createSchematicDescription(name, collection.description); + if (!description) { + return null; + } + return { name, collection, description }; + } + getSchematicRuleFactory(schematic, collection) { + return collection.host.getSchematicRuleFactory(schematic.description, collection.description); + } + createSourceFromUrl(url, context) { + return context.schematic.collection.description.host.createSourceFromUrl(url, context); + } + transformOptions(schematic, options, context) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (0, rxjs_1.of)(options).pipe(...this._hosts.map((host) => (0, operators_1.mergeMap)((opt) => host.transformOptions(schematic, opt, context)))); + } + transformContext(context) { + let result = context; + this._hosts.forEach((host) => { + result = (host.transformContext(result) || result); + }); + return result; + } + listSchematicNames(collection) { + const allNames = new Set(); + this._hosts.forEach((host) => { + try { + host.listSchematicNames(collection.description).forEach((name) => allNames.add(name)); + } + catch (_) { } + }); + return [...allNames]; + } + createTaskExecutor(name) { + for (const host of this._hosts) { + if (host.hasTaskExecutor(name)) { + return host.createTaskExecutor(name); + } + } + return (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name)); + } + hasTaskExecutor(name) { + for (const host of this._hosts) { + if (host.hasTaskExecutor(name)) { + return true; + } + } + return false; + } +} +exports.FallbackEngineHost = FallbackEngineHost; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.d.ts new file mode 100644 index 00000000..7c76aef6 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.d.ts @@ -0,0 +1,75 @@ +/** + * @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 + */ +/// +import { BaseException } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { Url } from 'url'; +import { RuleFactory, Source, TaskExecutor, TaskExecutorFactory } from '../src'; +import { FileSystemCollectionDesc, FileSystemEngineHost, FileSystemSchematicContext, FileSystemSchematicDesc, FileSystemSchematicDescription } from './description'; +export declare type OptionTransform = (schematic: FileSystemSchematicDescription, options: T, context?: FileSystemSchematicContext) => Observable | PromiseLike | R; +export declare type ContextTransform = (context: FileSystemSchematicContext) => FileSystemSchematicContext; +export declare class CollectionCannotBeResolvedException extends BaseException { + constructor(name: string); +} +export declare class InvalidCollectionJsonException extends BaseException { + constructor(_name: string, path: string, jsonException?: Error); +} +export declare class SchematicMissingFactoryException extends BaseException { + constructor(name: string); +} +export declare class FactoryCannotBeResolvedException extends BaseException { + constructor(name: string); +} +export declare class CollectionMissingSchematicsMapException extends BaseException { + constructor(name: string); +} +export declare class CollectionMissingFieldsException extends BaseException { + constructor(name: string); +} +export declare class SchematicMissingFieldsException extends BaseException { + constructor(name: string); +} +export declare class SchematicMissingDescriptionException extends BaseException { + constructor(name: string); +} +export declare class SchematicNameCollisionException extends BaseException { + constructor(name: string); +} +/** + * A EngineHost base class that uses the file system to resolve collections. This is the base of + * all other EngineHost provided by the tooling part of the Schematics library. + */ +export declare abstract class FileSystemEngineHostBase implements FileSystemEngineHost { + protected abstract _resolveCollectionPath(name: string, requester?: string): string; + protected abstract _resolveReferenceString(name: string, parentPath: string): { + ref: RuleFactory<{}>; + path: string; + } | null; + protected abstract _transformCollectionDescription(name: string, desc: Partial): FileSystemCollectionDesc; + protected abstract _transformSchematicDescription(name: string, collection: FileSystemCollectionDesc, desc: Partial): FileSystemSchematicDesc; + private _transforms; + private _contextTransforms; + private _taskFactories; + listSchematicNames(collection: FileSystemCollectionDesc): string[]; + registerOptionsTransform(t: OptionTransform): void; + registerContextTransform(t: ContextTransform): void; + /** + * + * @param name + * @return {{path: string}} + */ + createCollectionDescription(name: string, requester?: FileSystemCollectionDesc): FileSystemCollectionDesc; + createSchematicDescription(name: string, collection: FileSystemCollectionDesc): FileSystemSchematicDesc | null; + createSourceFromUrl(url: Url): Source | null; + transformOptions(schematic: FileSystemSchematicDesc, options: OptionT, context?: FileSystemSchematicContext): Observable; + transformContext(context: FileSystemSchematicContext): FileSystemSchematicContext; + getSchematicRuleFactory(schematic: FileSystemSchematicDesc, _collection: FileSystemCollectionDesc): RuleFactory; + registerTaskExecutor(factory: TaskExecutorFactory, options?: T): void; + createTaskExecutor(name: string): Observable; + hasTaskExecutor(name: string): boolean; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js new file mode 100644 index 00000000..84ab178a --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js @@ -0,0 +1,261 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileSystemEngineHostBase = exports.SchematicNameCollisionException = exports.SchematicMissingDescriptionException = exports.SchematicMissingFieldsException = exports.CollectionMissingFieldsException = exports.CollectionMissingSchematicsMapException = exports.FactoryCannotBeResolvedException = exports.SchematicMissingFactoryException = exports.InvalidCollectionJsonException = exports.CollectionCannotBeResolvedException = void 0; +const core_1 = require("@angular-devkit/core"); +const node_1 = require("@angular-devkit/core/node"); +const fs_1 = require("fs"); +const path_1 = require("path"); +const rxjs_1 = require("rxjs"); +const src_1 = require("../src"); +const file_system_utility_1 = require("./file-system-utility"); +class CollectionCannotBeResolvedException extends core_1.BaseException { + constructor(name) { + super(`Collection ${JSON.stringify(name)} cannot be resolved.`); + } +} +exports.CollectionCannotBeResolvedException = CollectionCannotBeResolvedException; +class InvalidCollectionJsonException extends core_1.BaseException { + constructor(_name, path, jsonException) { + let msg = `Collection JSON at path ${JSON.stringify(path)} is invalid.`; + if (jsonException) { + msg = `${msg} ${jsonException.message}`; + } + super(msg); + } +} +exports.InvalidCollectionJsonException = InvalidCollectionJsonException; +class SchematicMissingFactoryException extends core_1.BaseException { + constructor(name) { + super(`Schematic ${JSON.stringify(name)} is missing a factory.`); + } +} +exports.SchematicMissingFactoryException = SchematicMissingFactoryException; +class FactoryCannotBeResolvedException extends core_1.BaseException { + constructor(name) { + super(`Schematic ${JSON.stringify(name)} cannot resolve the factory.`); + } +} +exports.FactoryCannotBeResolvedException = FactoryCannotBeResolvedException; +class CollectionMissingSchematicsMapException extends core_1.BaseException { + constructor(name) { + super(`Collection "${name}" does not have a schematics map.`); + } +} +exports.CollectionMissingSchematicsMapException = CollectionMissingSchematicsMapException; +class CollectionMissingFieldsException extends core_1.BaseException { + constructor(name) { + super(`Collection "${name}" is missing fields.`); + } +} +exports.CollectionMissingFieldsException = CollectionMissingFieldsException; +class SchematicMissingFieldsException extends core_1.BaseException { + constructor(name) { + super(`Schematic "${name}" is missing fields.`); + } +} +exports.SchematicMissingFieldsException = SchematicMissingFieldsException; +class SchematicMissingDescriptionException extends core_1.BaseException { + constructor(name) { + super(`Schematics "${name}" does not have a description.`); + } +} +exports.SchematicMissingDescriptionException = SchematicMissingDescriptionException; +class SchematicNameCollisionException extends core_1.BaseException { + constructor(name) { + super(`Schematics/alias ${JSON.stringify(name)} collides with another alias or schematic` + + ' name.'); + } +} +exports.SchematicNameCollisionException = SchematicNameCollisionException; +/** + * A EngineHost base class that uses the file system to resolve collections. This is the base of + * all other EngineHost provided by the tooling part of the Schematics library. + */ +class FileSystemEngineHostBase { + constructor() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._transforms = []; + this._contextTransforms = []; + this._taskFactories = new Map(); + } + listSchematicNames(collection) { + const schematics = []; + for (const key of Object.keys(collection.schematics)) { + const schematic = collection.schematics[key]; + if (schematic.hidden || schematic.private) { + continue; + } + // If extends is present without a factory it is an alias, do not return it + // unless it is from another collection. + if (!schematic.extends || schematic.factory) { + schematics.push(key); + } + else if (schematic.extends && schematic.extends.indexOf(':') !== -1) { + schematics.push(key); + } + } + return schematics; + } + registerOptionsTransform(t) { + this._transforms.push(t); + } + registerContextTransform(t) { + this._contextTransforms.push(t); + } + /** + * + * @param name + * @return {{path: string}} + */ + createCollectionDescription(name, requester) { + const path = this._resolveCollectionPath(name, requester === null || requester === void 0 ? void 0 : requester.path); + const jsonValue = (0, file_system_utility_1.readJsonFile)(path); + if (!jsonValue || typeof jsonValue != 'object' || Array.isArray(jsonValue)) { + throw new InvalidCollectionJsonException(name, path); + } + // normalize extends property to an array + if (typeof jsonValue['extends'] === 'string') { + jsonValue['extends'] = [jsonValue['extends']]; + } + const description = this._transformCollectionDescription(name, { + ...jsonValue, + path, + }); + if (!description || !description.name) { + throw new InvalidCollectionJsonException(name, path); + } + // Validate aliases. + const allNames = Object.keys(description.schematics); + for (const schematicName of Object.keys(description.schematics)) { + const aliases = description.schematics[schematicName].aliases || []; + for (const alias of aliases) { + if (allNames.indexOf(alias) != -1) { + throw new SchematicNameCollisionException(alias); + } + } + allNames.push(...aliases); + } + return description; + } + createSchematicDescription(name, collection) { + // Resolve aliases first. + for (const schematicName of Object.keys(collection.schematics)) { + const schematicDescription = collection.schematics[schematicName]; + if (schematicDescription.aliases && schematicDescription.aliases.indexOf(name) != -1) { + name = schematicName; + break; + } + } + if (!(name in collection.schematics)) { + return null; + } + const collectionPath = (0, path_1.dirname)(collection.path); + const partialDesc = collection.schematics[name]; + if (!partialDesc) { + return null; + } + if (partialDesc.extends) { + const index = partialDesc.extends.indexOf(':'); + const collectionName = index !== -1 ? partialDesc.extends.substr(0, index) : null; + const schematicName = index === -1 ? partialDesc.extends : partialDesc.extends.substr(index + 1); + if (collectionName !== null) { + const extendCollection = this.createCollectionDescription(collectionName); + return this.createSchematicDescription(schematicName, extendCollection); + } + else { + return this.createSchematicDescription(schematicName, collection); + } + } + // Use any on this ref as we don't have the OptionT here, but we don't need it (we only need + // the path). + if (!partialDesc.factory) { + throw new SchematicMissingFactoryException(name); + } + const resolvedRef = this._resolveReferenceString(partialDesc.factory, collectionPath); + if (!resolvedRef) { + throw new FactoryCannotBeResolvedException(name); + } + let schema = partialDesc.schema; + let schemaJson = undefined; + if (schema) { + if (!(0, path_1.isAbsolute)(schema)) { + schema = (0, path_1.join)(collectionPath, schema); + } + schemaJson = (0, file_system_utility_1.readJsonFile)(schema); + } + // The schematic path is used to resolve URLs. + // We should be able to just do `dirname(resolvedRef.path)` but for compatibility with + // Bazel under Windows this directory needs to be resolved from the collection instead. + // This is needed because on Bazel under Windows the data files (such as the collection or + // url files) are not in the same place as the compiled JS. + const maybePath = (0, path_1.join)(collectionPath, partialDesc.factory); + const path = (0, fs_1.existsSync)(maybePath) && (0, fs_1.statSync)(maybePath).isDirectory() ? maybePath : (0, path_1.dirname)(maybePath); + return this._transformSchematicDescription(name, collection, { + ...partialDesc, + schema, + schemaJson, + name, + path, + factoryFn: resolvedRef.ref, + collection, + }); + } + createSourceFromUrl(url) { + switch (url.protocol) { + case null: + case 'file:': + return (context) => { + // Check if context has necessary FileSystemSchematicContext path property + const fileDescription = context.schematic.description; + if (fileDescription.path === undefined) { + throw new Error('Unsupported schematic context. Expected a FileSystemSchematicContext.'); + } + // Resolve all file:///a/b/c/d from the schematic's own path, and not the current + // path. + const root = (0, core_1.normalize)((0, path_1.resolve)(fileDescription.path, url.path || '')); + return new src_1.HostCreateTree(new core_1.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), root)); + }; + } + return null; + } + transformOptions(schematic, options, context) { + const transform = async () => { + let transformedOptions = options; + for (const transformer of this._transforms) { + const transformerResult = transformer(schematic, transformedOptions, context); + transformedOptions = await ((0, rxjs_1.isObservable)(transformerResult) + ? transformerResult.toPromise() + : transformerResult); + } + return transformedOptions; + }; + return (0, rxjs_1.from)(transform()); + } + transformContext(context) { + return this._contextTransforms.reduce((acc, curr) => curr(acc), context); + } + getSchematicRuleFactory(schematic, _collection) { + return schematic.factoryFn; + } + registerTaskExecutor(factory, options) { + this._taskFactories.set(factory.name, () => (0, rxjs_1.from)(factory.create(options))); + } + createTaskExecutor(name) { + const factory = this._taskFactories.get(name); + if (factory) { + return factory(); + } + return (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name)); + } + hasTaskExecutor(name) { + return this._taskFactories.has(name); + } +} +exports.FileSystemEngineHostBase = FileSystemEngineHostBase; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.d.ts new file mode 100644 index 00000000..a99cde93 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-engine-host.d.ts @@ -0,0 +1,28 @@ +/** + * @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 + */ +import { Observable } from 'rxjs'; +import { RuleFactory, TaskExecutor } from '../src'; +import { FileSystemCollectionDesc, FileSystemSchematicDesc } from './description'; +import { FileSystemEngineHostBase } from './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. + */ +export declare class FileSystemEngineHost extends FileSystemEngineHostBase { + protected _root: string; + constructor(_root: string); + protected _resolveCollectionPath(name: string): string; + protected _resolveReferenceString(refString: string, parentPath: string): { + ref: RuleFactory<{}>; + path: string; + } | null; + protected _transformCollectionDescription(name: string, desc: Partial): FileSystemCollectionDesc; + protected _transformSchematicDescription(name: string, _collection: FileSystemCollectionDesc, desc: Partial): FileSystemSchematicDesc; + hasTaskExecutor(name: string): boolean; + createTaskExecutor(name: string): Observable; +} 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; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.d.ts new file mode 100644 index 00000000..2586150f --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.d.ts @@ -0,0 +1,9 @@ +/** + * @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 + */ +import { JsonValue } from '@angular-devkit/core'; +export declare function readJsonFile(path: string): JsonValue; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.js new file mode 100644 index 00000000..e8499727 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/file-system-utility.js @@ -0,0 +1,26 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readJsonFile = void 0; +const schematics_1 = require("@angular-devkit/schematics"); +const fs_1 = require("fs"); +const jsonc_parser_1 = require("jsonc-parser"); +function readJsonFile(path) { + if (!(0, fs_1.existsSync)(path)) { + throw new schematics_1.FileDoesNotExistException(path); + } + const errors = []; + const content = (0, jsonc_parser_1.parse)((0, fs_1.readFileSync)(path, 'utf-8'), errors, { allowTrailingComma: true }); + if (errors.length) { + const { error, offset } = errors[0]; + throw new Error(`Failed to parse "${path}" as JSON AST Object. ${(0, jsonc_parser_1.printParseErrorCode)(error)} at location: ${offset}.`); + } + return content; +} +exports.readJsonFile = readJsonFile; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.d.ts new file mode 100644 index 00000000..5f2672b0 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.d.ts @@ -0,0 +1,15 @@ +/** + * @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 + */ +export * from './description'; +export * from './export-ref'; +export * from './file-system-engine-host-base'; +export * from './workflow/node-workflow'; +export { FileSystemEngineHost } from './file-system-engine-host'; +export { NodeModulesEngineHost, NodePackageDoesNotSupportSchematics, } from './node-module-engine-host'; +export { NodeModulesTestEngineHost } from './node-modules-test-engine-host'; +export { validateOptionsWithSchema } from './schema-option-transform'; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.js new file mode 100644 index 00000000..8efe0672 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/index.js @@ -0,0 +1,33 @@ +"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 __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateOptionsWithSchema = exports.NodeModulesTestEngineHost = exports.NodePackageDoesNotSupportSchematics = exports.NodeModulesEngineHost = exports.FileSystemEngineHost = void 0; +__exportStar(require("./description"), exports); +__exportStar(require("./export-ref"), exports); +__exportStar(require("./file-system-engine-host-base"), exports); +__exportStar(require("./workflow/node-workflow"), exports); +var file_system_engine_host_1 = require("./file-system-engine-host"); +Object.defineProperty(exports, "FileSystemEngineHost", { enumerable: true, get: function () { return file_system_engine_host_1.FileSystemEngineHost; } }); +var node_module_engine_host_1 = require("./node-module-engine-host"); +Object.defineProperty(exports, "NodeModulesEngineHost", { enumerable: true, get: function () { return node_module_engine_host_1.NodeModulesEngineHost; } }); +Object.defineProperty(exports, "NodePackageDoesNotSupportSchematics", { enumerable: true, get: function () { return node_module_engine_host_1.NodePackageDoesNotSupportSchematics; } }); +var node_modules_test_engine_host_1 = require("./node-modules-test-engine-host"); +Object.defineProperty(exports, "NodeModulesTestEngineHost", { enumerable: true, get: function () { return node_modules_test_engine_host_1.NodeModulesTestEngineHost; } }); +var schema_option_transform_1 = require("./schema-option-transform"); +Object.defineProperty(exports, "validateOptionsWithSchema", { enumerable: true, get: function () { return schema_option_transform_1.validateOptionsWithSchema; } }); diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.d.ts new file mode 100644 index 00000000..e1122fd7 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.d.ts @@ -0,0 +1,29 @@ +/** + * @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 + */ +import { BaseException } from '@angular-devkit/core'; +import { RuleFactory } from '../src'; +import { FileSystemCollectionDesc, FileSystemSchematicDesc } from './description'; +import { FileSystemEngineHostBase } from './file-system-engine-host-base'; +export declare class NodePackageDoesNotSupportSchematics extends BaseException { + constructor(name: string); +} +/** + * A simple EngineHost that uses NodeModules to resolve collections. + */ +export declare class NodeModulesEngineHost extends FileSystemEngineHostBase { + private readonly paths?; + constructor(paths?: string[] | undefined); + private resolve; + protected _resolveCollectionPath(name: string, requester?: string): string; + protected _resolveReferenceString(refString: string, parentPath: string): { + ref: RuleFactory<{}>; + path: string; + } | null; + protected _transformCollectionDescription(name: string, desc: Partial): FileSystemCollectionDesc; + protected _transformSchematicDescription(name: string, _collection: FileSystemCollectionDesc, desc: Partial): FileSystemSchematicDesc; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js new file mode 100644 index 00000000..23b4a332 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js @@ -0,0 +1,107 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeModulesEngineHost = exports.NodePackageDoesNotSupportSchematics = void 0; +const core_1 = require("@angular-devkit/core"); +const path_1 = require("path"); +const export_ref_1 = require("./export-ref"); +const file_system_engine_host_base_1 = require("./file-system-engine-host-base"); +const file_system_utility_1 = require("./file-system-utility"); +class NodePackageDoesNotSupportSchematics extends core_1.BaseException { + constructor(name) { + super(`Package ${JSON.stringify(name)} was found but does not support schematics.`); + } +} +exports.NodePackageDoesNotSupportSchematics = NodePackageDoesNotSupportSchematics; +/** + * A simple EngineHost that uses NodeModules to resolve collections. + */ +class NodeModulesEngineHost extends file_system_engine_host_base_1.FileSystemEngineHostBase { + constructor(paths) { + super(); + this.paths = paths; + } + resolve(name, requester, references = new Set()) { + if (requester) { + if (references.has(requester)) { + references.add(requester); + throw new Error('Circular schematic reference detected: ' + JSON.stringify(Array.from(references))); + } + else { + references.add(requester); + } + } + const relativeBase = requester ? (0, path_1.dirname)(requester) : process.cwd(); + let collectionPath = undefined; + if (name.startsWith('.')) { + name = (0, path_1.resolve)(relativeBase, name); + } + const resolveOptions = { + paths: requester ? [(0, path_1.dirname)(requester), ...(this.paths || [])] : this.paths, + }; + // Try to resolve as a package + try { + const packageJsonPath = require.resolve((0, path_1.join)(name, 'package.json'), resolveOptions); + const { schematics } = require(packageJsonPath); + if (!schematics || typeof schematics !== 'string') { + throw new NodePackageDoesNotSupportSchematics(name); + } + collectionPath = this.resolve(schematics, packageJsonPath, references); + } + catch (e) { + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + } + // If not a package, try to resolve as a file + if (!collectionPath) { + try { + collectionPath = require.resolve(name, resolveOptions); + } + catch (e) { + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + } + } + // If not a package or a file, error + if (!collectionPath) { + throw new file_system_engine_host_base_1.CollectionCannotBeResolvedException(name); + } + return collectionPath; + } + _resolveCollectionPath(name, requester) { + const collectionPath = this.resolve(name, requester); + (0, file_system_utility_1.readJsonFile)(collectionPath); + return collectionPath; + } + _resolveReferenceString(refString, parentPath) { + 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; + } +} +exports.NodeModulesEngineHost = NodeModulesEngineHost; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.d.ts new file mode 100644 index 00000000..60ac61ac --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.d.ts @@ -0,0 +1,23 @@ +/** + * @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 + */ +import { TaskConfiguration } from '../src/engine'; +import { FileSystemSchematicContext } from './description'; +import { NodeModulesEngineHost } from './node-module-engine-host'; +/** + * An EngineHost that uses a registry to super seed locations of collection.json files, but + * revert back to using node modules resolution. This is done for testing. + */ +export declare class NodeModulesTestEngineHost extends NodeModulesEngineHost { + private _collections; + private _tasks; + get tasks(): TaskConfiguration<{}>[]; + clearTasks(): void; + registerCollection(name: string, path: string): void; + transformContext(context: FileSystemSchematicContext): FileSystemSchematicContext; + protected _resolveCollectionPath(name: string, requester?: string): string; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.js new file mode 100644 index 00000000..abaab377 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/node-modules-test-engine-host.js @@ -0,0 +1,47 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeModulesTestEngineHost = void 0; +const node_module_engine_host_1 = require("./node-module-engine-host"); +/** + * An EngineHost that uses a registry to super seed locations of collection.json files, but + * revert back to using node modules resolution. This is done for testing. + */ +class NodeModulesTestEngineHost extends node_module_engine_host_1.NodeModulesEngineHost { + constructor() { + super(...arguments); + this._collections = new Map(); + this._tasks = []; + } + get tasks() { + return this._tasks; + } + clearTasks() { + this._tasks = []; + } + registerCollection(name, path) { + this._collections.set(name, path); + } + transformContext(context) { + const oldAddTask = context.addTask; + context.addTask = (task, dependencies) => { + this._tasks.push(task.toConfiguration()); + return oldAddTask.call(context, task, dependencies); + }; + return context; + } + _resolveCollectionPath(name, requester) { + const maybePath = this._collections.get(name); + if (maybePath) { + return maybePath; + } + return super._resolveCollectionPath(name, requester); + } +} +exports.NodeModulesTestEngineHost = NodeModulesTestEngineHost; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/package.json b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/package.json new file mode 100644 index 00000000..e82f12c2 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/package.json @@ -0,0 +1,5 @@ +{ + "name": "@angular-devkit/schematics/tools", + "main": "index.js", + "typings": "index.d.ts" +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.d.ts new file mode 100644 index 00000000..a7de1dcc --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.d.ts @@ -0,0 +1,14 @@ +/** + * @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 + */ +import { schema } from '@angular-devkit/core'; +import { Observable } from 'rxjs'; +import { FileSystemSchematicContext, FileSystemSchematicDescription } from './description'; +export declare class InvalidInputOptions extends schema.SchemaValidationException { + constructor(options: T, errors: schema.SchemaValidatorError[]); +} +export declare function validateOptionsWithSchema(registry: schema.SchemaRegistry): (schematic: FileSystemSchematicDescription, options: T, context?: FileSystemSchematicContext | undefined) => Observable; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js new file mode 100644 index 00000000..9d665a85 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js @@ -0,0 +1,38 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateOptionsWithSchema = exports.InvalidInputOptions = void 0; +const core_1 = require("@angular-devkit/core"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +class InvalidInputOptions extends core_1.schema.SchemaValidationException { + constructor(options, errors) { + super(errors, `Schematic input does not validate against the Schema: ${JSON.stringify(options)}\nErrors:\n`); + } +} +exports.InvalidInputOptions = InvalidInputOptions; +// This can only be used in NodeJS. +function validateOptionsWithSchema(registry) { + return (schematic, options, context) => { + // Prevent a schematic from changing the options object by making a copy of it. + options = (0, core_1.deepCopy)(options); + const withPrompts = context ? context.interactive : true; + if (schematic.schema && schematic.schemaJson) { + // Make a deep copy of options. + return registry.compile(schematic.schemaJson).pipe((0, operators_1.mergeMap)((validator) => validator(options, { withPrompts })), (0, operators_1.first)(), (0, operators_1.map)((result) => { + if (!result.success) { + throw new InvalidInputOptions(options, result.errors || []); + } + return options; + })); + } + return (0, rxjs_1.of)(options); + }; +} +exports.validateOptionsWithSchema = validateOptionsWithSchema; diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.d.ts new file mode 100644 index 00000000..cbbcaba3 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.d.ts @@ -0,0 +1,35 @@ +/** + * @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 + */ +import { Path, schema, virtualFs } from '@angular-devkit/core'; +import { workflow } from '@angular-devkit/schematics'; +import { FileSystemEngine } from '../description'; +import { OptionTransform } from '../file-system-engine-host-base'; +import { NodeModulesEngineHost } from '../node-module-engine-host'; +export interface NodeWorkflowOptions { + force?: boolean; + dryRun?: boolean; + packageManager?: string; + packageManagerForce?: boolean; + packageRegistry?: string; + registry?: schema.CoreSchemaRegistry; + resolvePaths?: string[]; + schemaValidation?: boolean; + optionTransforms?: OptionTransform[]; + engineHostCreator?: (options: NodeWorkflowOptions) => NodeModulesEngineHost; +} +/** + * A workflow specifically for Node tools. + */ +export declare class NodeWorkflow extends workflow.BaseWorkflow { + constructor(root: string, options: NodeWorkflowOptions); + constructor(host: virtualFs.Host, options: NodeWorkflowOptions & { + root?: Path; + }); + get engine(): FileSystemEngine; + get engineHost(): NodeModulesEngineHost; +} diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js new file mode 100644 index 00000000..41a69c28 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js @@ -0,0 +1,69 @@ +"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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeWorkflow = void 0; +const core_1 = require("@angular-devkit/core"); +const node_1 = require("@angular-devkit/core/node"); +const schematics_1 = require("@angular-devkit/schematics"); +const node_2 = require("../../tasks/node"); +const node_module_engine_host_1 = require("../node-module-engine-host"); +const schema_option_transform_1 = require("../schema-option-transform"); +/** + * A workflow specifically for Node tools. + */ +class NodeWorkflow extends schematics_1.workflow.BaseWorkflow { + constructor(hostOrRoot, options) { + var _a; + let host; + let root; + if (typeof hostOrRoot === 'string') { + root = (0, core_1.normalize)(hostOrRoot); + host = new core_1.virtualFs.ScopedHost(new node_1.NodeJsSyncHost(), root); + } + else { + host = hostOrRoot; + root = options.root; + } + const engineHost = ((_a = options.engineHostCreator) === null || _a === void 0 ? void 0 : _a.call(options, options)) || new node_module_engine_host_1.NodeModulesEngineHost(options.resolvePaths); + super({ + host, + engineHost, + force: options.force, + dryRun: options.dryRun, + registry: options.registry, + }); + engineHost.registerTaskExecutor(node_2.BuiltinTaskExecutor.NodePackage, { + allowPackageManagerOverride: true, + packageManager: options.packageManager, + force: options.packageManagerForce, + rootDirectory: root && (0, core_1.getSystemPath)(root), + registry: options.packageRegistry, + }); + engineHost.registerTaskExecutor(node_2.BuiltinTaskExecutor.RepositoryInitializer, { + rootDirectory: root && (0, core_1.getSystemPath)(root), + }); + engineHost.registerTaskExecutor(node_2.BuiltinTaskExecutor.RunSchematic); + if (options.optionTransforms) { + for (const transform of options.optionTransforms) { + engineHost.registerOptionsTransform(transform); + } + } + if (options.schemaValidation) { + engineHost.registerOptionsTransform((0, schema_option_transform_1.validateOptionsWithSchema)(this.registry)); + } + this._context = []; + } + get engine() { + return this._engine; + } + get engineHost() { + return this._engineHost; + } +} +exports.NodeWorkflow = NodeWorkflow; -- cgit v1.2.3