fix(sdk): add supported plugin type in preflight
This commit is contained in:
parent
f4d1c0baa4
commit
43d30245a0
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@ -11,6 +11,7 @@ on:
|
|||||||
- '.github/ISSUE_TEMPLATE/**'
|
- '.github/ISSUE_TEMPLATE/**'
|
||||||
- '.github/FUNDING.yml'
|
- '.github/FUNDING.yml'
|
||||||
- '.github/PULL_REQUEST_TEMPLATE.md'
|
- '.github/PULL_REQUEST_TEMPLATE.md'
|
||||||
|
- 'plugin-sdk/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
bump:
|
bump:
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export async function preflight(entry: Entry, opts: { all?: boolean } = {}): Pro
|
|||||||
// Structural checks that mirror the registry schema (fast, offline).
|
// Structural checks that mirror the registry schema (fast, offline).
|
||||||
if (!/^[a-z][a-z0-9-]{2,39}$/.test(entry.id)) fail(`id "${entry.id}" is not a valid slug (^[a-z][a-z0-9-]{2,39}$)`);
|
if (!/^[a-z][a-z0-9-]{2,39}$/.test(entry.id)) fail(`id "${entry.id}" is not a valid slug (^[a-z][a-z0-9-]{2,39}$)`);
|
||||||
if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(entry.repo)) fail(`repo "${entry.repo}" is not "owner/name"`);
|
if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(entry.repo)) fail(`repo "${entry.repo}" is not "owner/name"`);
|
||||||
if (!['integration', 'page', 'widget'].includes(entry.type)) fail(`type "${entry.type}" is not integration|page|widget`);
|
if (!['integration', 'page', 'widget', 'trip-page'].includes(entry.type)) fail(`type "${entry.type}" is not integration|page|widget|trip-page`);
|
||||||
if (entry.authorPublicKey && !entry.versions[0]?.signature) fail('entry has authorPublicKey but the newest version has no signature (sign the version too)');
|
if (entry.authorPublicKey && !entry.versions[0]?.signature) fail('entry has authorPublicKey but the newest version has no signature (sign the version too)');
|
||||||
|
|
||||||
const versions = opts.all ? entry.versions : entry.versions.slice(0, 1);
|
const versions = opts.all ? entry.versions : entry.versions.slice(0, 1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user