build: enhance nx build (#2948)

This commit is contained in:
Alex Yang
2023-07-01 01:17:31 +08:00
committed by GitHub
parent 7a5a5d503a
commit 81c5e6d3d2
27 changed files with 559 additions and 138 deletions
-1
View File
@@ -11,7 +11,6 @@ export default function getConfig() {
BUILD_DATE: '2021-09-01T00:00:00.000Z',
gitVersion: 'UNKNOWN',
hash: 'UNKNOWN',
editorVersion: 'UNKNOWN',
serverAPI: 'http://127.0.0.1:3000/',
editorFlags: blockSuiteFeatureFlags,
...buildFlags,
-37
View File
@@ -1,37 +0,0 @@
import http from 'node:http';
const options = {
hostname: 'localhost',
port: 3000,
path: '/api/healthz',
method: 'GET',
};
const maxAttempts = 5;
const timeout = 1000;
let attempts = 0;
while (attempts < maxAttempts) {
await new Promise(resolve => setTimeout(resolve, timeout * (1 << attempts)));
await new Promise(resolve => {
const req = http.request(options, res => {
if (res.statusCode === 204) {
console.log('Server is ready');
process.exit(0);
} else {
console.log(`Unexpected response: ${res.statusCode}`);
}
resolve();
});
req.on('error', error => {
console.error(error);
resolve();
});
req.end();
attempts++;
});
}
process.exit(1);