@sous-io/sous 1.2.1 → 1.3.0
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/dist/sous.js +146 -136
- package/docs/markdown/_sidebar.md +2 -0
- package/docs/markdown/commands.md +24 -16
- package/docs/markdown/config-inspection.md +1 -1
- package/docs/markdown/config-layers.md +2 -2
- package/docs/markdown/project-recipes.md +17 -6
- package/docs/markdown/repositories-authoring.md +109 -36
- package/docs/markdown/repositories-consuming.md +8 -6
- package/docs/markdown/repositories-contributing.md +16 -17
- package/docs/markdown/repositories-file-formats.md +82 -38
- package/docs/markdown/repositories-providers.md +18 -17
- package/docs/markdown/repositories-quickstart.md +25 -20
- package/docs/markdown/repositories-troubleshooting.md +8 -8
- package/docs/markdown/repositories-variables.md +2 -2
- package/docs/markdown/repositories.md +36 -18
- package/docs/markdown/skill-categories.md +5 -4
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-agent-skills/SKILL.tpl.md +1 -1
- package/recipes/core/sous-skills/skills/about-liquid-templates/SKILL.tpl.md +1 -1
- package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +17 -11
- package/recipes/core/sous-skills/skills/about-sous-configuration/SKILL.tpl.md +8 -1
- package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +14 -9
- package/recipes/core/sous-skills/skills/about-sous-repos/SKILL.tpl.md +70 -36
- package/recipes/core/sous-skills/skills/create-skill/SKILL.tpl.md +1 -1
- package/recipes/core/sous-skills/sous.recipe.yaml +6 -12
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
- [What sous init writes, and sous init hooks](architecture/specifications/S14-init-and-git-hooks.md)
|
|
43
43
|
- [Claude Code](architecture/specifications/S15-claude-code.md)
|
|
44
44
|
- [Codex](architecture/specifications/S16-codex.md)
|
|
45
|
+
- [Publishing](architecture/specifications/S17-publishing.md)
|
|
45
46
|
- **ADRs**
|
|
46
47
|
- [0001: Repositories](adrs/0001-repositories.md)
|
|
47
48
|
- [0002: Recipe answers in the template scope](adrs/0002-recipe-answers-in-templates.md)
|
|
@@ -87,3 +88,4 @@
|
|
|
87
88
|
- [0042: Retired recipes stay in the index and name their replacements](adrs/0042-retired-recipes.md)
|
|
88
89
|
- [0043: Every command runs the waiting migrations first](adrs/0043-migrations-before-every-command.md)
|
|
89
90
|
- [0044: A recipe can recommend other recipes, and sous asks before subscribing to them](adrs/0044-recipe-recommendations.md)
|
|
91
|
+
- [0045: `core` comes from `sous`, and `the-pantry` replaces `sous-recipes`](adrs/0045-core-in-sous-and-the-pantry.md)
|
|
@@ -285,7 +285,7 @@ one has the same key as a subscribed recipe, the subscribed one is not built, an
|
|
|
285
285
|
(unless the subscribed one is `core`):
|
|
286
286
|
|
|
287
287
|
```text
|
|
288
|
-
Skipped the subscribed
|
|
288
|
+
Skipped the subscribed the-pantry:tooling/linting: this project's own recipe project:tooling/linting is used instead.
|
|
289
289
|
```
|
|
290
290
|
|
|
291
291
|
A build compiles only the recipes whose subscriptions are switched on on this machine. Each one it skips gets a
|
|
@@ -589,7 +589,7 @@ Inspects the built configuration; see [Inspecting and validating](config-inspect
|
|
|
589
589
|
|
|
590
590
|
```bash
|
|
591
591
|
sous config show | jq .compilation
|
|
592
|
-
sous config get repos.
|
|
592
|
+
sous config get repos.the-pantry.url --layers
|
|
593
593
|
```
|
|
594
594
|
|
|
595
595
|
## repo
|
|
@@ -606,7 +606,7 @@ Manages the recipe repositories the project trusts; see [Repositories](repositor
|
|
|
606
606
|
- `repo list` lists the trusted repositories; `--verbose` adds the namespaces each publishes.
|
|
607
607
|
|
|
608
608
|
```bash
|
|
609
|
-
sous repo add https://github.com/sous-io/
|
|
609
|
+
sous repo add https://github.com/sous-io/the-pantry --name recipes
|
|
610
610
|
sous repo remove recipes --dry-run
|
|
611
611
|
```
|
|
612
612
|
|
|
@@ -631,9 +631,9 @@ checkout. `--global` links it for every project on this machine, and `--branch`,
|
|
|
631
631
|
newest versions their ranges allow, and `--remove` deletes a checkout sous cloned.
|
|
632
632
|
|
|
633
633
|
```bash
|
|
634
|
-
sous repo link
|
|
635
|
-
sous repo link
|
|
636
|
-
sous repo unlink
|
|
634
|
+
sous repo link the-pantry ~/Projects/the-pantry
|
|
635
|
+
sous repo link the-pantry --generate-branch --latest
|
|
636
|
+
sous repo unlink the-pantry --update
|
|
637
637
|
```
|
|
638
638
|
|
|
639
639
|
### `sous repo contribute REF`
|
|
@@ -677,17 +677,25 @@ sous repo init --for-project --workflow --no-example --readme
|
|
|
677
677
|
|
|
678
678
|
### `sous repo release`
|
|
679
679
|
|
|
680
|
-
Publishes new versions of the repository's recipes: raises their versions,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
680
|
+
Publishes new versions of the repository's recipes: raises their versions, writes the published data where
|
|
681
|
+
`sous.repo.yaml` keeps it (embedded under `published:`, in an index file, or nowhere for `index: tags`), commits
|
|
682
|
+
what changed and tags each version. It plans first and asks once, and it needs a git commit identity
|
|
683
|
+
(`user.name` and `user.email`) in the repository. `--check` only validates, and `--ci` is the setting for a
|
|
684
|
+
merge job. A recipe the repository no longer lists keeps its published versions, marked retired, with any
|
|
685
|
+
replacements `sous.repo.yaml` names (see
|
|
686
|
+
[Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every recipe that
|
|
687
|
+
uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
|
|
686
688
|
[Recommend other recipes](repositories-authoring.md#recommend-other-recipes)).
|
|
687
689
|
|
|
690
|
+
`--create-manifest` creates `sous.repo.yaml` at the project root, listing the project's recipe paths, when there
|
|
691
|
+
is none, without asking. `--publish-dependencies` also publishes the project's own recipes that a published
|
|
692
|
+
recipe depends on, without asking. `--yes` answers neither question; see
|
|
693
|
+
[What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
|
|
694
|
+
|
|
688
695
|
```bash
|
|
689
696
|
sous repo release --recipe workflow/task-files --bump minor --push
|
|
690
|
-
sous repo release --ci --
|
|
697
|
+
sous repo release --ci --push
|
|
698
|
+
sous repo release --create-manifest --publish-dependencies --yes
|
|
691
699
|
```
|
|
692
700
|
|
|
693
701
|
### `sous repo submit [REPO]`
|
|
@@ -746,7 +754,7 @@ explaining the repository `project`.
|
|
|
746
754
|
asks and where its files go, even before anything installs it.
|
|
747
755
|
|
|
748
756
|
```bash
|
|
749
|
-
sous namespace show sous
|
|
757
|
+
sous namespace show sous:core
|
|
750
758
|
sous recipe show omakase/house
|
|
751
759
|
```
|
|
752
760
|
|
|
@@ -794,9 +802,9 @@ $ sous subscription add workflow --non-interactive
|
|
|
794
802
|
Error: Sous has to ask which 'workflow' you meant, and it is not running where it can ask.
|
|
795
803
|
Why: the '--non-interactive' flag was passed.
|
|
796
804
|
'workflow' matched 2 things:
|
|
797
|
-
|
|
805
|
+
the-pantry:workflow (the whole namespace 'workflow' in the repository 'the-pantry')
|
|
798
806
|
qa:workflow (the whole namespace 'workflow' in the repository 'qa')
|
|
799
|
-
Answer it ahead of time: write the full reference (for example '
|
|
807
|
+
Answer it ahead of time: write the full reference (for example 'the-pantry:workflow'), or
|
|
800
808
|
pass '--accept-first' to take the first candidate listed above.
|
|
801
809
|
```
|
|
802
810
|
|
|
@@ -71,7 +71,7 @@ Prints one value by dot-path, with `[n]` for array indices:
|
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
73
|
sous config get name
|
|
74
|
-
sous config get repos.
|
|
74
|
+
sous config get repos.the-pantry.url
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
Scalars print raw (no quotes); objects and arrays print as pretty JSON. A missing path exits
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Layers and Merging
|
|
2
2
|
|
|
3
3
|
Sous builds one config for a project from many sources: the primary `sous.config.*` file, each
|
|
4
|
-
file in `conf.d/`, the config files recipes ship, the entries sous adds itself (the
|
|
5
|
-
|
|
4
|
+
file in `conf.d/`, the config files recipes ship, the entries sous adds itself (the repositories
|
|
5
|
+
`sous` and `the-pantry`, and the `core` subscription), and any plugin that changes the config. Sous combines
|
|
6
6
|
them all before any command does its work, and again after a command that changed the config.
|
|
7
7
|
|
|
8
8
|
## Which files are read
|
|
@@ -44,7 +44,8 @@ sous build
|
|
|
44
44
|
The skill is written to `.claude/skills/review-helpers/SKILL.md`, as a subscribed recipe's skill
|
|
45
45
|
would be. There was nothing to subscribe to: every recipe the project's recipe paths cover is in
|
|
46
46
|
use. The manifest needs no `namespace` and no `version`. The namespace, `tooling`, came from the
|
|
47
|
-
folder holding the recipe (see [Namespaces](#namespaces)), and a version
|
|
47
|
+
folder holding the recipe (see [Namespaces](#namespaces)), and a version matters only once it is
|
|
48
|
+
published (see [Publishing](#publishing)).
|
|
48
49
|
|
|
49
50
|
Sous lists project recipes under the reserved repository name `project`, so the full ref of this
|
|
50
51
|
one is `project:tooling/review-helpers`:
|
|
@@ -131,7 +132,7 @@ published recipe into `.sous/recipes/` to change it. The project recipe is used.
|
|
|
131
132
|
keeps its pin in the lockfile but is not built, and every build says so:
|
|
132
133
|
|
|
133
134
|
```text
|
|
134
|
-
Skipped the subscribed
|
|
135
|
+
Skipped the subscribed the-pantry:tooling/linting: this project's own recipe project:tooling/linting is used instead.
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
Delete the project recipe, or leave it out with `projectRecipes.exclude`, and the next build uses
|
|
@@ -153,7 +154,7 @@ subscribes:
|
|
|
153
154
|
```
|
|
154
155
|
|
|
155
156
|
```json
|
|
156
|
-
"workflow/task-files": { "kind": "subscribes", "repo": "
|
|
157
|
+
"workflow/task-files": { "kind": "subscribes", "repo": "the-pantry", "version": "1.0.2",
|
|
157
158
|
"requestedBy": ["tooling/review-helpers"], "hash": "sha256-..." }
|
|
158
159
|
```
|
|
159
160
|
|
|
@@ -181,9 +182,19 @@ character, so `.sous/recipes/*` watches all of `.sous/recipes/`.
|
|
|
181
182
|
|
|
182
183
|
## Publishing
|
|
183
184
|
|
|
184
|
-
A project recipe is never published by being there. A project
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
A project recipe is never published by being there. A project publishes the recipes its own
|
|
186
|
+
`sous.repo.yaml` lists (folders or glob patterns, such as `.sous/recipes/*`), through
|
|
187
|
+
`sous repo release`. Run in a project with no `sous.repo.yaml`, the release lists the project's
|
|
188
|
+
recipe paths and offers to create one listing them (`--create-manifest` answers yes).
|
|
189
|
+
|
|
190
|
+
A project recipe needs nothing more to be published. Its namespace is worked out the same way as for
|
|
191
|
+
a build (see [Namespaces](#namespaces)), and when it came from step 3 or later (the config, a
|
|
192
|
+
`package.json`, git or the folder's name), the release first writes a `sous.namespace.yaml` naming it
|
|
193
|
+
in the folder holding the recipe, so its published key never changes. A recipe with no `version` is
|
|
194
|
+
published as `1.0.0`, which the release writes into its manifest. A published recipe that depends on a
|
|
195
|
+
project recipe the manifest does not list makes the release ask whether to publish that one too
|
|
196
|
+
(`--publish-dependencies` answers yes). See
|
|
197
|
+
[What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
|
|
187
198
|
|
|
188
199
|
## Where to go next
|
|
189
200
|
|
|
@@ -26,8 +26,8 @@ $ sous repo init ./my-recipes --name my-recipes --namespace workflow
|
|
|
26
26
|
// then sous init sets the repository up as a sous project, and runs its first build
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`--name` is the repository's short name (default: the directory's own name), `--namespace` the
|
|
30
|
-
|
|
29
|
+
`--name` is the repository's short name (default: the directory's own name), `--namespace` the example recipe's
|
|
30
|
+
namespace, described in `sous.repo.yaml` (default: the repository's name), and `--dry-run` lists the files without writing them. `--host` names the repository host whose release automation to add:
|
|
31
31
|
`github` writes `.github/workflows/sous-release.yml`, and `gitlab` writes `.gitlab-ci.yml`. Without it, the host is
|
|
32
32
|
read from the directory's `origin` remote, and is `github` when there is none. Names are lowercase kebab-case, so `My-Recipes` yields `my-recipes`. Every
|
|
33
33
|
file is read back through the schemas sous uses on published repositories, so the scaffold validates. The scaffold
|
|
@@ -47,8 +47,11 @@ directory that already holds a sous config keeps it, and init is skipped with a
|
|
|
47
47
|
The command never replaces a file that exists, so it is safe to run in a directory that already holds a README
|
|
48
48
|
or a `.gitignore`. A file that exists (`README.md`, `CONTRIBUTING.md`, `sous.repo.yaml`, the workflow, the example
|
|
49
49
|
recipe's files) is left as it is and named in a note; when it keeps an existing `sous.repo.yaml`, it writes no
|
|
50
|
-
example recipe, which that manifest would not list. `.gitignore`
|
|
51
|
-
below the lines already there, and a second run leaves
|
|
50
|
+
example recipe, which that manifest would not list. `.gitignore` and `.gitattributes` each gain a block between
|
|
51
|
+
sous's marker comments, below the lines already there, and a second run leaves them as they are. The
|
|
52
|
+
`.gitattributes` block, `* text=auto eol=lf`, keeps every checkout at LF line endings: sous hashes recipe files
|
|
53
|
+
byte for byte, so a checkout that turned them into CRLF (git on Windows, by default) would change every
|
|
54
|
+
recipe's hash. `--overwrite` replaces the existing files with
|
|
52
55
|
the scaffold's. `--force` is the same flag as `--yes`; it used to mean overwrite.
|
|
53
56
|
|
|
54
57
|
`sous.repo.yaml` says what the repository publishes, and each recipe folder carries one `sous.recipe.yaml` beside the files it contributes. The scaffold writes no
|
|
@@ -56,7 +59,7 @@ the scaffold's. `--force` is the same flag as `--yes`; it used to mean overwrite
|
|
|
56
59
|
`sous repo release` records the catalog of published versions below the fields you edit. `CONTRIBUTING.md` is
|
|
57
60
|
for agents: it says that contribution instructions are written for agents, and that `sous build` after cloning
|
|
58
61
|
installs the sous core skills, which explain how a recipe repository works. The scaffold follows
|
|
59
|
-
[`sous-io/
|
|
62
|
+
[`sous-io/the-pantry`](https://github.com/sous-io/the-pantry), a complete repository minus its recipes, and
|
|
60
63
|
its placeholder skill is named `SKILL.tpl.md` because it ends with a footer that only a render fills in. Nothing else is
|
|
61
64
|
fixed: recipe folders may live anywhere, and what makes a folder a recipe is that `sous.repo.yaml` lists its
|
|
62
65
|
path under `recipes`. Both hand-written manifests are YAML or JSON and never JavaScript, because manifests are
|
|
@@ -90,12 +93,18 @@ recipes. `--workflow`, `--example` and `--readme` answer yes ahead of time; `--n
|
|
|
90
93
|
README section sits between sous's marker comments, so the rest of the file is never touched. `--in-sous-directory`
|
|
91
94
|
writes the manifest into `.sous/` instead, where sous also looks for it. `--for-project` does not run
|
|
92
95
|
`sous init`; run it first if the project has no `.sous/` yet. A project with its own release pipeline adds one
|
|
93
|
-
step to it, `sous repo release --ci --push`, instead of the workflow.
|
|
96
|
+
step to it, `sous repo release --ci --push --yes`, instead of the workflow.
|
|
97
|
+
|
|
98
|
+
`--for-project` is optional: `sous repo release`, run in a project with no `sous.repo.yaml`, lists the
|
|
99
|
+
project's recipe paths and offers to create one at the project root listing them (`--create-manifest` answers
|
|
100
|
+
yes; see [Cut a release](#cut-a-release)).
|
|
94
101
|
|
|
95
102
|
## Write a recipe
|
|
96
103
|
|
|
97
|
-
Copy the example folder, edit its manifest, and
|
|
98
|
-
|
|
104
|
+
Copy the example folder, edit its manifest, and make sure the `recipes` list in `sous.repo.yaml` covers its
|
|
105
|
+
folder: list the folder (`recipes:`, then `- recipes/workflow/task-files` under it), or a glob pattern that
|
|
106
|
+
matches it, such as `recipes/*/*`. A pattern is expanded the way a project expands its own recipe paths, so a
|
|
107
|
+
new folder under it is published with no edit to the list.
|
|
99
108
|
|
|
100
109
|
```yaml
|
|
101
110
|
formatVersion: 1
|
|
@@ -115,7 +124,14 @@ relative to the recipe folder (and optional `exclude` patterns). Sous registers
|
|
|
115
124
|
`prompts` and `config`, and a sous plugin may register more; the kind decides what happens to them in the subscriber's project, which the subscriber shapes with
|
|
116
125
|
[`recipes`](repositories-file-formats.md#recipes-what-each-content-kind-does). Field tables are in the
|
|
117
126
|
[recipe manifest](repositories-file-formats.md#sousrecipeyaml-the-recipe-manifest) reference, and recipe
|
|
118
|
-
metadata is the source of truth for the version: never edit `
|
|
127
|
+
metadata is the source of truth for the version: never edit the published data (the `published:` block of
|
|
128
|
+
`sous.repo.yaml`, or `sous.index.json`) by hand.
|
|
129
|
+
|
|
130
|
+
`namespace` and `version` may be left out. A recipe with no `namespace` gets one worked out from where it sits,
|
|
131
|
+
as a project's own recipe does (see [Namespaces](project-recipes.md#namespaces)): the nearest
|
|
132
|
+
`sous.namespace.yaml` above it that sets a `name`, then the first folder under the `recipes` path that found
|
|
133
|
+
it, then the project's names. A recipe with no `version` is released as `1.0.0` the first time, and the release
|
|
134
|
+
writes that version into its manifest.
|
|
119
135
|
|
|
120
136
|
?> To write a recipe for one project only, or to try one out before it is published, put it under that
|
|
121
137
|
project's `.sous/recipes/` instead: every build uses it from the working tree, with no release. See
|
|
@@ -296,7 +312,7 @@ are asked and its answers reach your templates. Both hold plain strings naming t
|
|
|
296
312
|
depends:
|
|
297
313
|
- workflow/qa-helper # a sibling: ^ its version at release
|
|
298
314
|
- workflow/qa-helper@1.1.4 # a sibling at exactly one version
|
|
299
|
-
- github://sous-io/
|
|
315
|
+
- github://sous-io/the-pantry/workflow/sat@^1.0 # another repository
|
|
300
316
|
- gitlab://gitlab.example.com/group/subgroup/proj/-/qa/lint # a self-hosted host, with subgroups
|
|
301
317
|
- https://github.com/acme/recipes/tree/main/recipes/lint # a URL copied from the browser
|
|
302
318
|
subscribes:
|
|
@@ -330,7 +346,7 @@ recommends:
|
|
|
330
346
|
reason: >-
|
|
331
347
|
/review flags untested changes much more precisely when the coverage skill is present. Skip it if your
|
|
332
348
|
project has no test suite.
|
|
333
|
-
- ref: github://sous-io/
|
|
349
|
+
- ref: github://sous-io/the-pantry/workflow/task-files@^1.2
|
|
334
350
|
reason: Lets /review attach its findings to the current task file.
|
|
335
351
|
```
|
|
336
352
|
|
|
@@ -348,8 +364,8 @@ instructions so they still read correctly without it ("if the task-files skill i
|
|
|
348
364
|
|
|
349
365
|
## Cut a release
|
|
350
366
|
|
|
351
|
-
`sous repo release` publishes new versions: one run raises versions,
|
|
352
|
-
and cuts the tags. Run it inside the repository, with your recipe changes committed.
|
|
367
|
+
`sous repo release` publishes new versions: one run raises versions, writes the published data, commits what
|
|
368
|
+
changed, and cuts the tags. Run it inside the repository, with your recipe changes committed.
|
|
353
369
|
|
|
354
370
|
```term
|
|
355
371
|
$ sous repo release
|
|
@@ -363,9 +379,9 @@ $ sous repo release
|
|
|
363
379
|
|
|
364
380
|
This run would:
|
|
365
381
|
Raise the versions listed above, in the manifests that declare them.
|
|
366
|
-
|
|
367
|
-
Commit the
|
|
368
|
-
Cut one annotated tag per version, dependency-first.
|
|
382
|
+
Write the published data into sous.repo.yaml published, with each version's dependencies resolved.
|
|
383
|
+
Commit the changed files and the published data together.
|
|
384
|
+
Cut one annotated tag per version, dependency-first, each carrying its content hash.
|
|
369
385
|
Push nothing; pass '--push' to push what it makes.
|
|
370
386
|
|
|
371
387
|
Publish these versions? yes
|
|
@@ -373,7 +389,7 @@ Publish these versions? yes
|
|
|
373
389
|
▶ Publishing:
|
|
374
390
|
|
|
375
391
|
workflow/qa-helper: 0.1.0 becomes 0.1.1.
|
|
376
|
-
|
|
392
|
+
written sous.repo.yaml
|
|
377
393
|
Committed: Release workflow/qa-helper@0.1.1
|
|
378
394
|
Created the tag workflow/qa-helper@0.1.1.
|
|
379
395
|
```
|
|
@@ -384,13 +400,21 @@ stops. Three facts about each recipe decide that plan and nothing else does: whe
|
|
|
384
400
|
files changed since the tag that last published it, and whether its version was already raised past that tag. The
|
|
385
401
|
third case is what a merge looks like to continuous integration: the bump is done, so the run only publishes it.
|
|
386
402
|
|
|
403
|
+
Where the published data goes is the repository's choice: embedded in `sous.repo.yaml` under `published:`
|
|
404
|
+
(where a repository that has published nothing puts it), in `sous.index.json` or another `.json` file, or
|
|
405
|
+
nowhere but the release tags (`index: tags`). Each form, and what a release writes in it, is in
|
|
406
|
+
[Where the published data lives](repositories-file-formats.md#where-the-published-data-lives). Every annotated
|
|
407
|
+
release tag's message carries the version's content hash on a line of its own, `Sous-Hash: sha256-...`, in every
|
|
408
|
+
form.
|
|
409
|
+
|
|
387
410
|
`--namespace <ns>` and `--recipe <ns/name>` narrow the run and both repeat; `--bump <level>` is `patch` (the
|
|
388
411
|
default), `minor`, `major` or `prerelease`; `--no-bump` raises nothing; `--include-unchanged` releases every
|
|
389
412
|
recipe in scope, changed or not; `--check` only reads, validating, failing on any problem the release would
|
|
390
413
|
refuse and on a change to a recipe whose [`submissions`](repositories-file-formats.md#the-submissions-block)
|
|
391
|
-
block says it takes no proposals, and reporting how merging would rewrite the committed
|
|
392
|
-
on it, since that
|
|
393
|
-
|
|
414
|
+
block says it takes no proposals, and reporting how merging would rewrite the committed published data without
|
|
415
|
+
failing on it (`Merging rewrites <file>, because:`, then each reason), since that data is the release's output;
|
|
416
|
+
and `--ci` is the merge preset: never bump, accept the plan, never ask, fail on anything unbumped. Every flag
|
|
417
|
+
this command takes, `--tag`, `--push`, `--publish-dependencies` and `--create-manifest` among them, is in the
|
|
394
418
|
[command reference](commands.md#sous-repo-release).
|
|
395
419
|
|
|
396
420
|
`--bump` and `--no-bump` contradict each other, and so do `--check` and `--ci`; sous refuses the combination and
|
|
@@ -398,10 +422,53 @@ says which one to keep. `--ci` implies `--no-bump` and `--yes`, accepting the pl
|
|
|
398
422
|
but it deliberately does not imply `--push`, so what a workflow pushes stays visible in the workflow file. Under
|
|
399
423
|
either, a recipe whose files changed without a bump is an error naming its manifest and the colliding tag.
|
|
400
424
|
|
|
401
|
-
`--push` pushes the branch to `origin`, plus every release tag that
|
|
402
|
-
holds and that `origin` lacks
|
|
403
|
-
|
|
404
|
-
|
|
425
|
+
`--push` pushes the branch to `origin`, plus every release tag that the published data names, that this checkout
|
|
426
|
+
holds and that `origin` lacks (with `index: tags`, every release tag the checkout holds that `origin` lacks).
|
|
427
|
+
That includes tags an earlier run cut without `--push`, so the pushed published data never names a tag
|
|
428
|
+
subscribers cannot fetch. The tags go first, then the branch. A `--push` run with nothing new to release still
|
|
429
|
+
pushes them, which is how to send a release you made without `--push`.
|
|
430
|
+
|
|
431
|
+
A run with no new version still rewrites the published data when it differs from what the repository publishes
|
|
432
|
+
(a recipe retired or moved, a namespace description changed, data written by an older sous), lists why, and
|
|
433
|
+
commits it as `Update the published data of <name>`. It asks first, unless `--yes` or `--ci` is given.
|
|
434
|
+
|
|
435
|
+
### What a release writes for you
|
|
436
|
+
|
|
437
|
+
A release fills in what a repository left out, so the first release of a project's own recipes needs nothing
|
|
438
|
+
written by hand:
|
|
439
|
+
|
|
440
|
+
- **No `sous.repo.yaml`.** When there is none in the directory, its `.sous/` directory or any directory above,
|
|
441
|
+
the release lists the project's recipe paths (`projectRecipes.paths`, `.sous/recipes/*` by default) and asks
|
|
442
|
+
whether to create `sous.repo.yaml` at the project root, listing them. `--create-manifest` answers yes; without
|
|
443
|
+
a terminal and without it, the release fails naming the switch. The new manifest holds only `recipes`, so its
|
|
444
|
+
published data is embedded. `--check` and `--dry-run` never create it: their error says to run the release
|
|
445
|
+
without them, or to run `sous repo init --for-project`.
|
|
446
|
+
- **No `version`.** A recipe whose manifest names none is released as `1.0.0`, and the release writes
|
|
447
|
+
`version: 1.0.0` into the manifest, in place, keeping its comments. A recipe that already has release tags but
|
|
448
|
+
names no version is an error.
|
|
449
|
+
- **A namespace worked out from outside the recipe.** When a recipe's namespace came from the project's sous
|
|
450
|
+
config `name`, its `package.json`, its git `origin` or its folder's name, a later change to any of them would
|
|
451
|
+
change the recipe's published key. So before publishing it, the release writes a `sous.namespace.yaml` holding
|
|
452
|
+
`name: <namespace>` in the folder holding the recipe (or sets `name` in the one already there, in place). If
|
|
453
|
+
that file would change the key of another recipe, the release takes it back and stops, asking you to add
|
|
454
|
+
`namespace:` to the manifests instead.
|
|
455
|
+
- **A dependency the repository does not publish.** When a recipe it publishes depends, with no location, on one
|
|
456
|
+
of the project's own recipes that `sous.repo.yaml` does not list, subscribers could never install it. The
|
|
457
|
+
release lists those recipes and asks whether to publish them too; `--publish-dependencies` answers yes, and
|
|
458
|
+
declining stops the release. Yes adds their folders to `recipes` (and writes a `sous.namespace.yaml` for one
|
|
459
|
+
whose namespace came from its folder, so its key stays the same). Without a terminal and without the switch
|
|
460
|
+
the release fails naming it. `--check` and `--dry-run` report it as an error.
|
|
461
|
+
|
|
462
|
+
`--yes` answers neither of the two questions above; only their own switches do. A first release that should
|
|
463
|
+
ask nothing passes all three:
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
sous repo release --create-manifest --publish-dependencies --yes
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
The release commits every one of these changes before it cuts the tags. A repository that keeps its published
|
|
470
|
+
data in its tags alone (`index: tags`) is the exception under `--ci`, which changes no file there: each of these
|
|
471
|
+
changes is an error saying to commit it first, or to run the release on a machine.
|
|
405
472
|
|
|
406
473
|
### The branch rule
|
|
407
474
|
|
|
@@ -434,13 +501,16 @@ hash, its dependencies and its variable definitions are carried forward exactly
|
|
|
434
501
|
disagreement is an error telling you to bump rather than republish
|
|
435
502
|
([what is checked](repositories-file-formats.md#sousindexjson)). A version counts
|
|
436
503
|
as published once its tag exists, and the tags are the backstop, so a tagged version missing from the index is
|
|
437
|
-
rebuilt from it, dependencies included, whenever the index is regenerated,
|
|
438
|
-
publishes something. A bump edits the manifest in place, so comments, field order and layout survive; a folded
|
|
504
|
+
rebuilt from it, dependencies included, whenever the index is regenerated. A bump edits the manifest in place, so comments, field order and layout survive; a folded
|
|
439
505
|
block of YAML prose may be re-wrapped and the space before a trailing comment collapsed to one.
|
|
440
506
|
|
|
441
|
-
!> A release commits the version bumps
|
|
442
|
-
|
|
443
|
-
|
|
507
|
+
!> A release commits the files it changed (version bumps, a first version, a namespace file, the repository
|
|
508
|
+
manifest, the published data), and nothing else; the only other commit sous ever makes for you is
|
|
509
|
+
`sous repo submit --commit`. It refuses to run while anything it publishes or writes has uncommitted changes:
|
|
510
|
+
every recipe folder it publishes, `sous.repo.yaml`, the index file when the published data is one, and any
|
|
511
|
+
`sous.namespace.yaml` it is about to write, because a tag names one commit and the published data records what
|
|
512
|
+
each recipe folder holds right now. A file the same run wrote earlier (a `sous.repo.yaml` it just created, for
|
|
513
|
+
example) does not count.
|
|
444
514
|
Uncommitted changes to any other file (such as the project files a newer sous rewrites when it runs its
|
|
445
515
|
migrations in a continuous integration checkout) do not stop it, and its commit leaves them out. It also
|
|
446
516
|
refuses when git does not know who is committing: set `git config user.name` and `git config user.email` first, or
|
|
@@ -460,8 +530,8 @@ retired:
|
|
|
460
530
|
- github://other/recipes/tools/widget # a recipe in another repository
|
|
461
531
|
```
|
|
462
532
|
|
|
463
|
-
A recipe that moved to another repository is retired the same way, naming its new home.
|
|
464
|
-
|
|
533
|
+
A recipe that moved to another repository is retired the same way, naming its new home. The next release
|
|
534
|
+
writes the retirement into the published data, even when it publishes no new version. The fields and what
|
|
465
535
|
the release checks are in [Retired recipes](repositories-file-formats.md#retired-recipes); what a
|
|
466
536
|
subscriber sees is in [Retired recipes](repositories-consuming.md#retired-recipes).
|
|
467
537
|
|
|
@@ -471,7 +541,7 @@ On GitHub, `sous repo init` writes `.github/workflows/sous-release.yml`, which r
|
|
|
471
541
|
calling the CLI from npm so nothing is installed into the repository. On a **pull request** it runs
|
|
472
542
|
`npx --yes @sous-io/sous repo release --check`, which only reads, so it is safe on an untrusted branch and
|
|
473
543
|
fails the pull request when a manifest is wrong or a published version changed, and notes how the merge will
|
|
474
|
-
rewrite the
|
|
544
|
+
rewrite the published data. On a **push to `main`** it
|
|
475
545
|
runs `npx --yes @sous-io/sous repo release --ci --push --yes`; edit the workflow's `branches` list if your
|
|
476
546
|
default branch has another name. `--ci` accepts the plan on its own, the redundant `--yes` keeping the file
|
|
477
547
|
working with an older published sous. Both jobs check out with `fetch-depth: 0`, so existing tags are visible
|
|
@@ -612,7 +682,7 @@ commands this section and [Edit a repository in place](#edit-a-repository-in-pla
|
|
|
612
682
|
|
|
613
683
|
`sous repo submit` proposes a change to a repository's maintainers and follows it through; it never publishes
|
|
614
684
|
and never writes to a repository directly. Run it inside the recipe repository you changed, or from a project
|
|
615
|
-
that links it: `sous repo submit
|
|
685
|
+
that links it: `sous repo submit the-pantry` runs in the linked checkout, and with no argument the project's
|
|
616
686
|
only linked repository is used (several are a question). A repository you have since unlinked is still
|
|
617
687
|
submitted from the checkout sous cloned for it, with a note saying so; with no checkout at all there is no
|
|
618
688
|
working copy to propose from, and `submit` says so.
|
|
@@ -623,9 +693,12 @@ It prints each step as it runs them:
|
|
|
623
693
|
(`gh` or `glab`) is installed and signed in, and everything is committed. `--commit` lifts that last rule:
|
|
624
694
|
sous lists what is uncommitted, asks once (`--yes` answers), checks git knows who is committing before
|
|
625
695
|
writing anything, and commits it all with the proposal's title, description and changelog as the message.
|
|
626
|
-
2. **Validation.** The repository validates, and your change leaves
|
|
627
|
-
proposal never fails the maintainer's own checks and wastes their review.
|
|
628
|
-
|
|
696
|
+
2. **Validation.** The repository validates, and your change leaves the published data as it found it, so a
|
|
697
|
+
proposal never fails the maintainer's own checks and wastes their review. Where the repository keeps it in an
|
|
698
|
+
index file, the change may not edit that file; where it is embedded in `sous.repo.yaml`, only the
|
|
699
|
+
`published:` block is compared, so a proposal may edit the rest of the manifest (to list a new recipe, for
|
|
700
|
+
example); a repository that publishes through its tags alone has nothing to compare. The published data is
|
|
701
|
+
written by the repository's own release after a merge; whether it agrees with the release tags is checked there, by
|
|
629
702
|
`sous repo release --check` on a full clone, not by `submit`. That is what lets `submit` run from the shallow
|
|
630
703
|
checkout `sous repo link` makes, which holds almost none of the tags. The comparison is made against the
|
|
631
704
|
copy of the default branch your checkout holds (`origin/main`, for example); when it holds none, `submit`
|
|
@@ -11,15 +11,15 @@ decision covers is [Trust](repositories.md#trust). Only what the repository publ
|
|
|
11
11
|
([How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository)):
|
|
12
12
|
|
|
13
13
|
```term
|
|
14
|
-
$ sous repo add https://github.com/sous-io/
|
|
14
|
+
$ sous repo add https://github.com/sous-io/the-pantry
|
|
15
15
|
// the trust question, then a small download
|
|
16
16
|
▶ Adding a repository:
|
|
17
|
-
Repository:
|
|
18
|
-
Location : https://github.com/sous-io/
|
|
17
|
+
Repository: the-pantry
|
|
18
|
+
Location : https://github.com/sous-io/the-pantry
|
|
19
19
|
Provider : github
|
|
20
20
|
Namespaces: communication, core, tool-usage, workflow
|
|
21
21
|
Recipes : 6
|
|
22
|
-
This project now trusts '
|
|
22
|
+
This project now trusts 'the-pantry'. Nothing from it has been installed.
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
`--name` sets the short name refs will use (it defaults to the last segment of the URL; `sous repo
|
|
@@ -443,8 +443,10 @@ config file rather than the managed layer is named and left alone.
|
|
|
443
443
|
## Opt out of `core`
|
|
444
444
|
|
|
445
445
|
The `core` subscription is an ordinary config entry, explained under
|
|
446
|
-
[the built-in core](repositories.md#the-
|
|
447
|
-
`subscriptions: { core: { enabled: false } }` into your config removes it.
|
|
446
|
+
[the built-in core](repositories.md#the-built-in-repositories-and-core); writing
|
|
447
|
+
`subscriptions: { core: { enabled: false } }` into your config removes it. That is the only way to drop
|
|
448
|
+
`core`: the `sous` repository that publishes it cannot be switched off, and
|
|
449
|
+
`repos: { "the-pantry": { enabled: false } }` switches off the official recipe repository instead.
|
|
448
450
|
|
|
449
451
|
`sous subscription remove core` writes exactly that into the managed subscriptions layer, because
|
|
450
452
|
there is no entry to delete: the one sous provides comes back on the next run, so only a recorded
|
|
@@ -13,7 +13,7 @@ hand.
|
|
|
13
13
|
Name the repository, or any namespace or recipe it publishes:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
sous repo contribute
|
|
16
|
+
sous repo contribute the-pantry # the repository itself
|
|
17
17
|
sous repo contribute workflow/task-files # the repository that publishes this recipe
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -53,7 +53,7 @@ Finishing proposes whatever is not proposed yet, so you can go straight to [Fini
|
|
|
53
53
|
now and keep working, run the submit step on its own:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
sous repo submit
|
|
56
|
+
sous repo submit the-pantry --title "Clarify the resume steps" --body "The resume steps skipped the task file."
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
`sous repo submit` validates the repository, pushes the branch (through a fork on your own account when you
|
|
@@ -64,15 +64,15 @@ under [Contribute to someone else's repository](repositories-authoring.md#contri
|
|
|
64
64
|
## Revise it
|
|
65
65
|
|
|
66
66
|
Review comments are answered with more commits on the same branch. Commit them, then run
|
|
67
|
-
`sous repo submit
|
|
67
|
+
`sous repo submit the-pantry` again: it finds the open proposal for the branch and pushes the new commits into
|
|
68
68
|
it. A new `--title` or `--body` replaces the proposal's own. With nothing new to send, it reports where the
|
|
69
|
-
proposal stands (review, checks, and whether it can merge). `sous repo submit
|
|
69
|
+
proposal stands (review, checks, and whether it can merge). `sous repo submit the-pantry --status` only
|
|
70
70
|
reports.
|
|
71
71
|
|
|
72
72
|
## Finish
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
sous repo contribute
|
|
75
|
+
sous repo contribute the-pantry --finish
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Finishing first looks at the branch for work no proposal carries yet: uncommitted changes, commits that were never
|
|
@@ -102,7 +102,7 @@ A contribution ships when the repository's maintainers merge it and the reposito
|
|
|
102
102
|
that happened before you finished, `--finish` already moved your pins to it. If it happens later, move them with
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
sous update
|
|
105
|
+
sous update the-pantry
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
which runs the same update `unlink --update` runs; with `--dry-run` it only shows what it would move. See
|
|
@@ -110,12 +110,14 @@ which runs the same update `unlink --update` runs; with `--dry-run` it only show
|
|
|
110
110
|
|
|
111
111
|
## What a contributor leaves alone
|
|
112
112
|
|
|
113
|
-
**Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits
|
|
114
|
-
`sous.index.json
|
|
115
|
-
tags; `sous repo submit` refuses a change that
|
|
113
|
+
**Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits the
|
|
114
|
+
published data: `sous.index.json`, or the `published:` block of `sous.repo.yaml`. It is written by the
|
|
115
|
+
repository's own release after a merge, from the manifests and the tags; `sous repo submit` refuses a change that
|
|
116
|
+
edits it, and says how to put it back. The rest of `sous.repo.yaml` is yours to edit, to list a new recipe, for
|
|
117
|
+
example.
|
|
116
118
|
|
|
117
119
|
**Versions depend on how the repository releases.** The release workflow `sous repo init` scaffolds, which
|
|
118
|
-
`
|
|
120
|
+
`the-pantry` also runs, publishes on every merge to the default branch with `sous repo release --ci`, and that
|
|
119
121
|
raises no versions: the version a merge publishes is the one the merged change declares. A recipe whose files
|
|
120
122
|
changed while its `version` still equals its last release tag stops that release. So, unless the repository's
|
|
121
123
|
contribution guide says its maintainers raise versions themselves, raise the recipe's `version` in its
|
|
@@ -124,15 +126,12 @@ or a new optional variable, and a major step for anything that breaks an existin
|
|
|
124
126
|
renaming a variable, or tightening a variable's validation). The changelog `sous repo submit` generates lists any
|
|
125
127
|
recipe your change touches without a version raise, with a warning that a `--ci` release refuses it, so a missed
|
|
126
128
|
one is visible in the proposal. The repository's
|
|
127
|
-
own guide is named by the `contribute` field of its `sous.repo.yaml`; for `
|
|
129
|
+
own guide is named by the `contribute` field of its `sous.repo.yaml`; for `the-pantry` it is its
|
|
128
130
|
`CONTRIBUTING.md`, and a repository `sous repo init` created starts with a `CONTRIBUTING.md` of the same kind.
|
|
129
131
|
|
|
130
|
-
**Core is edited in sous itself.** The `core`
|
|
131
|
-
source is
|
|
132
|
-
|
|
133
|
-
[`submissions`](repositories-file-formats.md#the-submissions-block) block: `sous repo submit` warns before
|
|
134
|
-
proposing a change that touches one and names where to send it instead, and the repository's own pull request
|
|
135
|
-
check refuses such a change. Propose core edits as a pull request to `sous-io/sous`.
|
|
132
|
+
**Core is edited in sous itself.** The `core` recipe is published from `sous-io/sous`, the repository of sous
|
|
133
|
+
itself, and its source is `.sous/recipes/core/sous-skills/` there. Propose core edits as a pull request to
|
|
134
|
+
`sous-io/sous`.
|
|
136
135
|
|
|
137
136
|
## The commands this chains
|
|
138
137
|
|