This commit is contained in:
Andras Bacsai 2022-12-29 22:33:31 +01:00
parent 4d26175ebe
commit 7d892bb19d
5 changed files with 20 additions and 6 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ dist
apps/api/db/*.db
apps/api/db/migration.db-journal
apps/api/core*
apps/server/build
apps/backup/backups/*
!apps/backup/backups/.gitkeep
/logs

7
apps/server/nodemon.json Normal file
View File

@ -0,0 +1,7 @@
{
"watch": ["src"],
"ignore": ["src/**/*.test.ts"],
"ext": "ts,mjs,json,graphql",
"exec": "rimraf build && esbuild `find src \\( -name '*.ts' -o -name '*.js' \\)` --platform=node --outdir=build --format=cjs && node build",
"legacyWatch": true
}

View File

@ -4,7 +4,8 @@
"license": "Apache-2.0",
"scripts": {
"build": "rimraf ../../build && tsc --outDir ../../build",
"dev": "tsx watch --clear-screen=false src",
"dev-old": "tsx watch --clear-screen=false src",
"dev": "nodemon",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"test-dev": "start-server-and-test 'tsx src/server' http-get://localhost:2022 'tsx src/client'",
@ -65,6 +66,8 @@
"@types/node-fetch": "2.6.2",
"@types/shell-quote": "^1.7.1",
"@types/ws": "8.5.3",
"esbuild": "0.15.15",
"nodemon": "2.0.20",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
"start-server-and-test": "1.14.0",

View File

@ -1,6 +1,6 @@
import Bree from 'bree';
import path from 'path';
import Cabin from 'cabin';
// import Cabin from 'cabin';
import TSBree from '@breejs/ts-worker';
export const isDev = process.env['NODE_ENV'] === 'development';
@ -9,7 +9,7 @@ Bree.extend(TSBree);
const options: any = {
defaultExtension: 'js',
logger: new Cabin(),
logger: false,
// logger: false,
// workerMessageHandler: async ({ name, message }) => {
// if (name === 'deployApplication' && message?.deploying) {
@ -18,9 +18,8 @@ const options: any = {
// }
// }
// },
// jobs: [{ name: 'deployApplication' }]
jobs: [{ name: 'worker' }]
jobs: [{ name: 'deployApplication' }, { name: 'worker' }]
};
if (isDev) options.root = path.join(__dirname, '../jobs');
if (isDev) options.root = path.join(__dirname, './jobs');
export const scheduler = new Bree(options);

View File

@ -265,6 +265,7 @@ importers:
cuid: 2.1.8
dayjs: 1.11.6
dotenv: ^16.0.3
esbuild: 0.15.15
execa: 6.1.0
fastify: 4.10.2
fastify-plugin: 4.4.0
@ -274,6 +275,7 @@ importers:
js-yaml: 4.1.0
jsonwebtoken: 8.5.1
node-fetch: 3.3.0
nodemon: 2.0.20
npm-run-all: 4.1.5
p-all: 4.0.0
p-throttle: 5.0.0
@ -340,6 +342,8 @@ importers:
'@types/node-fetch': 2.6.2
'@types/shell-quote': 1.7.1
'@types/ws': 8.5.3
esbuild: 0.15.15
nodemon: 2.0.20
npm-run-all: 4.1.5
rimraf: 3.0.2
start-server-and-test: 1.14.0