@decohere/core 0.0.1-dev.126 → 0.0.1-dev.5
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/package.json +40 -15
- package/src/caching/cache-manager.ts +102 -0
- package/src/caching/cache.decorator.ts +56 -0
- package/src/caching/cache.ts +11 -0
- package/{es6/src/caching/index.js → src/caching/index.ts} +1 -1
- package/src/caching/invalidate-cache.decorator.ts +81 -0
- package/src/caching/memoize.decorator.ts +34 -0
- package/src/caching/node-cache-memoize.adapter.ts +47 -0
- package/src/cli/action.ts +77 -0
- package/src/cli/command.ts +173 -0
- package/src/cli/index.ts +30 -0
- package/src/cli/module.type.ts +48 -0
- package/src/cli/options.ts +81 -0
- package/src/collections/find-duplicates.ts +16 -0
- package/src/collections/merge-arrays.ts +9 -0
- package/src/collections/sum.ts +71 -0
- package/src/collections/unique-objects.ts +23 -0
- package/src/composition/index.ts +48 -0
- package/src/configuration/configuration.types.ts +13 -0
- package/src/diagnostics/index.ts +1 -0
- package/src/diagnostics/trace.ts +97 -0
- package/{es6/src/extensibility/decorator-factory-base.js → src/extensibility/decorator-factory-base.ts} +17 -9
- package/src/extensibility/decorator-factory.ts +44 -0
- package/src/extensibility/extension.ts +34 -0
- package/src/extensibility/mixwith.ts +42 -0
- package/src/extensibility/pipeline.ts +60 -0
- package/{types/src/extensibility/step.d.ts → src/extensibility/step.ts} +6 -4
- package/src/interop/docker/docker.ts +57 -0
- package/src/interop/errors/interop.error.ts +1 -0
- package/src/interop/git/git.ts +98 -0
- package/src/interop/git/git.types.ts +17 -0
- package/src/interop/index.ts +22 -0
- package/src/interop/node/index.ts +1 -0
- package/src/interop/node/node.ts +38 -0
- package/src/interop/npm/npm.ts +168 -0
- package/src/interop/npm/npm.types.ts +28 -0
- package/src/interop/pnpm/pnpm.ts +22 -0
- package/src/interop/pnpm/pnpm.types.ts +3 -0
- package/src/interop/shell/shell.argv.ts +31 -0
- package/src/interop/shell/shell.ts +100 -0
- package/src/interop/shell/shell.types.ts +9 -0
- package/src/interop/types/detect-package-manager.ts +45 -0
- package/src/interop/types/package-manager.ts +7 -0
- package/src/interop/yarn/yarn.ts +28 -0
- package/src/interop/yarn/yarn.types.ts +3 -0
- package/src/io/copy-file.ts +13 -0
- package/src/io/delete-file.ts +4 -0
- package/src/io/directory-exists.ts +9 -0
- package/src/io/file-exists.ts +10 -0
- package/src/io/find-directories.ts +13 -0
- package/src/io/find-file.ts +37 -0
- package/{es6/src/io/io.js → src/io/io.ts} +3 -0
- package/src/io/read-file.ts +25 -0
- package/src/io/remove-dir.ts +11 -0
- package/src/io/types/directory.type.ts +4 -0
- package/src/io/types/file.ts +34 -0
- package/src/io/url-to-path.ts +17 -0
- package/src/io/watch.ts +290 -0
- package/src/io/write-file.ts +21 -0
- package/src/objects/deep-merge.ts +131 -0
- package/{es6/src/reflection/index.js → src/reflection/index.ts} +1 -0
- package/src/reflection/types/reflection.types.ts +28 -0
- package/src/reflection/utilities.ts +92 -0
- package/src/semver/index.ts +1 -0
- package/src/semver/semver.ts +96 -0
- package/src/system/camel-case.ts +3 -0
- package/src/system/debounce.ts +13 -0
- package/src/system/decorator.ts +41 -0
- package/src/system/environment.ts +6 -0
- package/{types/src/system/function.types.d.ts → src/system/function.types.ts} +10 -2
- package/src/system/retry.decorator.ts +43 -0
- package/src/system/sleep.ts +6 -0
- package/src/system/type.utils.ts +5 -0
- package/src/testing/flush-promises.ts +7 -0
- package/src/testing/glob-with-memfs.ts +25 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/memfs.ts +28 -0
- package/src/testing/mock-logger.ts +42 -0
- package/src/testing/spy-on-constructor.ts +33 -0
- package/tests/caching/cache-manager.spec.ts +147 -0
- package/tests/caching/cache-test-class.ts +91 -0
- package/tests/caching/cache.decorator.spec.ts +259 -0
- package/tests/caching/invalidate-cache-test-class.ts +52 -0
- package/tests/caching/invalidate-cache.decorator.spec.ts +120 -0
- package/tests/caching/memoize-test-class.ts +99 -0
- package/tests/caching/memoize.decorator.spec.ts +203 -0
- package/tests/cli/command.model.spec.ts +91 -0
- package/tests/collections/merge-arrays.spec.ts +50 -0
- package/tests/collections/sum.spec.ts +86 -0
- package/tests/collections/unique-objects.spec.ts +233 -0
- package/tests/extensibility/extension.spec.ts +29 -0
- package/tests/extensibility/pipeline.spec.ts +379 -0
- package/tests/interop/detect-package-manager.spec.ts +70 -0
- package/tests/interop/npm.spec.ts +129 -0
- package/tests/interop/pnpm.spec.ts +30 -0
- package/tests/interop/shell.spec.ts +47 -0
- package/tests/interop/yarn.spec.ts +18 -0
- package/tests/io/find-file.spec.ts +188 -0
- package/tests/io/watch.real-fs.spec.ts +76 -0
- package/tests/io/watch.spec.ts +291 -0
- package/tests/mock-prototype.ts +12 -0
- package/tests/semver/semver.spec.ts +51 -0
- package/tests/system/decorator.spec.ts +250 -0
- package/tests/system/retry.decorator.spec.ts +57 -0
- package/LICENSE +0 -15
- package/commonjs/src/caching/cache-manager.js +0 -98
- package/commonjs/src/caching/cache.decorator.js +0 -69
- package/commonjs/src/caching/cache.js +0 -6
- package/commonjs/src/caching/index.js +0 -23
- package/commonjs/src/caching/invalidate-cache.decorator.js +0 -92
- package/commonjs/src/caching/map-cache.js +0 -39
- package/commonjs/src/caching/memoize.decorator.js +0 -36
- package/commonjs/src/collections/collections.js +0 -21
- package/commonjs/src/collections/find-duplicates.js +0 -35
- package/commonjs/src/collections/index.js +0 -52
- package/commonjs/src/collections/merge-arrays.js +0 -34
- package/commonjs/src/collections/sum.js +0 -63
- package/commonjs/src/collections/unique-objects.js +0 -39
- package/commonjs/src/composition/index.js +0 -4
- package/commonjs/src/configuration/configuration.types.js +0 -11
- package/commonjs/src/configuration/index.js +0 -18
- package/commonjs/src/extensibility/decorator-factory-base.js +0 -22
- package/commonjs/src/extensibility/decorator-factory.js +0 -31
- package/commonjs/src/extensibility/extension.js +0 -37
- package/commonjs/src/extensibility/index.js +0 -23
- package/commonjs/src/extensibility/mixwith.js +0 -36
- package/commonjs/src/extensibility/pipeline.js +0 -56
- package/commonjs/src/extensibility/step.js +0 -18
- package/commonjs/src/io/copy-file.js +0 -25
- package/commonjs/src/io/delete-file.js +0 -21
- package/commonjs/src/io/directory-exists.js +0 -24
- package/commonjs/src/io/file-exists.js +0 -19
- package/commonjs/src/io/index.js +0 -66
- package/commonjs/src/io/io.js +0 -25
- package/commonjs/src/io/read-file.js +0 -39
- package/commonjs/src/io/remove-dir.js +0 -22
- package/commonjs/src/io/types/directory.type.js +0 -4
- package/commonjs/src/io/types/file.js +0 -28
- package/commonjs/src/io/types/index.js +0 -19
- package/commonjs/src/io/url-to-path.js +0 -33
- package/commonjs/src/io/write-file.js +0 -30
- package/commonjs/src/objects/deep-merge.js +0 -67
- package/commonjs/src/objects/index.js +0 -11
- package/commonjs/src/reflection/index.js +0 -20
- package/commonjs/src/reflection/types/index.js +0 -18
- package/commonjs/src/reflection/types/reflection.types.js +0 -26
- package/commonjs/src/reflection/utilities.js +0 -118
- package/commonjs/src/system/camel-case.js +0 -13
- package/commonjs/src/system/debounce.js +0 -19
- package/commonjs/src/system/decorator.js +0 -46
- package/commonjs/src/system/environment.js +0 -23
- package/commonjs/src/system/function.types.js +0 -18
- package/commonjs/src/system/index.js +0 -24
- package/commonjs/src/system/retry.decorator.js +0 -40
- package/commonjs/src/system/sleep.js +0 -13
- package/commonjs/src/system/type.utils.js +0 -4
- package/es6/src/caching/cache-manager.js +0 -82
- package/es6/src/caching/cache.decorator.js +0 -51
- package/es6/src/caching/cache.js +0 -3
- package/es6/src/caching/invalidate-cache.decorator.js +0 -71
- package/es6/src/caching/map-cache.js +0 -35
- package/es6/src/caching/memoize.decorator.js +0 -27
- package/es6/src/collections/find-duplicates.js +0 -17
- package/es6/src/collections/merge-arrays.js +0 -16
- package/es6/src/collections/sum.js +0 -45
- package/es6/src/collections/unique-objects.js +0 -21
- package/es6/src/composition/index.js +0 -1
- package/es6/src/configuration/configuration.types.js +0 -1
- package/es6/src/extensibility/decorator-factory.js +0 -21
- package/es6/src/extensibility/extension.js +0 -27
- package/es6/src/extensibility/mixwith.js +0 -26
- package/es6/src/extensibility/pipeline.js +0 -46
- package/es6/src/extensibility/step.js +0 -16
- package/es6/src/io/copy-file.js +0 -10
- package/es6/src/io/delete-file.js +0 -6
- package/es6/src/io/directory-exists.js +0 -9
- package/es6/src/io/file-exists.js +0 -9
- package/es6/src/io/read-file.js +0 -13
- package/es6/src/io/remove-dir.js +0 -7
- package/es6/src/io/types/directory.type.js +0 -1
- package/es6/src/io/types/file.js +0 -18
- package/es6/src/io/url-to-path.js +0 -15
- package/es6/src/io/write-file.js +0 -15
- package/es6/src/objects/deep-merge.js +0 -57
- package/es6/src/reflection/types/reflection.types.js +0 -8
- package/es6/src/reflection/utilities.js +0 -74
- package/es6/src/system/camel-case.js +0 -3
- package/es6/src/system/debounce.js +0 -9
- package/es6/src/system/decorator.js +0 -30
- package/es6/src/system/environment.js +0 -5
- package/es6/src/system/function.types.js +0 -26
- package/es6/src/system/retry.decorator.js +0 -30
- package/es6/src/system/sleep.js +0 -3
- package/es6/src/system/type.utils.js +0 -1
- package/types/src/caching/cache-manager.d.ts +0 -59
- package/types/src/caching/cache.d.ts +0 -11
- package/types/src/caching/cache.decorator.d.ts +0 -18
- package/types/src/caching/index.d.ts +0 -6
- package/types/src/caching/invalidate-cache.decorator.d.ts +0 -17
- package/types/src/caching/map-cache.d.ts +0 -23
- package/types/src/caching/memoize.decorator.d.ts +0 -16
- package/types/src/collections/collections.d.ts +0 -4
- package/types/src/collections/find-duplicates.d.ts +0 -2
- package/types/src/collections/index.d.ts +0 -1
- package/types/src/collections/merge-arrays.d.ts +0 -2
- package/types/src/collections/sum.d.ts +0 -4
- package/types/src/collections/unique-objects.d.ts +0 -2
- package/types/src/composition/index.d.ts +0 -37
- package/types/src/configuration/configuration.types.d.ts +0 -10
- package/types/src/configuration/index.d.ts +0 -1
- package/types/src/extensibility/decorator-factory-base.d.ts +0 -39
- package/types/src/extensibility/decorator-factory.d.ts +0 -19
- package/types/src/extensibility/extension.d.ts +0 -9
- package/types/src/extensibility/index.d.ts +0 -6
- package/types/src/extensibility/mixwith.d.ts +0 -6
- package/types/src/extensibility/pipeline.d.ts +0 -12
- package/types/src/io/copy-file.d.ts +0 -4
- package/types/src/io/delete-file.d.ts +0 -1
- package/types/src/io/directory-exists.d.ts +0 -1
- package/types/src/io/file-exists.d.ts +0 -1
- package/types/src/io/index.d.ts +0 -2
- package/types/src/io/io.d.ts +0 -8
- package/types/src/io/read-file.d.ts +0 -4
- package/types/src/io/remove-dir.d.ts +0 -5
- package/types/src/io/types/directory.type.d.ts +0 -4
- package/types/src/io/types/file.d.ts +0 -20
- package/types/src/io/types/index.d.ts +0 -2
- package/types/src/io/url-to-path.d.ts +0 -2
- package/types/src/io/write-file.d.ts +0 -5
- package/types/src/objects/deep-merge.d.ts +0 -41
- package/types/src/objects/index.d.ts +0 -1
- package/types/src/reflection/index.d.ts +0 -3
- package/types/src/reflection/types/index.d.ts +0 -1
- package/types/src/reflection/types/reflection.types.d.ts +0 -21
- package/types/src/reflection/utilities.d.ts +0 -27
- package/types/src/system/camel-case.d.ts +0 -1
- package/types/src/system/debounce.d.ts +0 -1
- package/types/src/system/decorator.d.ts +0 -15
- package/types/src/system/environment.d.ts +0 -6
- package/types/src/system/index.d.ts +0 -7
- package/types/src/system/retry.decorator.d.ts +0 -6
- package/types/src/system/sleep.d.ts +0 -1
- package/types/src/system/type.utils.d.ts +0 -1
- /package/{es6/src/collections/collections.js → src/collections/collections.ts} +0 -0
- /package/{es6/src/collections/index.js → src/collections/index.ts} +0 -0
- /package/{es6/src/configuration/index.js → src/configuration/index.ts} +0 -0
- /package/{es6/src/extensibility/index.js → src/extensibility/index.ts} +0 -0
- /package/{es6/src/io/index.js → src/io/index.ts} +0 -0
- /package/{es6/src/io/types/index.js → src/io/types/index.ts} +0 -0
- /package/{es6/src/objects/index.js → src/objects/index.ts} +0 -0
- /package/{es6/src/reflection/types/index.js → src/reflection/types/index.ts} +0 -0
- /package/{es6/src/system/index.js → src/system/index.ts} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type File = {
|
|
2
|
-
fullPath: string;
|
|
3
|
-
relativePath: string;
|
|
4
|
-
};
|
|
5
|
-
export declare class FileEx implements File {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(data: Partial<File> & {
|
|
8
|
-
content?: string;
|
|
9
|
-
});
|
|
10
|
-
fullPath: string;
|
|
11
|
-
relativePath: string;
|
|
12
|
-
toString(): string;
|
|
13
|
-
getContent(): Promise<string>;
|
|
14
|
-
}
|
|
15
|
-
export type Watcher = {
|
|
16
|
-
readonly ready: Promise<void>;
|
|
17
|
-
on(event: "ready", handler: () => unknown): Watcher;
|
|
18
|
-
on(event: "add" | "change" | "addDir" | "unlink" | "unlinkDir", handler: (file: File) => unknown): Watcher;
|
|
19
|
-
close(): void;
|
|
20
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
type TAllKeys<T> = T extends unknown ? keyof T : never;
|
|
2
|
-
type TIndexValue<T, K extends PropertyKey, D = never> = T extends unknown ? K extends keyof T ? T[K] : D : never;
|
|
3
|
-
type TPartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>> extends infer O ? {
|
|
4
|
-
[P in keyof O]: O[P];
|
|
5
|
-
} : never;
|
|
6
|
-
type TFunction = (...a: unknown[]) => unknown;
|
|
7
|
-
type TPrimitives = string | number | boolean | bigint | symbol | Date | TFunction;
|
|
8
|
-
type TMerged<T> = [T] extends [Array<unknown>] ? {
|
|
9
|
-
[K in keyof T]: TMerged<T[K]>;
|
|
10
|
-
} : [T] extends [TPrimitives] ? T : [T] extends [object] ? TPartialKeys<{
|
|
11
|
-
[K in TAllKeys<T>]: TMerged<TIndexValue<T, K>>;
|
|
12
|
-
}, never> : T;
|
|
13
|
-
export declare const merge: {
|
|
14
|
-
<T extends object[]>(...objects: T): TMerged<T[number]>;
|
|
15
|
-
options: IOptions;
|
|
16
|
-
withOptions<R = unknown, T extends object[] = object[]>(options: Partial<IOptions>, ...objects: T): R;
|
|
17
|
-
};
|
|
18
|
-
interface IOptions {
|
|
19
|
-
/**
|
|
20
|
-
* When `true`, values explicitly provided as `undefined` will override existing values, though properties that are simply omitted won't affect anything.
|
|
21
|
-
* When `false`, values explicitly provided as `undefined` won't override existing values.
|
|
22
|
-
*
|
|
23
|
-
* Default: `true`
|
|
24
|
-
*/
|
|
25
|
-
allowUndefinedOverrides: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* When `true` it will merge array properties.
|
|
28
|
-
* When `false` it will replace array properties with the last instance entirely instead of merging their contents.
|
|
29
|
-
*
|
|
30
|
-
* Default: `true`
|
|
31
|
-
*/
|
|
32
|
-
mergeArrays: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* When `true` it will ensure there are no duplicate array items.
|
|
35
|
-
* When `false` it will allow duplicates when merging arrays.
|
|
36
|
-
*
|
|
37
|
-
* Default: `true`
|
|
38
|
-
*/
|
|
39
|
-
uniqueArrayItems: boolean;
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { merge } from "./deep-merge.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./reflection.types.js";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type Constructable<T extends object = object> = {
|
|
2
|
-
new (...args: any[]): T;
|
|
3
|
-
} & Type;
|
|
4
|
-
export type Field = {
|
|
5
|
-
key: string;
|
|
6
|
-
propertyDescriptor: PropertyDescriptor;
|
|
7
|
-
};
|
|
8
|
-
export type FunctionType = (...args: unknown[]) => unknown | unknown[] | undefined | Promise<unknown>;
|
|
9
|
-
export type ReflectMeta = "paramtypes" | "type";
|
|
10
|
-
export declare const MetaDataOwners: {
|
|
11
|
-
Hearth: string;
|
|
12
|
-
Reflect: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const ReflectionMeta: {
|
|
15
|
-
paramtypes: string;
|
|
16
|
-
type: string;
|
|
17
|
-
};
|
|
18
|
-
export type Type = {
|
|
19
|
-
prototype: object;
|
|
20
|
-
name?: string;
|
|
21
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type Constructable, type Field, type FunctionType, type Type } from "./types/reflection.types.js";
|
|
2
|
-
export declare const isPrimitiveOrDateType: (type: Type) => boolean;
|
|
3
|
-
export declare const isDateType: (type: Type) => boolean;
|
|
4
|
-
export declare function isConstructable(type: Constructable | object | FunctionType): type is Constructable;
|
|
5
|
-
export declare const isArrayType: (type: Type) => boolean;
|
|
6
|
-
export declare function getMeta<T>(key: string, target: object, propertyKey?: string): T;
|
|
7
|
-
export declare function getFunctions(object: Constructable): PropertyDescriptor[];
|
|
8
|
-
export declare function getFunction(object: Constructable, functionName: string): PropertyDescriptor;
|
|
9
|
-
export declare function getFunctionMetadata<T>(key: string, target: object, func: FunctionType): T;
|
|
10
|
-
export declare function getFunctionArgs(target: object, func: FunctionType): Type[];
|
|
11
|
-
/**
|
|
12
|
-
* @description Gets the fields from an object
|
|
13
|
-
* @param object
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export declare function getFields<T>(object: T): Field[];
|
|
17
|
-
export declare function getFieldType(target: object, fieldName: string): Type;
|
|
18
|
-
export declare function getArgumentMeta<T>(key: string, target: FunctionType, argIndex: number): T;
|
|
19
|
-
export declare function defineMeta<T>(key: string, value: T, target: object): void;
|
|
20
|
-
/**
|
|
21
|
-
* @description Facade function to define metadata for a function argument
|
|
22
|
-
* @param key
|
|
23
|
-
* @param value
|
|
24
|
-
* @param func
|
|
25
|
-
* @param argIndex
|
|
26
|
-
*/
|
|
27
|
-
export declare function defineArgumentMeta<T>(key: string, value: T, func: FunctionType, argIndex: number): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function lowerCamelCase(val: any): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function debounce<T extends unknown[]>(callback: (...args: T) => Promise<void>, delay: number): (...args: T) => void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare abstract class FunctionDecorator<TOptions = undefined> {
|
|
2
|
-
protected options: TOptions;
|
|
3
|
-
constructor();
|
|
4
|
-
abstract decorator(target: object, propertyKey: string, descriptor: PropertyDescriptor): any;
|
|
5
|
-
decoratorFactory(options?: TOptions): any;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Skips the decorated method decorator if any of the named environment variables equal "true".
|
|
9
|
-
* Useful for disabling decorators like @cache() during unit tests or via feature flags.
|
|
10
|
-
*
|
|
11
|
-
* @example @ignoreIf("TEST", "DISABLE_CACHE")
|
|
12
|
-
*/
|
|
13
|
-
export declare function ignoreIf(...envVars: string[]): (_: object, __: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
14
|
-
/** @deprecated Use ignoreIf("TEST") instead */
|
|
15
|
-
export declare function ignoreDuringUnitTest(): (_: object, __: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|