mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* chore(deps): ra version bump * chore(changeset): add changeset * fix(scripts): incorrect docs path --------- Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import ncu from 'npm-check-updates';
|
|
import glob from 'glob';
|
|
import { resolve } from 'path';
|
|
|
|
|
|
const shouldUpgrade = process.argv.includes('--upgrade') || process.argv.includes('-u');
|
|
|
|
const checkForUpdates = async (path: string) => {
|
|
const filePaths = glob.sync(resolve(path, '**/package.json'), {
|
|
ignore: '**/node_modules/**',
|
|
});
|
|
|
|
for (const filePath of filePaths) {
|
|
try {
|
|
const upgraded = await ncu({
|
|
packageFile: filePath,
|
|
filter: '/^@react-(aria|stately|types)\\/.*$/',
|
|
upgrade: shouldUpgrade,
|
|
jsonUpgraded: false,
|
|
});
|
|
console.log(`Upgrades for ${filePath}:`, upgraded);
|
|
|
|
if(shouldUpgrade && upgraded) {
|
|
console.log(`✅ Upgraded packages in ${filePath}`);
|
|
}
|
|
} catch (error) {
|
|
console.error(`Error occurred while checking for updates in ${filePath}:`, error.message);
|
|
}
|
|
}
|
|
};
|
|
|
|
const main = async () => {
|
|
const dirs = [resolve('apps/docs'), resolve('packages')];
|
|
for (const dir of dirs) {
|
|
await checkForUpdates(dir);
|
|
}
|
|
};
|
|
|
|
main(); |