fix(canary): include all publishable packages (#1997)

* fix(canary): include all publishable packages, not just linked group

* fix(canary): avoid glob dependency in fallback changeset

* fix(canary): harden publishable package scan

---------

Co-authored-by: suraj-markup <suraj@composio.dev>
This commit is contained in:
suraj_markup 2026-05-22 05:30:09 +05:30 committed by GitHub
parent 66700634d3
commit bf892ca03f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 3 deletions

View File

@ -112,12 +112,29 @@ jobs:
# deletes it, so no cleanup is needed.
if [ -z "$(ls .changeset/*.md 2>/dev/null | grep -vi 'README')" ]; then
node << 'SCRIPT'
const cfg = require('./.changeset/config.json');
const pkgs = cfg.linked.flat();
const fs = require('fs');
const pkgs = [];
const addPackage = (m) => {
if (!fs.existsSync(m)) return;
const d = JSON.parse(fs.readFileSync(m, 'utf8'));
if (!d.private && d.publishConfig?.access === 'public') pkgs.push(d.name);
};
const scanPackages = (dir) => {
if (!fs.existsSync(dir)) return;
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
if (entry.isDirectory()) addPackage(`${dir}/${entry.name}/package.json`);
}
};
scanPackages('packages');
scanPackages('packages/plugins');
let body = '---\n';
pkgs.forEach(p => body += '"' + p + '": patch\n');
body += '---\n\nchore: canary build\n';
require('fs').writeFileSync('.changeset/canary-temp.md', body);
fs.writeFileSync('.changeset/canary-temp.md', body);
SCRIPT
fi
pnpm changeset version --snapshot nightly