reposets 4.0.1 → 4.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/bin/reposets.js +8 -7
- package/cli/commands/doctor.js +3 -3
- package/cli/commands/init.js +2 -2
- package/cli/commands/nuke.js +1 -1
- package/cli/commands/sync.js +3 -3
- package/cli/commands/validate.js +1 -1
- package/index.js +1 -1
- package/package.json +16 -16
- package/store/SyncJournal.js +4 -3
- package/sync/SyncEngine.js +1 -1
- package/sync/phases/code-scanning.js +2 -2
- package/sync/phases/environments.js +1 -1
- package/sync/phases/index.js +1 -1
- package/sync/phases/rulesets.js +2 -2
- package/sync/phases/secrets.js +2 -2
- package/sync/phases/security.js +1 -1
- package/sync/phases/settings.js +2 -2
- package/sync/phases/variables.js +2 -2
package/bin/reposets.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Invocation } from "../services/Invocation.js";
|
|
3
2
|
import { CredentialsFilesLive } from "../services/ConfigFiles.js";
|
|
3
|
+
import { Invocation } from "../services/Invocation.js";
|
|
4
4
|
import { CACHE_OPTIONS, STORE_OPTIONS } from "../store/files.js";
|
|
5
5
|
import { SyncJournalLive } from "../store/SyncJournal.js";
|
|
6
6
|
import { credentialsCommand } from "../cli/commands/credentials.js";
|
|
7
7
|
import { doctorCommand } from "../cli/commands/doctor.js";
|
|
8
|
-
import { syncCommand } from "../cli/commands/sync.js";
|
|
9
8
|
import { driftCommand } from "../cli/commands/drift.js";
|
|
10
9
|
import { historyCommand } from "../cli/commands/history.js";
|
|
11
10
|
import { initCommand } from "../cli/commands/init.js";
|
|
12
11
|
import { listCommand } from "../cli/commands/list.js";
|
|
13
12
|
import { nukeCommand } from "../cli/commands/nuke.js";
|
|
13
|
+
import { syncCommand } from "../cli/commands/sync.js";
|
|
14
14
|
import { validateCommand } from "../cli/commands/validate.js";
|
|
15
15
|
import { ConfigFlag, ConfigLive } from "../cli/flags.js";
|
|
16
16
|
import { Effect, Layer, Predicate } from "effect";
|
|
17
17
|
import { App, AppCache, AppStore } from "@effected/app";
|
|
18
|
-
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
18
|
+
import { NodeCrypto, NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
19
19
|
import { CliAudience, CliRuntime, ConfigIssueRenderer, Fmt } from "@effected/cli";
|
|
20
20
|
import { Command } from "effect/cli";
|
|
21
21
|
|
|
@@ -31,7 +31,7 @@ import { Command } from "effect/cli";
|
|
|
31
31
|
* `0.0.0 (dev build)` from every build until the version was threaded down
|
|
32
32
|
* from here through {@link Invocation}.
|
|
33
33
|
*/
|
|
34
|
-
const VERSION = "4.0.
|
|
34
|
+
const VERSION = "4.0.2";
|
|
35
35
|
/**
|
|
36
36
|
* The application's directories: XDG resolution and the `reposets` namespace
|
|
37
37
|
* under it.
|
|
@@ -121,8 +121,9 @@ const cli = Command.make("reposets", {}, () => Effect.void).pipe(Command.withDes
|
|
|
121
121
|
credentialsCommand
|
|
122
122
|
]), Command.provide(ConfigLive), Command.provide(CredentialsFilesLive), Command.withGlobalFlags([ConfigFlag]), Command.withSharedFlags(CliAudience.flags()));
|
|
123
123
|
/**
|
|
124
|
-
* The platform: Node's services,
|
|
125
|
-
* the
|
|
124
|
+
* The platform: Node's services, `SecureRandom` (which `NodeServices` no longer
|
|
125
|
+
* carries; the journal mints run ids with it), the application's directories
|
|
126
|
+
* over them, and the invocation facts.
|
|
126
127
|
*
|
|
127
128
|
* @remarks
|
|
128
129
|
* `provideMerge` rather than `provide`, because commands require the platform
|
|
@@ -133,7 +134,7 @@ const cli = Command.make("reposets", {}, () => Effect.void).pipe(Command.withDes
|
|
|
133
134
|
* colour-aware help formatter itself, closer to the program, and one set here
|
|
134
135
|
* would be shadowed.
|
|
135
136
|
*/
|
|
136
|
-
const PlatformLive = Layer.mergeAll(DirsLive, InvocationLive).pipe(Layer.provideMerge(NodeServices.layer));
|
|
137
|
+
const PlatformLive = Layer.mergeAll(DirsLive, InvocationLive).pipe(Layer.provideMerge(Layer.mergeAll(NodeServices.layer, NodeCrypto.layerSecureRandom)));
|
|
137
138
|
/**
|
|
138
139
|
* Render a failure that escaped a command, one line at a time, to stderr.
|
|
139
140
|
*
|
package/cli/commands/doctor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SettingsGroupSchema } from "../../schemas/config.js";
|
|
2
2
|
import { profileOwner } from "../../schemas/credentials.js";
|
|
3
|
-
import { Invocation } from "../../services/Invocation.js";
|
|
4
3
|
import { CREDENTIALS_FILENAME, ReposetsConfigFile, ReposetsCredentialsFile } from "../../services/ConfigFiles.js";
|
|
5
|
-
import { STORE_OPTIONS } from "../../store/files.js";
|
|
6
|
-
import { OP_SERVICE_ACCOUNT_TOKEN, OnePasswordClientLive } from "../../services/OnePasswordClient.js";
|
|
7
4
|
import { CredentialResolver, CredentialResolverLive } from "../../services/CredentialResolver.js";
|
|
5
|
+
import { Invocation } from "../../services/Invocation.js";
|
|
6
|
+
import { OP_SERVICE_ACCOUNT_TOKEN, OnePasswordClientLive } from "../../services/OnePasswordClient.js";
|
|
7
|
+
import { STORE_OPTIONS } from "../../store/files.js";
|
|
8
8
|
import { Config, Console, Effect, FileSystem, Layer, Option, Path, Predicate, Result } from "effect";
|
|
9
9
|
import { AppStore } from "@effected/app";
|
|
10
10
|
import { CliMessage, Doc, Fmt, SchemaIssueRenderer, Status } from "@effected/cli";
|
package/cli/commands/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Invocation } from "../../services/Invocation.js";
|
|
2
|
-
import { CONFIG_FILENAME, CREDENTIALS_FILENAME } from "../../services/ConfigFiles.js";
|
|
3
1
|
import { configSchemaHost, credentialsSchemaHost, schemaDirective } from "../../schemas/hosted.js";
|
|
2
|
+
import { CONFIG_FILENAME, CREDENTIALS_FILENAME } from "../../services/ConfigFiles.js";
|
|
3
|
+
import { Invocation } from "../../services/Invocation.js";
|
|
4
4
|
import { Effect, FileSystem, Option, Path } from "effect";
|
|
5
5
|
import { CliExit, CliMessage } from "@effected/cli";
|
|
6
6
|
import { Command, Flag } from "effect/cli";
|
package/cli/commands/nuke.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Invocation } from "../../services/Invocation.js";
|
|
2
1
|
import { CONFIG_FILENAME, CREDENTIALS_FILENAME } from "../../services/ConfigFiles.js";
|
|
2
|
+
import { Invocation } from "../../services/Invocation.js";
|
|
3
3
|
import { CACHE_OPTIONS, STORE_OPTIONS } from "../../store/files.js";
|
|
4
4
|
import { Effect, FileSystem, Path } from "effect";
|
|
5
5
|
import { AppCache, AppStore } from "@effected/app";
|
package/cli/commands/sync.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { danglingReferences } from "../../lib/config-refs.js";
|
|
1
2
|
import { ReposetsConfigFile, ReposetsCredentialsFile } from "../../services/ConfigFiles.js";
|
|
2
|
-
import { SyncJournal, SyncJournalLive } from "../../store/SyncJournal.js";
|
|
3
|
-
import { OnePasswordClientLive } from "../../services/OnePasswordClient.js";
|
|
4
3
|
import { CredentialResolver, CredentialResolverLive } from "../../services/CredentialResolver.js";
|
|
5
|
-
import {
|
|
4
|
+
import { OnePasswordClientLive } from "../../services/OnePasswordClient.js";
|
|
6
5
|
import { SyncLogger, SyncLoggerLive } from "../../services/SyncLogger.js";
|
|
7
6
|
import { AppliedStateLive } from "../../store/AppliedState.js";
|
|
8
7
|
import { RepoCacheLive } from "../../store/RepoCache.js";
|
|
8
|
+
import { SyncJournal, SyncJournalLive } from "../../store/SyncJournal.js";
|
|
9
9
|
import { PHASE_NAMES } from "../../sync/phase.js";
|
|
10
10
|
import { allPhases } from "../../sync/phases/index.js";
|
|
11
11
|
import { SyncEngine, SyncEngineLive } from "../../sync/SyncEngine.js";
|
package/cli/commands/validate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReposetsConfigFile, ReposetsCredentialsFile } from "../../services/ConfigFiles.js";
|
|
2
1
|
import { danglingReferences } from "../../lib/config-refs.js";
|
|
3
2
|
import { undefinedCredentialLabels } from "../../lib/credential-labels.js";
|
|
4
3
|
import { orgOnlyViolations } from "../../lib/org-only.js";
|
|
4
|
+
import { ReposetsConfigFile, ReposetsCredentialsFile } from "../../services/ConfigFiles.js";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
import { CliExit, CliMessage, Doc, Status } from "@effected/cli";
|
|
7
7
|
import { Command } from "effect/cli";
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigSchema } from "./schemas/config.js";
|
|
2
|
-
import { Invocation } from "./services/Invocation.js";
|
|
3
2
|
import { CONFIG_FILENAME, ConfigFlagMissingConfig, ConfigFlagNotFound, ReposetsConfigFile, makeConfigFilesLive } from "./services/ConfigFiles.js";
|
|
3
|
+
import { Invocation } from "./services/Invocation.js";
|
|
4
4
|
|
|
5
5
|
export { CONFIG_FILENAME, ConfigFlagMissingConfig, ConfigFlagNotFound, ConfigSchema, Invocation, ReposetsConfigFile, makeConfigFilesLive };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reposets",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI tool to sync GitHub repo settings, secrets and rulesets across personal repositories",
|
|
6
6
|
"keywords": [
|
|
@@ -48,22 +48,22 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@1password/sdk": "^0.5.0",
|
|
51
|
-
"@effect/platform-node": "
|
|
52
|
-
"@effected/app": "^0.
|
|
53
|
-
"@effected/cli": "^0.
|
|
54
|
-
"@effected/config-file": "^0.
|
|
55
|
-
"@effected/env": "^0.
|
|
56
|
-
"@effected/github": "^0.
|
|
57
|
-
"@effected/glob": "^0.
|
|
58
|
-
"@effected/jsonc": "^0.
|
|
59
|
-
"@effected/schemastore": "^0.
|
|
60
|
-
"@effected/store": "^0.
|
|
61
|
-
"@effected/toml": "^0.
|
|
62
|
-
"@effected/walker": "^0.
|
|
63
|
-
"@effected/xdg": "^0.
|
|
64
|
-
"@effected/yaml": "^0.
|
|
51
|
+
"@effect/platform-node": "~4.1.1",
|
|
52
|
+
"@effected/app": "^0.30.0",
|
|
53
|
+
"@effected/cli": "^0.25.0",
|
|
54
|
+
"@effected/config-file": "^0.23.0",
|
|
55
|
+
"@effected/env": "^0.9.0",
|
|
56
|
+
"@effected/github": "^0.27.0",
|
|
57
|
+
"@effected/glob": "^0.17.0",
|
|
58
|
+
"@effected/jsonc": "^0.22.0",
|
|
59
|
+
"@effected/schemastore": "^0.28.0",
|
|
60
|
+
"@effected/store": "^0.22.0",
|
|
61
|
+
"@effected/toml": "^0.18.0",
|
|
62
|
+
"@effected/walker": "^0.24.0",
|
|
63
|
+
"@effected/xdg": "^0.18.0",
|
|
64
|
+
"@effected/yaml": "^0.27.0",
|
|
65
65
|
"blakejs": "^1.2.1",
|
|
66
|
-
"effect": "
|
|
66
|
+
"effect": "~4.1.1",
|
|
67
67
|
"ink": "^8.0.0",
|
|
68
68
|
"react": "^19.3.1"
|
|
69
69
|
},
|
package/store/SyncJournal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Context,
|
|
1
|
+
import { Context, DateTime, Effect, Layer } from "effect";
|
|
2
2
|
import { Store } from "@effected/store";
|
|
3
|
+
import { SecureRandom } from "effect/crypto";
|
|
3
4
|
|
|
4
5
|
// src/store/SyncJournal.ts
|
|
5
6
|
/**
|
|
@@ -15,11 +16,11 @@ import { Store } from "@effected/store";
|
|
|
15
16
|
*/
|
|
16
17
|
var SyncJournal = class extends Context.Service()("reposets/SyncJournal", { make: Effect.gen(function* () {
|
|
17
18
|
const store = yield* Store;
|
|
18
|
-
const
|
|
19
|
+
const random = yield* SecureRandom.SecureRandom;
|
|
19
20
|
const sql = store.client;
|
|
20
21
|
return {
|
|
21
22
|
startRun: (options) => Effect.gen(function* () {
|
|
22
|
-
const id = yield*
|
|
23
|
+
const id = yield* random.uuidV7();
|
|
23
24
|
const startedAt = yield* DateTime.now;
|
|
24
25
|
yield* sql`
|
|
25
26
|
INSERT INTO sync_run (id, started_at, group_name, dry_run)
|
package/sync/SyncEngine.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { profileOwner } from "../schemas/credentials.js";
|
|
2
|
-
import { SyncJournal } from "../store/SyncJournal.js";
|
|
3
2
|
import { CredentialResolver } from "../services/CredentialResolver.js";
|
|
4
3
|
import { SyncLogger } from "../services/SyncLogger.js";
|
|
5
4
|
import { RepoCache } from "../store/RepoCache.js";
|
|
5
|
+
import { SyncJournal } from "../store/SyncJournal.js";
|
|
6
6
|
import { emptyResult, mergeResults, selectPhases } from "./phase.js";
|
|
7
7
|
import { Context, Effect, Layer } from "effect";
|
|
8
8
|
import { GitHubRepository, Repo, RepoRef } from "@effected/github";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
4
|
import { RepoCache } from "../../store/RepoCache.js";
|
|
4
|
-
import { read } from "./resource.js";
|
|
5
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
6
5
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
6
|
+
import { read } from "./resource.js";
|
|
7
7
|
import { Effect, Option } from "effect";
|
|
8
8
|
import { Fmt } from "@effected/cli";
|
|
9
9
|
import { CodeScanning, WorkflowDispatch } from "@effected/github";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
4
4
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
5
5
|
import { Effect, Option } from "effect";
|
|
6
6
|
import { Fmt } from "@effected/cli";
|
package/sync/phases/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { capture, declaredNames, resolveGroups } from "./resource.js";
|
|
2
1
|
import { cleanupPhase } from "./cleanup.js";
|
|
3
2
|
import { codeScanningPhase } from "./code-scanning.js";
|
|
4
3
|
import { environmentsPhase } from "./environments.js";
|
|
@@ -7,6 +6,7 @@ import { secretsPhase } from "./secrets.js";
|
|
|
7
6
|
import { securityPhase } from "./security.js";
|
|
8
7
|
import { settingsPhase } from "./settings.js";
|
|
9
8
|
import { variablesPhase } from "./variables.js";
|
|
9
|
+
import { capture, declaredNames, resolveGroups } from "./resource.js";
|
|
10
10
|
import { Effect } from "effect";
|
|
11
11
|
|
|
12
12
|
// src/sync/phases/index.ts
|
package/sync/phases/rulesets.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { buildRulesetPayload } from "../../schemas/ruleset.js";
|
|
2
3
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
3
4
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
4
5
|
import { RepoCache } from "../../store/RepoCache.js";
|
|
5
|
-
import { capture, read } from "./resource.js";
|
|
6
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
7
6
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
7
|
+
import { capture, read } from "./resource.js";
|
|
8
8
|
import { Effect, Option, Redacted } from "effect";
|
|
9
9
|
import { Ruleset } from "@effected/github";
|
|
10
10
|
|
package/sync/phases/secrets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
|
-
import { capture, resolveGroups } from "./resource.js";
|
|
4
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
5
4
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
5
|
+
import { capture, resolveGroups } from "./resource.js";
|
|
6
6
|
import { Effect, FileSystem, Option, Path, Redacted } from "effect";
|
|
7
7
|
import { RepositorySecret } from "@effected/github";
|
|
8
8
|
|
package/sync/phases/security.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
4
4
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
5
5
|
import { Effect, Option } from "effect";
|
|
6
6
|
import { Fmt } from "@effected/cli";
|
package/sync/phases/settings.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
4
|
import { RepoCache } from "../../store/RepoCache.js";
|
|
4
|
-
import { read } from "./resource.js";
|
|
5
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
6
5
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
6
|
+
import { read } from "./resource.js";
|
|
7
7
|
import { Effect, Option } from "effect";
|
|
8
8
|
import { GitHubRepository, Ruleset } from "@effected/github";
|
|
9
9
|
|
package/sync/phases/variables.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { fingerprint } from "../../lib/fingerprint.js";
|
|
1
2
|
import { SyncLogger } from "../../services/SyncLogger.js";
|
|
2
3
|
import { AppliedState, lookup } from "../../store/AppliedState.js";
|
|
3
|
-
import { capture, resolveGroups } from "./resource.js";
|
|
4
|
-
import { fingerprint } from "../../lib/fingerprint.js";
|
|
5
4
|
import { decide, isDrift, needsApply } from "../decide.js";
|
|
5
|
+
import { capture, resolveGroups } from "./resource.js";
|
|
6
6
|
import { Effect, FileSystem, Option, Path, Redacted } from "effect";
|
|
7
7
|
import { RepositoryVariable } from "@effected/github";
|
|
8
8
|
|