@volter/twin-github 0.1.0 → 0.1.1

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.
@@ -0,0 +1,26 @@
1
+ // GitHub SHARED helpers — pure shape functions both sides of the wire need: the twin's
2
+ // mirror-state projection (server side, `github-mirror-state.ts`) and the mirror's React
3
+ // client (`client/github-mirror.tsx`). Plain data in → plain data out; no state access,
4
+ // no `@volter/twin`, no Bun/node imports — this module rides into the browser bundle
5
+ // unchanged.
6
+
7
+ /** The ONE named store the mirror renders from: `GET /twin/store/${GITHUB_MIRROR_STORE}`
8
+ * (runtime contract R5 — the store door — is the only way a mirror reads twin state). */
9
+ export const GITHUB_MIRROR_STORE = 'mirror';
10
+
11
+ /** The store door's path, relative to the twin's base (the mirror host's origin). */
12
+ export const GITHUB_MIRROR_STORE_PATH = `/twin/store/${GITHUB_MIRROR_STORE}`;
13
+
14
+ /** GitHub's web origin — the projection's `url` fields are real github.com links. */
15
+ export const GITHUB_WEB_ORIGIN = 'https://github.com';
16
+
17
+ /** A pull request's web path (`/{owner}/{repo}/pull/{n}`) — the projection's `url` tail and
18
+ * the console's own route for an opened PR are the same grammar, real GitHub's. */
19
+ export function githubPullPath(repo: string, number: number | string): string {
20
+ return `/${repo}/pull/${number}`;
21
+ }
22
+
23
+ /** An issue's web path (`/{owner}/{repo}/issues/{n}`), the same way. */
24
+ export function githubIssuePath(repo: string, number: number | string): string {
25
+ return `/${repo}/issues/${number}`;
26
+ }