mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ci: build gulp first
This commit is contained in:
1 parent
b7839bdd9a
commit
d9667fab44
4 files changed
+29
-23
No files matched your search
@@ -44,7 +44,8 @@ jobs:
|
||||
yarn
|
||||
- name: Build And Lint
|
||||
run: |
|
||||
parallel --tty -j+0 yarn ::: lint:ci lint:ui:ci build build:ui:production
|
||||
yarn build:ui:gulp
|
||||
parallel --tty -j+0 yarn ::: lint:ci lint:ui:ci build build:ui:production:webpack
|
||||
- name: Publish
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: node build/publish.js
|
||||
|
||||
+3
-2
@@ -6,13 +6,14 @@ const compilerOptionsBase = {
|
||||
module: 'commonjs',
|
||||
esModuleInterop: true,
|
||||
moduleResolution: 'node',
|
||||
declaration: true,
|
||||
// declaration: true,
|
||||
sourceMap: false,
|
||||
composite: true,
|
||||
strictBindCallApply: true,
|
||||
experimentalDecorators: true,
|
||||
emitDecoratorMetadata: true,
|
||||
// emitDecoratorMetadata: true,
|
||||
noEmit: true,
|
||||
incremental: true,
|
||||
};
|
||||
const config = {
|
||||
compilerOptions: compilerOptionsBase,
|
||||
|
||||
+5
-3
@@ -9,9 +9,11 @@
|
||||
"scripts": {
|
||||
"build": "node build/prepare.js && tsc -b --verbose",
|
||||
"build:watch": "node build/prepare.js && tsc -b --watch",
|
||||
"build:ui": "node packages/ui-default/build",
|
||||
"build:ui:dev": "node --trace-deprecation packages/ui-default/build --dev",
|
||||
"build:ui:production": "node packages/ui-default/build --production",
|
||||
"build:ui": "yarn build:ui:gulp && node packages/ui-default/build",
|
||||
"build:ui:gulp": "node packages/ui-default/build --gulp",
|
||||
"build:ui:dev": "yarn build:ui:gulp && node --trace-deprecation packages/ui-default/build --dev",
|
||||
"build:ui:production": "yarn build:ui:gulp && node packages/ui-default/build --production",
|
||||
"build:ui:production:webpack": "node packages/ui-default/build --production",
|
||||
"lint": "eslint packages --ext ts --fix",
|
||||
"lint:ci": "eslint packages --ext ts",
|
||||
"lint:ui": "yarn workspace @hydrooj/ui-default eslint --ext .js,.ts,.jsx,.tsx . --fix",
|
||||
|
||||
@@ -86,23 +86,25 @@ async function runGulp() {
|
||||
async function main() {
|
||||
const dir = process.cwd();
|
||||
process.chdir(root());
|
||||
await runGulp();
|
||||
await runWebpack(argv.options as any);
|
||||
if (fs.existsSync('public/hydro.js')) {
|
||||
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
|
||||
}
|
||||
if (fs.existsSync('public/polyfill.js')) {
|
||||
fs.copyFileSync('public/polyfill.js', `public/polyfill-${pkg.version}.js`);
|
||||
}
|
||||
if (fs.existsSync('public/default.theme.css')) {
|
||||
fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`);
|
||||
}
|
||||
if (argv.options.production) {
|
||||
fs.removeSync('public/vditor/dist/js/mathjax');
|
||||
fs.removeSync('public/vditor/dist/js/echarts');
|
||||
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
||||
if (argv.options.gulp) await runGulp();
|
||||
else {
|
||||
await runWebpack(argv.options as any);
|
||||
if (fs.existsSync('public/hydro.js')) {
|
||||
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
|
||||
}
|
||||
if (fs.existsSync('public/polyfill.js')) {
|
||||
fs.copyFileSync('public/polyfill.js', `public/polyfill-${pkg.version}.js`);
|
||||
}
|
||||
if (fs.existsSync('public/default.theme.css')) {
|
||||
fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`);
|
||||
}
|
||||
if (argv.options.production) {
|
||||
fs.removeSync('public/vditor/dist/js/mathjax');
|
||||
fs.removeSync('public/vditor/dist/js/echarts');
|
||||
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
||||
}
|
||||
}
|
||||
process.chdir(dir);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user