reposets 1.0.12 → 1.0.14
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/bin/reposets.js +1 -1
- package/cli/commands/credentials.js +5 -5
- package/cli/commands/drift.js +3 -3
- package/cli/commands/history.js +4 -4
- package/cli/commands/init.js +1 -1
- package/cli/commands/nuke.js +2 -2
- package/cli/commands/sync.js +8 -8
- package/cli/flags.js +2 -2
- package/package.json +9 -9
- package/tsdoc-metadata.json +1 -1
package/bin/reposets.js
CHANGED
|
@@ -79,7 +79,7 @@ const reportAndExit = (error) => Effect.gen(function* () {
|
|
|
79
79
|
});
|
|
80
80
|
/** Whether a caught value is a tagged error of a given tag. */
|
|
81
81
|
const isTagged = (error, tag) => typeof error === "object" && error !== null && "_tag" in error && error._tag === tag;
|
|
82
|
-
cli.pipe(Command.run({ version: "1.0.
|
|
82
|
+
cli.pipe(Command.run({ version: "1.0.14" }), Effect.catch(reportAndExit), Effect.provide(MainLive), NodeRuntime.runMain);
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { };
|
|
@@ -6,11 +6,11 @@ import { AppDirs } from "@effected/xdg";
|
|
|
6
6
|
|
|
7
7
|
//#region src/cli/commands/credentials.ts
|
|
8
8
|
const EMPTY = { profiles: {} };
|
|
9
|
-
const profileFlag = Flag.
|
|
10
|
-
const opFlag = Flag.
|
|
11
|
-
const envFlag = Flag.
|
|
12
|
-
const usernameFlag = Flag.
|
|
13
|
-
const orgFlag = Flag.
|
|
9
|
+
const profileFlag = Flag.String("profile").pipe(Flag.withDescription("Credential profile name"));
|
|
10
|
+
const opFlag = Flag.String("op").pipe(Flag.withDescription("1Password secret reference, e.g. \"op://Vault/item/field\""), Flag.optional);
|
|
11
|
+
const envFlag = Flag.String("env").pipe(Flag.withDescription("Name of an environment variable holding the token, e.g. \"REPOSETS_GITHUB_TOKEN\""), Flag.optional);
|
|
12
|
+
const usernameFlag = Flag.String("username").pipe(Flag.withDescription("The personal account this profile acts as. Mutually exclusive with --org"), Flag.optional);
|
|
13
|
+
const orgFlag = Flag.String("org").pipe(Flag.withDescription("The organization this profile acts within. Mutually exclusive with --username"), Flag.optional);
|
|
14
14
|
/**
|
|
15
15
|
* Recognisable credential prefixes, so an obvious paste-in-the-wrong-place is
|
|
16
16
|
* caught rather than stored.
|
package/cli/commands/drift.js
CHANGED
|
@@ -30,9 +30,9 @@ import { Command, Flag } from "effect/unstable/cli";
|
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
32
|
const driftCommand = Command.make("drift", {
|
|
33
|
-
group: Flag.
|
|
34
|
-
repo: Flag.
|
|
35
|
-
debug: Flag.
|
|
33
|
+
group: Flag.String("group").pipe(Flag.withDescription("Check only this group"), Flag.optional),
|
|
34
|
+
repo: Flag.String("repo").pipe(Flag.withDescription("Check only this repository"), Flag.optional),
|
|
35
|
+
debug: Flag.Boolean("debug").pipe(Flag.withDescription("Show the applied and live fingerprints behind each drift report"))
|
|
36
36
|
}, (input) => syncHandler({
|
|
37
37
|
dryRun: true,
|
|
38
38
|
noCleanup: true,
|
package/cli/commands/history.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Effect } from "effect";
|
|
|
3
3
|
import { Command, Flag } from "effect/unstable/cli";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/commands/history.ts
|
|
6
|
-
const limitFlag = Flag.
|
|
7
|
-
const repoFlag = Flag.
|
|
6
|
+
const limitFlag = Flag.Int("limit").pipe(Flag.withDescription("How many runs to show, newest first"), Flag.withDefault(20));
|
|
7
|
+
const repoFlag = Flag.String("repo").pipe(Flag.withDescription("Only runs that touched this repository, as \"owner/name\""), Flag.optional);
|
|
8
8
|
/**
|
|
9
9
|
* `2026-08-12 22:14` — enough to tell two runs apart, short enough to align.
|
|
10
10
|
*
|
|
@@ -194,8 +194,8 @@ const historyCommand = Command.make("history", {
|
|
|
194
194
|
limit,
|
|
195
195
|
repo: repo._tag === "Some" ? repo.value : void 0
|
|
196
196
|
})).pipe(Command.withDescription("Show what previous sync runs did, newest first"), Command.withSubcommands([
|
|
197
|
-
Command.make("show", { run: Flag.
|
|
198
|
-
Command.make("prune", { keep: Flag.
|
|
197
|
+
Command.make("show", { run: Flag.String("run").pipe(Flag.withDescription("A run id, or a unique prefix")) }, ({ run }) => showHandler(run)).pipe(Command.withDescription("Show every resource one run touched")),
|
|
198
|
+
Command.make("prune", { keep: Flag.Int("keep").pipe(Flag.withDescription("How many of the newest runs to keep"), Flag.withDefault(50)) }, ({ keep }) => pruneHandler(keep)).pipe(Command.withDescription("Delete all but the newest runs from the journal")),
|
|
199
199
|
Command.make("clear", {}, () => clearHandler()).pipe(Command.withDescription("Delete every run from the journal"))
|
|
200
200
|
]));
|
|
201
201
|
|
package/cli/commands/init.js
CHANGED
|
@@ -5,7 +5,7 @@ import { AppDirs } from "@effected/xdg";
|
|
|
5
5
|
import { cwd } from "node:process";
|
|
6
6
|
|
|
7
7
|
//#region src/cli/commands/init.ts
|
|
8
|
-
const projectFlag = Flag.
|
|
8
|
+
const projectFlag = Flag.Boolean("project").pipe(Flag.withDescription("Scaffold into the current directory instead of the XDG config directory"));
|
|
9
9
|
const CONFIG_TEMPLATE = `# reposets configuration
|
|
10
10
|
# See: https://github.com/spencerbeggs/reposets
|
|
11
11
|
|
package/cli/commands/nuke.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Command, Flag, Prompt } from "effect/unstable/cli";
|
|
|
4
4
|
import { AppDirs } from "@effected/xdg";
|
|
5
5
|
|
|
6
6
|
//#region src/cli/commands/nuke.ts
|
|
7
|
-
const forceFlag = Flag.
|
|
7
|
+
const forceFlag = Flag.Boolean("force").pipe(Flag.withDescription("Delete without asking. Intended for scripts; there is no undo"));
|
|
8
8
|
/**
|
|
9
9
|
* Everything reposets has written to this machine.
|
|
10
10
|
*
|
|
@@ -98,7 +98,7 @@ const nukeHandler = (force) => Effect.gen(function* () {
|
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
yield* Effect.log("");
|
|
101
|
-
if (!(yield* Prompt.
|
|
101
|
+
if (!(yield* Prompt.Confirm({ message: `Delete ${targets.length} file${targets.length === 1 ? "" : "s"}?` }).pipe(Effect.orElseSucceed(() => false)))) {
|
|
102
102
|
yield* Effect.log("Nothing was deleted.");
|
|
103
103
|
return;
|
|
104
104
|
}
|
package/cli/commands/sync.js
CHANGED
|
@@ -207,14 +207,14 @@ const syncHandler = (input) => Effect.gen(function* () {
|
|
|
207
207
|
* @public
|
|
208
208
|
*/
|
|
209
209
|
const syncCommand = Command.make("sync", {
|
|
210
|
-
dryRun: Flag.
|
|
211
|
-
noCleanup: Flag.
|
|
212
|
-
failOnDrift: Flag.
|
|
213
|
-
group: Flag.
|
|
214
|
-
repo: Flag.
|
|
215
|
-
only: Flag.
|
|
216
|
-
skip: Flag.
|
|
217
|
-
debug: Flag.
|
|
210
|
+
dryRun: Flag.Boolean("dry-run").pipe(Flag.withDescription("Report what would change without writing anything")),
|
|
211
|
+
noCleanup: Flag.Boolean("no-cleanup").pipe(Flag.withDescription("Skip deletion of undeclared resources")),
|
|
212
|
+
failOnDrift: Flag.Boolean("fail-on-drift").pipe(Flag.withDescription("Exit non-zero when a resource was changed outside reposets")),
|
|
213
|
+
group: Flag.String("group").pipe(Flag.withDescription("Sync only this group"), Flag.optional),
|
|
214
|
+
repo: Flag.String("repo").pipe(Flag.withDescription("Sync only this repository"), Flag.optional),
|
|
215
|
+
only: Flag.String("only").pipe(Flag.withDescription("Run only these phases"), (f) => Flag.atLeast(f, 0)),
|
|
216
|
+
skip: Flag.String("skip").pipe(Flag.withDescription("Skip these phases"), (f) => Flag.atLeast(f, 0)),
|
|
217
|
+
debug: Flag.Boolean("debug").pipe(Flag.withDescription("Annotate output with value sources and the fingerprints behind a drift report"))
|
|
218
218
|
}, (input) => syncHandler({
|
|
219
219
|
dryRun: input.dryRun,
|
|
220
220
|
noCleanup: input.noCleanup,
|
package/cli/flags.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Flag, GlobalFlag } from "effect/unstable/cli";
|
|
|
7
7
|
* `--config`, as a global flag.
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
|
-
* `GlobalFlag.
|
|
10
|
+
* `GlobalFlag.Setting` returns a `Context.Service` carrying the parsed value,
|
|
11
11
|
* which is the bridge between parse time and layer-construction time: a layer
|
|
12
12
|
* can require the flag in `R` instead of receiving it as a constructor argument.
|
|
13
13
|
*
|
|
@@ -18,7 +18,7 @@ import { Flag, GlobalFlag } from "effect/unstable/cli";
|
|
|
18
18
|
*
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
const ConfigFlag = GlobalFlag.
|
|
21
|
+
const ConfigFlag = GlobalFlag.Setting("config")({ flag: Flag.String("config").pipe(Flag.withDescription("Path to reposets.config.toml, or a directory containing it"), Flag.optional) });
|
|
22
22
|
/**
|
|
23
23
|
* The config-file layer, parameterized by `--config` read from the ambient flag
|
|
24
24
|
* service.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reposets",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI tool to sync GitHub repo settings, secrets and rulesets across personal repositories",
|
|
6
6
|
"keywords": [
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@1password/sdk": "^0.5.0",
|
|
51
|
-
"@effect/platform-node": "4.0.0-rc.
|
|
52
|
-
"@effected/app": "^0.
|
|
53
|
-
"@effected/config-file": "^0.
|
|
54
|
-
"@effected/github": "^0.
|
|
55
|
-
"@effected/store": "^0.
|
|
56
|
-
"@effected/toml": "^0.
|
|
57
|
-
"@effected/xdg": "^0.
|
|
51
|
+
"@effect/platform-node": "4.0.0-rc.115",
|
|
52
|
+
"@effected/app": "^0.16.1",
|
|
53
|
+
"@effected/config-file": "^0.9.0",
|
|
54
|
+
"@effected/github": "^0.10.1",
|
|
55
|
+
"@effected/store": "^0.8.0",
|
|
56
|
+
"@effected/toml": "^0.7.0",
|
|
57
|
+
"@effected/xdg": "^0.5.1",
|
|
58
58
|
"blakejs": "^1.2.1",
|
|
59
|
-
"effect": "4.0.0-rc.
|
|
59
|
+
"effect": "4.0.0-rc.115"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=24.11.0"
|