From 1a252183cf768225d85e55cc9172dded59c4d73e Mon Sep 17 00:00:00 2001 From: "quisi.do" Date: Sat, 25 May 2024 19:19:55 -0700 Subject: [PATCH] add `cloudflare-utils` and `vitest-config` (#221) --- package.json | 2 +- packages/authn-shared/package.json | 2 + packages/authn-shared/vitest.config.ts | 26 +- packages/authn/package.json | 5 +- packages/authn/src/constants/metric-name.ts | 2 - packages/authn/src/features/get-console.ts | 29 --- .../authn/src/features/get-data-bucket.ts | 2 +- packages/authn/src/features/get-database.ts | 2 +- packages/authn/src/features/get-usage.ts | 4 +- .../authn/src/features/telemetry-queue.ts | 8 +- .../src/utils/is-analytics-engine-dataset.ts | 12 - packages/authn/src/utils/is-console.ts | 47 ---- packages/authn/src/utils/is-d1-database.ts | 16 -- packages/authn/src/utils/is-r2-bucket.ts | 22 -- packages/aws-rum-react/package.json | 3 +- packages/aws-rum-react/vitest.config.ts | 21 +- packages/cloudflare-utils/.attw.json | 5 + packages/cloudflare-utils/.gitignore | 8 + packages/cloudflare-utils/.npmignore | 15 ++ .../cloudflare-utils/.vscode/settings.json | 12 + packages/cloudflare-utils/LICENSE | 21 ++ packages/cloudflare-utils/README.md | 38 +++ packages/cloudflare-utils/eslint.config.js | 1 + packages/cloudflare-utils/package.json | 57 +++++ packages/cloudflare-utils/src/has-method.ts | 10 + packages/cloudflare-utils/src/has-methods.ts | 8 + packages/cloudflare-utils/src/index.ts | 4 + .../src/is-analytics-engine-dataset.test.ts | 15 ++ .../src/is-analytics-engine-dataset.ts | 13 + .../src/is-d1-database.test.ts | 18 ++ .../cloudflare-utils/src/is-d1-database.ts | 18 ++ .../cloudflare-utils/src/is-r2-bucket.test.ts | 21 ++ packages/cloudflare-utils/src/is-r2-bucket.ts | 21 ++ packages/cloudflare-utils/src/is-record.ts | 8 + packages/cloudflare-utils/tsconfig.json | 12 + .../cloudflare-utils/tsconfig.prepack.json | 12 + packages/cloudflare-utils/vitest.config.ts | 25 ++ packages/csp/jest.config.cjs | 2 - packages/csp/package.json | 8 +- packages/csp/src/features/handle-fetch.ts | 2 +- packages/csp/src/utils/is-d1-database.ts | 16 -- packages/csp/vitest.config.ts | 13 +- packages/eslint-config/eslint.config.js | 2 +- packages/eslint-config/jest.config.cjs | 2 - packages/eslint-config/vitest.config.ts | 26 +- packages/fmrs/jest.config.cjs | 2 - packages/fmrs/package.json | 3 +- packages/fmrs/vitest.config.ts | 26 +- packages/fullstory-react/jest.config.cjs | 2 - packages/fullstory-react/package.json | 3 +- packages/fullstory-react/vitest.config.ts | 21 +- packages/lazy-i18n/jest.config.cjs | 2 - packages/lazy-i18n/package.json | 2 + packages/lazy-i18n/vitest.config.ts | 21 +- packages/mock-next-router/jest.config.cjs | 2 - packages/mock-next-router/package.json | 3 +- packages/mock-next-router/vitest.config.ts | 21 +- packages/next/package.json | 2 +- packages/next/vitest.config.ts | 20 +- packages/number-format-react/jest.config.cjs | 2 - packages/number-format-react/package.json | 3 +- packages/number-format-react/vitest.config.ts | 21 +- packages/react-datadog/jest.config.cjs | 2 - packages/react-datadog/package.json | 3 +- packages/react-datadog/vitest.config.ts | 21 +- packages/sentry-react/jest.config.cjs | 2 - packages/sentry-react/package.json | 3 +- packages/sentry-react/vitest.config.ts | 21 +- packages/test/package.json | 3 +- packages/test/tsconfig.json | 4 +- packages/test/tsconfig.prepack.json | 11 +- packages/test/vitest.config.ts | 26 +- packages/tree-logger/package.json | 3 +- packages/tree-logger/vitest.config.ts | 26 +- packages/unknown2string/jest.config.cjs | 2 - packages/unknown2string/package.json | 3 +- packages/unknown2string/vitest.config.ts | 26 +- packages/use-shallow-memo/jest.config.cjs | 2 - packages/use-shallow-memo/package.json | 3 +- packages/use-shallow-memo/vitest.config.ts | 21 +- packages/vitest-config/.attw.json | 5 + packages/vitest-config/.gitignore | 8 + packages/vitest-config/.npmignore | 15 ++ packages/vitest-config/.vscode/settings.json | 12 + packages/vitest-config/LICENSE | 21 ++ packages/vitest-config/README.md | 43 ++++ packages/vitest-config/eslint.config.js | 1 + packages/vitest-config/package.json | 73 ++++++ .../vitest-config/src/coverage-options.ts | 13 + .../src/test => vitest-config/src}/exclude.ts | 6 + packages/vitest-config/src/index.ts | 17 ++ packages/vitest-config/src/inline-config.ts | 12 + packages/vitest-config/src/plugin-options.ts | 5 + packages/vitest-config/src/thresholds.ts | 10 + packages/vitest-config/tsconfig.json | 11 + packages/vitest-config/tsconfig.prepack.json | 12 + packages/vitest-config/vitest.config.ts | 1 + packages/workers-shared/eslint.config.js | 6 +- packages/workers-shared/jest.config.cjs | 2 - packages/workers-shared/package.json | 8 +- .../{constants => }/account-number.test.ts | 6 +- .../src/{constants => }/account-number.ts | 0 packages/workers-shared/src/index.ts | 6 +- .../src/{constants => }/product.test.ts | 4 +- .../src/{constants => }/product.ts | 0 .../src/{constants => }/usage-type.test.ts | 4 +- .../src/{constants => }/usage-type.ts | 0 packages/workers-shared/vitest.config.ts | 26 +- quisido.code-workspace | 8 + tsconfig.json | 4 +- vitest.config.ts | 27 +- yarn.lock | 234 +++++++++--------- 112 files changed, 847 insertions(+), 707 deletions(-) delete mode 100644 packages/authn/src/utils/is-analytics-engine-dataset.ts delete mode 100644 packages/authn/src/utils/is-console.ts delete mode 100644 packages/authn/src/utils/is-d1-database.ts delete mode 100644 packages/authn/src/utils/is-r2-bucket.ts create mode 100644 packages/cloudflare-utils/.attw.json create mode 100644 packages/cloudflare-utils/.gitignore create mode 100644 packages/cloudflare-utils/.npmignore create mode 100644 packages/cloudflare-utils/.vscode/settings.json create mode 100644 packages/cloudflare-utils/LICENSE create mode 100644 packages/cloudflare-utils/README.md create mode 100644 packages/cloudflare-utils/eslint.config.js create mode 100644 packages/cloudflare-utils/package.json create mode 100644 packages/cloudflare-utils/src/has-method.ts create mode 100644 packages/cloudflare-utils/src/has-methods.ts create mode 100644 packages/cloudflare-utils/src/index.ts create mode 100644 packages/cloudflare-utils/src/is-analytics-engine-dataset.test.ts create mode 100644 packages/cloudflare-utils/src/is-analytics-engine-dataset.ts create mode 100644 packages/cloudflare-utils/src/is-d1-database.test.ts create mode 100644 packages/cloudflare-utils/src/is-d1-database.ts create mode 100644 packages/cloudflare-utils/src/is-r2-bucket.test.ts create mode 100644 packages/cloudflare-utils/src/is-r2-bucket.ts create mode 100644 packages/cloudflare-utils/src/is-record.ts create mode 100644 packages/cloudflare-utils/tsconfig.json create mode 100644 packages/cloudflare-utils/tsconfig.prepack.json create mode 100644 packages/cloudflare-utils/vitest.config.ts delete mode 100644 packages/csp/jest.config.cjs delete mode 100644 packages/csp/src/utils/is-d1-database.ts delete mode 100644 packages/eslint-config/jest.config.cjs delete mode 100644 packages/fmrs/jest.config.cjs delete mode 100644 packages/fullstory-react/jest.config.cjs delete mode 100644 packages/lazy-i18n/jest.config.cjs delete mode 100644 packages/mock-next-router/jest.config.cjs delete mode 100644 packages/number-format-react/jest.config.cjs delete mode 100644 packages/react-datadog/jest.config.cjs delete mode 100644 packages/sentry-react/jest.config.cjs delete mode 100644 packages/unknown2string/jest.config.cjs delete mode 100644 packages/use-shallow-memo/jest.config.cjs create mode 100644 packages/vitest-config/.attw.json create mode 100644 packages/vitest-config/.gitignore create mode 100644 packages/vitest-config/.npmignore create mode 100644 packages/vitest-config/.vscode/settings.json create mode 100644 packages/vitest-config/LICENSE create mode 100644 packages/vitest-config/README.md create mode 100644 packages/vitest-config/eslint.config.js create mode 100644 packages/vitest-config/package.json create mode 100644 packages/vitest-config/src/coverage-options.ts rename packages/{next/src/test => vitest-config/src}/exclude.ts (58%) create mode 100644 packages/vitest-config/src/index.ts create mode 100644 packages/vitest-config/src/inline-config.ts create mode 100644 packages/vitest-config/src/plugin-options.ts create mode 100644 packages/vitest-config/src/thresholds.ts create mode 100644 packages/vitest-config/tsconfig.json create mode 100644 packages/vitest-config/tsconfig.prepack.json create mode 100644 packages/vitest-config/vitest.config.ts delete mode 100644 packages/workers-shared/jest.config.cjs rename packages/workers-shared/src/{constants => }/account-number.test.ts (74%) rename packages/workers-shared/src/{constants => }/account-number.ts (100%) rename packages/workers-shared/src/{constants => }/product.test.ts (79%) rename packages/workers-shared/src/{constants => }/product.ts (100%) rename packages/workers-shared/src/{constants => }/usage-type.test.ts (79%) rename packages/workers-shared/src/{constants => }/usage-type.ts (100%) diff --git a/package.json b/package.json index 0c738a178..fd0f66b28 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,9 @@ "@babel/preset-typescript": "^7.24.1", "@eslint/js": "^9.1.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@monorepo-template/test": "workspace:^", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/babel__core": "^7.20.5", "@types/babel__preset-env": "^7.9.6", "@types/eslint": "^8.56.10", diff --git a/packages/authn-shared/package.json b/packages/authn-shared/package.json index ba048fc49..3d98f3d7c 100644 --- a/packages/authn-shared/package.json +++ b/packages/authn-shared/package.json @@ -43,6 +43,7 @@ "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", @@ -57,6 +58,7 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" } } diff --git a/packages/authn-shared/vitest.config.ts b/packages/authn-shared/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/authn-shared/vitest.config.ts +++ b/packages/authn-shared/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/packages/authn/package.json b/packages/authn/package.json index 666d20243..56fb07bae 100644 --- a/packages/authn/package.json +++ b/packages/authn/package.json @@ -38,6 +38,7 @@ "dependencies": { "@quisido/authn-shared": "workspace:^", "@quisido/workers-shared": "workspace:^", + "cloudflare-utils": "workspace:^", "cookie": "^0.6.0", "fmrs": "workspace:^", "form-urlencoded": "^6.1.4", @@ -49,9 +50,10 @@ "@babel/preset-env": "^7.24.4", "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", - "@cloudflare/workers-types": "^4.20240419.0", + "@cloudflare/workers-types": "^4.20240512.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/cookie": "^0.6.0", "@types/eslint": "^8.56.10", "@vitest/coverage-istanbul": "^1.6.0", @@ -60,6 +62,7 @@ "concurrently": "^8.2.2", "eslint": "^9.1.1", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0", "wrangler": "^3.51.2" } diff --git a/packages/authn/src/constants/metric-name.ts b/packages/authn/src/constants/metric-name.ts index a7ec35e7e..1a712c402 100644 --- a/packages/authn/src/constants/metric-name.ts +++ b/packages/authn/src/constants/metric-name.ts @@ -48,9 +48,7 @@ enum MetricName { // quisi.do AuthnIdCreated = 'authn-id.created', AuthnIdError = 'authn-id.error', - InvalidConsole = 'console.invalid', InvalidUsageDataset = 'dataset.usage.invalid', - MissingConsole = 'console.missing', MissingUsageDataset = 'dataset.usage.missing', } diff --git a/packages/authn/src/features/get-console.ts b/packages/authn/src/features/get-console.ts index fb2688c54..57740f70c 100644 --- a/packages/authn/src/features/get-console.ts +++ b/packages/authn/src/features/get-console.ts @@ -1,35 +1,6 @@ -import { mapUnknownToString } from 'fmrs'; -import MetricName from '../constants/metric-name.js'; import getState from '../utils/get-state.js'; -import getTelemetry from '../utils/get-telemetry.js'; -import isConsole from '../utils/is-console.js'; export default function getConsole(): Console { const { console } = getState(); - - if (isConsole(console)) { - return console; - } - - const { emitPublicMetric, logPrivateError, logPublicError } = getTelemetry(); - if (typeof console === 'undefined') { - emitPublicMetric({ name: MetricName.MissingConsole }); - return console; - } - - emitPublicMetric({ name: MetricName.InvalidConsole }); - - logPrivateError( - new Error('Invalid console', { - cause: mapUnknownToString(console), - }), - ); - - logPublicError( - new Error('Invalid console', { - cause: typeof console, - }), - ); - return console; } diff --git a/packages/authn/src/features/get-data-bucket.ts b/packages/authn/src/features/get-data-bucket.ts index d7ec4930d..439c2583d 100644 --- a/packages/authn/src/features/get-data-bucket.ts +++ b/packages/authn/src/features/get-data-bucket.ts @@ -1,8 +1,8 @@ +import { isR2Bucket } from 'cloudflare-utils'; import { mapUnknownToString } from 'fmrs'; import MetricName from '../constants/metric-name.js'; import getEnv from '../utils/get-env.js'; import getTelemetry from '../utils/get-telemetry.js'; -import isR2Bucket from '../utils/is-r2-bucket.js'; export default function getDataBucket(): R2Bucket | null { const { AUTHN_DATA } = getEnv(); diff --git a/packages/authn/src/features/get-database.ts b/packages/authn/src/features/get-database.ts index 5d4045fc2..9913b71ef 100644 --- a/packages/authn/src/features/get-database.ts +++ b/packages/authn/src/features/get-database.ts @@ -1,6 +1,6 @@ import { ErrorCode } from '@quisido/authn-shared'; +import { isD1Database } from 'cloudflare-utils'; import getEnv from '../utils/get-env.js'; -import isD1Database from '../utils/is-d1-database.js'; import mapCauseToError from '../utils/map-cause-to-error.js'; export default function getDatabase(): D1Database { diff --git a/packages/authn/src/features/get-usage.ts b/packages/authn/src/features/get-usage.ts index f16733330..ab7ab93a6 100644 --- a/packages/authn/src/features/get-usage.ts +++ b/packages/authn/src/features/get-usage.ts @@ -1,8 +1,8 @@ import { ErrorCode } from '@quisido/authn-shared'; import { Product, type UsageType } from '@quisido/workers-shared'; +import { isAnalyticsEngineDataset } from 'cloudflare-utils'; import EnvironmentName from '../constants/environment-name.js'; import getEnv from '../utils/get-env.js'; -import isAnaylticsEngineDataset from '../utils/is-analytics-engine-dataset.js'; import mapCauseToError from '../utils/map-cause-to-error.js'; import getConsole from './get-console.js'; import getEnvironmentName from './get-environment-name.js'; @@ -21,7 +21,7 @@ const SINGLE = 1; export default function getUsage(): (options: Options) => void { const { USAGE } = getEnv(); const ENVIRONMENT_NAME: EnvironmentName = getEnvironmentName(); - if (!isAnaylticsEngineDataset(USAGE)) { + if (!isAnalyticsEngineDataset(USAGE)) { if (ENVIRONMENT_NAME === EnvironmentName.Development) { const console: Console = getConsole(); return function useDev({ diff --git a/packages/authn/src/features/telemetry-queue.ts b/packages/authn/src/features/telemetry-queue.ts index aa73bf878..fb899f93f 100644 --- a/packages/authn/src/features/telemetry-queue.ts +++ b/packages/authn/src/features/telemetry-queue.ts @@ -1,9 +1,9 @@ import { AccountNumber, UsageType } from '@quisido/workers-shared'; +import { isAnalyticsEngineDataset } from 'cloudflare-utils'; import { mapUnknownToError } from 'fmrs'; import MetricName from '../constants/metric-name.js'; import type { TraceParent } from '../modules/trace-parent/index.js'; import type { Metric } from '../types/metric.js'; -import isAnaylticsEngineDataset from '../utils/is-analytics-engine-dataset.js'; import mapAnalyticsEngineDatasetToEmitter from '../utils/map-analytics-dataset-engine-to-emitter.js'; import mapRequestToTraceParent from '../utils/map-request-to-trace-parent.js'; import TelemetryQueue from '../utils/telemetry-queue.js'; @@ -94,7 +94,7 @@ export default class AuthenticationTelemetryQueue extends TelemetryQueue return; } - if (!isAnaylticsEngineDataset(dataset)) { + if (!isAnalyticsEngineDataset(dataset)) { this.emitPublicMetric({ name: MetricName.InvalidPrivateDataset, type: typeof dataset, @@ -119,7 +119,7 @@ export default class AuthenticationTelemetryQueue extends TelemetryQueue return; } - if (!isAnaylticsEngineDataset(dataset)) { + if (!isAnalyticsEngineDataset(dataset)) { this.emitPublicMetric({ name: MetricName.InvalidPublicDataset, type: typeof dataset, @@ -163,7 +163,7 @@ export default class AuthenticationTelemetryQueue extends TelemetryQueue return; } - if (!isAnaylticsEngineDataset(dataset)) { + if (!isAnalyticsEngineDataset(dataset)) { this.emitPublicMetric({ name: MetricName.InvalidUsageDataset, type: typeof dataset, diff --git a/packages/authn/src/utils/is-analytics-engine-dataset.ts b/packages/authn/src/utils/is-analytics-engine-dataset.ts deleted file mode 100644 index 19936328a..000000000 --- a/packages/authn/src/utils/is-analytics-engine-dataset.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import isObject from './is-object.js'; - -export default function isAnaylticsEngineDataset( - value: unknown, -): value is AnalyticsEngineDataset { - return ( - isObject(value) && - 'writeDataPoint' in value && - typeof value['writeDataPoint'] === 'function' - ); -} diff --git a/packages/authn/src/utils/is-console.ts b/packages/authn/src/utils/is-console.ts deleted file mode 100644 index 8e90e79e4..000000000 --- a/packages/authn/src/utils/is-console.ts +++ /dev/null @@ -1,47 +0,0 @@ -import isObject from "./is-object.js"; - -export default function isConsole(value: unknown): value is Console { - return ( - isObject(value) && - 'assert' in value && - typeof value["assert"] === 'function' && - 'clear' in value && - typeof value["clear"] === 'function' && - 'count' in value && - typeof value["count"] === 'function' && - 'countReset' in value && - typeof value["countReset"] === 'function' && - 'debug' in value && - typeof value["debug"] === 'function' && - 'dir' in value && - typeof value["dir"] === 'function' && - 'dirxml' in value && - typeof value["dirxml"] === 'function' && - 'error' in value && - typeof value["error"] === 'function' && - 'group' in value && - typeof value["group"] === 'function' && - 'groupCollapsed' in value && - typeof value["groupCollapsed"] === 'function' && - 'groupEnd' in value && - typeof value["groupEnd"] === 'function' && - 'info' in value && - typeof value["info"] === 'function' && - 'log' in value && - typeof value["log"] === 'function' && - 'table' in value && - typeof value["table"] === 'function' && - 'time' in value && - typeof value["time"] === 'function' && - 'timeEnd' in value && - typeof value["timeEnd"] === 'function' && - 'timeLog' in value && - typeof value["timeLog"] === 'function' && - 'timeStamp' in value && - typeof value["timeStamp"] === 'function' && - 'trace' in value && - typeof value["trace"] === 'function' && - 'warn' in value && - typeof value["warn"] === 'function' - ); -} diff --git a/packages/authn/src/utils/is-d1-database.ts b/packages/authn/src/utils/is-d1-database.ts deleted file mode 100644 index 28f1ec331..000000000 --- a/packages/authn/src/utils/is-d1-database.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// -import isObject from './is-object.js'; - -export default function isD1Database(value: unknown): value is D1Database { - return ( - isObject(value) && - 'batch' in value && - 'dump' in value && - 'exec' in value && - 'prepare' in value && - typeof value['batch'] === 'function' && - typeof value['dump'] === 'function' && - typeof value['exec'] === 'function' && - typeof value['prepare'] === 'function' - ); -} diff --git a/packages/authn/src/utils/is-r2-bucket.ts b/packages/authn/src/utils/is-r2-bucket.ts deleted file mode 100644 index d65ba6c1b..000000000 --- a/packages/authn/src/utils/is-r2-bucket.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// -import isObject from './is-object.js'; - -export default function isR2Bucket(value: unknown): value is R2Bucket { - return ( - isObject(value) && - 'createMultipartUpload' in value && - 'delete' in value && - 'get' in value && - 'head' in value && - 'list' in value && - 'put' in value && - 'resumeMultipartUpload' in value && - typeof value['createMultipartUpload'] === 'function' && - typeof value['delete'] === 'function' && - typeof value['get'] === 'function' && - typeof value['head'] === 'function' && - typeof value['list'] === 'function' && - typeof value['put'] === 'function' && - typeof value['resumeMultipartUpload'] === 'function' - ); -} diff --git a/packages/aws-rum-react/package.json b/packages/aws-rum-react/package.json index b47dea215..b95ec38b8 100644 --- a/packages/aws-rum-react/package.json +++ b/packages/aws-rum-react/package.json @@ -40,8 +40,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/babel__core": "^7.20.5", "@types/babel__preset-env": "^7.9.6", @@ -67,6 +67,7 @@ "react-dom": "^18.2.0", "typescript": "^5.4.5", "unknown2string": "workspace:^", + "vite": "^5.2.11", "vitest": "^1.6.0", "whatwg-fetch": "^3.6.20" }, diff --git a/packages/aws-rum-react/vitest.config.ts b/packages/aws-rum-react/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/aws-rum-react/vitest.config.ts +++ b/packages/aws-rum-react/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/cloudflare-utils/.attw.json b/packages/cloudflare-utils/.attw.json new file mode 100644 index 000000000..8a4130f62 --- /dev/null +++ b/packages/cloudflare-utils/.attw.json @@ -0,0 +1,5 @@ +{ + "format": "table-flipped", + "ignoreRules": ["cjs-resolves-to-esm"], + "pack": "." +} diff --git a/packages/cloudflare-utils/.gitignore b/packages/cloudflare-utils/.gitignore new file mode 100644 index 000000000..e6418a668 --- /dev/null +++ b/packages/cloudflare-utils/.gitignore @@ -0,0 +1,8 @@ +/coverage/ +/dist/ +/node_modules/ +/.eslintcache +/*.cpuprofile +/*.iml +/*.tsbuildinfo +/*-*.*.*.tgz diff --git a/packages/cloudflare-utils/.npmignore b/packages/cloudflare-utils/.npmignore new file mode 100644 index 000000000..66f4bca6c --- /dev/null +++ b/packages/cloudflare-utils/.npmignore @@ -0,0 +1,15 @@ +/.vscode/ +/coverage/ +/node_modules/ +/src/ +/.*.json +/.*ignore +/.*rc.* +/.eslintcache +/*.config.* +/*.cpuprofile +/*.iml +/*.tsbuildinfo +/*-*.*.*.tgz +/tsconfig.* +.DS_Store diff --git a/packages/cloudflare-utils/.vscode/settings.json b/packages/cloudflare-utils/.vscode/settings.json new file mode 100644 index 000000000..0a420728a --- /dev/null +++ b/packages/cloudflare-utils/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "files.exclude": { + "coverage/": true, + "dist/": true, + "node_modules/": true, + ".attw.json": true, + ".eslintcache": true, + "*.cpuprofile": true, + "*.tsbuildinfo": true, + "vitest.config.ts.timestamp-*-*.mjs": true + } +} diff --git a/packages/cloudflare-utils/LICENSE b/packages/cloudflare-utils/LICENSE new file mode 100644 index 000000000..6281ae1c5 --- /dev/null +++ b/packages/cloudflare-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 https://quisi.do/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/cloudflare-utils/README.md b/packages/cloudflare-utils/README.md new file mode 100644 index 000000000..3928ecde5 --- /dev/null +++ b/packages/cloudflare-utils/README.md @@ -0,0 +1,38 @@ +# Cloudflare utilities + +The Cloudflare utilities module contains helper functions for Cloudflare +workers. You can validate your `env` bindings for TypeScript type-safety and +prevent missing or incorrect bindings in your environments. + +## Analytics Engine datasets + +```ts +import { isAnalyticsEngineDataset } from 'cloudflare-utils'; + +const { MY_DATASET } = env; +if (!isAnalyticsEngineDataset(MY_DATASET)) { + throw new Error('Expected an Analytics Engine dataset.'); +} +``` + +## D1 databases + +```ts +import { isD1Database } from 'cloudflare-utils'; + +const { MY_DATABASE } = env; +if (!isD1Database(MY_DATABASE)) { + throw new Error('Expected a D1 database.'); +} +``` + +## R2 buckets + +```ts +import { isR2Bucket } from 'cloudflare-utils'; + +const { MY_BUCKET } = env; +if (!isR2Bucket(MY_BUCKET)) { + throw new Error('Expected an R2 bucket.'); +} +``` diff --git a/packages/cloudflare-utils/eslint.config.js b/packages/cloudflare-utils/eslint.config.js new file mode 100644 index 000000000..3ee68e44d --- /dev/null +++ b/packages/cloudflare-utils/eslint.config.js @@ -0,0 +1 @@ +export { default } from '@quisido/eslint-config'; diff --git a/packages/cloudflare-utils/package.json b/packages/cloudflare-utils/package.json new file mode 100644 index 000000000..ef23cab77 --- /dev/null +++ b/packages/cloudflare-utils/package.json @@ -0,0 +1,57 @@ +{ + "name": "cloudflare-utils", + "version": "1.0.1", + "author": "quisi.do ", + "description": "utilities for Cloudflare workers", + "homepage": "https://github.com/quisido/quisi.do/tree/main/packages/cloudflare-utils#readme", + "license": "MIT", + "main": "./dist/index.js", + "repository": "github:quisido/quisi.do", + "type": "module", + "types": "./dist/index.d.ts", + "bugs": { + "email": "cloudflare-utils@quisi.do", + "url": "https://github.com/quisido/quisi.do/issues" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/quisido" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "attw": "attw --quiet", + "clean": "rm -rf coverage dist node_modules && rm -f tsconfig.prepack.tsbuildinfo tsc-output.cpuprofile", + "eslint": "eslint . --cache --color --exit-on-fatal-error --max-warnings 0", + "eslint:fix": "eslint . --cache --color --exit-on-fatal-error --fix --max-warnings 0", + "prepack": "yarn run tsc", + "prepublish": "concurrently --kill-others-on-fail --names attw,eslint,vitest \"yarn run attw\" \"yarn run eslint\" \"yarn run vitest:run\"", + "tsc": "tsc --generateCpuProfile tsc-output.cpuprofile --project tsconfig.prepack.json", + "vitest": "vitest", + "vitest:run": "vitest run", + "vitest:watch": "vitest watch" + }, + "dependencies": { + "@cloudflare/workers-types": "^4.20240512.0" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.3", + "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", + "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", + "@typescript-eslint/parser": "^7.7.0", + "@vitest/coverage-istanbul": "^1.6.0", + "concurrently": "^8.2.2", + "eslint": "^9.1.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", + "prettier": "^3.2.5", + "tslib": "^2.6.2", + "typescript": "^5.4.5", + "vite": "^5.2.11", + "vitest": "^1.6.0" + } +} diff --git a/packages/cloudflare-utils/src/has-method.ts b/packages/cloudflare-utils/src/has-method.ts new file mode 100644 index 000000000..d6c9f0233 --- /dev/null +++ b/packages/cloudflare-utils/src/has-method.ts @@ -0,0 +1,10 @@ +export default function hasMethod( + value: Record, + method: K, +): value is Record unknown> { + return ( + method in value && + typeof value[method] === 'function' + ); +} + diff --git a/packages/cloudflare-utils/src/has-methods.ts b/packages/cloudflare-utils/src/has-methods.ts new file mode 100644 index 000000000..0d6bc308e --- /dev/null +++ b/packages/cloudflare-utils/src/has-methods.ts @@ -0,0 +1,8 @@ +import hasMethod from "./has-method.js"; + +export default function hasMethods( + value: Record, + methods: readonly K[], +): value is Record unknown> { + return methods.every(hasMethod.bind(null, value)); +} diff --git a/packages/cloudflare-utils/src/index.ts b/packages/cloudflare-utils/src/index.ts new file mode 100644 index 000000000..4fa105300 --- /dev/null +++ b/packages/cloudflare-utils/src/index.ts @@ -0,0 +1,4 @@ +export { default as isAnalyticsEngineDataset } from './is-analytics-engine-dataset.js'; +export { default as isD1Database } from './is-d1-database.js'; +export { default as isR2Bucket } from './is-r2-bucket.js'; + diff --git a/packages/cloudflare-utils/src/is-analytics-engine-dataset.test.ts b/packages/cloudflare-utils/src/is-analytics-engine-dataset.test.ts new file mode 100644 index 000000000..237799688 --- /dev/null +++ b/packages/cloudflare-utils/src/is-analytics-engine-dataset.test.ts @@ -0,0 +1,15 @@ +/// +import { describe, expect, it, vi } from 'vitest'; +import { isAnalyticsEngineDataset } from "./index.js"; + +describe('isAnalyticsEngineDataset', (): void => { + it('should identify Analytics Engine dataset interfaces', (): void => { + expect(isAnalyticsEngineDataset(true)).toBe(false); + expect(isAnalyticsEngineDataset(null)).toBe(false); + expect(isAnalyticsEngineDataset({})).toBe(false); + + expect(isAnalyticsEngineDataset({ + writeDataPoint: vi.fn(), + })).toBe(true); + }); +}); diff --git a/packages/cloudflare-utils/src/is-analytics-engine-dataset.ts b/packages/cloudflare-utils/src/is-analytics-engine-dataset.ts new file mode 100644 index 000000000..605db6e31 --- /dev/null +++ b/packages/cloudflare-utils/src/is-analytics-engine-dataset.ts @@ -0,0 +1,13 @@ +/// + +import hasMethod from "./has-method.js"; +import isRecord from "./is-record.js"; + +export default function isAnalyticsEngineDataset( + value: unknown, +): value is AnalyticsEngineDataset { + return ( + isRecord(value) && + hasMethod(value, 'writeDataPoint') + ); +} diff --git a/packages/cloudflare-utils/src/is-d1-database.test.ts b/packages/cloudflare-utils/src/is-d1-database.test.ts new file mode 100644 index 000000000..85e1c17b8 --- /dev/null +++ b/packages/cloudflare-utils/src/is-d1-database.test.ts @@ -0,0 +1,18 @@ +/// +import { describe, expect, it, vi } from 'vitest'; +import { isD1Database } from "./index.js"; + +describe('isD1Database', (): void => { + it('should identify D1 database interfaces', (): void => { + expect(isD1Database(true)).toBe(false); + expect(isD1Database(null)).toBe(false); + expect(isD1Database({})).toBe(false); + + expect(isD1Database({ + batch: vi.fn(), + dump: vi.fn(), + exec: vi.fn(), + prepare: vi.fn(), + })).toBe(true); + }); +}); diff --git a/packages/cloudflare-utils/src/is-d1-database.ts b/packages/cloudflare-utils/src/is-d1-database.ts new file mode 100644 index 000000000..fe78c386b --- /dev/null +++ b/packages/cloudflare-utils/src/is-d1-database.ts @@ -0,0 +1,18 @@ +/// + +import hasMethods from "./has-methods.js"; +import isRecord from "./is-record.js"; + +const REQUIRED_METHODS: readonly (keyof D1Database)[] = [ + 'batch', + 'dump', + 'exec', + 'prepare', +]; + +export default function isD1Database(value: unknown): value is D1Database { + return ( + isRecord(value) && + hasMethods(value, REQUIRED_METHODS) + ); +} diff --git a/packages/cloudflare-utils/src/is-r2-bucket.test.ts b/packages/cloudflare-utils/src/is-r2-bucket.test.ts new file mode 100644 index 000000000..763909f9b --- /dev/null +++ b/packages/cloudflare-utils/src/is-r2-bucket.test.ts @@ -0,0 +1,21 @@ +/// +import { describe, expect, it, vi } from 'vitest'; +import { isR2Bucket } from "./index.js"; + +describe('isR2Bucket', (): void => { + it('should identify R2 bucket interfaces', (): void => { + expect(isR2Bucket(true)).toBe(false); + expect(isR2Bucket(null)).toBe(false); + expect(isR2Bucket({})).toBe(false); + + expect(isR2Bucket({ + createMultipartUpload: vi.fn(), + delete: vi.fn(), + get: vi.fn(), + head: vi.fn(), + list: vi.fn(), + put: vi.fn(), + resumeMultipartUpload: vi.fn(), + })).toBe(true); + }); +}); diff --git a/packages/cloudflare-utils/src/is-r2-bucket.ts b/packages/cloudflare-utils/src/is-r2-bucket.ts new file mode 100644 index 000000000..d5816be41 --- /dev/null +++ b/packages/cloudflare-utils/src/is-r2-bucket.ts @@ -0,0 +1,21 @@ +/// + +import hasMethods from "./has-methods.js"; +import isRecord from "./is-record.js"; + +const REQUIRED_METHODS: readonly (keyof R2Bucket)[] = [ + 'createMultipartUpload', + 'delete', + 'get', + 'head', + 'list', + 'put', + 'resumeMultipartUpload', +]; + +export default function isR2Bucket(value: unknown): value is R2Bucket { + return ( + isRecord(value) && + hasMethods(value, REQUIRED_METHODS) + ); +} diff --git a/packages/cloudflare-utils/src/is-record.ts b/packages/cloudflare-utils/src/is-record.ts new file mode 100644 index 000000000..b4fc2720d --- /dev/null +++ b/packages/cloudflare-utils/src/is-record.ts @@ -0,0 +1,8 @@ +export default function isRecord( + value: unknown, +): value is Record { + return ( + typeof value === 'object' && + value !== null + ); +} diff --git a/packages/cloudflare-utils/tsconfig.json b/packages/cloudflare-utils/tsconfig.json new file mode 100644 index 000000000..b23cefbe2 --- /dev/null +++ b/packages/cloudflare-utils/tsconfig.json @@ -0,0 +1,12 @@ +{ + "exclude": ["coverage/", "dist/", "node_modules/"], + "extends": "../../tsconfig.json", + "include": ["**/*.ts", "**/*.tsx"], + "compilerOptions": { + "lib": ["ESNext"], + "noEmit": true, + "rootDir": ".", + "sourceRoot": ".", + "types": [] + } +} diff --git a/packages/cloudflare-utils/tsconfig.prepack.json b/packages/cloudflare-utils/tsconfig.prepack.json new file mode 100644 index 000000000..96a0dc04c --- /dev/null +++ b/packages/cloudflare-utils/tsconfig.prepack.json @@ -0,0 +1,12 @@ +{ + "exclude": ["src/**/*.test.ts", "src/test/"], + "extends": "./tsconfig.json", + "include": ["src/"], + "compilerOptions": { + "declarationDir": "dist", + "noEmit": false, + "outDir": "dist", + "rootDir": "src", + "sourceRoot": "https://github.com/quisido/quisi.do/raw/main/packages/cloudflare-utils/src/" + } +} diff --git a/packages/cloudflare-utils/vitest.config.ts b/packages/cloudflare-utils/vitest.config.ts new file mode 100644 index 000000000..209fa9973 --- /dev/null +++ b/packages/cloudflare-utils/vitest.config.ts @@ -0,0 +1,25 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + clearMocks: true, + environment: 'node', + mockReset: true, + restoreMocks: true, + + coverage: { + all: true, + clean: true, + enabled: true, + provider: 'istanbul', + skipFull: true, + + thresholds: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, + }, +}); diff --git a/packages/csp/jest.config.cjs b/packages/csp/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/csp/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/csp/package.json b/packages/csp/package.json index 78281fa3f..173520bb6 100644 --- a/packages/csp/package.json +++ b/packages/csp/package.json @@ -32,14 +32,19 @@ "vitest:watch": "vitest watch", "whoami": "wrangler whoami" }, + "dependencies": { + "@quisido/workers-shared": "workspace:^", + "cloudflare-utils": "workspace:^" + }, "devDependencies": { "@babel/core": "^7.24.4", "@babel/preset-env": "^7.24.4", "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", - "@cloudflare/workers-types": "^4.20240419.0", + "@cloudflare/workers-types": "^4.20240512.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/eslint": "^8.56.10", "@vitest/coverage-istanbul": "^1.6.0", "babel-plugin-replace-import-extension": "^1.1.4", @@ -47,6 +52,7 @@ "concurrently": "^8.2.2", "eslint": "^9.1.1", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0", "wrangler": "^3.51.2" } diff --git a/packages/csp/src/features/handle-fetch.ts b/packages/csp/src/features/handle-fetch.ts index e90dfdee7..260247f94 100644 --- a/packages/csp/src/features/handle-fetch.ts +++ b/packages/csp/src/features/handle-fetch.ts @@ -1,8 +1,8 @@ /// +import { isD1Database } from "cloudflare-utils"; import { ALLOWED_METHODS_SET } from "../constants/allowed-methods.js"; import { StatusCode } from "../constants/status-code.js"; import InvalidPathnameResponse from "../utils/invalid-pathname-response.js"; -import isD1Database from "../utils/is-d1-database.js"; import isObject from "../utils/is-object.js"; import mapHeadersToOrigin from "../utils/map-headers-to-origin.js"; import mapPathnameToProjectId from "../utils/map-pathname-to-project-id.js"; diff --git a/packages/csp/src/utils/is-d1-database.ts b/packages/csp/src/utils/is-d1-database.ts deleted file mode 100644 index 28f1ec331..000000000 --- a/packages/csp/src/utils/is-d1-database.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// -import isObject from './is-object.js'; - -export default function isD1Database(value: unknown): value is D1Database { - return ( - isObject(value) && - 'batch' in value && - 'dump' in value && - 'exec' in value && - 'prepare' in value && - typeof value['batch'] === 'function' && - typeof value['dump'] === 'function' && - typeof value['exec'] === 'function' && - typeof value['prepare'] === 'function' - ); -} diff --git a/packages/csp/vitest.config.ts b/packages/csp/vitest.config.ts index a0230ec73..f573bdc69 100644 --- a/packages/csp/vitest.config.ts +++ b/packages/csp/vitest.config.ts @@ -1,18 +1,13 @@ +import CONFIG, { COVERAGE_OPTIONS, INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, + ...INLINE_CONFIG, coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, + ...COVERAGE_OPTIONS, thresholds: { branches: 9, diff --git a/packages/eslint-config/eslint.config.js b/packages/eslint-config/eslint.config.js index 3ee68e44d..82be934aa 100644 --- a/packages/eslint-config/eslint.config.js +++ b/packages/eslint-config/eslint.config.js @@ -1 +1 @@ -export { default } from '@quisido/eslint-config'; +export { default } from './dist/index.js'; diff --git a/packages/eslint-config/jest.config.cjs b/packages/eslint-config/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/eslint-config/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/eslint-config/vitest.config.ts b/packages/eslint-config/vitest.config.ts index 209fa9973..03b5fa67e 100644 --- a/packages/eslint-config/vitest.config.ts +++ b/packages/eslint-config/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '../vitest-config/dist/index.js'; diff --git a/packages/fmrs/jest.config.cjs b/packages/fmrs/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/fmrs/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/fmrs/package.json b/packages/fmrs/package.json index b95d43dcc..74c112f93 100644 --- a/packages/fmrs/package.json +++ b/packages/fmrs/package.json @@ -42,8 +42,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", @@ -58,6 +58,7 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" } } diff --git a/packages/fmrs/vitest.config.ts b/packages/fmrs/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/fmrs/vitest.config.ts +++ b/packages/fmrs/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/packages/fullstory-react/jest.config.cjs b/packages/fullstory-react/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/fullstory-react/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/fullstory-react/package.json b/packages/fullstory-react/package.json index 60066cee3..0a1d3adf6 100644 --- a/packages/fullstory-react/package.json +++ b/packages/fullstory-react/package.json @@ -47,8 +47,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/babel__core": "^7.20.5", "@types/babel__preset-env": "^7.9.6", @@ -73,6 +73,7 @@ "react-test-renderer": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/fullstory-react/vitest.config.ts b/packages/fullstory-react/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/fullstory-react/vitest.config.ts +++ b/packages/fullstory-react/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/lazy-i18n/jest.config.cjs b/packages/lazy-i18n/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/lazy-i18n/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/lazy-i18n/package.json b/packages/lazy-i18n/package.json index c7f6951ea..3ba017403 100644 --- a/packages/lazy-i18n/package.json +++ b/packages/lazy-i18n/package.json @@ -40,6 +40,7 @@ "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/babel__core": "^7.20.5", "@types/babel__preset-env": "^7.9.6", @@ -65,6 +66,7 @@ "sass": "^1.77.2", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/lazy-i18n/vitest.config.ts b/packages/lazy-i18n/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/lazy-i18n/vitest.config.ts +++ b/packages/lazy-i18n/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/mock-next-router/jest.config.cjs b/packages/mock-next-router/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/mock-next-router/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/mock-next-router/package.json b/packages/mock-next-router/package.json index b68267383..6478860c2 100644 --- a/packages/mock-next-router/package.json +++ b/packages/mock-next-router/package.json @@ -43,8 +43,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/node": "^20.12.7", "@types/react": "^18.2.79", @@ -69,6 +69,7 @@ "react-dom": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/mock-next-router/vitest.config.ts b/packages/mock-next-router/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/mock-next-router/vitest.config.ts +++ b/packages/mock-next-router/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/next/package.json b/packages/next/package.json index 25730beb3..e87c278a9 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -109,13 +109,13 @@ "@microsoft/eslint-formatter-sarif": "^3.1.0", "@monorepo-template/coverage": "^1.2.3", "@monorepo-template/cypress-coverage-plugin": "^1.0.7", - "@monorepo-template/eslint-config": "^1.0.7", "@monorepo-template/ignore-cypress-dependency-logs": "^1.0.0", "@next/bundle-analyzer": "^14.2.2", "@opentelemetry/auto-instrumentations-web": "^0.38.0", "@opentelemetry/core": "^1.23.0", "@opentelemetry/sdk-metrics": "^1.23.0", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@react-aria/link": "^3.6.5", "@sentry/types": "^7.111.0", "@stylistic/eslint-plugin-ts": "^1.7.2", diff --git a/packages/next/vitest.config.ts b/packages/next/vitest.config.ts index 22bdf433d..5f5f9505d 100644 --- a/packages/next/vitest.config.ts +++ b/packages/next/vitest.config.ts @@ -1,24 +1,16 @@ +import CONFIG, { COVERAGE_OPTIONS, INLINE_CONFIG, PLUGIN_OPTIONS } from '@quisido/vitest-config'; import react from '@vitejs/plugin-react'; -import { defaultExclude, defineConfig } from 'vitest/config'; -import { EXCLUDE } from './src/test/exclude.js'; +import { defineConfig } from 'vitest/config'; export default defineConfig({ - plugins: [react()], - + ...CONFIG, + plugins: [...PLUGIN_OPTIONS, react()], test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - exclude: [...defaultExclude, ...EXCLUDE], - mockReset: true, - restoreMocks: true, coverage: { - all: true, - clean: true, - enabled: true, - exclude: [...defaultExclude, ...EXCLUDE], - provider: 'istanbul', - skipFull: true, + ...COVERAGE_OPTIONS, thresholds: { branches: 4, diff --git a/packages/number-format-react/jest.config.cjs b/packages/number-format-react/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/number-format-react/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/number-format-react/package.json b/packages/number-format-react/package.json index 8bfca3a58..d3140dfa3 100644 --- a/packages/number-format-react/package.json +++ b/packages/number-format-react/package.json @@ -31,8 +31,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/node": "^20.12.7", "@types/react": "^18.2.79", @@ -54,6 +54,7 @@ "react-dom": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/number-format-react/vitest.config.ts b/packages/number-format-react/vitest.config.ts index 7d4a4556c..303d1c5bc 100644 --- a/packages/number-format-react/vitest.config.ts +++ b/packages/number-format-react/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'happy-dom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/react-datadog/jest.config.cjs b/packages/react-datadog/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/react-datadog/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/react-datadog/package.json b/packages/react-datadog/package.json index 880fb2249..7b25cb3d8 100644 --- a/packages/react-datadog/package.json +++ b/packages/react-datadog/package.json @@ -43,8 +43,8 @@ "@babel/preset-typescript": "^7.24.1", "@datadog/browser-rum": "^5.15.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/node": "^20.12.7", "@types/react": "^18.2.79", @@ -61,6 +61,7 @@ "react-dom": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/react-datadog/vitest.config.ts b/packages/react-datadog/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/react-datadog/vitest.config.ts +++ b/packages/react-datadog/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/sentry-react/jest.config.cjs b/packages/sentry-react/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/sentry-react/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/sentry-react/package.json b/packages/sentry-react/package.json index a1251f555..fb531cb5f 100644 --- a/packages/sentry-react/package.json +++ b/packages/sentry-react/package.json @@ -58,8 +58,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@sentry/react": "^7.111.0", "@testing-library/react": "^15.0.7", "@types/babel__core": "^7.20.5", @@ -85,6 +85,7 @@ "react-test-renderer": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/sentry-react/vitest.config.ts b/packages/sentry-react/vitest.config.ts index 7a92b415e..b7a1dbfae 100644 --- a/packages/sentry-react/vitest.config.ts +++ b/packages/sentry-react/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'jsdom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/test/package.json b/packages/test/package.json index d0a73f090..62a5829ae 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -44,8 +44,8 @@ "devDependencies": { "@arethetypeswrong/cli": "^0.15.3", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", "@vitest/coverage-istanbul": "^1.6.0", @@ -59,6 +59,7 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" } } diff --git a/packages/test/tsconfig.json b/packages/test/tsconfig.json index 7918a4e6b..6ca1c71bb 100644 --- a/packages/test/tsconfig.json +++ b/packages/test/tsconfig.json @@ -5,7 +5,7 @@ "compilerOptions": { "lib": ["DOM", "ESNext"], "noEmit": true, - "rootDir": "src", - "sourceRoot": "src" + "rootDir": ".", + "sourceRoot": "." } } diff --git a/packages/test/tsconfig.prepack.json b/packages/test/tsconfig.prepack.json index 96609593e..4b58f9b90 100644 --- a/packages/test/tsconfig.prepack.json +++ b/packages/test/tsconfig.prepack.json @@ -1,10 +1,13 @@ { + "exclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/test/"], "extends": "./tsconfig.json", + "include": ["src/"], + "compilerOptions": { "declarationDir": "dist", "noEmit": false, - "outDir": "dist" - }, - "exclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/test/"], - "include": ["src/"] + "outDir": "dist", + "rootDir": "src", + "sourceRoot": "https://github.com/quisido/quisi.do/raw/main/packages/test/src/" + } } diff --git a/packages/test/vitest.config.ts b/packages/test/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/test/vitest.config.ts +++ b/packages/test/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/packages/tree-logger/package.json b/packages/tree-logger/package.json index 1e9b2df28..1849fa641 100644 --- a/packages/tree-logger/package.json +++ b/packages/tree-logger/package.json @@ -38,8 +38,8 @@ "devDependencies": { "@arethetypeswrong/cli": "^0.15.3", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", @@ -54,6 +54,7 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" } } diff --git a/packages/tree-logger/vitest.config.ts b/packages/tree-logger/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/tree-logger/vitest.config.ts +++ b/packages/tree-logger/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/packages/unknown2string/jest.config.cjs b/packages/unknown2string/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/unknown2string/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/unknown2string/package.json b/packages/unknown2string/package.json index cf2af7fff..8d61b97e9 100644 --- a/packages/unknown2string/package.json +++ b/packages/unknown2string/package.json @@ -39,8 +39,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", @@ -55,6 +55,7 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" } } diff --git a/packages/unknown2string/vitest.config.ts b/packages/unknown2string/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/unknown2string/vitest.config.ts +++ b/packages/unknown2string/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/packages/use-shallow-memo/jest.config.cjs b/packages/use-shallow-memo/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/use-shallow-memo/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/use-shallow-memo/package.json b/packages/use-shallow-memo/package.json index 3654b9368..b75fdb92a 100644 --- a/packages/use-shallow-memo/package.json +++ b/packages/use-shallow-memo/package.json @@ -39,8 +39,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@testing-library/react": "^15.0.7", "@types/node": "^20.12.7", "@types/react": "^18.2.79", @@ -62,6 +62,7 @@ "react-dom": "^18.2.0", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" }, "peerDependencies": { diff --git a/packages/use-shallow-memo/vitest.config.ts b/packages/use-shallow-memo/vitest.config.ts index 7d4a4556c..303d1c5bc 100644 --- a/packages/use-shallow-memo/vitest.config.ts +++ b/packages/use-shallow-memo/vitest.config.ts @@ -1,25 +1,10 @@ +import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + ...CONFIG, test: { - clearMocks: true, + ...INLINE_CONFIG, environment: 'happy-dom', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, }, }); diff --git a/packages/vitest-config/.attw.json b/packages/vitest-config/.attw.json new file mode 100644 index 000000000..4b3efae98 --- /dev/null +++ b/packages/vitest-config/.attw.json @@ -0,0 +1,5 @@ +{ + "format": "table-flipped", + "ignoreRules": ["cjs-resolves-to-esm", "no-resolution"], + "pack": "." +} diff --git a/packages/vitest-config/.gitignore b/packages/vitest-config/.gitignore new file mode 100644 index 000000000..e6418a668 --- /dev/null +++ b/packages/vitest-config/.gitignore @@ -0,0 +1,8 @@ +/coverage/ +/dist/ +/node_modules/ +/.eslintcache +/*.cpuprofile +/*.iml +/*.tsbuildinfo +/*-*.*.*.tgz diff --git a/packages/vitest-config/.npmignore b/packages/vitest-config/.npmignore new file mode 100644 index 000000000..66f4bca6c --- /dev/null +++ b/packages/vitest-config/.npmignore @@ -0,0 +1,15 @@ +/.vscode/ +/coverage/ +/node_modules/ +/src/ +/.*.json +/.*ignore +/.*rc.* +/.eslintcache +/*.config.* +/*.cpuprofile +/*.iml +/*.tsbuildinfo +/*-*.*.*.tgz +/tsconfig.* +.DS_Store diff --git a/packages/vitest-config/.vscode/settings.json b/packages/vitest-config/.vscode/settings.json new file mode 100644 index 000000000..0a420728a --- /dev/null +++ b/packages/vitest-config/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "files.exclude": { + "coverage/": true, + "dist/": true, + "node_modules/": true, + ".attw.json": true, + ".eslintcache": true, + "*.cpuprofile": true, + "*.tsbuildinfo": true, + "vitest.config.ts.timestamp-*-*.mjs": true + } +} diff --git a/packages/vitest-config/LICENSE b/packages/vitest-config/LICENSE new file mode 100644 index 000000000..6281ae1c5 --- /dev/null +++ b/packages/vitest-config/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 https://quisi.do/ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/vitest-config/README.md b/packages/vitest-config/README.md new file mode 100644 index 000000000..4261c8cae --- /dev/null +++ b/packages/vitest-config/README.md @@ -0,0 +1,43 @@ +# [quisi.do](https://quisi.do) ESLint configuration + +[![CI/CD](https://github.com/quisido/quisi.do/actions/workflows/cd.yml/badge.svg?branch=main&event=push)](https://github.com/quisido/quisi.do/actions/workflows/cd.yml) +[![version](https://img.shields.io/npm/v/@quisido/eslint-config.svg)](https://www.npmjs.com/package/@quisido/eslint-config) +[![downloads](https://img.shields.io/npm/dt/@quisido/eslint-config.svg)](https://www.npmjs.com/package/@quisido/eslint-config) + +The `@quisido/eslint-config` provides flat ESLint configurations for `.cjs`, +`.d.ts`, `.js`, `.test.ts`, and `.ts` files. + +The simplest implementation is to just export the entire module as your ESLint +configuration. + +```js +// eslint.config.js +export { default } from '@quisido/eslint-config'; +``` + +To extend the configuration, you may spread the default export as an array. + +```js +// eslint.config.js +import configs from '@quisido/eslint-config'; + +export default [ + ...configs, + { + // Add your custom configuration here. + }, +]; +``` + +To cherry-pick or tailor any configurations, you may import them directly. + +```js +// eslint.config.js +import CJS from '@quisido/eslint-config/cjs'; +import D_TS from '@quisido/eslint-config/d-ts'; +import JS from '@quisido/eslint-config/js'; +import TEST_TS from '@quisido/eslint-config/test-ts'; +import TS from '@quisido/eslint-config/ts'; + +export default [JS, CJS, TS, D_TS, TEST_TS]; +``` diff --git a/packages/vitest-config/eslint.config.js b/packages/vitest-config/eslint.config.js new file mode 100644 index 000000000..4e068da94 --- /dev/null +++ b/packages/vitest-config/eslint.config.js @@ -0,0 +1 @@ +export { default } from '../eslint-config/dist/index.js'; diff --git a/packages/vitest-config/package.json b/packages/vitest-config/package.json new file mode 100644 index 000000000..c3523c481 --- /dev/null +++ b/packages/vitest-config/package.json @@ -0,0 +1,73 @@ +{ + "name": "@quisido/vitest-config", + "version": "1.0.0", + "author": "quisi.do ", + "description": "vitest configurations for quisi.do", + "homepage": "https://github.com/quisido/quisi.do/tree/main/packages/vitest-config#readme", + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist/index.js", + "repository": "github:quisido/quisi.do", + "type": "module", + "types": "./dist/index.d.ts", + "bugs": { + "email": "vitest-config@quisi.do", + "url": "https://github.com/quisido/quisi.do/issues" + }, + "funding": { + "type": "", + "url": "https://github.com/sponsors/quisido" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "attw": "attw --quiet", + "clean": "rm -rf coverage dist node_modules && rm -f tsconfig.prepack.tsbuildinfo tsc-output.cpuprofile", + "eslint": "eslint . --cache --color --exit-on-fatal-error --max-warnings 0", + "eslint:fix": "eslint . --cache --color --exit-on-fatal-error --fix --max-warnings 0", + "prepack": "yarn run tsc", + "prepublish": "concurrently --kill-others-on-fail --names attw,eslint \"yarn run attw\" \"yarn run eslint\"", + "tsc": "tsc --generateCpuProfile tsc-output.cpuprofile --project tsconfig.prepack.json", + "vitest": "vitest", + "vitest:run": "vitest run", + "vitest:watch": "vitest watch" + }, + "dependencies": { + "@eslint/js": "^9.1.1", + "@types/eslint": "^8.56.10", + "@types/eslint-config-prettier": "^6.11.3", + "@types/eslint__js": "^8.42.3", + "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", + "@typescript-eslint/parser": "^7.7.0", + "typescript-eslint": "patch:typescript-eslint@npm%3A7.7.0#~/.yarn/patches/typescript-eslint-npm-7.7.0-1c6d9ccc41.patch" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.3", + "@babel/core": "^7.24.4", + "@babel/preset-env": "^7.24.4", + "@babel/preset-react": "^7.24.1", + "@babel/preset-typescript": "^7.24.1", + "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^20.12.7", + "@vitest/coverage-istanbul": "^1.6.0", + "babel-plugin-replace-import-extension": "^1.1.4", + "cjs-ts": "workspace:^", + "concurrently": "^8.2.2", + "eslint": "^9.1.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", + "prettier": "^3.2.5", + "tslib": "^2.6.2", + "typescript": "^5.4.5", + "vite": "^5.2.11", + "vitest": "^1.6.0" + }, + "peerDependencies": { + "eslint": "^9.0.0", + "vite": "^5.0.0", + "vitest": "^1.0.0" + } +} diff --git a/packages/vitest-config/src/coverage-options.ts b/packages/vitest-config/src/coverage-options.ts new file mode 100644 index 000000000..7da87fe0b --- /dev/null +++ b/packages/vitest-config/src/coverage-options.ts @@ -0,0 +1,13 @@ +import type { CoverageOptions } from "vitest"; +import { EXCLUDE } from "./exclude.js"; +import { THRESHOLDS } from "./thresholds.js"; + +export const COVERAGE_OPTIONS: CoverageOptions = { + all: true, + clean: true, + enabled: true, + exclude: [...EXCLUDE], + provider: 'istanbul', + skipFull: true, + thresholds: THRESHOLDS, +}; diff --git a/packages/next/src/test/exclude.ts b/packages/vitest-config/src/exclude.ts similarity index 58% rename from packages/next/src/test/exclude.ts rename to packages/vitest-config/src/exclude.ts index 30cb491e2..4897d2df0 100644 --- a/packages/next/src/test/exclude.ts +++ b/packages/vitest-config/src/exclude.ts @@ -1,9 +1,15 @@ +import { defaultExclude } from "vitest/config"; + export const EXCLUDE: readonly string[] = [ + ...defaultExclude, '.next/**', + '.yarn/**', '.wrangler/**', 'certificates/**', 'coverage/**', 'cypress/**', + 'dist/**', 'out/**', + 'packages/**', '*.config.*', ]; diff --git a/packages/vitest-config/src/index.ts b/packages/vitest-config/src/index.ts new file mode 100644 index 000000000..0184b60f2 --- /dev/null +++ b/packages/vitest-config/src/index.ts @@ -0,0 +1,17 @@ +import type { UserConfig } from 'vite'; +import { defineConfig } from 'vitest/config'; +import { INLINE_CONFIG } from './inline-config.js'; +import { PLUGIN_OPTIONS } from './plugin-options.js'; + +export { COVERAGE_OPTIONS } from './coverage-options.js'; +export { EXCLUDE } from './exclude.js'; +export { INLINE_CONFIG } from './inline-config.js'; +export { PLUGIN_OPTIONS } from './plugin-options.js'; +export { THRESHOLDS } from './thresholds.js'; + +const USER_CONFIG: UserConfig = defineConfig({ + plugins: PLUGIN_OPTIONS, + test: INLINE_CONFIG, +}); + +export default USER_CONFIG; diff --git a/packages/vitest-config/src/inline-config.ts b/packages/vitest-config/src/inline-config.ts new file mode 100644 index 000000000..522465a9a --- /dev/null +++ b/packages/vitest-config/src/inline-config.ts @@ -0,0 +1,12 @@ +import type { InlineConfig } from "vitest"; +import { COVERAGE_OPTIONS } from "./coverage-options.js"; +import { EXCLUDE } from "./exclude.js"; + +export const INLINE_CONFIG: InlineConfig = { + clearMocks: true, + coverage: COVERAGE_OPTIONS, + environment: 'node', + exclude: [...EXCLUDE], + mockReset: true, + restoreMocks: true, +}; diff --git a/packages/vitest-config/src/plugin-options.ts b/packages/vitest-config/src/plugin-options.ts new file mode 100644 index 000000000..d143c7661 --- /dev/null +++ b/packages/vitest-config/src/plugin-options.ts @@ -0,0 +1,5 @@ +import type { UserConfig } from 'vitest/config'; + +type PluginOptions = Required['plugins']; + +export const PLUGIN_OPTIONS: PluginOptions = []; diff --git a/packages/vitest-config/src/thresholds.ts b/packages/vitest-config/src/thresholds.ts new file mode 100644 index 000000000..96edb899a --- /dev/null +++ b/packages/vitest-config/src/thresholds.ts @@ -0,0 +1,10 @@ +import type { BaseCoverageOptions } from "vitest"; + +type Thresholds = Required['thresholds']; + +export const THRESHOLDS: Thresholds = { + branches: 100, + functions: 100, + lines: 100, + statements: 100, +}; diff --git a/packages/vitest-config/tsconfig.json b/packages/vitest-config/tsconfig.json new file mode 100644 index 000000000..72d637ad9 --- /dev/null +++ b/packages/vitest-config/tsconfig.json @@ -0,0 +1,11 @@ +{ + "exclude": ["coverage/", "dist/", "node_modules/"], + "extends": "../../tsconfig.json", + "include": ["**/*.ts", "**/*.tsx"], + "compilerOptions": { + "lib": ["DOM", "ESNext"], + "noEmit": true, + "rootDir": ".", + "sourceRoot": "." + } +} diff --git a/packages/vitest-config/tsconfig.prepack.json b/packages/vitest-config/tsconfig.prepack.json new file mode 100644 index 000000000..6fac69665 --- /dev/null +++ b/packages/vitest-config/tsconfig.prepack.json @@ -0,0 +1,12 @@ +{ + "exclude": ["src/**/*.test.ts", "src/test/"], + "extends": "./tsconfig.json", + "include": ["src/"], + "compilerOptions": { + "declarationDir": "dist", + "noEmit": false, + "outDir": "dist", + "rootDir": "src", + "sourceRoot": "https://github.com/quisido/quisi.do/raw/main/packages/eslint-config/src/" + } +} diff --git a/packages/vitest-config/vitest.config.ts b/packages/vitest-config/vitest.config.ts new file mode 100644 index 000000000..957ca4697 --- /dev/null +++ b/packages/vitest-config/vitest.config.ts @@ -0,0 +1 @@ +export { default } from './src/index.js'; diff --git a/packages/workers-shared/eslint.config.js b/packages/workers-shared/eslint.config.js index 6eba15ef1..616d47a6a 100644 --- a/packages/workers-shared/eslint.config.js +++ b/packages/workers-shared/eslint.config.js @@ -6,9 +6,9 @@ export default [ { files: [ - 'src/constants/account-number.ts', - 'src/constants/product.ts', - 'src/constants/usage-type.ts', + 'src/account-number.ts', + 'src/product.ts', + 'src/usage-type.ts', ], rules: { diff --git a/packages/workers-shared/jest.config.cjs b/packages/workers-shared/jest.config.cjs deleted file mode 100644 index 43b2e378c..000000000 --- a/packages/workers-shared/jest.config.cjs +++ /dev/null @@ -1,2 +0,0 @@ -require('cjs-ts'); -module.exports = require('./jest.config.ts').default; diff --git a/packages/workers-shared/package.json b/packages/workers-shared/package.json index 16cc777e9..2d92dfc51 100644 --- a/packages/workers-shared/package.json +++ b/packages/workers-shared/package.json @@ -1,6 +1,6 @@ { "name": "@quisido/workers-shared", - "version": "1.1.0", + "version": "1.2.0", "author": "quisi.do ", "description": "shared quisi.do Cloudflare workers modules", "homepage": "https://github.com/quisido/quisi.do/tree/main/packages/workers-shared#readme", @@ -39,8 +39,8 @@ "@babel/preset-react": "^7.24.1", "@babel/preset-typescript": "^7.24.1", "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@monorepo-template/eslint-config": "^1.0.7", "@quisido/eslint-config": "workspace:^", + "@quisido/vitest-config": "workspace:^", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch", "@typescript-eslint/parser": "^7.7.0", @@ -56,6 +56,10 @@ "prettier": "^3.2.5", "tslib": "^2.6.2", "typescript": "^5.4.5", + "vite": "^5.2.11", "vitest": "^1.6.0" + }, + "dependencies": { + "@cloudflare/workers-types": "^4.20240512.0" } } diff --git a/packages/workers-shared/src/constants/account-number.test.ts b/packages/workers-shared/src/account-number.test.ts similarity index 74% rename from packages/workers-shared/src/constants/account-number.test.ts rename to packages/workers-shared/src/account-number.test.ts index c8bef97db..ef464cf12 100644 --- a/packages/workers-shared/src/constants/account-number.test.ts +++ b/packages/workers-shared/src/account-number.test.ts @@ -1,8 +1,8 @@ import { isNumber, sortUnknown } from 'fmrs'; import { describe, expect, it } from 'vitest'; -import { AccountNumber } from '../index.js'; -import createAscendingArray from '../test/create-ascending-array.js'; -import increment from '../test/increment.js'; +import { AccountNumber } from './index.js'; +import createAscendingArray from './test/create-ascending-array.js'; +import increment from './test/increment.js'; const VALUES: readonly number[] = Object.values(AccountNumber).filter(isNumber); const ASCENDING_ARRAY: readonly number[] = diff --git a/packages/workers-shared/src/constants/account-number.ts b/packages/workers-shared/src/account-number.ts similarity index 100% rename from packages/workers-shared/src/constants/account-number.ts rename to packages/workers-shared/src/account-number.ts diff --git a/packages/workers-shared/src/index.ts b/packages/workers-shared/src/index.ts index 17592067d..aacecc429 100644 --- a/packages/workers-shared/src/index.ts +++ b/packages/workers-shared/src/index.ts @@ -1,4 +1,4 @@ -export { AccountNumber } from "./constants/account-number.js"; -export { Product } from "./constants/product.js"; -export { UsageType } from "./constants/usage-type.js"; +export { AccountNumber } from "./account-number.js"; +export { Product } from "./product.js"; +export { UsageType } from "./usage-type.js"; diff --git a/packages/workers-shared/src/constants/product.test.ts b/packages/workers-shared/src/product.test.ts similarity index 79% rename from packages/workers-shared/src/constants/product.test.ts rename to packages/workers-shared/src/product.test.ts index 69353a4f2..e3ef73ca3 100644 --- a/packages/workers-shared/src/constants/product.test.ts +++ b/packages/workers-shared/src/product.test.ts @@ -1,7 +1,7 @@ import { isNumber, sortUnknown } from 'fmrs'; import { describe, expect, it } from 'vitest'; -import { Product } from '../index.js'; -import createAscendingArray from '../test/create-ascending-array.js'; +import { Product } from './index.js'; +import createAscendingArray from './test/create-ascending-array.js'; const VALUES: readonly number[] = Object.values(Product).filter(isNumber); const ASCENDING_ARRAY: readonly number[] = createAscendingArray(VALUES.length); diff --git a/packages/workers-shared/src/constants/product.ts b/packages/workers-shared/src/product.ts similarity index 100% rename from packages/workers-shared/src/constants/product.ts rename to packages/workers-shared/src/product.ts diff --git a/packages/workers-shared/src/constants/usage-type.test.ts b/packages/workers-shared/src/usage-type.test.ts similarity index 79% rename from packages/workers-shared/src/constants/usage-type.test.ts rename to packages/workers-shared/src/usage-type.test.ts index a97d3fe82..a11fceecc 100644 --- a/packages/workers-shared/src/constants/usage-type.test.ts +++ b/packages/workers-shared/src/usage-type.test.ts @@ -1,7 +1,7 @@ import { isNumber, sortUnknown } from 'fmrs'; import { describe, expect, it } from 'vitest'; -import { UsageType } from '../index.js'; -import createAscendingArray from '../test/create-ascending-array.js'; +import { UsageType } from './index.js'; +import createAscendingArray from './test/create-ascending-array.js'; const VALUES: readonly number[] = Object.values(UsageType).filter(isNumber); const ASCENDING_ARRAY: readonly number[] = createAscendingArray(VALUES.length); diff --git a/packages/workers-shared/src/constants/usage-type.ts b/packages/workers-shared/src/usage-type.ts similarity index 100% rename from packages/workers-shared/src/constants/usage-type.ts rename to packages/workers-shared/src/usage-type.ts diff --git a/packages/workers-shared/vitest.config.ts b/packages/workers-shared/vitest.config.ts index 209fa9973..b7dc4e259 100644 --- a/packages/workers-shared/vitest.config.ts +++ b/packages/workers-shared/vitest.config.ts @@ -1,25 +1 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/quisido.code-workspace b/quisido.code-workspace index 7a4af0612..f370bd86a 100644 --- a/quisido.code-workspace +++ b/quisido.code-workspace @@ -24,6 +24,10 @@ "name": "aws-rum-react", "path": "packages/aws-rum-react", }, + { + "name": "cloudflare-utils", + "path": "packages/cloudflare-utils", + }, { "name": "cjs-ts", "path": "packages/cjs-ts", @@ -76,6 +80,10 @@ "name": "use-shallow-memo", "path": "packages/use-shallow-memo", }, + { + "name": "vitest-config", + "path": "packages/vitest-config", + }, { "name": "workers-shared", "path": "packages/workers-shared", diff --git a/tsconfig.json b/tsconfig.json index 61b03f6a4..5c6304617 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,8 +13,8 @@ // "mapRoot": "../dist", // "outDir": "dist", // "reactNamespace": "React", - // "rootDir": "src", - // "sourceRoot": "src", + // "rootDir": ".", + // "sourceRoot": ".", // "typeRoots": [], // "watch": false, // "watchDirectory": "useFsEvents", diff --git a/vitest.config.ts b/vitest.config.ts index bf44bd548..b7dc4e259 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,26 +1 @@ -import { defaultExclude, defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - clearMocks: true, - environment: 'node', - exclude: [...defaultExclude, '.yarn/**', 'coverage/**', 'packages/**'], - mockReset: true, - restoreMocks: true, - - coverage: { - all: true, - clean: true, - enabled: true, - provider: 'istanbul', - skipFull: true, - - thresholds: { - branches: 100, - functions: 100, - lines: 100, - statements: 100, - }, - }, - }, -}); +export { default } from '@quisido/vitest-config'; diff --git a/yarn.lock b/yarn.lock index bf0071615..8bc58e2ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2650,10 +2650,10 @@ __metadata: languageName: node linkType: hard -"@cloudflare/workers-types@npm:^4.20240419.0": - version: 4.20240419.0 - resolution: "@cloudflare/workers-types@npm:4.20240419.0" - checksum: 10c0/e84f7bb16fb0d929dd91f9e0917f4c6f628b6b33d6894229fabd24350c28cfab2b632b605d5ac81eb56a9af096d9179488b4522d6ed9cc772c3d71a4e8f33717 +"@cloudflare/workers-types@npm:^4.20240512.0": + version: 4.20240512.0 + resolution: "@cloudflare/workers-types@npm:4.20240512.0" + checksum: 10c0/2121867705db9b5e8e44e8d7baf6c3982e7ce41e9e01ea2d2502b7f00c73859a17b23cfcc79c88c5a55c725229d36c5cc6a5d3399ffd62f8be72c2f48ab7c128 languageName: node linkType: hard @@ -4147,32 +4147,6 @@ __metadata: languageName: node linkType: hard -"@monorepo-template/eslint-config@npm:^1.0.7": - version: 1.0.7 - resolution: "@monorepo-template/eslint-config@npm:1.0.7" - dependencies: - "@typescript-eslint/eslint-plugin": "npm:^5.45.0" - "@typescript-eslint/parser": "npm:^5.45.0" - eslint-plugin-jsx-a11y: "npm:^6.6.1" - eslint-plugin-react: "npm:^7.31.11" - eslint-plugin-react-hooks: "npm:^4.6.0" - peerDependencies: - eslint: ">=8.0.0" - dependenciesMeta: - "@typescript-eslint/eslint-plugin": - optional: true - "@typescript-eslint/parser": - optional: true - eslint-plugin-jsx-a11y: - optional: true - eslint-plugin-react: - optional: true - eslint-plugin-react-hooks: - optional: true - checksum: 10c0/1c61c54ac15ea4ab9cba09710066ff1e0b475a17d17a873010d452790e5cabcba31412af74679957034454a5d9cc530a333c7b409268bdb6d37aca4e1a3bfea1 - languageName: node - linkType: hard - "@monorepo-template/ignore-cypress-dependency-logs@npm:^1.0.0": version: 1.0.0 resolution: "@monorepo-template/ignore-cypress-dependency-logs@npm:1.0.0" @@ -4201,9 +4175,9 @@ __metadata: dependencies: "@arethetypeswrong/cli": "npm:^0.15.3" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@monorepo-template/tree-logger": "workspace:^" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/js-yaml": "npm:^4.0.9" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" @@ -4220,6 +4194,7 @@ __metadata: prettier: "npm:^3.2.5" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" bin: monorepo-template-test: ./dist/bin/test.js @@ -4232,8 +4207,8 @@ __metadata: dependencies: "@arethetypeswrong/cli": "npm:^0.15.3" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" "@typescript-eslint/parser": "npm:^7.7.0" @@ -4249,6 +4224,7 @@ __metadata: prettier: "npm:^3.2.5" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" languageName: unknown linkType: soft @@ -4961,9 +4937,9 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@eslint/js": "npm:^9.1.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@monorepo-template/test": "workspace:^" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/babel__core": "npm:^7.20.5" "@types/babel__preset-env": "npm:^7.9.6" "@types/eslint": "npm:^8.56.10" @@ -5000,6 +4976,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" "@typescript-eslint/parser": "npm:^7.7.0" @@ -5015,6 +4992,7 @@ __metadata: prettier: "npm:^3.2.5" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" languageName: unknown linkType: soft @@ -5027,16 +5005,18 @@ __metadata: "@babel/preset-env": "npm:^7.24.4" "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" - "@cloudflare/workers-types": "npm:^4.20240419.0" + "@cloudflare/workers-types": "npm:^4.20240512.0" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" "@quisido/authn-shared": "workspace:^" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@quisido/workers-shared": "workspace:^" "@types/cookie": "npm:^0.6.0" "@types/eslint": "npm:^8.56.10" "@vitest/coverage-istanbul": "npm:^1.6.0" babel-plugin-replace-import-extension: "npm:^1.1.4" cjs-ts: "workspace:^" + cloudflare-utils: "workspace:^" concurrently: "npm:^8.2.2" cookie: "npm:^0.6.0" eslint: "npm:^9.1.1" @@ -5045,6 +5025,7 @@ __metadata: proposal-async-context: "https://github.com/tc39/proposal-async-context" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" wrangler: "npm:^3.51.2" languageName: unknown @@ -5058,16 +5039,20 @@ __metadata: "@babel/preset-env": "npm:^7.24.4" "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" - "@cloudflare/workers-types": "npm:^4.20240419.0" + "@cloudflare/workers-types": "npm:^4.20240512.0" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" + "@quisido/workers-shared": "workspace:^" "@types/eslint": "npm:^8.56.10" "@vitest/coverage-istanbul": "npm:^1.6.0" babel-plugin-replace-import-extension: "npm:^1.1.4" cjs-ts: "workspace:^" + cloudflare-utils: "workspace:^" concurrently: "npm:^8.2.2" eslint: "npm:^9.1.1" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" wrangler: "npm:^3.51.2" languageName: unknown @@ -5130,7 +5115,6 @@ __metadata: "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" "@monorepo-template/coverage": "npm:^1.2.3" "@monorepo-template/cypress-coverage-plugin": "npm:^1.0.7" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@monorepo-template/ignore-cypress-dependency-logs": "npm:^1.0.0" "@mui/icons-material": "npm:^5.15.15" "@mui/material": "npm:^5.15.15" @@ -5153,6 +5137,7 @@ __metadata: "@opentelemetry/semantic-conventions": "npm:^1.23.0" "@quisido/authn-shared": "workspace:^" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@react-aria/button": "npm:^3.9.3" "@react-aria/link": "npm:^3.6.5" "@react-aria/overlays": "npm:^3.21.1" @@ -5229,6 +5214,44 @@ __metadata: languageName: unknown linkType: soft +"@quisido/vitest-config@workspace:^, @quisido/vitest-config@workspace:packages/vitest-config": + version: 0.0.0-use.local + resolution: "@quisido/vitest-config@workspace:packages/vitest-config" + dependencies: + "@arethetypeswrong/cli": "npm:^0.15.3" + "@babel/core": "npm:^7.24.4" + "@babel/preset-env": "npm:^7.24.4" + "@babel/preset-react": "npm:^7.24.1" + "@babel/preset-typescript": "npm:^7.24.1" + "@eslint/js": "npm:^9.1.1" + "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" + "@types/eslint": "npm:^8.56.10" + "@types/eslint-config-prettier": "npm:^6.11.3" + "@types/eslint__js": "npm:^8.42.3" + "@types/node": "npm:^20.12.7" + "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" + "@typescript-eslint/parser": "npm:^7.7.0" + "@vitest/coverage-istanbul": "npm:^1.6.0" + babel-plugin-replace-import-extension: "npm:^1.1.4" + cjs-ts: "workspace:^" + concurrently: "npm:^8.2.2" + eslint: "npm:^9.1.1" + eslint-config-prettier: "npm:^9.1.0" + eslint-plugin-import: "npm:^2.29.1" + eslint-plugin-prettier: "npm:^5.1.3" + prettier: "npm:^3.2.5" + tslib: "npm:^2.6.2" + typescript: "npm:^5.4.5" + typescript-eslint: "patch:typescript-eslint@npm%3A7.7.0#~/.yarn/patches/typescript-eslint-npm-7.7.0-1c6d9ccc41.patch" + vite: "npm:^5.2.11" + vitest: "npm:^1.6.0" + peerDependencies: + eslint: ^9.0.0 + vite: ^5.0.0 + vitest: ^1.0.0 + languageName: unknown + linkType: soft + "@quisido/workers-shared@workspace:^, @quisido/workers-shared@workspace:packages/workers-shared": version: 0.0.0-use.local resolution: "@quisido/workers-shared@workspace:packages/workers-shared" @@ -5238,9 +5261,10 @@ __metadata: "@babel/preset-env": "npm:^7.24.4" "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" + "@cloudflare/workers-types": "npm:^4.20240512.0" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" "@typescript-eslint/parser": "npm:^7.7.0" @@ -5256,6 +5280,7 @@ __metadata: prettier: "npm:^3.2.5" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" languageName: unknown linkType: soft @@ -7014,23 +7039,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.45.0": - version: 5.62.0 - resolution: "@typescript-eslint/parser@npm:5.62.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/typescript-estree": "npm:5.62.0" - debug: "npm:^4.3.4" - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/315194b3bf39beb9bd16c190956c46beec64b8371e18d6bb72002108b250983eb1e186a01d34b77eb4045f4941acbb243b16155fbb46881105f65e37dc9e24d4 - languageName: node - linkType: hard - "@typescript-eslint/parser@npm:^7.0.2": version: 7.8.0 resolution: "@typescript-eslint/parser@npm:7.8.0" @@ -7049,16 +7057,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/scope-manager@npm:5.62.0" - dependencies: - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/visitor-keys": "npm:5.62.0" - checksum: 10c0/861253235576c1c5c1772d23cdce1418c2da2618a479a7de4f6114a12a7ca853011a1e530525d0931c355a8fd237b9cd828fac560f85f9623e24054fd024726f - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/scope-manager@npm:6.21.0" @@ -7133,13 +7131,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/types@npm:5.62.0" - checksum: 10c0/7febd3a7f0701c0b927e094f02e82d8ee2cada2b186fcb938bc2b94ff6fbad88237afc304cbaf33e82797078bbbb1baf91475f6400912f8b64c89be79bfa4ddf - languageName: node - linkType: hard - "@typescript-eslint/types@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/types@npm:6.21.0" @@ -7168,24 +7159,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" - dependencies: - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/visitor-keys": "npm:5.62.0" - debug: "npm:^4.3.4" - globby: "npm:^11.1.0" - is-glob: "npm:^4.0.3" - semver: "npm:^7.3.7" - tsutils: "npm:^3.21.0" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/d7984a3e9d56897b2481940ec803cb8e7ead03df8d9cfd9797350be82ff765dfcf3cfec04e7355e1779e948da8f02bc5e11719d07a596eb1cb995c48a95e38cf - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" @@ -7313,16 +7286,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" - dependencies: - "@typescript-eslint/types": "npm:5.62.0" - eslint-visitor-keys: "npm:^3.3.0" - checksum: 10c0/7c3b8e4148e9b94d9b7162a596a1260d7a3efc4e65199693b8025c71c4652b8042501c0bc9f57654c1e2943c26da98c0f77884a746c6ae81389fcb0b513d995d - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/visitor-keys@npm:6.21.0" @@ -8304,8 +8267,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/babel__core": "npm:^7.20.5" "@types/babel__preset-env": "npm:^7.9.6" @@ -8331,6 +8294,7 @@ __metadata: react-dom: "npm:^18.2.0" typescript: "npm:^5.4.5" unknown2string: "workspace:^" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" whatwg-fetch: "npm:^3.6.20" peerDependencies: @@ -9249,6 +9213,31 @@ __metadata: languageName: node linkType: hard +"cloudflare-utils@workspace:^, cloudflare-utils@workspace:packages/cloudflare-utils": + version: 0.0.0-use.local + resolution: "cloudflare-utils@workspace:packages/cloudflare-utils" + dependencies: + "@arethetypeswrong/cli": "npm:^0.15.3" + "@cloudflare/workers-types": "npm:^4.20240512.0" + "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" + "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" + "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" + "@typescript-eslint/parser": "npm:^7.7.0" + "@vitest/coverage-istanbul": "npm:^1.6.0" + concurrently: "npm:^8.2.2" + eslint: "npm:^9.1.1" + eslint-config-prettier: "npm:^9.1.0" + eslint-plugin-import: "npm:^2.29.1" + eslint-plugin-prettier: "npm:^5.1.3" + prettier: "npm:^3.2.5" + tslib: "npm:^2.6.2" + typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" + vitest: "npm:^1.6.0" + languageName: unknown + linkType: soft + "clsx@npm:^2.0.0, clsx@npm:^2.1.0": version: 2.1.0 resolution: "clsx@npm:2.1.0" @@ -10898,7 +10887,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-jsx-a11y@npm:^6.6.1, eslint-plugin-jsx-a11y@npm:^6.7.1, eslint-plugin-jsx-a11y@npm:^6.8.0": +"eslint-plugin-jsx-a11y@npm:^6.7.1, eslint-plugin-jsx-a11y@npm:^6.8.0": version: 6.8.0 resolution: "eslint-plugin-jsx-a11y@npm:6.8.0" dependencies: @@ -10962,7 +10951,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react@npm:^7.31.11, eslint-plugin-react@npm:^7.33.2, eslint-plugin-react@npm:^7.34.1": +"eslint-plugin-react@npm:^7.33.2, eslint-plugin-react@npm:^7.34.1": version: 7.34.1 resolution: "eslint-plugin-react@npm:7.34.1" dependencies: @@ -11650,8 +11639,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" "@typescript-eslint/parser": "npm:^7.7.0" @@ -11667,6 +11656,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" unknown2string: "workspace:^" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" languageName: unknown linkType: soft @@ -11850,8 +11840,8 @@ __metadata: "@fullstory/browser": "npm:^2.0.4" "@fullstory/snippet": "npm:^2.0.4" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/babel__core": "npm:^7.20.5" "@types/babel__preset-env": "npm:^7.9.6" @@ -11877,6 +11867,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" use-shallow-memo: "workspace:^" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: react: ">=17.0.0" @@ -13794,6 +13785,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/babel__core": "npm:^7.20.5" "@types/babel__preset-env": "npm:^7.9.6" @@ -13819,6 +13811,7 @@ __metadata: sass: "npm:^1.77.2" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: react: ">=17.0.0" @@ -14568,8 +14561,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/node": "npm:^20.12.7" "@types/react": "npm:^18.2.79" @@ -14596,6 +14589,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" use-force-update: "npm:^1.0.11" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: "@awsui/components-react": ">=3.0.0" @@ -14950,8 +14944,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/node": "npm:^20.12.7" "@types/react": "npm:^18.2.79" @@ -14973,6 +14967,7 @@ __metadata: react-dom: "npm:^18.2.0" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: react: ">=16.8.0" @@ -16006,8 +16001,8 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@datadog/browser-rum": "npm:^5.15.0" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/node": "npm:^20.12.7" "@types/react": "npm:^18.2.79" @@ -16025,6 +16020,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" use-shallow-memo: "workspace:^" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: "@datadog/browser-rum": ^5.0.0 @@ -16827,7 +16823,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.0, semver@npm:^7.0.0, semver@npm:^7.1.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": +"semver@npm:7.6.0, semver@npm:^7.0.0, semver@npm:^7.1.2, semver@npm:^7.3.5, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": version: 7.6.0 resolution: "semver@npm:7.6.0" dependencies: @@ -16866,8 +16862,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@sentry/browser": "npm:^7.111.0" "@sentry/react": "npm:^7.111.0" "@sentry/types": "npm:^7.111.0" @@ -16896,6 +16892,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" use-shallow-memo: "workspace:^" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: react: ">=18.0.0" @@ -18090,7 +18087,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.11.1, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": +"tslib@npm:^1.11.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 10c0/69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2 @@ -18104,17 +18101,6 @@ __metadata: languageName: node linkType: hard -"tsutils@npm:^3.21.0": - version: 3.21.0 - resolution: "tsutils@npm:3.21.0" - dependencies: - tslib: "npm:^1.8.1" - peerDependencies: - typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - checksum: 10c0/02f19e458ec78ead8fffbf711f834ad8ecd2cc6ade4ec0320790713dccc0a412b99e7fd907c4cda2a1dc602c75db6f12e0108e87a5afad4b2f9e90a24cabd5a2 - languageName: node - linkType: hard - "tunnel-agent@npm:^0.6.0": version: 0.6.0 resolution: "tunnel-agent@npm:0.6.0" @@ -18463,8 +18449,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@types/node": "npm:^20.12.7" "@typescript-eslint/eslint-plugin": "patch:@typescript-eslint/eslint-plugin@npm%3A7.7.0#~/.yarn/patches/@typescript-eslint-eslint-plugin-npm-7.7.0-de43f1e757.patch" "@typescript-eslint/parser": "npm:^7.7.0" @@ -18479,6 +18465,7 @@ __metadata: prettier: "npm:^3.2.5" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" languageName: unknown linkType: soft @@ -18570,8 +18557,8 @@ __metadata: "@babel/preset-react": "npm:^7.24.1" "@babel/preset-typescript": "npm:^7.24.1" "@microsoft/eslint-formatter-sarif": "npm:^3.1.0" - "@monorepo-template/eslint-config": "npm:^1.0.7" "@quisido/eslint-config": "workspace:^" + "@quisido/vitest-config": "workspace:^" "@testing-library/react": "npm:^15.0.7" "@types/node": "npm:^20.12.7" "@types/react": "npm:^18.2.79" @@ -18593,6 +18580,7 @@ __metadata: react-dom: "npm:^18.2.0" tslib: "npm:^2.6.2" typescript: "npm:^5.4.5" + vite: "npm:^5.2.11" vitest: "npm:^1.6.0" peerDependencies: react: ">=16.8.0"