diff --git a/config/default.ts b/config/default.json5 similarity index 98% rename from config/default.ts rename to config/default.json5 index aed8601..1831e21 100644 --- a/config/default.ts +++ b/config/default.json5 @@ -1,4 +1,4 @@ -export default { +{ app: { name: 'Example App', contact_email: 'contact@example.net' diff --git a/config/production.ts b/config/production.json5 similarity index 94% rename from config/production.ts rename to config/production.json5 index 4143867..6993e0e 100644 --- a/config/production.ts +++ b/config/production.json5 @@ -1,4 +1,4 @@ -export default { +{ log_level: "DEBUG", db_log_level: "ERROR", public_url: "https://watch-my.stream", diff --git a/config/test.ts b/config/test.json5 similarity index 90% rename from config/test.ts rename to config/test.json5 index 61f7c4a..c184427 100644 --- a/config/test.ts +++ b/config/test.json5 @@ -1,4 +1,4 @@ -export default { +{ mysql: { host: "localhost", user: "root", diff --git a/package.json b/package.json index 04056cc..3ad46b8 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@typescript-eslint/parser": "^4.3.0", "babel-loader": "^8.1.0", "concurrently": "^5.1.0", - "css-loader": "^4.2.2", + "css-loader": "^5.0.0", "eslint": "^7.10.0", "feather-icons": "^4.28.0", "file-loader": "^6.0.0", @@ -46,21 +46,20 @@ "imagemin-svgo": "^8.0.0", "img-loader": "^3.0.1", "jest": "^26.1.0", - "mini-css-extract-plugin": "^0.11.0", - "node-sass": "^4.14.0", + "mini-css-extract-plugin": "^1.2.1", + "node-sass": "^5.0.0", "nodemon": "^2.0.3", "sass-loader": "^10.0.1", - "terser-webpack-plugin": "^4.2.2", + "terser-webpack-plugin": "^5.0.3", "ts-jest": "^26.1.1", "ts-loader": "^8.0.4", "typescript": "^4.0.2", - "uglifyjs-webpack-plugin": "^2.2.0", - "webpack": "^4.43.0", - "webpack-cli": "^3.3.11" + "webpack": "^5.3.2", + "webpack-cli": "^4.1.0" }, "dependencies": { "config": "^3.3.1", "express": "^4.17.1", - "wms-core": "^0.22.0-rc.24" + "wms-core": "^0.22.0" } } diff --git a/src/App.ts b/src/App.ts index c8dac6b..6633f86 100644 --- a/src/App.ts +++ b/src/App.ts @@ -1,7 +1,6 @@ import Application from "wms-core/Application"; import Migration, {MigrationType} from "wms-core/db/Migration"; import CreateMigrationsTable from "wms-core/migrations/CreateMigrationsTable"; -import CreateLogsTable from "wms-core/migrations/CreateLogsTable"; import ExpressAppComponent from "wms-core/components/ExpressAppComponent"; import NunjucksComponent from "wms-core/components/NunjucksComponent"; import MysqlComponent from "wms-core/components/MysqlComponent"; @@ -18,6 +17,8 @@ import WebSocketServerComponent from "wms-core/components/WebSocketServerCompone import HomeController from "./controllers/HomeController"; import AutoUpdateComponent from "wms-core/components/AutoUpdateComponent"; import packageJson = require('../package.json'); +import DummyMigration from "wms-core/migrations/DummyMigration"; +import DropLegacyLogsTable from "wms-core/migrations/DropLegacyLogsTable"; export default class App extends Application { public constructor( @@ -30,7 +31,8 @@ export default class App extends Application { protected getMigrations(): MigrationType[] { return [ CreateMigrationsTable, - CreateLogsTable, + DummyMigration, + DropLegacyLogsTable, ]; } diff --git a/src/main.ts b/src/main.ts index 76e7561..e243999 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,15 +6,15 @@ process.env['NODE_CONFIG_DIR'] = + delimiter + (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/'); -import Logger from "wms-core/Logger"; +import {log} from "wms-core/Logger"; import App from "./App"; import config from "config"; (async () => { - Logger.debug('Config path:', process.env['NODE_CONFIG_DIR']); + log.debug('Config path:', process.env['NODE_CONFIG_DIR']); const app = new App(config.get('listen_addr'), config.get('port')); await app.start(); })().catch(err => { - Logger.error(err); + log.error(err); });