fix(models): keep generated sync scope reviewable
This commit is contained in:
@@ -18,7 +18,6 @@ const TEXT_ONLY_MARKER = ',__name(isKnownTextOnlyModel,"isKnownTextOnlyModel")'
|
|||||||
const VALID_EFFORTS = new Set(["minimal", "low", "medium", "high", "xhigh", "max"])
|
const VALID_EFFORTS = new Set(["minimal", "low", "medium", "high", "xhigh", "max"])
|
||||||
const CATALOG_SOURCE_PATH = new URL("../../src/commandcode-catalog.ts", import.meta.url)
|
const CATALOG_SOURCE_PATH = new URL("../../src/commandcode-catalog.ts", import.meta.url)
|
||||||
const README_PATH = new URL("../../README.md", import.meta.url)
|
const README_PATH = new URL("../../README.md", import.meta.url)
|
||||||
const CHANGELOG_PATH = new URL("../../CHANGELOG.md", import.meta.url)
|
|
||||||
|
|
||||||
export interface CommandCodeModelMetadata {
|
export interface CommandCodeModelMetadata {
|
||||||
imageModelIds: readonly string[]
|
imageModelIds: readonly string[]
|
||||||
@@ -254,22 +253,14 @@ export function updateReadmeCatalogVersion(readme: string, packageVersion: strin
|
|||||||
return updateDocumentedCatalogVersion(readme, packageVersion, "README")
|
return updateDocumentedCatalogVersion(readme, packageVersion, "README")
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateChangelogCatalogVersion(changelog: string, packageVersion: string): string {
|
|
||||||
return updateDocumentedCatalogVersion(changelog, packageVersion, "changelog")
|
|
||||||
}
|
|
||||||
|
|
||||||
async function writeSynchronizedCatalog(
|
async function writeSynchronizedCatalog(
|
||||||
packageVersion: string,
|
packageVersion: string,
|
||||||
metadata: CommandCodeModelMetadata,
|
metadata: CommandCodeModelMetadata,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const [readme, changelog] = await Promise.all([
|
const readme = await readFile(README_PATH, "utf-8")
|
||||||
readFile(README_PATH, "utf-8"),
|
|
||||||
readFile(CHANGELOG_PATH, "utf-8"),
|
|
||||||
])
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
writeFile(CATALOG_SOURCE_PATH, renderCommandCodeCatalog(packageVersion, metadata), "utf-8"),
|
writeFile(CATALOG_SOURCE_PATH, renderCommandCodeCatalog(packageVersion, metadata), "utf-8"),
|
||||||
writeFile(README_PATH, updateReadmeCatalogVersion(readme, packageVersion), "utf-8"),
|
writeFile(README_PATH, updateReadmeCatalogVersion(readme, packageVersion), "utf-8"),
|
||||||
writeFile(CHANGELOG_PATH, updateChangelogCatalogVersion(changelog, packageVersion), "utf-8"),
|
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
run: npm run sync:commandcode-catalog | tee commandcode-catalog-report.md
|
run: npm run sync:commandcode-catalog | tee commandcode-catalog-report.md
|
||||||
- name: Format and verify synchronized files
|
- name: Format and verify synchronized files
|
||||||
run: |
|
run: |
|
||||||
npm run format -- src/commandcode-catalog.ts README.md CHANGELOG.md
|
npm run format -- src/commandcode-catalog.ts README.md
|
||||||
npm run typecheck
|
npm run typecheck
|
||||||
npm run test:models
|
npm run test:models
|
||||||
npm run format:check
|
npm run format:check
|
||||||
@@ -87,4 +87,3 @@ jobs:
|
|||||||
add-paths: |
|
add-paths: |
|
||||||
src/commandcode-catalog.ts
|
src/commandcode-catalog.ts
|
||||||
README.md
|
README.md
|
||||||
CHANGELOG.md
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
parseModelsReference,
|
parseModelsReference,
|
||||||
parsePackageVersion,
|
parsePackageVersion,
|
||||||
renderCommandCodeCatalog,
|
renderCommandCodeCatalog,
|
||||||
updateChangelogCatalogVersion,
|
|
||||||
updateReadmeCatalogVersion,
|
updateReadmeCatalogVersion,
|
||||||
type CommandCodeModelMetadata,
|
type CommandCodeModelMetadata,
|
||||||
} from "../.github/scripts/check-commandcode-model-metadata.ts"
|
} from "../.github/scripts/check-commandcode-model-metadata.ts"
|
||||||
@@ -129,13 +128,6 @@ export const MODEL_EFFORTS: Readonly<Record<string, readonly CommandCodeReasonin
|
|||||||
),
|
),
|
||||||
"The capability snapshot currently follows `command-code@1.33.0`.",
|
"The capability snapshot currently follows `command-code@1.33.0`.",
|
||||||
)
|
)
|
||||||
assert.equal(
|
|
||||||
updateChangelogCatalogVersion(
|
|
||||||
"- Refresh capabilities from `command-code@1.32.2`, including metadata.",
|
|
||||||
"1.33.0",
|
|
||||||
),
|
|
||||||
"- Refresh capabilities from `command-code@1.33.0`, including metadata.",
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("rejects unexpected upstream structures instead of silently passing", () => {
|
it("rejects unexpected upstream structures instead of silently passing", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user