@g3nomaly/core 0.3.1 → 0.3.3
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 +122 -0
- package/dist/cli/commands/add.d.ts +24 -4
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +37 -14
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/conflict.d.ts +52 -0
- package/dist/cli/commands/conflict.d.ts.map +1 -0
- package/dist/cli/commands/conflict.js +88 -0
- package/dist/cli/commands/conflict.js.map +1 -0
- package/dist/cli/commands/installFromSources.d.ts +42 -13
- package/dist/cli/commands/installFromSources.d.ts.map +1 -1
- package/dist/cli/commands/installFromSources.js +68 -19
- package/dist/cli/commands/installFromSources.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +13 -3
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +26 -6
- package/dist/cli/commands/ls.js.map +1 -1
- package/dist/cli/commands/remove.d.ts +7 -1
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +15 -1
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/sources.d.ts +34 -10
- package/dist/cli/commands/sources.d.ts.map +1 -1
- package/dist/cli/commands/sources.js +17 -3
- package/dist/cli/commands/sources.js.map +1 -1
- package/dist/cli/commands/update.d.ts +11 -4
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +32 -14
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/dialogue.d.ts +65 -13
- package/dist/cli/dialogue.d.ts.map +1 -1
- package/dist/cli/dialogue.js +46 -7
- package/dist/cli/dialogue.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/installDialogues.d.ts +11 -3
- package/dist/cli/installDialogues.d.ts.map +1 -1
- package/dist/cli/installDialogues.js +22 -5
- package/dist/cli/installDialogues.js.map +1 -1
- package/dist/cli/pick.d.ts +11 -2
- package/dist/cli/pick.d.ts.map +1 -1
- package/dist/cli/pick.js +11 -2
- package/dist/cli/pick.js.map +1 -1
- package/dist/cli/report.d.ts +32 -8
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +26 -5
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/theme.d.ts +4 -0
- package/dist/cli/theme.d.ts.map +1 -1
- package/dist/cli/theme.js +4 -0
- package/dist/cli/theme.js.map +1 -1
- package/dist/cli/types.d.ts +56 -5
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/config/config.d.ts +32 -7
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +37 -7
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +58 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +0 -10
- package/dist/config/types.js.map +1 -1
- package/dist/hash/hash.d.ts +6 -8
- package/dist/hash/hash.d.ts.map +1 -1
- package/dist/hash/hash.js +7 -8
- package/dist/hash/hash.js.map +1 -1
- package/dist/hash/index.d.ts.map +1 -1
- package/dist/hash/index.js +1 -0
- package/dist/hash/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/installer/classify.d.ts +27 -1
- package/dist/installer/classify.d.ts.map +1 -1
- package/dist/installer/classify.js +36 -1
- package/dist/installer/classify.js.map +1 -1
- package/dist/installer/files.d.ts +10 -6
- package/dist/installer/files.d.ts.map +1 -1
- package/dist/installer/files.js +4 -3
- package/dist/installer/files.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +1 -1
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/install.d.ts +18 -6
- package/dist/installer/install.d.ts.map +1 -1
- package/dist/installer/install.js +20 -7
- package/dist/installer/install.js.map +1 -1
- package/dist/installer/io.d.ts +6 -1
- package/dist/installer/io.d.ts.map +1 -1
- package/dist/installer/io.js +6 -1
- package/dist/installer/io.js.map +1 -1
- package/dist/installer/manifest.d.ts +29 -19
- package/dist/installer/manifest.d.ts.map +1 -1
- package/dist/installer/manifest.js +20 -10
- package/dist/installer/manifest.js.map +1 -1
- package/dist/installer/manifestSources.d.ts +18 -7
- package/dist/installer/manifestSources.d.ts.map +1 -1
- package/dist/installer/manifestSources.js +18 -7
- package/dist/installer/manifestSources.js.map +1 -1
- package/dist/installer/marketplace.d.ts +24 -12
- package/dist/installer/marketplace.d.ts.map +1 -1
- package/dist/installer/marketplace.js +18 -10
- package/dist/installer/marketplace.js.map +1 -1
- package/dist/installer/origin.d.ts +23 -7
- package/dist/installer/origin.d.ts.map +1 -1
- package/dist/installer/origin.js +14 -7
- package/dist/installer/origin.js.map +1 -1
- package/dist/installer/remove.d.ts +17 -5
- package/dist/installer/remove.d.ts.map +1 -1
- package/dist/installer/remove.js +17 -5
- package/dist/installer/remove.js.map +1 -1
- package/dist/installer/resolve.d.ts +80 -31
- package/dist/installer/resolve.d.ts.map +1 -1
- package/dist/installer/resolve.js +96 -29
- package/dist/installer/resolve.js.map +1 -1
- package/dist/installer/sourceRegistry.d.ts +59 -22
- package/dist/installer/sourceRegistry.d.ts.map +1 -1
- package/dist/installer/sourceRegistry.js +25 -10
- package/dist/installer/sourceRegistry.js.map +1 -1
- package/dist/installer/types.d.ts +72 -19
- package/dist/installer/types.d.ts.map +1 -1
- package/dist/installer/types.js +18 -8
- package/dist/installer/types.js.map +1 -1
- package/dist/registry/index.d.ts +0 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -4
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/registry.handlers.d.ts +7 -0
- package/dist/registry/registry.handlers.d.ts.map +1 -1
- package/dist/registry/registry.handlers.js.map +1 -1
- package/dist/registry/registry.io.d.ts +23 -7
- package/dist/registry/registry.io.d.ts.map +1 -1
- package/dist/registry/registry.io.js +37 -14
- package/dist/registry/registry.io.js.map +1 -1
- package/dist/registry/registry.mutations.d.ts +10 -3
- package/dist/registry/registry.mutations.d.ts.map +1 -1
- package/dist/registry/registry.mutations.js +10 -3
- package/dist/registry/registry.mutations.js.map +1 -1
- package/dist/registry/registry.selectors.d.ts +41 -11
- package/dist/registry/registry.selectors.d.ts.map +1 -1
- package/dist/registry/registry.selectors.js +41 -11
- package/dist/registry/registry.selectors.js.map +1 -1
- package/dist/registry/registry.store.d.ts +22 -9
- package/dist/registry/registry.store.d.ts.map +1 -1
- package/dist/registry/registry.store.js +12 -3
- package/dist/registry/registry.store.js.map +1 -1
- package/dist/registry/registry.template.d.ts +12 -6
- package/dist/registry/registry.template.d.ts.map +1 -1
- package/dist/registry/registry.template.js +13 -6
- package/dist/registry/registry.template.js.map +1 -1
- package/dist/registry/types.d.ts +17 -3
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +16 -6
- package/dist/registry/types.js.map +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +1 -0
- package/dist/security/index.js.map +1 -1
- package/dist/security/securityParser.d.ts +9 -8
- package/dist/security/securityParser.d.ts.map +1 -1
- package/dist/security/securityParser.js +12 -22
- package/dist/security/securityParser.js.map +1 -1
- package/dist/security/securityWorker.d.ts +11 -0
- package/dist/security/securityWorker.d.ts.map +1 -1
- package/dist/security/securityWorker.js +17 -38
- package/dist/security/securityWorker.js.map +1 -1
- package/dist/sources/checkout.d.ts +10 -4
- package/dist/sources/checkout.d.ts.map +1 -1
- package/dist/sources/checkout.js +10 -4
- package/dist/sources/checkout.js.map +1 -1
- package/dist/sources/git.d.ts +5 -3
- package/dist/sources/git.d.ts.map +1 -1
- package/dist/sources/git.js +5 -3
- package/dist/sources/git.js.map +1 -1
- package/dist/sources/local.d.ts +6 -4
- package/dist/sources/local.d.ts.map +1 -1
- package/dist/sources/local.js +6 -4
- package/dist/sources/local.js.map +1 -1
- package/dist/sources/npm.d.ts +10 -7
- package/dist/sources/npm.d.ts.map +1 -1
- package/dist/sources/npm.js +49 -15
- package/dist/sources/npm.js.map +1 -1
- package/dist/sources/parse.d.ts +24 -16
- package/dist/sources/parse.d.ts.map +1 -1
- package/dist/sources/parse.js +40 -18
- package/dist/sources/parse.js.map +1 -1
- package/dist/sources/process.d.ts +10 -7
- package/dist/sources/process.d.ts.map +1 -1
- package/dist/sources/process.js +10 -7
- package/dist/sources/process.js.map +1 -1
- package/dist/sources/register.d.ts +20 -5
- package/dist/sources/register.d.ts.map +1 -1
- package/dist/sources/register.js +20 -5
- package/dist/sources/register.js.map +1 -1
- package/dist/sources/types.d.ts +43 -8
- package/dist/sources/types.d.ts.map +1 -1
- package/dist/sources/types.js +21 -4
- package/dist/sources/types.js.map +1 -1
- package/dist/utils/errors.d.ts +6 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +6 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/merge.d.ts +8 -2
- package/dist/utils/merge.d.ts.map +1 -1
- package/dist/utils/merge.js +9 -2
- package/dist/utils/merge.js.map +1 -1
- package/dist/utils/packageMeta.d.ts +16 -2
- package/dist/utils/packageMeta.d.ts.map +1 -1
- package/dist/utils/packageMeta.js +6 -2
- package/dist/utils/packageMeta.js.map +1 -1
- package/dist/utils/paths.d.ts +16 -5
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +16 -5
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/prompt.d.ts +6 -1
- package/dist/utils/prompt.d.ts.map +1 -1
- package/dist/utils/prompt.js +6 -1
- package/dist/utils/prompt.js.map +1 -1
- package/dist/utils/version.d.ts +7 -2
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +40 -3
- package/dist/utils/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,75 +1,124 @@
|
|
|
1
1
|
import type { OriginEntry } from "./origin";
|
|
2
2
|
import type { SourceOffer } from "./sourceRegistry";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @brief An entry or group as named on the command line or in `registryDependencies`.
|
|
5
|
+
*
|
|
6
|
+
* @property name - Entry key or group name, lowercased, e.g. `emphasise`.
|
|
7
|
+
* @property source - Registered source the name must come from, e.g. `g3n-skills`, when given as `<name>@<source>`. Absent when not given.
|
|
8
|
+
*/
|
|
4
9
|
export interface EntryRequest {
|
|
5
10
|
name: string;
|
|
6
|
-
/** Registered source the name must come from, when given as `<name>@<source>` */
|
|
7
11
|
source?: string;
|
|
8
12
|
}
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @brief Entries a set of requests resolved to, and what could not be resolved.
|
|
15
|
+
*
|
|
16
|
+
* @property entries - Resolved entries by key, `registryDependencies` rewritten to the resolved keys.
|
|
17
|
+
* @property unknown - Requests and dependencies no source offers, e.g. `ghost` or `ghost@mine`.
|
|
18
|
+
* @property ambiguous - One message per name more than one source offers, naming the qualified forms to pick from.
|
|
19
|
+
* @property notes - Why an entry nobody named is in the set, e.g. `{ vocabulary: "dep of plan" }`.
|
|
20
|
+
*/
|
|
10
21
|
export interface Resolution<T extends OriginEntry> {
|
|
11
|
-
/** Resolved entries by key, `registryDependencies` rewritten to the resolved keys */
|
|
12
22
|
entries: Map<string, SourceOffer<T>>;
|
|
13
|
-
/** Requests and dependencies no source offers, e.g. `ghost` or `ghost@mine` */
|
|
14
23
|
unknown: string[];
|
|
15
|
-
/** One message per name more than one source offers, naming the qualified forms to pick from */
|
|
16
24
|
ambiguous: string[];
|
|
17
|
-
/** Why an entry nobody named is in the set, e.g. `{ vocabulary: "dep of plan" }` */
|
|
18
25
|
notes: Record<string, string>;
|
|
19
26
|
}
|
|
20
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @brief One entry with its dependencies resolved across sources.
|
|
29
|
+
*
|
|
30
|
+
* @property offer - The entry with `registryDependencies` rewritten to the resolved keys.
|
|
31
|
+
* @property dependencies - Offers of the dependencies found, in the order declared.
|
|
32
|
+
* @property unknown - Dependencies no source offers, e.g. `ghost (dep of plan)`.
|
|
33
|
+
* @property ambiguous - One message per dependency more than one source offers.
|
|
34
|
+
*/
|
|
21
35
|
export interface ResolvedDependencies<T extends OriginEntry> {
|
|
22
|
-
/** The entry with `registryDependencies` rewritten to the resolved keys */
|
|
23
36
|
offer: SourceOffer<T>;
|
|
24
37
|
dependencies: SourceOffer<T>[];
|
|
25
|
-
/** Dependencies no source offers, e.g. `ghost (dep of plan)` */
|
|
26
38
|
unknown: string[];
|
|
27
39
|
ambiguous: string[];
|
|
28
40
|
}
|
|
29
41
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
42
|
+
* @brief Parses a typed request such as `emphasise` or `emphasise@g3n-skills`.
|
|
43
|
+
*
|
|
44
|
+
* Names are matched in lowercase. A leading `@` belongs to the name, as in
|
|
45
|
+
* `@shadcn/button@shadcn`, so the source starts at the first `@` after the first character.
|
|
46
|
+
*
|
|
47
|
+
* @param token - Word as typed on the command line, e.g. `emphasise@g3n-skills`.
|
|
48
|
+
* @returns Request with the lowercased name, and the source when one is given.
|
|
32
49
|
*/
|
|
33
50
|
export declare function parseRequest(token: string): EntryRequest;
|
|
34
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @brief Formats a request as it is typed, e.g. `emphasise@g3n-skills`.
|
|
53
|
+
*
|
|
54
|
+
* @param request - Parsed request, e.g. `{ name: "emphasise", source: "g3n-skills" }`.
|
|
55
|
+
*/
|
|
35
56
|
export declare function formatRequest(request: EntryRequest): string;
|
|
36
57
|
/**
|
|
37
|
-
* Resolves the `registryDependencies` of one entry against every offer.
|
|
38
|
-
*
|
|
58
|
+
* @brief Resolves the `registryDependencies` of one entry against every offer.
|
|
59
|
+
*
|
|
60
|
+
* A dependency that cannot be resolved keeps its bare name in the rewritten
|
|
39
61
|
* list and is reported in `unknown` or `ambiguous`.
|
|
40
62
|
*
|
|
41
|
-
* @param
|
|
63
|
+
* @param offer - Offer whose dependencies are resolved.
|
|
64
|
+
* @param offers - Every offer to resolve against, across all sources.
|
|
65
|
+
* @param preferred - Source to take a key from when several offer it: where it is installed, or where the request named it.
|
|
66
|
+
* @returns The offer with rewritten dependencies, the dependency offers found, and the ones that did not resolve.
|
|
42
67
|
*/
|
|
43
68
|
export declare function resolveDependencies<T extends OriginEntry>(offer: SourceOffer<T>, offers: readonly SourceOffer<T>[], preferred?: Record<string, string>): ResolvedDependencies<T>;
|
|
44
69
|
/**
|
|
45
|
-
* Resolves entry and group names against every offer, with the dependency
|
|
46
|
-
*
|
|
47
|
-
* source its key comes from for
|
|
48
|
-
* wanted under one key are reported as
|
|
49
|
-
* folder per key.
|
|
70
|
+
* @brief Resolves entry and group names against every offer, with the dependency closure of each across sources.
|
|
71
|
+
*
|
|
72
|
+
* An entry named in the request settles which source its key comes from for
|
|
73
|
+
* every dependency. Two different entries wanted under one key are reported as
|
|
74
|
+
* ambiguous, since a target holds one folder per key.
|
|
50
75
|
*
|
|
51
|
-
* @param
|
|
76
|
+
* @param tokens - Names as typed on the command line, e.g. `["emphasise", "ui@g3n-skills"]`.
|
|
77
|
+
* @param offers - Every offer to resolve against, across all sources.
|
|
78
|
+
* @param installed - Source each installed key came from.
|
|
79
|
+
* @returns The entries to install, and what could not be resolved or was ambiguous.
|
|
52
80
|
*/
|
|
53
81
|
export declare function resolveRequests<T extends OriginEntry>(tokens: readonly string[], offers: readonly SourceOffer<T>[], installed?: Record<string, string>): Resolution<T>;
|
|
54
82
|
/**
|
|
55
|
-
* Resolves entry and group names against what a target has installed
|
|
56
|
-
* `<name>@<source>` keeping only entries installed from that source. Works
|
|
57
|
-
* from the install manifest alone, so no source needs to be reachable.
|
|
83
|
+
* @brief Resolves entry and group names against what a target has installed.
|
|
58
84
|
*
|
|
59
|
-
*
|
|
85
|
+
* `<name>@<source>` keeps only entries installed from that source. Works from
|
|
86
|
+
* the install manifest alone, so no source needs to be reachable.
|
|
87
|
+
*
|
|
88
|
+
* @param tokens - Names as typed, e.g. `["emphasise@g3n-skills"]`.
|
|
89
|
+
* @param installed - Installed entries by key, from one target's manifest.
|
|
90
|
+
* @returns Installed keys in the order named, and the names that match nothing installed.
|
|
60
91
|
*/
|
|
61
92
|
export declare function resolveInstalled<T extends OriginEntry>(tokens: readonly string[], installed: Record<string, T>): {
|
|
62
93
|
keys: string[];
|
|
63
94
|
unknown: string[];
|
|
64
95
|
};
|
|
65
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* @brief Maps each installed key to the source it came from, across manifests.
|
|
98
|
+
*
|
|
99
|
+
* The first manifest wins on a clash.
|
|
100
|
+
*
|
|
101
|
+
* @param installed - Installed entries by key, one record per target manifest.
|
|
102
|
+
* @returns Source name by installed key, e.g. `{ emphasise: "g3n-skills" }`.
|
|
103
|
+
*/
|
|
66
104
|
export declare function installedOrigins<T extends OriginEntry>(installed: readonly Record<string, T>[]): Record<string, string>;
|
|
67
105
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
106
|
+
* @brief Maps each forked key to the installed fork that stands in for it, across manifests.
|
|
107
|
+
*
|
|
108
|
+
* The first manifest wins on a clash.
|
|
109
|
+
*
|
|
110
|
+
* @param installed - Installed entries by key, one record per target manifest.
|
|
111
|
+
* @returns Installed fork key by forked key, e.g. `{ emphasise: "my-emphasise" }`.
|
|
112
|
+
*/
|
|
113
|
+
export declare function installedForks<T extends OriginEntry>(installed: readonly Record<string, T>[]): Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* @brief Finds the fresh offer for each installed key, from the source it was installed from and never another, with its dependencies resolved.
|
|
70
116
|
*
|
|
71
|
-
* @param
|
|
72
|
-
* @
|
|
117
|
+
* @param keys - Installed keys to update.
|
|
118
|
+
* @param installed - Installed entries by key, from one target's manifest.
|
|
119
|
+
* @param offers - Every offer to search, across all sources.
|
|
120
|
+
* @param preferred - Source each installed key came from, across targets.
|
|
121
|
+
* @returns The offers found, and the keys whose source is gone or no longer offers them.
|
|
73
122
|
*/
|
|
74
123
|
export declare function resolveUpdates<T extends OriginEntry>(keys: readonly string[], installed: Record<string, T>, offers: readonly SourceOffer<T>[], preferred?: Record<string, string>): {
|
|
75
124
|
offers: SourceOffer<T>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/installer/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/installer/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAK,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW;IAC/C,OAAO,EAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACtC,OAAO,EAAI,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,WAAW;IACzD,KAAK,EAAS,WAAW,CAAC,CAAC,CAAC,CAAA;IAC5B,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9B,OAAO,EAAO,MAAM,EAAE,CAAA;IACtB,SAAS,EAAK,MAAM,EAAE,CAAA;CACvB;AAKD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAA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cAAc,CAAC,CAAC,SAAS,WAAW,EAClD,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAC5B,MAAM,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,EACjC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACrC;IAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CASjD"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* @brief Parses a typed request such as `emphasise` or `emphasise@g3n-skills`.
|
|
3
|
+
*
|
|
4
|
+
* Names are matched in lowercase. A leading `@` belongs to the name, as in
|
|
5
|
+
* `@shadcn/button@shadcn`, so the source starts at the first `@` after the first character.
|
|
6
|
+
*
|
|
7
|
+
* @param token - Word as typed on the command line, e.g. `emphasise@g3n-skills`.
|
|
8
|
+
* @returns Request with the lowercased name, and the source when one is given.
|
|
4
9
|
*/
|
|
5
10
|
export function parseRequest(token) {
|
|
6
11
|
const at = token.indexOf("@", 1);
|
|
@@ -8,22 +13,41 @@ export function parseRequest(token) {
|
|
|
8
13
|
? { name: token.slice(0, at).toLowerCase(), source: token.slice(at + 1) }
|
|
9
14
|
: { name: token.toLowerCase() };
|
|
10
15
|
}
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @brief Formats a request as it is typed, e.g. `emphasise@g3n-skills`.
|
|
18
|
+
*
|
|
19
|
+
* @param request - Parsed request, e.g. `{ name: "emphasise", source: "g3n-skills" }`.
|
|
20
|
+
*/
|
|
12
21
|
export function formatRequest(request) {
|
|
13
22
|
return request.source === undefined ? request.name : `${request.name}@${request.source}`;
|
|
14
23
|
}
|
|
15
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @brief Gets the name of the source an offer comes from.
|
|
26
|
+
*
|
|
27
|
+
* @param offer - Offer whose entry's origin names the source, e.g. `{ key: "emphasise", entry }`.
|
|
28
|
+
*/
|
|
16
29
|
function sourceOf(offer) {
|
|
17
30
|
return offer.entry.origin.source;
|
|
18
31
|
}
|
|
19
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @brief Gets the names of the sources the offers come from, each once, sorted.
|
|
34
|
+
*
|
|
35
|
+
* @param offers - Offers to read the sources of, e.g. the matches of one request.
|
|
36
|
+
*/
|
|
20
37
|
function uniqueSources(offers) {
|
|
21
38
|
return [...new Set(offers.map(sourceOf))].sort();
|
|
22
39
|
}
|
|
23
40
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
41
|
+
* @brief Finds the entries one request names.
|
|
42
|
+
*
|
|
43
|
+
* A group name expands to every entry in it and wins over an entry with the
|
|
44
|
+
* same key. A name offered by several sources is settled by the preferred
|
|
45
|
+
* source for it, and is ambiguous otherwise.
|
|
46
|
+
*
|
|
47
|
+
* @param request - Request being matched, e.g. `{ name: "emphasise" }`.
|
|
48
|
+
* @param offers - Every offer to search, across all sources.
|
|
49
|
+
* @param preferred - Source to pick for a key several sources offer, by key, e.g. `{ emphasise: "g3n-skills" }`.
|
|
50
|
+
* @returns The matching offers, an `{ ambiguous }` message when several sources offer the name, or `null` when none does.
|
|
27
51
|
*/
|
|
28
52
|
function matchRequest(request, offers, preferred) {
|
|
29
53
|
const pool = request.source === undefined ? offers : offers.filter((o) => sourceOf(o) === request.source);
|
|
@@ -40,9 +64,16 @@ function matchRequest(request, offers, preferred) {
|
|
|
40
64
|
return { ambiguous: `${request.name} is offered by ${sources.length} sources, name one: ${sources.map((s) => `${request.name}@${s}`).join(", ")}` };
|
|
41
65
|
}
|
|
42
66
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
67
|
+
* @brief Finds the entry one dependency token points at.
|
|
68
|
+
*
|
|
69
|
+
* The named source when the dependency is qualified, else the dependent's own
|
|
70
|
+
* source, else the source preferred for the key, else the only source offering it.
|
|
71
|
+
*
|
|
72
|
+
* @param token - Dependency as written in `registryDependencies`, e.g. `ghost@mine`.
|
|
73
|
+
* @param dependent - Offer that declares the dependency.
|
|
74
|
+
* @param offers - Every offer to search, across all sources.
|
|
75
|
+
* @param preferred - Source to pick for a key several sources offer, by key.
|
|
76
|
+
* @returns The matched offer, an `{ ambiguous }` message, or `null` when no source offers it.
|
|
46
77
|
*/
|
|
47
78
|
function matchDependency(token, dependent, offers, preferred) {
|
|
48
79
|
const request = parseRequest(token);
|
|
@@ -58,11 +89,15 @@ function matchDependency(token, dependent, offers, preferred) {
|
|
|
58
89
|
return { ambiguous: `${dependent.key} depends on ${request.name}, offered by ${uniqueSources(named).join(", ")}; qualify it as ${request.name}@<source>` };
|
|
59
90
|
}
|
|
60
91
|
/**
|
|
61
|
-
* Resolves the `registryDependencies` of one entry against every offer.
|
|
62
|
-
*
|
|
92
|
+
* @brief Resolves the `registryDependencies` of one entry against every offer.
|
|
93
|
+
*
|
|
94
|
+
* A dependency that cannot be resolved keeps its bare name in the rewritten
|
|
63
95
|
* list and is reported in `unknown` or `ambiguous`.
|
|
64
96
|
*
|
|
65
|
-
* @param
|
|
97
|
+
* @param offer - Offer whose dependencies are resolved.
|
|
98
|
+
* @param offers - Every offer to resolve against, across all sources.
|
|
99
|
+
* @param preferred - Source to take a key from when several offer it: where it is installed, or where the request named it.
|
|
100
|
+
* @returns The offer with rewritten dependencies, the dependency offers found, and the ones that did not resolve.
|
|
66
101
|
*/
|
|
67
102
|
export function resolveDependencies(offer, offers, preferred = {}) {
|
|
68
103
|
const result = { offer, dependencies: [], unknown: [], ambiguous: [] };
|
|
@@ -83,13 +118,16 @@ export function resolveDependencies(offer, offers, preferred = {}) {
|
|
|
83
118
|
return result;
|
|
84
119
|
}
|
|
85
120
|
/**
|
|
86
|
-
* Resolves entry and group names against every offer, with the dependency
|
|
87
|
-
*
|
|
88
|
-
* source its key comes from for
|
|
89
|
-
* wanted under one key are reported as
|
|
90
|
-
* folder per key.
|
|
121
|
+
* @brief Resolves entry and group names against every offer, with the dependency closure of each across sources.
|
|
122
|
+
*
|
|
123
|
+
* An entry named in the request settles which source its key comes from for
|
|
124
|
+
* every dependency. Two different entries wanted under one key are reported as
|
|
125
|
+
* ambiguous, since a target holds one folder per key.
|
|
91
126
|
*
|
|
92
|
-
* @param
|
|
127
|
+
* @param tokens - Names as typed on the command line, e.g. `["emphasise", "ui@g3n-skills"]`.
|
|
128
|
+
* @param offers - Every offer to resolve against, across all sources.
|
|
129
|
+
* @param installed - Source each installed key came from.
|
|
130
|
+
* @returns The entries to install, and what could not be resolved or was ambiguous.
|
|
93
131
|
*/
|
|
94
132
|
export function resolveRequests(tokens, offers, installed = {}) {
|
|
95
133
|
const preferred = { ...installed };
|
|
@@ -134,11 +172,14 @@ export function resolveRequests(tokens, offers, installed = {}) {
|
|
|
134
172
|
return result;
|
|
135
173
|
}
|
|
136
174
|
/**
|
|
137
|
-
* Resolves entry and group names against what a target has installed
|
|
138
|
-
* `<name>@<source>` keeping only entries installed from that source. Works
|
|
139
|
-
* from the install manifest alone, so no source needs to be reachable.
|
|
175
|
+
* @brief Resolves entry and group names against what a target has installed.
|
|
140
176
|
*
|
|
141
|
-
*
|
|
177
|
+
* `<name>@<source>` keeps only entries installed from that source. Works from
|
|
178
|
+
* the install manifest alone, so no source needs to be reachable.
|
|
179
|
+
*
|
|
180
|
+
* @param tokens - Names as typed, e.g. `["emphasise@g3n-skills"]`.
|
|
181
|
+
* @param installed - Installed entries by key, from one target's manifest.
|
|
182
|
+
* @returns Installed keys in the order named, and the names that match nothing installed.
|
|
142
183
|
*/
|
|
143
184
|
export function resolveInstalled(tokens, installed) {
|
|
144
185
|
const keys = [];
|
|
@@ -154,7 +195,14 @@ export function resolveInstalled(tokens, installed) {
|
|
|
154
195
|
}
|
|
155
196
|
return { keys: [...new Set(keys)], unknown };
|
|
156
197
|
}
|
|
157
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* @brief Maps each installed key to the source it came from, across manifests.
|
|
200
|
+
*
|
|
201
|
+
* The first manifest wins on a clash.
|
|
202
|
+
*
|
|
203
|
+
* @param installed - Installed entries by key, one record per target manifest.
|
|
204
|
+
* @returns Source name by installed key, e.g. `{ emphasise: "g3n-skills" }`.
|
|
205
|
+
*/
|
|
158
206
|
export function installedOrigins(installed) {
|
|
159
207
|
const origins = {};
|
|
160
208
|
for (const record of installed)
|
|
@@ -163,11 +211,30 @@ export function installedOrigins(installed) {
|
|
|
163
211
|
return origins;
|
|
164
212
|
}
|
|
165
213
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
214
|
+
* @brief Maps each forked key to the installed fork that stands in for it, across manifests.
|
|
215
|
+
*
|
|
216
|
+
* The first manifest wins on a clash.
|
|
217
|
+
*
|
|
218
|
+
* @param installed - Installed entries by key, one record per target manifest.
|
|
219
|
+
* @returns Installed fork key by forked key, e.g. `{ emphasise: "my-emphasise" }`.
|
|
220
|
+
*/
|
|
221
|
+
export function installedForks(installed) {
|
|
222
|
+
const forks = {};
|
|
223
|
+
for (const record of installed) {
|
|
224
|
+
for (const [key, entry] of Object.entries(record))
|
|
225
|
+
if (entry.forkedFrom !== undefined)
|
|
226
|
+
forks[entry.forkedFrom] ??= key;
|
|
227
|
+
}
|
|
228
|
+
return forks;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @brief Finds the fresh offer for each installed key, from the source it was installed from and never another, with its dependencies resolved.
|
|
168
232
|
*
|
|
169
|
-
* @param
|
|
170
|
-
* @
|
|
233
|
+
* @param keys - Installed keys to update.
|
|
234
|
+
* @param installed - Installed entries by key, from one target's manifest.
|
|
235
|
+
* @param offers - Every offer to search, across all sources.
|
|
236
|
+
* @param preferred - Source each installed key came from, across targets.
|
|
237
|
+
* @returns The offers found, and the keys whose source is gone or no longer offers them.
|
|
171
238
|
*/
|
|
172
239
|
export function resolveUpdates(keys, installed, offers, preferred = {}) {
|
|
173
240
|
const found = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/installer/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/installer/resolve.ts"],"names":[],"mappings":"AAgDA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAChC,OAAO,EAAE,GAAG,CAAC;QACX,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;QACzE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAA;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAqB;IACjD,OAAO,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAA;AAC1F,CAAC;AAED;;;;GAIG;AACH,SAAS,QAAQ,CAAwB,KAAqB;IAC5D,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAA;AAClC,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAwB,MAAiC;IAC7E,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AAClD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,YAAY,CAAwB,OAAqB,EAAE,MAAiC,EAAE,SAAiC;IACtI,MAAM,IAAI,GAAM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2,58 +2,95 @@ import { type RegistryStore } from "../registry/registry.store";
|
|
|
2
2
|
import type { RegisteredSource, SourceCheckout } from "../sources/types";
|
|
3
3
|
import type { EntrySource } from "../cli/types";
|
|
4
4
|
import { type OriginEntry } from "./origin";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @brief What a package's reader found in one checked-out source.
|
|
7
|
+
*
|
|
8
|
+
* @property entries - Entries by key, each with its `origin` filled in.
|
|
9
|
+
* @property warnings - Problems the reader met that did not stop it.
|
|
10
|
+
*/
|
|
6
11
|
export interface SourceEntries<T extends OriginEntry> {
|
|
7
|
-
/** Entries by key, each with its `origin` filled in */
|
|
8
12
|
entries: [string, T][];
|
|
9
13
|
warnings: string[];
|
|
10
14
|
}
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @brief Reads the entries one checked-out source offers. Each installer supplies its own.
|
|
17
|
+
*
|
|
18
|
+
* @param checkout - Checkout of the source to read.
|
|
19
|
+
* @returns Entries and warnings found in the checkout.
|
|
20
|
+
*/
|
|
12
21
|
export type ReadSource<T extends OriginEntry> = (checkout: SourceCheckout) => Promise<SourceEntries<T>>;
|
|
13
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @brief A source that could not be checked out or read.
|
|
24
|
+
*
|
|
25
|
+
* @property name - Name of the registered source.
|
|
26
|
+
* @property error - Reason it failed, as a message.
|
|
27
|
+
*/
|
|
14
28
|
export interface FailedSource {
|
|
15
29
|
name: string;
|
|
16
30
|
error: string;
|
|
17
31
|
}
|
|
18
32
|
/**
|
|
19
|
-
* The entries a set of sources offers, one registry store per source
|
|
20
|
-
* from checkouts that stay on disk until `dispose` so the install can copy
|
|
21
|
-
* files out of them.
|
|
33
|
+
* @brief The entries a set of sources offers, one registry store per source.
|
|
22
34
|
*
|
|
23
|
-
*
|
|
24
|
-
* `source add` commands. `offers`
|
|
25
|
-
* `entrySource` copies an entry's files from its checkout.
|
|
35
|
+
* Checkouts stay on disk until `dispose` so the install can copy files out of them. Built by
|
|
36
|
+
* `loadSourceRegistry` in each installer's `add`, `update`, `ls` and `source add` commands. `offers`
|
|
37
|
+
* lists every entry for name resolution, and `entrySource` copies an entry's files from its checkout.
|
|
38
|
+
*
|
|
39
|
+
* @property sources - Entries by source name, in the order the sources were given.
|
|
40
|
+
* @property checkouts - Checkout of each source by name.
|
|
41
|
+
* @property warnings - Warnings from loading, prefixed with the source name.
|
|
42
|
+
* @property failed - Sources that could not be checked out or read.
|
|
43
|
+
* @property dispose - Releases every checkout.
|
|
26
44
|
*/
|
|
27
45
|
export interface SourceRegistry<T extends OriginEntry> {
|
|
28
|
-
/** Entries by source name, in the order the sources were given */
|
|
29
46
|
sources: Map<string, RegistryStore<T>>;
|
|
30
47
|
checkouts: Map<string, SourceCheckout>;
|
|
31
48
|
warnings: string[];
|
|
32
49
|
failed: FailedSource[];
|
|
33
50
|
dispose: () => void;
|
|
34
51
|
}
|
|
35
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @brief One entry that one source offers.
|
|
54
|
+
*
|
|
55
|
+
* @property key - Key of the entry within its source.
|
|
56
|
+
* @property entry - The entry itself.
|
|
57
|
+
*/
|
|
36
58
|
export interface SourceOffer<T extends OriginEntry> {
|
|
37
59
|
key: string;
|
|
38
60
|
entry: T;
|
|
39
61
|
}
|
|
40
62
|
/**
|
|
41
|
-
* Checks out each source and reads its entries with `readSource`, all
|
|
42
|
-
*
|
|
43
|
-
* `failed` instead of throwing, so one unreachable
|
|
44
|
-
* rest. A key offered twice by one source keeps the first, with a warning.
|
|
63
|
+
* @brief Checks out each source and reads its entries with `readSource`, all sources at once.
|
|
64
|
+
*
|
|
65
|
+
* A source that cannot be checked out or read lands in `failed` instead of throwing, so one unreachable
|
|
66
|
+
* source does not stop the rest. A key offered twice by one source keeps the first, with a warning.
|
|
45
67
|
*
|
|
46
|
-
* @param
|
|
68
|
+
* @param sources - Registered sources to load.
|
|
69
|
+
* @param projectRoot - Absolute root that local source paths and the `node_modules` lookup start from.
|
|
70
|
+
* @param readSource - Reads the entries of one checkout.
|
|
71
|
+
* @returns Registry holding every source that loaded, with the rest in `failed`.
|
|
47
72
|
*/
|
|
48
73
|
export declare function loadSourceRegistry<T extends OriginEntry>(sources: readonly RegisteredSource[], projectRoot: string, readSource: ReadSource<T>): Promise<SourceRegistry<T>>;
|
|
49
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* @brief Lists every entry of every source, sources in their given order and keys sorted within each.
|
|
76
|
+
*
|
|
77
|
+
* @param registry - Registry returned by `loadSourceRegistry`.
|
|
78
|
+
* @returns One offer per entry.
|
|
79
|
+
*/
|
|
50
80
|
export declare function offers<T extends OriginEntry>(registry: SourceRegistry<T>): SourceOffer<T>[];
|
|
51
81
|
/**
|
|
52
|
-
* File source for the core install commands
|
|
53
|
-
*
|
|
54
|
-
*
|
|
82
|
+
* @brief File source for the core install commands. Copies each file from `<checkout>/<origin.dir>/<path>` in its entry's source.
|
|
83
|
+
*
|
|
84
|
+
* @param registry - Registry whose checkouts the files are copied from.
|
|
85
|
+
* @returns Source that copies an entry's files from the checkout of `origin.source`.
|
|
86
|
+
* @throws {Error} When the entry's source is not checked out.
|
|
55
87
|
*/
|
|
56
88
|
export declare function entrySource<T extends OriginEntry>(registry: SourceRegistry<T>): EntrySource;
|
|
57
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* @brief Converts offers into the registry the core install commands take, keyed by entry key.
|
|
91
|
+
*
|
|
92
|
+
* @param selected - Offers to include. A later offer with the same key replaces an earlier one.
|
|
93
|
+
* @returns Entries by key.
|
|
94
|
+
*/
|
|
58
95
|
export declare function offerRegistry<T extends OriginEntry>(selected: Iterable<SourceOffer<T>>): Record<string, T>;
|
|
59
96
|
//# sourceMappingURL=sourceRegistry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceRegistry.d.ts","sourceRoot":"","sources":["../../src/installer/sourceRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK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AAM,EAAK,YAAY,EAAE,CAAA;IACzB,OAAO,EAAI,MAAM,IAAI,CAAA;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,WAAW;IAChD,GAAG,EAAI,MAAM,CAAA;IACb,KAAK,EAAE,CAAC,CAAA;CACT;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EAC5D,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GACxB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CA6B5B;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,CAG3F;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,WAAW,CAO3F;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAI1G"}
|
|
@@ -8,12 +8,15 @@ import { errorMessage } from "../utils/errors";
|
|
|
8
8
|
import { copySource } from "./install";
|
|
9
9
|
import { OriginEntrySchema } from "./origin";
|
|
10
10
|
/**
|
|
11
|
-
* Checks out each source and reads its entries with `readSource`, all
|
|
12
|
-
* sources at once. A source that cannot be checked out or read lands in
|
|
13
|
-
* `failed` instead of throwing, so one unreachable source does not stop the
|
|
14
|
-
* rest. A key offered twice by one source keeps the first, with a warning.
|
|
11
|
+
* @brief Checks out each source and reads its entries with `readSource`, all sources at once.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
13
|
+
* A source that cannot be checked out or read lands in `failed` instead of throwing, so one unreachable
|
|
14
|
+
* source does not stop the rest. A key offered twice by one source keeps the first, with a warning.
|
|
15
|
+
*
|
|
16
|
+
* @param sources - Registered sources to load.
|
|
17
|
+
* @param projectRoot - Absolute root that local source paths and the `node_modules` lookup start from.
|
|
18
|
+
* @param readSource - Reads the entries of one checkout.
|
|
19
|
+
* @returns Registry holding every source that loaded, with the rest in `failed`.
|
|
17
20
|
*/
|
|
18
21
|
export async function loadSourceRegistry(sources, projectRoot, readSource) {
|
|
19
22
|
const registry = { sources: new Map(), checkouts: new Map(), warnings: [], failed: [], dispose: () => { } };
|
|
@@ -43,14 +46,21 @@ export async function loadSourceRegistry(sources, projectRoot, readSource) {
|
|
|
43
46
|
});
|
|
44
47
|
return registry;
|
|
45
48
|
}
|
|
46
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @brief Lists every entry of every source, sources in their given order and keys sorted within each.
|
|
51
|
+
*
|
|
52
|
+
* @param registry - Registry returned by `loadSourceRegistry`.
|
|
53
|
+
* @returns One offer per entry.
|
|
54
|
+
*/
|
|
47
55
|
export function offers(registry) {
|
|
48
56
|
return [...registry.sources.values()].flatMap((store) => Object.entries(entries(store)).sort(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => ({ key, entry })));
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
51
|
-
* File source for the core install commands
|
|
52
|
-
*
|
|
53
|
-
*
|
|
59
|
+
* @brief File source for the core install commands. Copies each file from `<checkout>/<origin.dir>/<path>` in its entry's source.
|
|
60
|
+
*
|
|
61
|
+
* @param registry - Registry whose checkouts the files are copied from.
|
|
62
|
+
* @returns Source that copies an entry's files from the checkout of `origin.source`.
|
|
63
|
+
* @throws {Error} When the entry's source is not checked out.
|
|
54
64
|
*/
|
|
55
65
|
export function entrySource(registry) {
|
|
56
66
|
return (entry) => {
|
|
@@ -61,7 +71,12 @@ export function entrySource(registry) {
|
|
|
61
71
|
return copySource((filePath) => path.join(checkout.dir, origin.dir, filePath));
|
|
62
72
|
};
|
|
63
73
|
}
|
|
64
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* @brief Converts offers into the registry the core install commands take, keyed by entry key.
|
|
76
|
+
*
|
|
77
|
+
* @param selected - Offers to include. A later offer with the same key replaces an earlier one.
|
|
78
|
+
* @returns Entries by key.
|
|
79
|
+
*/
|
|
65
80
|
export function offerRegistry(selected) {
|
|
66
81
|
const registry = {};
|
|
67
82
|
for (const offer of selected)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceRegistry.js","sourceRoot":"","sources":["../../src/installer/sourceRegistry.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAsB,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"sourceRegistry.js","sourceRoot":"","sources":["../../src/installer/sourceRegistry.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAsB,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;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