From 50846ceaa6696fd5c8420976fa2dab5f5091cbbe Mon Sep 17 00:00:00 2001 From: Nick Kosarev Date: Tue, 11 Jun 2024 14:44:58 +0200 Subject: [PATCH] lint --- .dependency-cruiser.cjs | 708 +++++++++--------- biome.json | 2 +- bun.lockb | Bin 147611 -> 147996 bytes package.json | 14 +- src/app.d.ts | 4 +- src/hooks.server.ts | 30 +- src/lib/components/Footer.svelte | 7 +- src/lib/components/Header.svelte | 6 +- src/lib/components/Profile.svelte | 42 +- src/lib/game/actions/action.ts | 2 +- .../game/actions/donateWoodToVillageAction.ts | 2 +- src/lib/game/actions/plantTreeAction.ts | 2 +- src/lib/game/actions/voteAction.ts | 2 +- src/lib/game/chunks/forest.ts | 4 +- src/lib/game/chunks/gameChunk.ts | 31 +- src/lib/game/chunks/lake.ts | 12 +- src/lib/game/chunks/village.ts | 14 +- src/lib/game/common/event.ts | 22 +- src/lib/game/common/generators/unitTop.ts | 2 +- src/lib/game/common/group.ts | 2 +- src/lib/game/common/inventory.ts | 2 +- src/lib/game/common/poll.ts | 4 +- src/lib/game/common/route.ts | 2 +- src/lib/game/components/buildingInterface.ts | 2 +- src/lib/game/components/dialogueInterface.ts | 2 +- .../game/components/fireParticlesContainer.ts | 2 +- src/lib/game/components/graphicsContainer.ts | 2 +- src/lib/game/components/unitHairContainer.ts | 2 +- src/lib/game/components/unitHeadContainer.ts | 2 +- src/lib/game/components/unitInterface.ts | 2 +- src/lib/game/components/unitTopContainer.ts | 2 +- .../components/wagonEngineCloudsContainer.ts | 4 +- .../game/components/wagonEngineContainer.ts | 2 +- src/lib/game/components/wagonFuelContainer.ts | 2 +- .../game/components/wagonWheelContainer.ts | 2 +- src/lib/game/game.ts | 10 +- src/lib/game/objects/buildings/building.ts | 2 +- src/lib/game/objects/buildings/campfire.ts | 2 +- .../objects/buildings/constructionArea.ts | 5 +- src/lib/game/objects/buildings/store.ts | 2 +- src/lib/game/objects/buildings/wagonStop.ts | 2 +- src/lib/game/objects/buildings/warehouse.ts | 2 +- src/lib/game/objects/flag.ts | 2 +- src/lib/game/objects/gameObject.ts | 5 +- src/lib/game/objects/lake.ts | 6 +- src/lib/game/objects/rabbit.ts | 2 +- src/lib/game/objects/stone.ts | 4 +- src/lib/game/objects/tree.ts | 29 +- src/lib/game/objects/units/player.ts | 4 +- src/lib/game/objects/units/unit.ts | 4 +- src/lib/game/objects/wagon.ts | 6 +- src/lib/game/objects/water.ts | 2 +- src/lib/game/objects/wolf.ts | 2 +- src/lib/game/quests/noTradingPostQuest.ts | 24 +- src/lib/game/quests/quest.ts | 2 +- .../game/quests/treesAreRunningOutQuest.ts | 16 +- src/lib/game/scenes/gameScene.ts | 20 +- src/lib/game/scripts/buildScript.ts | 2 +- src/lib/game/scripts/chopTreeScript.ts | 2 +- src/lib/game/scripts/mineStoneScript.ts | 2 +- .../moveOffScreenAndSelfDestroyScript.ts | 10 +- .../scripts/moveToTradePostAndTradeScript.ts | 10 +- .../scripts/placeItemInWarehouseScript.ts | 10 +- src/lib/game/scripts/plantNewTreeScript.ts | 10 +- src/lib/game/scripts/script.ts | 2 +- src/lib/game/services/actionService.ts | 12 +- src/lib/game/services/eventService.ts | 26 +- src/lib/game/services/pollService.ts | 2 +- src/lib/game/services/questService.ts | 28 +- src/lib/game/services/routeService.ts | 40 +- src/lib/game/services/tradeService.ts | 12 +- src/lib/game/services/wagonService.ts | 2 +- src/lib/game/utils/assetsManager.ts | 109 ++- src/lib/game/utils/audioManager.ts | 5 +- src/lib/game/utils/generators/background.ts | 12 +- src/lib/game/utils/messageController.ts | 2 +- src/lib/game/utils/webSocketManager.ts | 2 +- src/lib/locale.ts | 13 +- src/lib/server/db/db.repository.ts | 10 +- src/lib/types.ts | 2 +- src/routes/+error.svelte | 2 +- src/routes/+layout.server.ts | 4 +- src/routes/+layout.svelte | 6 +- src/routes/+page.server.ts | 4 +- src/routes/+page.svelte | 76 +- src/routes/about/+page.svelte | 2 +- src/routes/auth/profile/+server.ts | 12 +- src/routes/auth/sign-in/+page.svelte | 22 +- src/routes/auth/sign-in/+server.ts | 47 +- src/routes/character/+page.server.ts | 14 +- src/routes/character/+page.svelte | 4 +- src/routes/character/[slug]/+page.server.ts | 16 +- src/routes/character/[slug]/+page.svelte | 6 +- src/routes/p/+page.server.ts | 6 +- src/routes/p/[slug]/+page.server.ts | 16 +- src/routes/p/[slug]/+page.svelte | 4 +- 96 files changed, 814 insertions(+), 847 deletions(-) diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjs index 0cc7caf8..5fa3e1cd 100644 --- a/.dependency-cruiser.cjs +++ b/.dependency-cruiser.cjs @@ -1,389 +1,373 @@ /** @type {import('dependency-cruiser').IConfiguration} */ module.exports = { - forbidden: [ - { - name: 'no-circular', - severity: 'warn', - comment: - 'This dependency is part of a circular relationship. You might want to revise ' + - 'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ', - from: {}, - to: { - circular: true - } - }, - { - name: 'no-orphans', - comment: - "This is an orphan module - it's likely not used (anymore?). Either use it or " + - "remove it. If it's logical this module is an orphan (i.e. it's a config file), " + - "add an exception for it in your dependency-cruiser configuration. By default " + - "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " + - "files (.d.ts), tsconfig.json and some of the babel and webpack configs.", - severity: 'warn', - from: { - orphan: true, - pathNot: [ - '(^|/)[.][^/]+[.](?:js|cjs|mjs|ts|cts|mts|json)$', // dot files - '[.]d[.]ts$', // TypeScript declaration files - '(^|/)tsconfig[.]json$', // TypeScript config - '(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$' // other configs - ] - }, - to: {}, - }, - { - name: 'no-deprecated-core', - comment: - 'A module depends on a node core module that has been deprecated. Find an alternative - these are ' + - "bound to exist - node doesn't deprecate lightly.", - severity: 'warn', - from: {}, - to: { - dependencyTypes: [ - 'core' - ], - path: [ - '^v8/tools/codemap$', - '^v8/tools/consarray$', - '^v8/tools/csvparser$', - '^v8/tools/logreader$', - '^v8/tools/profile_view$', - '^v8/tools/profile$', - '^v8/tools/SourceMap$', - '^v8/tools/splaytree$', - '^v8/tools/tickprocessor-driver$', - '^v8/tools/tickprocessor$', - '^node-inspect/lib/_inspect$', - '^node-inspect/lib/internal/inspect_client$', - '^node-inspect/lib/internal/inspect_repl$', - '^async_hooks$', - '^punycode$', - '^domain$', - '^constants$', - '^sys$', - '^_linklist$', - '^_stream_wrap$' - ], - } - }, - { - name: 'not-to-deprecated', - comment: - 'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' + - 'version of that module, or find an alternative. Deprecated modules are a security risk.', - severity: 'warn', - from: {}, - to: { - dependencyTypes: [ - 'deprecated' - ] - } - }, - { - name: 'no-non-package-json', - severity: 'error', - comment: - "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " + - "That's problematic as the package either (1) won't be available on live (2 - worse) will be " + - "available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " + - "in your package.json.", - from: {}, - to: { - dependencyTypes: [ - 'npm-no-pkg', - 'npm-unknown' - ] - } - }, - { - name: 'not-to-unresolvable', - comment: - "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " + - 'module: add it to your package.json. In all other cases you likely already know what to do.', - severity: 'error', - from: {}, - to: { - couldNotResolve: true - } - }, - { - name: 'no-duplicate-dep-types', - comment: - "Likely this module depends on an external ('npm') package that occurs more than once " + - "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " + - "maintenance problems later on.", - severity: 'warn', - from: {}, - to: { - moreThanOneDependencyType: true, - // as it's pretty common to have a type import be a type only import - // _and_ (e.g.) a devDependency - don't consider type-only dependency - // types for this rule - dependencyTypesNot: ["type-only"] - } - }, + forbidden: [ + { + name: "no-circular", + severity: "warn", + comment: + "This dependency is part of a circular relationship. You might want to revise " + + "your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ", + from: {}, + to: { + circular: true, + }, + }, + { + name: "no-orphans", + comment: + "This is an orphan module - it's likely not used (anymore?). Either use it or " + + "remove it. If it's logical this module is an orphan (i.e. it's a config file), " + + "add an exception for it in your dependency-cruiser configuration. By default " + + "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " + + "files (.d.ts), tsconfig.json and some of the babel and webpack configs.", + severity: "warn", + from: { + orphan: true, + pathNot: [ + "(^|/)[.][^/]+[.](?:js|cjs|mjs|ts|cts|mts|json)$", // dot files + "[.]d[.]ts$", // TypeScript declaration files + "(^|/)tsconfig[.]json$", // TypeScript config + "(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs + ], + }, + to: {}, + }, + { + name: "no-deprecated-core", + comment: + "A module depends on a node core module that has been deprecated. Find an alternative - these are " + + "bound to exist - node doesn't deprecate lightly.", + severity: "warn", + from: {}, + to: { + dependencyTypes: ["core"], + path: [ + "^v8/tools/codemap$", + "^v8/tools/consarray$", + "^v8/tools/csvparser$", + "^v8/tools/logreader$", + "^v8/tools/profile_view$", + "^v8/tools/profile$", + "^v8/tools/SourceMap$", + "^v8/tools/splaytree$", + "^v8/tools/tickprocessor-driver$", + "^v8/tools/tickprocessor$", + "^node-inspect/lib/_inspect$", + "^node-inspect/lib/internal/inspect_client$", + "^node-inspect/lib/internal/inspect_repl$", + "^async_hooks$", + "^punycode$", + "^domain$", + "^constants$", + "^sys$", + "^_linklist$", + "^_stream_wrap$", + ], + }, + }, + { + name: "not-to-deprecated", + comment: + "This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later " + + "version of that module, or find an alternative. Deprecated modules are a security risk.", + severity: "warn", + from: {}, + to: { + dependencyTypes: ["deprecated"], + }, + }, + { + name: "no-non-package-json", + severity: "error", + comment: + "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " + + "That's problematic as the package either (1) won't be available on live (2 - worse) will be " + + "available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " + + "in your package.json.", + from: {}, + to: { + dependencyTypes: ["npm-no-pkg", "npm-unknown"], + }, + }, + { + name: "not-to-unresolvable", + comment: + "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " + + "module: add it to your package.json. In all other cases you likely already know what to do.", + severity: "error", + from: {}, + to: { + couldNotResolve: true, + }, + }, + { + name: "no-duplicate-dep-types", + comment: + "Likely this module depends on an external ('npm') package that occurs more than once " + + "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " + + "maintenance problems later on.", + severity: "warn", + from: {}, + to: { + moreThanOneDependencyType: true, + // as it's pretty common to have a type import be a type only import + // _and_ (e.g.) a devDependency - don't consider type-only dependency + // types for this rule + dependencyTypesNot: ["type-only"], + }, + }, - /* rules you might want to tweak for your specific situation: */ - - { - name: 'not-to-spec', - comment: - 'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' + - "If there's something in a spec that's of use to other modules, it doesn't have that single " + - 'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.', - severity: 'error', - from: {}, - to: { - path: '[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx|ls|coffee|litcoffee|coffee[.]md)$' - } - }, - { - name: 'not-to-dev-dep', - severity: 'error', - comment: - "This module depends on an npm package from the 'devDependencies' section of your " + - 'package.json. It looks like something that ships to production, though. To prevent problems ' + - "with npm packages that aren't there on production declare it (only!) in the 'dependencies'" + - 'section of your package.json. If this module is development only - add it to the ' + - 'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration', - from: { - path: '^(packages)', - pathNot: '[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx|ls|coffee|litcoffee|coffee[.]md)$' - }, - to: { - dependencyTypes: [ - 'npm-dev', - ], - // type only dependencies are not a problem as they don't end up in the - // production code or are ignored by the runtime. - dependencyTypesNot: [ - 'type-only' - ], - pathNot: [ - 'node_modules/@types/' - ] - } - }, - { - name: 'optional-deps-used', - severity: 'info', - comment: - "This module depends on an npm package that is declared as an optional dependency " + - "in your package.json. As this makes sense in limited situations only, it's flagged here. " + - "If you're using an optional dependency here by design - add an exception to your" + - "dependency-cruiser configuration.", - from: {}, - to: { - dependencyTypes: [ - 'npm-optional' - ] - } - }, - { - name: 'peer-deps-used', - comment: - "This module depends on an npm package that is declared as a peer dependency " + - "in your package.json. This makes sense if your package is e.g. a plugin, but in " + - "other cases - maybe not so much. If the use of a peer dependency is intentional " + - "add an exception to your dependency-cruiser configuration.", - severity: 'warn', - from: {}, - to: { - dependencyTypes: [ - 'npm-peer' - ] - } - } - ], - options: { + /* rules you might want to tweak for your specific situation: */ - /* Which modules not to follow further when encountered */ - doNotFollow: { - /* path: an array of regular expressions in strings to match against */ - path: ['node_modules'] - }, + { + name: "not-to-spec", + comment: + "This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. " + + "If there's something in a spec that's of use to other modules, it doesn't have that single " + + "responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.", + severity: "error", + from: {}, + to: { + path: "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx|ls|coffee|litcoffee|coffee[.]md)$", + }, + }, + { + name: "not-to-dev-dep", + severity: "error", + comment: + "This module depends on an npm package from the 'devDependencies' section of your " + + "package.json. It looks like something that ships to production, though. To prevent problems " + + "with npm packages that aren't there on production declare it (only!) in the 'dependencies'" + + "section of your package.json. If this module is development only - add it to the " + + "from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration", + from: { + path: "^(packages)", + pathNot: + "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx|ls|coffee|litcoffee|coffee[.]md)$", + }, + to: { + dependencyTypes: ["npm-dev"], + // type only dependencies are not a problem as they don't end up in the + // production code or are ignored by the runtime. + dependencyTypesNot: ["type-only"], + pathNot: ["node_modules/@types/"], + }, + }, + { + name: "optional-deps-used", + severity: "info", + comment: + "This module depends on an npm package that is declared as an optional dependency " + + "in your package.json. As this makes sense in limited situations only, it's flagged here. " + + "If you're using an optional dependency here by design - add an exception to your" + + "dependency-cruiser configuration.", + from: {}, + to: { + dependencyTypes: ["npm-optional"], + }, + }, + { + name: "peer-deps-used", + comment: + "This module depends on an npm package that is declared as a peer dependency " + + "in your package.json. This makes sense if your package is e.g. a plugin, but in " + + "other cases - maybe not so much. If the use of a peer dependency is intentional " + + "add an exception to your dependency-cruiser configuration.", + severity: "warn", + from: {}, + to: { + dependencyTypes: ["npm-peer"], + }, + }, + ], + options: { + /* Which modules not to follow further when encountered */ + doNotFollow: { + /* path: an array of regular expressions in strings to match against */ + path: ["node_modules"], + }, - /* Which modules to exclude */ - // exclude : { - // /* path: an array of regular expressions in strings to match against */ - // path: '', - // }, + /* Which modules to exclude */ + // exclude : { + // /* path: an array of regular expressions in strings to match against */ + // path: '', + // }, - /* Which modules to exclusively include (array of regular expressions in strings) - dependency-cruiser will skip everything not matching this pattern - */ - // includeOnly : [''], + /* Which modules to exclusively include (array of regular expressions in strings) + dependency-cruiser will skip everything not matching this pattern + */ + // includeOnly : [''], - /* dependency-cruiser will include modules matching against the focus - regular expression in its output, as well as their direct neighbours - (dependencies and dependents) - */ - // focus : '', + /* dependency-cruiser will include modules matching against the focus + regular expression in its output, as well as their direct neighbours + (dependencies and dependents) + */ + // focus : '', - /* List of module systems to cruise. - When left out dependency-cruiser will fall back to the list of _all_ - module systems it knows of. It's the default because it's the safe option - It might come at a performance penalty, though. - moduleSystems: ['amd', 'cjs', 'es6', 'tsd'] - - As in practice only commonjs ('cjs') and ecmascript modules ('es6') - are widely used, you can limit the moduleSystems to those. - */ - - // moduleSystems: ['cjs', 'es6'], + /* List of module systems to cruise. + When left out dependency-cruiser will fall back to the list of _all_ + module systems it knows of. It's the default because it's the safe option + It might come at a performance penalty, though. + moduleSystems: ['amd', 'cjs', 'es6', 'tsd'] - /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/' - to open it on your online repo or `vscode://file/${process.cwd()}/` to - open it in visual studio code), - */ - // prefix: `vscode://file/${process.cwd()}/`, + As in practice only commonjs ('cjs') and ecmascript modules ('es6') + are widely used, you can limit the moduleSystems to those. + */ - /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation - true: also detect dependencies that only exist before typescript-to-javascript compilation - "specify": for each dependency identify whether it only exists before compilation or also after - */ - tsPreCompilationDeps: true, - - /* list of extensions to scan that aren't javascript or compile-to-javascript. - Empty by default. Only put extensions in here that you want to take into - account that are _not_ parsable. - */ - // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"], + // moduleSystems: ['cjs', 'es6'], - /* if true combines the package.jsons found from the module up to the base - folder the cruise is initiated from. Useful for how (some) mono-repos - manage dependencies & dependency definitions. - */ - combinedDependencies: true, + /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/' + to open it on your online repo or `vscode://file/${process.cwd()}/` to + open it in visual studio code), + */ + // prefix: `vscode://file/${process.cwd()}/`, - /* if true leave symlinks untouched, otherwise use the realpath */ - // preserveSymlinks: false, + /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation + true: also detect dependencies that only exist before typescript-to-javascript compilation + "specify": for each dependency identify whether it only exists before compilation or also after + */ + tsPreCompilationDeps: true, - /* TypeScript project file ('tsconfig.json') to use for - (1) compilation and - (2) resolution (e.g. with the paths property) + /* list of extensions to scan that aren't javascript or compile-to-javascript. + Empty by default. Only put extensions in here that you want to take into + account that are _not_ parsable. + */ + // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"], - The (optional) fileName attribute specifies which file to take (relative to - dependency-cruiser's current working directory). When not provided - defaults to './tsconfig.json'. - */ - tsConfig: { - fileName: 'tsconfig.base.json' - }, + /* if true combines the package.jsons found from the module up to the base + folder the cruise is initiated from. Useful for how (some) mono-repos + manage dependencies & dependency definitions. + */ + combinedDependencies: true, - /* Webpack configuration to use to get resolve options from. + /* if true leave symlinks untouched, otherwise use the realpath */ + // preserveSymlinks: false, - The (optional) fileName attribute specifies which file to take (relative - to dependency-cruiser's current working directory. When not provided defaults - to './webpack.conf.js'. + /* TypeScript project file ('tsconfig.json') to use for + (1) compilation and + (2) resolution (e.g. with the paths property) - The (optional) `env` and `arguments` attributes contain the parameters to be passed if - your webpack config is a function and takes them (see webpack documentation - for details) - */ - // webpackConfig: { - // fileName: 'webpack.config.js', - // env: {}, - // arguments: {} - // }, + The (optional) fileName attribute specifies which file to take (relative to + dependency-cruiser's current working directory). When not provided + defaults to './tsconfig.json'. + */ + tsConfig: { + fileName: "tsconfig.json", + }, - /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use - for compilation (and whatever other naughty things babel plugins do to - source code). - */ - // babelConfig: { - // fileName: '.babelrc', - // }, + /* Webpack configuration to use to get resolve options from. - /* List of strings you have in use in addition to cjs/ es6 requires - & imports to declare module dependencies. Use this e.g. if you've - re-declared require, use a require-wrapper or use window.require as - a hack. - */ - // exoticRequireStrings: [], - - /* options to pass on to enhanced-resolve, the package dependency-cruiser - uses to resolve module references to disk. The values below should be - suitable for most situations + The (optional) fileName attribute specifies which file to take (relative + to dependency-cruiser's current working directory. When not provided defaults + to './webpack.conf.js'. - If you use webpack: you can also set these in webpack.conf.js. The set - there will override the ones specified here. - */ - enhancedResolveOptions: { - /* What to consider as an 'exports' field in package.jsons */ - exportsFields: ["exports"], - /* List of conditions to check for in the exports field. - Only works when the 'exportsFields' array is non-empty. - */ - conditionNames: ["import", "require", "node", "default", "types"], - /* - The extensions, by default are the same as the ones dependency-cruiser - can access (run `npx depcruise --info` to see which ones that are in - _your_ environment. If that list is larger than you need you can pass - the extensions you actually use (e.g. [".js", ".jsx"]). This can speed - up the most expensive step in dependency cruising (module resolution) - quite a bit. - */ - // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"], - /* What to consider a 'main' field in package.json */ - mainFields: ["module", "main", "types", "typings"], - /* - A list of alias fields in package.jsons - See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and - the [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields) - documentation in the webpack docs. - - Defaults to an empty array (don't use any alias fields). - */ - // aliasFields: ["browser"], - }, - reporterOptions: { - dot: { - /* pattern of modules that can be consolidated in the detailed - graphical dependency graph. The default pattern in this configuration - collapses everything in node_modules to one folder deep so you see - the external modules, but not the innards your app depends upon. + The (optional) `env` and `arguments` attributes contain the parameters to be passed if + your webpack config is a function and takes them (see webpack documentation + for details) */ - collapsePattern: 'node_modules/(?:@[^/]+/[^/]+|[^/]+)', + // webpackConfig: { + // fileName: 'webpack.config.js', + // env: {}, + // arguments: {} + // }, - /* Options to tweak the appearance of your graph.See - https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions - for details and some examples. If you don't specify a theme - don't worry - dependency-cruiser will fall back to the default one. - */ - // theme: { - // graph: { - // /* splines: "ortho" will give you straight lines at the expense of - // being slow to render on big graphs - // splines: "true" will give you bezier curves which are faster - // but might not look as nice - // */ - // splines: "true" - // }, - // } - }, - archi: { - /* pattern of modules that can be consolidated in the high level - graphical dependency graph. If you use the high level graphical - dependency graph reporter (`archi`) you probably want to tweak - this collapsePattern to your situation. + /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use + for compilation (and whatever other naughty things babel plugins do to + source code). + */ + // babelConfig: { + // fileName: '.babelrc', + // }, + + /* List of strings you have in use in addition to cjs/ es6 requires + & imports to declare module dependencies. Use this e.g. if you've + re-declared require, use a require-wrapper or use window.require as + a hack. */ - collapsePattern: '^(?:packages|src|lib(s?)|app(s?)|bin|test(s?)|spec(s?))/[^/]+|node_modules/(?:@[^/]+/[^/]+|[^/]+)', + // exoticRequireStrings: [], + + /* options to pass on to enhanced-resolve, the package dependency-cruiser + uses to resolve module references to disk. The values below should be + suitable for most situations - /* Options to tweak the appearance of your graph.See - https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions - for details and some examples. If you don't specify a theme - for 'archi' dependency-cruiser will use the one specified in the - dot section above and otherwise use the default one. + If you use webpack: you can also set these in webpack.conf.js. The set + there will override the ones specified here. */ - // theme: { - // }, - }, - "text": { - "highlightFocused": true - }, - } - } + enhancedResolveOptions: { + /* What to consider as an 'exports' field in package.jsons */ + exportsFields: ["exports"], + /* List of conditions to check for in the exports field. + Only works when the 'exportsFields' array is non-empty. + */ + conditionNames: ["import", "require", "node", "default", "types"], + /* + The extensions, by default are the same as the ones dependency-cruiser + can access (run `npx depcruise --info` to see which ones that are in + _your_ environment. If that list is larger than you need you can pass + the extensions you actually use (e.g. [".js", ".jsx"]). This can speed + up the most expensive step in dependency cruising (module resolution) + quite a bit. + */ + // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"], + /* What to consider a 'main' field in package.json */ + mainFields: ["module", "main", "types", "typings"], + /* + A list of alias fields in package.jsons + See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and + the [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields) + documentation in the webpack docs. + + Defaults to an empty array (don't use any alias fields). + */ + // aliasFields: ["browser"], + }, + reporterOptions: { + dot: { + /* pattern of modules that can be consolidated in the detailed + graphical dependency graph. The default pattern in this configuration + collapses everything in node_modules to one folder deep so you see + the external modules, but not the innards your app depends upon. + */ + collapsePattern: "node_modules/(?:@[^/]+/[^/]+|[^/]+)", + + /* Options to tweak the appearance of your graph.See + https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions + for details and some examples. If you don't specify a theme + don't worry - dependency-cruiser will fall back to the default one. + */ + // theme: { + // graph: { + // /* splines: "ortho" will give you straight lines at the expense of + // being slow to render on big graphs + // splines: "true" will give you bezier curves which are faster + // but might not look as nice + // */ + // splines: "true" + // }, + // } + }, + archi: { + /* pattern of modules that can be consolidated in the high level + graphical dependency graph. If you use the high level graphical + dependency graph reporter (`archi`) you probably want to tweak + this collapsePattern to your situation. + */ + collapsePattern: + "^(?:packages|src|lib(s?)|app(s?)|bin|test(s?)|spec(s?))/[^/]+|node_modules/(?:@[^/]+/[^/]+|[^/]+)", + + /* Options to tweak the appearance of your graph.See + https://github.com/sverweij/dependency-cruiser/blob/main/doc/options-reference.md#reporteroptions + for details and some examples. If you don't specify a theme + for 'archi' dependency-cruiser will use the one specified in the + dot section above and otherwise use the default one. + */ + // theme: { + // }, + }, + text: { + highlightFocused: true, + }, + }, + }, }; // generated: dependency-cruiser@16.3.1 on 2024-04-16T10:36:05.632Z diff --git a/biome.json b/biome.json index feb188d8..109ea45b 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", + "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json", "organizeImports": { "enabled": true }, diff --git a/bun.lockb b/bun.lockb index 090cc14e30eb3df57d00004a51066c6c11ce0955..b130ac7aff30e866ec902e4234019c077a6f4cff 100644 GIT binary patch delta 8590 zcmeHMXH*o+w(e?XgaJpQFd#_~FoEPjiHZ^iP*8BhNE$MtL{Sh_@S?|rtrm)?=+Pr) zMF9~Ma|Tf{9@K-PqGCo#>f1HU9PljPTKBE@)_Q+#ulf4h`>X2RRn=8J)l~(HIGeLM zYs`iOSoYHkp04)M-Q|$dYWWpv>49$3Ucb691?#MpRnIj#zG5^@ks~cns7LotK0MEZ z!`7TgQA$h|XPC;=Ac|6@s4O>NHDG=a)4?&zObw+dF1R9K6<|RaMX3W@OIQb31AIqF z9}HY6q9`q34e*VD*TW5!fR_RH1rAM2OiG(0qSPZON*VkV(8+D1fXRJk0m}nVjie|J zMP+8i!PN>NjE4krfez#(1=$i!QTo6czypD&OL!!(A^6(BI>28bKPkvvTTpbhje`x(_2rr!Yc+UE4*Etj-Cl0D$ve(eUQcwF zW#0FnqO^Yd4vpYSnPr1nQA+Ndj(H_^8c*aH9^bsgLtjsWW2;wRV4FYKY7=A5Tg%}@Z7+YVU%6@oGS1f zz=N0*_?&j|oWx!oMB#@})L8In@pTKp8wDO)oU;}@5Aayx`>lh~;R+tbC>!zVyP?eT zNGCcdjJXooW~Q9h6+%P8yf>CP}l5aq-cz++8dt~=PX?|?O#;kr1m!YOJtkvN;c z8Ut6TFr?Ohf=BMF!sHo3U0|Hqf+sFLJtKmVk8$E`2hklw4&$f8=QM*ysszR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-gP3mM|ol<0>MV3%<37p_qavTpWMSjQy&n`tzfl`(tW8_vp ze<^A}$fMq~3{A7+xC>k;Tv?0s@Sy|9%*+KOWfTMR1@?-}7YAR&cof*t$W!3zC2*~O za{xsn=p+uwjqD@~7 zr!@SML|3HCjGV5F{r1qtLwz+A2{ot8A>4#=?#;fE(ljhOiugu~6kK{{%d@fvx37Jv zfwgOqA%4?{%uN+pGqcL@X{puhY#P~1M+^4XOe{Er__Tf&4m*U3>C$Z6dkDG7IT8|T zIPzx{Nn20F8-7Of%{^eK6j`*6*!u(euh%|7qd0ltolk6c|1i@tFJ_n=~JY= z`bt8lV@ntd6Gd)Nktpk{aSi7kMeg*6d|Z1JMIsg4c@zzYzl}ak$jVTW8C4|Q^ie## z!Z*f}ZD;`c9`9&IQSz$vqe5(O3}w)rg?QmHRE$*d=VLHod3eroWTmG_4$iMUme{Y^ zax;xa;C;uDZ&nlhU>ZOt?`<{kJoavsbfS5aUZxa@zsp{A!A%!lCy^;2D^a8dwL9@T z3(>{uz7j?9@W|e<08_E|*1i%m9DM=}@F9T}8OH#pU255_<}dmxDRPpBHl*`MtjRvn zSCWCZ!sS}z@=M2Mo5H0N`1lDFyi@HYLh95>nNuYY>;8iBk!OABFKCK7^1wQmk!`)f zB@}20PVr0BJQy|(z9C)C!yVSN5ngOf55#9pXe}(XpGPS9T(aR|KLp9;JoX|4Bv90b?`D5+8w*zKvuZTg&zLJGQ|QH zh@>ds<3v~5RY{86XdZTUqwSS^tKDelFH#r3aig7Na<41xuT=1pyCM`67~%2mw5_c4 znK!+w{-h5*n}b~H{Y11W!dF_LWtIW7F1{mzdt?J><1ao#{4jtv{33O+b0GA9;tEY% o5J+1q$$27L9bXKDuIa0y8w7*UC!<6(gR_I^0Wb{3LG-5o0mc@D#{d8T diff --git a/package.json b/package.json index 613ee4c4..da5061b0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig tsconfig.json --watch", - "lint": "npx @biomejs/biome check --apply ./src", + "lint": "npx @biomejs/biome check --write ./src", "lint:deps": "npx depcruise apps" }, "type": "module", @@ -38,7 +38,7 @@ "@twurple/auth": "7.1.0", "@twurple/easy-bot": "7.1.0", "@twurple/pubsub": "7.1.0", - "hono": "4.4.4", + "hono": "4.4.5", "howler": "2.2.4", "jsonwebtoken": "9.0.2", "pixi.js": "8.1.6", @@ -46,22 +46,22 @@ "react-dom": "18.3.1" }, "devDependencies": { - "@biomejs/biome": "1.8.0", + "@biomejs/biome": "1.8.1", "@sveltejs/kit": "2.5.10", "@sveltejs/vite-plugin-svelte": "3.1.1", - "@tailwindcss/vite": "4.0.0-alpha.15", + "@tailwindcss/vite": "4.0.0-alpha.16", "@types/bun": "1.1.3", "@types/howler": "2.2.11", "@types/jsonwebtoken": "9.0.6", "@types/react": "18.3.3", "@types/react-dom": "18.3.0", - "@vitejs/plugin-react": "4.3.0", - "dependency-cruiser": "16.3.2", + "@vitejs/plugin-react": "4.3.1", + "dependency-cruiser": "16.3.3", "prisma": "5.15.0", "svelte": "4.2.18", "svelte-adapter-bun": "0.5.2", "svelte-check": "3.8.0", - "tailwindcss": "4.0.0-alpha.15", + "tailwindcss": "4.0.0-alpha.16", "tslib": "2.6.3", "typescript": "5.4.5", "vite": "5.2.13" diff --git a/src/app.d.ts b/src/app.d.ts index 0c354550..7149e89e 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,6 +1,6 @@ // See https://kit.svelte.dev/docs/types#app // for information about these interfaces -import type { IProfile } from "$lib/types"; +import type { IProfile } from "$lib/types" declare global { namespace App { @@ -14,5 +14,3 @@ declare global { // interface Platform {} } } - -export type {} diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 540f2665..ffd80996 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,34 +1,34 @@ -import { env as privateEnv } from "$env/dynamic/private"; -import { env as publicEnv } from "$env/dynamic/public"; -import { type Handle, error } from "@sveltejs/kit"; -import jwt from "jsonwebtoken"; -import type { IProfile } from "$lib/types"; +import { env as privateEnv } from "$env/dynamic/private" +import { env as publicEnv } from "$env/dynamic/public" +import type { IProfile } from "$lib/types" +import { type Handle, error } from "@sveltejs/kit" +import jwt from "jsonwebtoken" export const handle: Handle = async ({ event, resolve }) => { const cookieKey = publicEnv.PUBLIC_COOKIE_KEY const jwtSecret = privateEnv.PRIVATE_JWT_SECRET_KEY if (jwtSecret && cookieKey && event.cookies.get(cookieKey)) { - const token = event.cookies.get(cookieKey); + const token = event.cookies.get(cookieKey) if (!token) { - event.locals.profile = null; - return resolve(event); + event.locals.profile = null + return resolve(event) } try { - const payload = jwt.verify(token, jwtSecret); + const payload = jwt.verify(token, jwtSecret) if (typeof payload === "string") { - error(400, "Something went wrong"); + error(400, "Something went wrong") } if (!payload.profile) { - error(400, "Token is not valid"); + error(400, "Token is not valid") } const profile = payload.profile as IProfile event.locals.profile = { - ...profile - }; + ...profile, + } } catch (error) { if (error instanceof jwt.TokenExpiredError) { event.cookies.delete(cookieKey, { path: "/" }) @@ -36,5 +36,5 @@ export const handle: Handle = async ({ event, resolve }) => { } } - return resolve(event); -}; \ No newline at end of file + return resolve(event) +} diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index 4ef2a308..e9362af4 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -1,5 +1,10 @@