@intellectual-frontiers/repoctl 0.0.0-stage → 0.1.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.
Files changed (59) hide show
  1. package/LICENSE +75 -0
  2. package/README.md +19 -2
  3. package/dist/governance/checks.d.ts +23 -0
  4. package/dist/governance/config.d.ts +233 -0
  5. package/dist/governance/generators.d.ts +54 -0
  6. package/dist/governance/identity.d.ts +23 -0
  7. package/dist/governance/ids.d.ts +46 -0
  8. package/dist/governance/mod.d.ts +25 -0
  9. package/dist/governance/mod.js +1063 -0
  10. package/dist/governance/problems.d.ts +28 -0
  11. package/dist/governance/proof.d.ts +108 -0
  12. package/dist/governance/tiers.d.ts +25 -0
  13. package/dist/governance/verbs.d.ts +43 -0
  14. package/dist/governance/version.d.ts +14 -0
  15. package/dist/logical/check.d.ts +33 -0
  16. package/dist/logical/commit.d.ts +64 -0
  17. package/dist/logical/constants.d.ts +27 -0
  18. package/dist/logical/declared.d.ts +32 -0
  19. package/dist/logical/docs.d.ts +31 -0
  20. package/dist/logical/doctor.d.ts +42 -0
  21. package/dist/logical/findings.d.ts +26 -0
  22. package/dist/logical/glob.d.ts +17 -0
  23. package/dist/logical/hygiene-facts.d.ts +33 -0
  24. package/dist/logical/hygiene.d.ts +68 -0
  25. package/dist/logical/merge.d.ts +46 -0
  26. package/dist/logical/mod.d.ts +36 -0
  27. package/dist/logical/mod.js +2553 -0
  28. package/dist/logical/order.d.ts +24 -0
  29. package/dist/logical/pool.d.ts +14 -0
  30. package/dist/logical/ports.d.ts +96 -0
  31. package/dist/logical/prove.d.ts +118 -0
  32. package/dist/logical/publish.d.ts +70 -0
  33. package/dist/logical/scaffold.d.ts +52 -0
  34. package/dist/logical/select.d.ts +83 -0
  35. package/dist/logical/semver.d.ts +16 -0
  36. package/dist/logical/status.d.ts +71 -0
  37. package/dist/logical/step.d.ts +18 -0
  38. package/dist/logical/surface.d.ts +73 -0
  39. package/dist/logical/sync.d.ts +34 -0
  40. package/dist/mod.d.ts +20 -0
  41. package/dist/mod.js +12992 -0
  42. package/dist/physical/adapters.d.ts +25 -0
  43. package/dist/physical/config-load.d.ts +30 -0
  44. package/dist/physical/define.d.ts +73 -0
  45. package/dist/physical/mod.d.ts +26 -0
  46. package/dist/physical/mod.js +12660 -0
  47. package/dist/physical/program.d.ts +14 -0
  48. package/dist/physical/prove-run.d.ts +50 -0
  49. package/dist/physical/prove.d.ts +76 -0
  50. package/dist/physical/tests.d.ts +54 -0
  51. package/dist/physical/verbs/check.d.ts +26 -0
  52. package/dist/physical/verbs/docs.d.ts +6 -0
  53. package/dist/physical/verbs/library.d.ts +4 -0
  54. package/dist/physical/verbs/prove.d.ts +5 -0
  55. package/dist/physical/verbs/releasing.d.ts +27 -0
  56. package/dist/physical/verbs/sync.d.ts +12 -0
  57. package/dist/repoctl.d.ts +16 -0
  58. package/package.json +70 -4
  59. package/repoctl.mjs +12693 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * `repoctl merge <ref>` (commons repoctl 0003-repoctl-sync FR-005, FR-006): Git merges the reference; where files conflict, the ones a generator writes are never resolved by hand but made again by their generators (taking one side
3
+ * to clear the markers, running `sync`, and staging what is then as its generator makes it), and the ones a person wrote are left exactly as Git left them and named. The merge is completed only where nothing conflicts any more.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * import { partitionConflicts } from "./merge.js";
8
+ * partitionConflicts([], ["README.md"]); // { generated: [], written: ["README.md"] }
9
+ * ```
10
+ *
11
+ * @module
12
+ */
13
+ import type { Generator, GitRef } from "@intellectual-frontiers/repoctl/governance";
14
+ import { type Identity } from "@intellectual-frontiers/repoctl/governance";
15
+ import type { World } from "./ports.js";
16
+ import { type SyncReport } from "./sync.js";
17
+ /** What a merge came to. */
18
+ export type MergeReport = {
19
+ readonly kind: "refused";
20
+ readonly why: readonly string[];
21
+ } | {
22
+ readonly kind: "merged";
23
+ readonly sync: SyncReport;
24
+ } | {
25
+ readonly kind: "conflicts";
26
+ /** The generated files that conflicted and were made again and staged. */
27
+ readonly regenerated: readonly string[];
28
+ /** Of those, the ones that also hold what a person wrote: the lines of both sides were kept and the generated part was made again, so that nothing a side wrote is lost. */
29
+ readonly unioned: readonly string[];
30
+ /** The generated files that conflicted and could not be made again: they stay conflicted. */
31
+ readonly unresolved: readonly string[];
32
+ /** The files a person wrote that conflict, untouched. */
33
+ readonly written: readonly string[];
34
+ /** Whether the merge was completed with a commit. */
35
+ readonly committed: boolean;
36
+ readonly sync: SyncReport;
37
+ };
38
+ /** The conflicted paths split into the ones a generator writes and the ones a person wrote. */
39
+ export declare function partitionConflicts(table: readonly Generator[], paths: readonly string[]): {
40
+ readonly generated: readonly string[];
41
+ readonly written: readonly string[];
42
+ };
43
+ /** Whether a conflicted generated file also holds text a person wrote. */
44
+ export declare function isMixed(table: readonly Generator[], path: string): boolean;
45
+ /** Merges `ref` into the checkout, in the order the generators are given. */
46
+ export declare function runMerge(w: Pick<World, "files" | "process" | "repo">, ref: GitRef, order: readonly Generator[], identity: Identity): Promise<MergeReport>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The Logical layer of Repoctl (commons repoctl 0003-repoctl-sync, 0004-repoctl-status-release, 0005-repoctl-library-commit-doctor): what each verb reasons with, as pure functions of values and of the ports of the world: the order of
3
+ * the generators, `sync`, `merge`, `check`, the version constants, the status, the publication, the scaffold of a library, the commit and the diagnosis of a checkout. It imports Governance, Core and the governance and logical layers of
4
+ * Headless, and reads no file, runs no program and reaches no network except through its ports.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { orderGenerators } from "@intellectual-frontiers/repoctl/logical";
9
+ * orderGenerators([]).kind; // "ok"
10
+ * ```
11
+ *
12
+ * @module
13
+ */
14
+ export * from "./check.js";
15
+ export * from "./commit.js";
16
+ export * from "./constants.js";
17
+ export * from "./declared.js";
18
+ export * from "./doctor.js";
19
+ export * from "./findings.js";
20
+ export * from "./glob.js";
21
+ export * from "./merge.js";
22
+ export * from "./order.js";
23
+ export * from "./pool.js";
24
+ export * from "./ports.js";
25
+ export * from "./prove.js";
26
+ export * from "./publish.js";
27
+ export * from "./docs.js";
28
+ export * from "./scaffold.js";
29
+ export * from "./select.js";
30
+ export * from "./semver.js";
31
+ export * from "./status.js";
32
+ export * from "./surface.js";
33
+ export * from "./step.js";
34
+ export * from "./sync.js";
35
+ export * from "./hygiene.js";
36
+ export * from "./hygiene-facts.js";