diff --git a/package.json b/package.json index 53fec61862..9ed3b955f8 100644 --- a/package.json +++ b/package.json @@ -12,21 +12,21 @@ ], "scripts": { "serve-static": "live-server --open=demo --watch=build/o_spreadsheet.js,build/o_spreadsheet.xml,demo", - "dev": "npm-run-all build --parallel server serve-static watch:*", + "dev": "npm-run-all --print-label build --parallel server serve-static watch:*", "server": "node tools/server/main.js", "build:js": "tsc --module es6 --incremental", - "bundle:js": "rollup -c -m --configDev", - "bundle:xml": "node tools/bundle_xml/main.js", - "build": "npm-run-all build:js bundle:js \"bundle:xml -- --outDir build\"", + "build:bundleJs": "rollup -c -m --configDev", + "build:bundleXml": "node tools/bundle_xml/main.js", + "build": "npm-run-all build:js build:bundleJs \"build:bundleXml -- --outDir build\"", "doc": "typedoc", "precommit": "npm run prettier && npm run doc", "test": "jest", "test:watch": "jest --watch", "prettier": "prettier . --write", "check-formatting": "prettier . --check", - "dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run bundle:xml -- --outDir dist", + "dist": "tsc --module es6 --declaration --declarationDir dist/types && rollup -c && npm run build:bundleXml -- --outDir dist", "prepare": "husky install", - "watch:bundle": "npm run bundle:js -- --watch", + "watch:bundle": "npm run build:bundleJs -- --watch", "watch:ts": "npm run build:js -- --watch", "watch:xml": "node tools/bundle_xml/watch_xml_templates.js", "unzipXlsx": "node tools/bundle_xlsx/unzip_xlsx_demo.js", diff --git a/tools/server/main.js b/tools/server/main.js index 650a65a5bf..a33169af4b 100644 --- a/tools/server/main.js +++ b/tools/server/main.js @@ -42,11 +42,11 @@ if (fs.existsSync(currentSessionFile)) { } // save the messages before exiting gracefully -[`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`].forEach((eventType) => { - process.on(eventType, () => { +[`SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`].forEach((eventType) => { + process.on(eventType, (code) => { log(`writing ${messages.length} messages to ${currentSessionFile}`); fs.writeFileSync(currentSessionFile, JSON.stringify(messages)); - process.exit(); + process.exit(code); }); }); diff --git a/tsconfig.json b/tsconfig.json index af9a4b6ae0..30fb086b8a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ "strictNullChecks": true, "esModuleInterop": true, "allowJs": true, + "preserveWatchOutput": true, "sourceMap": true }, "include": ["src"],