From a631b905fc89991b308ad804af78cf599c6b5940 Mon Sep 17 00:00:00 2001 From: Matthieu Sieben Date: Tue, 13 Feb 2024 15:27:28 +0100 Subject: [PATCH] wip --- .eslintrc | 18 +- jest.config.base.js | 20 -- jest.config.js | 5 +- test-setup.ts => jest.setup.ts | 0 package.json | 12 +- packages/api/jest.config.js | 9 +- packages/api/jest.d.ts | 20 ++ packages/api/jest.setup.ts | 79 +++++++ packages/api/package.json | 3 +- packages/api/tests/moderation.test.ts | 1 - packages/api/tests/profile-moderation.test.ts | 2 + .../api/tests/util/moderation-behavior.ts | 82 +------- packages/api/tsconfig.tests.json | 1 + packages/aws/tsconfig.json | 5 +- packages/aws/tsconfig.tests.json | 8 - packages/bsky/jest.config.js | 8 +- packages/bsky/package.json | 1 + .../bsky/tests/auto-moderator/labeler.test.ts | 1 + packages/bsky/tests/duplicate-records.test.ts | 1 + .../bsky/tests/pipeline/backpressure.test.ts | 2 + packages/bsky/tests/subscription/repo.test.ts | 1 + packages/bsync/jest.config.js | 6 +- packages/bsync/package.json | 1 + packages/common-web/jest.config.js | 6 +- packages/common-web/package.json | 3 + packages/common/jest.config.js | 6 +- packages/common/package.json | 1 + packages/crypto/jest.config.js | 6 +- packages/crypto/package.json | 3 +- packages/identity/jest.config.js | 7 +- packages/identity/package.json | 3 +- packages/lex-cli/tsconfig.json | 5 +- packages/lex-cli/tsconfig.tests.json | 8 - packages/lexicon/jest.config.js | 7 +- packages/lexicon/package.json | 3 + packages/ozone/jest.config.js | 8 +- packages/ozone/package.json | 1 + packages/ozone/tests/db.test.ts | 5 + packages/ozone/tests/moderation.test.ts | 1 + packages/pds/jest.config.js | 8 +- packages/pds/package.json | 7 +- packages/pds/tests/account-deletion.test.ts | 1 + packages/pds/tests/account.test.ts | 2 + packages/pds/tests/blob-deletes.test.ts | 1 + packages/pds/tests/crud.test.ts | 1 + packages/pds/tests/email-confirmation.test.ts | 1 + packages/pds/tests/file-uploads.test.ts | 1 + packages/pds/tests/handles.test.ts | 1 + packages/pds/tests/invite-codes.test.ts | 1 + packages/pds/tests/races.test.ts | 1 + packages/pds/tests/sequencer.test.ts | 1 + .../pds/tests/sync/subscribe-repos.test.ts | 1 + packages/repo/jest.config.js | 6 +- packages/repo/package.json | 3 + packages/repo/tests/_util.ts | 4 + packages/syntax/jest.config.js | 6 +- packages/syntax/package.json | 3 + packages/xrpc-server/jest.config.js | 7 +- packages/xrpc-server/package.json | 1 + pnpm-lock.yaml | 195 ++++++++++++++++-- tsconfig.json | 34 +-- 61 files changed, 417 insertions(+), 228 deletions(-) delete mode 100644 jest.config.base.js rename test-setup.ts => jest.setup.ts (100%) create mode 100644 packages/api/jest.d.ts create mode 100644 packages/api/jest.setup.ts delete mode 100644 packages/aws/tsconfig.tests.json delete mode 100644 packages/lex-cli/tsconfig.tests.json diff --git a/.eslintrc b/.eslintrc index 193aab98490..650df576b78 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,15 +13,7 @@ "plugin:prettier/recommended", "prettier" ], - "ignorePatterns": [ - "dist", - "node_modules", - "jest.config.base.js", - "jest.bench.config.js", - "jest.config.js", - "build.js", - "update-pkg.js" - ], + "ignorePatterns": ["dist", "node_modules"], "rules": { "no-var": "error", "prefer-const": "warn", @@ -37,6 +29,14 @@ "@typescript-eslint/no-explicit-any": "off" }, "overrides": [ + { + "files": ["jest.config.js"], + "env": { "commonjs": true } + }, + { + "files": ["jest.setup.js"], + "env": { "jest": true } + }, { "files": "*.js", "rules": { diff --git a/jest.config.base.js b/jest.config.base.js deleted file mode 100644 index ee4e2799057..00000000000 --- a/jest.config.base.js +++ /dev/null @@ -1,20 +0,0 @@ -// Jest doesn't like ES modules, so we need to transpile them -// For each one, add them to this list, add them to -// "workspaces.nohoist" in the root package.json, and -// make sure that a babel.config.js is in the package root -const esModules = ['get-port', 'node-fetch'].join('|') - -// jestconfig.base.js -module.exports = { - roots: ['/src', '/tests'], - transform: { - '^.+\\.(t|j)s?$': '@swc/jest', - '^.+\\.hbs$': require.resolve('handlebars-jest'), - }, - transformIgnorePatterns: [`/node_modules/(?!${esModules})`], - testRegex: '(/tests/.*.(test|spec)).(jsx?|tsx?)$', - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], - setupFiles: ['/../../test-setup.ts'], - verbose: true, - testTimeout: 60000, -} diff --git a/jest.config.js b/jest.config.js index 2366503d1d3..d0126bea35b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,4 @@ -// jest.config.js -const base = require('./jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, projects: ['/packages/*/jest.config.js'], } diff --git a/test-setup.ts b/jest.setup.ts similarity index 100% rename from test-setup.ts rename to jest.setup.ts diff --git a/package.json b/package.json index fa8564e493b..124fd503228 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,14 @@ }, "scripts": { "lint:fix": "pnpm lint --fix", - "lint": "eslint . --ext .ts,.tsx", - "verify": "prettier --check . && pnpm lint", - "format": "prettier --write .", + "lint": "eslint . --ext .ts,.js", + "style:fix": "prettier --write .", + "style": "prettier --check .", + "verify": "npm-run-all -p verify:*", + "verify:style": "pnpm run style", + "verify:lint": "pnpm lint", + "verify:types": "tsc --build tsconfig.json", + "format": "npm-run-all *:fix", "build": "pnpm -r --stream build", "dev": "npm-run-all -p dev:*", "dev:tsc": "tsc --build tsconfig.json --watch", @@ -40,7 +45,6 @@ "eslint": "^8.24.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", - "handlebars-jest": "^1.0.0", "jest": "^28.1.2", "node-gyp": "^9.3.1", "npm-run-all": "^4.1.5", diff --git a/packages/api/jest.config.js b/packages/api/jest.config.js index d8abff65a6f..23994feaf41 100644 --- a/packages/api/jest.config.js +++ b/packages/api/jest.config.js @@ -1,6 +1,9 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'API', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + testTimeout: 60000, + setupFiles: ['/../../jest.setup.ts'], + setupFilesAfterEnv: ['/jest.setup.ts'], } diff --git a/packages/api/jest.d.ts b/packages/api/jest.d.ts new file mode 100644 index 00000000000..2fb3b38b470 --- /dev/null +++ b/packages/api/jest.d.ts @@ -0,0 +1,20 @@ +declare namespace jest { + // eslint-disable-next-line + interface Matchers { + toBeModerationResult( + expected: ModerationBehaviorResult | undefined, + context: string, + stringifiedResult: string, + ignoreCause?: boolean, + ): R + } + + interface Expect { + toBeModerationResult( + expected: ModerationBehaviorResult | undefined, + context: string, + stringifiedResult: string, + ignoreCause?: boolean, + ): void + } +} diff --git a/packages/api/jest.setup.ts b/packages/api/jest.setup.ts new file mode 100644 index 00000000000..eb2647bbb6c --- /dev/null +++ b/packages/api/jest.setup.ts @@ -0,0 +1,79 @@ +import { ModerationBehaviorResult } from './definitions/moderation-behaviors' +import { ModerationUI } from './src' + +expect.extend({ + toBeModerationResult( + actual: ModerationUI, + expected: ModerationBehaviorResult | undefined, + context: string, + stringifiedResult: string, + ignoreCause = false, + ) { + const fail = (msg: string) => ({ + pass: false, + message: () => `${msg}. Full result: ${stringifiedResult}`, + }) + let cause = actual.cause?.type as string + if (actual.cause?.type === 'label') { + cause = `label:${actual.cause.labelDef.id}` + } else if (actual.cause?.type === 'muted') { + if (actual.cause.source.type === 'list') { + cause = 'muted-by-list' + } + } else if (actual.cause?.type === 'blocking') { + if (actual.cause.source.type === 'list') { + cause = 'blocking-by-list' + } + } + if (!expected) { + if (!ignoreCause && actual.cause) { + return fail(`${context} expected to be a no-op, got ${cause}`) + } + if (actual.alert) { + return fail(`${context} expected to be a no-op, got alert=true`) + } + if (actual.blur) { + return fail(`${context} expected to be a no-op, got blur=true`) + } + if (actual.filter) { + return fail(`${context} expected to be a no-op, got filter=true`) + } + if (actual.noOverride) { + return fail(`${context} expected to be a no-op, got noOverride=true`) + } + } else { + if (!ignoreCause && cause !== expected.cause) { + return fail(`${context} expected to be ${expected.cause}, got ${cause}`) + } + if (!!actual.alert !== !!expected.alert) { + return fail( + `${context} expected to be alert=${expected.alert || false}, got ${ + actual.alert || false + }`, + ) + } + if (!!actual.blur !== !!expected.blur) { + return fail( + `${context} expected to be blur=${expected.blur || false}, got ${ + actual.blur || false + }`, + ) + } + if (!!actual.filter !== !!expected.filter) { + return fail( + `${context} expected to be filter=${expected.filter || false}, got ${ + actual.filter || false + }`, + ) + } + if (!!actual.noOverride !== !!expected.noOverride) { + return fail( + `${context} expected to be noOverride=${ + expected.noOverride || false + }, got ${actual.noOverride || false}`, + ) + } + } + return { pass: true, message: () => '' } + }, +}) diff --git a/packages/api/package.json b/packages/api/package.json index bbea7c11027..c69320526d9 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -34,6 +34,7 @@ }, "devDependencies": { "@atproto/lex-cli": "workspace:^", - "common-tags": "^1.8.2" + "common-tags": "^1.8.2", + "jest": "^28.1.2" } } diff --git a/packages/api/tests/moderation.test.ts b/packages/api/tests/moderation.test.ts index d9dd98086d8..130facf78db 100644 --- a/packages/api/tests/moderation.test.ts +++ b/packages/api/tests/moderation.test.ts @@ -1,6 +1,5 @@ import { moderateProfile, moderatePost } from '../src' import { mock } from './util' -import './util/moderation-behavior' describe('Moderation', () => { it('Applies self-labels on profiles according to the global preferences', () => { diff --git a/packages/api/tests/profile-moderation.test.ts b/packages/api/tests/profile-moderation.test.ts index bca63857c30..1a0711b3d31 100644 --- a/packages/api/tests/profile-moderation.test.ts +++ b/packages/api/tests/profile-moderation.test.ts @@ -26,11 +26,13 @@ describe('Post moderation behaviors', () => { suiteRunner.moderationOpts(scenario), ) expect(res.account).toBeModerationResult( + // @ts-expect-error FIXME remove this comment (and fix the TS error) scenario.behaviors.account, 'account', JSON.stringify(res, null, 2), ) expect(res.profile).toBeModerationResult( + // @ts-expect-error FIXME remove this comment (and fix the TS error) scenario.behaviors.profile, 'profile content', JSON.stringify(res, null, 2), diff --git a/packages/api/tests/util/moderation-behavior.ts b/packages/api/tests/util/moderation-behavior.ts index cc7a101e11f..ab6fe30686d 100644 --- a/packages/api/tests/util/moderation-behavior.ts +++ b/packages/api/tests/util/moderation-behavior.ts @@ -1,88 +1,10 @@ -import { ModerationUI, ModerationOpts, ComAtprotoLabelDefs } from '../../src' import type { - ModerationBehaviors, ModerationBehaviorScenario, - ModerationBehaviorResult, + ModerationBehaviors, } from '../../definitions/moderation-behaviors' +import { ComAtprotoLabelDefs, ModerationOpts } from '../../src' import { mock as m } from './index' -expect.extend({ - toBeModerationResult( - actual: ModerationUI, - expected: ModerationBehaviorResult | undefined, - context: string, - stringifiedResult: string, - ignoreCause = false, - ) { - const fail = (msg: string) => ({ - pass: false, - message: () => `${msg}. Full result: ${stringifiedResult}`, - }) - let cause = actual.cause?.type as string - if (actual.cause?.type === 'label') { - cause = `label:${actual.cause.labelDef.id}` - } else if (actual.cause?.type === 'muted') { - if (actual.cause.source.type === 'list') { - cause = 'muted-by-list' - } - } else if (actual.cause?.type === 'blocking') { - if (actual.cause.source.type === 'list') { - cause = 'blocking-by-list' - } - } - if (!expected) { - if (!ignoreCause && actual.cause) { - return fail(`${context} expected to be a no-op, got ${cause}`) - } - if (actual.alert) { - return fail(`${context} expected to be a no-op, got alert=true`) - } - if (actual.blur) { - return fail(`${context} expected to be a no-op, got blur=true`) - } - if (actual.filter) { - return fail(`${context} expected to be a no-op, got filter=true`) - } - if (actual.noOverride) { - return fail(`${context} expected to be a no-op, got noOverride=true`) - } - } else { - if (!ignoreCause && cause !== expected.cause) { - return fail(`${context} expected to be ${expected.cause}, got ${cause}`) - } - if (!!actual.alert !== !!expected.alert) { - return fail( - `${context} expected to be alert=${expected.alert || false}, got ${ - actual.alert || false - }`, - ) - } - if (!!actual.blur !== !!expected.blur) { - return fail( - `${context} expected to be blur=${expected.blur || false}, got ${ - actual.blur || false - }`, - ) - } - if (!!actual.filter !== !!expected.filter) { - return fail( - `${context} expected to be filter=${expected.filter || false}, got ${ - actual.filter || false - }`, - ) - } - if (!!actual.noOverride !== !!expected.noOverride) { - return fail( - `${context} expected to be noOverride=${ - expected.noOverride || false - }, got ${actual.noOverride || false}`, - ) - } - } - return { pass: true, message: () => '' } - }, -}) - export class ModerationBehaviorSuiteRunner { constructor(public suite: ModerationBehaviors) {} diff --git a/packages/api/tsconfig.tests.json b/packages/api/tsconfig.tests.json index edf7021535a..252baec9843 100644 --- a/packages/api/tsconfig.tests.json +++ b/packages/api/tsconfig.tests.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig/test.json", "compilerOptions": { "rootDir": "./", + "types": ["jest", "./jest.d.ts"], "noEmit": true }, "include": ["./tests"] diff --git a/packages/aws/tsconfig.json b/packages/aws/tsconfig.json index 1f3ab3c0ec4..e84b8178b47 100644 --- a/packages/aws/tsconfig.json +++ b/packages/aws/tsconfig.json @@ -1,7 +1,4 @@ { "include": [], - "references": [ - { "path": "./tsconfig.build.json" }, - { "path": "./tsconfig.tests.json" } - ] + "references": [{ "path": "./tsconfig.build.json" }] } diff --git a/packages/aws/tsconfig.tests.json b/packages/aws/tsconfig.tests.json deleted file mode 100644 index edf7021535a..00000000000 --- a/packages/aws/tsconfig.tests.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig/test.json", - "compilerOptions": { - "rootDir": "./", - "noEmit": true - }, - "include": ["./tests"] -} diff --git a/packages/bsky/jest.config.js b/packages/bsky/jest.config.js index 14720ce82eb..ee315e79d22 100644 --- a/packages/bsky/jest.config.js +++ b/packages/bsky/jest.config.js @@ -1,6 +1,8 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Bsky App View', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + testTimeout: 60000, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/bsky/package.json b/packages/bsky/package.json index 863821cf1ff..db9420a3bb7 100644 --- a/packages/bsky/package.json +++ b/packages/bsky/package.json @@ -75,6 +75,7 @@ "@types/pg": "^8.6.6", "@types/qs": "^6.9.7", "axios": "^0.27.2", + "jest": "^28.1.2", "ts-node": "^10.8.2" } } diff --git a/packages/bsky/tests/auto-moderator/labeler.test.ts b/packages/bsky/tests/auto-moderator/labeler.test.ts index 67a1c6b40e4..f9371f56ade 100644 --- a/packages/bsky/tests/auto-moderator/labeler.test.ts +++ b/packages/bsky/tests/auto-moderator/labeler.test.ts @@ -28,6 +28,7 @@ describe('labeler', () => { dbPostgresSchema: 'bsky_labeler', }) ozone = network.ozone + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.bsky.indexer.ctx const pdsCtx = network.pds.ctx autoMod = ctx.autoMod diff --git a/packages/bsky/tests/duplicate-records.test.ts b/packages/bsky/tests/duplicate-records.test.ts index 9c7617bd668..88e14442351 100644 --- a/packages/bsky/tests/duplicate-records.test.ts +++ b/packages/bsky/tests/duplicate-records.test.ts @@ -18,6 +18,7 @@ describe('duplicate record', () => { dbPostgresSchema: 'bsky_duplicates', }) db = network.bsky.indexer.ctx.db + // @ts-expect-error Error due to circular dependency with the dev-env package services = network.bsky.indexer.ctx.services did = 'did:example:alice' }) diff --git a/packages/bsky/tests/pipeline/backpressure.test.ts b/packages/bsky/tests/pipeline/backpressure.test.ts index 87e01b8cc89..b1ca8cff6c6 100644 --- a/packages/bsky/tests/pipeline/backpressure.test.ts +++ b/packages/bsky/tests/pipeline/backpressure.test.ts @@ -23,6 +23,7 @@ describe('pipeline backpressure', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: TEST_NAME, }) + // @ts-expect-error Error due to circular dependency with the dev-env package ingester = await getIngester(network, { name: TEST_NAME, ingesterPartitionCount: 2, @@ -55,6 +56,7 @@ describe('pipeline backpressure', () => { expect(lengths[0] + lengths[1]).toBeLessThanOrEqual(10 + 5) // not exact due to batching, may catch on following check backpressure // drain all items using indexers, releasing backpressure await indexers.start() + // @ts-expect-error Error due to circular dependency with the dev-env package await processAll(network, ingester) const lengthsFinal = await ingester.ctx.redis.streamLengths([ 'repo:0', diff --git a/packages/bsky/tests/subscription/repo.test.ts b/packages/bsky/tests/subscription/repo.test.ts index 481b2d2d422..52f5b58dc17 100644 --- a/packages/bsky/tests/subscription/repo.test.ts +++ b/packages/bsky/tests/subscription/repo.test.ts @@ -19,6 +19,7 @@ describe('sync', () => { network = await TestNetwork.create({ dbPostgresSchema: 'bsky_subscription_repo', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.bsky.ctx pdsAgent = network.pds.getClient() sc = network.getSeedClient() diff --git a/packages/bsync/jest.config.js b/packages/bsync/jest.config.js index 9abb11c632d..4ac7794c9ed 100644 --- a/packages/bsync/jest.config.js +++ b/packages/bsync/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Bsync', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/bsync/package.json b/packages/bsync/package.json index 44aa11e4159..edda1f89d88 100644 --- a/packages/bsync/package.json +++ b/packages/bsync/package.json @@ -43,6 +43,7 @@ "@bufbuild/protoc-gen-es": "^1.5.0", "@connectrpc/protoc-gen-connect-es": "^1.1.4", "@types/pg": "^8.6.6", + "jest": "^28.1.2", "ts-node": "^10.8.2" } } diff --git a/packages/common-web/jest.config.js b/packages/common-web/jest.config.js index 6beabf62b60..85f61f37aac 100644 --- a/packages/common-web/jest.config.js +++ b/packages/common-web/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Common Web', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/common-web/package.json b/packages/common-web/package.json index bc240c4a2c1..f993eb15842 100644 --- a/packages/common-web/package.json +++ b/packages/common-web/package.json @@ -23,5 +23,8 @@ "multiformats": "^9.9.0", "uint8arrays": "3.0.0", "zod": "^3.21.4" + }, + "devDependencies": { + "jest": "^28.1.2" } } diff --git a/packages/common/jest.config.js b/packages/common/jest.config.js index 33f1da33d80..18e79db079e 100644 --- a/packages/common/jest.config.js +++ b/packages/common/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Common', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/common/package.json b/packages/common/package.json index d50e029b8a2..a49c22aea86 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -28,6 +28,7 @@ "zod": "3.21.4" }, "devDependencies": { + "jest": "^28.1.2", "typescript": "^5.3.3", "uint8arrays": "3.0.0" } diff --git a/packages/crypto/jest.config.js b/packages/crypto/jest.config.js index 365131c9293..d5f37b722f9 100644 --- a/packages/crypto/jest.config.js +++ b/packages/crypto/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Crypto', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/crypto/package.json b/packages/crypto/package.json index e92e1d99007..16db0cc1046 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -25,6 +25,7 @@ "uint8arrays": "3.0.0" }, "devDependencies": { - "@atproto/common": "workspace:^" + "@atproto/common": "workspace:^", + "jest": "^28.1.2" } } diff --git a/packages/identity/jest.config.js b/packages/identity/jest.config.js index 4eb023d6fcc..768288c07bf 100644 --- a/packages/identity/jest.config.js +++ b/packages/identity/jest.config.js @@ -1,6 +1,7 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Identity', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/identity/package.json b/packages/identity/package.json index b697e4d73aa..30edc26cea9 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -31,6 +31,7 @@ "@did-plc/server": "^0.0.1", "cors": "^2.8.5", "express": "^4.18.2", - "get-port": "^6.1.2" + "get-port": "^6.1.2", + "jest": "^28.1.2" } } diff --git a/packages/lex-cli/tsconfig.json b/packages/lex-cli/tsconfig.json index 1f3ab3c0ec4..e84b8178b47 100644 --- a/packages/lex-cli/tsconfig.json +++ b/packages/lex-cli/tsconfig.json @@ -1,7 +1,4 @@ { "include": [], - "references": [ - { "path": "./tsconfig.build.json" }, - { "path": "./tsconfig.tests.json" } - ] + "references": [{ "path": "./tsconfig.build.json" }] } diff --git a/packages/lex-cli/tsconfig.tests.json b/packages/lex-cli/tsconfig.tests.json deleted file mode 100644 index edf7021535a..00000000000 --- a/packages/lex-cli/tsconfig.tests.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig/test.json", - "compilerOptions": { - "rootDir": "./", - "noEmit": true - }, - "include": ["./tests"] -} diff --git a/packages/lexicon/jest.config.js b/packages/lexicon/jest.config.js index ecdb2ae4b7c..cb439bdfb43 100644 --- a/packages/lexicon/jest.config.js +++ b/packages/lexicon/jest.config.js @@ -1,6 +1,7 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Lexicon', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/lexicon/package.json b/packages/lexicon/package.json index 7e987704740..0d536fc74b3 100644 --- a/packages/lexicon/package.json +++ b/packages/lexicon/package.json @@ -25,5 +25,8 @@ "iso-datestring-validator": "^2.2.2", "multiformats": "^9.9.0", "zod": "^3.21.4" + }, + "devDependencies": { + "jest": "^28.1.2" } } diff --git a/packages/ozone/jest.config.js b/packages/ozone/jest.config.js index 14720ce82eb..ee315e79d22 100644 --- a/packages/ozone/jest.config.js +++ b/packages/ozone/jest.config.js @@ -1,6 +1,8 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Bsky App View', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + testTimeout: 60000, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/ozone/package.json b/packages/ozone/package.json index a9a3e5d9cfa..40f83f4ea48 100644 --- a/packages/ozone/package.json +++ b/packages/ozone/package.json @@ -58,6 +58,7 @@ "@types/express-serve-static-core": "^4.17.36", "@types/pg": "^8.6.6", "@types/qs": "^6.9.7", + "jest": "^28.1.2", "ts-node": "^10.8.2" } } diff --git a/packages/ozone/tests/db.test.ts b/packages/ozone/tests/db.test.ts index 30ca5fde5ec..c15e7810fce 100644 --- a/packages/ozone/tests/db.test.ts +++ b/packages/ozone/tests/db.test.ts @@ -48,6 +48,7 @@ describe('db', () => { return await dbTxn.db .insertInto('repo_push_event') .values({ + // @ts-expect-error FIXME remove this comment (and fix the TS error) eventType: 'takedown', subjectDid: 'x', }) @@ -78,6 +79,7 @@ describe('db', () => { await dbTxn.db .insertInto('repo_push_event') .values({ + // @ts-expect-error FIXME remove this comment (and fix the TS error) eventType: 'takedown', subjectDid: 'y', }) @@ -124,6 +126,7 @@ describe('db', () => { leakedTx = dbTxn await dbTxn.db .insertInto('repo_push_event') + // @ts-expect-error FIXME remove this comment (and fix the TS error) .values({ eventType: 'takedown', subjectDid: 'a' }) .execute() throw new Error('test tx failed') @@ -132,6 +135,7 @@ describe('db', () => { const attempt = leakedTx?.db .insertInto('repo_push_event') + // @ts-expect-error FIXME remove this comment (and fix the TS error) .values({ eventType: 'takedown', subjectDid: 'b' }) .execute() await expect(attempt).rejects.toThrow('tx already failed') @@ -156,6 +160,7 @@ describe('db', () => { const query = dbTxn.db .insertInto('repo_push_event') .values({ + // @ts-expect-error FIXME remove this comment (and fix the TS error) eventType: 'takedown', subjectDid: name, }) diff --git a/packages/ozone/tests/moderation.test.ts b/packages/ozone/tests/moderation.test.ts index 7be35e6fea4..bb7b7e01908 100644 --- a/packages/ozone/tests/moderation.test.ts +++ b/packages/ozone/tests/moderation.test.ts @@ -810,6 +810,7 @@ describe('moderation', () => { // In the actual app, this will be instantiated and run on server startup const reverser = new EventReverser( network.ozone.ctx.db, + // @ts-expect-error Error due to circular dependency with the dev-env package network.ozone.ctx.modService, ) await reverser.findAndRevertDueActions() diff --git a/packages/pds/jest.config.js b/packages/pds/jest.config.js index e98e672e050..e66657f9546 100644 --- a/packages/pds/jest.config.js +++ b/packages/pds/jest.config.js @@ -1,6 +1,8 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'PDS', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + testTimeout: 60000, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/pds/package.json b/packages/pds/package.json index cf312193ae9..a1133b513ac 100644 --- a/packages/pds/package.json +++ b/packages/pds/package.json @@ -15,12 +15,6 @@ }, "main": "dist/index.js", "types": "dist/index.d.ts", - "exports": { - ".": { - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - }, "bin": "dist/bin.js", "scripts": { "codegen": "lex gen-server ./src/lexicon ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*", @@ -93,6 +87,7 @@ "esbuild": "^0.14.48", "esbuild-plugin-handlebars": "^1.0.3", "get-port": "^6.1.2", + "jest": "^28.1.2", "ts-node": "^10.8.2", "ws": "^8.12.0" } diff --git a/packages/pds/tests/account-deletion.test.ts b/packages/pds/tests/account-deletion.test.ts index cfcd5bf4c76..267902a057b 100644 --- a/packages/pds/tests/account-deletion.test.ts +++ b/packages/pds/tests/account-deletion.test.ts @@ -36,6 +36,7 @@ describe('account deletion', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'account_deletion', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx mailer = ctx.mailer agent = new AtpAgent({ service: network.pds.url }) diff --git a/packages/pds/tests/account.test.ts b/packages/pds/tests/account.test.ts index 70ca5abf741..73148cc985f 100644 --- a/packages/pds/tests/account.test.ts +++ b/packages/pds/tests/account.test.ts @@ -30,7 +30,9 @@ describe('account', () => { privacyPolicyUrl: 'https://example.com/privacy-policy', }, }) + // @ts-expect-error Error due to circular dependency with the dev-env package mailer = network.pds.ctx.mailer + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx idResolver = network.pds.ctx.idResolver agent = network.pds.getClient() diff --git a/packages/pds/tests/blob-deletes.test.ts b/packages/pds/tests/blob-deletes.test.ts index e40883afc95..73b466c8727 100644 --- a/packages/pds/tests/blob-deletes.test.ts +++ b/packages/pds/tests/blob-deletes.test.ts @@ -17,6 +17,7 @@ describe('blob deletes', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'blob_deletes', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() sc = network.getSeedClient() diff --git a/packages/pds/tests/crud.test.ts b/packages/pds/tests/crud.test.ts index 8ba409dc2d2..c19dbe6f9d0 100644 --- a/packages/pds/tests/crud.test.ts +++ b/packages/pds/tests/crud.test.ts @@ -35,6 +35,7 @@ describe('crud operations', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'crud', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() aliceAgent = network.pds.getClient() diff --git a/packages/pds/tests/email-confirmation.test.ts b/packages/pds/tests/email-confirmation.test.ts index 2f66b1939d2..d41ed587476 100644 --- a/packages/pds/tests/email-confirmation.test.ts +++ b/packages/pds/tests/email-confirmation.test.ts @@ -24,6 +24,7 @@ describe('email confirmation', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'email_confirmation', }) + // @ts-expect-error Error due to circular dependency with the dev-env package mailer = network.pds.ctx.mailer agent = network.pds.getClient() sc = network.getSeedClient() diff --git a/packages/pds/tests/file-uploads.test.ts b/packages/pds/tests/file-uploads.test.ts index 7cde753bfb0..2333630a5d6 100644 --- a/packages/pds/tests/file-uploads.test.ts +++ b/packages/pds/tests/file-uploads.test.ts @@ -23,6 +23,7 @@ describe('file uploads', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'file_uploads', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() sc = network.getSeedClient() diff --git a/packages/pds/tests/handles.test.ts b/packages/pds/tests/handles.test.ts index 3d6e5ecb41f..21141f45b89 100644 --- a/packages/pds/tests/handles.test.ts +++ b/packages/pds/tests/handles.test.ts @@ -35,6 +35,7 @@ describe('handles', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'handles', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx idResolver = new IdResolver({ plcUrl: ctx.cfg.identity.plcUrl }) agent = network.pds.getClient() diff --git a/packages/pds/tests/invite-codes.test.ts b/packages/pds/tests/invite-codes.test.ts index 90d16aad00b..f1066feb7d2 100644 --- a/packages/pds/tests/invite-codes.test.ts +++ b/packages/pds/tests/invite-codes.test.ts @@ -19,6 +19,7 @@ describe('account', () => { inviteEpoch: Date.now() - 3 * DAY, }, }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() }) diff --git a/packages/pds/tests/races.test.ts b/packages/pds/tests/races.test.ts index fc65dab664c..d595b2ef397 100644 --- a/packages/pds/tests/races.test.ts +++ b/packages/pds/tests/races.test.ts @@ -17,6 +17,7 @@ describe('races', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'races', }) + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() await agent.createAccount({ diff --git a/packages/pds/tests/sequencer.test.ts b/packages/pds/tests/sequencer.test.ts index 3d9fed7a152..fb899888dce 100644 --- a/packages/pds/tests/sequencer.test.ts +++ b/packages/pds/tests/sequencer.test.ts @@ -19,6 +19,7 @@ describe('sequencer', () => { network = await TestNetworkNoAppView.create({ dbPostgresSchema: 'sequencer', }) + // @ts-expect-error Error due to circular dependency with the dev-env package sequencer = network.pds.ctx.sequencer sc = network.getSeedClient() await userSeed(sc) diff --git a/packages/pds/tests/sync/subscribe-repos.test.ts b/packages/pds/tests/sync/subscribe-repos.test.ts index bc877ec11ee..c34f12c90e9 100644 --- a/packages/pds/tests/sync/subscribe-repos.test.ts +++ b/packages/pds/tests/sync/subscribe-repos.test.ts @@ -42,6 +42,7 @@ describe('repo subscribe repos', () => { }, }) serverHost = network.pds.url.replace('http://', '') + // @ts-expect-error Error due to circular dependency with the dev-env package ctx = network.pds.ctx agent = network.pds.getClient() sc = network.getSeedClient() diff --git a/packages/repo/jest.config.js b/packages/repo/jest.config.js index 57136979d86..3c34b5882cf 100644 --- a/packages/repo/jest.config.js +++ b/packages/repo/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Repo', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/repo/package.json b/packages/repo/package.json index ad043c9cd79..fce70a019ec 100644 --- a/packages/repo/package.json +++ b/packages/repo/package.json @@ -30,5 +30,8 @@ "multiformats": "^9.9.0", "uint8arrays": "3.0.0", "zod": "^3.21.4" + }, + "devDependencies": { + "jest": "^28.1.2" } } diff --git a/packages/repo/tests/_util.ts b/packages/repo/tests/_util.ts index 9942cff7568..206f2bad541 100644 --- a/packages/repo/tests/_util.ts +++ b/packages/repo/tests/_util.ts @@ -24,6 +24,7 @@ type IdMapping = Record export const randomCid = async (storage?: RepoStorage): Promise => { const block = await dataToCborBlock({ test: randomStr(50) }) if (storage) { + // @ts-expect-error FIXME remove this comment (and fix the TS error) await storage.putBlock(block.cid, block.bytes) } return block.cid @@ -189,6 +190,7 @@ export const pathsForOps = (ops: RecordWriteOp[]): RecordPath[] => export const saveMst = async (storage: RepoStorage, mst: MST): Promise => { const diff = await mst.getUnstoredBlocks() + // @ts-expect-error FIXME remove this comment (and fix the TS error) await storage.putMany(diff.blocks) return diff.root } @@ -215,6 +217,8 @@ export const addBadCommit = async ( sig: await keypair.sign(randomBytes(256)), } const commitCid = await newBlocks.add(commit) + + // @ts-expect-error FIXME remove this comment (and fix the TS error) await repo.storage.applyCommit({ cid: commitCid, rev, diff --git a/packages/syntax/jest.config.js b/packages/syntax/jest.config.js index 08a81143eda..90d955c21ab 100644 --- a/packages/syntax/jest.config.js +++ b/packages/syntax/jest.config.js @@ -1,6 +1,6 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'Syntax', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/syntax/package.json b/packages/syntax/package.json index a841004fce1..e411d70009a 100644 --- a/packages/syntax/package.json +++ b/packages/syntax/package.json @@ -24,6 +24,9 @@ "dependencies": { "@atproto/common-web": "workspace:^" }, + "devDependencies": { + "jest": "^28.1.2" + }, "browser": { "dns/promises": false } diff --git a/packages/xrpc-server/jest.config.js b/packages/xrpc-server/jest.config.js index 81ec7cce52f..1ecdecded6d 100644 --- a/packages/xrpc-server/jest.config.js +++ b/packages/xrpc-server/jest.config.js @@ -1,6 +1,7 @@ -const base = require('../../jest.config.base.js') - +/** @type {import('jest').Config} */ module.exports = { - ...base, displayName: 'XRPC Server', + transform: { '^.+\\.(t|j)s$': '@swc/jest' }, + transformIgnorePatterns: [`/node_modules/(?!get-port)`], + setupFiles: ['/../../jest.setup.ts'], } diff --git a/packages/xrpc-server/package.json b/packages/xrpc-server/package.json index 99419b5bc4a..839ad6365b1 100644 --- a/packages/xrpc-server/package.json +++ b/packages/xrpc-server/package.json @@ -41,6 +41,7 @@ "@types/ws": "^8.5.4", "get-port": "^6.1.2", "jose": "^4.15.4", + "jest": "^28.1.2", "key-encoder": "^2.0.3", "multiformats": "^9.9.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e573184b572..67cee9aaffd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,9 +56,6 @@ importers: eslint-plugin-prettier: specifier: ^4.2.1 version: 4.2.1(eslint-config-prettier@8.5.0)(eslint@8.24.0)(prettier@2.7.1) - handlebars-jest: - specifier: ^1.0.0 - version: 1.0.0 jest: specifier: ^28.1.2 version: 28.1.2(@types/node@18.0.0) @@ -114,6 +111,9 @@ importers: common-tags: specifier: ^1.8.2 version: 1.8.2 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/aws: dependencies: @@ -289,6 +289,9 @@ importers: axios: specifier: ^0.27.2 version: 0.27.2 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.17.8)(ts-node@10.8.2) ts-node: specifier: ^10.8.2 version: 10.8.2(@swc/core@1.3.42)(@types/node@18.17.8)(typescript@5.3.3) @@ -344,6 +347,9 @@ importers: '@types/pg': specifier: ^8.6.6 version: 8.6.6 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.17.8)(ts-node@10.8.2) ts-node: specifier: ^10.8.2 version: 10.8.2(@swc/core@1.3.42)(@types/node@18.17.8)(typescript@5.3.3) @@ -372,6 +378,9 @@ importers: specifier: 3.21.4 version: 3.21.4 devDependencies: + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) typescript: specifier: ^5.3.3 version: 5.3.3 @@ -393,6 +402,10 @@ importers: zod: specifier: ^3.21.4 version: 3.21.4 + devDependencies: + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/crypto: dependencies: @@ -409,6 +422,9 @@ importers: '@atproto/common': specifier: workspace:^ version: link:../common + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/dev-env: dependencies: @@ -497,6 +513,9 @@ importers: get-port: specifier: ^6.1.2 version: 6.1.2 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/lex-cli: dependencies: @@ -539,6 +558,10 @@ importers: zod: specifier: ^3.21.4 version: 3.21.4 + devDependencies: + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/ozone: dependencies: @@ -633,6 +656,9 @@ importers: '@types/qs': specifier: ^6.9.7 version: 6.9.7 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.17.8)(ts-node@10.8.2) ts-node: specifier: ^10.8.2 version: 10.8.2(@swc/core@1.3.42)(@types/node@18.17.8)(typescript@5.3.3) @@ -799,6 +825,9 @@ importers: get-port: specifier: ^6.1.2 version: 6.1.2 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.17.8)(ts-node@10.8.2) ts-node: specifier: ^10.8.2 version: 10.8.2(@swc/core@1.3.42)(@types/node@18.17.8)(typescript@5.3.3) @@ -835,12 +864,20 @@ importers: zod: specifier: ^3.21.4 version: 3.21.4 + devDependencies: + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/syntax: dependencies: '@atproto/common-web': specifier: workspace:^ version: link:../common-web + devDependencies: + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) packages/xrpc: dependencies: @@ -909,6 +946,9 @@ importers: get-port: specifier: ^6.1.2 version: 6.1.2 + jest: + specifier: ^28.1.2 + version: 28.1.2(@types/node@18.0.0) jose: specifier: ^4.15.4 version: 4.15.4 @@ -5229,6 +5269,49 @@ packages: - ts-node dev: true + /@jest/core@28.1.3(ts-node@10.8.2): + resolution: {integrity: sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 28.1.3 + '@jest/reporters': 28.1.3 + '@jest/test-result': 28.1.3 + '@jest/transform': 28.1.3 + '@jest/types': 28.1.3 + '@types/node': 18.17.8 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.8.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 28.1.3 + jest-config: 28.1.3(@types/node@18.17.8)(ts-node@10.8.2) + jest-haste-map: 28.1.3 + jest-message-util: 28.1.3 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.3 + jest-resolve-dependencies: 28.1.3 + jest-runner: 28.1.3 + jest-runtime: 28.1.3 + jest-snapshot: 28.1.3 + jest-util: 28.1.3 + jest-validate: 28.1.3 + jest-watcher: 28.1.3 + micromatch: 4.0.5 + pretty-format: 28.1.3 + rimraf: 3.0.2 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /@jest/create-cache-key-function@27.5.1: resolution: {integrity: sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -6849,11 +6932,6 @@ packages: engines: {node: '>=0.8'} dev: true - /clone@2.1.2: - resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} - engines: {node: '>=0.8'} - dev: true - /cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} @@ -8354,12 +8432,6 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - /handlebars-jest@1.0.0: - resolution: {integrity: sha512-giA9RSHNLKOqFU2dJ3QapELUJmXb4wmQWIEPc5cYp3Sx4Nwo01PBsTWrwo28cGWC8gRg+seMVMBi7wQtcaqw3g==} - dependencies: - node-cache: 5.1.2 - dev: true - /handlebars@4.7.7: resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} engines: {node: '>=0.4.7'} @@ -8940,6 +9012,34 @@ packages: - ts-node dev: true + /jest-cli@28.1.3(@types/node@18.17.8)(ts-node@10.8.2): + resolution: {integrity: sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.3(ts-node@10.8.2) + '@jest/test-result': 28.1.3 + '@jest/types': 28.1.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + import-local: 3.1.0 + jest-config: 28.1.3(@types/node@18.17.8)(ts-node@10.8.2) + jest-util: 28.1.3 + jest-validate: 28.1.3 + prompts: 2.4.2 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest-config@28.1.3(@types/node@18.0.0): resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -9018,6 +9118,46 @@ packages: - supports-color dev: true + /jest-config@28.1.3(@types/node@18.17.8)(ts-node@10.8.2): + resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.18.6 + '@jest/test-sequencer': 28.1.3 + '@jest/types': 28.1.3 + '@types/node': 18.17.8 + babel-jest: 28.1.3(@babel/core@7.18.6) + chalk: 4.1.2 + ci-info: 3.8.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 28.1.3 + jest-environment-node: 28.1.3 + jest-get-type: 28.0.2 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.3 + jest-runner: 28.1.3 + jest-util: 28.1.3 + jest-validate: 28.1.3 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 28.1.3 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.8.2(@swc/core@1.3.42)(@types/node@18.17.8)(typescript@5.3.3) + transitivePeerDependencies: + - supports-color + dev: true + /jest-diff@28.1.3: resolution: {integrity: sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -9329,6 +9469,26 @@ packages: - ts-node dev: true + /jest@28.1.2(@types/node@18.17.8)(ts-node@10.8.2): + resolution: {integrity: sha512-Tuf05DwLeCh2cfWCQbcz9UxldoDyiR1E9Igaei5khjonKncYdc6LDfynKCEWozK0oLE3GD+xKAo2u8x/0s6GOg==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.3(ts-node@10.8.2) + '@jest/types': 28.1.3 + import-local: 3.1.0 + jest-cli: 28.1.3(@types/node@18.17.8)(ts-node@10.8.2) + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jose@4.15.4: resolution: {integrity: sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==} dev: true @@ -9921,13 +10081,6 @@ packages: /node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} - /node-cache@5.1.2: - resolution: {integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==} - engines: {node: '>= 8.0.0'} - dependencies: - clone: 2.1.2 - dev: true - /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} diff --git a/tsconfig.json b/tsconfig.json index 8aef57e31b4..ce214eff636 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,22 +2,22 @@ "extends": "./tsconfig/common.json", "include": [], "references": [ - { "path": "./packages/api/tsconfig.build.json" }, - { "path": "./packages/aws/tsconfig.build.json" }, - { "path": "./packages/bsky/tsconfig.build.json" }, - { "path": "./packages/bsync/tsconfig.build.json" }, - { "path": "./packages/common/tsconfig.build.json" }, - { "path": "./packages/common-web/tsconfig.build.json" }, - { "path": "./packages/crypto/tsconfig.build.json" }, - { "path": "./packages/dev-env/tsconfig.build.json" }, - { "path": "./packages/identity/tsconfig.build.json" }, - { "path": "./packages/lex-cli/tsconfig.build.json" }, - { "path": "./packages/lexicon/tsconfig.build.json" }, - { "path": "./packages/ozone/tsconfig.build.json" }, - { "path": "./packages/pds/tsconfig.build.json" }, - { "path": "./packages/repo/tsconfig.build.json" }, - { "path": "./packages/syntax/tsconfig.build.json" }, - { "path": "./packages/xrpc/tsconfig.build.json" }, - { "path": "./packages/xrpc-server/tsconfig.build.json" } + { "path": "./packages/api" }, + { "path": "./packages/aws" }, + { "path": "./packages/bsky" }, + { "path": "./packages/bsync" }, + { "path": "./packages/common" }, + { "path": "./packages/common-web" }, + { "path": "./packages/crypto" }, + { "path": "./packages/dev-env" }, + { "path": "./packages/identity" }, + { "path": "./packages/lex-cli" }, + { "path": "./packages/lexicon" }, + { "path": "./packages/ozone" }, + { "path": "./packages/pds" }, + { "path": "./packages/repo" }, + { "path": "./packages/syntax" }, + { "path": "./packages/xrpc" }, + { "path": "./packages/xrpc-server" } ] }