-
Notifications
You must be signed in to change notification settings - Fork 13
refactor(web): full frontend architecture overhaul #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eoaksnes
wants to merge
9
commits into
main
Choose a base branch
from
stack/03-web
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3d52884
chore(infra): IaC, compose, radix, redis, oauth2-proxy baseline
eoaksnes bfd23ed
feat(api): add monitoring feature with track_events use case
eoaksnes 34ba3af
refactor(web): full frontend architecture overhaul
eoaksnes ea808d5
fix: add missing todos router
eoaksnes 982a734
refactor: error pages cleanup
awesthouse 8e2d89c
refactor: color scheme and variables initial cleanup
awesthouse 4892f6d
refactor: remove unnecessary comments and code
awesthouse d03ffdb
chore: rebased
eoaksnes a611c70
fix: remove only-allow yarn preinstall hook
Dre90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| !src/**/*.ts | ||
| !src/*.tsx | ||
| !src/**/*.tsx | ||
| !src/**/*.css | ||
|
|
||
| !index.html | ||
| !tsconfig.json | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| const {existsSync} = require(`fs`); | ||
| const {createRequire, register} = require(`module`); | ||
| const {resolve} = require(`path`); | ||
| const {pathToFileURL} = require(`url`); | ||
|
|
||
| const relPnpApiPath = "../../../../.pnp.cjs"; | ||
|
|
||
| const absPnpApiPath = resolve(__dirname, relPnpApiPath); | ||
| const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); | ||
| const absRequire = createRequire(absPnpApiPath); | ||
|
|
||
| const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); | ||
| const isPnpLoaderEnabled = existsSync(absPnpLoaderPath); | ||
|
|
||
| if (existsSync(absPnpApiPath)) { | ||
| if (!process.versions.pnp) { | ||
| // Setup the environment to be able to require eslint/bin/eslint.js | ||
| require(absPnpApiPath).setup(); | ||
| if (isPnpLoaderEnabled && register) { | ||
| register(pathToFileURL(absPnpLoaderPath)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const wrapWithUserWrapper = existsSync(absUserWrapperPath) | ||
| ? exports => absRequire(absUserWrapperPath)(exports) | ||
| : exports => exports; | ||
|
|
||
| // Defer to the real eslint/bin/eslint.js your application uses | ||
| module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "eslint", | ||
| "version": "10.3.0-sdk", | ||
| "main": "./lib/api.js", | ||
| "type": "commonjs", | ||
| "bin": { | ||
| "eslint": "./bin/eslint.js" | ||
| }, | ||
| "exports": { | ||
| ".": { | ||
| "types": "./lib/types/index.d.ts", | ||
| "default": "./lib/api.js" | ||
| }, | ||
| "./config": { | ||
| "types": "./lib/types/config-api.d.ts", | ||
| "default": "./lib/config-api.js" | ||
| }, | ||
| "./package.json": "./package.json", | ||
| "./use-at-your-own-risk": { | ||
| "types": "./lib/types/use-at-your-own-risk.d.ts", | ||
| "default": "./lib/unsupported-api.js" | ||
| }, | ||
| "./rules": { | ||
| "types": "./lib/types/rules.d.ts" | ||
| }, | ||
| "./universal": { | ||
| "types": "./lib/types/universal.d.ts", | ||
| "default": "./lib/universal.js" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # This file is automatically generated by @yarnpkg/sdks. | ||
| # Manual changes might be lost! | ||
|
|
||
| integrations: | ||
| - vscode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| const {existsSync} = require(`fs`); | ||
| const {createRequire, register} = require(`module`); | ||
| const {resolve} = require(`path`); | ||
| const {pathToFileURL} = require(`url`); | ||
|
|
||
| const relPnpApiPath = "../../../../.pnp.cjs"; | ||
|
|
||
| const absPnpApiPath = resolve(__dirname, relPnpApiPath); | ||
| const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); | ||
| const absRequire = createRequire(absPnpApiPath); | ||
|
|
||
| const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); | ||
| const isPnpLoaderEnabled = existsSync(absPnpLoaderPath); | ||
|
|
||
| if (existsSync(absPnpApiPath)) { | ||
| if (!process.versions.pnp) { | ||
| // Setup the environment to be able to require typescript/bin/tsc | ||
| require(absPnpApiPath).setup(); | ||
| if (isPnpLoaderEnabled && register) { | ||
| register(pathToFileURL(absPnpLoaderPath)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const wrapWithUserWrapper = existsSync(absUserWrapperPath) | ||
| ? exports => absRequire(absUserWrapperPath)(exports) | ||
| : exports => exports; | ||
|
|
||
| // Defer to the real typescript/bin/tsc your application uses | ||
| module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| const {existsSync} = require(`fs`); | ||
| const {createRequire, register} = require(`module`); | ||
| const {resolve} = require(`path`); | ||
| const {pathToFileURL} = require(`url`); | ||
|
|
||
| const relPnpApiPath = "../../../../.pnp.cjs"; | ||
|
|
||
| const absPnpApiPath = resolve(__dirname, relPnpApiPath); | ||
| const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); | ||
| const absRequire = createRequire(absPnpApiPath); | ||
|
|
||
| const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); | ||
| const isPnpLoaderEnabled = existsSync(absPnpLoaderPath); | ||
|
|
||
| if (existsSync(absPnpApiPath)) { | ||
| if (!process.versions.pnp) { | ||
| // Setup the environment to be able to require typescript/bin/tsserver | ||
| require(absPnpApiPath).setup(); | ||
| if (isPnpLoaderEnabled && register) { | ||
| register(pathToFileURL(absPnpLoaderPath)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const wrapWithUserWrapper = existsSync(absUserWrapperPath) | ||
| ? exports => absRequire(absUserWrapperPath)(exports) | ||
| : exports => exports; | ||
|
|
||
| // Defer to the real typescript/bin/tsserver your application uses | ||
| module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "name": "typescript", | ||
| "version": "6.0.3-sdk", | ||
| "main": "./lib/typescript.js", | ||
| "type": "commonjs", | ||
| "bin": { | ||
| "tsc": "./bin/tsc", | ||
| "tsserver": "./bin/tsserver" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| nodeLinker: pnp | ||
| enableGlobalCache: true | ||
|
|
||
| nodeLinker: pnp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| // Minimal ESLint flat config — runs ONLY @tanstack/eslint-plugin-query rules | ||
| // alongside Biome. Biome remains the formatter and primary linter; this file | ||
| // hosts the TanStack-specific rules Biome cannot express | ||
| // (queryKey-aware exhaustive-deps, prefer-query-options, mutation/infinite | ||
| // property order, etc.). | ||
| // | ||
| // Run with: `yarn lint:query` (or via mise: `mise run lint:web:query`). | ||
|
|
||
| import pluginQuery from '@tanstack/eslint-plugin-query' | ||
| import tseslint from 'typescript-eslint' | ||
|
|
||
| const recommended = pluginQuery.configs['flat/recommended'] | ||
| const recommendedRules = {} | ||
| for (const c of Array.isArray(recommended) ? recommended : [recommended]) { | ||
| Object.assign(recommendedRules, c.rules ?? {}) | ||
| } | ||
|
|
||
| export default [ | ||
| { | ||
| ignores: ['src/api-generated/**', 'build/**', 'node_modules/**', '.yarn/**'], | ||
| }, | ||
| { | ||
| files: ['src/**/*.{ts,tsx}'], | ||
| // We only enable the @tanstack/query rules — silence reports about | ||
| // pre-existing `eslint-disable` directives for rules we don't load. | ||
| linterOptions: { | ||
| reportUnusedDisableDirectives: 'off', | ||
| }, | ||
| languageOptions: { | ||
| parser: tseslint.parser, | ||
| parserOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| ecmaFeatures: { jsx: true }, | ||
| }, | ||
| }, | ||
| plugins: { | ||
| '@tanstack/query': pluginQuery, | ||
| }, | ||
| rules: { | ||
| ...recommendedRules, | ||
| // Feature-slice boundary: outside code may only import a feature | ||
| // through its public barrel (`@/features/<name>`), never deep paths | ||
| // like `@/features/<name>/api/...`. Inside-feature code uses | ||
| // relative paths and is exempted by the override below. | ||
| 'no-restricted-imports': [ | ||
| 'error', | ||
| { | ||
| patterns: [ | ||
| { | ||
| group: ['@/features/*/*'], | ||
| message: | ||
| 'Import from the feature barrel (`@/features/<name>`), not its internals. ' + | ||
| 'If you need something not exported, add it to the barrel.', | ||
| }, | ||
| { | ||
| group: ['@/shared/platform/*/*'], | ||
| message: | ||
| 'Import from the platform module barrel (`@/shared/platform/<name>`), not its ' + | ||
| 'internals. If you need something not exported, add it to the barrel.', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| // Inside a feature, deep imports are fine — but prefer relative paths | ||
| // (the rule still nudges that direction by allowing only relatives here). | ||
| files: ['src/features/*/**/*.{ts,tsx}'], | ||
| rules: { | ||
| 'no-restricted-imports': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| // Layering: `shared/` is a downstream layer. It must not depend on | ||
| // `features/` or `app/` — that would create a cycle (features import | ||
| // shared; app composes both). Pure utilities only. | ||
| files: ['src/shared/**/*.{ts,tsx}'], | ||
| rules: { | ||
| 'no-restricted-imports': [ | ||
| 'error', | ||
| { | ||
| patterns: [ | ||
| { | ||
| group: ['@/features/*', '@/features/*/*', '@/app/*', '@/app/*/*'], | ||
| message: | ||
| '`shared/` must not import from `features/` or `app/`. ' + | ||
| 'Move the symbol down to `shared/` or invert the dependency.', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| // Layering: `config/` may import `features/*` *barrels* (e.g. | ||
| // `accessControl.ts` types its `Permissions` map against `Todo` from | ||
| // `@/features/todos`). It must not depend on `app/`. | ||
| files: ['src/config/**/*.{ts,tsx}'], | ||
| rules: { | ||
| 'no-restricted-imports': [ | ||
| 'error', | ||
| { | ||
| patterns: [ | ||
| { | ||
| group: ['@/app/*', '@/app/*/*'], | ||
| message: '`config/` must not import from `app/`.', | ||
| }, | ||
| { | ||
| group: ['@/features/*/*'], | ||
| message: 'Import from the feature barrel (`@/features/<name>`), not its internals.', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understand the use of eslint for the tanstack plugin (we should definitely pay attention to wether Biome adds support for the plugin at some point), but I don't understand adding more rules for eslint to handle. We should decide on biome, eslint or oxlint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I recommend we try out oxlint.
https://charpeni.com/blog/migrating-from-eslint-biome-prettier-to-oxlint-oxfmt
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i am understanding this correctly, biome also supports defining
noRestrictedImportsinbiome.json, so the relvant parts from eslint could be moved there.https://biomejs.dev/linter/rules/no-restricted-imports/