Commit graph

9 commits

Author SHA1 Message Date
KaiserBh
92646dacc8
build(web): bump vite and cjs node api refactor (#1276)
* refactor: use ES module.

To maintain compatibility with vite 6 and since that's where the web are heading too.
Also moved some deps to devDeps, better optimized production builds. Changed some of the script command to match how others run or preview it, I think it was still using CRA.

* chore: update-lock.yaml

* refactor: since we are using ESM now, .cjs .ts required.

Changed the file extensions and refactored the .eslintrc.cjs I think there was a lot of bloat from the previous version and removed most of them and keep it simple for now, we can always expand from here a clean slate.

* refactor: added .node.json and refactored.

* fix(build): APIClient.ts had few error.

ESLint: Unexpected lexical declaration in case block.(no-case-declarations)

and TS2554: Expected  0-1  arguments, but got  2
we passed the cause to the constructor which it only takes 1 argument so removed it instead, since it's already in the string "Offline".

* fix(build): import never used.

* fix(build): add the types for react-dom/client.

* fix(build): use ESNext instead.

* fix(build): hmm why are we missing the types for the import?

Added @types/react-table.

* chore(lint): fix lint warnings

Don't use * for export.

* chore(lint): missing deps.

React Hook useEffect has a missing dependency: 'validateForm'. Either include it or remove the dependency array

* chore(lint): fix import.

* chore(lint): fix import.

* chore(lint): fix react hook.

error  React Hook "useMutation" is called conditionally. React Hooks must be called in the exact same order in every component render  react-hooks/rules-of-hooks

* chore(lint): value never used.

  52:10  error    '_regexPattern' is assigned a value but never used

* chore(lint): add missing dependency to useEffect

* chore(lint): fix imports.

* chore(lint): add deps to array.

* chore(lint): error  Unexpected lexical declaration in case block  no-case-declarations

* chore(lint): remove any and add types.

I am not sure about type CompleteFilterType I know it's being used for JSON so might need to use any?? dunno just test it and see if works.

* chore(lint): react-hooks/exhaustive-deps

* chore(lint): react-hooks/exhaustive-deps

* chore(lint): use type guard instead of any.

* chore(lint): react-hooks/exhaustive-deps

* Revert "chore(lint): remove any and add types."

This reverts commit 7b9168fe7826d63cb00e44df8e15fbde49b59174.

* chore(web): ignore sourcemap warnings

* chore(web): update vite to 5.0.4

* chore: add the new script `pnpm dev` to start the dev env.

* chore: add the curly braces.

more info: https://eslint.org/docs/latest/rules/no-case-declarations

* chore: remove the extra spaces

* chore: remove the extra spaces

* chore: add the curly braces.

* chore: add curly braces

* remove text-shadow property and comment

* revert switch case braces for Actions.tsx

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-12-15 23:36:16 +01:00
Fabricio Silva
c7ec93722b
chore(web): relocations and cleanups (#957)
* delete manifest (vite-plugin-pwa generates it)

* fix upper case letter on screen components

* fix imports of screens components missing upper case

* remove default export from Base.tsx

* move RegexPlayground to settings import

* replace some relative path imports

* remove React and ununsed imports

* small alignments on vite.config.ts

* move Dashboard and Releases to screens

* move filters/index.tsx to filters/index.ts

* remove default export from APIKeyAddForm

* remove default export from FilterAddForm

* organize imports and exports for the router

* add .vscode workspace to gitignore

* some touchs on .gitignore file

* fix some eslint rules
2023-07-21 17:33:51 +02:00
ze0s
6e5385a490
refactor(web): replace pkg react-query with tanstack/react-query (#868)
* refactor: move to tanstack/react-query and fix cache

* refactor(releases): move to tanstack/react-query

* refactor(logs): move to tanstack/react-query

* refactor(base): move to tanstack/react-query

* refactor(base): move to tanstack/react-query

* refactor(dashboard): move to tanstack/react-query

* refactor(auth): move to tanstack/react-query

* refactor(filters): move to tanstack/react-query

* refactor(settings): move to tanstack/react-query

* chore(pkg): add tanstack/react-query

* refactor(filters): move to tanstack/react-query

* refactor: move to tanstack/react-query

* refactor: invalidate queries

* chore(pkg): remove old react-query

* chore: change imports to root prefixes

* build: remove needs web from test

* set enableReinitialize to true to fix formik caching issues

* fix all property for apiKeys const

* fix toast when enabling/disabling feed

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-04-27 21:26:27 +02:00
KaiserBh
1cdbbe5bf3
refactor(web): migrate create-react-app to vite (#823)
* fix(build): dockerignore add exclusions

* fix: baseurl and build

* chore: removed react-app-env instead use vite

* chore: updated server and embedding static files.

* commented because conflict I believe, and not needed.

* docs: updated readme

* chore: updated json and added vite

* chore: import fix

* chore: updated yarn.lock and package json

* build: add empty dist to compile backend

* fix: use / as default baseurl

---------

Co-authored-by: KaiserBh <kaiserbh@proton.me>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-04-10 14:28:24 +02:00
ze0s
33897b04a1
Revert #787 (#821)
Revert "refactor(web): migrate create-react-app to vite (#787)"

This reverts commit edae1bbf4b.
2023-04-07 19:08:42 +02:00
KaiserBh
edae1bbf4b
refactor(web): migrate create-react-app to vite (#787)
* removed react-app type instead use vite.

* removed index.html from public since vite uses it from root: read more: https://vitejs.dev/guide/#index-html-and-project-root

* yarn.lock update.

* added vite config file. With commented rollUp option if we want the build to be called build but using default stuff for now.

* updated tsconfig to use vite and include vite.config.ts

* changed package json build commands to use vite.

* for some reason there is an error in vite config when we put project as tsconfig.json.

* build.go updated to use the new dist folder.

* refactored as well updated to use dist and web.AssetHandler again.

* Fixed issue forcing the frontend to be reloaded for all routes to work if logged in fresh without reloading it will always go back to dashboard.

* updated it to use the new function; need to fix the Index for baseUrl I believe, if enabled it works except logs route will crash due to cors.

* refactored and default port to 7474, don't think we need the rollUpOptions.

* added tmp/ to ignore .

* init air.toml, for dev hot reloading both app and backend. https://github.com/cosmtrek/air run it using air but make sure it's in PATH

* updated the start command to build and watch for changes, works great with air.

* revert

* added proxy for vite config. To be used for dev.

* refactor: I think this should fix it, when logs route etc getting accessed usually it throws error but by getting rid of the catch-all it should work as intended, since web.RegisterHandler(r) will catch the unmatched ones.

* fix: baseurl and build

* fix(build): docker ignore !web/dist

* fix(build): dockerignore add exclusions

* docs: update README.md

* build: update postcss config

---------

Co-authored-by: KaiserBh <kaiserbh@proton.me>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-04-07 16:04:10 +02:00
stacksmash76
cb8f280e86
refactor(web) add eslint (#222)
* fix(tsconfig.json): changed skipLibCheck to false.
refactor(eslint): moved configuration from package.json to .eslintrc.js and added a typescript plugin for future use

* feat: wip eslint and types

* feat: fix identation

* feat: get rid of last any types
2022-05-17 06:44:07 +02:00
stacksmash76
20138030e1
refactor: various frontend improvements (#101)
* Removed recoil and replaced it with react-ridge-state, a 0.4kb alternative.

* Added AuthContext and SettingsContext persistent localStorage states.

* Fixed tailwind.config.js incorrect key directive. See https://tailwindcss.com/docs/content-configuration#safelisting-classes.

* Changed darkMode in Tailwind to "class" and started manually adjusting the theme according to the appropriate media query.

* Added possibility of changing the theme manually via the Settings tab.

* Changed Releases.tsx behavior to show the UI only when the HTTP request succeeded and there is some data (i.e. table is non-empty).

* Changed the table color of screens/filters/list.tsx to a one notch lighter shade of gray for eye-comfort.

* Replaced "User" in the header, with the users real username.

* Made data version, commit and date fields optional in settings/Application.tsx.

* Started working on a RegExp playground, which works fine, but JS won't cooperate and return the right match length. Either way, the RegExp must be implemented on backend and then must be communicated with the frontend. Otherwise a potential for incorrect results exists.

* Removed Layout.tsx, since it was redundant.

* Created a Checkbox component class for easier and consistent future use.

* Rewritten App.tsx, Login.tsx, Logout.tsx to accomodate for new changes.

* Fixed previous mistake regarding tailwind.config.js purge key, since we're still using old postcss7 from October last year

* Removed package-lock.json from both root and web directories.

* Refresh TypeScript configuration to support a types/ directory containing d.ts. The effect of this is that types don't have to be imported anymore and are at all times available globally. This also unifies them into a single source of truth, which will be a lot easier to manage in the future. Note: Only certain interop types have been moved at the time of writing.

* Fixed minor Checkbox argument mistake.

* fix: remove length from data check

* chore: lock files are annoying

* fix: select

* fix: wip release filtering
2022-01-26 23:54:29 +01:00
Ludvig Lundgren
773e57afe6 feat: add webui 2021-08-11 15:27:48 +02:00