chore: merge master into refactor/playwright-projects
This commit is contained in:
commit
2c596173d8
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue