@codefast/cli 0.3.15 → 0.3.16-canary.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/README.md +1 -1
- package/dist/arrange/analyze.mjs +24 -0
- package/dist/{domains/arrange/presentation/presenters/arrange-cli.schema.mjs → arrange/cli-schema.mjs} +10 -1
- package/dist/arrange/command.mjs +106 -0
- package/dist/{domains/arrange/domain/arrange-analyze.domain-service.mjs → arrange/domain/analyze-service.mjs} +17 -10
- package/dist/{domains/arrange/domain/ast/ast-node.model.mjs → arrange/domain/ast/ast-node.mjs} +57 -3
- package/dist/{domains/arrange/domain/ast/collectors-cn.collector.mjs → arrange/domain/ast/collectors-cn.mjs} +21 -9
- package/dist/{domains/arrange/domain/ast/collectors-jsx.collector.mjs → arrange/domain/ast/collectors-jsx.mjs} +5 -2
- package/dist/{domains/arrange/domain/ast/collectors-tv.collector.mjs → arrange/domain/ast/collectors-tv.mjs} +21 -6
- package/dist/{domains/arrange/domain/ast/ast-helpers.helper.mjs → arrange/domain/ast/helpers.mjs} +26 -9
- package/dist/{domains/arrange/domain/ast/targets.model.mjs → arrange/domain/ast/targets.mjs} +19 -10
- package/dist/{domains/arrange/domain/constants.domain.mjs → arrange/domain/constants.mjs} +63 -18
- package/dist/{domains/arrange/domain/arrange-grouping.domain-service.mjs → arrange/domain/grouping-service.mjs} +31 -10
- package/dist/{domains/arrange/domain/grouping.domain.mjs → arrange/domain/grouping.mjs} +39 -18
- package/dist/{domains/arrange/domain/imports.domain.mjs → arrange/domain/imports.mjs} +7 -3
- package/dist/{domains/arrange/domain/source-text-formatters.formatter.mjs → arrange/domain/source-text-formatters.mjs} +22 -5
- package/dist/{domains/arrange/domain/tailwind-token.value-object.mjs → arrange/domain/tailwind-token.mjs} +12 -3
- package/dist/{domains/arrange/domain/tailwind-token-classifier.domain-service.mjs → arrange/domain/token-classifier.mjs} +40 -15
- package/dist/arrange/output.mjs +79 -0
- package/dist/arrange/process-file.mjs +42 -0
- package/dist/arrange/resolve-target.mjs +24 -0
- package/dist/arrange/scan-target.mjs +20 -0
- package/dist/arrange/source-parse.mjs +18 -0
- package/dist/arrange/suggest.mjs +15 -0
- package/dist/arrange/sync.mjs +51 -0
- package/dist/arrange/typescript-ast-translator.mjs +354 -0
- package/dist/arrange/workspace.mjs +31 -0
- package/dist/bin.mjs +1 -1
- package/dist/{program.mjs → cli.mjs} +14 -20
- package/dist/core/cli/format-error.mjs +15 -0
- package/dist/core/cli/global-options.mjs +10 -0
- package/dist/core/cli/positional.mjs +11 -0
- package/dist/core/cli/result-handle.mjs +51 -0
- package/dist/core/config/loader.mjs +79 -0
- package/dist/{domains/config/domain/codefast-config.schema.mjs → core/config/schema.mjs} +16 -2
- package/dist/core/config/warnings.mjs +12 -0
- package/dist/core/config.mjs +19 -0
- package/dist/{shell/domain/caught-unknown-message.value-object.mjs → core/errors.mjs} +20 -4
- package/dist/core/exit-codes.mjs +17 -0
- package/dist/core/filesystem/node.mjs +32 -0
- package/dist/core/logger.mjs +15 -0
- package/dist/{shell/domain/result.model.mjs → core/result.mjs} +7 -3
- package/dist/core/schema-parse.mjs +18 -0
- package/dist/{shell/domain/source-text-edit.support.mjs → core/source-text-edit.mjs} +14 -13
- package/dist/core/verbose-diagnostics.mjs +11 -0
- package/dist/core/workspace/resolver.mjs +177 -0
- package/dist/core/workspace/typescript-walk.mjs +36 -0
- package/dist/{domains/mirror/application/mirror-sync-cli-result.mjs → mirror/cli-result.mjs} +8 -2
- package/dist/{domains/mirror/presentation/presenters/mirror-cli.schema.mjs → mirror/cli-schema.mjs} +4 -1
- package/dist/mirror/command.mjs +57 -0
- package/dist/mirror/dist-filesystem-impl.mjs +42 -0
- package/dist/{domains/mirror/domain/constants.domain.mjs → mirror/domain/constants.mjs} +16 -1
- package/dist/{domains/mirror/infrastructure/guards/dirent-list.guard.mjs → mirror/domain/dirent-guard.mjs} +5 -2
- package/dist/{domains/mirror/domain/errors.domain.mjs → mirror/domain/errors.mjs} +7 -1
- package/dist/{domains/mirror/domain/generate-mirror-exports.domain-service.mjs → mirror/domain/exports.mjs} +17 -10
- package/dist/{domains/mirror/domain/package-display-name.policy.mjs → mirror/domain/package-display-name.mjs} +5 -2
- package/dist/{domains/mirror/domain/path-normalizer.value-object.mjs → mirror/domain/path-normalizer.mjs} +4 -1
- package/dist/mirror/output.mjs +45 -0
- package/dist/mirror/package-path.mjs +32 -0
- package/dist/mirror/prepare.mjs +33 -0
- package/dist/mirror/sync-reporter.mjs +104 -0
- package/dist/mirror/sync-workspace-package.mjs +103 -0
- package/dist/mirror/sync.mjs +87 -0
- package/dist/{domains/mirror/infrastructure/package-json-exports.repository.mjs → mirror/write-exports.mjs} +11 -7
- package/dist/tag/cli-result.mjs +11 -0
- package/dist/{domains/tag/presentation/presenters/tag-cli.schema.mjs → tag/cli-schema.mjs} +4 -1
- package/dist/tag/command.mjs +56 -0
- package/dist/tag/output.mjs +87 -0
- package/dist/tag/prepare.mjs +29 -0
- package/dist/tag/resolve-target-path.mjs +12 -0
- package/dist/tag/since-writer.mjs +130 -0
- package/dist/tag/sync.mjs +141 -0
- package/dist/tag/target-candidates.mjs +68 -0
- package/dist/tag/target-runner.mjs +26 -0
- package/dist/tag/version-resolver.mjs +25 -0
- package/package.json +4 -7
- package/dist/bootstrap/cli-application.module.mjs +0 -18
- package/dist/bootstrap/composition-root.mjs +0 -14
- package/dist/bootstrap/register-cli-command-trees.mjs +0 -7
- package/dist/domains/arrange/application/ports/outbound/arrange-target-scanner.port.mjs +0 -1
- package/dist/domains/arrange/application/ports/outbound/domain-source-parser.port.mjs +0 -1
- package/dist/domains/arrange/application/ports/outbound/file-walker.port.mjs +0 -1
- package/dist/domains/arrange/application/ports/presenting/present-analyze-report.presenter.mjs +0 -1
- package/dist/domains/arrange/application/ports/presenting/present-arrange-sync-result.presenter.mjs +0 -1
- package/dist/domains/arrange/application/ports/presenting/present-group-file-preview.presenter.mjs +0 -1
- package/dist/domains/arrange/application/requests/analyze-directory.request.mjs +0 -1
- package/dist/domains/arrange/application/requests/arrange-sync.request.mjs +0 -1
- package/dist/domains/arrange/application/requests/suggest-groups.request.mjs +0 -1
- package/dist/domains/arrange/application/use-cases/analyze-directory.use-case.mjs +0 -255
- package/dist/domains/arrange/application/use-cases/prepare-arrange-workspace.use-case.mjs +0 -264
- package/dist/domains/arrange/application/use-cases/run-arrange-sync.use-case.mjs +0 -274
- package/dist/domains/arrange/application/use-cases/suggest-cn-groups.use-case.mjs +0 -237
- package/dist/domains/arrange/arrange.module.mjs +0 -38
- package/dist/domains/arrange/composition/tokens.mjs +0 -17
- package/dist/domains/arrange/contracts/models.mjs +0 -1
- package/dist/domains/arrange/domain/tailwind-grouping.domain-service.mjs +0 -231
- package/dist/domains/arrange/domain/types.domain.mjs +0 -1
- package/dist/domains/arrange/infrastructure/adapters/arrange-file-processor.adapter.mjs +0 -267
- package/dist/domains/arrange/infrastructure/adapters/arrange-target-path-resolver.adapter.mjs +0 -247
- package/dist/domains/arrange/infrastructure/adapters/arrange-target-scanner.adapter.mjs +0 -243
- package/dist/domains/arrange/infrastructure/adapters/domain-source-parser.adapter.mjs +0 -241
- package/dist/domains/arrange/infrastructure/adapters/file-walker.adapter.mjs +0 -240
- package/dist/domains/arrange/infrastructure/typescript-ast-translator.mjs +0 -580
- package/dist/domains/arrange/presentation/cli/arrange.command.mjs +0 -465
- package/dist/domains/arrange/presentation/presenters/arrange-analyze.presenter.mjs +0 -252
- package/dist/domains/arrange/presentation/presenters/arrange-sync.presenter.mjs +0 -236
- package/dist/domains/arrange/presentation/presenters/group-file-preview.presenter.mjs +0 -271
- package/dist/domains/config/application/ports/outbound/codefast-config-schema.port.mjs +0 -1
- package/dist/domains/config/application/ports/outbound/config-loader.port.mjs +0 -1
- package/dist/domains/config/application/ports/outbound/config-warning-reporter.port.mjs +0 -1
- package/dist/domains/config/composition/tokens.mjs +0 -7
- package/dist/domains/config/domain/schema.domain.mjs +0 -1
- package/dist/domains/config/infrastructure/adapters/config-loader.adapter.mjs +0 -305
- package/dist/domains/config/infrastructure/adapters/config-warning-reporter.adapter.mjs +0 -234
- package/dist/domains/config/infrastructure/adapters/zod-codefast-config-schema.adapter.mjs +0 -236
- package/dist/domains/mirror/application/ports/inbound/prepare-mirror-sync.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/inbound/run-mirror-sync.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/outbound/file-system-service.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/outbound/mirror-package-path.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/outbound/mirror-sync-reporter.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/outbound/package-repository.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/outbound/sync-workspace-package.port.mjs +0 -1
- package/dist/domains/mirror/application/ports/presenting/present-mirror-sync-progress.presenter.mjs +0 -1
- package/dist/domains/mirror/application/requests/mirror-sync-execution-input.mjs +0 -1
- package/dist/domains/mirror/application/requests/mirror-sync.request.mjs +0 -1
- package/dist/domains/mirror/application/use-cases/prepare-mirror-sync.use-case.mjs +0 -263
- package/dist/domains/mirror/application/use-cases/run-mirror-sync.use-case.mjs +0 -317
- package/dist/domains/mirror/composition/tokens.mjs +0 -12
- package/dist/domains/mirror/contracts/models.mjs +0 -1
- package/dist/domains/mirror/domain/types.domain.mjs +0 -1
- package/dist/domains/mirror/infrastructure/adapters/file-system-service.adapter.mjs +0 -261
- package/dist/domains/mirror/infrastructure/adapters/mirror-package-path-resolver.adapter.mjs +0 -252
- package/dist/domains/mirror/infrastructure/adapters/mirror-sync-reporter.adapter.mjs +0 -322
- package/dist/domains/mirror/infrastructure/adapters/package-repository.adapter.mjs +0 -241
- package/dist/domains/mirror/infrastructure/adapters/sync-workspace-package.adapter.mjs +0 -328
- package/dist/domains/mirror/mirror.module.mjs +0 -26
- package/dist/domains/mirror/presentation/cli/mirror.command.mjs +0 -328
- package/dist/domains/mirror/presentation/presenters/present-mirror-sync-progress.presenter.mjs +0 -265
- package/dist/domains/tag/application/ports/inbound/prepare-tag-sync.port.mjs +0 -1
- package/dist/domains/tag/application/ports/inbound/run-tag-sync.port.mjs +0 -1
- package/dist/domains/tag/application/ports/outbound/tag-eligible-workspace-paths.port.mjs +0 -1
- package/dist/domains/tag/application/ports/outbound/tag-since-writer.port.mjs +0 -1
- package/dist/domains/tag/application/ports/outbound/tag-target-path-resolver.port.mjs +0 -1
- package/dist/domains/tag/application/ports/outbound/tag-target-runner.port.mjs +0 -1
- package/dist/domains/tag/application/ports/outbound/tag-version-resolver.port.mjs +0 -1
- package/dist/domains/tag/application/ports/presenting/present-tag-sync-progress.presenter.mjs +0 -1
- package/dist/domains/tag/application/ports/presenting/present-tag-sync-result.presenter.mjs +0 -1
- package/dist/domains/tag/application/requests/tag-sync-execution-input.mjs +0 -1
- package/dist/domains/tag/application/requests/tag-sync.request.mjs +0 -1
- package/dist/domains/tag/application/tag-sync-cli-result.mjs +0 -11
- package/dist/domains/tag/application/use-cases/prepare-tag-sync.use-case.mjs +0 -260
- package/dist/domains/tag/application/use-cases/run-tag-sync.use-case.mjs +0 -375
- package/dist/domains/tag/composition/tokens.mjs +0 -13
- package/dist/domains/tag/contracts/models.mjs +0 -1
- package/dist/domains/tag/domain/types.domain.mjs +0 -1
- package/dist/domains/tag/infrastructure/adapters/tag-since-writer.adapter.mjs +0 -348
- package/dist/domains/tag/infrastructure/adapters/tag-target-path-resolver.adapter.mjs +0 -235
- package/dist/domains/tag/infrastructure/adapters/tag-target-resolver.adapter.mjs +0 -302
- package/dist/domains/tag/infrastructure/adapters/tag-target-runner.adapter.mjs +0 -259
- package/dist/domains/tag/infrastructure/adapters/tag-version-resolver.adapter.mjs +0 -249
- package/dist/domains/tag/presentation/cli/tag.command.mjs +0 -325
- package/dist/domains/tag/presentation/presenters/present-tag-sync-progress.presenter.mjs +0 -248
- package/dist/domains/tag/presentation/presenters/present-tag-sync-result.presenter.mjs +0 -290
- package/dist/domains/tag/tag.module.mjs +0 -28
- package/dist/shell/application/cli-runtime.tokens.mjs +0 -18
- package/dist/shell/application/coordination/cli-executor.coordination.mjs +0 -1
- package/dist/shell/application/coordination/cli-schema-parsing.coordination.mjs +0 -1
- package/dist/shell/application/global-cli-options.model.mjs +0 -5
- package/dist/shell/application/ports/inbound/load-codefast-config.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-fs.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-logger.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-path.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-runtime.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-telemetry.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/cli-verbose-diagnostics.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/format-app-error.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/global-cli-options-parse.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/repo-root-resolver.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/typescript-source-file-walker.port.mjs +0 -1
- package/dist/shell/application/ports/outbound/workspace-package-layout.port.mjs +0 -1
- package/dist/shell/application/ports/primary/command.port.mjs +0 -1
- package/dist/shell/application/services/cli-executor.service.mjs +0 -267
- package/dist/shell/application/services/schema-validator.service.mjs +0 -236
- package/dist/shell/application/use-cases/load-codefast-config.use-case.mjs +0 -243
- package/dist/shell/composition/tokens.mjs +0 -5
- package/dist/shell/contracts/cli-command-slots.mjs +0 -11
- package/dist/shell/domain/cli-exit-codes.domain.mjs +0 -11
- package/dist/shell/domain/cli-positional-arg.value-object.mjs +0 -6
- package/dist/shell/domain/errors.domain.mjs +0 -17
- package/dist/shell/infrastructure/adapters/cli-verbose-diagnostics.adapter.mjs +0 -228
- package/dist/shell/infrastructure/adapters/format-app-error.adapter.mjs +0 -236
- package/dist/shell/infrastructure/adapters/global-cli-options-parser.adapter.mjs +0 -233
- package/dist/shell/infrastructure/adapters/repo-root-resolver.adapter.mjs +0 -244
- package/dist/shell/infrastructure/adapters/typescript-source-file-walker.adapter.mjs +0 -259
- package/dist/shell/infrastructure/commander/commander-cli-host.adapter.mjs +0 -69
- package/dist/shell/infrastructure/node/node-cli-fs.adapter.mjs +0 -249
- package/dist/shell/infrastructure/node/node-cli-logger.adapter.mjs +0 -231
- package/dist/shell/infrastructure/node/node-cli-path.adapter.mjs +0 -246
- package/dist/shell/infrastructure/node/node-cli-runtime.adapter.mjs +0 -234
- package/dist/shell/infrastructure/telemetry/cli-telemetry.adapter.mjs +0 -280
- package/dist/shell/infrastructure/workspace/node-pnpm-workspace-package-layout.adapter.mjs +0 -385
- package/dist/shell/shell.module.mjs +0 -43
- package/dist/shell/wiring/optional-cli-port-telemetry-activation.mjs +0 -13
- /package/dist/{domains/arrange/application/ports/inbound/analyze-directory.port.mjs → arrange/domain/types.mjs} +0 -0
- /package/dist/{domains/arrange/application/ports/inbound/prepare-arrange-workspace.port.mjs → core/filesystem/port.mjs} +0 -0
- /package/dist/{domains/arrange/application/ports/inbound/run-arrange-sync.port.mjs → mirror/domain/dist-filesystem.mjs} +0 -0
- /package/dist/{domains/arrange/application/ports/inbound/suggest-cn-groups.port.mjs → mirror/domain/types.mjs} +0 -0
- /package/dist/{domains/arrange/application/ports/outbound/arrange-file-processor.port.mjs → mirror/sync-types.mjs} +0 -0
- /package/dist/{domains/arrange/application/ports/outbound/arrange-target-path-resolver.port.mjs → tag/domain/types.mjs} +0 -0
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { injectable } from "@codefast/di";
|
|
3
|
-
//#region src/shell/infrastructure/node/node-cli-path.adapter.ts
|
|
4
|
-
function toPrimitive(input, hint) {
|
|
5
|
-
if (typeof input !== "object" || input === null) return input;
|
|
6
|
-
var prim = input[Symbol.toPrimitive];
|
|
7
|
-
if (prim !== void 0) {
|
|
8
|
-
var res = prim.call(input, hint || "default");
|
|
9
|
-
if (typeof res !== "object") return res;
|
|
10
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
11
|
-
}
|
|
12
|
-
return (hint === "string" ? String : Number)(input);
|
|
13
|
-
}
|
|
14
|
-
function toPropertyKey(arg) {
|
|
15
|
-
var key = toPrimitive(arg, "string");
|
|
16
|
-
return typeof key === "symbol" ? key : String(key);
|
|
17
|
-
}
|
|
18
|
-
function checkInRHS(value) {
|
|
19
|
-
if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
function setFunctionName(fn, name, prefix) {
|
|
23
|
-
if (typeof name === "symbol") {
|
|
24
|
-
name = name.description;
|
|
25
|
-
name = name ? "[" + name + "]" : "";
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
Object.defineProperty(fn, "name", {
|
|
29
|
-
configurable: true,
|
|
30
|
-
value: prefix ? prefix + " " + name : name
|
|
31
|
-
});
|
|
32
|
-
} catch (_) {}
|
|
33
|
-
return fn;
|
|
34
|
-
}
|
|
35
|
-
function _apply_decs_2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
|
36
|
-
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
|
|
37
|
-
var defineProperty = Object.defineProperty;
|
|
38
|
-
var create = Object.create;
|
|
39
|
-
var metadata;
|
|
40
|
-
var existingNonFields = [create(null), create(null)];
|
|
41
|
-
var hasClassDecs = classDecs.length;
|
|
42
|
-
var _;
|
|
43
|
-
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
|
44
|
-
return function(thisArg, value) {
|
|
45
|
-
if (useStaticThis) {
|
|
46
|
-
value = thisArg;
|
|
47
|
-
thisArg = targetClass;
|
|
48
|
-
}
|
|
49
|
-
for (var i = 0; i < initializers.length; i++) value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
|
50
|
-
return hasValue ? value : thisArg;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
|
54
|
-
if (typeof fn !== "function") {
|
|
55
|
-
if (throwUndefined || fn !== void 0) throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
|
56
|
-
}
|
|
57
|
-
return fn;
|
|
58
|
-
}
|
|
59
|
-
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
|
60
|
-
function assertInstanceIfPrivate(target) {
|
|
61
|
-
if (!hasPrivateBrand(target)) throw new TypeError("Attempted to access private element on non-instance");
|
|
62
|
-
}
|
|
63
|
-
var decs = [].concat(decInfo[0]);
|
|
64
|
-
var decVal = decInfo[3];
|
|
65
|
-
var isClass = !ret;
|
|
66
|
-
var isAccessor = kind === 1;
|
|
67
|
-
var isGetter = kind === 3;
|
|
68
|
-
var isSetter = kind === 4;
|
|
69
|
-
var isMethod = kind === 2;
|
|
70
|
-
function bindPropCall(name, useStaticThis, before) {
|
|
71
|
-
return function(_this, value) {
|
|
72
|
-
if (useStaticThis) {
|
|
73
|
-
value = _this;
|
|
74
|
-
_this = Class;
|
|
75
|
-
}
|
|
76
|
-
if (before) before(_this);
|
|
77
|
-
return desc[name].call(_this, value);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
var desc1 = {};
|
|
81
|
-
var init = [];
|
|
82
|
-
var key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
|
83
|
-
if (!isClass) {
|
|
84
|
-
if (isPrivate) {
|
|
85
|
-
if (isField || isAccessor) desc1 = {
|
|
86
|
-
get: setFunctionName(function() {
|
|
87
|
-
return decVal(this);
|
|
88
|
-
}, name, "get"),
|
|
89
|
-
set: function(value) {
|
|
90
|
-
decInfo[4](this, value);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
else desc1[key] = decVal;
|
|
94
|
-
if (!isField) setFunctionName(desc1[key], name, isMethod ? "" : key);
|
|
95
|
-
} else if (!isField) desc1 = Object.getOwnPropertyDescriptor(Class, name);
|
|
96
|
-
if (!isField && !isPrivate) {
|
|
97
|
-
_ = existingNonFields[+isStatic][name];
|
|
98
|
-
if (_ && (_ ^ kind) !== 7) throw new Error("Decorating two elements with the same name (" + desc1[key].name + ") is not supported yet");
|
|
99
|
-
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
var newValue = Class;
|
|
103
|
-
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
|
104
|
-
var dec = assertCallable(decs[i], "A decorator", "be", true);
|
|
105
|
-
var decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
|
106
|
-
var decoratorFinishedRef = {};
|
|
107
|
-
var ctx = {
|
|
108
|
-
kind: [
|
|
109
|
-
"field",
|
|
110
|
-
"accessor",
|
|
111
|
-
"method",
|
|
112
|
-
"getter",
|
|
113
|
-
"setter",
|
|
114
|
-
"class"
|
|
115
|
-
][kind],
|
|
116
|
-
name,
|
|
117
|
-
metadata,
|
|
118
|
-
addInitializer: (function(decoratorFinishedRef, initializer) {
|
|
119
|
-
if (decoratorFinishedRef.v) throw new TypeError("attempted to call addInitializer after decoration was finished");
|
|
120
|
-
assertCallable(initializer, "An initializer", "be", true);
|
|
121
|
-
initializers.push(initializer);
|
|
122
|
-
}).bind(null, decoratorFinishedRef)
|
|
123
|
-
};
|
|
124
|
-
if (isClass) {
|
|
125
|
-
_ = dec.call(decThis, newValue, ctx);
|
|
126
|
-
decoratorFinishedRef.v = 1;
|
|
127
|
-
if (assertCallable(_, "class decorators", "return")) newValue = _;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
ctx.static = isStatic;
|
|
131
|
-
ctx.private = isPrivate;
|
|
132
|
-
_ = ctx.access = { has: isPrivate ? hasPrivateBrand.bind() : function(target) {
|
|
133
|
-
return name in target;
|
|
134
|
-
} };
|
|
135
|
-
if (!isSetter) _.get = isPrivate ? isMethod ? function(_this) {
|
|
136
|
-
assertInstanceIfPrivate(_this);
|
|
137
|
-
return desc1.value;
|
|
138
|
-
} : bindPropCall("get", 0, assertInstanceIfPrivate) : function(target) {
|
|
139
|
-
return target[name];
|
|
140
|
-
};
|
|
141
|
-
if (!isMethod && !isGetter) _.set = isPrivate ? bindPropCall("set", 0, assertInstanceIfPrivate) : function(target, value) {
|
|
142
|
-
target[name] = value;
|
|
143
|
-
};
|
|
144
|
-
newValue = dec.call(decThis, isAccessor ? {
|
|
145
|
-
get: desc1.get,
|
|
146
|
-
set: desc1.set
|
|
147
|
-
} : desc1[key], ctx);
|
|
148
|
-
decoratorFinishedRef.v = 1;
|
|
149
|
-
if (isAccessor) {
|
|
150
|
-
if (typeof newValue === "object" && newValue) {
|
|
151
|
-
if (_ = assertCallable(newValue.get, "accessor.get")) desc1.get = _;
|
|
152
|
-
if (_ = assertCallable(newValue.set, "accessor.set")) desc1.set = _;
|
|
153
|
-
if (_ = assertCallable(newValue.init, "accessor.init")) init.unshift(_);
|
|
154
|
-
} else if (newValue !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
|
155
|
-
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) if (isField) init.unshift(newValue);
|
|
156
|
-
else desc1[key] = newValue;
|
|
157
|
-
}
|
|
158
|
-
if (kind < 2) ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
|
159
|
-
if (!isField && !isClass) if (isPrivate) if (isAccessor) ret.splice(-1, 0, bindPropCall("get", isStatic), bindPropCall("set", isStatic));
|
|
160
|
-
else ret.push(isMethod ? desc1[key] : assertCallable.call.bind(desc1[key]));
|
|
161
|
-
else defineProperty(Class, name, desc1);
|
|
162
|
-
return newValue;
|
|
163
|
-
}
|
|
164
|
-
function applyMemberDecs() {
|
|
165
|
-
var ret = [];
|
|
166
|
-
var protoInitializers;
|
|
167
|
-
var staticInitializers;
|
|
168
|
-
var pushInitializers = function(initializers) {
|
|
169
|
-
if (initializers) ret.push(createRunInitializers(initializers));
|
|
170
|
-
};
|
|
171
|
-
var applyMemberDecsOfKind = function(isStatic, isField) {
|
|
172
|
-
for (var i = 0; i < memberDecs.length; i++) {
|
|
173
|
-
var decInfo = memberDecs[i];
|
|
174
|
-
var kind = decInfo[1];
|
|
175
|
-
var kindOnly = kind & 7;
|
|
176
|
-
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
|
177
|
-
var name = decInfo[2];
|
|
178
|
-
var isPrivate = !!decInfo[3];
|
|
179
|
-
var decoratorsHaveThis = kind & 16;
|
|
180
|
-
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function(_) {
|
|
181
|
-
return checkInRHS(_) === targetClass;
|
|
182
|
-
} : instanceBrand);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
applyMemberDecsOfKind(8, 0);
|
|
187
|
-
applyMemberDecsOfKind(0, 0);
|
|
188
|
-
applyMemberDecsOfKind(8, 1);
|
|
189
|
-
applyMemberDecsOfKind(0, 1);
|
|
190
|
-
pushInitializers(protoInitializers);
|
|
191
|
-
pushInitializers(staticInitializers);
|
|
192
|
-
return ret;
|
|
193
|
-
}
|
|
194
|
-
function defineMetadata(Class) {
|
|
195
|
-
return defineProperty(Class, symbolMetadata, {
|
|
196
|
-
configurable: true,
|
|
197
|
-
enumerable: true,
|
|
198
|
-
value: metadata
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
if (parentClass !== void 0) metadata = parentClass[symbolMetadata];
|
|
202
|
-
metadata = create(metadata == null ? null : metadata);
|
|
203
|
-
_ = applyMemberDecs();
|
|
204
|
-
if (!hasClassDecs) defineMetadata(targetClass);
|
|
205
|
-
return {
|
|
206
|
-
e: _,
|
|
207
|
-
get c() {
|
|
208
|
-
var initializers = [];
|
|
209
|
-
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
let _dec, _initClass;
|
|
214
|
-
_dec = injectable([]);
|
|
215
|
-
let _NodeCliPathAdapter;
|
|
216
|
-
(class {
|
|
217
|
-
static {
|
|
218
|
-
({c: [_NodeCliPathAdapter, _initClass]} = _apply_decs_2311(this, [_dec], []));
|
|
219
|
-
}
|
|
220
|
-
resolve(...paths) {
|
|
221
|
-
return path.resolve(...paths);
|
|
222
|
-
}
|
|
223
|
-
join(...paths) {
|
|
224
|
-
return path.join(...paths);
|
|
225
|
-
}
|
|
226
|
-
relative(from, to) {
|
|
227
|
-
return path.relative(from, to);
|
|
228
|
-
}
|
|
229
|
-
dirname(pathValue) {
|
|
230
|
-
return path.dirname(pathValue);
|
|
231
|
-
}
|
|
232
|
-
basename(pathValue) {
|
|
233
|
-
return path.basename(pathValue);
|
|
234
|
-
}
|
|
235
|
-
extname(pathValue) {
|
|
236
|
-
return path.extname(pathValue);
|
|
237
|
-
}
|
|
238
|
-
get separator() {
|
|
239
|
-
return path.sep;
|
|
240
|
-
}
|
|
241
|
-
static {
|
|
242
|
-
_initClass();
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
//#endregion
|
|
246
|
-
export { _NodeCliPathAdapter as NodeCliPathAdapter };
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import process from "node:process";
|
|
2
|
-
import { injectable } from "@codefast/di";
|
|
3
|
-
//#region src/shell/infrastructure/node/node-cli-runtime.adapter.ts
|
|
4
|
-
function toPrimitive(input, hint) {
|
|
5
|
-
if (typeof input !== "object" || input === null) return input;
|
|
6
|
-
var prim = input[Symbol.toPrimitive];
|
|
7
|
-
if (prim !== void 0) {
|
|
8
|
-
var res = prim.call(input, hint || "default");
|
|
9
|
-
if (typeof res !== "object") return res;
|
|
10
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
11
|
-
}
|
|
12
|
-
return (hint === "string" ? String : Number)(input);
|
|
13
|
-
}
|
|
14
|
-
function toPropertyKey(arg) {
|
|
15
|
-
var key = toPrimitive(arg, "string");
|
|
16
|
-
return typeof key === "symbol" ? key : String(key);
|
|
17
|
-
}
|
|
18
|
-
function checkInRHS(value) {
|
|
19
|
-
if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
function setFunctionName(fn, name, prefix) {
|
|
23
|
-
if (typeof name === "symbol") {
|
|
24
|
-
name = name.description;
|
|
25
|
-
name = name ? "[" + name + "]" : "";
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
Object.defineProperty(fn, "name", {
|
|
29
|
-
configurable: true,
|
|
30
|
-
value: prefix ? prefix + " " + name : name
|
|
31
|
-
});
|
|
32
|
-
} catch (_) {}
|
|
33
|
-
return fn;
|
|
34
|
-
}
|
|
35
|
-
function _apply_decs_2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
|
36
|
-
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
|
|
37
|
-
var defineProperty = Object.defineProperty;
|
|
38
|
-
var create = Object.create;
|
|
39
|
-
var metadata;
|
|
40
|
-
var existingNonFields = [create(null), create(null)];
|
|
41
|
-
var hasClassDecs = classDecs.length;
|
|
42
|
-
var _;
|
|
43
|
-
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
|
44
|
-
return function(thisArg, value) {
|
|
45
|
-
if (useStaticThis) {
|
|
46
|
-
value = thisArg;
|
|
47
|
-
thisArg = targetClass;
|
|
48
|
-
}
|
|
49
|
-
for (var i = 0; i < initializers.length; i++) value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
|
50
|
-
return hasValue ? value : thisArg;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
|
54
|
-
if (typeof fn !== "function") {
|
|
55
|
-
if (throwUndefined || fn !== void 0) throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
|
56
|
-
}
|
|
57
|
-
return fn;
|
|
58
|
-
}
|
|
59
|
-
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
|
60
|
-
function assertInstanceIfPrivate(target) {
|
|
61
|
-
if (!hasPrivateBrand(target)) throw new TypeError("Attempted to access private element on non-instance");
|
|
62
|
-
}
|
|
63
|
-
var decs = [].concat(decInfo[0]);
|
|
64
|
-
var decVal = decInfo[3];
|
|
65
|
-
var isClass = !ret;
|
|
66
|
-
var isAccessor = kind === 1;
|
|
67
|
-
var isGetter = kind === 3;
|
|
68
|
-
var isSetter = kind === 4;
|
|
69
|
-
var isMethod = kind === 2;
|
|
70
|
-
function bindPropCall(name, useStaticThis, before) {
|
|
71
|
-
return function(_this, value) {
|
|
72
|
-
if (useStaticThis) {
|
|
73
|
-
value = _this;
|
|
74
|
-
_this = Class;
|
|
75
|
-
}
|
|
76
|
-
if (before) before(_this);
|
|
77
|
-
return desc[name].call(_this, value);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
var desc1 = {};
|
|
81
|
-
var init = [];
|
|
82
|
-
var key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
|
83
|
-
if (!isClass) {
|
|
84
|
-
if (isPrivate) {
|
|
85
|
-
if (isField || isAccessor) desc1 = {
|
|
86
|
-
get: setFunctionName(function() {
|
|
87
|
-
return decVal(this);
|
|
88
|
-
}, name, "get"),
|
|
89
|
-
set: function(value) {
|
|
90
|
-
decInfo[4](this, value);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
else desc1[key] = decVal;
|
|
94
|
-
if (!isField) setFunctionName(desc1[key], name, isMethod ? "" : key);
|
|
95
|
-
} else if (!isField) desc1 = Object.getOwnPropertyDescriptor(Class, name);
|
|
96
|
-
if (!isField && !isPrivate) {
|
|
97
|
-
_ = existingNonFields[+isStatic][name];
|
|
98
|
-
if (_ && (_ ^ kind) !== 7) throw new Error("Decorating two elements with the same name (" + desc1[key].name + ") is not supported yet");
|
|
99
|
-
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
var newValue = Class;
|
|
103
|
-
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
|
104
|
-
var dec = assertCallable(decs[i], "A decorator", "be", true);
|
|
105
|
-
var decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
|
106
|
-
var decoratorFinishedRef = {};
|
|
107
|
-
var ctx = {
|
|
108
|
-
kind: [
|
|
109
|
-
"field",
|
|
110
|
-
"accessor",
|
|
111
|
-
"method",
|
|
112
|
-
"getter",
|
|
113
|
-
"setter",
|
|
114
|
-
"class"
|
|
115
|
-
][kind],
|
|
116
|
-
name,
|
|
117
|
-
metadata,
|
|
118
|
-
addInitializer: (function(decoratorFinishedRef, initializer) {
|
|
119
|
-
if (decoratorFinishedRef.v) throw new TypeError("attempted to call addInitializer after decoration was finished");
|
|
120
|
-
assertCallable(initializer, "An initializer", "be", true);
|
|
121
|
-
initializers.push(initializer);
|
|
122
|
-
}).bind(null, decoratorFinishedRef)
|
|
123
|
-
};
|
|
124
|
-
if (isClass) {
|
|
125
|
-
_ = dec.call(decThis, newValue, ctx);
|
|
126
|
-
decoratorFinishedRef.v = 1;
|
|
127
|
-
if (assertCallable(_, "class decorators", "return")) newValue = _;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
ctx.static = isStatic;
|
|
131
|
-
ctx.private = isPrivate;
|
|
132
|
-
_ = ctx.access = { has: isPrivate ? hasPrivateBrand.bind() : function(target) {
|
|
133
|
-
return name in target;
|
|
134
|
-
} };
|
|
135
|
-
if (!isSetter) _.get = isPrivate ? isMethod ? function(_this) {
|
|
136
|
-
assertInstanceIfPrivate(_this);
|
|
137
|
-
return desc1.value;
|
|
138
|
-
} : bindPropCall("get", 0, assertInstanceIfPrivate) : function(target) {
|
|
139
|
-
return target[name];
|
|
140
|
-
};
|
|
141
|
-
if (!isMethod && !isGetter) _.set = isPrivate ? bindPropCall("set", 0, assertInstanceIfPrivate) : function(target, value) {
|
|
142
|
-
target[name] = value;
|
|
143
|
-
};
|
|
144
|
-
newValue = dec.call(decThis, isAccessor ? {
|
|
145
|
-
get: desc1.get,
|
|
146
|
-
set: desc1.set
|
|
147
|
-
} : desc1[key], ctx);
|
|
148
|
-
decoratorFinishedRef.v = 1;
|
|
149
|
-
if (isAccessor) {
|
|
150
|
-
if (typeof newValue === "object" && newValue) {
|
|
151
|
-
if (_ = assertCallable(newValue.get, "accessor.get")) desc1.get = _;
|
|
152
|
-
if (_ = assertCallable(newValue.set, "accessor.set")) desc1.set = _;
|
|
153
|
-
if (_ = assertCallable(newValue.init, "accessor.init")) init.unshift(_);
|
|
154
|
-
} else if (newValue !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
|
155
|
-
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) if (isField) init.unshift(newValue);
|
|
156
|
-
else desc1[key] = newValue;
|
|
157
|
-
}
|
|
158
|
-
if (kind < 2) ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
|
159
|
-
if (!isField && !isClass) if (isPrivate) if (isAccessor) ret.splice(-1, 0, bindPropCall("get", isStatic), bindPropCall("set", isStatic));
|
|
160
|
-
else ret.push(isMethod ? desc1[key] : assertCallable.call.bind(desc1[key]));
|
|
161
|
-
else defineProperty(Class, name, desc1);
|
|
162
|
-
return newValue;
|
|
163
|
-
}
|
|
164
|
-
function applyMemberDecs() {
|
|
165
|
-
var ret = [];
|
|
166
|
-
var protoInitializers;
|
|
167
|
-
var staticInitializers;
|
|
168
|
-
var pushInitializers = function(initializers) {
|
|
169
|
-
if (initializers) ret.push(createRunInitializers(initializers));
|
|
170
|
-
};
|
|
171
|
-
var applyMemberDecsOfKind = function(isStatic, isField) {
|
|
172
|
-
for (var i = 0; i < memberDecs.length; i++) {
|
|
173
|
-
var decInfo = memberDecs[i];
|
|
174
|
-
var kind = decInfo[1];
|
|
175
|
-
var kindOnly = kind & 7;
|
|
176
|
-
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
|
177
|
-
var name = decInfo[2];
|
|
178
|
-
var isPrivate = !!decInfo[3];
|
|
179
|
-
var decoratorsHaveThis = kind & 16;
|
|
180
|
-
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function(_) {
|
|
181
|
-
return checkInRHS(_) === targetClass;
|
|
182
|
-
} : instanceBrand);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
applyMemberDecsOfKind(8, 0);
|
|
187
|
-
applyMemberDecsOfKind(0, 0);
|
|
188
|
-
applyMemberDecsOfKind(8, 1);
|
|
189
|
-
applyMemberDecsOfKind(0, 1);
|
|
190
|
-
pushInitializers(protoInitializers);
|
|
191
|
-
pushInitializers(staticInitializers);
|
|
192
|
-
return ret;
|
|
193
|
-
}
|
|
194
|
-
function defineMetadata(Class) {
|
|
195
|
-
return defineProperty(Class, symbolMetadata, {
|
|
196
|
-
configurable: true,
|
|
197
|
-
enumerable: true,
|
|
198
|
-
value: metadata
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
if (parentClass !== void 0) metadata = parentClass[symbolMetadata];
|
|
202
|
-
metadata = create(metadata == null ? null : metadata);
|
|
203
|
-
_ = applyMemberDecs();
|
|
204
|
-
if (!hasClassDecs) defineMetadata(targetClass);
|
|
205
|
-
return {
|
|
206
|
-
e: _,
|
|
207
|
-
get c() {
|
|
208
|
-
var initializers = [];
|
|
209
|
-
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
let _dec, _initClass;
|
|
214
|
-
_dec = injectable([]);
|
|
215
|
-
let _NodeCliRuntimeAdapter;
|
|
216
|
-
(class {
|
|
217
|
-
static {
|
|
218
|
-
({c: [_NodeCliRuntimeAdapter, _initClass]} = _apply_decs_2311(this, [_dec], []));
|
|
219
|
-
}
|
|
220
|
-
cwd() {
|
|
221
|
-
return process.cwd();
|
|
222
|
-
}
|
|
223
|
-
setExitCode(code) {
|
|
224
|
-
process.exitCode = code;
|
|
225
|
-
}
|
|
226
|
-
isStdoutTty() {
|
|
227
|
-
return !!process.stdout.isTTY;
|
|
228
|
-
}
|
|
229
|
-
static {
|
|
230
|
-
_initClass();
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
//#endregion
|
|
234
|
-
export { _NodeCliRuntimeAdapter as NodeCliRuntimeAdapter };
|