From abbc7c68799524bfc62412764b7af8f0e97e7003 Mon Sep 17 00:00:00 2001 From: Danny Delott Date: Fri, 15 Nov 2024 12:14:20 -0800 Subject: [PATCH 1/5] Add dependency-cruiser, fix depcruise violations --- .../hyperdrive-trading/.dependency-cruiser.js | 366 ++++++++++++++++++ apps/hyperdrive-trading/package.json | 6 +- .../src/base/ExtractMethodParams.ts | 6 - .../hyperdrive-trading/src/base/ReturnType.ts | 5 - .../src/base/assertNever.ts | 33 -- .../src/base/formatTimeDifference.ts | 36 -- .../src/ui/base/formatting/formatAssetId.ts | 3 - ...{CreateWalletFn.ts => CreateWalletFn.d.ts} | 0 yarn.lock | 179 ++++++++- 9 files changed, 546 insertions(+), 88 deletions(-) create mode 100644 apps/hyperdrive-trading/.dependency-cruiser.js delete mode 100644 apps/hyperdrive-trading/src/base/ExtractMethodParams.ts delete mode 100644 apps/hyperdrive-trading/src/base/ReturnType.ts delete mode 100644 apps/hyperdrive-trading/src/base/assertNever.ts delete mode 100644 apps/hyperdrive-trading/src/base/formatTimeDifference.ts delete mode 100644 apps/hyperdrive-trading/src/ui/base/formatting/formatAssetId.ts rename apps/hyperdrive-trading/src/wallets/{CreateWalletFn.ts => CreateWalletFn.d.ts} (100%) diff --git a/apps/hyperdrive-trading/.dependency-cruiser.js b/apps/hyperdrive-trading/.dependency-cruiser.js new file mode 100644 index 000000000..d53a76dd7 --- /dev/null +++ b/apps/hyperdrive-trading/.dependency-cruiser.js @@ -0,0 +1,366 @@ +/** @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"], + }, + }, + + /* 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)$", + }, + }, + { + 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: "^(src)", + pathNot: [ + "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$", + "^src/testing", + ], + }, + 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 exclusively include (array of regular expressions in strings) + dependency-cruiser will skip everything not matching this pattern + */ + // includeOnly : [''], + + /* 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'], + + /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/main/' + to open it on your online repo or `vscode://file/${process.cwd()}/` to + open it in visual studio code), + */ + // prefix: `vscode://file/${process.cwd()}/`, + + /* 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: false, + + /* 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"], + + /* 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: false, + + /* if true leave symlinks untouched, otherwise use the realpath */ + // preserveSymlinks: false, + + /* TypeScript project file ('tsconfig.json') to use for + (1) compilation and + (2) resolution (e.g. with the paths property) + + 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", + }, + + /* Webpack configuration to use to get resolve options from. + + 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'. + + 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: {} + // }, + + /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use + for compilation + */ + // 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. + */ + // 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 + + 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 module resolution, which is the most expensive step. + */ + // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"], + /* What to consider a 'main' field in package.json */ + + // if you migrate to ESM (or are in an ESM environment already) you will want to + // have "module" in the list of mainFields, like so: + // mainFields: ["module", "main", "types", "typings"], + mainFields: ["main", "types", "typings"], + /* + A list of alias fields in package.jsons + See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and + the webpack [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields) + documentation + + Defaults to an empty array (= don't use 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 their innards. + */ + 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 + dependency-cruiser falls back to a built-in one. + */ + // theme: { + // graph: { + // /* splines: "ortho" gives straight lines, but is slow on big graphs + // splines: "true" gives bezier curves (fast, not as nice as ortho) + // */ + // 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. 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.6.0 on 2024-11-15T19:56:05.588Z diff --git a/apps/hyperdrive-trading/package.json b/apps/hyperdrive-trading/package.json index 1d9f7582d..28b09ef63 100644 --- a/apps/hyperdrive-trading/package.json +++ b/apps/hyperdrive-trading/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "bash ./scripts/build-app.sh", "build:dev": "bash ./scripts/build-app.sh development", + "depcruise": "npx depcruise src", "dev": "vite", "format": "prettier --write '**/*.{gql,graphql,js,jsx,ts,tsx,json,md,yaml,yml}'", "format:check": "prettier --check '**/*.{gql,graphql,js,jsx,ts,tsx,json,md}'", @@ -39,13 +40,16 @@ "@rollbar/react": "^0.11.1", "@tanstack/react-query": "^4.29.12", "@tanstack/react-router": "^1.9.0", + "@tanstack/router-devtools": "^1.9.0", "@tanstack/react-table": "^8.10.3", + "@tanstack/query-core": "^4.36.1", "@types/d3-format": "^3.0.4", "@types/lodash.sortby": "^4.7.9", "@uniswap/token-lists": "^1.0.0-beta.34", "@usecapsule/rainbowkit-wallet": "^0.9.4", "@usecapsule/react-sdk": "^3.17.0", "@wagmi/core": "^2.6.9", + "zod": "^3.23.8", "assert-never": "^1.2.1", "buffer": "^6.0.3", "calendar-link": "^2.6.0", @@ -74,7 +78,6 @@ "@hyperdrive/prettier-config": "*", "@hyperdrive/tsconfig": "*", "@tanstack/eslint-plugin-query": "^5.28.11", - "@tanstack/router-devtools": "^1.9.0", "@tanstack/router-vite-plugin": "^1.8.2", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.10", @@ -83,6 +86,7 @@ "@typescript-eslint/parser": "^7.5.0", "@vitejs/plugin-react": "^3.1.0", "autoprefixer": "^10.4.13", + "dependency-cruiser": "^16.6.0", "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.9", diff --git a/apps/hyperdrive-trading/src/base/ExtractMethodParams.ts b/apps/hyperdrive-trading/src/base/ExtractMethodParams.ts deleted file mode 100644 index f3a3f9719..000000000 --- a/apps/hyperdrive-trading/src/base/ExtractMethodParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type ExtractMethodParams< - Interface extends Record, - MethodName extends keyof Interface, -> = Interface[MethodName] extends (...args: any[]) => any - ? Parameters[0] - : never; diff --git a/apps/hyperdrive-trading/src/base/ReturnType.ts b/apps/hyperdrive-trading/src/base/ReturnType.ts deleted file mode 100644 index 935f2cb2f..000000000 --- a/apps/hyperdrive-trading/src/base/ReturnType.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type ReturnType = T[K] extends ( - ...args: any[] -) => infer R - ? R - : any; diff --git a/apps/hyperdrive-trading/src/base/assertNever.ts b/apps/hyperdrive-trading/src/base/assertNever.ts deleted file mode 100644 index 066ab2348..000000000 --- a/apps/hyperdrive-trading/src/base/assertNever.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Helper function for exhaustive checks of discriminated unions. - * https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html - * - * @example - * - * type A = {type: 'a'}; - * type B = {type: 'b'}; - * type Union = A | B; - * - * function doSomething(arg: Union) { - * if (arg.type === 'a') { - * return something; - * } - * - * if (arg.type === 'b') { - * return somethingElse; - * } - * - * // TS will error if there are other types in the union - * // Will throw an Error when called at runtime. - * // Use `assertNever(arg, true)` instead to fail silently. - * return assertNever(arg); - * } - */ export function assertNever(value: never, noThrow?: boolean): never { - if (noThrow) { - return value; - } - - throw new Error( - `Unhandled discriminated union member: ${JSON.stringify(value)}`, - ); -} diff --git a/apps/hyperdrive-trading/src/base/formatTimeDifference.ts b/apps/hyperdrive-trading/src/base/formatTimeDifference.ts deleted file mode 100644 index f72f20551..000000000 --- a/apps/hyperdrive-trading/src/base/formatTimeDifference.ts +++ /dev/null @@ -1,36 +0,0 @@ -const SECONDS_PER_MINUTE = 60; -const SECONDS_PER_HOUR = 3600; -const SECONDS_PER_DAY = 86400; // 24 hours * 3600 seconds per hour - -/** - * Converts seconds to a human-readable string representing the time difference in minutes, hours, or days. - * @param {bigint} currentTimeStamp - * @param {bigint} previousTimeStamp - * @returns {string} A string representing how long ago the event occurred, in minutes, hours, or days. - */ -export function formatTimeDifference({ - currentTimeStamp, - previousTimeStamp, -}: { - currentTimeStamp: bigint; - previousTimeStamp: bigint; -}): string { - const timeDifference = Number(currentTimeStamp - previousTimeStamp); - - if (timeDifference < 2 * SECONDS_PER_MINUTE) { - return "recently"; - } - - if (timeDifference < SECONDS_PER_HOUR) { - const minutes = Math.floor(timeDifference / SECONDS_PER_MINUTE); - return `${minutes} minutes ago`; - } else if (timeDifference < SECONDS_PER_DAY) { - const hours = Math.floor(timeDifference / SECONDS_PER_HOUR); - const hourText = hours === 1 ? "hour" : "hours"; - return `${hours} ${hourText} ago`; - } else { - const days = Math.floor(timeDifference / SECONDS_PER_DAY); - const dayText = days === 1 ? "day" : "days"; - return `${days} ${dayText} ago`; - } -} diff --git a/apps/hyperdrive-trading/src/ui/base/formatting/formatAssetId.ts b/apps/hyperdrive-trading/src/ui/base/formatting/formatAssetId.ts deleted file mode 100644 index 845c7f087..000000000 --- a/apps/hyperdrive-trading/src/ui/base/formatting/formatAssetId.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function formatAssetId(assetId: string): string { - return `${assetId.slice(0, 4)}...${assetId.slice(-4)}`; -} diff --git a/apps/hyperdrive-trading/src/wallets/CreateWalletFn.ts b/apps/hyperdrive-trading/src/wallets/CreateWalletFn.d.ts similarity index 100% rename from apps/hyperdrive-trading/src/wallets/CreateWalletFn.ts rename to apps/hyperdrive-trading/src/wallets/CreateWalletFn.d.ts diff --git a/yarn.lock b/yarn.lock index a1901e46c..4f3259b0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4381,7 +4381,7 @@ resolved "https://registry.yarnpkg.com/@tanstack/history/-/history-1.15.13.tgz#544878665989e6ce07872378961fc6717d342682" integrity sha512-ToaeMtK5S4YaxCywAlYexc7KPFN0esjyTZ4vXzJhXEWAkro9iHgh7m/4ozPJb7oTo65WkHWX0W9GjcZbInSD8w== -"@tanstack/query-core@4.36.1": +"@tanstack/query-core@4.36.1", "@tanstack/query-core@^4.36.1": version "4.36.1" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.36.1.tgz#79f8c1a539d47c83104210be2388813a7af2e524" integrity sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA== @@ -5947,21 +5947,45 @@ acorn-import-assertions@^1.9.0: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== +acorn-jsx-walk@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/acorn-jsx-walk/-/acorn-jsx-walk-2.0.0.tgz#a5ed648264e68282d7c2aead80216bfdf232573a" + integrity sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA== + acorn-jsx@^5.0.0, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== +acorn-loose@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/acorn-loose/-/acorn-loose-8.4.0.tgz#26d3e219756d1e180d006f5bcc8d261a28530f55" + integrity sha512-M0EUka6rb+QC4l9Z3T0nJEzNOO7JcoJlYMrBlyBCiFSXRyxjLKayd4TbQs2FDRWQU1h9FR7QVNHt+PEaoNL5rQ== + dependencies: + acorn "^8.11.0" + acorn-walk@^8.0.0, acorn-walk@^8.1.1: version "8.3.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== +acorn-walk@^8.3.4: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" + acorn@^8.0.0, acorn@^8.0.4, acorn@^8.11.3, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.11.0, acorn@^8.14.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + address@^1.0.1, address@^1.1.2: version "1.2.2" resolved "https://registry.yarnpkg.com/address/-/address-1.2.2.tgz#2b5248dac5485a6390532c6a517fda2e3faac89e" @@ -6014,6 +6038,16 @@ ajv@^8.0.0, ajv@^8.9.0: require-from-string "^2.0.2" uri-js "^4.2.2" +ajv@^8.17.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + alge@0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/alge/-/alge-0.8.1.tgz#f3d8a9ceecaf6d56981ecb2a4804a0e6dd7f4e6b" @@ -7193,6 +7227,11 @@ commander@^10.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== +commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -7961,6 +8000,34 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +dependency-cruiser@^16.6.0: + version "16.6.0" + resolved "https://registry.yarnpkg.com/dependency-cruiser/-/dependency-cruiser-16.6.0.tgz#ff73285621f86b618837fd9fe03bc27ee40f8dc7" + integrity sha512-lIk58+MCU/RksPm9rh5sA3kpWaA2kmsfz8wnrlW5bFeZ5olU+PLH9vVuT2grJdFDDd44JGYfvNRyKkDLqt4uvg== + dependencies: + acorn "^8.14.0" + acorn-jsx "^5.3.2" + acorn-jsx-walk "^2.0.0" + acorn-loose "^8.4.0" + acorn-walk "^8.3.4" + ajv "^8.17.1" + commander "^12.1.0" + enhanced-resolve "^5.17.1" + ignore "^6.0.2" + interpret "^3.1.1" + is-installed-globally "^1.0.0" + json5 "^2.2.3" + memoize "^10.0.0" + picocolors "^1.1.1" + picomatch "^4.0.2" + prompts "^2.4.2" + rechoir "^0.8.0" + safe-regex "^2.1.1" + semver "^7.6.3" + teamcity-service-messages "^0.1.14" + tsconfig-paths-webpack-plugin "^4.1.0" + watskeburt "^4.1.0" + dequal@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" @@ -8341,6 +8408,14 @@ enhanced-resolve@^5.12.0, enhanced-resolve@^5.16.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.17.1, enhanced-resolve@^5.7.0: + version "5.17.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" + integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" @@ -9285,6 +9360,11 @@ fast-shallow-equal@^1.0.0: resolved "https://registry.yarnpkg.com/fast-shallow-equal/-/fast-shallow-equal-1.0.0.tgz#d4dcaf6472440dcefa6f88b98e3251e27f25628b" integrity sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw== +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + fast-url-parser@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" @@ -9741,6 +9821,13 @@ glob@^7.0.0, glob@^7.1.3, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +global-directory@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/global-directory/-/global-directory-4.0.1.tgz#4d7ac7cfd2cb73f304c53b8810891748df5e361e" + integrity sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q== + dependencies: + ini "4.1.1" + global-dirs@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" @@ -10414,6 +10501,11 @@ ignore@^5.1.4, ignore@^5.2.0, ignore@^5.2.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== +ignore@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-6.0.2.tgz#77cccb72a55796af1b6d2f9eb14fa326d24f4283" + integrity sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A== + image-size@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.1.1.tgz#ddd67d4dc340e52ac29ce5f546a09f4e29e840ac" @@ -10482,6 +10574,11 @@ ini@2.0.0: resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== +ini@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" + integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== + ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -10519,6 +10616,11 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== + invariant@2.2.4, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -10735,6 +10837,14 @@ is-installed-globally@^0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" +is-installed-globally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-1.0.0.tgz#08952c43758c33d815692392f7f8437b9e436d5a" + integrity sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ== + dependencies: + global-directory "^4.0.1" + is-path-inside "^4.0.0" + is-map@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" @@ -10790,6 +10900,11 @@ is-path-inside@^3.0.2, is-path-inside@^3.0.3: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-path-inside@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-4.0.0.tgz#805aeb62c47c1b12fc3fd13bfb3ed1e7430071db" + integrity sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA== + is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -11912,6 +12027,13 @@ memfs@^3.1.2, memfs@^3.4.3: dependencies: fs-monkey "^1.0.4" +memoize@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/memoize/-/memoize-10.0.0.tgz#43fa66b2022363c7c50cf5dfab732a808a3d7147" + integrity sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA== + dependencies: + mimic-function "^5.0.0" + meow@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/meow/-/meow-6.1.1.tgz#1ad64c4b76b2a24dfb2f635fddcadf320d251467" @@ -12437,6 +12559,11 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +mimic-function@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mimic-function/-/mimic-function-5.0.1.tgz#acbe2b3349f99b9deaca7fb70e48b83e94e67076" + integrity sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA== + mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -13357,11 +13484,21 @@ picocolors@^1.0.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pidtree@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" @@ -14497,6 +14634,13 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== + dependencies: + resolve "^1.20.0" + recursive-readdir@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.3.tgz#e726f328c0d69153bcabd5c322d3195252379372" @@ -14549,7 +14693,7 @@ regenerator-transform@^0.15.2: dependencies: "@babel/runtime" "^7.8.4" -regexp-tree@^0.1.27: +regexp-tree@^0.1.27, regexp-tree@~0.1.1: version "0.1.27" resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.27.tgz#2198f0ef54518ffa743fe74d983b56ffd631b6cd" integrity sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA== @@ -14775,7 +14919,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.22.2, resolve@^1.22.4: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.2, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -15005,6 +15149,13 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" +safe-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-2.1.1.tgz#f7128f00d056e2fe5c11e81a1324dd974aadced2" + integrity sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A== + dependencies: + regexp-tree "~0.1.1" + safe-stable-stringify@^2.1.0: version "2.4.3" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" @@ -16049,6 +16200,11 @@ tar@^6.1.11: mkdirp "^1.0.3" yallist "^4.0.0" +teamcity-service-messages@^0.1.14: + version "0.1.14" + resolved "https://registry.yarnpkg.com/teamcity-service-messages/-/teamcity-service-messages-0.1.14.tgz#193d420a5e4aef8e5e50b8c39e7865e08fbb5d8a" + integrity sha512-29aQwaHqm8RMX74u2o/h1KbMLP89FjNiMxD9wbF2BbWOnbM+q+d1sCEC+MqCc4QW3NJykn77OMpTFw/xTHIc0w== + term-size@^2.1.0: version "2.2.1" resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" @@ -16273,6 +16429,16 @@ tsconfck@^3.0.3: resolved "https://registry.yarnpkg.com/tsconfck/-/tsconfck-3.0.3.tgz#d9bda0e87d05b1c360e996c9050473c7e6f8084f" integrity sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA== +tsconfig-paths-webpack-plugin@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.2.0.tgz#f7459a8ed1dd4cf66ad787aefc3d37fff3cf07fc" + integrity sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA== + dependencies: + chalk "^4.1.0" + enhanced-resolve "^5.7.0" + tapable "^2.2.1" + tsconfig-paths "^4.1.2" + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -16283,7 +16449,7 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tsconfig-paths@^4.1.0, tsconfig-paths@^4.2.0: +tsconfig-paths@^4.1.0, tsconfig-paths@^4.1.2, tsconfig-paths@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== @@ -17086,6 +17252,11 @@ watchpack@^2.4.1: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" +watskeburt@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/watskeburt/-/watskeburt-4.1.0.tgz#3c0227669be646a97424b631164b1afe3d4d5344" + integrity sha512-KkY5H51ajqy9HYYI+u9SIURcWnqeVVhdH0I+ab6aXPGHfZYxgRCwnR6Lm3+TYB6jJVt5jFqw4GAKmwf1zHmGQw== + wbuf@^1.1.0, wbuf@^1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" From 0d24dd0ad81a26b622f2f50c7840a3917d5654c2 Mon Sep 17 00:00:00 2001 From: Danny Delott Date: Fri, 15 Nov 2024 12:15:31 -0800 Subject: [PATCH 2/5] Add depcruise to github workflow --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6940b3551..a00b69e21 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - task: [format, lint, typecheck, test] + task: [format, lint, typecheck, test, depcruise] steps: - name: Check out code uses: actions/checkout@v4 From 8afbb4dcb02ba488619f7688fceb1806151526e8 Mon Sep 17 00:00:00 2001 From: Danny Delott Date: Fri, 15 Nov 2024 12:25:57 -0800 Subject: [PATCH 3/5] Update gh action to run depcruise on hyperdrive trading only --- .github/workflows/pull-request.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a00b69e21..3da361c2d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -28,4 +28,9 @@ jobs: run: yarn --frozen-lockfile - name: Run ${{ matrix.task }} - run: yarn ${{ matrix.task }} + run: | + if [ "${{ matrix.task }}" = "depcruise" ]; then + yarn workspace hyperdrive-trading ${{ matrix.task }} + else + yarn ${{ matrix.task }} + fi From 7c3c2890271166789eefd9c8bc5ca0eb85503092 Mon Sep 17 00:00:00 2001 From: Danny Delott Date: Fri, 15 Nov 2024 12:37:55 -0800 Subject: [PATCH 4/5] gh action --- apps/hyperdrive-trading/.dependency-cruiser.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/hyperdrive-trading/.dependency-cruiser.js b/apps/hyperdrive-trading/.dependency-cruiser.js index d53a76dd7..7beeb9297 100644 --- a/apps/hyperdrive-trading/.dependency-cruiser.js +++ b/apps/hyperdrive-trading/.dependency-cruiser.js @@ -190,10 +190,15 @@ module.exports = { }, /* Which modules to exclude */ - // exclude : { - // /* path: an array of regular expressions in strings to match against */ - // path: '', - // }, + exclude: { + /* path: an array of regular expressions in strings to match against */ + + path: [ + // Modules that live in the monorepo should not be cruised, since they + // cannot be resolved by dependency-cruiser + "^@delvtech\\/.*", + ], + }, /* Which modules to exclusively include (array of regular expressions in strings) dependency-cruiser will skip everything not matching this pattern @@ -222,7 +227,7 @@ module.exports = { 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: false, + // tsPreCompilationDeps: false, /* 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 From b0fb55b643492ca3a5c15a1e66d45653dcc6a308 Mon Sep 17 00:00:00 2001 From: Danny Delott Date: Fri, 15 Nov 2024 13:16:03 -0800 Subject: [PATCH 5/5] Add hyperdrive-specific dependency cruiser rules --- .../hyperdrive-trading/.dependency-cruiser.js | 52 +++++++++++++++++++ .../longs/CloseLongForm/CloseLongForm.tsx | 2 +- .../longs}/StatusCell.tsx | 0 .../hyperdrive/longs/hooks/useCloseLong.tsx | 2 +- .../ui/hyperdrive/longs/hooks/useOpenLong.tsx | 2 +- .../hyperdrive/lp/hooks/useAddLiquidity.tsx | 2 +- .../lp/hooks/useRemoveLiquidity.tsx | 2 +- .../shorts/CloseShortForm/CloseShortForm.tsx | 2 +- .../hyperdrive/shorts/hooks/useCloseShort.tsx | 2 +- .../hyperdrive/shorts/hooks/useOpenShort.tsx | 2 +- .../OpenLongsTable/OpenLongsTableDesktop.tsx | 2 +- .../OpenShortsTableDesktop.tsx | 2 +- .../src/ui/token/hooks/useApproveToken.tsx | 2 +- .../src/ui/token/hooks/useMintToken.tsx | 2 +- .../TransactionToast.tsx | 0 15 files changed, 64 insertions(+), 12 deletions(-) rename apps/hyperdrive-trading/src/ui/{portfolio/longs/OpenLongsTable => hyperdrive/longs}/StatusCell.tsx (100%) rename apps/hyperdrive-trading/src/ui/{base/components/Toaster => transactions}/TransactionToast.tsx (100%) diff --git a/apps/hyperdrive-trading/.dependency-cruiser.js b/apps/hyperdrive-trading/.dependency-cruiser.js index 7beeb9297..05e01991a 100644 --- a/apps/hyperdrive-trading/.dependency-cruiser.js +++ b/apps/hyperdrive-trading/.dependency-cruiser.js @@ -1,6 +1,58 @@ /** @type {import('dependency-cruiser').IConfiguration} */ module.exports = { forbidden: [ + // Hyperdrive Trading rules + { + name: "hyperdrive-no-deps-from-base", + comment: + "Files in 'src/base' are only allowed to import other files within 'src/base'.", + severity: "error", + from: { + path: "^src/base", + }, + to: { + pathNot: ["^src/base", "node_modules", "fixed-point-wasm"], + }, + }, + { + name: "hyperdrive-no-deps-from-ui-base", + comment: + "Files in 'src/ui/base' are only allowed to import other files within 'src/base' and 'src/ui/base'.", + severity: "error", + from: { + path: "^src/ui/base", + }, + to: { + pathNot: [ + "^src/base", + "^src/ui/base", + "node_modules", + "fixed-point-wasm", + ], + }, + }, + { + name: "hyperdrive-no-react-from-non-ui", + comment: "Only src/ui may import react", + severity: "error", + from: { pathNot: "src/ui" }, + to: { + path: "node_modules/react", + }, + }, + { + name: "hyperdrive-no-portfolio-imports", + comment: + "Files in 'src/ui/hyperdrive' are not allowed to import from 'src/ui/portfolio'.", + severity: "error", + from: { + path: "^src/ui/hyperdrive", + }, + to: { + path: "^src/ui/portfolio", + }, + }, + // Default dependency cruiser rules { name: "no-circular", severity: "warn", diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/CloseLongForm/CloseLongForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/CloseLongForm/CloseLongForm.tsx index e38162714..94e213e2a 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/CloseLongForm/CloseLongForm.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/CloseLongForm/CloseLongForm.tsx @@ -17,8 +17,8 @@ import { useNumericInput } from "src/ui/base/hooks/useNumericInput"; import { ConnectWalletButton } from "src/ui/compliance/ConnectWallet"; import { useCloseLong } from "src/ui/hyperdrive/longs/hooks/useCloseLong"; import { usePreviewCloseLong } from "src/ui/hyperdrive/longs/hooks/usePreviewCloseLong"; +import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell"; import { TransactionView } from "src/ui/hyperdrive/TransactionView"; -import { StatusCell } from "src/ui/portfolio/longs/OpenLongsTable/StatusCell"; import { useTokenBalance } from "src/ui/token/hooks/useTokenBalance"; import { useTokenFiatPrice } from "src/ui/token/hooks/useTokenFiatPrice"; import { TokenInput } from "src/ui/token/TokenInput"; diff --git a/apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/StatusCell.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/StatusCell.tsx similarity index 100% rename from apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/StatusCell.tsx rename to apps/hyperdrive-trading/src/ui/hyperdrive/longs/StatusCell.tsx diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useCloseLong.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useCloseLong.tsx index ea6f491b9..703ece1ef 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useCloseLong.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useCloseLong.tsx @@ -7,11 +7,11 @@ import { } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, Hash } from "viem"; import { usePublicClient } from "wagmi"; diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useOpenLong.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useOpenLong.tsx index cb4062958..25c83daa4 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useOpenLong.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/longs/hooks/useOpenLong.tsx @@ -4,11 +4,11 @@ import { MutationStatus } from "@tanstack/query-core"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address } from "viem"; import { usePublicClient } from "wagmi"; diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useAddLiquidity.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useAddLiquidity.tsx index dbdb45ebd..e52ddbedd 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useAddLiquidity.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useAddLiquidity.tsx @@ -7,11 +7,11 @@ import { } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, Hash } from "viem"; interface UseAddLiquidityOptions { chainId: number; diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useRemoveLiquidity.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useRemoveLiquidity.tsx index da3988da9..d5ce5e0d4 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useRemoveLiquidity.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useRemoveLiquidity.tsx @@ -7,11 +7,11 @@ import { } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, Hash } from "viem"; interface UseRemoveLiquidityOptions { diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/CloseShortForm/CloseShortForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/CloseShortForm/CloseShortForm.tsx index 3bcebfe95..e0fcddac8 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/CloseShortForm/CloseShortForm.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/CloseShortForm/CloseShortForm.tsx @@ -16,10 +16,10 @@ import { useNumericInput } from "src/ui/base/hooks/useNumericInput"; import { SwitchNetworksButton } from "src/ui/chains/SwitchChainButton/SwitchChainButton"; import { ConnectWalletButton } from "src/ui/compliance/ConnectWallet"; import { InvalidTransactionButton } from "src/ui/hyperdrive/InvalidTransactionButton"; +import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell"; import { useCloseShort } from "src/ui/hyperdrive/shorts/hooks/useCloseShort"; import { usePreviewCloseShort } from "src/ui/hyperdrive/shorts/hooks/usePreviewCloseShort"; import { TransactionView } from "src/ui/hyperdrive/TransactionView"; -import { StatusCell } from "src/ui/portfolio/longs/OpenLongsTable/StatusCell"; import { useTokenBalance } from "src/ui/token/hooks/useTokenBalance"; import { useTokenFiatPrice } from "src/ui/token/hooks/useTokenFiatPrice"; import { TokenInput } from "src/ui/token/TokenInput"; diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useCloseShort.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useCloseShort.tsx index 543374fe8..0f782ca74 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useCloseShort.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useCloseShort.tsx @@ -7,11 +7,11 @@ import { } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, Hash } from "viem"; interface UseCloseShortOptions { diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useOpenShort.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useOpenShort.tsx index 513e9d261..0f4b45ebb 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useOpenShort.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/hooks/useOpenShort.tsx @@ -8,11 +8,11 @@ import { } from "@tanstack/react-query"; import toast from "react-hot-toast"; import { parseError } from "src/network/parseError"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; import { prepareSharesIn } from "src/ui/hyperdrive/hooks/usePrepareSharesIn"; import { useReadWriteHyperdrive } from "src/ui/hyperdrive/hooks/useReadWriteHyperdrive"; import { toastWarpcast } from "src/ui/social/WarpcastToast"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, Hash, parseUnits } from "viem"; import { usePublicClient } from "wagmi"; diff --git a/apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/OpenLongsTableDesktop.tsx b/apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/OpenLongsTableDesktop.tsx index 9a3e4204e..0cd1711d2 100644 --- a/apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/OpenLongsTableDesktop.tsx +++ b/apps/hyperdrive-trading/src/ui/portfolio/longs/OpenLongsTable/OpenLongsTableDesktop.tsx @@ -31,8 +31,8 @@ import { formatBalance } from "src/ui/base/formatting/formatBalance"; import { ConnectWalletButton } from "src/ui/compliance/ConnectWallet"; import { MaturesOnCell } from "src/ui/hyperdrive/MaturesOnCell/MaturesOnCell"; import { CloseLongModalButton } from "src/ui/hyperdrive/longs/CloseLongModalButton/CloseLongModalButton"; +import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell"; import { CurrentValueCell } from "src/ui/portfolio/longs/OpenLongsTable/CurrentValueCell"; -import { StatusCell } from "src/ui/portfolio/longs/OpenLongsTable/StatusCell"; import { TotalOpenLongsValue } from "src/ui/portfolio/longs/OpenLongsTable/TotalOpenLongsValue"; import { usePortfolioLongsData } from "src/ui/portfolio/longs/usePortfolioLongsData"; import { useAccount } from "wagmi"; diff --git a/apps/hyperdrive-trading/src/ui/portfolio/shorts/OpenShortsTable/OpenShortsTableDesktop.tsx b/apps/hyperdrive-trading/src/ui/portfolio/shorts/OpenShortsTable/OpenShortsTableDesktop.tsx index ff5bd2e97..f1b42c4fb 100644 --- a/apps/hyperdrive-trading/src/ui/portfolio/shorts/OpenShortsTable/OpenShortsTableDesktop.tsx +++ b/apps/hyperdrive-trading/src/ui/portfolio/shorts/OpenShortsTable/OpenShortsTableDesktop.tsx @@ -23,9 +23,9 @@ import { NonIdealState } from "src/ui/base/components/NonIdealState"; import { Pagination } from "src/ui/base/components/Pagination"; import { formatBalance } from "src/ui/base/formatting/formatBalance"; import { ConnectWalletButton } from "src/ui/compliance/ConnectWallet"; +import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell"; import { MaturesOnCell } from "src/ui/hyperdrive/MaturesOnCell/MaturesOnCell"; import { CloseShortModalButton } from "src/ui/hyperdrive/shorts/CloseShortModalButton/CloseShortModalButton"; -import { StatusCell } from "src/ui/portfolio/longs/OpenLongsTable/StatusCell"; import { CurrentShortsValueCell } from "src/ui/portfolio/shorts/OpenShortsTable/CurrentShortsValueCell"; import { ManageShortButton } from "src/ui/portfolio/shorts/OpenShortsTable/ManageShortButton"; import { ShortRateAndSizeCell } from "src/ui/portfolio/shorts/OpenShortsTable/ShortRateAndSizeCell"; diff --git a/apps/hyperdrive-trading/src/ui/token/hooks/useApproveToken.tsx b/apps/hyperdrive-trading/src/ui/token/hooks/useApproveToken.tsx index 34cc99656..238d6a7de 100644 --- a/apps/hyperdrive-trading/src/ui/token/hooks/useApproveToken.tsx +++ b/apps/hyperdrive-trading/src/ui/token/hooks/useApproveToken.tsx @@ -8,8 +8,8 @@ import { appConfig, getToken } from "@delvtech/hyperdrive-appconfig"; import { useState } from "react"; import { MAX_UINT256 } from "src/base/constants"; import { QueryStatusWithIdle } from "src/base/queryStatus"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, erc20Abi, parseUnits } from "viem"; import { sepolia } from "viem/chains"; interface UseTokenApprovalOptions { diff --git a/apps/hyperdrive-trading/src/ui/token/hooks/useMintToken.tsx b/apps/hyperdrive-trading/src/ui/token/hooks/useMintToken.tsx index d7ec9b205..d38ee628a 100644 --- a/apps/hyperdrive-trading/src/ui/token/hooks/useMintToken.tsx +++ b/apps/hyperdrive-trading/src/ui/token/hooks/useMintToken.tsx @@ -4,8 +4,8 @@ import toast from "react-hot-toast"; import { queryClient } from "src/network/queryClient"; import { waitForTransactionAndInvalidateCache } from "src/network/waitForTransactionAndInvalidateCache"; import { ETH_MAGIC_NUMBER } from "src/token/ETH_MAGIC_NUMBER"; -import TransactionToast from "src/ui/base/components/Toaster/TransactionToast"; import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts"; +import TransactionToast from "src/ui/transactions/TransactionToast"; import { Address, formatUnits, parseAbi } from "viem"; import { sepolia } from "viem/chains"; import { usePublicClient, useReadContract, useWriteContract } from "wagmi"; diff --git a/apps/hyperdrive-trading/src/ui/base/components/Toaster/TransactionToast.tsx b/apps/hyperdrive-trading/src/ui/transactions/TransactionToast.tsx similarity index 100% rename from apps/hyperdrive-trading/src/ui/base/components/Toaster/TransactionToast.tsx rename to apps/hyperdrive-trading/src/ui/transactions/TransactionToast.tsx