depflow 3.0.0-dev.1 → 3.0.0-dev.11
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 +108 -43
- package/dist/builder/Builder.d.ts +279 -0
- package/dist/builder/Builder.js +391 -0
- package/dist/builder/Builder.js.map +1 -0
- package/dist/cli/CLI.d.ts +157 -0
- package/dist/cli/CLI.js +214 -0
- package/dist/cli/CLI.js.map +1 -0
- package/dist/cli/DepFLowCLI.d.ts +93 -0
- package/dist/cli/DepFLowCLI.js +413 -0
- package/dist/cli/DepFLowCLI.js.map +1 -0
- package/dist/cli/Flags.d.ts +106 -0
- package/dist/cli/Flags.js +125 -0
- package/dist/cli/Flags.js.map +1 -0
- package/dist/cli/bin.js +68 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/config/Config.d.ts +690 -0
- package/dist/config/Config.js +45 -0
- package/dist/config/Config.js.map +1 -0
- package/dist/config/ImportMap.d.ts +60 -0
- package/dist/config/ImportMap.js +66 -0
- package/dist/config/ImportMap.js.map +1 -0
- package/dist/config/JsonSchema.d.ts +12 -0
- package/dist/config/JsonSchema.js +26 -0
- package/dist/config/JsonSchema.js.map +1 -0
- package/dist/config/Settings.d.ts +201 -0
- package/dist/config/Settings.js +191 -0
- package/dist/config/Settings.js.map +1 -0
- package/dist/config/TSConfig.d.ts +73 -0
- package/dist/config/TSConfig.js +73 -0
- package/dist/config/TSConfig.js.map +1 -0
- package/dist/config/codecs/JsonCodec.d.ts +30 -0
- package/dist/config/codecs/JsonCodec.js +31 -0
- package/dist/config/codecs/JsonCodec.js.map +1 -0
- package/dist/config/codecs/YamlCodec.d.ts +62 -0
- package/dist/config/codecs/YamlCodec.js +89 -0
- package/dist/config/codecs/YamlCodec.js.map +1 -0
- package/dist/dependency/DepUtils.d.ts +50 -0
- package/dist/dependency/DepUtils.js +71 -0
- package/dist/dependency/DepUtils.js.map +1 -0
- package/dist/dependency/Dependency.d.ts +81 -0
- package/dist/dependency/Dependency.js +71 -0
- package/dist/dependency/Dependency.js.map +1 -0
- package/dist/dependency/Git.d.ts +75 -0
- package/dist/dependency/Git.js +97 -0
- package/dist/dependency/Git.js.map +1 -0
- package/dist/dependency/GitDependency.d.ts +30 -0
- package/dist/dependency/GitDependency.js +79 -0
- package/dist/dependency/GitDependency.js.map +1 -0
- package/dist/dependency/NpmDependency.d.ts +27 -0
- package/dist/dependency/NpmDependency.js +91 -0
- package/dist/dependency/NpmDependency.js.map +1 -0
- package/dist/resolve/AliasCompiler.d.ts +45 -0
- package/dist/resolve/AliasCompiler.js +84 -0
- package/dist/resolve/AliasCompiler.js.map +1 -0
- package/{build/support/PathResolver → dist/resolve}/PathResolver.d.ts +26 -9
- package/dist/resolve/PathResolver.js +133 -0
- package/dist/resolve/PathResolver.js.map +1 -0
- package/dist/resolve/PathRewriter.d.ts +24 -0
- package/{build/support/PathResolver → dist/resolve}/PathRewriter.js +21 -11
- package/dist/resolve/PathRewriter.js.map +1 -0
- package/dist/schema/Config/Builder.d.ts +496 -0
- package/dist/schema/Config/Builder.js +78 -0
- package/dist/schema/Config/Builder.js.map +1 -0
- package/dist/schema/Config/Config.d.ts +673 -0
- package/dist/schema/Config/Config.js +62 -0
- package/dist/schema/Config/Config.js.map +1 -0
- package/dist/schema/Config/Dependency.d.ts +878 -0
- package/dist/schema/Config/Dependency.js +80 -0
- package/dist/schema/Config/Dependency.js.map +1 -0
- package/dist/schema/Config/Extractor.d.ts +157 -0
- package/dist/schema/Config/Extractor.js +43 -0
- package/dist/schema/Config/Extractor.js.map +1 -0
- package/dist/schema/Config/Resolver.d.ts +87 -0
- package/dist/schema/Config/Resolver.js +43 -0
- package/dist/schema/Config/Resolver.js.map +1 -0
- package/dist/schema/Config/Transform.d.ts +90 -0
- package/dist/schema/Config/Transform.js +51 -0
- package/dist/schema/Config/Transform.js.map +1 -0
- package/dist/schema/Defaults.d.ts +20 -0
- package/dist/schema/Defaults.js +24 -0
- package/dist/schema/Defaults.js.map +1 -0
- package/dist/schema/ImportMap.d.ts +30 -0
- package/dist/schema/ImportMap.js +28 -0
- package/dist/schema/ImportMap.js.map +1 -0
- package/dist/schema/TSConfig.d.ts +70 -0
- package/dist/schema/TSConfig.js +39 -0
- package/dist/schema/TSConfig.js.map +1 -0
- package/dist/schema/schema.d.ts +38 -0
- package/dist/schema/schema.js +40 -0
- package/dist/schema/schema.js.map +1 -0
- package/dist/task/Command.d.ts +287 -0
- package/dist/task/Command.js +404 -0
- package/dist/task/Command.js.map +1 -0
- package/dist/task/Group.d.ts +15 -0
- package/dist/task/Group.js +29 -0
- package/dist/task/Group.js.map +1 -0
- package/dist/task/OutputPolicy.d.ts +262 -0
- package/dist/task/OutputPolicy.js +364 -0
- package/dist/task/OutputPolicy.js.map +1 -0
- package/dist/task/Task.d.ts +210 -0
- package/dist/task/Task.js +312 -0
- package/dist/task/Task.js.map +1 -0
- package/package.json +16 -14
- package/.gitignore +0 -7
- package/build/cli/DepFLowCLI.d.ts +0 -15
- package/build/cli/DepFLowCLI.js +0 -223
- package/build/cli/DepFLowCLI.js.map +0 -1
- package/build/cli/bin.js +0 -41
- package/build/cli/bin.js.map +0 -1
- package/build/config/Config.d.ts +0 -28
- package/build/config/Config.js +0 -46
- package/build/config/Config.js.map +0 -1
- package/build/config/ImportMap.d.ts +0 -37
- package/build/config/ImportMap.js +0 -82
- package/build/config/ImportMap.js.map +0 -1
- package/build/config/Tsconfig.d.ts +0 -57
- package/build/config/Tsconfig.js +0 -100
- package/build/config/Tsconfig.js.map +0 -1
- package/build/config/schemas.d.ts +0 -1194
- package/build/config/schemas.js +0 -66
- package/build/config/schemas.js.map +0 -1
- package/build/support/Async.d.ts +0 -22
- package/build/support/Async.js +0 -62
- package/build/support/Async.js.map +0 -1
- package/build/support/Builder/Builder.d.ts +0 -36
- package/build/support/Builder/Builder.js +0 -89
- package/build/support/Builder/Builder.js.map +0 -1
- package/build/support/Dependency/Dependency.d.ts +0 -38
- package/build/support/Dependency/Dependency.js +0 -14
- package/build/support/Dependency/Dependency.js.map +0 -1
- package/build/support/Dependency/GitDependency.d.ts +0 -20
- package/build/support/Dependency/GitDependency.js +0 -67
- package/build/support/Dependency/GitDependency.js.map +0 -1
- package/build/support/Dependency/NpmDependency.d.ts +0 -18
- package/build/support/Dependency/NpmDependency.js +0 -65
- package/build/support/Dependency/NpmDependency.js.map +0 -1
- package/build/support/Dependency/Resolver.d.ts +0 -7
- package/build/support/Dependency/Resolver.js +0 -4
- package/build/support/Dependency/Resolver.js.map +0 -1
- package/build/support/Git.d.ts +0 -53
- package/build/support/Git.js +0 -86
- package/build/support/Git.js.map +0 -1
- package/build/support/PathResolver/AliasCompiler.d.ts +0 -25
- package/build/support/PathResolver/AliasCompiler.js +0 -39
- package/build/support/PathResolver/AliasCompiler.js.map +0 -1
- package/build/support/PathResolver/PathResolver.js +0 -104
- package/build/support/PathResolver/PathResolver.js.map +0 -1
- package/build/support/PathResolver/PathRewriter.d.ts +0 -18
- package/build/support/PathResolver/PathRewriter.js.map +0 -1
- package/build/support/PathResolver/Utils.d.ts +0 -36
- package/build/support/PathResolver/Utils.js +0 -45
- package/build/support/PathResolver/Utils.js.map +0 -1
- package/build/support/Task/Command.d.ts +0 -49
- package/build/support/Task/Command.js +0 -100
- package/build/support/Task/Command.js.map +0 -1
- package/build/support/Task/Task.d.ts +0 -84
- package/build/support/Task/Task.js +0 -145
- package/build/support/Task/Task.js.map +0 -1
- package/build/support/Utils.d.ts +0 -40
- package/build/support/Utils.js +0 -138
- package/build/support/Utils.js.map +0 -1
- package/build/support/Validator.d.ts +0 -22
- package/build/support/Validator.js +0 -28
- package/build/support/Validator.js.map +0 -1
- /package/{build → dist}/cli/bin.d.ts +0 -0
package/build/config/schemas.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@netfeez/common';
|
|
2
|
-
export const ImportMap = Schema.fromObject({
|
|
3
|
-
imports: { type: 'object', default: {} },
|
|
4
|
-
scopes: { type: 'object', default: {} }
|
|
5
|
-
});
|
|
6
|
-
export const TsConfig = Schema.fromObject({
|
|
7
|
-
compilerOptions: { type: 'object', properties: {
|
|
8
|
-
baseUrl: { type: 'string' },
|
|
9
|
-
rootDir: { type: 'string' },
|
|
10
|
-
outDir: { type: 'string' },
|
|
11
|
-
paths: { type: 'object' }
|
|
12
|
-
}, allowAdditionalProperties: true }
|
|
13
|
-
}, true);
|
|
14
|
-
export const ExtractorEntry = Schema.fromObject({
|
|
15
|
-
from: { type: 'string', required: true },
|
|
16
|
-
to: { type: 'string', required: true },
|
|
17
|
-
replacer: { union: [{ type: 'string' }, { type: 'object', properties: {
|
|
18
|
-
search: { type: 'string', required: true },
|
|
19
|
-
replace: { type: 'string', required: true }
|
|
20
|
-
} }], nullable: true }
|
|
21
|
-
});
|
|
22
|
-
export const BuilderEntry = Schema.fromObject({
|
|
23
|
-
maxTimeMs: { type: 'number', default: 60000 },
|
|
24
|
-
run: { union: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }] },
|
|
25
|
-
extract: { union: [{ type: 'string' }, { type: 'array', items: ExtractorEntry.root }] }
|
|
26
|
-
});
|
|
27
|
-
export const ResolverEntry = Schema.fromObject({
|
|
28
|
-
alias: { type: 'string', required: true },
|
|
29
|
-
target: { union: [
|
|
30
|
-
{ type: 'string' },
|
|
31
|
-
{ type: 'object', properties: {
|
|
32
|
-
local: { type: 'string', required: true },
|
|
33
|
-
cdn: { type: 'string' }
|
|
34
|
-
} }
|
|
35
|
-
], required: true }
|
|
36
|
-
});
|
|
37
|
-
export const GitDependency = Schema.fromObject({
|
|
38
|
-
name: { type: 'string', required: true },
|
|
39
|
-
repo: { type: 'string', required: true },
|
|
40
|
-
tag: { type: 'string', default: 'main' },
|
|
41
|
-
builder: { type: 'array', default: [], items: BuilderEntry.root },
|
|
42
|
-
resolver: { type: 'array', nullable: true, default: [], items: ResolverEntry.root }
|
|
43
|
-
});
|
|
44
|
-
export const NpmDependency = Schema.fromObject({
|
|
45
|
-
name: { type: 'string', required: true },
|
|
46
|
-
version: { type: 'string', required: true },
|
|
47
|
-
builder: { type: 'array', default: [], items: BuilderEntry.root },
|
|
48
|
-
resolver: { type: 'array', nullable: true, default: [], items: ResolverEntry.root }
|
|
49
|
-
});
|
|
50
|
-
export const Config = Schema.fromObject({
|
|
51
|
-
$schema: { type: 'string', default: '.depflow/schema.json' },
|
|
52
|
-
flowFolder: { type: 'string', default: '.depflow' },
|
|
53
|
-
outDir: { type: 'string', default: 'dist' },
|
|
54
|
-
tsconfig: { type: 'string', nullable: true, default: null },
|
|
55
|
-
importmap: { type: 'string', nullable: true, default: null },
|
|
56
|
-
dependencies: { type: 'array', default: [], items: GitDependency.root },
|
|
57
|
-
npmDependencies: { type: 'array', default: [], items: NpmDependency.root }
|
|
58
|
-
});
|
|
59
|
-
export const Schemas = {
|
|
60
|
-
Config,
|
|
61
|
-
TsConfig, ImportMap,
|
|
62
|
-
BuilderEntry, ResolverEntry,
|
|
63
|
-
GitDependency, NpmDependency
|
|
64
|
-
};
|
|
65
|
-
export default Schemas;
|
|
66
|
-
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/config/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;IACvC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IACxC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IACtC,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE;YAC3C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAA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2
|
-
static delay(ms: number): Promise<void>;
|
|
3
|
-
/**
|
|
4
|
-
* Asynchronously waits for a specific event to occur by executing the provided executor function.
|
|
5
|
-
* The executor function is expected to call a done callback when the event occurs, passing any relevant result.
|
|
6
|
-
* The method also supports an optional timeout parameter, which will reject the promise if the event does not occur within the specified time frame.
|
|
7
|
-
*
|
|
8
|
-
* @param executor - A function that executes the logic to wait for the event and calls the done callback when the event occurs.
|
|
9
|
-
* @param timeout - An optional timeout in milliseconds after which the promise will be rejected if the event has not occurred (default is -1, meaning no timeout).
|
|
10
|
-
* @returns A promise that resolves with the result passed to the done callback when the event occurs, or rejects if an error occurs or if the timeout is reached.
|
|
11
|
-
*/
|
|
12
|
-
static awaitEvent<R extends any>(executor: Async.AsyncEvent.Exec<R>, timeout?: number): Promise<R>;
|
|
13
|
-
}
|
|
14
|
-
export declare namespace Async {
|
|
15
|
-
namespace AsyncEvent {
|
|
16
|
-
type Clean = () => void;
|
|
17
|
-
type Done<R> = (result: R) => void;
|
|
18
|
-
type Fail = (error: Error) => void;
|
|
19
|
-
type Exec<R> = (done: Done<R>, fail: Fail) => Clean | Promise<Clean> | void | Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export default Async;
|
package/build/support/Async.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export class Async {
|
|
2
|
-
static async delay(ms) {
|
|
3
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Asynchronously waits for a specific event to occur by executing the provided executor function.
|
|
7
|
-
* The executor function is expected to call a done callback when the event occurs, passing any relevant result.
|
|
8
|
-
* The method also supports an optional timeout parameter, which will reject the promise if the event does not occur within the specified time frame.
|
|
9
|
-
*
|
|
10
|
-
* @param executor - A function that executes the logic to wait for the event and calls the done callback when the event occurs.
|
|
11
|
-
* @param timeout - An optional timeout in milliseconds after which the promise will be rejected if the event has not occurred (default is -1, meaning no timeout).
|
|
12
|
-
* @returns A promise that resolves with the result passed to the done callback when the event occurs, or rejects if an error occurs or if the timeout is reached.
|
|
13
|
-
*/
|
|
14
|
-
static async awaitEvent(executor, timeout = -1) {
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
let timer = null;
|
|
17
|
-
let isSettled = false;
|
|
18
|
-
let cleanupHandler;
|
|
19
|
-
const cleanup = () => {
|
|
20
|
-
isSettled = true;
|
|
21
|
-
if (!timer)
|
|
22
|
-
return;
|
|
23
|
-
clearTimeout(timer);
|
|
24
|
-
timer = null;
|
|
25
|
-
if (typeof cleanupHandler === 'function') {
|
|
26
|
-
cleanupHandler();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const safeResolve = (result) => {
|
|
30
|
-
if (isSettled)
|
|
31
|
-
return;
|
|
32
|
-
cleanup();
|
|
33
|
-
resolve(result);
|
|
34
|
-
};
|
|
35
|
-
const safeReject = (err) => {
|
|
36
|
-
if (isSettled)
|
|
37
|
-
return;
|
|
38
|
-
cleanup();
|
|
39
|
-
reject(err instanceof Error ? err : new Error(String(err)));
|
|
40
|
-
};
|
|
41
|
-
if (timeout > 0) {
|
|
42
|
-
timer = setTimeout(() => {
|
|
43
|
-
safeReject(new Error(`Async event timed out after ${timeout}ms`));
|
|
44
|
-
}, timeout);
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const result = executor(safeResolve, safeReject);
|
|
48
|
-
if (result instanceof Promise) {
|
|
49
|
-
result.then(h => { cleanupHandler = h; }).catch(safeReject);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
cleanupHandler = result;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
safeReject(error);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export default Async;
|
|
62
|
-
//# sourceMappingURL=Async.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Async.js","s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AC;gBACd,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;oBACpB,UAAU,CAAC,IAAI,KAAK,CAAC,+BAA+B,OAAO,IAAI,CAAC,CAAC,CAAC;gBACtE,CAAC,EAAE,OAAO,CAAC,CAAC;YAChB,CAAC;YAED,IAAI,CAAC;gBACD,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;gBACjD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;oBAC5B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBAChE,CAAC;qBAAM,CAAC;oBACJ,cAAc,GAAG,MAAM,CAAC;gBAC5B,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AASD,eAAe,KAAK,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type Logger from "@netfeez/vterm";
|
|
2
|
-
import type Schemas from "../../config/schemas.js";
|
|
3
|
-
export declare class Builder {
|
|
4
|
-
protected readonly pipeline: Builder.BuilderEntry[];
|
|
5
|
-
protected readonly cwd: string;
|
|
6
|
-
protected readonly logger: Logger | null;
|
|
7
|
-
constructor(info: Builder.Info);
|
|
8
|
-
run(): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
|
|
11
|
-
* It handles the copying of files from the specified source to the target location, applying any necessary path transformations based on the provided replacer configuration.
|
|
12
|
-
* This method is essential for managing the file extraction phase of the build process, allowing for flexible and customizable file handling as defined in the builder configuration.
|
|
13
|
-
* @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
|
|
14
|
-
* @returns A promise that resolves when the extraction process is complete, or rejects with an error if any issues occur during the file copying or transformation.
|
|
15
|
-
* @throws Will throw an error if any issues occur during the file copying process, such as problems with reading or writing files, or if the provided entry configuration is invalid.
|
|
16
|
-
*/
|
|
17
|
-
protected runExtractor(entry: string | Builder.Extractor[]): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Runs a series of shell commands as part of the build process, using a child process to execute the commands and capturing the output for logging. It handles the execution of the commands, providing feedback on the progress and any errors that occur during the process. This method is essential for executing the necessary setup commands defined in the builder configuration, allowing for a flexible and dynamic build process that can accommodate various requirements for different dependencies.
|
|
20
|
-
* @param commands An array of strings representing the shell commands to be executed as part of the build process.
|
|
21
|
-
* @param logger An optional Logger instance for logging the output and errors from the command execution.
|
|
22
|
-
* @returns A promise that resolves when the command execution is complete, or rejects with an error if any command fails, allowing callers to handle such scenarios appropriately.
|
|
23
|
-
* @throws Will throw an error if any issues occur during the execution of the commands, such as problems with spawning the child process or if any command returns a non-zero exit code.
|
|
24
|
-
*/
|
|
25
|
-
protected runTask(commands: string[], cwd: string, maxTimeMs: number): Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
export declare namespace Builder {
|
|
28
|
-
type BuilderEntry = Schemas.BuilderEntry['infer'];
|
|
29
|
-
type Extractor = Schemas.ExtractorEntry['infer'];
|
|
30
|
-
interface Info {
|
|
31
|
-
pipeline: BuilderEntry[];
|
|
32
|
-
cwd: string;
|
|
33
|
-
logger?: Logger | null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export default Builder;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import Utils from "../Utils.js";
|
|
2
|
-
import Async from "../Async.js";
|
|
3
|
-
import Task from "../Task/Task.js";
|
|
4
|
-
import { File, Path } from "@netfeez/common-node";
|
|
5
|
-
export class Builder {
|
|
6
|
-
pipeline = [];
|
|
7
|
-
cwd = process.cwd();
|
|
8
|
-
logger;
|
|
9
|
-
constructor(info) {
|
|
10
|
-
this.pipeline = info.pipeline;
|
|
11
|
-
this.cwd = info.cwd;
|
|
12
|
-
this.logger = info.logger || null;
|
|
13
|
-
}
|
|
14
|
-
async run() {
|
|
15
|
-
this.logger?.group(Utils.newGroup('#00FFB4'));
|
|
16
|
-
for (const step of this.pipeline) {
|
|
17
|
-
let ranTask = false;
|
|
18
|
-
if (step.run)
|
|
19
|
-
try {
|
|
20
|
-
const commands = typeof step.run === 'string' ? [step.run] : step.run;
|
|
21
|
-
await this.runTask(commands, this.cwd, step.maxTimeMs ?? 60000);
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
this.logger?.error(`&C1[Run] &C7${error}`);
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
ranTask = true;
|
|
28
|
-
}
|
|
29
|
-
if (step.extract)
|
|
30
|
-
try {
|
|
31
|
-
if (ranTask)
|
|
32
|
-
this.logger?.line();
|
|
33
|
-
await this.runExtractor(step.extract);
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
this.logger?.error(`&C1[Extract] &C7${error}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
this.logger?.groupEnd();
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
|
|
43
|
-
* It handles the copying of files from the specified source to the target location, applying any necessary path transformations based on the provided replacer configuration.
|
|
44
|
-
* This method is essential for managing the file extraction phase of the build process, allowing for flexible and customizable file handling as defined in the builder configuration.
|
|
45
|
-
* @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
|
|
46
|
-
* @returns A promise that resolves when the extraction process is complete, or rejects with an error if any issues occur during the file copying or transformation.
|
|
47
|
-
* @throws Will throw an error if any issues occur during the file copying process, such as problems with reading or writing files, or if the provided entry configuration is invalid.
|
|
48
|
-
*/
|
|
49
|
-
async runExtractor(entry) {
|
|
50
|
-
const extractor = typeof entry === 'string' ? [{ from: '**/*', to: entry }] : entry;
|
|
51
|
-
for (const entry of extractor) {
|
|
52
|
-
const { from, to: toEntry, replacer } = entry;
|
|
53
|
-
const regex = !replacer ? null : new RegExp(typeof replacer === 'string' ? replacer : replacer.search, 'g');
|
|
54
|
-
const value = !replacer || typeof replacer === 'string' ? '' : replacer.replace;
|
|
55
|
-
const to = Path.isAbsolute(toEntry) ? toEntry : Path.join(Path.cwd, toEntry);
|
|
56
|
-
this.logger?.log(`&C7Extracting &C3${from}&C7 to &C3${to}&C7...`);
|
|
57
|
-
await File.smartCopy(from, to, {
|
|
58
|
-
cwd: this.cwd,
|
|
59
|
-
map: path => regex ? path.replace(regex, value) : path
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Runs a series of shell commands as part of the build process, using a child process to execute the commands and capturing the output for logging. It handles the execution of the commands, providing feedback on the progress and any errors that occur during the process. This method is essential for executing the necessary setup commands defined in the builder configuration, allowing for a flexible and dynamic build process that can accommodate various requirements for different dependencies.
|
|
65
|
-
* @param commands An array of strings representing the shell commands to be executed as part of the build process.
|
|
66
|
-
* @param logger An optional Logger instance for logging the output and errors from the command execution.
|
|
67
|
-
* @returns A promise that resolves when the command execution is complete, or rejects with an error if any command fails, allowing callers to handle such scenarios appropriately.
|
|
68
|
-
* @throws Will throw an error if any issues occur during the execution of the commands, such as problems with spawning the child process or if any command returns a non-zero exit code.
|
|
69
|
-
*/
|
|
70
|
-
runTask(commands, cwd, maxTimeMs) {
|
|
71
|
-
return Async.awaitEvent((done, fail) => {
|
|
72
|
-
const pollito = new Task(cwd, commands);
|
|
73
|
-
if (this.logger) {
|
|
74
|
-
pollito.on('line', (line) => this.logger?.info(`${line}`));
|
|
75
|
-
pollito.on('error', (msg, step) => this.logger?.error(`&C1[Step ${step}]&C7: &C1${msg}`));
|
|
76
|
-
}
|
|
77
|
-
pollito.once('finish', (data) => {
|
|
78
|
-
if (data.fails > 0)
|
|
79
|
-
fail(new Error(`Build failed with ${data.fails} failed steps.`));
|
|
80
|
-
else
|
|
81
|
-
done();
|
|
82
|
-
});
|
|
83
|
-
pollito.start().catch(fail);
|
|
84
|
-
return () => { pollito.stop(); };
|
|
85
|
-
}, maxTimeMs);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export default Builder;
|
|
89
|
-
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/support/Builder/Builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,OAAO,OAAO;IACG,QAAQ,GAA2B,EAAE,CAAC;IACtC,GAAG,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,MAAM,CAAgB;IAEzC,YAAmB,IAAkB;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,GAAG;QACZ,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/B,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,IAAI,CAAC,GAAG;gBAAE,IAAI,CAAC;oBACf,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;oBACxE,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I,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;YAC9F,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC5B,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC;oBAAE,IAAI,CAAC,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC;;oBAChF,IAAI,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClB,CAAC;CACJ;AAUD,eAAe,OAAO,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type Logger from "@netfeez/vterm";
|
|
2
|
-
import type Resolver from "./Resolver.js";
|
|
3
|
-
import type Builder from "../Builder/Builder.js";
|
|
4
|
-
export declare abstract class Dependency {
|
|
5
|
-
protected readonly logger: Logger | null;
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly builder: Builder.BuilderEntry[];
|
|
8
|
-
readonly resolver: Resolver.ResolverEntry[];
|
|
9
|
-
constructor(info: Dependency.Info, logger?: Logger | null);
|
|
10
|
-
/**
|
|
11
|
-
* Install the dependency.
|
|
12
|
-
* This method should handle the installation process, such as downloading files, setting up configurations, etc.
|
|
13
|
-
*/
|
|
14
|
-
abstract install(): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Uninstall the dependency.
|
|
17
|
-
* This method should handle the uninstallation process, such as removing files, cleaning up configurations, etc.
|
|
18
|
-
*/
|
|
19
|
-
abstract uninstall(): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Build the dependency.
|
|
22
|
-
* This method should handle the build process, such as compiling code, bundling files, etc.
|
|
23
|
-
*/
|
|
24
|
-
abstract build(): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Resolve the dependency.
|
|
27
|
-
* This method should handle the resolution process, such as fetching dependencies, resolving versions, etc.
|
|
28
|
-
*/
|
|
29
|
-
abstract resolve(): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
export declare namespace Dependency {
|
|
32
|
-
interface Info {
|
|
33
|
-
name: string;
|
|
34
|
-
builder?: Builder.BuilderEntry[];
|
|
35
|
-
resolver?: Resolver.ResolverEntry[];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export default Dependency;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class Dependency {
|
|
2
|
-
logger;
|
|
3
|
-
name;
|
|
4
|
-
builder;
|
|
5
|
-
resolver;
|
|
6
|
-
constructor(info, logger) {
|
|
7
|
-
this.name = info.name;
|
|
8
|
-
this.builder = info.builder || [];
|
|
9
|
-
this.resolver = info.resolver || [];
|
|
10
|
-
this.logger = logger || null;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export default Dependency;
|
|
14
|
-
//# sourceMappingURL=Dependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/support/Dependency/Dependency.ts"],"names":[],"mappings":"AAKA,MAAM,OAAgB,UAAU;IACT,MAAM,CAAgB;IAEzB,IAAI,CAAS;IACb,OAAO,CAAyB;IAChC,QAAQ,CAA2B;IAEnD,YAAmB,IAAqB,EAAE,MAAsB;QAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;IACjC,CAAC;CAqBJ;AAQD,eAAe,UAAU,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import Logger from "@netfeez/vterm";
|
|
2
|
-
import Schemas from "../../config/schemas.js";
|
|
3
|
-
import Dependency from './Dependency.js';
|
|
4
|
-
export declare class GitDependency extends Dependency implements GitDependency.Dependency {
|
|
5
|
-
readonly flowFolder: string;
|
|
6
|
-
readonly repo: GitDependency.repo;
|
|
7
|
-
readonly tag: string;
|
|
8
|
-
constructor(flowFolder: string, dependency: GitDependency.Dependency, logger?: Logger | null);
|
|
9
|
-
/** Get the folder of the dependency */
|
|
10
|
-
get folder(): string;
|
|
11
|
-
install(): Promise<void>;
|
|
12
|
-
uninstall(): Promise<void>;
|
|
13
|
-
build(): Promise<void>;
|
|
14
|
-
resolve(): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export declare namespace GitDependency {
|
|
17
|
-
type repo = `https://github.com/${string}/${string}.git` | `git@github.com:${string}/${string}.git`;
|
|
18
|
-
type Dependency = Schemas.GitDependency['infer'];
|
|
19
|
-
}
|
|
20
|
-
export default GitDependency;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author NetFeez <netfeez.dev@gmail.com>
|
|
3
|
-
* @description Dependency utility.
|
|
4
|
-
* @license Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { File, Path } from '@netfeez/common-node';
|
|
7
|
-
import Validator from "../Validator.js";
|
|
8
|
-
import Git from "../Git.js";
|
|
9
|
-
import Utils from "../Utils.js";
|
|
10
|
-
import Dependency from './Dependency.js';
|
|
11
|
-
import Builder from '../Builder/Builder.js';
|
|
12
|
-
export class GitDependency extends Dependency {
|
|
13
|
-
flowFolder;
|
|
14
|
-
repo;
|
|
15
|
-
tag;
|
|
16
|
-
constructor(flowFolder, dependency, logger = null) {
|
|
17
|
-
super({
|
|
18
|
-
name: dependency.name,
|
|
19
|
-
builder: dependency.builder,
|
|
20
|
-
resolver: dependency.resolver || []
|
|
21
|
-
}, logger);
|
|
22
|
-
this.flowFolder = flowFolder;
|
|
23
|
-
Validator.validateRepo(dependency.repo);
|
|
24
|
-
this.repo = dependency.repo;
|
|
25
|
-
this.tag = dependency.tag;
|
|
26
|
-
}
|
|
27
|
-
/** Get the folder of the dependency */
|
|
28
|
-
get folder() {
|
|
29
|
-
let path = Path.join(this.flowFolder, this.name);
|
|
30
|
-
path = Path.normalize(path);
|
|
31
|
-
return path;
|
|
32
|
-
}
|
|
33
|
-
async install() {
|
|
34
|
-
try {
|
|
35
|
-
this.logger?.group(Utils.newGroup('#00B4FF'));
|
|
36
|
-
if (await File.exists(this.folder)) {
|
|
37
|
-
this.logger?.log(`&C3Repository already exists, pulling latest changes...`);
|
|
38
|
-
await Git.pull(this.folder, { logger: this.logger ?? undefined });
|
|
39
|
-
this.logger?.log(`&C2Pull completed successfully.`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.logger?.log(`&C5Cloning repository from &C6${this.repo}&C5...`);
|
|
43
|
-
await Git.clone(this.repo, this.folder, { tag: this.tag, logger: this.logger ?? undefined });
|
|
44
|
-
this.logger?.log(`&C2Clone completed successfully.`);
|
|
45
|
-
}
|
|
46
|
-
await this.build();
|
|
47
|
-
this.logger?.groupEnd();
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async uninstall() { }
|
|
54
|
-
async build() {
|
|
55
|
-
if (this.builder.length === 0)
|
|
56
|
-
return;
|
|
57
|
-
const builder = new Builder({
|
|
58
|
-
pipeline: this.builder,
|
|
59
|
-
cwd: this.folder,
|
|
60
|
-
logger: this.logger
|
|
61
|
-
});
|
|
62
|
-
await builder.run();
|
|
63
|
-
}
|
|
64
|
-
async resolve() { }
|
|
65
|
-
}
|
|
66
|
-
export default GitDependency;
|
|
67
|
-
//# sourceMappingURL=GitDependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GitDependency.js","sourceRoot":"","sources":["../../../src/support/D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E3C;AAOD,eAAe,aAAa,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Schemas from "../../config/schemas.js";
|
|
2
|
-
import { Dependency } from "./Dependency.js";
|
|
3
|
-
import Logger from "@netfeez/vterm";
|
|
4
|
-
export declare class NpmDependency extends Dependency implements NpmDependency.Dependency {
|
|
5
|
-
readonly flowFolder: string;
|
|
6
|
-
version: string;
|
|
7
|
-
constructor(flowFolder: string, dependency: NpmDependency.Dependency, logger?: Logger | null);
|
|
8
|
-
get folder(): string;
|
|
9
|
-
install(): Promise<void>;
|
|
10
|
-
uninstall(): Promise<void>;
|
|
11
|
-
build(): Promise<void>;
|
|
12
|
-
resolve(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export declare namespace NpmDependency {
|
|
15
|
-
type Resolver = Schemas.ResolverEntry['infer'];
|
|
16
|
-
type Dependency = Schemas.NpmDependency['infer'];
|
|
17
|
-
}
|
|
18
|
-
export default NpmDependency;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Path } from "@netfeez/common-node";
|
|
2
|
-
import Builder from "../Builder/Builder.js";
|
|
3
|
-
import Task from "../Task/Task.js";
|
|
4
|
-
import Utils from "../Utils.js";
|
|
5
|
-
import { Dependency } from "./Dependency.js";
|
|
6
|
-
import Async from "@netfeez/common-node/Async";
|
|
7
|
-
export class NpmDependency extends Dependency {
|
|
8
|
-
flowFolder;
|
|
9
|
-
version;
|
|
10
|
-
constructor(flowFolder, dependency, logger = null) {
|
|
11
|
-
super({
|
|
12
|
-
name: dependency.name,
|
|
13
|
-
builder: dependency.builder,
|
|
14
|
-
resolver: dependency.resolver || []
|
|
15
|
-
}, logger);
|
|
16
|
-
this.flowFolder = flowFolder;
|
|
17
|
-
this.version = dependency.version;
|
|
18
|
-
}
|
|
19
|
-
get folder() {
|
|
20
|
-
let path = Path.join(this.flowFolder, 'node_modules', this.name);
|
|
21
|
-
path = Path.normalize(path);
|
|
22
|
-
return path;
|
|
23
|
-
}
|
|
24
|
-
async install() {
|
|
25
|
-
try {
|
|
26
|
-
this.logger?.group(Utils.newGroup('#00B4FF'));
|
|
27
|
-
this.logger?.log(`&C5Using npm to install &C6${this.name}&C5...`);
|
|
28
|
-
const identifier = `${this.name}@${this.version}`;
|
|
29
|
-
const task = new Task(this.flowFolder, [
|
|
30
|
-
`npm install ${identifier} --prefix ./ --no-save`
|
|
31
|
-
]);
|
|
32
|
-
await Async.awaitEvent((done, fail) => {
|
|
33
|
-
if (this.logger) {
|
|
34
|
-
task.on('line', (data) => this.logger?.log(`&C3${data}`));
|
|
35
|
-
task.on('error', (data) => this.logger?.error(`&C1${data}`));
|
|
36
|
-
}
|
|
37
|
-
task.on('finish', () => {
|
|
38
|
-
this.logger?.log(`&C2Installation of ${this.name} completed successfully.`);
|
|
39
|
-
done();
|
|
40
|
-
});
|
|
41
|
-
task.start().catch(fail);
|
|
42
|
-
return () => { task.stop(); };
|
|
43
|
-
});
|
|
44
|
-
await this.build();
|
|
45
|
-
this.logger?.groupEnd();
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async uninstall() { }
|
|
52
|
-
async build() {
|
|
53
|
-
if (this.builder.length === 0)
|
|
54
|
-
return;
|
|
55
|
-
const builder = new Builder({
|
|
56
|
-
pipeline: this.builder,
|
|
57
|
-
cwd: this.folder,
|
|
58
|
-
logger: this.logger
|
|
59
|
-
});
|
|
60
|
-
await builder.run();
|
|
61
|
-
}
|
|
62
|
-
async resolve() { }
|
|
63
|
-
}
|
|
64
|
-
export default NpmDependency;
|
|
65
|
-
//# sourceMappingURL=NpmDependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NpmDependency.js","sourceRoot":"","sources":["../../../src/support/Dependency/NpmDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,OAAO,MAA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AC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;IACxB,CAAC;IACM,KAAK,CAAC,OAAO,KAAmB,CAAC;CAE3C;AAKD,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../../src/support/Dependency/Resolver.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,QAAQ;CACpB;AAID,eAAe,QAAQ,CAAC"}
|
package/build/support/Git.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import Task from "./Task/Task.js";
|
|
2
|
-
import Logger from "@netfeez/vterm";
|
|
3
|
-
export declare class Git {
|
|
4
|
-
protected path: string;
|
|
5
|
-
protected repo: string;
|
|
6
|
-
protected logger: Logger | null;
|
|
7
|
-
protected cwd: string;
|
|
8
|
-
constructor(path: string, repo: string, options: Git.RepoOptions);
|
|
9
|
-
/**
|
|
10
|
-
* Clones a Git repository from the specified URL to the target path, optionally checking out a specific tag after cloning.
|
|
11
|
-
* The method constructs the necessary commands to perform the clone operation and optionally check out a specified tag, then initiates a Task to execute these commands sequentially.
|
|
12
|
-
* It listens for 'line' events to log standard output and 'error' events to log any errors that occur during command execution, including the step at which the error occurred.
|
|
13
|
-
* Once all commands have been executed,
|
|
14
|
-
* it listens for the 'finish' event to determine the overall success of the operation, logging a summary of the results and resolving or rejecting the promise accordingly based on whether any steps failed.
|
|
15
|
-
* @param repo The URL of the Git repository to clone.
|
|
16
|
-
* @param path The file system path where the repository should be cloned to.
|
|
17
|
-
* @param options An object containing optional parameters for the clone operation, including:
|
|
18
|
-
* - tag: An optional Git tag to check out after cloning the repository.
|
|
19
|
-
* - logger: An optional Logger instance for real-time logging of command output and errors.
|
|
20
|
-
* - cwd: An optional current working directory to execute the commands from, defaulting to the process's current working directory if not provided.
|
|
21
|
-
*/
|
|
22
|
-
static clone(repo: string, path: string, options: Git.RepoOptions): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Performs a 'git pull' operation on the specified repository path, optionally checking out a specific tag after pulling the latest changes.
|
|
25
|
-
* The method constructs the necessary commands to navigate to the repository path, execute the pull operation, and optionally check out a specified tag.
|
|
26
|
-
* It then initiates a Task to execute these commands sequentially, providing real-time logging and error handling through the provided Logger instance.
|
|
27
|
-
* The method listens for 'line' events to log standard output and 'error' events to log any errors that occur during command execution, including the step at which the error occurred.
|
|
28
|
-
* Once all commands have been executed, it listens for the 'finish' event to determine the overall success of the operation, logging a summary of the results and resolving or rejecting the promise accordingly based on whether any steps failed.
|
|
29
|
-
* @param path The file system path to the local Git repository where the pull operation should be performed.
|
|
30
|
-
* @param options An object containing optional parameters for the pull operation, including:
|
|
31
|
-
* - tag: An optional Git tag to check out after pulling the latest changes.
|
|
32
|
-
* - logger: An optional Logger instance for real-time logging of command output and errors.
|
|
33
|
-
* - cwd: An optional current working directory to execute the commands from, defaulting to the process's current working directory if not provided.
|
|
34
|
-
*/
|
|
35
|
-
static pull(path: string, options: Git.RepoOptions): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Executes a series of Git commands as a Task, providing real-time logging and error handling through the provided Logger instance.
|
|
38
|
-
* The method constructs the necessary commands based on the provided repository URL, target path, and optional tag, then initiates a Task to execute these commands sequentially.
|
|
39
|
-
* It listens for 'line' events to log standard output and 'error' events to log any errors that occur during command execution, including the step at which the error occurred.
|
|
40
|
-
* Once all commands have been executed, it listens for the 'finish' event to determine the overall success of the operation, logging a summary of the results and resolving or rejecting the promise accordingly based on whether any steps failed.
|
|
41
|
-
*/
|
|
42
|
-
protected static runTask(commands: string[], options: Git.ShellOptions): Promise<Task.FinishData>;
|
|
43
|
-
}
|
|
44
|
-
export declare namespace Git {
|
|
45
|
-
interface ShellOptions {
|
|
46
|
-
cwd?: string;
|
|
47
|
-
logger?: Logger;
|
|
48
|
-
}
|
|
49
|
-
interface RepoOptions extends ShellOptions {
|
|
50
|
-
tag?: string;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
export default Git;
|