Skip to content

Commit

Permalink
chore: tmp fix father build
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Oct 23, 2024
1 parent 06ef251 commit 034a4dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default defineConfig({
filename: 'antdx',
},
sourcemap: true,
generateUnminified: true,
externals: {
react: 'React',
'react-dom': 'ReactDOM',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"dumi-plugin-color-chunk": "^1.1.2",
"esbuild-loader": "^4.2.2",
"fast-glob": "^3.3.2",
"father": "^4.5.1-beta.4",
"father": "4.5.1-beta.4",
"fetch-jsonp": "^1.3.0",
"fs-extra": "^11.2.0",
"gh-pages": "^6.1.1",
Expand Down
13 changes: 10 additions & 3 deletions scripts/check-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ function exitProcess(code = 1) {

async function checkVersion() {
spinner.start('正在检查当前版本是否已经存在');
const { versions } = await fetch('http://registry.npmjs.org/@ant-design/x').then(
(res: Response) => res.json(),
);

const raceUrl = [
'http://registry.npmjs.org/@ant-design/x',
'https://registry.npmmirror.com/@ant-design/x',
];

// any of the urls return the data will be fine
const promises = raceUrl.map((url) => fetch(url).then((res) => res.json()));
const { versions } = await Promise.race(promises);

if (version in versions) {
spinner.fail(chalk.yellow('😈 Current version already exists. Forget update package.json?'));
spinner.info(`${chalk.cyan(' => Current:')}: version`);
Expand Down

0 comments on commit 034a4dc

Please sign in to comment.