Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ node scripts/sync-skills.mjs --check

## Versions

Every manifest carries the same version. A change to a manifest or to a marketplace file needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes a skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release.
Every manifest carries the same version. A change to a manifest, a marketplace file or `assets/` (such as the icon) needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes a skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release.

## Not accepted

Expand Down
8 changes: 8 additions & 0 deletions scripts/test/validate.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ test('a changed skill with a new version passes', async () => {
assert.deepEqual(await validate(root, { base: 'HEAD~1' }), [])
})

test('a changed icon needs a new version', async () => {
// Directories and agents keep the cached copy of a version, so a new logo
// reaches users only with a new version.
await write(root, 'assets/icon.png', 'new png')
git(root, 'commit', '-q', '-am', 'new icon')
await assertOneError('version', { base: 'HEAD~1' })
})

test('a README change needs no new version', async () => {
await write(root, 'README.md', `${README}\nMore.\n`)
git(root, 'commit', '-q', '-am', 'docs')
Expand Down
10 changes: 7 additions & 3 deletions scripts/validate.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
// Checks that this repository is a valid, publishable plugin. Run as
// `node scripts/validate.mjs [--base <git ref>]`; exits 1 and lists what is
// wrong. With --base it also requires a new version whenever the skills or a
// manifest changed since that ref.
// wrong. With --base it also requires a new version whenever the skills, the
// assets or a manifest changed since that ref.
import { execFileSync } from 'node:child_process'
import { lstat, readFile } from 'node:fs/promises'
import path from 'node:path'
Expand Down Expand Up @@ -299,7 +299,10 @@ const isHigher = (version, than) => {
return false
}

/** A change to the skills or a manifest since `base` needs a higher version. */
/**
* A change to the skills, the assets or a manifest since `base` needs a higher
* version: directories and agents keep the copy of each version they have.
*/
const checkVersionBump = async (root, base, errors) => {
try {
git(root, 'rev-parse', '--verify', '--quiet', `${base}^{commit}`)
Expand All @@ -314,6 +317,7 @@ const checkVersionBump = async (root, base, errors) => {
base,
'--',
'skills',
'assets',
...VERSIONED_MANIFESTS,
...MARKETPLACES,
)
Expand Down