@antelopejs/core 0.3.2 → 1.1.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 +5 -15
- 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 +208 -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 +79 -85
- 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 +231 -0
- package/dist/core/cli/common.js.map +1 -0
- package/dist/core/cli/git-operations.d.ts +30 -0
- 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 +66 -0
- package/dist/core/module-manager.js +343 -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/interface-resolution.d.ts +14 -0
- package/dist/core/resolution/interface-resolution.js +34 -0
- package/dist/core/resolution/interface-resolution.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 +333 -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 +143 -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 +50 -38
- 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.d.ts +0 -51
- 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
package/dist/logging/logger.js
CHANGED
|
@@ -1,132 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
exports.levelMap = {
|
|
23
|
-
trace: 0,
|
|
24
|
-
debug: 10,
|
|
25
|
-
info: 20,
|
|
26
|
-
warn: 30,
|
|
27
|
-
error: 40,
|
|
28
|
-
};
|
|
29
|
-
exports.defaultConfigLogging = {
|
|
30
|
-
enabled: true,
|
|
31
|
-
moduleTracking: { enabled: false, includes: [], excludes: [] },
|
|
32
|
-
formatter: {
|
|
33
|
-
'0': '{{chalk.gray}}[{{DATE}}] {{chalk.magenta}}{{chalk.bold}}[TRACE]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
34
|
-
'10': '{{chalk.gray}}[{{DATE}}] {{chalk.blue}}{{chalk.bold}}[DEBUG]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
35
|
-
'20': '{{chalk.gray}}[{{DATE}}] {{chalk.green}}{{chalk.bold}}[INFO]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
36
|
-
'30': '{{chalk.gray}}[{{DATE}}] {{chalk.yellow}}{{chalk.bold}}[WARN]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
37
|
-
'40': '{{chalk.gray}}[{{DATE}}] {{chalk.red}}{{chalk.bold}}[ERROR]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
38
|
-
default: '{{chalk.gray}}[{{DATE}}] {{chalk.white}}{{chalk.bold}}[LOG]{{chalk.reset}}{{chalk.dim}} {{chalk.reset}} {{ARGS}}',
|
|
39
|
-
},
|
|
40
|
-
dateFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
41
|
-
};
|
|
42
|
-
function getStream(log) {
|
|
43
|
-
return log.levelId === beta_2.Logging.Level.ERROR.valueOf() ? process.stderr : process.stdout;
|
|
44
|
-
}
|
|
45
|
-
let loggingConfig;
|
|
46
|
-
const channelCache = {};
|
|
47
|
-
function getChannelFilter(channel) {
|
|
48
|
-
if (!loggingConfig.channelFilter) {
|
|
49
|
-
return exports.levelMap.warn;
|
|
50
|
-
}
|
|
51
|
-
let match = -1;
|
|
52
|
-
let matchValue = exports.levelMap.warn;
|
|
53
|
-
for (const key of Object.keys(loggingConfig.channelFilter)) {
|
|
54
|
-
if (key.endsWith('*')) {
|
|
55
|
-
if (channel.startsWith(key.substring(0, key.length - 1)) && match < key.length - 1) {
|
|
56
|
-
match = key.length - 1;
|
|
57
|
-
matchValue = loggingConfig.channelFilter[key];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else if (channel === key) {
|
|
61
|
-
matchValue = loggingConfig.channelFilter[key];
|
|
62
|
-
break;
|
|
3
|
+
exports.LogLevel = exports.LogChannel = exports.Logger = void 0;
|
|
4
|
+
const log_filter_1 = require("./log-filter");
|
|
5
|
+
const log_formatter_1 = require("./log-formatter");
|
|
6
|
+
class Logger {
|
|
7
|
+
formatter = new log_formatter_1.LogFormatter();
|
|
8
|
+
filter = new log_filter_1.LogFilter();
|
|
9
|
+
transports = [];
|
|
10
|
+
defaultChannel = "default";
|
|
11
|
+
addTransport(transport) {
|
|
12
|
+
this.transports.push(transport);
|
|
13
|
+
}
|
|
14
|
+
removeTransport(transport) {
|
|
15
|
+
const index = this.transports.indexOf(transport);
|
|
16
|
+
if (index !== -1) {
|
|
17
|
+
this.transports.splice(index, 1);
|
|
63
18
|
}
|
|
64
19
|
}
|
|
65
|
-
|
|
66
|
-
|
|
20
|
+
setMinLevel(level) {
|
|
21
|
+
this.filter.setMinLevel(level);
|
|
67
22
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function shouldIgnoreChannel(log) {
|
|
71
|
-
let filter = channelCache[log.channel];
|
|
72
|
-
if (filter === undefined) {
|
|
73
|
-
filter = getChannelFilter(log.channel);
|
|
74
|
-
channelCache[log.channel] = filter;
|
|
23
|
+
setChannelLevel(channel, level) {
|
|
24
|
+
this.filter.setChannelLevel(channel, level);
|
|
75
25
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
function shouldIgnoreModule(_log) {
|
|
79
|
-
if (loggingConfig.moduleTracking.enabled) {
|
|
80
|
-
const module = (0, beta_1.GetResponsibleModule)() || '';
|
|
81
|
-
if (loggingConfig.moduleTracking.excludes.length > 0) {
|
|
82
|
-
return loggingConfig.moduleTracking.excludes.includes(module);
|
|
83
|
-
}
|
|
84
|
-
if (loggingConfig.moduleTracking.includes.length > 0) {
|
|
85
|
-
return !loggingConfig.moduleTracking.includes.includes(module);
|
|
86
|
-
}
|
|
26
|
+
setModuleTracking(enabled) {
|
|
27
|
+
this.filter.setModuleTracking(enabled);
|
|
87
28
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
function handleLog(log) {
|
|
91
|
-
if (shouldIgnoreChannel(log) || shouldIgnoreModule(log)) {
|
|
92
|
-
return;
|
|
29
|
+
setModuleIncludes(modules) {
|
|
30
|
+
this.filter.setModuleIncludes(modules);
|
|
93
31
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (terminal_display_1.terminalDisplay.isSpinnerActive()) {
|
|
97
|
-
terminal_display_1.terminalDisplay.log(message);
|
|
32
|
+
setModuleExcludes(modules) {
|
|
33
|
+
this.filter.setModuleExcludes(modules);
|
|
98
34
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
stream.write(utils_1.NEWLINE);
|
|
35
|
+
setTemplate(level, template) {
|
|
36
|
+
this.formatter.setTemplate(level, template);
|
|
102
37
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
38
|
+
setDateFormat(format) {
|
|
39
|
+
this.formatter.setDateFormat(format);
|
|
40
|
+
}
|
|
41
|
+
createChannel(name) {
|
|
42
|
+
return new LogChannel(this, name);
|
|
43
|
+
}
|
|
44
|
+
error(...args) {
|
|
45
|
+
this.log(log_formatter_1.LogLevel.ERROR, this.defaultChannel, args);
|
|
46
|
+
}
|
|
47
|
+
warn(...args) {
|
|
48
|
+
this.log(log_formatter_1.LogLevel.WARN, this.defaultChannel, args);
|
|
49
|
+
}
|
|
50
|
+
info(...args) {
|
|
51
|
+
this.log(log_formatter_1.LogLevel.INFO, this.defaultChannel, args);
|
|
52
|
+
}
|
|
53
|
+
debug(...args) {
|
|
54
|
+
this.log(log_formatter_1.LogLevel.DEBUG, this.defaultChannel, args);
|
|
55
|
+
}
|
|
56
|
+
trace(...args) {
|
|
57
|
+
this.log(log_formatter_1.LogLevel.TRACE, this.defaultChannel, args);
|
|
58
|
+
}
|
|
59
|
+
write(level, channel, args, module) {
|
|
60
|
+
this.log(level, channel, args, module);
|
|
61
|
+
}
|
|
62
|
+
log(level, channel, args, module) {
|
|
63
|
+
const entry = {
|
|
64
|
+
level,
|
|
65
|
+
channel,
|
|
66
|
+
args,
|
|
67
|
+
time: new Date(),
|
|
68
|
+
module,
|
|
69
|
+
};
|
|
70
|
+
if (!this.filter.shouldLog(entry)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const formatted = this.formatter.format(entry);
|
|
74
|
+
for (const transport of this.transports) {
|
|
75
|
+
transport(entry, formatted);
|
|
111
76
|
}
|
|
112
|
-
loggingConfig.channelFilter[channel] = level;
|
|
113
77
|
}
|
|
114
78
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
exports.Logger = Logger;
|
|
80
|
+
class LogChannel {
|
|
81
|
+
logger;
|
|
82
|
+
name;
|
|
83
|
+
constructor(logger, name) {
|
|
84
|
+
this.logger = logger;
|
|
85
|
+
this.name = name;
|
|
86
|
+
}
|
|
87
|
+
error(...args) {
|
|
88
|
+
this.logger.write(log_formatter_1.LogLevel.ERROR, this.name, args);
|
|
89
|
+
}
|
|
90
|
+
warn(...args) {
|
|
91
|
+
this.logger.write(log_formatter_1.LogLevel.WARN, this.name, args);
|
|
119
92
|
}
|
|
120
|
-
|
|
121
|
-
|
|
93
|
+
info(...args) {
|
|
94
|
+
this.logger.write(log_formatter_1.LogLevel.INFO, this.name, args);
|
|
122
95
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
loggingConfig.channelFilter = {};
|
|
96
|
+
debug(...args) {
|
|
97
|
+
this.logger.write(log_formatter_1.LogLevel.DEBUG, this.name, args);
|
|
126
98
|
}
|
|
127
|
-
|
|
128
|
-
|
|
99
|
+
trace(...args) {
|
|
100
|
+
this.logger.write(log_formatter_1.LogLevel.TRACE, this.name, args);
|
|
129
101
|
}
|
|
130
|
-
listener_1.default.register(handleLog);
|
|
131
102
|
}
|
|
103
|
+
exports.LogChannel = LogChannel;
|
|
104
|
+
var log_formatter_2 = require("./log-formatter");
|
|
105
|
+
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return log_formatter_2.LogLevel; } });
|
|
132
106
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":";;;AAAA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@
|
|
|
1
|
+
{"version":3,"file":"config.types.js","sourceRoot":"","sources":["../../src/types/config.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Stats } from "node:fs";
|
|
2
|
+
export interface IFileSystem {
|
|
3
|
+
readFile(path: string): Promise<Buffer>;
|
|
4
|
+
readFileString(path: string, encoding?: BufferEncoding): Promise<string>;
|
|
5
|
+
writeFile(path: string, data: Buffer | string): Promise<void>;
|
|
6
|
+
readdir(path: string): Promise<string[]>;
|
|
7
|
+
stat(path: string): Promise<Stats>;
|
|
8
|
+
mkdir(path: string, options?: {
|
|
9
|
+
recursive?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
rm(path: string, options?: {
|
|
12
|
+
recursive?: boolean;
|
|
13
|
+
force?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
exists(path: string): Promise<boolean>;
|
|
16
|
+
access(path: string): Promise<void>;
|
|
17
|
+
copyFile(src: string, dest: string): Promise<void>;
|
|
18
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.types.js","sourceRoot":"","sources":["../../src/types/filesystem.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./config.types"), exports);
|
|
18
|
+
__exportStar(require("./filesystem.types"), exports);
|
|
19
|
+
__exportStar(require("./module.types"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,qDAAmC;AACnC,iDAA+B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum ModuleState {
|
|
2
|
+
Loaded = "loaded",
|
|
3
|
+
Constructed = "constructed",
|
|
4
|
+
Active = "active"
|
|
5
|
+
}
|
|
6
|
+
export interface ModuleCallbacks {
|
|
7
|
+
construct?(config: unknown): Promise<void> | void;
|
|
8
|
+
destroy?(): Promise<void> | void;
|
|
9
|
+
start?(): void;
|
|
10
|
+
stop?(): Promise<void> | void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleState = void 0;
|
|
4
|
+
var ModuleState;
|
|
5
|
+
(function (ModuleState) {
|
|
6
|
+
ModuleState["Loaded"] = "loaded";
|
|
7
|
+
ModuleState["Constructed"] = "constructed";
|
|
8
|
+
ModuleState["Active"] = "active";
|
|
9
|
+
})(ModuleState || (exports.ModuleState = ModuleState = {}));
|
|
10
|
+
//# sourceMappingURL=module.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.types.js","sourceRoot":"","sources":["../../src/types/module.types.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;IAC3B,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lock"), exports);
|
|
18
|
+
__exportStar(require("./object"), exports);
|
|
19
|
+
__exportStar(require("./promise"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,4CAA0B"}
|
package/dist/utils/lock.js
CHANGED
|
@@ -4,17 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.acquireLock = acquireLock;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_os_1 = require("node:os");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
10
|
const proper_lockfile_1 = __importDefault(require("proper-lockfile"));
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const DEFAULT_LOCK_TIMEOUT_MS = 30000;
|
|
12
|
+
function getLockDir() {
|
|
13
|
+
return node_path_1.default.join((0, node_os_1.homedir)(), ".antelopejs", "locks");
|
|
14
|
+
}
|
|
15
|
+
async function acquireLock(lockName, timeoutMs = DEFAULT_LOCK_TIMEOUT_MS) {
|
|
16
|
+
const sanitizedLockName = lockName.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
17
|
+
const lockDir = getLockDir();
|
|
18
|
+
const lockFile = node_path_1.default.join(lockDir, `${sanitizedLockName}.lock`);
|
|
19
|
+
if (!(0, node_fs_1.existsSync)(lockFile)) {
|
|
20
|
+
(0, node_fs_1.mkdirSync)(lockDir, { recursive: true });
|
|
21
|
+
(0, node_fs_1.writeFileSync)(lockFile, "");
|
|
18
22
|
}
|
|
19
23
|
await proper_lockfile_1.default.lock(lockFile, {
|
|
20
24
|
retries: {
|
|
@@ -30,6 +34,7 @@ async function acquireLock(lockName, timeoutMs = 30000) {
|
|
|
30
34
|
await proper_lockfile_1.default.unlock(lockFile);
|
|
31
35
|
}
|
|
32
36
|
catch {
|
|
37
|
+
return;
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
40
|
}
|
package/dist/utils/lock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/utils/lock.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/utils/lock.ts"],"names":[],"mappings":";;;;;AAWA,kCA8BC;AAzC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:
|
|
2
|
-
export declare function mergeDeep(target:
|
|
1
|
+
export declare function isObject(item: unknown): item is Record<string, unknown>;
|
|
2
|
+
export declare function mergeDeep(target: Record<string, any>, ...sources: Array<Record<string, any> | undefined>): Record<string, any>;
|
|
3
|
+
export declare function set(obj: Record<string, any>, path: string, value: unknown): void;
|
package/dist/utils/object.js
CHANGED
|
@@ -2,25 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isObject = isObject;
|
|
4
4
|
exports.mergeDeep = mergeDeep;
|
|
5
|
+
exports.set = set;
|
|
5
6
|
function isObject(item) {
|
|
6
|
-
return item && typeof item ===
|
|
7
|
+
return item !== null && typeof item === "object" && !Array.isArray(item);
|
|
7
8
|
}
|
|
8
9
|
function mergeDeep(target, ...sources) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const result = { ...target };
|
|
11
|
+
for (const source of sources) {
|
|
12
|
+
if (!source)
|
|
13
|
+
continue;
|
|
13
14
|
for (const key in source) {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (Object.hasOwn(source, key)) {
|
|
16
|
+
const sourceValue = source[key];
|
|
17
|
+
const targetValue = result[key];
|
|
18
|
+
if (isObject(sourceValue) && isObject(targetValue)) {
|
|
19
|
+
result[key] = mergeDeep(targetValue, sourceValue);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
result[key] = sourceValue;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
return
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
function set(obj, path, value) {
|
|
30
|
+
const keys = path.split(".");
|
|
31
|
+
let current = obj;
|
|
32
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
33
|
+
const key = keys[i];
|
|
34
|
+
if (!(key in current) || !isObject(current[key])) {
|
|
35
|
+
current[key] = {};
|
|
36
|
+
}
|
|
37
|
+
current = current[key];
|
|
38
|
+
}
|
|
39
|
+
current[keys[keys.length - 1]] = value;
|
|
25
40
|
}
|
|
26
41
|
//# sourceMappingURL=object.js.map
|
package/dist/utils/object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAED,
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAED,8BAuBC;AAED,kBAiBC;AA9CD,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,SAAgB,SAAS,CACvB,MAA2B,EAC3B,GAAG,OAA+C;IAElD,MAAM,MAAM,GAAwB,EAAE,GAAG,MAAM,EAAE,CAAC;IAElD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;gBAC/B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBAEhC,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;oBACnD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;gBACpD,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,GAAG,CACjB,GAAwB,EACxB,IAAY,EACZ,KAAc;IAEd,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,OAAO,GAAG,GAAG,CAAC;IAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AACzC,CAAC"}
|
package/dist/utils/promise.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
1
|
+
export declare function Detour<T extends (...args: any[]) => any>(fn: T, sideEffect: (...args: Parameters<T>) => void): T;
|
|
2
|
+
export declare function CreateDetour<T extends (...args: any[]) => any>(fn: T): {
|
|
3
|
+
fn: T;
|
|
4
|
+
detour: (sideEffect: (...args: Parameters<T>) => void) => void;
|
|
5
|
+
};
|
package/dist/utils/promise.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResolveLater = ResolveLater;
|
|
4
3
|
exports.Detour = Detour;
|
|
5
4
|
exports.CreateDetour = CreateDetour;
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function Detour(fn, sideEffect) {
|
|
6
|
+
return ((...args) => {
|
|
7
|
+
sideEffect(...args);
|
|
8
|
+
return fn(...args);
|
|
10
9
|
});
|
|
11
|
-
return [promise, resolve];
|
|
12
10
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
function CreateDetour(fn) {
|
|
12
|
+
let currentSideEffect;
|
|
13
|
+
const wrapped = ((...args) => {
|
|
14
|
+
currentSideEffect?.(...args);
|
|
15
|
+
return fn(...args);
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
fn: wrapped,
|
|
19
|
+
detour: (sideEffect) => {
|
|
20
|
+
currentSideEffect = sideEffect;
|
|
21
|
+
},
|
|
17
22
|
};
|
|
18
23
|
}
|
|
19
|
-
function CreateDetour(func) {
|
|
20
|
-
const [promise, resolve] = ResolveLater();
|
|
21
|
-
func(promise);
|
|
22
|
-
return Detour(resolve);
|
|
23
|
-
}
|
|
24
24
|
//# sourceMappingURL=promise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.js","sourceRoot":"","sources":["../../src/utils/promise.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"promise.js","sourceRoot":"","sources":["../../src/utils/promise.ts"],"names":[],"mappings":";;AAAA,wBAQC;AAED,oCAgBC;AA1BD,SAAgB,MAAM,CACpB,EAAK,EACL,UAA4C;IAE5C,OAAO,CAAC,CAAC,GAAG,IAAmB,EAAE,EAAE;QACjC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QACpB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IACrB,CAAC,CAAM,CAAC;AACV,CAAC;AAED,SAAgB,YAAY,CAC1B,EAAK;IAEL,IAAI,iBAAiE,CAAC;IAEtE,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,IAAmB,EAAE,EAAE;QAC1C,iBAAiB,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7B,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IACrB,CAAC,CAAM,CAAC;IAER,OAAO;QACL,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;YACrB,iBAAiB,GAAG,UAAU,CAAC;QACjC,CAAC;KACF,CAAC;AACJ,CAAC"}
|