From 5d16bc740b86a9ad162a520f75e81fe685ea7ead Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 18 Apr 2021 19:43:35 +0800 Subject: [PATCH] build: use prepare+build --- .github/workflows/build.yml | 2 +- build/{build.js => prepare.js} | 10 ---------- package.json | 4 ++-- packages/hydrooj/package.json | 2 +- 4 files changed, 4 insertions(+), 14 deletions(-) rename build/{build.js => prepare.js} (87%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94077fa3f..8d75b9259 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: run: yarn - name: Build run: | - yarn build + yarn build --verbose yarn build:ui:production - name: Lint run: yarn lint:ci diff --git a/build/build.js b/build/prepare.js similarity index 87% rename from build/build.js rename to build/prepare.js index 91289dcad..adf06187c 100644 --- a/build/build.js +++ b/build/prepare.js @@ -1,7 +1,5 @@ const fs = require('fs'); const path = require('path'); -const { argv } = require('yargs'); -const { sync } = require('cross-spawn'); const compilerOptionsBase = { target: 'es2019', @@ -69,11 +67,3 @@ for (const package of packages) { } } fs.writeFileSync(path.resolve(process.cwd(), 'tsconfig.json'), JSON.stringify(config)); - -sync('./node_modules/.bin/tsc -b packages/hydrooj', { stdio: 'inherit' }); - -if (argv.watch) { - sync('./node_modules/.bin/tsc -b --watch', { stdio: 'inherit' }); -} else { - sync('./node_modules/.bin/tsc -b', { stdio: 'inherit' }); -} diff --git a/package.json b/package.json index 072c20723..234210f1c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ ], "main": "package.json", "scripts": { - "build": "node build/build.js", - "build:watch": "node build/build.js --watch", + "build": "node build/prepare.js && tsc -b", + "build:watch": "node build/build.js && tsc -b --watch", "build:ui": "node packages/ui-default/build", "build:ui:dev": "node packages/ui-default/build --dev", "build:ui:production": "node packages/ui-default/build --production", diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 75b693954..6c322421b 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -26,7 +26,7 @@ "koa-router": "^10.0.0", "koa-static-cache": "^5.1.3", "lodash": "^4.17.21", - "minio": "7.0.18", + "minio": "7.0.17", "moment-timezone": "^0.5.32", "mongodb": "^3.6.6", "nodemailer": "^6.5.0",