From d7a59b2ff02f12c5c690b91b6d4c31137ab7e158 Mon Sep 17 00:00:00 2001 From: Pavel Date: Wed, 9 Jun 2021 22:18:03 +0300 Subject: [PATCH] Fix dashboard (#12) * TS replaced with js * Livereload works for ELM part * Fix layout issue with empty spaces * Using pure css spinners * Fixed services not being displayed in module page --- .dockerignore | 1 + .eslintrc.js | 42 +- .github/workflows/container.yml | 2 +- caddy.Dockerfile | 2 +- elm.json | 5 +- favicon.ico | Bin 0 -> 15406 bytes index.html | 1 - nginx.Dockerfile | 4 - nginx.conf | 9 - package-lock.json | 8092 ++++++++++--------------------- package.json | 119 +- src/BlueprintPage/View.elm | 36 +- src/Main.elm | 2 - src/Main.elm.d.ts | 1 - src/Model.elm | 2 - src/ModulePage/View.elm | 7 +- src/Modules/View.elm | 8 +- src/Msg.elm | 2 - src/SpinnerView.elm | 24 +- src/Subscriptions.elm | 2 - src/Update.elm | 10 - src/Utils/Utils.elm | 5 + src/{index.ts => index.js} | 89 +- src/types.js | 46 + src/types.ts | 91 - tsconfig.json | 28 - webpack.config.js | 235 +- 27 files changed, 2872 insertions(+), 5993 deletions(-) create mode 100644 favicon.ico delete mode 100644 nginx.Dockerfile delete mode 100644 nginx.conf delete mode 100644 src/Main.elm.d.ts rename src/{index.ts => index.js} (63%) create mode 100644 src/types.js delete mode 100644 src/types.ts delete mode 100644 tsconfig.json diff --git a/.dockerignore b/.dockerignore index d5e2da4..e565d74 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ * **/* !bundle/ +!dist/ !Caddyfile !nginx.conf diff --git a/.eslintrc.js b/.eslintrc.js index 11f5436..d3ef6c0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,14 +16,40 @@ module.exports = { 'plugin:prettier/recommended', ], plugins: ['@typescript-eslint', 'prettier'], - rules: {}, + rules: { + 'func-names': ['error', 'as-needed'], + 'prefer-destructuring': 'off', + 'object-shorthand': ['error', 'consistent-as-needed'], + 'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], + + 'import/prefer-default-export': 'off', + 'import/extensions': [ + 'error', + 'ignorePackages', + { + js: 'never', + mjs: 'never', + jsx: 'never', + ts: 'never', + tsx: 'never', + }, + ], + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], + '@typescript-eslint/no-explicit-any': 'off', + + // should be overriden for current project only + 'no-param-reassign': ['error', { props: false }], + 'no-console': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + }, settings: { - // 'import/resolver': { - // browser: { - // extensions: ['.js', '.js', '.ts', '.ts', '.css', '.elm'], - // paths: ['src'], - // }, - // }, - 'import/extensions': ['.js', '.ts'], + 'import/extensions': ['.js', '.ts', '.jsx', '.tsx'], + 'import/resolver': { + typescript: {}, + node: { + paths: ['src'], + }, + }, }, }; diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index ff0b00f..266862c 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -28,7 +28,7 @@ jobs: node-version: 14 - run: npm install - - run: npm run pack + - run: npm run build env: CI: true diff --git a/caddy.Dockerfile b/caddy.Dockerfile index 10ab4ef..82e730a 100644 --- a/caddy.Dockerfile +++ b/caddy.Dockerfile @@ -1,6 +1,6 @@ FROM caddy WORKDIR / -COPY ./bundle /bundle +COPY ./dist /bundle COPY Caddyfile /Caddyfile #RUN printf '\n\ diff --git a/elm.json b/elm.json index 4f18fba..3eeb3de 100644 --- a/elm.json +++ b/elm.json @@ -1,15 +1,12 @@ { "type": "application", - "source-directories": [ - "src" - ], + "source-directories": ["src"], "elm-version": "0.19.1", "dependencies": { "direct": { "Chadtech/unique-list": "2.1.4", "avh4/elm-color": "1.0.0", "ccapndave/elm-flat-map": "1.2.0", - "damienklinnert/elm-spinner": "3.0.2", "elm/browser": "1.0.2", "elm/core": "1.0.5", "elm/html": "1.0.0", diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000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