@sous-io/sous 0.2.37 → 1.0.2
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 +14 -256
- package/dist/bin.js +11 -0
- package/dist/sous.js +1094 -0
- package/docs/markdown/README.md +5 -4
- package/docs/markdown/_sidebar.md +21 -1
- package/docs/markdown/commands.md +294 -431
- package/docs/markdown/config-discovery.md +25 -14
- package/docs/markdown/config-inspection.md +53 -31
- package/docs/markdown/config-layers.md +168 -66
- package/docs/markdown/config-variables.md +44 -11
- package/docs/markdown/configuration.md +104 -17
- package/docs/markdown/design-principles.md +4 -1
- package/docs/markdown/repositories-authoring.md +30 -0
- package/docs/markdown/repositories-consuming.md +72 -14
- package/docs/markdown/repositories-file-formats.md +31 -13
- package/docs/markdown/repositories-providers.md +48 -57
- package/docs/markdown/repositories-quickstart.md +3 -2
- package/docs/markdown/repositories-troubleshooting.md +27 -1
- package/docs/markdown/repositories-variables.md +6 -1
- package/docs/markdown/repositories.md +18 -8
- package/package.json +48 -107
- package/recipes/core/sous-skills/skills/about-liquid-templates/SKILL.tpl.md +4 -6
- package/recipes/core/sous-skills/skills/about-liquid-templates/references/liquid-filters.tpl.md +2 -0
- package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +10 -9
- package/recipes/core/sous-skills/skills/about-sous-configuration/SKILL.tpl.md +35 -14
- package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +51 -20
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/sous.config.schema.json +351 -132
- package/bin/run.js +0 -51
- package/src/base-command.ts +0 -457
- package/src/commands/build.ts +0 -181
- package/src/commands/clear.ts +0 -79
- package/src/commands/compile.ts +0 -155
- package/src/commands/config/get.ts +0 -110
- package/src/commands/config/show.ts +0 -32
- package/src/commands/config/validate.ts +0 -53
- package/src/commands/help.ts +0 -46
- package/src/commands/init.ts +0 -289
- package/src/commands/launch.ts +0 -139
- package/src/commands/lock/rebuild.ts +0 -239
- package/src/commands/lock/show.ts +0 -115
- package/src/commands/namespace/list.ts +0 -138
- package/src/commands/namespace/show.ts +0 -130
- package/src/commands/prune.ts +0 -43
- package/src/commands/recipe/list.ts +0 -112
- package/src/commands/recipe/show.ts +0 -439
- package/src/commands/repo/add.ts +0 -145
- package/src/commands/repo/contribute.ts +0 -604
- package/src/commands/repo/gc.ts +0 -173
- package/src/commands/repo/init.ts +0 -136
- package/src/commands/repo/link.ts +0 -899
- package/src/commands/repo/list.ts +0 -236
- package/src/commands/repo/release.ts +0 -685
- package/src/commands/repo/remove.ts +0 -194
- package/src/commands/repo/search.ts +0 -243
- package/src/commands/repo/submit.ts +0 -341
- package/src/commands/repo/unlink.ts +0 -461
- package/src/commands/subscription/add.ts +0 -286
- package/src/commands/subscription/list.ts +0 -208
- package/src/commands/subscription/remove.ts +0 -182
- package/src/commands/subscription/update.ts +0 -216
- package/src/commands/update.ts +0 -178
- package/src/commands/vars/ask.ts +0 -417
- package/src/commands/vars/index.ts +0 -79
- package/src/commands/vars/list.ts +0 -67
- package/src/commands/vars/show.ts +0 -77
- package/src/config-command.ts +0 -30
- package/src/lib/build-preparation.ts +0 -128
- package/src/lib/build-service.ts +0 -580
- package/src/lib/config-discovery.ts +0 -378
- package/src/lib/config-inspect.ts +0 -145
- package/src/lib/config-kernel.mjs +0 -379
- package/src/lib/config-schema.ts +0 -401
- package/src/lib/env-file.ts +0 -328
- package/src/lib/env-local.ts +0 -212
- package/src/lib/errors.ts +0 -32
- package/src/lib/glob-pattern.ts +0 -24
- package/src/lib/include-resolver.ts +0 -523
- package/src/lib/interactive.ts +0 -165
- package/src/lib/markdown-compiler.ts +0 -947
- package/src/lib/package-info.ts +0 -25
- package/src/lib/pid-service.ts +0 -99
- package/src/lib/project-install.d.mts +0 -44
- package/src/lib/project-install.mjs +0 -234
- package/src/lib/project-scaffold/index.ts +0 -332
- package/src/lib/project-scaffold/templates.ts +0 -240
- package/src/lib/repos/catalog-display.ts +0 -215
- package/src/lib/repos/catalog-inputs.ts +0 -288
- package/src/lib/repos/catalog.ts +0 -842
- package/src/lib/repos/contribute.ts +0 -452
- package/src/lib/repos/core-recipe.ts +0 -105
- package/src/lib/repos/declarations.ts +0 -187
- package/src/lib/repos/defaults.ts +0 -175
- package/src/lib/repos/formats/common.ts +0 -440
- package/src/lib/repos/formats/index-file.ts +0 -253
- package/src/lib/repos/formats/links-map.ts +0 -98
- package/src/lib/repos/formats/lockfile.ts +0 -169
- package/src/lib/repos/formats/patterns.ts +0 -57
- package/src/lib/repos/formats/recipe-manifest.ts +0 -205
- package/src/lib/repos/formats/repo-manifest.ts +0 -97
- package/src/lib/repos/formats/store-entry.ts +0 -84
- package/src/lib/repos/formats/variable-definition.ts +0 -268
- package/src/lib/repos/freshness.ts +0 -264
- package/src/lib/repos/git-clone.ts +0 -850
- package/src/lib/repos/identity.ts +0 -89
- package/src/lib/repos/index.ts +0 -57
- package/src/lib/repos/links.ts +0 -356
- package/src/lib/repos/load-manifest.ts +0 -237
- package/src/lib/repos/lock-service.ts +0 -454
- package/src/lib/repos/locked-namespace-resolver.ts +0 -232
- package/src/lib/repos/locked-recipe-lookup.ts +0 -123
- package/src/lib/repos/locked-recipes.ts +0 -254
- package/src/lib/repos/managed-layer.ts +0 -422
- package/src/lib/repos/memories-hash-name.ts +0 -33
- package/src/lib/repos/namespace-resolver.ts +0 -527
- package/src/lib/repos/providers/base.ts +0 -268
- package/src/lib/repos/providers/git.ts +0 -245
- package/src/lib/repos/providers/github.ts +0 -589
- package/src/lib/repos/providers/gitlab.ts +0 -332
- package/src/lib/repos/providers/http.ts +0 -128
- package/src/lib/repos/providers/index-cache.ts +0 -421
- package/src/lib/repos/providers/index.ts +0 -106
- package/src/lib/repos/providers/local.ts +0 -410
- package/src/lib/repos/providers/provider.ts +0 -615
- package/src/lib/repos/recipe-config-layers.ts +0 -316
- package/src/lib/repos/recipe-key-matcher.ts +0 -62
- package/src/lib/repos/recipe-memories.ts +0 -178
- package/src/lib/repos/recipe-targets.ts +0 -236
- package/src/lib/repos/ref-search.ts +0 -46
- package/src/lib/repos/release/bump.ts +0 -161
- package/src/lib/repos/release/changelog.ts +0 -461
- package/src/lib/repos/release/git-state.ts +0 -460
- package/src/lib/repos/release/index-builder.ts +0 -1108
- package/src/lib/repos/release/index.ts +0 -19
- package/src/lib/repos/release/plan.ts +0 -521
- package/src/lib/repos/release/settle.ts +0 -154
- package/src/lib/repos/release/submissions.ts +0 -214
- package/src/lib/repos/release/submit-checkout.ts +0 -290
- package/src/lib/repos/release/submit-questions.ts +0 -153
- package/src/lib/repos/release/submit-service.ts +0 -898
- package/src/lib/repos/release/tags.ts +0 -239
- package/src/lib/repos/release/validate.ts +0 -463
- package/src/lib/repos/resolver.ts +0 -1028
- package/src/lib/repos/scaffold/index.ts +0 -245
- package/src/lib/repos/scaffold/templates.ts +0 -517
- package/src/lib/repos/seed.ts +0 -473
- package/src/lib/repos/store/contract.ts +0 -64
- package/src/lib/repos/store/hash.ts +0 -191
- package/src/lib/repos/store/recipe-store.ts +0 -599
- package/src/lib/repos/store/settings.ts +0 -58
- package/src/lib/repos/subscription-service.ts +0 -3859
- package/src/lib/repos/trust.ts +0 -447
- package/src/lib/repos/update-plan.ts +0 -235
- package/src/lib/self-update/index.ts +0 -14
- package/src/lib/self-update/installs.ts +0 -413
- package/src/lib/self-update/managers.ts +0 -126
- package/src/lib/self-update/plan.ts +0 -315
- package/src/lib/self-update/registry.ts +0 -99
- package/src/lib/self-update/run.ts +0 -506
- package/src/lib/self-update/versions.ts +0 -243
- package/src/lib/settings.ts +0 -1107
- package/src/lib/sous-home.ts +0 -104
- package/src/lib/state.ts +0 -167
- package/src/lib/vars/answers.ts +0 -192
- package/src/lib/vars/ask.ts +0 -1152
- package/src/lib/vars/definition-source.ts +0 -261
- package/src/lib/vars/display.ts +0 -231
- package/src/lib/vars/index.ts +0 -20
- package/src/lib/vars/ladder.ts +0 -282
- package/src/lib/vars/mappings.ts +0 -260
- package/src/lib/vars/names.ts +0 -94
- package/src/lib/vars/preanswers.ts +0 -395
- package/src/lib/vars/question-plan.ts +0 -241
- package/src/lib/vars/report.ts +0 -228
- package/src/lib/vars/safe-regex.ts +0 -235
- package/src/lib/vars/secrets.ts +0 -131
- package/src/lib/vars/validate.ts +0 -312
- package/src/lib/version-report.ts +0 -90
- package/src/lib/watch-loop.ts +0 -148
- package/src/lib/watch-service.ts +0 -116
- package/src/services/ref-resolver/container.ts +0 -107
- package/src/services/ref-resolver/dependency.ts +0 -60
- package/src/services/ref-resolver/format.ts +0 -197
- package/src/services/ref-resolver/glob.ts +0 -115
- package/src/services/ref-resolver/hash-names.ts +0 -155
- package/src/services/ref-resolver/index.ts +0 -55
- package/src/services/ref-resolver/injectable.ts +0 -36
- package/src/services/ref-resolver/location.ts +0 -62
- package/src/services/ref-resolver/lookups/cached-index-lookup.ts +0 -53
- package/src/services/ref-resolver/lookups/catalog-lookup.ts +0 -23
- package/src/services/ref-resolver/lookups/catalog-matcher.ts +0 -261
- package/src/services/ref-resolver/lookups/chained-lookup.ts +0 -27
- package/src/services/ref-resolver/lookups/env-var-lookup.ts +0 -65
- package/src/services/ref-resolver/lookups/fetched-index-lookup.ts +0 -150
- package/src/services/ref-resolver/lookups/recorded-dependency-lookup.ts +0 -62
- package/src/services/ref-resolver/lookups/ref-lookup.ts +0 -54
- package/src/services/ref-resolver/lookups/variable-lookup.ts +0 -123
- package/src/services/ref-resolver/named-refs.ts +0 -144
- package/src/services/ref-resolver/parser/env-var-splitter.ts +0 -27
- package/src/services/ref-resolver/parser/location-splitter.ts +0 -239
- package/src/services/ref-resolver/parser/name-path-splitter.ts +0 -200
- package/src/services/ref-resolver/parser/partial-ref.ts +0 -84
- package/src/services/ref-resolver/parser/query-splitter.ts +0 -61
- package/src/services/ref-resolver/parser/range-splitter.ts +0 -52
- package/src/services/ref-resolver/parser/ref-parser.ts +0 -115
- package/src/services/ref-resolver/parser/repo-qualifier-splitter.ts +0 -51
- package/src/services/ref-resolver/parts.ts +0 -115
- package/src/services/ref-resolver/pruners/command-line-pruner.ts +0 -47
- package/src/services/ref-resolver/pruners/include-pruner.ts +0 -66
- package/src/services/ref-resolver/pruners/manifest-pruner.ts +0 -130
- package/src/services/ref-resolver/pruners/ref-pruner.ts +0 -135
- package/src/services/ref-resolver/pruners/rule-helpers.ts +0 -44
- package/src/services/ref-resolver/pruners/stored-key-pruner.ts +0 -136
- package/src/services/ref-resolver/ref-helpers.ts +0 -62
- package/src/services/ref-resolver/ref-picker-service.ts +0 -204
- package/src/services/ref-resolver/ref-report.ts +0 -84
- package/src/services/ref-resolver/ref-resolve-arguments.ts +0 -47
- package/src/services/ref-resolver/ref-resolve-result.ts +0 -36
- package/src/services/ref-resolver/ref-resolver-service.ts +0 -323
- package/src/services/ref-resolver/source.ts +0 -48
- package/src/services/ref-resolver/tokens.ts +0 -25
- package/src/services/ref-resolver/types.ts +0 -155
- package/src/templating/filters/bullet-list.ts +0 -9
- package/src/templating/filters/index.ts +0 -8
- package/src/templating/init-liquid-engine.ts +0 -139
- package/src/templating/lib/glob-files.ts +0 -74
- package/src/templating/lib/import-export.ts +0 -32
- package/src/templating/lib/secret-scope.ts +0 -41
- package/src/templating/lib/tag-args.ts +0 -19
- package/src/templating/tags/exportScalarVarsJs.ts +0 -46
- package/src/templating/tags/getFiles.ts +0 -89
- package/src/templating/tags/index.ts +0 -14
- package/src/templating/tags/listFiles.ts +0 -54
- package/src/templating/tags/showVars.ts +0 -28
- package/src/utils/choice-prompt.ts +0 -143
- package/src/utils/command-errors.ts +0 -186
- package/src/utils/command-help.ts +0 -45
- package/src/utils/confirm-prompt.ts +0 -110
- package/src/utils/flags.ts +0 -177
- package/src/utils/formatting.ts +0 -849
- package/src/utils/prompts.ts +0 -53
- package/src/utils/sous-directory.ts +0 -245
- package/src/utils/table.ts +0 -603
- package/src/utils/value-prompt.ts +0 -119
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `sous repo list`.
|
|
3
|
-
*
|
|
4
|
-
* Shows every repository this project trusts, what it publishes, and whether it
|
|
5
|
-
* is currently being read from a working copy instead of a published version.
|
|
6
|
-
* By default it reads only what sous already has on disk: a repository whose
|
|
7
|
-
* index has never been fetched says so in its own row rather than triggering a
|
|
8
|
-
* download, so the command is safe to run offline. `--latest` reads each index
|
|
9
|
-
* from upstream instead, saving nothing, and `--installed` narrows the listing
|
|
10
|
-
* to the repositories the lockfile pins a recipe from, naming each one under
|
|
11
|
-
* its row.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { Flags } from "@oclif/core";
|
|
15
|
-
import { color } from "@oclif/color";
|
|
16
|
-
import { BaseCommand } from "../../base-command.js";
|
|
17
|
-
import { subscriptionServiceFor } from "../../lib/repos/subscription-service.js";
|
|
18
|
-
import { readEffectiveLinks } from "../../lib/repos/links.js";
|
|
19
|
-
import { BUILT_IN_ADDED_BY } from "../../lib/repos/defaults.js";
|
|
20
|
-
import { requireProvider } from "../../lib/repos/providers/index.js";
|
|
21
|
-
import { readTrustedIndexes } from "../../lib/repos/catalog-inputs.js";
|
|
22
|
-
import {
|
|
23
|
-
LINKED_REPO_NOTE,
|
|
24
|
-
describeIndexSource,
|
|
25
|
-
printBrowsingNotes,
|
|
26
|
-
} from "../../lib/repos/catalog-display.js";
|
|
27
|
-
import { renderTable, type TableColumn } from "../../utils/table.js";
|
|
28
|
-
import { browsingFlags } from "../../utils/flags.js";
|
|
29
|
-
import {
|
|
30
|
-
footer,
|
|
31
|
-
indent,
|
|
32
|
-
log,
|
|
33
|
-
note,
|
|
34
|
-
paragraph,
|
|
35
|
-
section,
|
|
36
|
-
showCommandVars,
|
|
37
|
-
wrapColumns,
|
|
38
|
-
wrapText,
|
|
39
|
-
} from "../../utils/formatting.js";
|
|
40
|
-
|
|
41
|
-
/** How far every line of this command's output is indented. */
|
|
42
|
-
const INDENT = 2;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The columns the listing shows, widest-mattering first. The URL is the column
|
|
46
|
-
* that steps aside on a narrow terminal: it is the longest and the least often
|
|
47
|
-
* read, and its middle is what a cut gives up, so the host and the repository
|
|
48
|
-
* name both survive.
|
|
49
|
-
*/
|
|
50
|
-
const COLUMNS: TableColumn[] = [
|
|
51
|
-
{ key: "name", header: "Repository", overflow: "truncate", minWidth: 8 },
|
|
52
|
-
{ key: "provider", header: "Provider", priority: "medium" },
|
|
53
|
-
{ key: "origin", header: "Origin" },
|
|
54
|
-
{
|
|
55
|
-
key: "linked",
|
|
56
|
-
header: "Linked",
|
|
57
|
-
kind: "path",
|
|
58
|
-
overflow: "truncate",
|
|
59
|
-
priority: "medium",
|
|
60
|
-
minWidth: 6,
|
|
61
|
-
},
|
|
62
|
-
{ key: "recipes", header: "Recipes", kind: "number", priority: "low", minWidth: 11 },
|
|
63
|
-
{
|
|
64
|
-
key: "url",
|
|
65
|
-
header: "URL",
|
|
66
|
-
kind: "url",
|
|
67
|
-
overflow: "truncate",
|
|
68
|
-
truncate: "middle",
|
|
69
|
-
priority: "low",
|
|
70
|
-
flex: 1,
|
|
71
|
-
minWidth: 12,
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
|
|
75
|
-
export default class RepoList extends BaseCommand {
|
|
76
|
-
static description = "List the recipe repositories this project trusts";
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The other spelling of the topic. It lives under a hidden topic, so it is
|
|
80
|
-
* typable everywhere without ever reaching the top-level listing.
|
|
81
|
-
*/
|
|
82
|
-
static aliases = ["repos:list"];
|
|
83
|
-
|
|
84
|
-
static examples = [
|
|
85
|
-
"<%= config.bin %> repo list",
|
|
86
|
-
"<%= config.bin %> repo list --verbose",
|
|
87
|
-
"<%= config.bin %> repo list --installed --latest",
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
static flags = {
|
|
91
|
-
...BaseCommand.baseFlags,
|
|
92
|
-
...browsingFlags(),
|
|
93
|
-
verbose: Flags.boolean({
|
|
94
|
-
description: "Show the namespaces each repository publishes, under its row",
|
|
95
|
-
default: false,
|
|
96
|
-
}),
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
async run(): Promise<void> {
|
|
100
|
-
const { flags } = await this.parse(RepoList);
|
|
101
|
-
|
|
102
|
-
showCommandVars({
|
|
103
|
-
Project: this.projectLabel,
|
|
104
|
-
Config: this.configContext.configPath,
|
|
105
|
-
Reading: describeIndexSource(flags.latest),
|
|
106
|
-
...(flags.installed ? { Showing: "only what this project has installed" } : {}),
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
section(
|
|
110
|
-
flags.installed
|
|
111
|
-
? "Repositories this project has installed recipes from"
|
|
112
|
-
: "Repositories this project trusts"
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
const service = subscriptionServiceFor({
|
|
116
|
-
configContext: this.configContext,
|
|
117
|
-
settings: this.settings,
|
|
118
|
-
shellEnv: this.shellEnv,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const repos = service.currentRepos();
|
|
122
|
-
const lock = service.lockService.read();
|
|
123
|
-
const names = Object.keys(repos)
|
|
124
|
-
.sort()
|
|
125
|
-
.filter(
|
|
126
|
-
(name) =>
|
|
127
|
-
!flags.installed ||
|
|
128
|
-
Object.values(lock.recipes).some((locked) => locked.repo === name)
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
if (names.length === 0 && flags.installed && Object.keys(repos).length > 0) {
|
|
132
|
-
paragraph("This project has installed no recipe from the repositories it trusts.");
|
|
133
|
-
footer();
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (names.length === 0) {
|
|
138
|
-
paragraph(
|
|
139
|
-
"This project trusts no repositories yet. Add one with " +
|
|
140
|
-
"'sous repo add <url>'; adding a repository is how you trust it."
|
|
141
|
-
);
|
|
142
|
-
footer();
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const links = readEffectiveLinks(this.configContext.sousDir);
|
|
147
|
-
const indexes = await readTrustedIndexes(service, { latest: flags.latest });
|
|
148
|
-
const indexFor = new Map(indexes.repos.map((entry) => [entry.name, entry.index]));
|
|
149
|
-
|
|
150
|
-
const rows = names.map((name) => {
|
|
151
|
-
const entry = repos[name]!;
|
|
152
|
-
const index = indexFor.get(name);
|
|
153
|
-
const namespaces =
|
|
154
|
-
index === undefined ? "not fetched" : Object.keys(index.namespaces).sort().join(", ");
|
|
155
|
-
// A repository whose index has never been fetched says so in the cell
|
|
156
|
-
// itself. The count is not unknown in any interesting sense; sous simply
|
|
157
|
-
// has not downloaded the one file that holds it, and saying that in the
|
|
158
|
-
// row saves a note under the table.
|
|
159
|
-
const recipes =
|
|
160
|
-
index === undefined ? "not fetched" : String(Object.keys(index.recipes).length);
|
|
161
|
-
return {
|
|
162
|
-
name,
|
|
163
|
-
url: entry.url,
|
|
164
|
-
provider: describeProvider(entry.url, entry.provider),
|
|
165
|
-
origin: describeOrigin(entry.addedBy),
|
|
166
|
-
namespaces: namespaces.length > 0 ? namespaces : "none",
|
|
167
|
-
recipes,
|
|
168
|
-
linked: links[name] === undefined ? "no" : `yes: ${links[name]!.path}`,
|
|
169
|
-
installed: Object.entries(lock.recipes)
|
|
170
|
-
.filter(([, locked]) => locked.repo === name)
|
|
171
|
-
.map(([key, locked]) => `${key} ${locked.version}`)
|
|
172
|
-
.sort()
|
|
173
|
-
.join(", "),
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
for (const line of renderTable(COLUMNS, rows, {
|
|
178
|
-
indent: INDENT,
|
|
179
|
-
rowNote: (row) => {
|
|
180
|
-
const notes: string[] = [];
|
|
181
|
-
if (flags.verbose) notes.push(`Namespaces: ${row.namespaces}`);
|
|
182
|
-
if (flags.installed) notes.push(`Installed: ${row.installed}`);
|
|
183
|
-
// Each note wraps under itself, inside the two indents it is printed at.
|
|
184
|
-
const width = Math.max(20, wrapColumns() - INDENT * 2);
|
|
185
|
-
return notes.length === 0
|
|
186
|
-
? undefined
|
|
187
|
-
: notes
|
|
188
|
-
.flatMap((text) => wrapText(text, width))
|
|
189
|
-
.map((line) => color.gray(indent(line, INDENT)))
|
|
190
|
-
.join("\n");
|
|
191
|
-
},
|
|
192
|
-
})) {
|
|
193
|
-
log(indent(line, INDENT));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// The table says everything about each repository; what sits under it is
|
|
197
|
-
// only what the rows could not: a repository upstream could not answer for,
|
|
198
|
-
// and what a linked row means for the installed recipes it names.
|
|
199
|
-
printBrowsingNotes({ notChecked: indexes.notChecked.filter((name) => names.includes(name)) });
|
|
200
|
-
if (flags.installed && names.some((name) => links[name] !== undefined)) {
|
|
201
|
-
note(LINKED_REPO_NOTE);
|
|
202
|
-
}
|
|
203
|
-
footer();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* The identifier of the provider that actually handles a repository entry: the
|
|
209
|
-
* one the entry names, otherwise the one that recognizes its URL. The column
|
|
210
|
-
* reports the provider doing the work, not how sous arrived at it, so an entry
|
|
211
|
-
* that leaves `provider` out still reads `local` or `github` rather than a note
|
|
212
|
-
* about detection. An entry no provider can claim reads `unknown`; the listing
|
|
213
|
-
* is a read-only view of what is on disk and refuses nothing.
|
|
214
|
-
*
|
|
215
|
-
* @param url - The repository entry's URL.
|
|
216
|
-
* @param providerId - The provider the entry named, when it named one.
|
|
217
|
-
*/
|
|
218
|
-
function describeProvider(url: string, providerId: string | undefined): string {
|
|
219
|
-
try {
|
|
220
|
-
return requireProvider(url, providerId).id;
|
|
221
|
-
} catch {
|
|
222
|
-
return "unknown";
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Plain-language wording for a repository entry's `addedBy` field, so the table
|
|
228
|
-
* says who wanted the repository rather than printing a bare marker value.
|
|
229
|
-
*
|
|
230
|
-
* @param addedBy - What the entry recorded, when it recorded anything.
|
|
231
|
-
*/
|
|
232
|
-
function describeOrigin(addedBy: string | undefined): string {
|
|
233
|
-
if (addedBy === BUILT_IN_ADDED_BY) return "built in";
|
|
234
|
-
if (addedBy === undefined || addedBy === "user") return "user";
|
|
235
|
-
return `required by ${addedBy}`;
|
|
236
|
-
}
|