From a26f02a485e4f5cb1857b20a6cac2711437d5df0 Mon Sep 17 00:00:00 2001 From: Hazork Date: Sat, 4 Sep 2021 19:27:44 -0300 Subject: [PATCH] fix: fixed web menu and changed web server tsconfig --- web/package.json | 2 +- web/server/index.ts | 2 +- web/server/tsconfig.json | 37 ++++++++++++++++--------------------- web/src/index.tsx | 3 +++ yarn.lock | 9 ++++++++- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/web/package.json b/web/package.json index 38850f0..97109a3 100644 --- a/web/package.json +++ b/web/package.json @@ -12,7 +12,7 @@ "build": "concurrently \"webpack\" \"tsc --project server\"" }, "dependencies": { - "axios": "^0.21.3", + "axios": "0.21.1", "bootstrap": "^5.0.0-beta2", "dotenv": "^10.0.0", "express": "^4.17.1", diff --git a/web/server/index.ts b/web/server/index.ts index e3e78b5..360091a 100644 --- a/web/server/index.ts +++ b/web/server/index.ts @@ -9,7 +9,7 @@ const dist = path.resolve(__dirname, '..', 'dist'); const app = express(); -app.use('/', express.static(dist, { maxAge: STATIC_AGE })); +app.use(express.static(dist, { maxAge: STATIC_AGE })); app.get('/', (_, res) => res.sendFile(path.resolve(dist, 'index.html'))); diff --git a/web/server/tsconfig.json b/web/server/tsconfig.json index cc166ac..c6fb4a9 100644 --- a/web/server/tsconfig.json +++ b/web/server/tsconfig.json @@ -4,9 +4,9 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - // "lib": ["DOM", "DOM.Iterable", "ESNext"], /* Specify library files to be included in the compilation. */ + "target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + //"lib": ["DOM"] /* Specify library files to be included in the compilation. */, // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "react-jsx", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ @@ -28,29 +28,26 @@ "strict": true /* Enable all strict type-checking options. */, "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, "strictNullChecks": true /* Enable strict null checks. */, - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */, + "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, /* Additional Checks */ - "noUnusedLocals": false /* Report errors on unused locals. */, - "noUnusedParameters": false /* Report errors on unused parameters. */, - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, + "noPropertyAccessFromIndexSignature": true /* Require undeclared properties from index signatures to use element accesses. */, /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + "baseUrl": "./" /* Base directory to resolve non-absolute module names. */, // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - "typeRoots": [ - "node_modules/@types", - "src/@types" - ] /* List of folders to include type definitions from. */, + // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, @@ -69,9 +66,7 @@ /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "resolveJsonModule": true, - "suppressImplicitAnyIndexErrors": true + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["./"] + "include": ["."] } diff --git a/web/src/index.tsx b/web/src/index.tsx index ae2bda8..1e44d46 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -3,6 +3,9 @@ import ReactDOM from 'react-dom'; import { App } from './app'; import { Header } from './header'; +import 'bootstrap/dist/css/bootstrap.min.css'; +import 'bootstrap/dist/js/bootstrap.bundle.min.js'; + ReactDOM.render( <>
diff --git a/yarn.lock b/yarn.lock index b21f519..97fad50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1814,6 +1814,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@0.21.1: + version "0.21.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" + integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== + dependencies: + follow-redirects "^1.10.0" + axios@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.3.tgz#f85d9b747f9b66d59ca463605cedf1844872b82e" @@ -3280,7 +3287,7 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.0.0, follow-redirects@^1.14.0: +follow-redirects@^1.0.0, follow-redirects@^1.10.0, follow-redirects@^1.14.0: version "1.14.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==