spexcode 0.2.0 → 0.2.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.
- package/README.md +68 -65
- package/README.zh-CN.md +135 -0
- package/package.json +1 -1
- package/spec-cli/src/cli.ts +14 -5
- package/spec-cli/src/gateway.ts +15 -11
- package/spec-cli/src/guide.ts +11 -7
- package/spec-cli/src/help.ts +4 -2
- package/spec-cli/src/index.ts +11 -4
- package/spec-cli/src/issues.ts +66 -15
- package/spec-cli/src/localIssues.ts +17 -0
- package/spec-dashboard/dist/assets/{index-BTU-44Os.css → index-Ct_ubwrd.css} +1 -1
- package/spec-dashboard/dist/assets/{index-B0tgHeEQ.js → index-DehTZ-h9.js} +38 -38
- package/spec-dashboard/dist/index.html +2 -2
- package/spec-forge/src/cli.ts +4 -10
- package/spec-forge/src/drivers.ts +13 -0
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
} catch (e) { /* localStorage/matchMedia unavailable — default (light) stands */ }
|
|
20
20
|
})()
|
|
21
21
|
</script>
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-DehTZ-h9.js"></script>
|
|
23
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Ct_ubwrd.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
|
26
26
|
<div id="root"></div>
|
package/spec-forge/src/cli.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { loadSpecs } from '../../spec-cli/src/specs.js'
|
|
2
2
|
import type { ForgeDriver, ForgeIssue, ForgePR } from './port.js'
|
|
3
|
-
import {
|
|
3
|
+
import { DEFAULT_FORGE_HOST, FORGE_DRIVERS, forgeDriverFor } from './drivers.js'
|
|
4
4
|
import { resolveLinks, type NodeLinks } from './links.js'
|
|
5
5
|
import { resolveEvalPending, type NodeEvalPending } from './needs-yatsu-eval.js'
|
|
6
6
|
|
|
7
|
-
const DRIVERS: ForgeDriver[] = [githubDriver]
|
|
8
|
-
const DEFAULT_HOST = 'github'
|
|
9
|
-
function driverFor(host: string): ForgeDriver | undefined {
|
|
10
|
-
return DRIVERS.find((d) => d.host === host)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
7
|
// tiny flag reader over this command's own arg slice (everything after `forge`), so cli.ts stays routing-only.
|
|
14
8
|
function flag(args: string[], name: string): string | undefined {
|
|
15
9
|
const i = args.indexOf(`--${name}`)
|
|
@@ -20,10 +14,10 @@ const has = (args: string[], name: string) => args.includes(`--${name}`)
|
|
|
20
14
|
async function readForge(
|
|
21
15
|
args: string[],
|
|
22
16
|
): Promise<{ driver: ForgeDriver; nodeIds: string[]; issues: ForgeIssue[]; prs: ForgePR[] } | null> {
|
|
23
|
-
const host = flag(args, 'host') ??
|
|
24
|
-
const driver =
|
|
17
|
+
const host = flag(args, 'host') ?? DEFAULT_FORGE_HOST
|
|
18
|
+
const driver = forgeDriverFor(host)
|
|
25
19
|
if (!driver) {
|
|
26
|
-
console.error(`forge: unknown host '${host}' (known: ${
|
|
20
|
+
console.error(`forge: unknown host '${host}' (known: ${FORGE_DRIVERS.map((d) => d.host).join(', ')})`)
|
|
27
21
|
return null
|
|
28
22
|
}
|
|
29
23
|
const nodeIds = (await loadSpecs()).map((s) => s.id)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ForgeDriver } from './port.js'
|
|
2
|
+
import { githubDriver } from './drivers/github.js'
|
|
3
|
+
|
|
4
|
+
export const FORGE_DRIVERS: ForgeDriver[] = [githubDriver]
|
|
5
|
+
export const DEFAULT_FORGE_HOST = 'github'
|
|
6
|
+
|
|
7
|
+
export function forgeDriverFor(host: string): ForgeDriver | undefined {
|
|
8
|
+
return FORGE_DRIVERS.find((d) => d.host === host)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function forgeIssueStores(): { id: string; label: string; kind: 'forge' }[] {
|
|
12
|
+
return FORGE_DRIVERS.map((d) => ({ id: d.host, label: d.host, kind: 'forge' }))
|
|
13
|
+
}
|