chore: update post-publish script

This commit is contained in:
MadCcc 2022-07-08 10:48:29 +08:00
parent caf6999408
commit 644b7ecea4

View File

@ -5,12 +5,19 @@ const dayjs = require('dayjs');
const inquirer = require('inquirer'); const inquirer = require('inquirer');
const chalk = require('chalk'); const chalk = require('chalk');
const { spawnSync } = require('child_process'); const { spawnSync } = require('child_process');
const packageJson = require('../package.json');
const SAFE_DAYS_START = 1000 * 60 * 60 * 24 * 15; // 15 days const SAFE_DAYS_START = 1000 * 60 * 60 * 24 * 15; // 15 days
const SAFE_DAYS_DIFF = 1000 * 60 * 60 * 24 * 3; // 3 days not update seems to be stable const SAFE_DAYS_DIFF = 1000 * 60 * 60 * 24 * 3; // 3 days not update seems to be stable
(async function process() { (async function process() {
console.log(chalk.cyan('🤖 Post Publish Scripting...\n')); console.log(chalk.cyan('🤖 Post Publish Scripting...\n'));
if (packageJson.version.startsWith('5.0')) {
console.log(chalk.green('🤖 Next version, skipped.'));
return;
}
const { time, 'dist-tags': distTags } = await fetch('http://registry.npmjs.org/antd').then(res => const { time, 'dist-tags': distTags } = await fetch('http://registry.npmjs.org/antd').then(res =>
res.json(), res.json(),
); );