depflow 3.0.0-dev.11 → 3.0.0-dev.12
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 +493 -162
- package/dist/cli/Actions.d.ts +187 -0
- package/dist/cli/Actions.js +793 -0
- package/dist/cli/Actions.js.map +1 -0
- package/dist/cli/CLI.d.ts +15 -2
- package/dist/cli/CLI.js +19 -2
- package/dist/cli/CLI.js.map +1 -1
- package/dist/cli/DepflowCLI.d.ts +62 -0
- package/dist/cli/DepflowCLI.js +229 -0
- package/dist/cli/DepflowCLI.js.map +1 -0
- package/dist/cli/bin.js +27 -32
- package/dist/cli/bin.js.map +1 -1
- package/dist/config/Config.d.ts +1 -1
- package/dist/dependency/DepUtils.d.ts +35 -7
- package/dist/dependency/DepUtils.js +64 -13
- package/dist/dependency/DepUtils.js.map +1 -1
- package/dist/schema/Config/Config.d.ts +1 -1
- package/dist/schema/Config/Dependency.d.ts +3 -3
- package/dist/schema/Config/Dependency.js +3 -3
- package/dist/schema/Config/Dependency.js.map +1 -1
- package/package.json +3 -2
- package/dist/cli/DepFLowCLI.d.ts +0 -93
- package/dist/cli/DepFLowCLI.js +0 -413
- package/dist/cli/DepFLowCLI.js.map +0 -1
|
@@ -5,15 +5,43 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare namespace DepUtils {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* a local path of a repository
|
|
10
|
-
* itself is.
|
|
8
|
+
* A repository in the canonical form `git clone` accepts: a remote over one of the transports it
|
|
9
|
+
* speaks, or a local path of a repository, always ending in `.git`. The name of a dependency is
|
|
10
|
+
* never derived from it, only the repo itself is.
|
|
11
11
|
*
|
|
12
12
|
* @remarks Every transport is spelled out so the accepted shapes are readable, but the `.git`
|
|
13
13
|
* suffix is what all of them share and what {@link DepUtils.repo} enforces, so the last member is
|
|
14
14
|
* the one that decides.
|
|
15
15
|
*/
|
|
16
16
|
type Repo = `https://${string}.git` | `http://${string}.git` | `ssh://${string}.git` | `git://${string}.git` | `file://${string}.git` | `git@${string}.git` | `${string}.git`;
|
|
17
|
+
/**
|
|
18
|
+
* What a repository reference resolves to: the URL `git clone` is given and the name GitHub
|
|
19
|
+
* derives from it.
|
|
20
|
+
*/
|
|
21
|
+
interface Reference {
|
|
22
|
+
/** The repository, canonical: a value {@link DepUtils.Repo} accepts whatever form it came in. */
|
|
23
|
+
repo: Repo;
|
|
24
|
+
/** The `<user>/<name>` GitHub derives, or `null` when the reference is not a GitHub one. **/
|
|
25
|
+
name: string | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parses a repository reference into the repository git clones from and the name GitHub derives.
|
|
29
|
+
*
|
|
30
|
+
* A GitHub repository may be written as the bare `user/repo` shorthand, as an HTTP(S) URL or as an
|
|
31
|
+
* SCP like ssh address, with or without the `.git` suffix; every one of them is canonicalized to
|
|
32
|
+
* the same repository. Any other repository is accepted as it stands when it is a value
|
|
33
|
+
* {@link DepUtils.Repo} accepts, and carries no derivable name.
|
|
34
|
+
* @param reference - The repository reference as a user writes it.
|
|
35
|
+
* @returns The canonical repository and the derived name, `null` when there is none.
|
|
36
|
+
* @throws { Error } When the reference is not a clonable repository.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* DepUtils.parse('netfeez/omega');
|
|
41
|
+
* // { repo: 'https://github.com/netfeez/omega.git', name: 'netfeez/omega' }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
function parse(reference: string): Reference;
|
|
17
45
|
/**
|
|
18
46
|
* Validates that the provided value is a repository `git clone` accepts, and says what it is not when
|
|
19
47
|
* it does not: a URL with its scheme, an SCP like address or a local path of a repository.
|
|
@@ -31,18 +59,18 @@ export declare namespace DepUtils {
|
|
|
31
59
|
*/
|
|
32
60
|
function repo(repo: unknown): asserts repo is Repo;
|
|
33
61
|
/**
|
|
34
|
-
* Extracts the name a dependency is known by from its repository
|
|
62
|
+
* Extracts the name a dependency is known by from its repository reference.
|
|
35
63
|
*
|
|
36
64
|
* Only a GitHub repository has a name that can be derived without asking, and the name it derives
|
|
37
65
|
* is the one the alias of the dependency takes everywhere else, so it is derived here and nowhere
|
|
38
66
|
* else.
|
|
39
|
-
* @param repo - The repository
|
|
40
|
-
* @returns The repository name, as `<user
|
|
67
|
+
* @param repo - The repository reference, in any of the forms {@link DepUtils.parse} accepts.
|
|
68
|
+
* @returns The repository name, as `<user>/<name>`.
|
|
41
69
|
* @throws { Error } When the repository is not a GitHub one, saying the name has to be given.
|
|
42
70
|
*
|
|
43
71
|
* @example
|
|
44
72
|
* ```ts
|
|
45
|
-
* DepUtils.getRepoName('https://github.com/NetFeez/omega.git'); // 'NetFeez
|
|
73
|
+
* DepUtils.getRepoName('https://github.com/NetFeez/omega.git'); // 'NetFeez/omega'
|
|
46
74
|
* ```
|
|
47
75
|
*/
|
|
48
76
|
function getRepoName(repo: string): string;
|
|
@@ -11,14 +11,68 @@ export var DepUtils;
|
|
|
11
11
|
*/
|
|
12
12
|
const CLONEABLE_REGEX = /^(?:(?:https?|ssh|git|file):\/\/|git@)\S+$|\S*\.git$/;
|
|
13
13
|
/**
|
|
14
|
-
* Matches a
|
|
14
|
+
* Matches a GitHub repository over HTTP, with or without the `.git` suffix, and captures its user
|
|
15
|
+
* and name.
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const GITHUB_HTTP_REGEX = /^(https?):\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/;
|
|
18
|
+
/**
|
|
19
|
+
* Matches a GitHub repository over SSH in the SCP like form, with or without the `.git` suffix and
|
|
20
|
+
* tolerating the stray slash some clients write after the colon (`git@github.com:/user/repo`).
|
|
21
|
+
*/
|
|
22
|
+
const GITHUB_SSH_REGEX = /^git@github\.com:?\/?([^/]+)\/([^/]+?)(?:\.git)?$/;
|
|
23
|
+
/**
|
|
24
|
+
* Matches the bare `user/repo` shorthand GitHub itself accepts, without a scheme and with or
|
|
25
|
+
* without the `.git` suffix.
|
|
26
|
+
*/
|
|
27
|
+
const GITHUB_SHORT_REGEX = /^([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?$/;
|
|
17
28
|
/**
|
|
18
29
|
* The suffix that tells a repository from anything else, checked on the value as a whole instead of
|
|
19
30
|
* anchoring it, so a local path of a repository keeps validating wherever it lives.
|
|
20
31
|
*/
|
|
21
32
|
const GIT_SUFFIX_REGEX = /\.git$/;
|
|
33
|
+
/**
|
|
34
|
+
* The failure every rejected reference is reported with, so a caller sees what was expected of it.
|
|
35
|
+
* @param reference - The value that was refused.
|
|
36
|
+
* @returns The error describing what a repository reference may be.
|
|
37
|
+
**/
|
|
38
|
+
function notClonable(reference) {
|
|
39
|
+
return new Error(`Not a clonable git repository: "${reference}". Pass a user/repo pair, a repository ending in .git, a URL git can clone, an ssh address or a local path of a repository.`);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parses a repository reference into the repository git clones from and the name GitHub derives.
|
|
43
|
+
*
|
|
44
|
+
* A GitHub repository may be written as the bare `user/repo` shorthand, as an HTTP(S) URL or as an
|
|
45
|
+
* SCP like ssh address, with or without the `.git` suffix; every one of them is canonicalized to
|
|
46
|
+
* the same repository. Any other repository is accepted as it stands when it is a value
|
|
47
|
+
* {@link DepUtils.Repo} accepts, and carries no derivable name.
|
|
48
|
+
* @param reference - The repository reference as a user writes it.
|
|
49
|
+
* @returns The canonical repository and the derived name, `null` when there is none.
|
|
50
|
+
* @throws { Error } When the reference is not a clonable repository.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* DepUtils.parse('netfeez/omega');
|
|
55
|
+
* // { repo: 'https://github.com/netfeez/omega.git', name: 'netfeez/omega' }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
function parse(reference) {
|
|
59
|
+
if (typeof reference !== 'string' || !reference.trim())
|
|
60
|
+
throw notClonable(reference);
|
|
61
|
+
const value = reference.trim();
|
|
62
|
+
const http = value.match(GITHUB_HTTP_REGEX);
|
|
63
|
+
if (http)
|
|
64
|
+
return { repo: `${http[1]}://github.com/${http[2]}/${http[3]}.git`, name: `${http[2]}/${http[3]}` };
|
|
65
|
+
const ssh = value.match(GITHUB_SSH_REGEX);
|
|
66
|
+
if (ssh)
|
|
67
|
+
return { repo: `git@github.com:${ssh[1]}/${ssh[2]}.git`, name: `${ssh[1]}/${ssh[2]}` };
|
|
68
|
+
const short = value.match(GITHUB_SHORT_REGEX);
|
|
69
|
+
if (short)
|
|
70
|
+
return { repo: `https://github.com/${short[1]}/${short[2]}.git`, name: `${short[1]}/${short[2]}` };
|
|
71
|
+
if (!CLONEABLE_REGEX.test(value) || !GIT_SUFFIX_REGEX.test(value))
|
|
72
|
+
throw notClonable(value);
|
|
73
|
+
return { repo: value, name: null };
|
|
74
|
+
}
|
|
75
|
+
DepUtils.parse = parse;
|
|
22
76
|
/**
|
|
23
77
|
* Validates that the provided value is a repository `git clone` accepts, and says what it is not when
|
|
24
78
|
* it does not: a URL with its scheme, an SCP like address or a local path of a repository.
|
|
@@ -42,28 +96,25 @@ export var DepUtils;
|
|
|
42
96
|
}
|
|
43
97
|
DepUtils.repo = repo;
|
|
44
98
|
/**
|
|
45
|
-
* Extracts the name a dependency is known by from its repository
|
|
99
|
+
* Extracts the name a dependency is known by from its repository reference.
|
|
46
100
|
*
|
|
47
101
|
* Only a GitHub repository has a name that can be derived without asking, and the name it derives
|
|
48
102
|
* is the one the alias of the dependency takes everywhere else, so it is derived here and nowhere
|
|
49
103
|
* else.
|
|
50
|
-
* @param repo - The repository
|
|
51
|
-
* @returns The repository name, as `<user
|
|
104
|
+
* @param repo - The repository reference, in any of the forms {@link DepUtils.parse} accepts.
|
|
105
|
+
* @returns The repository name, as `<user>/<name>`.
|
|
52
106
|
* @throws { Error } When the repository is not a GitHub one, saying the name has to be given.
|
|
53
107
|
*
|
|
54
108
|
* @example
|
|
55
109
|
* ```ts
|
|
56
|
-
* DepUtils.getRepoName('https://github.com/NetFeez/omega.git'); // 'NetFeez
|
|
110
|
+
* DepUtils.getRepoName('https://github.com/NetFeez/omega.git'); // 'NetFeez/omega'
|
|
57
111
|
* ```
|
|
58
112
|
*/
|
|
59
113
|
function getRepoName(repo) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return `${user}.${repoName}`;
|
|
65
|
-
}
|
|
66
|
-
throw new Error(`Cannot derive a name from "${repo}": only GitHub repositories are named automatically, pass the name yourself.`);
|
|
114
|
+
const { name } = parse(repo);
|
|
115
|
+
if (!name)
|
|
116
|
+
throw new Error(`Cannot derive a name from "${repo}": only GitHub repositories are named automatically, pass the name yourself.`);
|
|
117
|
+
return name;
|
|
67
118
|
}
|
|
68
119
|
DepUtils.getRepoName = getRepoName;
|
|
69
120
|
})(DepUtils || (DepUtils = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepUtils.js","sourceRoot":"","sources":["../../src/dependency/DepUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,KAAW,QAAQ,
|
|
1
|
+
{"version":3,"file":"DepUtils.js","sourceRoot":"","sources":["../../src/dependency/DepUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,KAAW,QAAQ,CAgJxB;AAhJD,WAAiB,QAAQ;IA+BrB;;;OAGG;IACH,MAAM,eAAe,GAAG,sDAAsD,CAAC;IAE/E;;;OAGG;IACH,MAAM,iBAAiB,GAAG,4DAA4D,CAAC;IAEvF;;;OAGG;IACH,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;IAE7E;;;OAGG;IACH,MAAM,kBAAkB,GAAG,yEAAyE,CAAC;IAErG;;;OAGG;IACH,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IAElC;;;;QAII;IACJ,SAAS,WAAW,CAAC,SAAkB;QACnC,OAAO,IAA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I,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5F,OAAO,EAAE,IAAI,EAAE,KAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAfe,SAAA,KAAK,QAepB,CAAA;IAED;;;;;;;;;;;;;;OAcG;IACH,SAAgB,IAAI,CAAC,IAAa;QAC9B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,CAAC,CAAC;QAC3G,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,2GAA2G,CAAC,CAAC;IAChP,CAAC;IAHe,SAAA,IAAI,OAGnB,CAAA;IAED;;;;;;;;;;;;;;OAcG;IACH,SAAgB,WAAW,CAAC,IAAY;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,8EAA8E,CAAC,CAAC;QAC7I,OAAO,IAAI,CAAC;IAChB,CAAC;IAJe,SAAA,WAAW,cAI1B,CAAA;AACL,CAAC,EAhJgB,QAAQ,KAAR,QAAQ,QAgJxB;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -239,7 +239,7 @@ export declare const Config: Schema<{
|
|
|
239
239
|
readonly type: "string";
|
|
240
240
|
readonly required: true;
|
|
241
241
|
readonly pattern: RegExp;
|
|
242
|
-
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not
|
|
242
|
+
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not an arbitrary path: a `<user>/<repo>` pair or a single alphanumeric segment.";
|
|
243
243
|
};
|
|
244
244
|
readonly repo: {
|
|
245
245
|
readonly type: "string";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import Schema from '@netfeez/schema';
|
|
7
7
|
export declare namespace DependencyName {
|
|
8
|
-
/** A single
|
|
8
|
+
/** A `user/repo` identity or a single segment: the identity of a git source, also the name of its checkout folder. */
|
|
9
9
|
const GIT: RegExp;
|
|
10
10
|
/** A package name, optionally scoped: the identity of an npm source. */
|
|
11
11
|
const NPM: RegExp;
|
|
@@ -18,7 +18,7 @@ export declare const GitDependency: Schema<{
|
|
|
18
18
|
readonly type: "string";
|
|
19
19
|
readonly required: true;
|
|
20
20
|
readonly pattern: RegExp;
|
|
21
|
-
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not
|
|
21
|
+
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not an arbitrary path: a `<user>/<repo>` pair or a single alphanumeric segment.";
|
|
22
22
|
};
|
|
23
23
|
readonly repo: {
|
|
24
24
|
readonly type: "string";
|
|
@@ -450,7 +450,7 @@ export declare const Dependency: {
|
|
|
450
450
|
readonly type: "string";
|
|
451
451
|
readonly required: true;
|
|
452
452
|
readonly pattern: RegExp;
|
|
453
|
-
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not
|
|
453
|
+
readonly description: "Unique name used to reference the dependency in flows and path aliases. It is an identity, not an arbitrary path: a `<user>/<repo>` pair or a single alphanumeric segment.";
|
|
454
454
|
};
|
|
455
455
|
readonly repo: {
|
|
456
456
|
readonly type: "string";
|
|
@@ -13,8 +13,8 @@ export var DependencyName;
|
|
|
13
13
|
* The identities the flow folder reserves for itself, declared once so no source can claim them.
|
|
14
14
|
*/
|
|
15
15
|
const RESERVED = 'schema\\.json|node_modules';
|
|
16
|
-
/** A single
|
|
17
|
-
DependencyName.GIT = new RegExp(`^(?!(
|
|
16
|
+
/** A `user/repo` identity or a single segment: the identity of a git source, also the name of its checkout folder. */
|
|
17
|
+
DependencyName.GIT = new RegExp(`^(?!(?:${RESERVED})(?:/|$))[A-Za-z0-9][A-Za-z0-9._-]*(?:/[A-Za-z0-9][A-Za-z0-9._-]*)?$`);
|
|
18
18
|
/** A package name, optionally scoped: the identity of an npm source. */
|
|
19
19
|
DependencyName.NPM = new RegExp(`^(?!(${RESERVED})$)@?[A-Za-z0-9][A-Za-z0-9._~-]*(/[A-Za-z0-9][A-Za-z0-9._~-]*)?$`);
|
|
20
20
|
})(DependencyName || (DependencyName = {}));
|
|
@@ -25,7 +25,7 @@ export const GitDependency = new Schema({
|
|
|
25
25
|
type: 'string',
|
|
26
26
|
required: true,
|
|
27
27
|
pattern: DependencyName.GIT,
|
|
28
|
-
description: 'Unique name used to reference the dependency in flows and path aliases. It is an identity, not
|
|
28
|
+
description: 'Unique name used to reference the dependency in flows and path aliases. It is an identity, not an arbitrary path: a `<user>/<repo>` pair or a single alphanumeric segment.'
|
|
29
29
|
},
|
|
30
30
|
repo: {
|
|
31
31
|
type: 'string',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/schema/Config/Dependency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,MAAM,KAAW,cAAc,CAa9B;AAbD,WAAiB,cAAc;IAE3B;;OAEG;IACH,MAAM,QAAQ,GAAG,4BAA4B,CAAC;IAE9C,
|
|
1
|
+
{"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/schema/Config/Dependency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM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ACF,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,cAAc,CAAC,GAAG;YAC3B,WAAW,EAAE,iDAAiD;SACjE;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iDAAiD;SACjE;QACD,OAAO,EAAE;YACL,GAAG,OAAO,CAAC,UAAU;YACrB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC1C,WAAW,EAAE,sDAAsD;SACtE;QACD,QAAQ,EAAE;YACN,GAAG,QAAQ,CAAC,UAAU;YACtB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3C,WAAW,EAAE,yDAAyD;SACzE;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAK3D,eAAe,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "depflow",
|
|
3
3
|
"description": "is a simple dependency manager based on github repositories",
|
|
4
|
-
"version": "3.0.0-dev.
|
|
4
|
+
"version": "3.0.0-dev.12",
|
|
5
5
|
"main": "dist/cli/bin.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"dep": "dist/cli/bin.js"
|
|
8
|
+
"dep": "dist/cli/bin.js",
|
|
9
|
+
"depflow": "dist/cli/bin.js"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
12
|
"clean": "node ./scripts/clean.mjs",
|
package/dist/cli/DepFLowCLI.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author NetFeez <netfeez.dev@gmail.com>.
|
|
3
|
-
* @description Main CLI surface: dependency management commands, builds and config conversions.
|
|
4
|
-
* @license Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import CLI from "./CLI.js";
|
|
7
|
-
import OutputPolicy from "../task/OutputPolicy.js";
|
|
8
|
-
import Flags from "./Flags.js";
|
|
9
|
-
/** The flags accepted by every command of the CLI. **/
|
|
10
|
-
export declare const options: Flags<{
|
|
11
|
-
readonly flow: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly default: "depflow.yml";
|
|
14
|
-
readonly aliases: readonly ["p", "f"];
|
|
15
|
-
readonly description: "Path to the configuration file the command operates on.";
|
|
16
|
-
};
|
|
17
|
-
readonly watch: {
|
|
18
|
-
readonly type: "boolean";
|
|
19
|
-
readonly default: false;
|
|
20
|
-
readonly aliases: readonly ["w"];
|
|
21
|
-
readonly description: "Keeps watching the built files and rewrites their paths on every change.";
|
|
22
|
-
};
|
|
23
|
-
readonly cdn: {
|
|
24
|
-
readonly type: "boolean";
|
|
25
|
-
readonly default: false;
|
|
26
|
-
readonly description: "Resolves the dependency paths to their CDN target instead of their local one.";
|
|
27
|
-
};
|
|
28
|
-
readonly verbose: {
|
|
29
|
-
readonly type: "boolean";
|
|
30
|
-
readonly default: false;
|
|
31
|
-
readonly aliases: readonly ["v"];
|
|
32
|
-
readonly description: "Streams the output of every command as it runs, attributed to the command that wrote it, instead of only reporting how each of them ended. The indentation of that output is lost, and the complete buffer of every command reaches the evidence file whether this flag is given or not.";
|
|
33
|
-
};
|
|
34
|
-
readonly silent: {
|
|
35
|
-
readonly type: "boolean";
|
|
36
|
-
readonly default: false;
|
|
37
|
-
readonly description: "Says only what failed, one line per failed command. It silences the progress of DepFlow itself, such as \"Installing dependencies...\", and not the help, which belongs to the console interface. The exit status and the evidence file are the same as in any other mode.";
|
|
38
|
-
};
|
|
39
|
-
readonly decorate: {
|
|
40
|
-
readonly type: "boolean";
|
|
41
|
-
readonly default: true;
|
|
42
|
-
readonly description: "Draws boxes, indentation, timestamps, levels and names around what is reported. --decorate=false leaves the content alone and keeps the color of the markers and the diagnostics, which carry information and are not decoration.";
|
|
43
|
-
};
|
|
44
|
-
}>;
|
|
45
|
-
export declare class DepFlowCLI extends CLI {
|
|
46
|
-
readonly configPath: string;
|
|
47
|
-
protected readonly projectRoot: string;
|
|
48
|
-
constructor(configPath?: string);
|
|
49
|
-
/** Absolute path of the flow directory (`.depflow`) under the project root. **/
|
|
50
|
-
protected get flowDirectory(): string;
|
|
51
|
-
/**
|
|
52
|
-
* The policy the run is presented through, built for the mode the flags asked for.
|
|
53
|
-
* @param flags - The flags of the command being run.
|
|
54
|
-
* @returns The policy of the run, never `null`: the evidence is written whether it is asked for or not.
|
|
55
|
-
*
|
|
56
|
-
* @remarks The policy is also what settles the channel the lifecycle of the CLI is reported through, so
|
|
57
|
-
* every command asks for it first and reports through `policy.report`: a `silent` run that said
|
|
58
|
-
* "Installing dependencies..." would not be silent, and an undecorated run would still draw boxes
|
|
59
|
-
* around lines that carry nothing but what they say.
|
|
60
|
-
*
|
|
61
|
-
* @remarks A command reports through the policy and not through `this.out`, which belongs to the
|
|
62
|
-
* console interface DepFlow was built on: the help, the prompt and the verdict of an invocation are
|
|
63
|
-
* drawn by surfaces DepFlow does not own, and they stay visible in every mode.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* const policy = this.policy(flags);
|
|
68
|
-
* const out = policy.report;
|
|
69
|
-
* if (policy.decoration === 'on') out.group(Group.create('#FFB4DC'));
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
protected policy(flags: DepFlowCLI.Options): OutputPolicy;
|
|
73
|
-
commandAdd(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
74
|
-
commandRemove(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
75
|
-
commandInstall(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
76
|
-
commandRun(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
77
|
-
list(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
78
|
-
rewritePaths(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
79
|
-
commandSync(command: string, args: string[], flags?: DepFlowCLI.Options, caller?: OutputPolicy): Promise<void>;
|
|
80
|
-
/**
|
|
81
|
-
* Converts the depflow config file between JSON and YAML.
|
|
82
|
-
* @param command - The invoked command name ('json-to-yaml' or 'yaml-to-json').
|
|
83
|
-
* @param args - Optional output file path.
|
|
84
|
-
* @param flags - The flags of the command being run, which settle how the conversion is reported.
|
|
85
|
-
*/
|
|
86
|
-
convert(command: string, args: string[], flags?: DepFlowCLI.Options): Promise<void>;
|
|
87
|
-
}
|
|
88
|
-
export declare namespace DepFlowCLI {
|
|
89
|
-
type Exec = (this: DepFlowCLI, command: string, args: string[], flags: Options) => Promise<void> | void;
|
|
90
|
-
/** The values of the flags accepted by the CLI. **/
|
|
91
|
-
type Options = typeof options.infer;
|
|
92
|
-
}
|
|
93
|
-
export default DepFlowCLI;
|