Fix local eslint out of memory issue (#7913)

This commit is contained in:
jdolle 2026-03-26 02:15:09 -07:00 committed by GitHub
parent 27d1d04e52
commit 576c7558ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 2429 additions and 819 deletions

View file

@ -55,6 +55,8 @@ module.exports = {
'packages/web/app/src/gql/**/*', 'packages/web/app/src/gql/**/*',
'codegen.cjs', 'codegen.cjs',
'tsup', 'tsup',
'packages/libraries/render-laboratory/src/laboratory.ts',
'packages/web/app/vite.config.ts',
], ],
overrides: [ overrides: [
{ {
@ -66,6 +68,10 @@ module.exports = {
schema: SCHEMA_PATH, schema: SCHEMA_PATH,
operations: OPERATIONS_PATHS, operations: OPERATIONS_PATHS,
}, },
rules: {
'@graphql-eslint/no-deprecated': 'error',
'@graphql-eslint/require-id-when-available': 'error',
},
}, },
{ {
// Setup processor for operations/fragments definitions on code-files // Setup processor for operations/fragments definitions on code-files
@ -76,8 +82,8 @@ module.exports = {
files: ['packages/web/app/**/*.graphql'], files: ['packages/web/app/**/*.graphql'],
plugins: ['@graphql-eslint'], plugins: ['@graphql-eslint'],
rules: { rules: {
'@graphql-eslint/require-id-when-available': 'error',
'@graphql-eslint/no-deprecated': 'error', '@graphql-eslint/no-deprecated': 'error',
'@graphql-eslint/require-id-when-available': 'error',
}, },
}, },
{ {
@ -144,6 +150,16 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': 'off', '@typescript-eslint/ban-types': 'off',
'@typescript-eslint/triple-slash-reference': 'off', '@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrors: 'none',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
}, },
}, },
{ {

View file

@ -32,5 +32,8 @@ CHANGELOG.md
.hive/ .hive/
.hive-dev/ .hive-dev/
# File generated by laboratory
packages/libraries/render-laboratory/src/laboratory.ts
# File generated by @hive/app#generate-changelog script # File generated by @hive/app#generate-changelog script
packages/web/app/src/components/ui/changelog/generated-changelog.ts packages/web/app/src/components/ui/changelog/generated-changelog.ts

View file

@ -32,7 +32,7 @@
"graphql:generate": "VERBOSE=1 graphql-codegen --config codegen.mts", "graphql:generate": "VERBOSE=1 graphql-codegen --config codegen.mts",
"graphql:generate:watch": "pnpm graphql:generate --watch", "graphql:generate:watch": "pnpm graphql:generate --watch",
"integration:prepare": "cd integration-tests && ./local.sh", "integration:prepare": "cd integration-tests && ./local.sh",
"lint": "eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"", "lint": "NODE_OPTIONS=\"--max-old-space-size=8192\" eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
"lint:env-template": "tsx scripts/check-env-template.ts", "lint:env-template": "tsx scripts/check-env-template.ts",
"lint:fix": "pnpm lint --fix", "lint:fix": "pnpm lint --fix",
"lint:prettier": "prettier --cache --check .", "lint:prettier": "prettier --cache --check .",
@ -90,7 +90,7 @@
"cypress": "13.17.0", "cypress": "13.17.0",
"dotenv": "16.4.7", "dotenv": "16.4.7",
"eslint": "8.57.1", "eslint": "8.57.1",
"eslint-plugin-better-tailwindcss": "^4.0.0", "eslint-plugin-better-tailwindcss": "^4.3.2",
"eslint-plugin-cypress": "4.1.0", "eslint-plugin-cypress": "4.1.0",
"eslint-plugin-hive": "file:rules", "eslint-plugin-hive": "file:rules",
"fs-extra": "11.2.0", "fs-extra": "11.2.0",

View file

@ -60,11 +60,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
protected logger: Logger = { protected logger: Logger = {
info: (...args) => this.logInfo(...args), info: (...args) => this.logInfo(...args),
error: (...args) => this.logFailure(...args), error: (...args) => this.logFailure(...args),
debug: (...args) => { debug: (...args) => this.logDebug(...args),
if (this.flags.debug) {
this.logInfo(...args);
}
},
}; };
logSuccess(...args: any[]) { logSuccess(...args: any[]) {
@ -83,6 +79,12 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
this.log(Texture.warning(...args)); this.log(Texture.warning(...args));
} }
logDebug(...args: any[]) {
if (this.flags.debug) {
this.logInfo(...args);
}
}
maybe<TArgs extends Record<string, any>, TKey extends keyof TArgs>({ maybe<TArgs extends Record<string, any>, TKey extends keyof TArgs>({
key, key,
env, env,
@ -119,7 +121,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
ensure< ensure<
TKey extends ValidConfigurationKeys, TKey extends ValidConfigurationKeys,
TArgs extends { TArgs extends {
[key in TKey]: GetConfigurationValueType<TKey>; [_key in TKey]: GetConfigurationValueType<TKey>;
}, },
>({ >({
key, key,
@ -215,6 +217,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
return fileContent; return fileContent;
} catch (e) { } catch (e) {
this.logFailure(e);
throw new InvalidFileContentsError(file, 'JSON'); throw new InvalidFileContentsError(file, 'JSON');
} }
} }

View file

@ -61,6 +61,7 @@ export default class AppCreate extends Command<typeof AppCreate> {
description: AppCreate.flags['registry.endpoint'].description!, description: AppCreate.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
@ -72,6 +73,7 @@ export default class AppCreate extends Command<typeof AppCreate> {
description: AppCreate.flags['registry.accessToken'].description!, description: AppCreate.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -49,6 +49,7 @@ export default class AppPublish extends Command<typeof AppPublish> {
description: AppPublish.flags['registry.endpoint'].description!, description: AppPublish.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
@ -60,6 +61,7 @@ export default class AppPublish extends Command<typeof AppPublish> {
description: AppPublish.flags['registry.accessToken'].description!, description: AppPublish.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -53,6 +53,7 @@ export default class AppRetire extends Command<typeof AppRetire> {
description: AppRetire.flags['registry.endpoint'].description!, description: AppRetire.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
@ -64,6 +65,7 @@ export default class AppRetire extends Command<typeof AppRetire> {
description: AppRetire.flags['registry.accessToken'].description!, description: AppRetire.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -41,6 +41,7 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
description: ArtifactsFetch.flags['cdn.endpoint'].description!, description: ArtifactsFetch.flags['cdn.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingCdnEndpointError(); throw new MissingCdnEndpointError();
} }
@ -52,6 +53,7 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
description: ArtifactsFetch.flags['cdn.accessToken'].description!, description: ArtifactsFetch.flags['cdn.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingCdnKeyError(); throw new MissingCdnKeyError();
} }

View file

@ -211,6 +211,7 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.endpoint'].description!, description: Dev.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
try { try {
@ -222,6 +223,7 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.accessToken'].description!, description: Dev.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }
@ -270,6 +272,7 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.endpoint'].description!, description: Dev.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
try { try {
@ -281,6 +284,7 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.accessToken'].description!, description: Dev.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -111,6 +111,7 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
description: OperationsCheck.flags['registry.endpoint'].description!, description: OperationsCheck.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
@ -123,6 +124,7 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
description: OperationsCheck.flags['registry.accessToken'].description!, description: OperationsCheck.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -210,6 +210,7 @@ export default class SchemaCheck extends Command<typeof SchemaCheck> {
description: SchemaCheck.flags['registry.endpoint'].description!, description: SchemaCheck.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
const file = args.file; const file = args.file;
@ -222,6 +223,7 @@ export default class SchemaCheck extends Command<typeof SchemaCheck> {
description: SchemaCheck.flags['registry.accessToken'].description!, description: SchemaCheck.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -111,6 +111,7 @@ export default class SchemaDelete extends Command<typeof SchemaDelete> {
description: SchemaDelete.flags['registry.endpoint'].description!, description: SchemaDelete.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
try { try {
@ -122,6 +123,7 @@ export default class SchemaDelete extends Command<typeof SchemaDelete> {
description: SchemaDelete.flags['registry.accessToken'].description!, description: SchemaDelete.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -149,6 +149,7 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
description: SchemaFetch.flags['registry.endpoint'].description!, description: SchemaFetch.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
try { try {
@ -160,6 +161,7 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
description: SchemaFetch.flags['registry.accessToken'].description!, description: SchemaFetch.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -166,6 +166,7 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
return metadata; return metadata;
} catch (e) { } catch (e) {
this.logDebug(e);
// If we can't parse it, we can try to load it from FS // If we can't parse it, we can try to load it from FS
return this.readJSON(metadata); return this.readJSON(metadata);
} }
@ -188,6 +189,7 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
description: SchemaPublish.flags['registry.endpoint'].description!, description: SchemaPublish.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
try { try {
@ -199,6 +201,7 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
description: SchemaPublish.flags['registry.accessToken'].description!, description: SchemaPublish.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }
const service = flags.service; const service = flags.service;

View file

@ -78,6 +78,7 @@ export default class WhoAmI extends Command<typeof WhoAmI> {
description: WhoAmI.flags['registry.endpoint'].description!, description: WhoAmI.flags['registry.endpoint'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingEndpointError(); throw new MissingEndpointError();
} }
@ -90,6 +91,7 @@ export default class WhoAmI extends Command<typeof WhoAmI> {
description: WhoAmI.flags['registry.accessToken'].description!, description: WhoAmI.flags['registry.accessToken'].description!,
}); });
} catch (e) { } catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError(); throw new MissingRegistryTokenError();
} }

View file

@ -142,7 +142,7 @@ export class Config {
throw new Error('Invalid config.'); throw new Error('Invalid config.');
} }
} }
} catch (error) { } catch (_error) {
this.cache = { this.cache = {
registry: { registry: {
endpoint: undefined, endpoint: undefined,

View file

@ -73,6 +73,7 @@ export function graphqlRequest(config: {
try { try {
jsonData = (await response.json()) as ExecutionResult<TResult>; jsonData = (await response.json()) as ExecutionResult<TResult>;
} catch (err) { } catch (err) {
config.logger?.debug?.(String(err));
const contentType = response?.headers?.get('content-type'); const contentType = response?.headers?.get('content-type');
throw new APIError( throw new APIError(
`Response from graphql was not valid JSON.${contentType ? ` Received "content-type": "${contentType}".` : ''}`, `Response from graphql was not valid JSON.${contentType ? ` Received "content-type": "${contentType}".` : ''}`,

View file

@ -227,7 +227,7 @@ class FederationSubgraphUrlLoader implements Loader {
name name
} }
} }
`) as TypedDocumentNode<{ __type: null | { name: string } }, {}>, `) as TypedDocumentNode<{ __type: null | { name: string } }, Record<string, never>>,
}); });
if (isSubgraph.__type === null) { if (isSubgraph.__type === null) {
@ -247,7 +247,7 @@ class FederationSubgraphUrlLoader implements Loader {
sdl sdl
} }
} }
`) as TypedDocumentNode<{ _service: { sdl: string } }, {}>, `) as TypedDocumentNode<{ _service: { sdl: string } }, Record<string, never>>,
}); });
this.logger?.debug?.('Resolved subgraph SDL successfully.'); this.logger?.debug?.('Resolved subgraph SDL successfully.');

View file

@ -6,9 +6,9 @@
import { createAgent } from '../src/client/agent.js'; import { createAgent } from '../src/client/agent.js';
let data: Array<{}> = []; let data: Array<object> = [];
const agent = createAgent<{}>( const agent = createAgent<object>(
{ {
debug: true, debug: true,
endpoint: 'http://127.0.0.1', endpoint: 'http://127.0.0.1',

View file

@ -202,7 +202,7 @@ type OptionalWhenFalse<T, KCond extends keyof T, KExcluded extends keyof T> =
// untouched by default or when true // untouched by default or when true
| T | T
// when false, make KExcluded optional // when false, make KExcluded optional
| (Omit<T, KExcluded> & { [P in KCond]: false } & { [P in KExcluded]?: T[KExcluded] }); | (Omit<T, KExcluded> & { [_P in KCond]: false } & { [_P in KExcluded]?: T[KExcluded] });
export type HivePluginOptions = OptionalWhenFalse< export type HivePluginOptions = OptionalWhenFalse<
{ {

View file

@ -139,7 +139,7 @@ export function addProperty<T, K extends string, V>(
value: V, value: V,
obj: T, obj: T,
): T & { ): T & {
[k in K]: V; [_k in K]: V;
}; };
export function addProperty<T, K extends string, V>( export function addProperty<T, K extends string, V>(
key: K, key: K,

View file

@ -113,7 +113,9 @@ export async function initMigrationTestingEnvironment() {
await runPGMigrations({ slonik }); await runPGMigrations({ slonik });
}, },
async done(deleteDb = true) { async done(deleteDb = true) {
deleteDb ?? (await db.query(`DROP DATABASE ${dbName};`)); if (deleteDb) {
await db.query(`DROP DATABASE ${dbName};`);
}
await db.$pool.end().catch(); await db.$pool.end().catch();
}, },
}; };

View file

@ -1,7 +1,7 @@
import type { Scalars } from '../../__generated__/types'; import type { Scalars } from '../../__generated__/types';
import type { AdminOrganizationStats } from '../../shared/entities'; import type { AdminOrganizationStats } from '../../shared/entities';
export type AdminQueryMapper = {}; export type AdminQueryMapper = object;
export type AdminStatsMapper = { export type AdminStatsMapper = {
period: { period: {
from: Scalars['DateTime']['input']; from: Scalars['DateTime']['input'];

View file

@ -52,7 +52,7 @@ export class AppDeployments {
private storage: Storage, private storage: Storage,
private schemaVersionHelper: SchemaVersionHelper, private schemaVersionHelper: SchemaVersionHelper,
private persistedDocumentScheduler: PersistedDocumentScheduler, private persistedDocumentScheduler: PersistedDocumentScheduler,
@Inject(APP_DEPLOYMENTS_ENABLED) private appDeploymentsEnabled: Boolean, @Inject(APP_DEPLOYMENTS_ENABLED) private appDeploymentsEnabled: boolean,
) { ) {
this.logger = logger.child({ source: 'AppDeployments' }); this.logger = logger.child({ source: 'AppDeployments' });
} }

View file

@ -37,7 +37,10 @@ const ThirdpartUserModel = z.object({
timeJoined: z.number(), timeJoined: z.number(),
}); });
const EmailPasswordOrThirdPartyUserModel = z.union([EmailPasswordUserModel, ThirdpartUserModel]); export const EmailPasswordOrThirdPartyUserModel = z.union([
EmailPasswordUserModel,
ThirdpartUserModel,
]);
export type EmailPasswordOrThirdPartyUser = z.TypeOf<typeof EmailPasswordOrThirdPartyUserModel>; export type EmailPasswordOrThirdPartyUser = z.TypeOf<typeof EmailPasswordOrThirdPartyUserModel>;

View file

@ -40,7 +40,7 @@ export class SchemaProposalStorage {
logger: Logger, logger: Logger,
@Inject(PG_POOL_CONFIG) private pool: DatabasePool, @Inject(PG_POOL_CONFIG) private pool: DatabasePool,
private storage: Storage, private storage: Storage,
@Inject(SCHEMA_PROPOSALS_ENABLED) private schemaProposalsEnabled: Boolean, @Inject(SCHEMA_PROPOSALS_ENABLED) private schemaProposalsEnabled: boolean,
private taskScheduler: TaskScheduler, private taskScheduler: TaskScheduler,
) { ) {
this.logger = logger.child({ source: 'SchemaProposalStorage' }); this.logger = logger.child({ source: 'SchemaProposalStorage' });

View file

@ -52,8 +52,6 @@ export class RedisRateLimiter {
} }
} }
req.routeOptions.url;
let ip = req.ip; let ip = req.ip;
if (this.config.config.ipHeaderName && req.headers[this.config.config.ipHeaderName]) { if (this.config.config.ipHeaderName && req.headers[this.config.config.ipHeaderName]) {

View file

@ -11,11 +11,11 @@ export type NullableAndPartial<T> = {
export type NullableDictionary<T> = { [P in keyof T]: T[P] | null }; export type NullableDictionary<T> = { [P in keyof T]: T[P] | null };
export type Listify<T, K extends keyof T> = Omit<T, K> & { export type Listify<T, K extends keyof T> = Omit<T, K> & {
[key in K]: T[K] | readonly T[K][]; [_key in K]: T[K] | readonly T[K][];
}; };
export type MapToArray<T, K extends keyof T> = Omit<T, K> & { export type MapToArray<T, K extends keyof T> = Omit<T, K> & {
[key in K]: readonly T[K][]; [_key in K]: readonly T[K][];
}; };
export function uuid(len = 13) { export function uuid(len = 13) {

View file

@ -68,7 +68,9 @@ const handler: ExportedHandler<Env> = {
}; };
function flush() { function flush() {
loki && ctx.waitUntil(loki.flush()); if (loki) {
ctx.waitUntil(loki.flush());
}
} }
try { try {

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,7 @@ for (const [ruleId, rule] of Object.entries(rules)) {
const RULE_LEVEL = z.union([z.number().min(0).max(2), z.enum(['off', 'warn', 'error'])]); const RULE_LEVEL = z.union([z.number().min(0).max(2), z.enum(['off', 'warn', 'error'])]);
type RulemapValidationType = { type RulemapValidationType = {
[RuleKey in keyof typeof rules]: ZodType; [_RuleKey in keyof typeof rules]: ZodType;
}; };
export function normalizeAjvSchema( export function normalizeAjvSchema(

View file

@ -461,7 +461,7 @@ export async function main() {
method: ['GET', 'HEAD'], method: ['GET', 'HEAD'],
url: '/_health', url: '/_health',
async handler(_, res) { async handler(_, res) {
res.status(200).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void void res.status(200).send();
}, },
}); });
@ -490,7 +490,7 @@ export async function main() {
req.log.error(`Readiness check failed: [${response.statusCode}] ${response.body}`); req.log.error(`Readiness check failed: [${response.statusCode}] ${response.body}`);
} else { } else {
reportReadiness(true); reportReadiness(true);
res.status(200).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void void res.status(200).send();
return; return;
} }
} catch (error) { } catch (error) {
@ -498,7 +498,7 @@ export async function main() {
} }
reportReadiness(false); reportReadiness(false);
res.status(400).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void void res.status(400).send();
}, },
}); });

View file

@ -29,9 +29,9 @@ const getHiveClientVersion = (userAgent: string | null) => {
}; };
export function useArmor< export function useArmor<
PluginContext extends Record<string, any> = {}, PluginContext extends Record<string, any> = object,
TServerContext extends Record<string, any> = {}, TServerContext extends Record<string, any> = object,
TUserContext = {}, TUserContext = object,
>(): Plugin<PluginContext, TServerContext, TUserContext> { >(): Plugin<PluginContext, TServerContext, TUserContext> {
return { return {
onValidate(ctx) { onValidate(ctx) {

View file

@ -456,7 +456,7 @@ type FunctionTraceOptions<TArgs extends any[], TResult> = {
errorAttributes?: Attributes | ((error: Error) => Attributes); errorAttributes?: Attributes | ((error: Error) => Attributes);
}; };
export function traceFn<This extends Object, TArgs extends any[], TResult>( export function traceFn<This extends object, TArgs extends any[], TResult>(
spanName: string, spanName: string,
options?: FunctionTraceOptions<TArgs, Awaited<TResult>>, options?: FunctionTraceOptions<TArgs, Awaited<TResult>>,
) { ) {

View file

@ -76,7 +76,9 @@ export type { tokens, schema_policy_resource } from './db/types';
type Connection = DatabasePool | DatabaseTransactionConnection; type Connection = DatabasePool | DatabaseTransactionConnection;
type OverrideProp<T extends {}, K extends keyof T, V extends T[K]> = Omit<T, K> & { [P in K]: V }; type OverrideProp<T extends Record<string, any>, K extends keyof T, V extends T[K]> = Omit<T, K> & {
[_P in K]: V;
};
type schema_log = Omit<schema_log_in_db, 'action'> & { type schema_log = Omit<schema_log_in_db, 'action'> & {
action: 'PUSH' | 'DELETE'; action: 'PUSH' | 'DELETE';

View file

@ -263,7 +263,7 @@ export function implement<Model = never>() {
return { return {
with: < with: <
Schema extends Implements<Model> & { Schema extends Implements<Model> & {
[unknownKey in Exclude<keyof Schema, keyof Model>]: never; [_Key in Exclude<keyof Schema, keyof Model>]: never;
}, },
>( >(
schema: Schema, schema: Schema,
@ -1525,7 +1525,7 @@ export const InsertConditionalBreakingChangeMetadataModel =
}, },
})).nullable(); })).nullable();
const SchemaCheckInputModel = z.union([ export const SchemaCheckInputModel = z.union([
z.intersection( z.intersection(
z.object({ z.object({
isSuccess: z.literal(false), isSuccess: z.literal(false),

View file

@ -8,15 +8,10 @@ interface Email {
date: Date; date: Date;
} }
const emailProviders = { type EmailProviders = 'postmark' | 'mock' | 'smtp' | 'sendmail';
postmark,
mock,
smtp,
sendmail,
};
export interface EmailProvider { export interface EmailProvider {
id: keyof typeof emailProviders; id: EmailProviders;
send(email: Omit<Email, 'date'>): Promise<void>; send(email: Omit<Email, 'date'>): Promise<void>;
history: Email[]; history: Email[];
} }

View file

@ -6,7 +6,7 @@ import { HiveStripeWrapper } from '@/lib/billing/stripe';
* Utility for wrapping a component with an authenticated container that has the default application layout. * Utility for wrapping a component with an authenticated container that has the default application layout.
*/ */
export const authenticated = export const authenticated =
<TProps extends {}>(Component: (props: TProps) => ReactElement | null) => <TProps extends Record<string, any>>(Component: (props: TProps) => ReactElement | null) =>
(props: TProps) => { (props: TProps) => {
return ( return (
<SessionAuth> <SessionAuth>

View file

@ -15,6 +15,7 @@ const BillingView_OrganizationFragment = graphql(`
const BillingView_QueryFragment = graphql(` const BillingView_QueryFragment = graphql(`
fragment BillingView_QueryFragment on Query { fragment BillingView_QueryFragment on Query {
billingPlans { billingPlans {
id
planType planType
...PlanSummary_PlanFragment ...PlanSummary_PlanFragment
} }

View file

@ -6,6 +6,7 @@ import { CurrencyFormatter, formatMillionOrBillion } from './helpers';
const PriceEstimationTable_PlanFragment = graphql(` const PriceEstimationTable_PlanFragment = graphql(`
fragment PriceEstimationTable_PlanFragment on BillingPlan { fragment PriceEstimationTable_PlanFragment on BillingPlan {
id
includedOperationsLimit includedOperationsLimit
pricePerOperationsUnit pricePerOperationsUnit
basePrice basePrice

View file

@ -4,6 +4,7 @@ import { FragmentType, graphql, useFragment } from '@/gql';
const ProPlanBilling_OrganizationFragment = graphql(` const ProPlanBilling_OrganizationFragment = graphql(`
fragment ProPlanBilling_OrganizationFragment on Organization { fragment ProPlanBilling_OrganizationFragment on Organization {
id
billingConfiguration { billingConfiguration {
hasPaymentIssues hasPaymentIssues
} }

View file

@ -40,12 +40,14 @@ const ExternalCompositionStatus_TestQuery = graphql(`
const ExternalCompositionSettings_OrganizationFragment = graphql(` const ExternalCompositionSettings_OrganizationFragment = graphql(`
fragment ExternalCompositionSettings_OrganizationFragment on Organization { fragment ExternalCompositionSettings_OrganizationFragment on Organization {
id
slug slug
} }
`); `);
const ExternalCompositionSettings_ProjectFragment = graphql(` const ExternalCompositionSettings_ProjectFragment = graphql(`
fragment ExternalCompositionSettings_ProjectFragment on Project { fragment ExternalCompositionSettings_ProjectFragment on Project {
id
slug slug
isNativeFederationEnabled isNativeFederationEnabled
externalSchemaComposition { externalSchemaComposition {
@ -58,6 +60,7 @@ const ExternalCompositionSettings_UpdateResultFragment = graphql(`
fragment ExternalCompositionSettings_UpdateResultFragment on UpdateSchemaCompositionResult { fragment ExternalCompositionSettings_UpdateResultFragment on UpdateSchemaCompositionResult {
ok { ok {
updatedProject { updatedProject {
id
externalSchemaComposition { externalSchemaComposition {
endpoint endpoint
} }

View file

@ -47,6 +47,7 @@ const ChangesBlock_SchemaCheckConditionalBreakingChangeMetadataFragment = graphq
settings { settings {
retentionInDays retentionInDays
targets { targets {
id
slug slug
target { target {
id id

View file

@ -81,6 +81,7 @@ const Proposals_SelectFragment = graphql(`
const Proposals_TargetProjectTypeFragment = graphql(` const Proposals_TargetProjectTypeFragment = graphql(`
fragment Proposals_TargetProjectTypeFragment on Target { fragment Proposals_TargetProjectTypeFragment on Target {
id
project { project {
id id
type type
@ -274,7 +275,7 @@ export function ProposalEditor(props: {
onValueChange={idx => { onValueChange={idx => {
try { try {
setActiveTab(parseInt(idx, 10)); setActiveTab(parseInt(idx, 10));
} catch (e) { } catch (_e: unknown) {
console.error('Cannot set active tab. Could not parse index.'); console.error('Cannot set active tab. Could not parse index.');
} }
}} }}

View file

@ -20,7 +20,7 @@ const Command = React.forwardRef<
)); ));
Command.displayName = CommandPrimitive.displayName; Command.displayName = CommandPrimitive.displayName;
interface CommandDialogProps extends DialogProps {} type CommandDialogProps = DialogProps;
const CommandDialog = ({ children, ...props }: CommandDialogProps) => { const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
return ( return (

View file

@ -12,13 +12,6 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement; action?: ToastActionElement;
}; };
const actionTypes = {
ADD_TOAST: 'ADD_TOAST',
UPDATE_TOAST: 'UPDATE_TOAST',
DISMISS_TOAST: 'DISMISS_TOAST',
REMOVE_TOAST: 'REMOVE_TOAST',
} as const;
let count = 0; let count = 0;
function genId() { function genId() {
@ -26,7 +19,12 @@ function genId() {
return count.toString(); return count.toString();
} }
type ActionType = typeof actionTypes; type ActionType = {
ADD_TOAST: 'ADD_TOAST';
UPDATE_TOAST: 'UPDATE_TOAST';
DISMISS_TOAST: 'DISMISS_TOAST';
REMOVE_TOAST: 'REMOVE_TOAST';
};
type Action = type Action =
| { | {

View file

@ -7,7 +7,7 @@ import { Button } from '@/components/ui/button';
import { Heading } from '@/components/ui/heading'; import { Heading } from '@/components/ui/heading';
import { ArrowDownIcon, CheckIcon } from '@/components/ui/icon'; import { ArrowDownIcon, CheckIcon } from '@/components/ui/icon';
import { Input, Modal } from '@/components/v2'; import { Input, Modal } from '@/components/v2';
import { FragmentType, graphql, useFragment } from '@/gql'; import { DocumentType, FragmentType, graphql, useFragment } from '@/gql';
import { useNotifications } from '@/lib/hooks'; import { useNotifications } from '@/lib/hooks';
import { Combobox as HeadlessCombobox, Transition as HeadlessTransition } from '@headlessui/react'; import { Combobox as HeadlessCombobox, Transition as HeadlessTransition } from '@headlessui/react';
@ -37,7 +37,6 @@ const TransferOrganizationOwnership_Members = graphql(`
node { node {
id id
isOwner isOwner
...MemberFields
user { user {
id id
fullName fullName
@ -51,22 +50,9 @@ const TransferOrganizationOwnership_Members = graphql(`
} }
`); `);
const MemberFields = graphql(`
fragment MemberFields on Member {
id
user {
id
fullName
displayName
email
}
isOwner
}
`);
type Member = NonNullable< type Member = NonNullable<
FragmentType<typeof MemberFields>[' $fragmentRefs'] DocumentType<typeof TransferOrganizationOwnership_Members>['organization']
>['MemberFieldsFragment']; >['members']['edges'][number]['node'];
const TransferOrganizationOwnershipModal_OrganizationFragment = graphql(` const TransferOrganizationOwnershipModal_OrganizationFragment = graphql(`
fragment TransferOrganizationOwnershipModal_OrganizationFragment on Organization { fragment TransferOrganizationOwnershipModal_OrganizationFragment on Organization {

View file

@ -37,7 +37,7 @@ const dateStringFormat = 'yyyy-MM-dd HH:mm';
function parseDateString(input: string) { function parseDateString(input: string) {
try { try {
return parseDate(input, dateStringFormat, new UTCDate()); return parseDate(input, dateStringFormat, new UTCDate());
} catch (error) { } catch (_error: unknown) {
return undefined; return undefined;
} }
} }

View file

@ -67,6 +67,7 @@ const DeleteGitHubIntegrationMutation = graphql(`
const GitHubIntegrationSection_OrganizationFragment = graphql(` const GitHubIntegrationSection_OrganizationFragment = graphql(`
fragment GitHubIntegrationSection_OrganizationFragment on Organization { fragment GitHubIntegrationSection_OrganizationFragment on Organization {
id
hasGitHubIntegration hasGitHubIntegration
slug slug
} }
@ -113,6 +114,7 @@ function GitHubIntegrationSection(props: {
const SlackIntegrationSection_OrganizationFragment = graphql(` const SlackIntegrationSection_OrganizationFragment = graphql(`
fragment SlackIntegrationSection_OrganizationFragment on Organization { fragment SlackIntegrationSection_OrganizationFragment on Organization {
id
hasSlackIntegration hasSlackIntegration
slug slug
} }

View file

@ -228,6 +228,7 @@ const ConditionalBreakingChangesMetadataSection_SchemaCheckFragment = graphql(`
percentage percentage
excludedClientNames excludedClientNames
targets { targets {
id
slug slug
target { target {
id id

View file

@ -49,7 +49,7 @@ const DeprecatedSchemaView_DeprecatedSchemaExplorerFragment = graphql(`
} }
`); `);
const DeprecatedSchemaView = memo(function _DeprecatedSchemaView(props: { function InternalDeprecatedSchemaView(props: {
explorer: FragmentType<typeof DeprecatedSchemaView_DeprecatedSchemaExplorerFragment>; explorer: FragmentType<typeof DeprecatedSchemaView_DeprecatedSchemaExplorerFragment>;
totalRequests: number; totalRequests: number;
organizationSlug: string; organizationSlug: string;
@ -150,7 +150,9 @@ const DeprecatedSchemaView = memo(function _DeprecatedSchemaView(props: {
</div> </div>
</div> </div>
); );
}); }
const DeprecatedSchemaView = memo(InternalDeprecatedSchemaView);
const DeprecatedSchemaExplorer_DeprecatedSchemaQuery = graphql(` const DeprecatedSchemaExplorer_DeprecatedSchemaQuery = graphql(`
query DeprecatedSchemaExplorer_DeprecatedSchemaQuery( query DeprecatedSchemaExplorer_DeprecatedSchemaQuery(

View file

@ -63,7 +63,7 @@ const UnusedSchemaView_UnusedSchemaExplorerFragment = graphql(`
} }
`); `);
const UnusedSchemaView = memo(function _UnusedSchemaView(props: { function InternalUnusedSchemaView(props: {
explorer: FragmentType<typeof UnusedSchemaView_UnusedSchemaExplorerFragment>; explorer: FragmentType<typeof UnusedSchemaView_UnusedSchemaExplorerFragment>;
totalRequests: number; totalRequests: number;
organizationSlug: string; organizationSlug: string;
@ -209,7 +209,9 @@ const UnusedSchemaView = memo(function _UnusedSchemaView(props: {
</div> </div>
</div> </div>
); );
}); }
const UnusedSchemaView = memo(InternalUnusedSchemaView);
const UnusedSchemaExplorer_UnusedSchemaQuery = graphql(` const UnusedSchemaExplorer_UnusedSchemaQuery = graphql(`
query UnusedSchemaExplorer_UnusedSchemaQuery( query UnusedSchemaExplorer_UnusedSchemaQuery(

View file

@ -46,7 +46,7 @@ import { cn } from '@/lib/utils';
import * as SliderPrimitive from '@radix-ui/react-slider'; import * as SliderPrimitive from '@radix-ui/react-slider';
import * as dateMath from '../../lib/date-math'; import * as dateMath from '../../lib/date-math';
interface FilterInputProps extends InputHTMLAttributes<HTMLInputElement> {} type FilterInputProps = InputHTMLAttributes<HTMLInputElement>;
export const FilterInput = forwardRef<HTMLInputElement, FilterInputProps>( export const FilterInput = forwardRef<HTMLInputElement, FilterInputProps>(
({ className, type, ...props }, ref) => { ({ className, type, ...props }, ref) => {

File diff suppressed because it is too large Load diff