@antelopejs/core 0.3.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/build/build-artifact.d.ts +59 -0
- package/dist/core/build/build-artifact.js +72 -0
- package/dist/core/build/build-artifact.js.map +1 -0
- package/dist/{utils → core/cli}/cli-ui.d.ts +4 -14
- package/dist/core/cli/cli-ui.js +154 -0
- package/dist/core/cli/cli-ui.js.map +1 -0
- package/dist/{utils → core/cli}/command.d.ts +1 -1
- package/dist/core/cli/command.js +25 -0
- package/dist/core/cli/command.js.map +1 -0
- package/dist/{cli → core/cli/commands}/config/get.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/config/get.js +11 -10
- package/dist/core/cli/commands/config/get.js.map +1 -0
- package/dist/{cli → core/cli/commands}/config/index.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/config/index.js +5 -4
- package/dist/core/cli/commands/config/index.js.map +1 -0
- package/dist/{cli → core/cli/commands}/config/reset.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/config/reset.js +17 -16
- package/dist/core/cli/commands/config/reset.js.map +1 -0
- package/dist/{cli/module/exports → core/cli/commands/config}/set.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/config/set.js +15 -11
- package/dist/core/cli/commands/config/set.js.map +1 -0
- package/dist/{cli → core/cli/commands}/config/show.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/config/show.js +13 -11
- package/dist/core/cli/commands/config/show.js.map +1 -0
- package/dist/{cli/module/exports → core/cli/commands/module}/index.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/module/index.js +3 -7
- package/dist/core/cli/commands/module/index.js.map +1 -0
- package/dist/{cli → core/cli/commands}/module/init.d.ts +1 -1
- package/dist/core/cli/commands/module/init.js +176 -0
- package/dist/core/cli/commands/module/init.js.map +1 -0
- package/dist/{cli → core/cli/commands}/module/test.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/module/test.js +13 -15
- package/dist/core/cli/commands/module/test.js.map +1 -0
- package/dist/{cli/config/set.d.ts → core/cli/commands/project/build.d.ts} +1 -1
- package/dist/core/cli/commands/project/build.js +71 -0
- package/dist/core/cli/commands/project/build.js.map +1 -0
- package/dist/core/cli/commands/project/dev.d.ts +20 -0
- package/dist/core/cli/commands/project/dev.js +262 -0
- package/dist/core/cli/commands/project/dev.js.map +1 -0
- package/dist/{cli/module/imports → core/cli/commands/project}/index.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/index.js +10 -3
- package/dist/core/cli/commands/project/index.js.map +1 -0
- package/dist/{cli → core/cli/commands}/project/init.d.ts +1 -1
- package/dist/core/cli/commands/project/init.js +118 -0
- package/dist/core/cli/commands/project/init.js.map +1 -0
- package/dist/{cli/module → core/cli/commands/project/logging}/index.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/logging/index.js +4 -3
- package/dist/core/cli/commands/project/logging/index.js.map +1 -0
- package/dist/{cli → core/cli/commands}/project/logging/set.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/logging/set.js +99 -89
- package/dist/core/cli/commands/project/logging/set.js.map +1 -0
- package/dist/{cli → core/cli/commands}/project/logging/show.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/logging/show.js +37 -34
- package/dist/core/cli/commands/project/logging/show.js.map +1 -0
- package/dist/{cli → core/cli/commands}/project/modules/add.d.ts +3 -3
- package/dist/core/cli/commands/project/modules/add.js +237 -0
- package/dist/core/cli/commands/project/modules/add.js.map +1 -0
- package/dist/core/cli/commands/project/modules/index.d.ts +2 -0
- package/dist/{cli → core/cli/commands}/project/modules/index.js +5 -4
- package/dist/core/cli/commands/project/modules/index.js.map +1 -0
- package/dist/{cli/module/imports → core/cli/commands/project/modules}/install.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/modules/install.js +83 -84
- package/dist/core/cli/commands/project/modules/install.js.map +1 -0
- package/dist/{cli/module/imports → core/cli/commands/project/modules}/list.d.ts +1 -1
- package/dist/core/cli/commands/project/modules/list.js +123 -0
- package/dist/core/cli/commands/project/modules/list.js.map +1 -0
- package/dist/{cli → core/cli/commands}/project/modules/remove.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/modules/remove.js +31 -28
- package/dist/core/cli/commands/project/modules/remove.js.map +1 -0
- package/dist/{cli/module/imports → core/cli/commands/project/modules}/update.d.ts +1 -1
- package/dist/{cli → core/cli/commands}/project/modules/update.js +26 -22
- package/dist/core/cli/commands/project/modules/update.js.map +1 -0
- package/dist/core/cli/commands/project/run.d.ts +1 -0
- package/dist/core/cli/commands/project/run.js +12 -0
- package/dist/core/cli/commands/project/run.js.map +1 -0
- package/dist/core/cli/commands/project/start.d.ts +2 -0
- package/dist/core/cli/commands/project/start.js +57 -0
- package/dist/core/cli/commands/project/start.js.map +1 -0
- package/dist/core/cli/commands/shared/project-command.d.ts +8 -0
- package/dist/core/cli/commands/shared/project-command.js +32 -0
- package/dist/core/cli/commands/shared/project-command.js.map +1 -0
- package/dist/core/cli/common.d.ts +23 -0
- package/dist/core/cli/common.js +203 -0
- package/dist/core/cli/common.js.map +1 -0
- package/dist/{cli/git.d.ts → core/cli/git-operations.d.ts} +1 -20
- package/dist/core/cli/git-operations.js +159 -0
- package/dist/core/cli/git-operations.js.map +1 -0
- package/dist/core/cli/index.d.ts +4 -0
- package/dist/core/cli/index.js +81 -0
- package/dist/core/cli/index.js.map +1 -0
- package/dist/core/cli/logging-utils.d.ts +17 -0
- package/dist/{logging/utils.js → core/cli/logging-utils.js} +49 -43
- package/dist/core/cli/logging-utils.js.map +1 -0
- package/dist/{utils → core/cli}/package-manager.d.ts +4 -3
- package/dist/core/cli/package-manager.js +106 -0
- package/dist/core/cli/package-manager.js.map +1 -0
- package/dist/{logging → core/cli}/terminal-display.d.ts +1 -3
- package/dist/{logging → core/cli}/terminal-display.js +6 -7
- package/dist/core/cli/terminal-display.js.map +1 -0
- package/dist/core/cli/version-check.d.ts +2 -0
- package/dist/{cli → core/cli}/version-check.js +9 -5
- package/dist/core/cli/version-check.js.map +1 -0
- package/dist/core/config/config-loader.d.ts +20 -0
- package/dist/core/config/config-loader.js +98 -0
- package/dist/core/config/config-loader.js.map +1 -0
- package/dist/core/config/config-parser.d.ts +16 -0
- package/dist/core/config/config-parser.js +134 -0
- package/dist/core/config/config-parser.js.map +1 -0
- package/dist/core/config/config-paths.d.ts +7 -0
- package/dist/core/config/config-paths.js +32 -0
- package/dist/core/config/config-paths.js.map +1 -0
- package/dist/core/config/index.d.ts +3 -0
- package/dist/core/config/index.js +20 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/downloaders/git.d.ts +8 -0
- package/dist/core/downloaders/git.js +96 -0
- package/dist/core/downloaders/git.js.map +1 -0
- package/dist/core/downloaders/local-folder.d.ts +8 -0
- package/dist/core/downloaders/local-folder.js +70 -0
- package/dist/core/downloaders/local-folder.js.map +1 -0
- package/dist/core/downloaders/local.d.ts +8 -0
- package/dist/core/downloaders/local.js +59 -0
- package/dist/core/downloaders/local.js.map +1 -0
- package/dist/core/downloaders/package.d.ts +11 -0
- package/dist/core/downloaders/package.js +99 -0
- package/dist/core/downloaders/package.js.map +1 -0
- package/dist/core/downloaders/registry.d.ts +11 -0
- package/dist/core/downloaders/registry.js +85 -0
- package/dist/core/downloaders/registry.js.map +1 -0
- package/dist/core/downloaders/types.d.ts +11 -0
- package/dist/core/downloaders/types.js +3 -0
- package/dist/core/downloaders/types.js.map +1 -0
- package/dist/core/downloaders/utils.d.ts +5 -0
- package/dist/core/downloaders/utils.js +77 -0
- package/dist/core/downloaders/utils.js.map +1 -0
- package/dist/core/filesystem.d.ts +20 -0
- package/dist/core/filesystem.js +80 -0
- package/dist/core/filesystem.js.map +1 -0
- package/dist/core/interface-registry.d.ts +7 -0
- package/dist/core/interface-registry.js +23 -0
- package/dist/core/interface-registry.js.map +1 -0
- package/dist/{common/cache.d.ts → core/module-cache.d.ts} +8 -4
- package/dist/{common/cache.js → core/module-cache.js} +52 -32
- package/dist/core/module-cache.js.map +1 -0
- package/dist/core/module-lifecycle.d.ts +13 -0
- package/dist/core/module-lifecycle.js +62 -0
- package/dist/core/module-lifecycle.js.map +1 -0
- package/dist/core/module-manager.d.ts +65 -0
- package/dist/core/module-manager.js +340 -0
- package/dist/core/module-manager.js.map +1 -0
- package/dist/core/module-manifest.d.ts +45 -0
- package/dist/core/module-manifest.js +180 -0
- package/dist/core/module-manifest.js.map +1 -0
- package/dist/core/module-registry.d.ts +7 -0
- package/dist/core/module-registry.js +17 -0
- package/dist/core/module-registry.js.map +1 -0
- package/dist/core/module-tracker.d.ts +8 -0
- package/dist/core/module-tracker.js +14 -0
- package/dist/core/module-tracker.js.map +1 -0
- package/dist/core/module.d.ts +19 -0
- package/dist/core/module.js +106 -0
- package/dist/core/module.js.map +1 -0
- package/dist/core/repl/repl-session.d.ts +10 -0
- package/dist/core/repl/repl-session.js +26 -0
- package/dist/core/repl/repl-session.js.map +1 -0
- package/dist/core/resolution/path-mapper.d.ts +7 -0
- package/dist/core/resolution/path-mapper.js +79 -0
- package/dist/core/resolution/path-mapper.js.map +1 -0
- package/dist/core/resolution/resolver-detour.d.ts +8 -0
- package/dist/core/resolution/resolver-detour.js +42 -0
- package/dist/core/resolution/resolver-detour.js.map +1 -0
- package/dist/core/resolution/resolver.d.ts +23 -0
- package/dist/core/resolution/resolver.js +55 -0
- package/dist/core/resolution/resolver.js.map +1 -0
- package/dist/core/runtime/build-runtime.d.ts +8 -0
- package/dist/core/runtime/build-runtime.js +129 -0
- package/dist/core/runtime/build-runtime.js.map +1 -0
- package/dist/core/runtime/module-loading.d.ts +16 -0
- package/dist/core/runtime/module-loading.js +310 -0
- package/dist/core/runtime/module-loading.js.map +1 -0
- package/dist/core/runtime/runtime-bootstrap.d.ts +9 -0
- package/dist/core/runtime/runtime-bootstrap.js +92 -0
- package/dist/core/runtime/runtime-bootstrap.js.map +1 -0
- package/dist/core/runtime/runtime-types.d.ts +34 -0
- package/dist/core/runtime/runtime-types.js +3 -0
- package/dist/core/runtime/runtime-types.js.map +1 -0
- package/dist/core/shutdown/index.d.ts +1 -0
- package/dist/core/shutdown/index.js +18 -0
- package/dist/core/shutdown/index.js.map +1 -0
- package/dist/core/shutdown/shutdown-manager.d.ts +23 -0
- package/dist/core/shutdown/shutdown-manager.js +108 -0
- package/dist/core/shutdown/shutdown-manager.js.map +1 -0
- package/dist/core/test/stub-interface.d.ts +3 -0
- package/dist/core/test/stub-interface.js +40 -0
- package/dist/core/test/stub-interface.js.map +1 -0
- package/dist/core/test/test-context.d.ts +18 -0
- package/dist/core/test/test-context.js +34 -0
- package/dist/core/test/test-context.js.map +1 -0
- package/dist/core/test/test-module.d.ts +15 -0
- package/dist/core/test/test-module.js +234 -0
- package/dist/core/test/test-module.js.map +1 -0
- package/dist/core/test/test-runner.d.ts +8 -0
- package/dist/core/test/test-runner.js +33 -0
- package/dist/core/test/test-runner.js.map +1 -0
- package/dist/core/watch/file-hasher.d.ts +6 -0
- package/dist/core/watch/file-hasher.js +16 -0
- package/dist/core/watch/file-hasher.js.map +1 -0
- package/dist/core/watch/file-watcher.d.ts +24 -0
- package/dist/core/watch/file-watcher.js +179 -0
- package/dist/core/watch/file-watcher.js.map +1 -0
- package/dist/core/watch/hot-reload.d.ts +10 -0
- package/dist/core/watch/hot-reload.js +36 -0
- package/dist/core/watch/hot-reload.js.map +1 -0
- package/dist/index.d.ts +17 -8
- package/dist/index.js +142 -150
- package/dist/index.js.map +1 -1
- package/dist/logging/index.d.ts +13 -3
- package/dist/logging/index.js +213 -9
- package/dist/logging/index.js.map +1 -1
- package/dist/logging/log-filter.d.ts +16 -0
- package/dist/logging/log-filter.js +68 -0
- package/dist/logging/log-filter.js.map +1 -0
- package/dist/logging/log-formatter.d.ts +24 -0
- package/dist/logging/log-formatter.js +76 -0
- package/dist/logging/log-formatter.js.map +1 -0
- package/dist/logging/logger.d.ts +36 -6
- package/dist/logging/logger.js +87 -113
- package/dist/logging/logger.js.map +1 -1
- package/dist/types/config.types.d.ts +7 -0
- package/dist/types/config.types.js +3 -0
- package/dist/types/config.types.js.map +1 -0
- package/dist/types/filesystem.types.d.ts +19 -0
- package/dist/types/filesystem.types.js +3 -0
- package/dist/types/filesystem.types.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +20 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/module.types.d.ts +11 -0
- package/dist/types/module.types.js +10 -0
- package/dist/types/module.types.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lock.js +15 -10
- package/dist/utils/lock.js.map +1 -1
- package/dist/utils/object.d.ts +3 -2
- package/dist/utils/object.js +28 -13
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/promise.d.ts +5 -3
- package/dist/utils/promise.js +15 -15
- package/dist/utils/promise.js.map +1 -1
- package/package.json +44 -32
- package/dist/cli/common.d.ts +0 -22
- package/dist/cli/common.js +0 -105
- package/dist/cli/common.js.map +0 -1
- package/dist/cli/config/get.js.map +0 -1
- package/dist/cli/config/index.js.map +0 -1
- package/dist/cli/config/reset.js.map +0 -1
- package/dist/cli/config/set.js.map +0 -1
- package/dist/cli/config/show.js.map +0 -1
- package/dist/cli/git.js +0 -349
- package/dist/cli/git.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js +0 -68
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/module/exports/generate.d.ts +0 -2
- package/dist/cli/module/exports/generate.js +0 -153
- package/dist/cli/module/exports/generate.js.map +0 -1
- package/dist/cli/module/exports/index.js +0 -16
- package/dist/cli/module/exports/index.js.map +0 -1
- package/dist/cli/module/exports/set.js +0 -47
- package/dist/cli/module/exports/set.js.map +0 -1
- package/dist/cli/module/imports/add.d.ts +0 -10
- package/dist/cli/module/imports/add.js +0 -175
- package/dist/cli/module/imports/add.js.map +0 -1
- package/dist/cli/module/imports/index.js +0 -22
- package/dist/cli/module/imports/index.js.map +0 -1
- package/dist/cli/module/imports/install.js +0 -132
- package/dist/cli/module/imports/install.js.map +0 -1
- package/dist/cli/module/imports/list.js +0 -93
- package/dist/cli/module/imports/list.js.map +0 -1
- package/dist/cli/module/imports/remove.d.ts +0 -2
- package/dist/cli/module/imports/remove.js +0 -100
- package/dist/cli/module/imports/remove.js.map +0 -1
- package/dist/cli/module/imports/update.js +0 -161
- package/dist/cli/module/imports/update.js.map +0 -1
- package/dist/cli/module/index.js.map +0 -1
- package/dist/cli/module/init.js +0 -194
- package/dist/cli/module/init.js.map +0 -1
- package/dist/cli/module/test.js.map +0 -1
- package/dist/cli/project/index.d.ts +0 -2
- package/dist/cli/project/index.js.map +0 -1
- package/dist/cli/project/init.js +0 -120
- package/dist/cli/project/init.js.map +0 -1
- package/dist/cli/project/logging/index.d.ts +0 -2
- package/dist/cli/project/logging/index.js.map +0 -1
- package/dist/cli/project/logging/set.js.map +0 -1
- package/dist/cli/project/logging/show.js.map +0 -1
- package/dist/cli/project/modules/add.js +0 -239
- package/dist/cli/project/modules/add.js.map +0 -1
- package/dist/cli/project/modules/index.d.ts +0 -2
- package/dist/cli/project/modules/index.js.map +0 -1
- package/dist/cli/project/modules/install.d.ts +0 -2
- package/dist/cli/project/modules/install.js.map +0 -1
- package/dist/cli/project/modules/list.d.ts +0 -2
- package/dist/cli/project/modules/list.js +0 -92
- package/dist/cli/project/modules/list.js.map +0 -1
- package/dist/cli/project/modules/remove.js.map +0 -1
- package/dist/cli/project/modules/update.d.ts +0 -2
- package/dist/cli/project/modules/update.js.map +0 -1
- package/dist/cli/project/run.d.ts +0 -2
- package/dist/cli/project/run.js +0 -147
- package/dist/cli/project/run.js.map +0 -1
- package/dist/cli/version-check.d.ts +0 -1
- package/dist/cli/version-check.js.map +0 -1
- package/dist/common/cache.js.map +0 -1
- package/dist/common/config.d.ts +0 -55
- package/dist/common/config.js +0 -168
- package/dist/common/config.js.map +0 -1
- package/dist/common/downloader/git.d.ts +0 -8
- package/dist/common/downloader/git.js +0 -97
- package/dist/common/downloader/git.js.map +0 -1
- package/dist/common/downloader/index.d.ts +0 -13
- package/dist/common/downloader/index.js +0 -58
- package/dist/common/downloader/index.js.map +0 -1
- package/dist/common/downloader/local.d.ts +0 -12
- package/dist/common/downloader/local.js +0 -70
- package/dist/common/downloader/local.js.map +0 -1
- package/dist/common/downloader/package.d.ts +0 -6
- package/dist/common/downloader/package.js +0 -58
- package/dist/common/downloader/package.js.map +0 -1
- package/dist/common/manifest.d.ts +0 -48
- package/dist/common/manifest.js +0 -126
- package/dist/common/manifest.js.map +0 -1
- package/dist/interfaces/core/beta/decorators.d.ts +0 -29
- package/dist/interfaces/core/beta/decorators.js +0 -72
- package/dist/interfaces/core/beta/decorators.js.map +0 -1
- package/dist/interfaces/core/beta/index.d.ts +0 -58
- package/dist/interfaces/core/beta/index.js +0 -266
- package/dist/interfaces/core/beta/index.js.map +0 -1
- package/dist/interfaces/core/beta/modules.d.ts +0 -26
- package/dist/interfaces/core/beta/modules.js +0 -31
- package/dist/interfaces/core/beta/modules.js.map +0 -1
- package/dist/interfaces/logging/beta/index.d.ts +0 -27
- package/dist/interfaces/logging/beta/index.js +0 -61
- package/dist/interfaces/logging/beta/index.js.map +0 -1
- package/dist/interfaces/logging/beta/listener.d.ts +0 -9
- package/dist/interfaces/logging/beta/listener.js +0 -5
- package/dist/interfaces/logging/beta/listener.js.map +0 -1
- package/dist/loader/index.d.ts +0 -45
- package/dist/loader/index.js +0 -490
- package/dist/loader/index.js.map +0 -1
- package/dist/loader/module.d.ts +0 -29
- package/dist/loader/module.js +0 -142
- package/dist/loader/module.js.map +0 -1
- package/dist/logging/terminal-display.js.map +0 -1
- package/dist/logging/utils.d.ts +0 -21
- package/dist/logging/utils.js.map +0 -1
- package/dist/utils/cli-ui.js +0 -245
- package/dist/utils/cli-ui.js.map +0 -1
- package/dist/utils/command.js +0 -23
- package/dist/utils/command.js.map +0 -1
- package/dist/utils/package-manager.js +0 -99
- package/dist/utils/package-manager.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerLocalFolderDownloader = registerLocalFolderDownloader;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
39
|
+
const command_1 = require("../cli/command");
|
|
40
|
+
const filesystem_1 = require("../filesystem");
|
|
41
|
+
const module_manifest_1 = require("../module-manifest");
|
|
42
|
+
const utils_1 = require("./utils");
|
|
43
|
+
const Logger = new logging_1.Logging.Channel("loader.local-folder");
|
|
44
|
+
function registerLocalFolderDownloader(registry, deps = {}) {
|
|
45
|
+
const fs = deps.fs ?? new filesystem_1.NodeFileSystem();
|
|
46
|
+
const exec = deps.exec ?? command_1.ExecuteCMD;
|
|
47
|
+
registry.register("local-folder", "path", async (_cache, source) => {
|
|
48
|
+
const searchPath = (0, utils_1.expandHome)(source.path);
|
|
49
|
+
const entries = await fs.readdir(searchPath);
|
|
50
|
+
const manifests = [];
|
|
51
|
+
for (const name of entries) {
|
|
52
|
+
const folder = path.join(searchPath, name);
|
|
53
|
+
const stat = await fs.stat(folder);
|
|
54
|
+
if (!stat.isDirectory())
|
|
55
|
+
continue;
|
|
56
|
+
const moduleName = source.id ? `${source.id}-${name}` : name;
|
|
57
|
+
await (0, utils_1.runInstallCommands)(exec, Logger, moduleName, folder, source.installCommand);
|
|
58
|
+
const moduleSource = {
|
|
59
|
+
type: "local",
|
|
60
|
+
path: folder,
|
|
61
|
+
watchDir: source.watchDir,
|
|
62
|
+
installCommand: source.installCommand,
|
|
63
|
+
};
|
|
64
|
+
const manifest = await module_manifest_1.ModuleManifest.create(folder, moduleSource, moduleName, fs);
|
|
65
|
+
manifests.push(manifest);
|
|
66
|
+
}
|
|
67
|
+
return manifests;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=local-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-folder.js","sourceRoot":"","sources":["../../../src/core/downloaders/local-folder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,sEA8CC;AApED,gDAAkC;AAKlC,gEAA6D;AAE7D,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Ac,EAAE,MAAM,CAAC,cAAc;aACtC,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,gCAAc,CAAC,MAAM,CAC1C,MAAM,EACN,YAAY,EACZ,UAAU,EACV,EAAE,CACH,CAAC;YACF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IFileSystem } from "../../types";
|
|
2
|
+
import type { DownloaderRegistry } from "./registry";
|
|
3
|
+
import type { CommandRunner } from "./types";
|
|
4
|
+
export interface LocalDownloaderDeps {
|
|
5
|
+
fs?: IFileSystem;
|
|
6
|
+
exec?: CommandRunner;
|
|
7
|
+
}
|
|
8
|
+
export declare function registerLocalDownloader(registry: DownloaderRegistry, deps?: LocalDownloaderDeps): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerLocalDownloader = registerLocalDownloader;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
39
|
+
const command_1 = require("../cli/command");
|
|
40
|
+
const filesystem_1 = require("../filesystem");
|
|
41
|
+
const module_manifest_1 = require("../module-manifest");
|
|
42
|
+
const utils_1 = require("./utils");
|
|
43
|
+
const Logger = new logging_1.Logging.Channel("loader.local");
|
|
44
|
+
function registerLocalDownloader(registry, deps = {}) {
|
|
45
|
+
const fs = deps.fs ?? new filesystem_1.NodeFileSystem();
|
|
46
|
+
const exec = deps.exec ?? command_1.ExecuteCMD;
|
|
47
|
+
registry.register("local", "path", async (_cache, source) => {
|
|
48
|
+
const formattedPath = (0, utils_1.expandHome)(source.path);
|
|
49
|
+
if (!(await fs.exists(formattedPath))) {
|
|
50
|
+
Logger.Error(`Path does not exist or is not accessible: ${formattedPath}`);
|
|
51
|
+
throw new Error(`Path does not exist or is not accessible: ${formattedPath}`);
|
|
52
|
+
}
|
|
53
|
+
await (0, utils_1.runInstallCommands)(exec, Logger, formattedPath, formattedPath, source.installCommand);
|
|
54
|
+
const name = source.id ?? path.basename(formattedPath);
|
|
55
|
+
const manifest = await module_manifest_1.ModuleManifest.create(formattedPath, source, name, fs);
|
|
56
|
+
return [manifest];
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/core/downloaders/local.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,0DAuCC;AA1DD,gDAAkC;AAElC,gEAA6D;AAE7D,4CAA4C;AAC5C,8CAA+C;AAE/C,wDAAoD;AAGpD,mCAAyD;AAEzD,MAAM,MAAM,GAAG,IAAI,iBAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAOnD,SAAgB,uBAAuB,CACrC,QAA4B,EAC5B,OAA4B,EAAE;IAE9B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,2BAAc,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,oBAAU,CAAC;IAErC,QAAQ,CAAC,QAAQ,CACf,OAAO,EACP,MAAM,EACN,KAAK,EAAE,MAAmB,EAAE,MAAyB,EAAE,EAAE;QACvD,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;YACtC,MAAM,CAAC,KAAK,CACV,6CAA6C,aAAa,EAAE,CAC7D,CAAC;YACF,MAAM,IAAI,KAAK,CACb,6CAA6C,aAAa,EAAE,CAC7D,CAAC;QACJ,CAAC;QAED,MAAM,IAAA,0BAAkB,EACtB,IAAI,EACJ,MAAM,EACN,aAAa,EACb,aAAa,EACb,MAAM,CAAC,cAAc,CACtB,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAG,MAAM,gCAAc,CAAC,MAAM,CAC1C,aAAa,EACb,MAAM,EACN,IAAI,EACJ,EAAE,CACH,CAAC;QACF,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IFileSystem } from "../../types";
|
|
2
|
+
import type { DownloaderRegistry } from "./registry";
|
|
3
|
+
import type { CommandRunner } from "./types";
|
|
4
|
+
export interface PackageDownloaderDeps {
|
|
5
|
+
fs?: IFileSystem;
|
|
6
|
+
exec?: CommandRunner;
|
|
7
|
+
extract?: (from: string, to: string) => Promise<void>;
|
|
8
|
+
getInstallCommand?: (folder: string) => Promise<string>;
|
|
9
|
+
getTemp?: () => Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export declare function registerPackageDownloader(registry: DownloaderRegistry, deps?: PackageDownloaderDeps): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.registerPackageDownloader = registerPackageDownloader;
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
42
|
+
const inly_1 = __importDefault(require("inly"));
|
|
43
|
+
const command_1 = require("../cli/command");
|
|
44
|
+
const package_manager_1 = require("../cli/package-manager");
|
|
45
|
+
const filesystem_1 = require("../filesystem");
|
|
46
|
+
const module_cache_1 = require("../module-cache");
|
|
47
|
+
const module_manifest_1 = require("../module-manifest");
|
|
48
|
+
const Logger = new logging_1.Logging.Channel("loader.package");
|
|
49
|
+
function defaultExtract(from, to) {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const instance = (0, inly_1.default)(from, to);
|
|
52
|
+
instance.on("error", reject);
|
|
53
|
+
instance.on("end", resolve);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function registerPackageDownloader(registry, deps = {}) {
|
|
57
|
+
const fs = deps.fs ?? new filesystem_1.NodeFileSystem();
|
|
58
|
+
const exec = deps.exec ?? command_1.ExecuteCMD;
|
|
59
|
+
const extract = deps.extract ?? defaultExtract;
|
|
60
|
+
const installCommand = deps.getInstallCommand ?? package_manager_1.getInstallCommand;
|
|
61
|
+
const getTemp = deps.getTemp ?? (() => module_cache_1.ModuleCache.getTemp());
|
|
62
|
+
registry.register("package", "package", async (cache, source) => {
|
|
63
|
+
Logger.Debug(`Loading package: ${source.package}@${source.version}`);
|
|
64
|
+
let folder;
|
|
65
|
+
let manifest;
|
|
66
|
+
if (!source.ignoreCache &&
|
|
67
|
+
cache.hasVersion(source.package, source.version)) {
|
|
68
|
+
Logger.Trace(`Using cached version of ${source.package}@${source.version}`);
|
|
69
|
+
folder = await cache.getFolder(source.package, true, true);
|
|
70
|
+
manifest = JSON.parse(await fs.readFileString(path.join(folder, "package.json")));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
Logger.Trace(`Downloading package ${source.package}@${source.version}`);
|
|
74
|
+
const tmp = await getTemp();
|
|
75
|
+
const result = await exec(`npm pack ${source.package}@${source.version}`, { cwd: tmp });
|
|
76
|
+
if (result.code !== 0) {
|
|
77
|
+
throw new Error(`Failed to pack npm package: ${result.stderr}`);
|
|
78
|
+
}
|
|
79
|
+
const filename = result.stdout.trim();
|
|
80
|
+
Logger.Debug(`Extracting ${filename} for ${source.package}@${source.version}`);
|
|
81
|
+
await extract(path.join(tmp, filename), tmp);
|
|
82
|
+
const tmpPackage = path.join(tmp, "package");
|
|
83
|
+
manifest = JSON.parse(await fs.readFileString(path.join(tmpPackage, "package.json")));
|
|
84
|
+
Logger.Trace(`Transferring ${source.package}@${source.version} to cache`);
|
|
85
|
+
folder = await cache.transfer(tmpPackage, source.package, manifest.version);
|
|
86
|
+
Logger.Debug(`Installing dependencies for ${source.package}@${source.version}`);
|
|
87
|
+
const cmd = await installCommand(folder);
|
|
88
|
+
const installResult = await exec(cmd, { cwd: folder });
|
|
89
|
+
if (installResult.code !== 0) {
|
|
90
|
+
throw new Error(`Failed to install dependencies: ${installResult.stderr}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
Logger.Debug(`Successfully loaded ${source.package}@${source.version}`);
|
|
94
|
+
const name = source.id ?? source.package;
|
|
95
|
+
const moduleManifest = await module_manifest_1.ModuleManifest.create(folder, source, name, fs);
|
|
96
|
+
return [moduleManifest];
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../../src/core/downloaders/package.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,8DAkFC;AAlHD,gDAAkC;AAElC,gEAA6D;AAE7D,gDAAwB;AAExB,4CAA4C;AAC5C,4DAA2D;AAC3D,8CAA+C;AAC/C,kDAA8C;AAC9C,wDAA4E;AAY5E,MAAM,MAAM,GAAG,IAAI,iBAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAErD,SAAS,cAAc,CAAC,IAAY,EAAE,EAAU;IAC9C,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,IAAA,cAAI,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAChC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,yBAAyB,CACvC,QAA4B,EAC5B,OAA8B,EAAE;IAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,2BAAc,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,oBAAU,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAA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J,CAAC;QACH,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,uBAAuB,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC;QACzC,MAAM,cAAc,GAAG,MAAM,gCAAc,CAAC,MAAM,CAChD,MAAM,EACN,MAAM,EACN,IAAI,EACJ,EAAE,CACH,CAAC;QACF,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModuleSource } from "@antelopejs/interface-core/config";
|
|
2
|
+
import type { ModuleCache } from "../module-cache";
|
|
3
|
+
import type { ModuleManifest } from "../module-manifest";
|
|
4
|
+
export type ModuleLoader<T extends ModuleSource = ModuleSource> = (cache: ModuleCache, source: T) => Promise<ModuleManifest[]>;
|
|
5
|
+
export declare class DownloaderRegistry {
|
|
6
|
+
private waiting;
|
|
7
|
+
private knownTypes;
|
|
8
|
+
register<T extends ModuleSource>(type: string, loaderIdentifier: keyof T, loader: ModuleLoader<T>): void;
|
|
9
|
+
load(projectFolder: string, cache: ModuleCache, source: ModuleSource): Promise<ModuleManifest[]>;
|
|
10
|
+
getLoaderIdentifier(source: ModuleSource): any | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DownloaderRegistry = void 0;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
39
|
+
const Logger = new logging_1.Logging.Channel("loader.common");
|
|
40
|
+
class DownloaderRegistry {
|
|
41
|
+
waiting = new Map();
|
|
42
|
+
knownTypes = new Map();
|
|
43
|
+
register(type, loaderIdentifier, loader) {
|
|
44
|
+
this.knownTypes.set(type, { loaderIdentifier, loader });
|
|
45
|
+
const waitingList = this.waiting.get(type);
|
|
46
|
+
if (waitingList) {
|
|
47
|
+
for (const waiter of waitingList) {
|
|
48
|
+
void loader(waiter.cache, waiter.source).then(waiter.resolve, waiter.reject);
|
|
49
|
+
}
|
|
50
|
+
this.waiting.delete(type);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
load(projectFolder, cache, source) {
|
|
54
|
+
Logger.Debug(`LoadModule called for type ${source.type}`);
|
|
55
|
+
const type = this.knownTypes.get(source.type);
|
|
56
|
+
if (type) {
|
|
57
|
+
Logger.Trace(`Found loader for type ${source.type}`);
|
|
58
|
+
if (type.loaderIdentifier === "path") {
|
|
59
|
+
const pathValue = source[type.loaderIdentifier];
|
|
60
|
+
if (typeof pathValue === "string" && !path.isAbsolute(pathValue)) {
|
|
61
|
+
source[type.loaderIdentifier] = path.resolve(projectFolder, pathValue);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return type.loader(cache, source);
|
|
65
|
+
}
|
|
66
|
+
Logger.Info(`No loader found for type ${source.type}, adding to waitlist`);
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
let waitingList = this.waiting.get(source.type);
|
|
69
|
+
if (!waitingList) {
|
|
70
|
+
waitingList = [];
|
|
71
|
+
this.waiting.set(source.type, waitingList);
|
|
72
|
+
}
|
|
73
|
+
waitingList.push({ cache, source, resolve, reject });
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
getLoaderIdentifier(source) {
|
|
77
|
+
const type = this.knownTypes.get(source.type);
|
|
78
|
+
if (type) {
|
|
79
|
+
return source[type.loaderIdentifier];
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.DownloaderRegistry = DownloaderRegistry;
|
|
85
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/downloaders/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAElC,gEAA6D;AAI7D,MAAM,MAAM,GAAG,IAAI,iBAAO,CAAC,OAAO,CAAC,eAAe,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AC,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,OAAO,CACnD,aAAa,EACb,SAAS,CACV,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAa,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,IAAI,sBAAsB,CAAC,CAAC;QAC3E,OAAO,IAAI,OAAO,CAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACvD,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChD,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,WAAW,GAAG,EAAE,CAAC;gBACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAC7C,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,CAAC,MAAoB;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,IAAI,EAAE,CAAC;YACT,OAAQ,MAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAhED,gDAgEC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CommandResult {
|
|
2
|
+
stdout: string;
|
|
3
|
+
stderr: string;
|
|
4
|
+
code: number;
|
|
5
|
+
}
|
|
6
|
+
export type CommandRunner = (command: string, options: {
|
|
7
|
+
cwd?: string;
|
|
8
|
+
}) => Promise<CommandResult>;
|
|
9
|
+
export interface DebugLogger {
|
|
10
|
+
Debug(...args: unknown[]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/downloaders/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ModuleInstallCommand } from "@antelopejs/interface-core/config";
|
|
2
|
+
import type { CommandRunner, DebugLogger } from "./types";
|
|
3
|
+
export declare function normalizeCommands(installCommand?: ModuleInstallCommand): string[];
|
|
4
|
+
export declare function runInstallCommands(exec: CommandRunner, logger: DebugLogger, label: string, folder: string, installCommand?: ModuleInstallCommand): Promise<void>;
|
|
5
|
+
export declare function expandHome(input: string): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.normalizeCommands = normalizeCommands;
|
|
37
|
+
exports.runInstallCommands = runInstallCommands;
|
|
38
|
+
exports.expandHome = expandHome;
|
|
39
|
+
const os = __importStar(require("node:os"));
|
|
40
|
+
const terminal_display_1 = require("../cli/terminal-display");
|
|
41
|
+
function normalizeCommands(installCommand) {
|
|
42
|
+
if (!installCommand) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
return Array.isArray(installCommand) ? installCommand : [installCommand];
|
|
46
|
+
}
|
|
47
|
+
async function runInstallCommands(exec, logger, label, folder, installCommand) {
|
|
48
|
+
const commands = normalizeCommands(installCommand);
|
|
49
|
+
if (commands.length === 0) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await terminal_display_1.terminalDisplay.startSpinner(`Installing dependencies for ${label}`);
|
|
53
|
+
for (const command of commands) {
|
|
54
|
+
logger.Debug(`Executing command: ${command}`);
|
|
55
|
+
const result = await exec(command, { cwd: folder });
|
|
56
|
+
if (result.code !== 0) {
|
|
57
|
+
await terminal_display_1.terminalDisplay.failSpinner(`Failed to install dependencies: ${result.stderr}`);
|
|
58
|
+
throw new Error(`Failed to install dependencies: ${result.stderr || result.stdout}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
await terminal_display_1.terminalDisplay.stopSpinner(`Dependencies installed for ${label}`);
|
|
62
|
+
}
|
|
63
|
+
function expandHome(input) {
|
|
64
|
+
const homeDir = os.homedir();
|
|
65
|
+
if (input.startsWith("~")) {
|
|
66
|
+
return homeDir + input.slice(1);
|
|
67
|
+
}
|
|
68
|
+
if (input.includes("~")) {
|
|
69
|
+
const parts = input.split("~");
|
|
70
|
+
if (parts[0].startsWith(homeDir)) {
|
|
71
|
+
return `${homeDir}/${parts[1].replace(/^\/+/, "")}`;
|
|
72
|
+
}
|
|
73
|
+
return input.replace(/~/g, homeDir).replace(/\/+/, "/");
|
|
74
|
+
}
|
|
75
|
+
return input;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/downloaders/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,8CAOC;AAED,gDA0BC;AAED,gCAgBC;AA1DD,4CAA8B;AAE9B,8DAA0D;AAG1D,SAAgB,iBAAiB,CAC/B,cAAqC;IAErC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;AAC3E,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,IAAmB,EACnB,MAAmB,EACnB,KAAa,EACb,MAAc,EACd,cAAqC;IAErC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACnD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,kCAAe,CAAC,YAAY,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;IAC3E,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,EAAE,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System } from "../types";
|
|
3
|
+
export declare class NodeFileSystem implements IFileSystem {
|
|
4
|
+
readFile(filePath: string): Promise<Buffer>;
|
|
5
|
+
readFileString(filePath: string, encoding?: BufferEncoding): Promise<string>;
|
|
6
|
+
writeFile(filePath: string, data: Buffer | string): Promise<void>;
|
|
7
|
+
readdir(dirPath: string): Promise<string[]>;
|
|
8
|
+
stat(filePath: string): Promise<fsSync.Stats>;
|
|
9
|
+
mkdir(dirPath: string, options?: {
|
|
10
|
+
recursive?: boolean;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
rm(filePath: string, options?: {
|
|
13
|
+
recursive?: boolean;
|
|
14
|
+
force?: boolean;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
exists(filePath: string): Promise<boolean>;
|
|
17
|
+
access(filePath: string): Promise<void>;
|
|
18
|
+
copyFile(src: string, dest: string): Promise<void>;
|
|
19
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.NodeFileSystem = void 0;
|
|
37
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
38
|
+
class NodeFileSystem {
|
|
39
|
+
async readFile(filePath) {
|
|
40
|
+
return fs.readFile(filePath);
|
|
41
|
+
}
|
|
42
|
+
async readFileString(filePath, encoding = "utf-8") {
|
|
43
|
+
return fs.readFile(filePath, encoding);
|
|
44
|
+
}
|
|
45
|
+
async writeFile(filePath, data) {
|
|
46
|
+
await fs.writeFile(filePath, data);
|
|
47
|
+
}
|
|
48
|
+
async readdir(dirPath) {
|
|
49
|
+
return fs.readdir(dirPath);
|
|
50
|
+
}
|
|
51
|
+
async stat(filePath) {
|
|
52
|
+
return fs.stat(filePath);
|
|
53
|
+
}
|
|
54
|
+
async mkdir(dirPath, options) {
|
|
55
|
+
await fs.mkdir(dirPath, options);
|
|
56
|
+
}
|
|
57
|
+
async rm(filePath, options) {
|
|
58
|
+
await fs.rm(filePath, options);
|
|
59
|
+
}
|
|
60
|
+
async exists(filePath) {
|
|
61
|
+
try {
|
|
62
|
+
await fs.access(filePath);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async access(filePath) {
|
|
70
|
+
await fs.access(filePath);
|
|
71
|
+
}
|
|
72
|
+
async copyFile(src, dest) {
|
|
73
|
+
await fs.copyFile(src, dest);
|
|
74
|
+
}
|
|
75
|
+
async rename(oldPath, newPath) {
|
|
76
|
+
await fs.rename(oldPath, newPath);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.NodeFileSystem = NodeFileSystem;
|
|
80
|
+
//# sourceMappingURL=filesystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/core/filesystem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAuC;AAGvC,MAAa,cAAc;IACzB,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,WAA2B,OAAO;QAElC,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE,IAAqB;QACrD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAe;QAC3B,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB;QACzB,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAK,CACT,OAAe,EACf,OAAiC;QAEjC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,EAAE,CACN,QAAgB,EAChB,OAAkD;QAElD,MAAM,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB;QAC3B,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB;QAC3B,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,IAAY;QACtC,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAAe;QAC3C,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AA1DD,wCA0DC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InterfaceRegistry = void 0;
|
|
4
|
+
const internal_1 = require("@antelopejs/interface-core/internal");
|
|
5
|
+
class InterfaceRegistry {
|
|
6
|
+
setConnections(moduleId, connections) {
|
|
7
|
+
const connectionIDs = {};
|
|
8
|
+
for (const [interfaceName, modules] of connections) {
|
|
9
|
+
connectionIDs[interfaceName] = modules.map(({ id }) => {
|
|
10
|
+
const entry = {
|
|
11
|
+
path: interfaceName,
|
|
12
|
+
};
|
|
13
|
+
if (id !== undefined) {
|
|
14
|
+
entry.id = id;
|
|
15
|
+
}
|
|
16
|
+
return entry;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
internal_1.internal.interfaceConnections[moduleId] = connectionIDs;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.InterfaceRegistry = InterfaceRegistry;
|
|
23
|
+
//# sourceMappingURL=interface-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface-registry.js","sourceRoot":"","sources":["../../src/core/interface-registry.ts"],"names":[],"mappings":";;;AAAA,kEAA+D;AAY/D,MAAa,iBAAiB;IAC5B,cAAc,CACZ,QAAgB,EAChB,WAAkD;QAElD,MAAM,aAAa,GAA+C,EAAE,CAAC;QACrE,KAAK,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,WAAW,EAAE,CAAC;YACnD,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;gBACpD,MAAM,KAAK,GAA6B;oBACtC,IAAI,EAAE,aAAa;iBACpB,CAAC;gBACF,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;oBACrB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;gBAChB,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;QACL,CAAC;QACD,mBAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC;IAC1D,CAAC;CACF;AAnBD,8CAmBC"}
|