Skip to content

AI-native design editor. Open-source Figma alternative.

fix(ci): classify package READMEs as documentation

Danila Poyarkov9e45ccae32f6
diff --git a/tools/ci/src/policy.ts b/tools/ci/src/policy.ts
index 67b8b2fa3..4810c94cc 100644
--- a/tools/ci/src/policy.ts
+++ b/tools/ci/src/policy.ts
@@ -7,7 +7,7 @@ export type ChangeScope = 'docs' | 'code'
export function classifyPaths(paths: readonly string[]): ChangeScope {
if (paths.length === 0) return 'code'
return paths.every((path) => {
- if (ROOT_DOCS.has(path)) return true
+ if (ROOT_DOCS.has(path) || /^packages\/[^/]+\/README\.md$/.test(path)) return true
if (path.startsWith('packages/docs/')) return DOC_ASSET.test(path)
if (path.startsWith('openspec/')) return path.endsWith('.md')
if (path.startsWith('skills/')) return path.endsWith('.md') || path.endsWith('/LICENSE.txt')
diff --git a/tools/ci/tests/policy.test.ts b/tools/ci/tests/policy.test.ts
index f6b3c2a51..2053d9df1 100644
--- a/tools/ci/tests/policy.test.ts
+++ b/tools/ci/tests/policy.test.ts
@@ -14,6 +14,8 @@ const documentation = [
'README.md',
'AGENTS.md',
'CHANGELOG.md',
+ 'packages/vue/README.md',
+ 'packages/core/README.md',
'packages/docs/programmable/sdk/api/components/bindable-value.md',
'packages/docs/public/logo.svg',
'skills/open-pencil/SKILL.md',
@@ -23,6 +25,9 @@ const documentation = [
const code = [
'src/app/ai/chat/system-prompt.md',
'packages/core/src/design-jsx/reference/authoring.md',
+ 'packages/core/src/README.md',
+ 'packages/core/README.md.ts',
+ 'packages/core/instructions.md',
'packages/docs/.vitepress/config.ts',
'packages/docs/demo.vue',
'skills/open-pencil/scripts/create.ts',
@@ -40,6 +45,11 @@ test.each(code)('code or unknown path: %s', (path) => {
expect(classifyPaths([path])).toBe('code')
expect(classifyPaths([...documentation, path])).toBe('code')
})
+test('package READMEs and public guides share the docs-only route', () => {
+ expect(
+ classifyPaths(['packages/vue/README.md', 'packages/docs/programmable/sdk/getting-started.md'])
+ ).toBe('docs')
+})
test('empty diffs fail safe to code checks', () => {
expect(classifyPaths([])).toBe('code')
})