('app.port'),
+ );
await app.start();
})().catch(err => {
logger.error(err);
diff --git a/src/tsconfig.json b/src/tsconfig.json
new file mode 100644
index 0000000..890991d
--- /dev/null
+++ b/src/tsconfig.json
@@ -0,0 +1,30 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "composite": true,
+
+ "module": "CommonJS",
+
+ "baseUrl": "../dist",
+ "rootDir": "./",
+ "sourceRoot": "./",
+ "outDir": "../dist",
+
+ "typeRoots": [
+ "src/types"
+ ]
+ },
+ "include": [
+ "./**/*",
+ "../node_modules/swaf/types"
+ ],
+ "exclude": [
+ "./assets/**/*",
+ "./common/**/*"
+ ],
+ "references": [
+ {
+ "path": "./common"
+ }
+ ]
+}
diff --git a/src/types/.gitkeep b/src/types/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/tsconfig.frontend.json b/tsconfig.frontend.json
deleted file mode 100644
index ad74720..0000000
--- a/tsconfig.frontend.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "outDir": "public/js",
- "rootDir": "./assets",
- "target": "ES6",
- "strict": true,
- "lib": [
- "es2020",
- "DOM"
- ],
- "typeRoots": [
- "./node_modules/@types"
- ]
- },
- "include": [
- "assets/ts/**/*"
- ]
-}
diff --git a/tsconfig.json b/tsconfig.json
index 12eec0a..6a82f14 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,22 +1,43 @@
{
"compilerOptions": {
- "module": "CommonJS",
- "esModuleInterop": true,
- "outDir": "dist",
- "rootDir": "./src",
- "target": "ES6",
+ "target": "ESNext",
+ "module": "ESNext",
+ "declaration": true,
+ "stripInternal": true,
+
"strict": true,
+ "allowSyntheticDefaultImports": true,
+ "strictNullChecks": true,
+
+ "moduleResolution": "Node",
+ "esModuleInterop": true,
+ "baseUrl": "dist",
+ "inlineSourceMap": true,
+ "inlineSources": true,
+ "outDir": "dist",
+
+ "typeRoots": [
+ "node_modules/@types",
+ "src/types"
+ ],
"lib": [
"es2020",
- "DOM"
+ "dom"
],
- "typeRoots": [
- "./node_modules/@types"
- ],
- "resolveJsonModule": true
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "allowJs": true
},
- "include": [
- "src/**/*",
- "node_modules/swaf/types"
+ "include": [],
+ "references": [
+ {
+ "path": "src",
+ },
+ {
+ "path": "src/assets/ts",
+ },
+ {
+ "path": "src/assets/views",
+ }
]
}
diff --git a/tsconfig.test.json b/tsconfig.test.json
index 897a6b4..fce2399 100644
--- a/tsconfig.test.json
+++ b/tsconfig.test.json
@@ -11,4 +11,4 @@
"src/types/**/*",
"test/**/*"
]
-}
\ No newline at end of file
+}
diff --git a/views/about.njk b/views/about.njk
deleted file mode 100644
index f1e7a0a..0000000
--- a/views/about.njk
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends 'layouts/base.njk' %}
-
-{% set title = app.name + ' - About us' %}
-
-{% block body %}
- Very interesting
-
-
-
- This is us
- And we like swaf!
-
-
-{% endblock %}
diff --git a/views/home.njk b/views/home.njk
deleted file mode 100644
index 09adf33..0000000
--- a/views/home.njk
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends 'layouts/base.njk' %}
-
-{% set title = app.name + ' - Hello world!' %}
-
-{% block body %}
- Hello world!
-{% endblock %}
\ No newline at end of file
diff --git a/views/layouts/base.njk b/views/layouts/base.njk
deleted file mode 100644
index f350e8e..0000000
--- a/views/layouts/base.njk
+++ /dev/null
@@ -1,41 +0,0 @@
-{% extends 'layouts/barebone.njk' %}
-{% import 'macros.njk' as macros %}
-
-{% block _stylesheets %}
- {{ super() }}
-
- {% block stylesheets %}{% endblock %}
-{% endblock %}
-{% block _scripts %}
- {{ super() }}
- {% block scripts %}{% endblock %}
-{% endblock %}
-
-{% block header %}
- {{ app.name }}
-
-{% endblock %}
-
-{% block _body %}
-
- {{ macros.messages(flash) }}
-
-
-
- {% if h1 %}
- {{ h1 }}
- {% endif %}
- {% if subtitle %}
- {{ subtitle }}
- {% endif %}
-
- {% block body %}{% endblock %}
-
-{% endblock %}
-
-{% block footer %}{{ app.name }} v{{ app_version }} - all rights reserved.{% endblock %}
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
deleted file mode 100644
index b624595..0000000
--- a/webpack.config.js
+++ /dev/null
@@ -1,121 +0,0 @@
-const path = require('path');
-const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
-const {extendDefaultPlugins} = require("svgo");
-const TerserPlugin = require('terser-webpack-plugin');
-
-const dev = process.env.NODE_ENV === 'development';
-
-const userConfig = require('./assets/config.json');
-for (const b in userConfig.bundles) {
- if (userConfig.bundles.hasOwnProperty(b)) {
- userConfig.bundles[b] = `./assets/${userConfig.bundles[b]}`;
- }
-}
-
-const config = {
- entry: userConfig.bundles,
- output: {
- path: path.resolve(__dirname, 'public/js'),
- filename: '[name].js'
- },
- devtool: dev ? 'eval-source-map' : undefined,
- module: {
- rules: [
- {
- test: /\.js$/i,
- use: [
- {
- loader: 'babel-loader',
- options: {
- presets: ['@babel/preset-env'],
- }
- }
- ]
- },
- {
- test: /\.s[ac]ss$/i,
- use: [
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- publicPath: '/',
- }
- },
- 'css-loader',
- 'sass-loader',
- ]
- },
- {
- test: /\.(woff2?|eot|ttf|otf)$/i,
- use: 'file-loader?name=../fonts/[name].[ext]',
- },
- {
- test: /\.tsx?$/i,
- use: {
- loader: 'ts-loader',
- options: {
- configFile: 'tsconfig.frontend.json',
- }
- },
- exclude: '/node_modules/'
- },
- {
- test: /\.(png|jpe?g|gif|svg)$/i,
- use: [
- 'file-loader?name=../img/[name].[ext]',
- ],
- type: 'asset',
- }
- ],
- },
- resolve: {
- extensions: ['.tsx', '.ts', '.js'],
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: '../css/[name].css',
- }),
- new ImageMinimizerPlugin({
- minimizerOptions: {
- // Lossless optimization with custom option
- // Feel free to experiment with options for better result for you
- plugins: [
- ["gifsicle", {}],
- ["mozjpeg", {}],
- ["pngquant", {}],
- ["webp", {quality: 90}],
- // Svgo configuration here https://github.com/svg/svgo#configuration
- [
- "svgo",
- {
- plugins: extendDefaultPlugins([
- {
- name: "removeViewBox",
- active: false,
- },
- {
- name: "addAttributesToSVGElement",
- params: {
- attributes: [{xmlns: "http://www.w3.org/2000/svg"}],
- },
- },
- ]),
- },
- ],
- ],
- },
- }),
- ]
-};
-
-if (!dev) {
- config.optimization = {
- minimize: true,
- minimizer: [
- new TerserPlugin(),
- ]
- };
-}
-
-module.exports = config;