mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
chore(): add production build check (#19031)
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
const tc = require('turbocolor');
|
const tc = require('turbocolor');
|
||||||
const execa = require('execa');
|
const execa = require('execa');
|
||||||
const Listr = require('listr');
|
const Listr = require('listr');
|
||||||
|
const path = require('path');
|
||||||
const octokit = require('@octokit/rest')()
|
const octokit = require('@octokit/rest')()
|
||||||
const common = require('./common');
|
const common = require('./common');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
@ -16,6 +17,8 @@ async function main() {
|
|||||||
throw new Error('env.GH_TOKEN is undefined');
|
throw new Error('env.GH_TOKEN is undefined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkProductionRelease();
|
||||||
|
|
||||||
const tasks = [];
|
const tasks = [];
|
||||||
const { version } = common.readPkg('core');
|
const { version } = common.readPkg('core');
|
||||||
const changelog = findChangelog();
|
const changelog = findChangelog();
|
||||||
@ -39,6 +42,15 @@ async function main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkProductionRelease() {
|
||||||
|
const corePath = common.projectPath('core');
|
||||||
|
const hasEsm = fs.existsSync(path.join(corePath, 'dist', 'esm'));
|
||||||
|
const hasEsmEs5 = fs.existsSync(path.join(corePath, 'dist', 'esm-es5'));
|
||||||
|
const hasCjs = fs.existsSync(path.join(corePath, 'dist', 'cjs'));
|
||||||
|
if (!hasEsm || !hasEsmEs5 || !hasCjs) {
|
||||||
|
throw new Error('core build is not a production build');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function publishGit(tasks, version, changelog) {
|
function publishGit(tasks, version, changelog) {
|
||||||
const tag = `v${version}`;
|
const tag = `v${version}`;
|
||||||
|
Reference in New Issue
Block a user