From 7b59d02fdee96e3af2227f2ebddc656de9ece2dc Mon Sep 17 00:00:00 2001 From: Logan Snow <4197432+lsnow99@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:06:43 -0500 Subject: [PATCH 01/29] feat: runtime enum support --- src/ast/export-statement-node.ts | 13 +++- src/ast/index.ts | 1 + src/ast/node-type.ts | 1 + src/ast/runtime-enum-declaration-node.ts | 13 ++++ src/cli/cli.test.ts | 1 + src/cli/cli.ts | 5 ++ src/generator/generator.ts | 4 +- src/serializer/serializer.test.ts | 25 +++++++ src/serializer/serializer.ts | 41 +++++++++++ src/transformer/symbol-collection.ts | 2 + src/transformer/transformer.test.ts | 92 +++++++++++++++++++++++- src/transformer/transformer.ts | 34 ++++++++- 12 files changed, 225 insertions(+), 7 deletions(-) create mode 100644 src/ast/runtime-enum-declaration-node.ts diff --git a/src/ast/export-statement-node.ts b/src/ast/export-statement-node.ts index 3a7830b..f99346f 100644 --- a/src/ast/export-statement-node.ts +++ b/src/ast/export-statement-node.ts @@ -1,12 +1,21 @@ import type { AliasDeclarationNode } from './alias-declaration-node'; import type { InterfaceDeclarationNode } from './interface-declaration-node'; import { NodeType } from './node-type'; +import type { RuntimeEnumDeclarationNode } from './runtime-enum-declaration-node'; export class ExportStatementNode { - readonly argument: AliasDeclarationNode | InterfaceDeclarationNode; + readonly argument: + | AliasDeclarationNode + | InterfaceDeclarationNode + | RuntimeEnumDeclarationNode; readonly type = NodeType.EXPORT_STATEMENT; - constructor(argument: AliasDeclarationNode | InterfaceDeclarationNode) { + constructor( + argument: + | AliasDeclarationNode + | InterfaceDeclarationNode + | RuntimeEnumDeclarationNode, + ) { this.argument = argument; } } diff --git a/src/ast/index.ts b/src/ast/index.ts index 0b152ee..69d6ef2 100644 --- a/src/ast/index.ts +++ b/src/ast/index.ts @@ -18,6 +18,7 @@ export * from './module-reference-node'; export * from './node-type'; export * from './object-expression-node'; export * from './property-node'; +export * from './runtime-enum-declaration-node'; export * from './statement-node'; export * from './template-node'; export * from './union-expression-node'; diff --git a/src/ast/node-type.ts b/src/ast/node-type.ts index fec65d6..5810cdc 100644 --- a/src/ast/node-type.ts +++ b/src/ast/node-type.ts @@ -14,6 +14,7 @@ export const enum NodeType { MODULE_REFERENCE = 'ModuleReference', OBJECT_EXPRESSION = 'ObjectExpression', PROPERTY = 'Property', + RUNTIME_ENUM_DECLARATION = 'RuntimeEnumDeclaration', TEMPLATE = 'Template', UNION_EXPRESSION = 'UnionExpression', VALUE = 'Value', diff --git a/src/ast/runtime-enum-declaration-node.ts b/src/ast/runtime-enum-declaration-node.ts new file mode 100644 index 0000000..cc07f91 --- /dev/null +++ b/src/ast/runtime-enum-declaration-node.ts @@ -0,0 +1,13 @@ +import type { ExpressionNode } from './expression-node'; +import { NodeType } from './node-type'; + +export class RuntimeEnumDeclarationNode { + readonly body: ExpressionNode; + readonly name: string; + readonly type = NodeType.RUNTIME_ENUM_DECLARATION; + + constructor(name: string, body: ExpressionNode) { + this.name = name; + this.body = body; + } +} diff --git a/src/cli/cli.test.ts b/src/cli/cli.test.ts index 777a593..b3b8e45 100644 --- a/src/cli/cli.test.ts +++ b/src/cli/cli.test.ts @@ -17,6 +17,7 @@ export const testCli = () => { logLevel: DEFAULT_LOG_LEVEL, outFile: DEFAULT_OUT_FILE, print: false, + runtimeEnums: false, schema: undefined, typeOnlyImports: true, url: DEFAULT_URL, diff --git a/src/cli/cli.ts b/src/cli/cli.ts index ae176a1..06ea09e 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -25,6 +25,7 @@ export type CliOptions = { logLevel?: LogLevel; outFile?: string | undefined; print?: boolean; + runtimeEnums?: boolean; schema?: string | undefined; typeOnlyImports?: boolean; url: string; @@ -42,6 +43,7 @@ export class Cli { const outFile = options.outFile; const excludePattern = options.excludePattern; const includePattern = options.includePattern; + const runtimeEnums = options.runtimeEnums; const schema = options.schema; const typeOnlyImports = options.typeOnlyImports; @@ -82,6 +84,7 @@ export class Cli { includePattern, logger, outFile, + runtimeEnums, schema, typeOnlyImports, verify: options.verify, @@ -158,6 +161,7 @@ export class Cli { (argv['out-file'] as string | undefined) ?? (argv.print ? undefined : DEFAULT_OUT_FILE); const print = this.#parseBoolean(argv.print); + const runtimeEnums = this.#parseBoolean(argv.runtimeEnums); const schema = argv.schema as string | undefined; const typeOnlyImports = this.#parseBoolean( argv['type-only-imports'] ?? true, @@ -219,6 +223,7 @@ export class Cli { logLevel, outFile, print, + runtimeEnums, schema, typeOnlyImports, url, diff --git a/src/generator/generator.ts b/src/generator/generator.ts index 586b990..95094c6 100644 --- a/src/generator/generator.ts +++ b/src/generator/generator.ts @@ -16,6 +16,7 @@ export type GenerateOptions = { logger?: Logger; outFile?: string; print?: boolean; + runtimeEnums?: boolean; schema?: string; serializer?: Serializer; transformer?: Transformer; @@ -53,11 +54,12 @@ export class Generator { defaultSchema: options.schema, dialect: options.dialect, metadata, + runtimeEnums: !!options.runtimeEnums, }); const serializer = options.serializer ?? - new Serializer({ typeOnlyImports: options.typeOnlyImports }); + new Serializer({ typeOnlyImports: options.typeOnlyImports, camelCase: !!options.camelCase }); const data = serializer.serialize(nodes); const relativeOutDir = options.outFile diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 5035d05..02ee2ca 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -14,6 +14,7 @@ import { MappedTypeNode, ObjectExpressionNode, PropertyNode, + RuntimeEnumDeclarationNode, TemplateNode, UnionExpressionNode, } from '../ast'; @@ -289,6 +290,7 @@ export const testSerializer = () => { ], enums, ), + runtimeEnums: false, }); strictEqual( @@ -345,6 +347,7 @@ export const testSerializer = () => { ], enums, ), + runtimeEnums: false, }); strictEqual( @@ -371,5 +374,27 @@ export const testSerializer = () => { ); }); }); + + void describe('serialize', () => { + const enumSerializer = new Serializer({ camelCase: true }); + void it('should serialize runtime enums properly', () => + strictEqual( + enumSerializer.serializeRuntimeEnum( + new RuntimeEnumDeclarationNode( + 'Mood', + new UnionExpressionNode([ + new LiteralNode('sad'), + new LiteralNode('happy'), + new LiteralNode('happy_or_sad'), + ]), + ), + ), + 'enum Mood {\n' + + ' happy = "happy",\n' + + ' happyOrSad = "happy_or_sad",\n' + + ' sad = "sad",\n' + + '}\n', + )); + }); }); }; diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index cc9afa8..2516868 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -14,15 +14,18 @@ import type { MappedTypeNode, ObjectExpressionNode, PropertyNode, + RuntimeEnumDeclarationNode, StatementNode, UnionExpressionNode, } from '../ast'; import { NodeType } from '../ast'; +import { toCamelCase } from '../transformer'; const IDENTIFIER_REGEXP = /^[$A-Z_a-z][\w$]*$/; export type SerializerOptions = { typeOnlyImports?: boolean; + camelCase?: boolean; }; /** @@ -30,9 +33,11 @@ export type SerializerOptions = { */ export class Serializer { readonly typeOnlyImports: boolean; + readonly camelCase: boolean; constructor(options: SerializerOptions = {}) { this.typeOnlyImports = options.typeOnlyImports ?? true; + this.camelCase = options.camelCase ?? false; } serialize(nodes: StatementNode[]) { @@ -65,6 +70,39 @@ export class Serializer { return data; } + serializeRuntimeEnum(node: RuntimeEnumDeclarationNode) { + let data = 'enum '; + data += node.name; + data += ' {\n'; + + if (node.body.type === NodeType.UNION_EXPRESSION) { + const sortedArgs = node.body.args.sort((a, b) => + (a as LiteralNode).value.localeCompare( + (b as LiteralNode).value, + ), + ); + for (const arg of sortedArgs) { + if (arg.type === NodeType.LITERAL && typeof arg.value === 'string') { + const serializedArg = this.serializeLiteral(arg); + const enumValueName = this.camelCase + ? toCamelCase(arg.value) + : arg.value; + data += ' '; + data += enumValueName; + data += ' = '; + data += serializedArg; + data += ','; + data += '\n'; + } + } + } + + data += '}'; + data += '\n'; + + return data; + } + serializeAliasDeclaration(node: AliasDeclarationNode) { const expression = node.body.type === NodeType.TEMPLATE ? node.body.expression : node.body; @@ -127,6 +165,9 @@ export class Serializer { case NodeType.INTERFACE_DECLARATION: data += this.serializeInterfaceDeclaration(node.argument); break; + case NodeType.RUNTIME_ENUM_DECLARATION: + data += this.serializeRuntimeEnum(node.argument); + break; } return data; diff --git a/src/transformer/symbol-collection.ts b/src/transformer/symbol-collection.ts index a1cbb8d..9539a9a 100644 --- a/src/transformer/symbol-collection.ts +++ b/src/transformer/symbol-collection.ts @@ -12,10 +12,12 @@ export type SymbolNameMap = { export type SymbolNode = | { node: ExpressionNode | TemplateNode; type: SymbolType.DEFINITION } | { node: ModuleReferenceNode; type: SymbolType.MODULE_REFERENCE } + | { node: ExpressionNode; type: SymbolType.RUNTIME_ENUM_DEFINITION } | { type: SymbolType.TABLE }; export const enum SymbolType { DEFINITION = 'Definition', + RUNTIME_ENUM_DEFINITION = 'RuntimeEnumDefinition', MODULE_REFERENCE = 'ModuleReference', TABLE = 'Table', } diff --git a/src/transformer/transformer.test.ts b/src/transformer/transformer.test.ts index e48b3cb..e03bae3 100644 --- a/src/transformer/transformer.test.ts +++ b/src/transformer/transformer.test.ts @@ -11,6 +11,7 @@ import { LiteralNode, ObjectExpressionNode, PropertyNode, + RuntimeEnumDeclarationNode, UnionExpressionNode, } from '../ast'; import { @@ -31,11 +32,20 @@ export const testTransformer = () => { 'public.mood_': ['', ',', "'", "'','"], }); - const transform = (tables: TableMetadata[], camelCase: boolean) => { + const transform = ( + tables: TableMetadata[], + camelCase: boolean, + runtimeEnums: boolean, + ) => { const dialect = new PostgresDialect(); const transformer = new Transformer(); const metadata = new DatabaseMetadata(tables, enums); - return transformer.transform({ camelCase, dialect, metadata }); + return transformer.transform({ + camelCase, + dialect, + metadata, + runtimeEnums, + }); }; void it('should transform correctly', () => { @@ -68,6 +78,7 @@ export const testTransformer = () => { }), ], false, + false, ); deepStrictEqual(nodes, [ @@ -148,6 +159,7 @@ export const testTransformer = () => { }), ], true, + false, ); deepStrictEqual(nodes, [ @@ -200,6 +212,7 @@ export const testTransformer = () => { }), ], false, + false, ); deepStrictEqual(nodes, [ @@ -252,5 +265,80 @@ export const testTransformer = () => { ), ]); }); + + void it('should transform runtime enums correctly', () => { + const nodes = transform( + [ + new TableMetadata({ + columns: [ + new ColumnMetadata({ + dataType: 'mood', + hasDefaultValue: false, + name: 'column1', + }), + new ColumnMetadata({ + dataType: 'mood_', + hasDefaultValue: true, + name: 'column2', + }), + ], + name: 'table', + schema: 'public', + }), + ], + false, + true, + ); + + deepStrictEqual(nodes, [ + new ImportStatementNode('kysely', [new ImportClauseNode('ColumnType')]), + new ExportStatementNode( + new RuntimeEnumDeclarationNode( + 'Mood', + new UnionExpressionNode([ + new LiteralNode('happy'), + new LiteralNode('ok'), + new LiteralNode('sad'), + ]), + ), + ), + new ExportStatementNode( + new RuntimeEnumDeclarationNode( + 'Mood2', + new UnionExpressionNode([ + new LiteralNode(''), + new LiteralNode(','), + new LiteralNode("'"), + new LiteralNode("'','"), + ]), + ), + ), + new ExportStatementNode( + new AliasDeclarationNode('Generated', GLOBAL_DEFINITIONS.Generated), + ), + new ExportStatementNode( + new InterfaceDeclarationNode( + 'Table', + new ObjectExpressionNode([ + new PropertyNode('column1', new IdentifierNode('Mood')), + new PropertyNode( + 'column2', + new GenericExpressionNode('Generated', [ + new IdentifierNode('Mood2'), + ]), + ), + ]), + ), + ), + new ExportStatementNode( + new InterfaceDeclarationNode( + 'DB', + new ObjectExpressionNode([ + new PropertyNode('table', new IdentifierNode('Table')), + ]), + ), + ), + ]); + }); }); }; diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 7f24151..e02fd8f 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -12,6 +12,7 @@ import { NodeType, ObjectExpressionNode, PropertyNode, + RuntimeEnumDeclarationNode, UnionExpressionNode, } from '../ast'; import type { @@ -48,6 +49,7 @@ export type TransformContext = { enums: EnumCollection; imports: Imports; metadata: DatabaseMetadata; + runtimeEnums: boolean; scalars: Scalars; symbols: SymbolCollection; }; @@ -57,6 +59,7 @@ export type TransformOptions = { defaultSchema?: string; dialect: Dialect; metadata: DatabaseMetadata; + runtimeEnums: boolean; }; /** @@ -158,6 +161,7 @@ export class Transformer { ...options.dialect.adapter.imports, }, metadata: options.metadata, + runtimeEnums: options.runtimeEnums, scalars: { ...options.dialect.adapter.scalars, }, @@ -186,6 +190,22 @@ export class Transformer { return new ExportStatementNode(argument); } + #createRuntimeEnumDefinitionNodes(context: TransformContext) { + const runtimeEnumDefinitionNodes: ExportStatementNode[] = []; + + for (const { name, symbol } of context.symbols.entries()) { + if (symbol.type === SymbolType.RUNTIME_ENUM_DEFINITION) { + const argument = new RuntimeEnumDeclarationNode(name, symbol.node); + const runtimeEnumDefinitionNode = new ExportStatementNode(argument); + runtimeEnumDefinitionNodes.push(runtimeEnumDefinitionNode); + } + } + + return runtimeEnumDefinitionNodes.sort((a, b) => + a.argument.name.localeCompare(b.argument.name), + ); + } + #createDefinitionNodes(context: TransformContext) { const definitionNodes: ExportStatementNode[] = []; @@ -285,7 +305,9 @@ export class Transformer { const enumNode = unionize(this.#transformEnum(enumValues)); const symbolName = context.symbols.set(symbolId, { node: enumNode, - type: SymbolType.DEFINITION, + type: context.runtimeEnums + ? SymbolType.RUNTIME_ENUM_DEFINITION + : SymbolType.DEFINITION, }); const node = new IdentifierNode(symbolName); return [node]; @@ -346,9 +368,17 @@ export class Transformer { const context = this.#createContext(options); const tableNodes = this.#transformTables(context); const importNodes = this.#createImportNodes(context); + const runtimeEnumDefinitionNodes = + this.#createRuntimeEnumDefinitionNodes(context); const definitionNodes = this.#createDefinitionNodes(context); const databaseNode = this.#createDatabaseExportNode(context); - return [...importNodes, ...definitionNodes, ...tableNodes, databaseNode]; + return [ + ...importNodes, + ...runtimeEnumDefinitionNodes, + ...definitionNodes, + ...tableNodes, + databaseNode, + ]; } } From c8e4a3e14abd3f71dbffb21efdea10c9af191db2 Mon Sep 17 00:00:00 2001 From: Logan Snow <4197432+lsnow99@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:34:20 -0500 Subject: [PATCH 02/29] add cli flag description --- src/cli/flags.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli/flags.ts b/src/cli/flags.ts index 8d2b4d0..b613ac7 100644 --- a/src/cli/flags.ts +++ b/src/cli/flags.ts @@ -51,6 +51,10 @@ export const FLAGS: Flag[] = [ description: 'Print the generated output to the terminal.', longName: 'print', }, + { + description: 'Generate runtime enums instead of string unions.', + longName: 'runtime-enums', + }, { description: 'Generate TypeScript 3.8+ `import type` syntax (default: true).', From d6a9b951bfccdea9446ded9229e29521dab37c22 Mon Sep 17 00:00:00 2001 From: Logan Snow <4197432+lsnow99@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:40:13 -0500 Subject: [PATCH 03/29] support single enum value --- src/cli/cli.ts | 2 +- src/serializer/serializer.test.ts | 2 +- src/serializer/serializer.ts | 42 ++++++++++++++++--------------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 06ea09e..5ad48e5 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -161,7 +161,7 @@ export class Cli { (argv['out-file'] as string | undefined) ?? (argv.print ? undefined : DEFAULT_OUT_FILE); const print = this.#parseBoolean(argv.print); - const runtimeEnums = this.#parseBoolean(argv.runtimeEnums); + const runtimeEnums = this.#parseBoolean(argv['runtime-enums']); const schema = argv.schema as string | undefined; const typeOnlyImports = this.#parseBoolean( argv['type-only-imports'] ?? true, diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 02ee2ca..adb8d1a 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -393,7 +393,7 @@ export const testSerializer = () => { ' happy = "happy",\n' + ' happyOrSad = "happy_or_sad",\n' + ' sad = "sad",\n' + - '}\n', + '}', )); }); }); diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index 2516868..6f4f936 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -75,30 +75,32 @@ export class Serializer { data += node.name; data += ' {\n'; - if (node.body.type === NodeType.UNION_EXPRESSION) { - const sortedArgs = node.body.args.sort((a, b) => - (a as LiteralNode).value.localeCompare( - (b as LiteralNode).value, - ), - ); - for (const arg of sortedArgs) { - if (arg.type === NodeType.LITERAL && typeof arg.value === 'string') { - const serializedArg = this.serializeLiteral(arg); - const enumValueName = this.camelCase - ? toCamelCase(arg.value) - : arg.value; - data += ' '; - data += enumValueName; - data += ' = '; - data += serializedArg; - data += ','; - data += '\n'; - } + const args = + node.body.type === NodeType.UNION_EXPRESSION + ? node.body.args + : [node.body]; + const sortedArgs = args.sort((a, b) => + (a as LiteralNode).value.localeCompare( + (b as LiteralNode).value, + ), + ); + + for (const arg of sortedArgs) { + if (arg.type === NodeType.LITERAL && typeof arg.value === 'string') { + const serializedArg = this.serializeLiteral(arg); + const enumValueName = this.camelCase + ? toCamelCase(arg.value) + : arg.value; + data += ' '; + data += enumValueName; + data += ' = '; + data += serializedArg; + data += ','; + data += '\n'; } } data += '}'; - data += '\n'; return data; } From 0ebd72a0cdf0296564a2b50ea4705bbfbdca8843 Mon Sep 17 00:00:00 2001 From: Robin Clowers Date: Fri, 8 Mar 2024 12:22:09 -0800 Subject: [PATCH 04/29] feat: add skip-domains flag --- src/cli/cli.ts | 5 ++++- src/cli/flags.ts | 5 +++++ src/core/dialect-manager.ts | 12 +++++++++++- src/core/e2e.test.ts | 2 +- src/dialects/postgres/postgres-dialect.ts | 13 ++++++++++++- src/dialects/postgres/postgres-introspector.ts | 11 ++++++++++- src/serializer/serializer.test.ts | 2 +- src/transformer/transformer.test.ts | 2 +- 8 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index ae176a1..7d2166c 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -26,6 +26,7 @@ export type CliOptions = { outFile?: string | undefined; print?: boolean; schema?: string | undefined; + skipDomains?: boolean; typeOnlyImports?: boolean; url: string; verify?: boolean | undefined; @@ -62,7 +63,9 @@ export class Cli { logger.info(`No dialect specified. Assuming '${inferredDialectName}'.`); } - const dialectManager = new DialectManager(); + const dialectManager = new DialectManager({ + skipDomains: options.skipDomains ?? false, + }); const dialect = dialectManager.getDialect( options.dialectName ?? inferredDialectName, ); diff --git a/src/cli/flags.ts b/src/cli/flags.ts index 8d2b4d0..dbaa2db 100644 --- a/src/cli/flags.ts +++ b/src/cli/flags.ts @@ -66,6 +66,11 @@ export const FLAGS: Flag[] = [ description: 'Set the default schema of the database connection.', longName: 'schema', }, + { + description: + 'Skip generating type information for postgres domains. (default: false)', + longName: 'skip-domains', + }, { description: 'Verify that the generated types are up-to-date. (default: false)', diff --git a/src/core/dialect-manager.ts b/src/core/dialect-manager.ts index c094224..cbbdc02 100644 --- a/src/core/dialect-manager.ts +++ b/src/core/dialect-manager.ts @@ -16,10 +16,20 @@ export type DialectName = | 'postgres' | 'sqlite'; +export type DialectManagerOptions = { + skipDomains: boolean; +}; + /** * Returns a dialect instance for a pre-defined dialect name. */ export class DialectManager { + readonly #options: DialectManagerOptions; + + constructor(opts: DialectManagerOptions) { + this.#options = opts; + } + getDialect(name: DialectName): Dialect { switch (name) { case 'bun-sqlite': @@ -31,7 +41,7 @@ export class DialectManager { case 'mysql': return new MysqlDialect(); case 'postgres': - return new PostgresDialect(); + return new PostgresDialect(this.#options); default: return new SqliteDialect(); } diff --git a/src/core/e2e.test.ts b/src/core/e2e.test.ts index a516552..bcc60c7 100644 --- a/src/core/e2e.test.ts +++ b/src/core/e2e.test.ts @@ -35,7 +35,7 @@ const TESTS: Test[] = [ }, { connectionString: 'postgres://user:password@localhost:5433/database', - dialect: new PostgresDialect(), + dialect: new PostgresDialect({ skipDomains: false }), values: { false: false, id: 1, true: true }, }, { diff --git a/src/dialects/postgres/postgres-dialect.ts b/src/dialects/postgres/postgres-dialect.ts index 78a513c..637f560 100644 --- a/src/dialects/postgres/postgres-dialect.ts +++ b/src/dialects/postgres/postgres-dialect.ts @@ -4,9 +4,20 @@ import { Dialect } from '../../core'; import { PostgresAdapter } from './postgres-adapter'; import { PostgresIntrospector } from './postgres-introspector'; +export type PostgresDialectOptions = { + skipDomains: boolean; +}; + export class PostgresDialect extends Dialect { + readonly #options: PostgresDialectOptions; readonly adapter = new PostgresAdapter(); - readonly introspector = new PostgresIntrospector(this.adapter); + readonly introspector; + + constructor(opts: PostgresDialectOptions) { + super(); + this.#options = opts; + this.introspector = new PostgresIntrospector(this.adapter, this.#options); + } async createKyselyDialect(options: CreateKyselyDialectOptions) { const { Pool } = await import('pg'); diff --git a/src/dialects/postgres/postgres-introspector.ts b/src/dialects/postgres/postgres-introspector.ts index 1a8cae6..32cb0a4 100644 --- a/src/dialects/postgres/postgres-introspector.ts +++ b/src/dialects/postgres/postgres-introspector.ts @@ -17,12 +17,18 @@ type PostgresDomainInspector = { rootType: string; }; +export type PostgresIntrospectorOptions = { + skipDomains: boolean; +}; + export class PostgresIntrospector extends Introspector { readonly adapter: PostgresAdapter; + readonly #options: PostgresIntrospectorOptions; - constructor(adapter: PostgresAdapter) { + constructor(adapter: PostgresAdapter, opts: PostgresIntrospectorOptions) { super(); this.adapter = adapter; + this.#options = opts; } #createDatabaseMetadata( @@ -94,6 +100,9 @@ export class PostgresIntrospector extends Introspector { } async #introspectDomains(db: Kysely) { + if (this.#options.skipDomains) { + return []; + } const result = await sql` with recursive domain_hierarchy as ( select oid, typbasetype diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 757c310..4307ebd 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -320,7 +320,7 @@ export const testSerializer = () => { void describe('serialize', () => { void it('should serialize Postgres JSON fields properly', () => { - const dialect = new PostgresDialect(); + const dialect = new PostgresDialect({ skipDomains: false }); const enums = new EnumCollection(); const transformer = new Transformer(); diff --git a/src/transformer/transformer.test.ts b/src/transformer/transformer.test.ts index 0220f7d..c6cde8a 100644 --- a/src/transformer/transformer.test.ts +++ b/src/transformer/transformer.test.ts @@ -32,7 +32,7 @@ export const testTransformer = () => { }); const transform = (tables: TableMetadata[], camelCase: boolean) => { - const dialect = new PostgresDialect(); + const dialect = new PostgresDialect({ skipDomains: false }); const transformer = new Transformer(); const metadata = new DatabaseMetadata(tables, enums); return transformer.transform({ camelCase, dialect, metadata }); From f8a3300fb1f396821ef46cae741bbfd02f5d3873 Mon Sep 17 00:00:00 2001 From: brettbedarfmw Date: Fri, 8 Mar 2024 13:52:16 -0700 Subject: [PATCH 05/29] camel case edits --- .gitignore | 1 + package.json | 8 +- pnpm-lock.yaml | 564 ++++++++++++++++++++++++---- src/dialects/mssql/mssql-dialect.ts | 3 +- src/transformer/case-converter.ts | 3 + src/transformer/transformer.ts | 3 +- 6 files changed, 499 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 862bcb6..4701d0b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ **/*.DS_Store **/*.tsbuildinfo **/.env +.vscode/settings.json diff --git a/package.json b/package.json index 5ccd6b6..1a7d621 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "start": "node ./dist/cli/bin.js", "test": "ts-node-dev ./src/index.test.ts", "test:watch": "ts-node-dev --quiet --respawn ./src/index.test.ts", - "upgrade": "ncu -u" + "upgrade": "ncu -u", + "postinstall": "test -d node_modules/kysely/dist || (cd node_modules/kysely && pnpm run build)" }, "dependencies": { "chalk": "4.1.2", @@ -59,8 +60,8 @@ "@typescript-eslint/parser": "^6.20.0", "better-sqlite3": "^9.3.0", "eslint": "^8.56.0", + "kysely": "github:kysely-org/kysely#d1c1322", "kysely-bun-worker": "^0.5.6", - "kysely": "^0.27.2", "mysql2": "^3.9.1", "npm-run-all": "^4.1.5", "pg": "^8.11.3", @@ -77,7 +78,7 @@ "@tediousjs/connection-string": "^0.5.0", "better-sqlite3": ">=7.6.2", "kysely-bun-worker": "^0.5.3", - "kysely": "^0.27.0", + "kysely": "github:kysely-org/kysely#d1c1322", "mysql2": "^2.3.3 || ^3.0.0", "pg": "^8.8.0", "tarn": "^3.0.0", @@ -112,6 +113,7 @@ "optional": true } }, + "eslintConfig": { "extends": [ "@robinblomberg/robinblomberg", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d6c1be..dfefb03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@tediousjs/connection-string': + specifier: ^0.5.0 + version: 0.5.0 chalk: specifier: 4.1.2 version: 4.1.2 @@ -20,6 +23,12 @@ dependencies: minimist: specifier: ^1.2.8 version: 1.2.8 + tarn: + specifier: ^3.0.0 + version: 3.0.2 + tedious: + specifier: ^16.6.0 + version: 16.7.1 devDependencies: '@libsql/kysely-libsql': @@ -52,6 +61,9 @@ devDependencies: '@types/pg': specifier: ^8.11.0 version: 8.11.0 + '@types/tedious': + specifier: 4.0.14 + version: 4.0.14 '@typescript-eslint/parser': specifier: ^6.20.0 version: 6.20.0(eslint@8.56.0)(typescript@5.3.3) @@ -62,8 +74,8 @@ devDependencies: specifier: ^8.56.0 version: 8.56.0 kysely: - specifier: ^0.27.2 - version: 0.27.2 + specifier: github:kysely-org/kysely#d1c1322 + version: github.com/kysely-org/kysely/d1c1322 kysely-bun-worker: specifier: ^0.5.6 version: 0.5.6(kysely@0.27.2) @@ -113,6 +125,172 @@ packages: '@jridgewell/trace-mapping': 0.3.20 dev: true + /@azure/abort-controller@1.1.0: + resolution: {integrity: sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==} + engines: {node: '>=12.0.0'} + dependencies: + tslib: 2.6.2 + dev: false + + /@azure/abort-controller@2.0.0: + resolution: {integrity: sha512-RP/mR/WJchR+g+nQFJGOec+nzeN/VvjlwbinccoqfhTsTHbb8X5+mLDp48kHT0ueyum0BNSwGm0kX0UZuIqTGg==} + engines: {node: '>=18.0.0'} + dependencies: + tslib: 2.6.2 + dev: false + + /@azure/core-auth@1.6.0: + resolution: {integrity: sha512-3X9wzaaGgRaBCwhLQZDtFp5uLIXCPrGbwJNWPPugvL4xbIGgScv77YzzxToKGLAKvG9amDoofMoP+9hsH1vs1w==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 2.0.0 + '@azure/core-util': 1.7.0 + tslib: 2.6.2 + dev: false + + /@azure/core-client@1.8.0: + resolution: {integrity: sha512-+gHS3gEzPlhyQBMoqVPOTeNH031R5DM/xpCvz72y38C09rg4Hui/1sJS/ujoisDZbbSHyuRLVWdFlwL0pIFwbg==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 2.0.0 + '@azure/core-auth': 1.6.0 + '@azure/core-rest-pipeline': 1.14.0 + '@azure/core-tracing': 1.0.1 + '@azure/core-util': 1.7.0 + '@azure/logger': 1.0.4 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@azure/core-http-compat@2.0.1: + resolution: {integrity: sha512-xpQZz/q7E0jSW4rckrTo2mDFDQgo6I69hBU4voMQi7REi6JRW5a+KfVkbJCFCWnkFmP6cAJ0IbuudTdf/MEBOQ==} + engines: {node: '>=14.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-client': 1.8.0 + '@azure/core-rest-pipeline': 1.14.0 + transitivePeerDependencies: + - supports-color + dev: false + + /@azure/core-lro@2.6.0: + resolution: {integrity: sha512-PyRNcaIOfMgoUC01/24NoG+k8O81VrKxYARnDlo+Q2xji0/0/j2nIt8BwQh294pb1c5QnXTDPbNR4KzoDKXEoQ==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 2.0.0 + '@azure/core-util': 1.7.0 + '@azure/logger': 1.0.4 + tslib: 2.6.2 + dev: false + + /@azure/core-paging@1.5.0: + resolution: {integrity: sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==} + engines: {node: '>=14.0.0'} + dependencies: + tslib: 2.6.2 + dev: false + + /@azure/core-rest-pipeline@1.14.0: + resolution: {integrity: sha512-Tp4M6NsjCmn9L5p7HsW98eSOS7A0ibl3e5ntZglozT0XuD/0y6i36iW829ZbBq0qihlGgfaeFpkLjZ418KDm1Q==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 2.0.0 + '@azure/core-auth': 1.6.0 + '@azure/core-tracing': 1.0.1 + '@azure/core-util': 1.7.0 + '@azure/logger': 1.0.4 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@azure/core-tracing@1.0.1: + resolution: {integrity: sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==} + engines: {node: '>=12.0.0'} + dependencies: + tslib: 2.6.2 + dev: false + + /@azure/core-util@1.7.0: + resolution: {integrity: sha512-Zq2i3QO6k9DA8vnm29mYM4G8IE9u1mhF1GUabVEqPNX8Lj833gdxQ2NAFxt2BZsfAL+e9cT8SyVN7dFVJ/Hf0g==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 2.0.0 + tslib: 2.6.2 + dev: false + + /@azure/identity@3.4.2: + resolution: {integrity: sha512-0q5DL4uyR0EZ4RXQKD8MadGH6zTIcloUoS/RVbCpNpej4pwte0xpqYxk8K97Py2RiuUvI7F4GXpoT4046VfufA==} + engines: {node: '>=14.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.6.0 + '@azure/core-client': 1.8.0 + '@azure/core-rest-pipeline': 1.14.0 + '@azure/core-tracing': 1.0.1 + '@azure/core-util': 1.7.0 + '@azure/logger': 1.0.4 + '@azure/msal-browser': 3.10.0 + '@azure/msal-node': 2.6.4 + events: 3.3.0 + jws: 4.0.0 + open: 8.4.2 + stoppable: 1.1.0 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@azure/keyvault-keys@4.8.0: + resolution: {integrity: sha512-jkuYxgkw0aaRfk40OQhFqDIupqblIOIlYESWB6DKCVDxQet1pyv86Tfk9M+5uFM0+mCs6+MUHU+Hxh3joiUn4Q==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.6.0 + '@azure/core-client': 1.8.0 + '@azure/core-http-compat': 2.0.1 + '@azure/core-lro': 2.6.0 + '@azure/core-paging': 1.5.0 + '@azure/core-rest-pipeline': 1.14.0 + '@azure/core-tracing': 1.0.1 + '@azure/core-util': 1.7.0 + '@azure/logger': 1.0.4 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@azure/logger@1.0.4: + resolution: {integrity: sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==} + engines: {node: '>=14.0.0'} + dependencies: + tslib: 2.6.2 + dev: false + + /@azure/msal-browser@3.10.0: + resolution: {integrity: sha512-mnmi8dCXVNZI+AGRq0jKQ3YiodlIC4W9npr6FCB9WN6NQT+6rq+cIlxgUb//BjLyzKsnYo+i4LROGeMyU+6v1A==} + engines: {node: '>=0.8.0'} + dependencies: + '@azure/msal-common': 14.7.1 + dev: false + + /@azure/msal-common@14.7.1: + resolution: {integrity: sha512-v96btzjM7KrAu4NSEdOkhQSTGOuNUIIsUdB8wlyB9cdgl5KqEKnTonHUZ8+khvZ6Ap542FCErbnTyDWl8lZ2rA==} + engines: {node: '>=0.8.0'} + dev: false + + /@azure/msal-node@2.6.4: + resolution: {integrity: sha512-nNvEPx009/80UATCToF+29NZYocn01uKrB91xtFr7bSqkqO1PuQGXRyYwryWRztUrYZ1YsSbw9A+LmwOhpVvcg==} + engines: {node: '>=16'} + dependencies: + '@azure/msal-common': 14.7.1 + jsonwebtoken: 9.0.2 + uuid: 8.3.2 + dev: false + /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} @@ -661,6 +839,10 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /@js-joda/core@5.6.1: + resolution: {integrity: sha512-Xla/d7ZMMR6+zRd6lTio0wRZECfcfFJP7GGe9A9L4tDOlD5CX4YcZ4YZle9w58bBYzssojVapI84RraKWDQZRg==} + dev: false + /@libsql/hrana-client@0.4.4: resolution: {integrity: sha512-BevUg0UBRLs5AEqn0fjrMcl49xCtwuFavgK4MzCb3PTtxpEbQ24oGXctspN9drBiUVmqSZr7go887aiLLzSO3A==} dependencies: @@ -698,7 +880,7 @@ packages: kysely: '*' dependencies: '@libsql/hrana-client': 0.4.4 - kysely: 0.27.2 + kysely: github.com/kysely-org/kysely/d1c1322 transitivePeerDependencies: - bufferutil - encoding @@ -897,6 +1079,15 @@ packages: resolution: {integrity: sha512-mbO9WxhDzqQ2hxJalWEvcSxUi6M1HCDEcvzcZJqIdzb4rrSxuCGlpqh94r5jT683I1ux06XtUHk5nEQEGnqGvQ==} dev: true + /@tediousjs/connection-string@0.5.0: + resolution: {integrity: sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==} + dev: false + + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -960,7 +1151,6 @@ packages: resolution: {integrity: sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==} dependencies: undici-types: 5.26.5 - dev: true /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -974,6 +1164,13 @@ packages: pg-types: 4.0.1 dev: true + /@types/readable-stream@4.0.10: + resolution: {integrity: sha512-AbUKBjcC8SHmImNi4yK2bbjogQlkFSg7shZCcicxPQapniOlajG8GCc39lvXzCWX4lLRRs7DM3VAeSlqmEVZUA==} + dependencies: + '@types/node': 20.11.16 + safe-buffer: 5.1.2 + dev: false + /@types/semver@7.5.6: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true @@ -986,6 +1183,12 @@ packages: resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==} dev: true + /@types/tedious@4.0.14: + resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==} + dependencies: + '@types/node': 20.11.16 + dev: true + /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: @@ -1229,6 +1432,13 @@ packages: pretty-format: 29.7.0 dev: true + /abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: false + /acorn-jsx@5.3.2(acorn@8.11.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1259,6 +1469,15 @@ packages: hasBin: true dev: true + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -1332,7 +1551,6 @@ packages: dependencies: call-bind: 1.0.5 is-array-buffer: 3.0.2 - dev: true /array-includes@3.1.7: resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} @@ -1402,7 +1620,6 @@ packages: get-intrinsic: 1.2.2 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 - dev: true /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} @@ -1425,7 +1642,6 @@ packages: /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} - dev: true /axe-core@4.7.0: resolution: {integrity: sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==} @@ -1443,7 +1659,6 @@ packages: /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: true /better-sqlite3@9.3.0: resolution: {integrity: sha512-ww73jVpQhRRdS9uMr761ixlkl4bWoXi8hMQlBGhoN6vPNlUHpIsNmw4pKN6kjknlt/wopdvXHvLk1W75BI+n0Q==} @@ -1472,6 +1687,15 @@ packages: readable-stream: 3.6.2 dev: true + /bl@6.0.11: + resolution: {integrity: sha512-Ok/NWrEA0mlEEbWzckkZVLq6Nv1m2xZ+i9Jq5hZ9Ph/YEcP5dExqls9wUzpluhQRPzdeT8oZNOXAytta6YN8pQ==} + dependencies: + '@types/readable-stream': 4.0.10 + buffer: 6.0.3 + inherits: 2.0.4 + readable-stream: 4.5.2 + dev: false + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1501,6 +1725,10 @@ packages: update-browserslist-db: 1.0.13(browserslist@4.22.3) dev: true + /buffer-equal-constant-time@1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + dev: false + /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true @@ -1517,6 +1745,13 @@ packages: ieee754: 1.2.1 dev: true + /buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -1533,7 +1768,6 @@ packages: function-bind: 1.1.2 get-intrinsic: 1.2.2 set-function-length: 1.1.1 - dev: true /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -1700,7 +1934,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} @@ -1732,7 +1965,11 @@ packages: get-intrinsic: 1.2.2 gopd: 1.0.1 has-property-descriptors: 1.0.1 - dev: true + + /define-lazy-prop@2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + dev: false /define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} @@ -1741,7 +1978,6 @@ packages: define-data-property: 1.1.1 has-property-descriptors: 1.0.1 object-keys: 1.1.1 - dev: true /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} @@ -1814,6 +2050,12 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true + /ecdsa-sig-formatter@1.0.11: + resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + dependencies: + safe-buffer: 5.2.1 + dev: false + /electron-to-chromium@1.4.655: resolution: {integrity: sha512-2yszojF7vIZ68adIOvzV4bku8OZad9w5H9xF3ZAMZjPuOjBarlflUkjN6DggdV+L71WZuKUfKUhov/34+G5QHg==} dev: true @@ -1881,7 +2123,25 @@ packages: typed-array-length: 1.0.4 unbox-primitive: 1.0.2 which-typed-array: 1.1.13 - dev: true + + /es-aggregate-error@1.0.12: + resolution: {integrity: sha512-j0PupcmELoVbYS2NNrsn5zcLLEsryQwP02x8fRawh7c2eEaPHwJFAxltZsqV7HJjsF57+SMpYyVRWgbVLfOagg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + define-properties: 1.2.1 + es-abstract: 1.22.3 + es-errors: 1.3.0 + function-bind: 1.1.2 + globalthis: 1.0.3 + has-property-descriptors: 1.0.1 + set-function-name: 2.0.1 + dev: false + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: false /es-iterator-helpers@1.0.15: resolution: {integrity: sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==} @@ -1909,7 +2169,6 @@ packages: get-intrinsic: 1.2.2 has-tostringtag: 1.0.0 hasown: 2.0.0 - dev: true /es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} @@ -1924,7 +2183,6 @@ packages: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 - dev: true /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} @@ -2321,6 +2579,16 @@ packages: engines: {node: '>=0.10.0'} dev: true + /event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: false + + /events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: false + /execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} @@ -2420,7 +2688,6 @@ packages: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 - dev: true /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} @@ -2465,11 +2732,9 @@ packages: define-properties: 1.2.1 es-abstract: 1.22.3 functions-have-names: 1.2.3 - dev: true /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true /generate-function@2.3.1: resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} @@ -2493,7 +2758,6 @@ packages: has-proto: 1.0.1 has-symbols: 1.0.3 hasown: 2.0.0 - dev: true /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} @@ -2506,7 +2770,6 @@ packages: dependencies: call-bind: 1.0.5 get-intrinsic: 1.2.2 - dev: true /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} @@ -2582,7 +2845,6 @@ packages: engines: {node: '>= 0.4'} dependencies: define-properties: 1.2.1 - dev: true /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} @@ -2600,7 +2862,6 @@ packages: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.2 - dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -2612,7 +2873,6 @@ packages: /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -2626,24 +2886,20 @@ packages: resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} dependencies: get-intrinsic: 1.2.2 - dev: true /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} - dev: true /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true /has-tostringtag@1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: true /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} @@ -2655,6 +2911,27 @@ packages: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} @@ -2665,11 +2942,9 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 - dev: true /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - dev: true /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} @@ -2714,7 +2989,6 @@ packages: get-intrinsic: 1.2.2 hasown: 2.0.0 side-channel: 1.0.4 - dev: true /interpret@1.4.0: resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} @@ -2727,7 +3001,6 @@ packages: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-typed-array: 1.1.12 - dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} @@ -2744,7 +3017,6 @@ packages: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 - dev: true /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} @@ -2759,7 +3031,6 @@ packages: dependencies: call-bind: 1.0.5 has-tostringtag: 1.0.0 - dev: true /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} @@ -2771,7 +3042,6 @@ packages: /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - dev: true /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} @@ -2783,7 +3053,12 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true + + /is-docker@2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + dev: false /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -2822,14 +3097,12 @@ packages: /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} - dev: true /is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} @@ -2850,7 +3123,6 @@ packages: dependencies: call-bind: 1.0.5 has-tostringtag: 1.0.0 - dev: true /is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} @@ -2860,7 +3132,6 @@ packages: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.5 - dev: true /is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} @@ -2872,21 +3143,18 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: true /is-typed-array@1.1.12: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} dependencies: which-typed-array: 1.1.13 - dev: true /is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} @@ -2896,7 +3164,6 @@ packages: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: call-bind: 1.0.5 - dev: true /is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} @@ -2905,9 +3172,15 @@ packages: get-intrinsic: 1.2.2 dev: true + /is-wsl@2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + dependencies: + is-docker: 2.2.1 + dev: false + /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2936,6 +3209,10 @@ packages: resolution: {integrity: sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==} dev: true + /js-md4@0.3.2: + resolution: {integrity: sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==} + dev: false + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -2947,6 +3224,10 @@ packages: argparse: 2.0.1 dev: true + /jsbi@4.3.0: + resolution: {integrity: sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==} + dev: false + /jsdoc-type-pratt-parser@4.0.0: resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} engines: {node: '>=12.0.0'} @@ -3006,6 +3287,22 @@ packages: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} dev: true + /jsonwebtoken@9.0.2: + resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} + engines: {node: '>=12', npm: '>=6'} + dependencies: + jws: 3.2.2 + lodash.includes: 4.3.0 + lodash.isboolean: 3.0.3 + lodash.isinteger: 4.0.4 + lodash.isnumber: 3.0.3 + lodash.isplainobject: 4.0.6 + lodash.isstring: 4.0.1 + lodash.once: 4.1.1 + ms: 2.1.3 + semver: 7.5.4 + dev: false + /jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} @@ -3016,6 +3313,36 @@ packages: object.values: 1.1.7 dev: true + /jwa@1.4.1: + resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + dev: false + + /jwa@2.0.0: + resolution: {integrity: sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==} + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + dev: false + + /jws@3.2.2: + resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} + dependencies: + jwa: 1.4.1 + safe-buffer: 5.2.1 + dev: false + + /jws@4.0.0: + resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==} + dependencies: + jwa: 2.0.0 + safe-buffer: 5.2.1 + dev: false + /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: @@ -3027,15 +3354,10 @@ packages: peerDependencies: kysely: '>=0.26' dependencies: - kysely: 0.27.2 + kysely: github.com/kysely-org/kysely/d1c1322 zen-mitt: 0.3.0 dev: true - /kysely@0.27.2: - resolution: {integrity: sha512-DmRvEfiR/NLpgsTbSxma2ldekhsdcd65+MNiKXyd/qj7w7X5e3cLkXxcj+MypsRDjPhHQ/CD5u3Eq1sBYzX0bw==} - engines: {node: '>=14.0.0'} - dev: true - /language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} dev: true @@ -3091,10 +3413,38 @@ packages: p-locate: 5.0.0 dev: true + /lodash.includes@4.3.0: + resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} + dev: false + + /lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + dev: false + + /lodash.isinteger@4.0.4: + resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} + dev: false + + /lodash.isnumber@3.0.3: + resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} + dev: false + + /lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + dev: false + + /lodash.isstring@4.0.1: + resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + dev: false + /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true + /lodash.once@4.1.1: + resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + dev: false + /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true @@ -3137,7 +3487,6 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 - dev: true /lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} @@ -3249,11 +3598,9 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true /mysql2@3.9.1: resolution: {integrity: sha512-3njoWAAhGBYy0tWBabqUQcLtczZUxrmmtc2vszQUekg3kTJyZ5/IeLC3Fo04u6y6Iy5Sba7pIIa2P/gs8D3ZeQ==} @@ -3286,6 +3633,10 @@ packages: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} dev: true + /native-duplexpair@1.0.0: + resolution: {integrity: sha512-E7QQoM+3jvNtlmyfqRZ0/U75VFgCls+fSkbml2MpgWkWyz3ox8Y58gNhfuziuQYGNNQAbFZJQck55LHCnCK6CA==} + dev: false + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -3301,6 +3652,10 @@ packages: semver: 7.5.4 dev: true + /node-abort-controller@3.1.1: + resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + dev: false + /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -3361,12 +3716,10 @@ packages: /object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} - dev: true /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} - dev: true /object.assign@4.1.5: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} @@ -3376,7 +3729,6 @@ packages: define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 - dev: true /object.entries@1.1.7: resolution: {integrity: sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==} @@ -3437,6 +3789,15 @@ packages: mimic-fn: 4.0.0 dev: true + /open@8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 + is-wsl: 2.2.0 + dev: false + /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -3795,6 +4156,11 @@ packages: react-is: 18.2.0 dev: true + /process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: false + /prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} dependencies: @@ -3874,6 +4240,17 @@ packages: util-deprecate: 1.0.2 dev: true + /readable-stream@4.5.2: + resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + abort-controller: 3.0.0 + buffer: 6.0.3 + events: 3.3.0 + process: 0.11.10 + string_decoder: 1.3.0 + dev: false + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -3916,7 +4293,6 @@ packages: call-bind: 1.0.5 define-properties: 1.2.1 set-function-name: 2.0.1 - dev: true /regjsparser@0.10.0: resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} @@ -4020,11 +4396,13 @@ packages: get-intrinsic: 1.2.2 has-symbols: 1.0.3 isarray: 2.0.5 - dev: true + + /safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: false /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} @@ -4032,11 +4410,9 @@ packages: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-regex: 1.1.4 - dev: true /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} @@ -4054,7 +4430,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: true /seq-queue@0.0.5: resolution: {integrity: sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==} @@ -4068,7 +4443,6 @@ packages: get-intrinsic: 1.2.2 gopd: 1.0.1 has-property-descriptors: 1.0.1 - dev: true /set-function-name@2.0.1: resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} @@ -4077,7 +4451,6 @@ packages: define-data-property: 1.1.1 functions-have-names: 1.2.3 has-property-descriptors: 1.0.1 - dev: true /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} @@ -4128,7 +4501,6 @@ packages: call-bind: 1.0.5 get-intrinsic: 1.2.2 object-inspect: 1.13.1 - dev: true /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -4207,6 +4579,10 @@ packages: engines: {node: '>= 10.x'} dev: true + /sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + dev: false + /sqlstring@2.3.3: resolution: {integrity: sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==} engines: {node: '>= 0.6'} @@ -4220,6 +4596,11 @@ packages: resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} dev: true + /stoppable@1.1.0: + resolution: {integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==} + engines: {node: '>=4', npm: '>=6'} + dev: false + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4268,7 +4649,6 @@ packages: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 - dev: true /string.prototype.trimend@1.0.7: resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} @@ -4276,7 +4656,6 @@ packages: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 - dev: true /string.prototype.trimstart@1.0.7: resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} @@ -4284,13 +4663,11 @@ packages: call-bind: 1.0.5 define-properties: 1.2.1 es-abstract: 1.22.3 - dev: true /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 - dev: true /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} @@ -4375,6 +4752,30 @@ packages: readable-stream: 3.6.2 dev: true + /tarn@3.0.2: + resolution: {integrity: sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==} + engines: {node: '>=8.0.0'} + dev: false + + /tedious@16.7.1: + resolution: {integrity: sha512-NmedZS0NJiTv3CoYnf1FtjxIDUgVYzEmavrc8q2WHRb+lP4deI9BpQfmNnBZZaWusDbP5FVFZCcvzb3xOlNVlQ==} + engines: {node: '>=16'} + dependencies: + '@azure/identity': 3.4.2 + '@azure/keyvault-keys': 4.8.0 + '@js-joda/core': 5.6.1 + bl: 6.0.11 + es-aggregate-error: 1.0.12 + iconv-lite: 0.6.3 + js-md4: 0.3.2 + jsbi: 4.3.0 + native-duplexpair: 1.0.0 + node-abort-controller: 3.1.1 + sprintf-js: 1.1.3 + transitivePeerDependencies: + - supports-color + dev: false + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true @@ -4508,6 +4909,10 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: false + /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -4569,7 +4974,6 @@ packages: call-bind: 1.0.5 get-intrinsic: 1.2.2 is-typed-array: 1.1.12 - dev: true /typed-array-byte-length@1.0.0: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} @@ -4579,7 +4983,6 @@ packages: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 - dev: true /typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} @@ -4590,7 +4993,6 @@ packages: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 - dev: true /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} @@ -4598,7 +5000,6 @@ packages: call-bind: 1.0.5 for-each: 0.3.3 is-typed-array: 1.1.12 - dev: true /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} @@ -4617,11 +5018,9 @@ packages: has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 - dev: true /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - dev: true /update-browserslist-db@1.0.13(browserslist@4.22.3): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} @@ -4644,6 +5043,11 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true + /uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: false + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true @@ -4788,7 +5192,6 @@ packages: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 - dev: true /which-builtin-type@1.1.3: resolution: {integrity: sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==} @@ -4826,7 +5229,6 @@ packages: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 - dev: true /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} @@ -4897,7 +5299,6 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} @@ -4919,3 +5320,10 @@ packages: dependencies: '@subframe7536/type-utils': 0.1.4 dev: true + + github.com/kysely-org/kysely/d1c1322: + resolution: {tarball: https://codeload.github.com/kysely-org/kysely/tar.gz/d1c1322} + name: kysely + version: 0.27.2 + engines: {node: '>=14.0.0'} + dev: true diff --git a/src/dialects/mssql/mssql-dialect.ts b/src/dialects/mssql/mssql-dialect.ts index a87fa31..045a4bb 100644 --- a/src/dialects/mssql/mssql-dialect.ts +++ b/src/dialects/mssql/mssql-dialect.ts @@ -1,5 +1,6 @@ import { MssqlDialect as KyselyMssqlDialect } from 'kysely'; -import { CreateKyselyDialectOptions, Dialect } from '../../core'; +import type { CreateKyselyDialectOptions } from '../../core'; +import { Dialect } from '../../core'; import { MssqlAdapter } from './mssql-adapter'; import { MssqlIntrospector } from './mssql-introspector'; diff --git a/src/transformer/case-converter.ts b/src/transformer/case-converter.ts index 93d47ff..b3268cd 100644 --- a/src/transformer/case-converter.ts +++ b/src/transformer/case-converter.ts @@ -1,6 +1,9 @@ import { CamelCasePlugin } from 'kysely'; class CaseConverter extends CamelCasePlugin { + constructor() { + super({underscoreBeforeDigits:true,}); + } toCamelCase(string: string) { return this.camelCase(string); } diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 7f24151..94b7607 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -320,7 +320,8 @@ export class Transformer { const tableProperties: PropertyNode[] = []; for (const column of table.columns) { - const key = this.#transformName(column.name, context); + const lowerColumnName = column.name.toLowerCase(); + const key = this.#transformName(lowerColumnName, context); const value = this.#transformColumn(column, context); const tableProperty = new PropertyNode(key, value); tableProperties.push(tableProperty); From 56a854fa349b514bdbe6cd26d31551ec779ee1a1 Mon Sep 17 00:00:00 2001 From: brettbedarfmw Date: Fri, 8 Mar 2024 13:53:10 -0700 Subject: [PATCH 06/29] ignore generated types --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4701d0b..59e1144 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ **/*.tsbuildinfo **/.env .vscode/settings.json +output/ +gen/ From 90b7e4a527a5eda1332e8c92adc725aa5b825a09 Mon Sep 17 00:00:00 2001 From: brettbedarfmw Date: Fri, 8 Mar 2024 14:14:27 -0700 Subject: [PATCH 07/29] add lower case option --- src/cli/cli.ts | 10 +++++++++- src/cli/flags.ts | 4 ++++ src/generator/generator.ts | 2 ++ src/transformer/transformer.ts | 10 +++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index ae176a1..2b65bac 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -29,6 +29,7 @@ export type CliOptions = { typeOnlyImports?: boolean; url: string; verify?: boolean | undefined; + lowerCaseFields?: boolean | undefined }; export type LogLevelName = (typeof LOG_LEVEL_NAMES)[number]; @@ -44,7 +45,7 @@ export class Cli { const includePattern = options.includePattern; const schema = options.schema; const typeOnlyImports = options.typeOnlyImports; - + const lowerCase = options.lowerCaseFields; const logger = new Logger(options.logLevel); const connectionStringParser = new ConnectionStringParser(); @@ -76,6 +77,7 @@ export class Cli { await generator.generate({ camelCase, + lowerCase, db, dialect, excludePattern, @@ -147,6 +149,7 @@ export class Cli { const _: string[] = argv._; const camelCase = this.#parseBoolean(argv['camel-case']); + const lowerCase = this.#parseBoolean(argv['lower-case']) const dialectName = argv.dialect; const help = !!argv.h || !!argv.help || _.includes('-h') || _.includes('--help'); @@ -193,6 +196,10 @@ export class Cli { ' --url=env(DATABASE_URL)', ); } + + if (camelCase && lowerCase) { + throw new Error('Cannot use --camel-case and --lower-case at the same time.') + } } catch (error) { if (logLevel > LogLevel.SILENT) { if (error instanceof Error) { @@ -223,6 +230,7 @@ export class Cli { typeOnlyImports, url, verify, + lowerCaseFields: lowerCase }; } diff --git a/src/cli/flags.ts b/src/cli/flags.ts index 8d2b4d0..273f92b 100644 --- a/src/cli/flags.ts +++ b/src/cli/flags.ts @@ -11,6 +11,10 @@ export const FLAGS: Flag[] = [ description: 'Use the Kysely CamelCasePlugin.', longName: 'camel-case', }, + { + description: 'Convert table and column names to lower case.', + longName: 'lower-case', + }, { description: `Set the SQL dialect. (values: [${VALID_DIALECTS.join( ', ', diff --git a/src/generator/generator.ts b/src/generator/generator.ts index 586b990..378e6f8 100644 --- a/src/generator/generator.ts +++ b/src/generator/generator.ts @@ -9,6 +9,7 @@ import { Transformer } from '../transformer'; export type GenerateOptions = { camelCase?: boolean; + lowerCase?: boolean; db: Kysely; dialect: Dialect; excludePattern?: string; @@ -50,6 +51,7 @@ export class Generator { const transformer = options.transformer ?? new Transformer(); const nodes = transformer.transform({ camelCase: !!options.camelCase, + lowerCase: !!options.lowerCase, defaultSchema: options.schema, dialect: options.dialect, metadata, diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 94b7607..9f4e664 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -42,6 +42,7 @@ const unionize = (args: ExpressionNode[]) => { export type TransformContext = { camelCase: boolean; + lowerCase:boolean; defaultScalar: ExpressionNode; defaultSchema: string | null; definitions: Definitions; @@ -54,6 +55,7 @@ export type TransformContext = { export type TransformOptions = { camelCase: boolean; + lowerCase: boolean; defaultSchema?: string; dialect: Dialect; metadata: DatabaseMetadata; @@ -310,7 +312,13 @@ export class Transformer { } #transformName(name: string, context: TransformContext) { - return context.camelCase ? toCamelCase(name) : name; + if (context.camelCase){ + toCamelCase(name) + } else if (context.lowerCase) { + return name.toLowerCase(); + } else { + return name; + } } #transformTables(context: TransformContext) { From b0b85d75f2b115ab687200ade08869ebdd14833b Mon Sep 17 00:00:00 2001 From: Johan Eliasson Date: Sun, 17 Mar 2024 13:37:15 +0100 Subject: [PATCH 08/29] column comments --- package.json | 2 +- pnpm-lock.yaml | 20 ++++++++++---------- src/ast/property-node.ts | 4 +++- src/core/metadata/column-metadata.ts | 3 +++ src/serializer/serializer.ts | 10 +++++++++- src/transformer/transformer.ts | 3 ++- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 3f6ac40..c10f5d8 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@typescript-eslint/parser": "^7.1.1", "better-sqlite3": "^9.4.3", "eslint": "^8.57.0", - "kysely": "^0.27.2", + "kysely": "^0.27.3", "kysely-bun-worker": "^0.5.7", "mysql2": "^3.9.2", "npm-run-all": "^4.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 824bf4b..e132d59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,7 +36,7 @@ dependencies: devDependencies: '@libsql/kysely-libsql': specifier: ^0.3.0 - version: 0.3.0(kysely@0.27.2) + version: 0.3.0(kysely@0.27.3) '@robinblomberg/eslint-config-prettier': specifier: ^0.1.4 version: 0.1.4 @@ -77,11 +77,11 @@ devDependencies: specifier: ^8.57.0 version: 8.57.0 kysely: - specifier: ^0.27.2 - version: 0.27.2 + specifier: ^0.27.3 + version: 0.27.3 kysely-bun-worker: specifier: ^0.5.7 - version: 0.5.7(kysely@0.27.2) + version: 0.5.7(kysely@0.27.3) mysql2: specifier: ^3.9.2 version: 3.9.2 @@ -877,13 +877,13 @@ packages: - utf-8-validate dev: true - /@libsql/kysely-libsql@0.3.0(kysely@0.27.2): + /@libsql/kysely-libsql@0.3.0(kysely@0.27.3): resolution: {integrity: sha512-UEZB2giBFSR0NPwx2a8TxdnBEq20u7LfHupiwFc0t0VXAP1URdrSVv84rjMl/EAEs1tC6/Ex6O+OppwoKoJRbg==} peerDependencies: kysely: '*' dependencies: '@libsql/hrana-client': 0.4.4 - kysely: 0.27.2 + kysely: 0.27.3 transitivePeerDependencies: - bufferutil - encoding @@ -3405,16 +3405,16 @@ packages: json-buffer: 3.0.1 dev: true - /kysely-bun-worker@0.5.7(kysely@0.27.2): + /kysely-bun-worker@0.5.7(kysely@0.27.3): resolution: {integrity: sha512-P4W5moWU6A1xJ2GvGbdrPDiasSKTjuBfItU1vj+wZlA+A6AXv8Nxk0nScuBu8F12UnalrIDDu+oLCF5wC3Z4EA==} peerDependencies: kysely: '>=0.26' dependencies: - kysely: 0.27.2 + kysely: 0.27.3 dev: true - /kysely@0.27.2: - resolution: {integrity: sha512-DmRvEfiR/NLpgsTbSxma2ldekhsdcd65+MNiKXyd/qj7w7X5e3cLkXxcj+MypsRDjPhHQ/CD5u3Eq1sBYzX0bw==} + /kysely@0.27.3: + resolution: {integrity: sha512-lG03Ru+XyOJFsjH3OMY6R/9U38IjDPfnOfDgO3ynhbDr+Dz8fak+X6L62vqu3iybQnj+lG84OttBuU9KY3L9kA==} engines: {node: '>=14.0.0'} dev: true diff --git a/src/ast/property-node.ts b/src/ast/property-node.ts index a21f1ea..e47b9ef 100644 --- a/src/ast/property-node.ts +++ b/src/ast/property-node.ts @@ -5,9 +5,11 @@ export class PropertyNode { readonly key: string; readonly type = NodeType.PROPERTY; readonly value: ExpressionNode; + readonly comment?: string; - constructor(key: string, value: ExpressionNode) { + constructor(key: string, value: ExpressionNode, comment?: string) { this.key = key; this.value = value; + this.comment = comment; } } diff --git a/src/core/metadata/column-metadata.ts b/src/core/metadata/column-metadata.ts index 8382a8a..e9c7d75 100644 --- a/src/core/metadata/column-metadata.ts +++ b/src/core/metadata/column-metadata.ts @@ -7,6 +7,7 @@ export type ColumnMetadataOptions = { isAutoIncrementing?: boolean; isNullable?: boolean; name: string; + comment?: string; }; export class ColumnMetadata { @@ -18,6 +19,7 @@ export class ColumnMetadata { readonly isAutoIncrementing: boolean; readonly isNullable: boolean; readonly name: string; + readonly comment?: string; constructor(options: ColumnMetadataOptions) { this.dataType = options.dataType; @@ -28,5 +30,6 @@ export class ColumnMetadata { this.isAutoIncrementing = options.isAutoIncrementing ?? false; this.isNullable = options.isNullable ?? false; this.name = options.name; + this.comment = options.comment; } } diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index 411b9db..8f663a4 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -286,7 +286,6 @@ export class Serializer { ); for (const property of sortedProperties) { - data += ' '; data += this.serializeProperty(property); } } @@ -299,6 +298,15 @@ export class Serializer { serializeProperty(node: PropertyNode) { let data = ''; + console.log('node1:', node); + + if (node.comment) { + data += ` /**\n`; + data += ` * ${node.comment}\n`; + data += ` */\n`; + } + + data += ' '; data += this.serializeKey(node.key); data += ': '; data += this.serializeExpression(node.value); diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 30c23d7..5c92a22 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -322,7 +322,8 @@ export class Transformer { for (const column of table.columns) { const key = this.#transformName(column.name, context); const value = this.#transformColumn(column, context); - const tableProperty = new PropertyNode(key, value); + const comment = column.comment; + const tableProperty = new PropertyNode(key, value, comment); tableProperties.push(tableProperty); } From 633599f3a164fae3330ebfb56f2caa05a3329d2c Mon Sep 17 00:00:00 2001 From: Johan Eliasson Date: Sun, 17 Mar 2024 13:41:04 +0100 Subject: [PATCH 09/29] fix --- src/serializer/serializer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index 8f663a4..fd2d8bb 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -298,8 +298,6 @@ export class Serializer { serializeProperty(node: PropertyNode) { let data = ''; - console.log('node1:', node); - if (node.comment) { data += ` /**\n`; data += ` * ${node.comment}\n`; From fea605a51e64c0c97cebc261eeb6a2d6b94178b7 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 17 Mar 2024 21:00:30 +0100 Subject: [PATCH 10/29] feat: adjust API for --no-domains flag --- src/cli/cli.test.ts | 3 +++ src/cli/cli.ts | 24 +++++++++++++------ src/cli/flags.ts | 10 ++++---- src/core/dialect-manager.ts | 6 ++--- src/core/e2e.test.ts | 2 +- src/dialects/postgres/postgres-dialect.ts | 6 ++--- .../postgres/postgres-introspector.ts | 10 +++++--- src/serializer/serializer.test.ts | 2 +- src/transformer/transformer.test.ts | 2 +- 9 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/cli/cli.test.ts b/src/cli/cli.test.ts index 777a593..c3ce136 100644 --- a/src/cli/cli.test.ts +++ b/src/cli/cli.test.ts @@ -11,6 +11,7 @@ export const testCli = () => { const DEFAULT_CLI_OPTIONS: CliOptions = { camelCase: false, dialectName: undefined, + domains: false, envFile: undefined, excludePattern: undefined, includePattern: undefined, @@ -36,6 +37,8 @@ export const testCli = () => { assert(['--camel-case'], { camelCase: true }); assert(['--dialect=mysql'], { dialectName: 'mysql' }); + assert(['--domains'], { domains: true }); + assert(['--no-domains'], { domains: false }); assert(['--exclude-pattern=public._*'], { excludePattern: 'public._*' }); assert(['--help'], {}); assert(['-h'], {}); diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 7d2166c..64ad382 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -19,6 +19,7 @@ import { FLAGS } from './flags'; export type CliOptions = { camelCase?: boolean; dialectName?: DialectName | undefined; + domains?: boolean; envFile?: string | undefined; excludePattern?: string | undefined; includePattern?: string | undefined; @@ -26,7 +27,6 @@ export type CliOptions = { outFile?: string | undefined; print?: boolean; schema?: string | undefined; - skipDomains?: boolean; typeOnlyImports?: boolean; url: string; verify?: boolean | undefined; @@ -40,9 +40,9 @@ export type LogLevelName = (typeof LOG_LEVEL_NAMES)[number]; export class Cli { async generate(options: CliOptions) { const camelCase = !!options.camelCase; - const outFile = options.outFile; const excludePattern = options.excludePattern; const includePattern = options.includePattern; + const outFile = options.outFile; const schema = options.schema; const typeOnlyImports = options.typeOnlyImports; @@ -53,8 +53,8 @@ export class Cli { connectionStringParser.parse({ connectionString: options.url ?? DEFAULT_URL, dialectName: options.dialectName, - logger, envFile: options.envFile, + logger, }); if (options.dialectName) { @@ -64,7 +64,7 @@ export class Cli { } const dialectManager = new DialectManager({ - skipDomains: options.skipDomains ?? false, + skipDomains: !!options.domains, }); const dialect = dialectManager.getDialect( options.dialectName ?? inferredDialectName, @@ -151,10 +151,11 @@ export class Cli { const _: string[] = argv._; const camelCase = this.#parseBoolean(argv['camel-case']); const dialectName = argv.dialect; - const help = - !!argv.h || !!argv.help || _.includes('-h') || _.includes('--help'); + const domains = this.#parseBoolean(argv.domains); const envFile = argv['env-file'] as string | undefined; const excludePattern = argv['exclude-pattern'] as string | undefined; + const help = + !!argv.h || !!argv.help || _.includes('-h') || _.includes('--help'); const includePattern = argv['include-pattern'] as string | undefined; const logLevel = this.#getLogLevel(argv['log-level']); const outFile = @@ -172,7 +173,15 @@ export class Cli { for (const key in argv) { if ( key !== '_' && - !FLAGS.some((flag) => [flag.longName, flag.shortName].includes(key)) + !FLAGS.some((flag) => { + return [ + flag.shortName, + flag.longName, + ...(flag.longName.startsWith('no-') + ? [flag.longName.slice(3)] + : []), + ].includes(key); + }) ) { throw new RangeError(`Invalid flag: "${key}"`); } @@ -216,6 +225,7 @@ export class Cli { return { camelCase, dialectName, + domains, envFile, excludePattern, includePattern, diff --git a/src/cli/flags.ts b/src/cli/flags.ts index dbaa2db..317eb07 100644 --- a/src/cli/flags.ts +++ b/src/cli/flags.ts @@ -43,6 +43,11 @@ export const FLAGS: Flag[] = [ 'Set the terminal log level. (values: [debug, info, warn, error, silent], default: warn)', longName: 'log-level', }, + { + description: + 'Skip generating types for PostgreSQL domains. (default: false)', + longName: 'no-domains', + }, { description: `Set the file build path. (default: ${DEFAULT_OUT_FILE})`, longName: 'out-file', @@ -66,11 +71,6 @@ export const FLAGS: Flag[] = [ description: 'Set the default schema of the database connection.', longName: 'schema', }, - { - description: - 'Skip generating type information for postgres domains. (default: false)', - longName: 'skip-domains', - }, { description: 'Verify that the generated types are up-to-date. (default: false)', diff --git a/src/core/dialect-manager.ts b/src/core/dialect-manager.ts index cbbdc02..b64e85e 100644 --- a/src/core/dialect-manager.ts +++ b/src/core/dialect-manager.ts @@ -17,7 +17,7 @@ export type DialectName = | 'sqlite'; export type DialectManagerOptions = { - skipDomains: boolean; + skipDomains?: boolean; }; /** @@ -26,8 +26,8 @@ export type DialectManagerOptions = { export class DialectManager { readonly #options: DialectManagerOptions; - constructor(opts: DialectManagerOptions) { - this.#options = opts; + constructor(options: DialectManagerOptions = {}) { + this.#options = options; } getDialect(name: DialectName): Dialect { diff --git a/src/core/e2e.test.ts b/src/core/e2e.test.ts index bcc60c7..a516552 100644 --- a/src/core/e2e.test.ts +++ b/src/core/e2e.test.ts @@ -35,7 +35,7 @@ const TESTS: Test[] = [ }, { connectionString: 'postgres://user:password@localhost:5433/database', - dialect: new PostgresDialect({ skipDomains: false }), + dialect: new PostgresDialect(), values: { false: false, id: 1, true: true }, }, { diff --git a/src/dialects/postgres/postgres-dialect.ts b/src/dialects/postgres/postgres-dialect.ts index 637f560..a61d6f0 100644 --- a/src/dialects/postgres/postgres-dialect.ts +++ b/src/dialects/postgres/postgres-dialect.ts @@ -5,7 +5,7 @@ import { PostgresAdapter } from './postgres-adapter'; import { PostgresIntrospector } from './postgres-introspector'; export type PostgresDialectOptions = { - skipDomains: boolean; + skipDomains?: boolean; }; export class PostgresDialect extends Dialect { @@ -13,9 +13,9 @@ export class PostgresDialect extends Dialect { readonly adapter = new PostgresAdapter(); readonly introspector; - constructor(opts: PostgresDialectOptions) { + constructor(options: PostgresDialectOptions = {}) { super(); - this.#options = opts; + this.#options = options; this.introspector = new PostgresIntrospector(this.adapter, this.#options); } diff --git a/src/dialects/postgres/postgres-introspector.ts b/src/dialects/postgres/postgres-introspector.ts index 32cb0a4..6e57618 100644 --- a/src/dialects/postgres/postgres-introspector.ts +++ b/src/dialects/postgres/postgres-introspector.ts @@ -18,17 +18,20 @@ type PostgresDomainInspector = { }; export type PostgresIntrospectorOptions = { - skipDomains: boolean; + skipDomains?: boolean; }; export class PostgresIntrospector extends Introspector { readonly adapter: PostgresAdapter; readonly #options: PostgresIntrospectorOptions; - constructor(adapter: PostgresAdapter, opts: PostgresIntrospectorOptions) { + constructor( + adapter: PostgresAdapter, + options: PostgresIntrospectorOptions = {}, + ) { super(); this.adapter = adapter; - this.#options = opts; + this.#options = options; } #createDatabaseMetadata( @@ -103,6 +106,7 @@ export class PostgresIntrospector extends Introspector { if (this.#options.skipDomains) { return []; } + const result = await sql` with recursive domain_hierarchy as ( select oid, typbasetype diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 4307ebd..757c310 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -320,7 +320,7 @@ export const testSerializer = () => { void describe('serialize', () => { void it('should serialize Postgres JSON fields properly', () => { - const dialect = new PostgresDialect({ skipDomains: false }); + const dialect = new PostgresDialect(); const enums = new EnumCollection(); const transformer = new Transformer(); diff --git a/src/transformer/transformer.test.ts b/src/transformer/transformer.test.ts index c6cde8a..0220f7d 100644 --- a/src/transformer/transformer.test.ts +++ b/src/transformer/transformer.test.ts @@ -32,7 +32,7 @@ export const testTransformer = () => { }); const transform = (tables: TableMetadata[], camelCase: boolean) => { - const dialect = new PostgresDialect({ skipDomains: false }); + const dialect = new PostgresDialect(); const transformer = new Transformer(); const metadata = new DatabaseMetadata(tables, enums); return transformer.transform({ camelCase, dialect, metadata }); From 997bd93554c4292552c661826a9d9a0b2fcc9752 Mon Sep 17 00:00:00 2001 From: Tim Clark Date: Tue, 12 Mar 2024 08:59:15 -0400 Subject: [PATCH 11/29] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f6ac40..9ab9a1a 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "mysql2": "^2.3.3 || ^3.0.0", "pg": "^8.8.0", "tarn": "^3.0.0", - "tedious": "^16.6.0" + "tedious": "^16.6.0 || ^17.0.0" }, "peerDependenciesMeta": { "@libsql/kysely-libsql": { From 2b3d30f487e30fa095f2b9e840500e5889d80c68 Mon Sep 17 00:00:00 2001 From: Tim Clark Date: Tue, 12 Mar 2024 09:21:30 -0400 Subject: [PATCH 12/29] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ab9a1a..61afaf9 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "mysql2": "^2.3.3 || ^3.0.0", "pg": "^8.8.0", "tarn": "^3.0.0", - "tedious": "^16.6.0 || ^17.0.0" + "tedious": "^16.6.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { "@libsql/kysely-libsql": { From 501666254746d83a73ad879326545a72bf6ecb17 Mon Sep 17 00:00:00 2001 From: Tim Clark Date: Tue, 12 Mar 2024 09:34:01 -0400 Subject: [PATCH 13/29] dont support v18 --- package.json | 2 +- pnpm-lock.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 61afaf9..9ab9a1a 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "mysql2": "^2.3.3 || ^3.0.0", "pg": "^8.8.0", "tarn": "^3.0.0", - "tedious": "^16.6.0 || ^17.0.0 || ^18.0.0" + "tedious": "^16.6.0 || ^17.0.0" }, "peerDependenciesMeta": { "@libsql/kysely-libsql": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 824bf4b..97e8873 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,7 +30,7 @@ dependencies: specifier: ^3.0.0 version: 3.0.2 tedious: - specifier: ^16.6.0 + specifier: ^16.6.0 || ^17.0.0 version: 16.7.1 devDependencies: @@ -1749,7 +1749,7 @@ packages: dev: true /buffer-equal-constant-time@1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from@1.1.2: From 7fb5ef9e63ace2ad84e4ad48b8b504dee065fed7 Mon Sep 17 00:00:00 2001 From: Andrew Rempe Date: Sat, 16 Mar 2024 22:45:46 -0500 Subject: [PATCH 14/29] Set kysely-bun-worker as an optional peer dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ab9a1a..9be8ed0 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "optional": false }, "kysely-bun-worker": { - "optional": false + "optional": true }, "mysql2": { "optional": true From e3676dc0b0584f991c42c594bbaa32b647bb4c46 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 17 Mar 2024 21:02:26 +0100 Subject: [PATCH 15/29] chore: bump deps --- package.json | 10 +-- pnpm-lock.yaml | 230 ++++++++++++++++++++++++------------------------- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/package.json b/package.json index 9be8ed0..31b1c51 100644 --- a/package.json +++ b/package.json @@ -49,19 +49,19 @@ "devDependencies": { "@libsql/kysely-libsql": "^0.3.0", "@robinblomberg/eslint-config-prettier": "^0.1.4", - "@robinblomberg/eslint-config-robinblomberg": "0.26.0", + "@robinblomberg/eslint-config-robinblomberg": "0.27.0", "@robinblomberg/prettier-config": "^0.1.2", "@types/better-sqlite3": "^7.6.9", "@types/git-diff": "^2.0.7", "@types/micromatch": "^4.0.6", "@types/minimist": "^1.2.5", - "@types/node": "^20.11.25", + "@types/node": "^20.11.28", "@types/pg": "^8.11.2", "@types/tedious": "^4.0.14", - "@typescript-eslint/parser": "^7.1.1", + "@typescript-eslint/parser": "^7.2.0", "better-sqlite3": "^9.4.3", "eslint": "^8.57.0", - "kysely": "^0.27.2", + "kysely": "^0.27.3", "kysely-bun-worker": "^0.5.7", "mysql2": "^3.9.2", "npm-run-all": "^4.1.5", @@ -72,7 +72,7 @@ "ts-node-dev": "^2.0.0", "tsx": "^4.7.1", "typescript": "^5.4.2", - "vitest": "^1.3.1" + "vitest": "^1.4.0" }, "peerDependencies": { "@libsql/kysely-libsql": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 97e8873..5b8dfa7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,13 +36,13 @@ dependencies: devDependencies: '@libsql/kysely-libsql': specifier: ^0.3.0 - version: 0.3.0(kysely@0.27.2) + version: 0.3.0(kysely@0.27.3) '@robinblomberg/eslint-config-prettier': specifier: ^0.1.4 version: 0.1.4 '@robinblomberg/eslint-config-robinblomberg': - specifier: 0.26.0 - version: 0.26.0(eslint@8.57.0)(typescript@5.4.2) + specifier: 0.27.0 + version: 0.27.0(eslint@8.57.0)(typescript@5.4.2) '@robinblomberg/prettier-config': specifier: ^0.1.2 version: 0.1.2 @@ -59,8 +59,8 @@ devDependencies: specifier: ^1.2.5 version: 1.2.5 '@types/node': - specifier: ^20.11.25 - version: 20.11.25 + specifier: ^20.11.28 + version: 20.11.28 '@types/pg': specifier: ^8.11.2 version: 8.11.2 @@ -68,8 +68,8 @@ devDependencies: specifier: ^4.0.14 version: 4.0.14 '@typescript-eslint/parser': - specifier: ^7.1.1 - version: 7.1.1(eslint@8.57.0)(typescript@5.4.2) + specifier: ^7.2.0 + version: 7.2.0(eslint@8.57.0)(typescript@5.4.2) better-sqlite3: specifier: ^9.4.3 version: 9.4.3 @@ -77,11 +77,11 @@ devDependencies: specifier: ^8.57.0 version: 8.57.0 kysely: - specifier: ^0.27.2 - version: 0.27.2 + specifier: ^0.27.3 + version: 0.27.3 kysely-bun-worker: specifier: ^0.5.7 - version: 0.5.7(kysely@0.27.2) + version: 0.5.7(kysely@0.27.3) mysql2: specifier: ^3.9.2 version: 3.9.2 @@ -102,7 +102,7 @@ devDependencies: version: 5.0.5 ts-node-dev: specifier: ^2.0.0 - version: 2.0.0(@types/node@20.11.25)(typescript@5.4.2) + version: 2.0.0(@types/node@20.11.28)(typescript@5.4.2) tsx: specifier: ^4.7.1 version: 4.7.1 @@ -110,8 +110,8 @@ devDependencies: specifier: ^5.4.2 version: 5.4.2 vitest: - specifier: ^1.3.1 - version: 1.3.1(@types/node@20.11.25) + specifier: ^1.4.0 + version: 1.4.0(@types/node@20.11.28) packages: @@ -877,13 +877,13 @@ packages: - utf-8-validate dev: true - /@libsql/kysely-libsql@0.3.0(kysely@0.27.2): + /@libsql/kysely-libsql@0.3.0(kysely@0.27.3): resolution: {integrity: sha512-UEZB2giBFSR0NPwx2a8TxdnBEq20u7LfHupiwFc0t0VXAP1URdrSVv84rjMl/EAEs1tC6/Ex6O+OppwoKoJRbg==} peerDependencies: kysely: '*' dependencies: '@libsql/hrana-client': 0.4.4 - kysely: 0.27.2 + kysely: 0.27.3 transitivePeerDependencies: - bufferutil - encoding @@ -928,24 +928,24 @@ packages: resolution: {integrity: sha512-gAGbmxj3fJFS2VQWfhyNCQ/GS96BrEDak+Axh1usVLkibVh7fTPIulR3RkttQP84BT8EP0OF+Uast4pqpDTKzg==} dev: true - /@robinblomberg/eslint-config-robinblomberg@0.26.0(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-RRU1au5VDEUCaa2R9SE1/H6udSDOjB2kpZeYNbc2mBJSEgGGneKDHhx8fwMboApW8Mtz+rWscRmBf8KduDqj6w==} + /@robinblomberg/eslint-config-robinblomberg@0.27.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-YgBFXy9DmeVcC4gjK53FEhBDy9Kr+4W7qSoZY1jjTHd+4FhfY50EbCc3dcqbFqfqeFoLA7CfSqJX3dCpdE+UBg==} peerDependencies: eslint: ^8.43.0 typescript: '>=4.2.0' dependencies: '@babel/core': 7.24.0 '@babel/eslint-parser': 7.23.10(@babel/core@7.24.0)(eslint@8.57.0) - '@typescript-eslint/eslint-plugin': 7.1.1(@typescript-eslint/parser@7.1.1)(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/parser': 7.1.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) eslint: 8.57.0 eslint-define-config: 2.1.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.1.1)(eslint@8.57.0) - eslint-plugin-jsdoc: 48.2.0(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0) + eslint-plugin-jsdoc: 48.2.1(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) - eslint-plugin-react: 7.34.0(eslint@8.57.0) + eslint-plugin-react: 7.34.1(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) - eslint-plugin-react-refresh: 0.4.5(eslint@8.57.0) + eslint-plugin-react-refresh: 0.4.6(eslint@8.57.0) eslint-plugin-sonarjs: 0.24.0(eslint@8.57.0) eslint-plugin-sort-exports: 0.9.1(eslint@8.57.0) eslint-plugin-sort-keys: 2.3.5 @@ -1106,7 +1106,7 @@ packages: /@types/better-sqlite3@7.6.9: resolution: {integrity: sha512-FvktcujPDj9XKMJQWFcl2vVl7OdRIqsSRX9b0acWwTmwLK9CF2eqo/FRcmMLNpugKoX/avA6pb7TorDLmpgTnQ==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 dev: true /@types/braces@3.0.4: @@ -1142,12 +1142,12 @@ packages: /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 form-data: 4.0.0 dev: true - /@types/node@20.11.25: - resolution: {integrity: sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==} + /@types/node@20.11.28: + resolution: {integrity: sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==} dependencies: undici-types: 5.26.5 @@ -1158,7 +1158,7 @@ packages: /@types/pg@8.11.2: resolution: {integrity: sha512-G2Mjygf2jFMU/9hCaTYxJrwdObdcnuQde1gndooZSOHsNSaCehAuwc7EIuSA34Do8Jx2yZ19KtvW8P0j4EuUXw==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 pg-protocol: 1.6.0 pg-types: 4.0.2 dev: true @@ -1166,7 +1166,7 @@ packages: /@types/readable-stream@4.0.10: resolution: {integrity: sha512-AbUKBjcC8SHmImNi4yK2bbjogQlkFSg7shZCcicxPQapniOlajG8GCc39lvXzCWX4lLRRs7DM3VAeSlqmEVZUA==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 safe-buffer: 5.1.2 dev: false @@ -1185,17 +1185,17 @@ packages: /@types/tedious@4.0.14: resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 dev: true /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 dev: true - /@typescript-eslint/eslint-plugin@7.1.1(@typescript-eslint/parser@7.1.1)(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==} + /@typescript-eslint/eslint-plugin@7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1206,11 +1206,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.1.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/scope-manager': 7.1.1 - '@typescript-eslint/type-utils': 7.1.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/utils': 7.1.1(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 7.1.1 + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/type-utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4 eslint: 8.57.0 graphemer: 1.4.0 @@ -1223,8 +1223,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==} + /@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1233,10 +1233,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.1.1 - '@typescript-eslint/types': 7.1.1 - '@typescript-eslint/typescript-estree': 7.1.1(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 7.1.1 + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4 eslint: 8.57.0 typescript: 5.4.2 @@ -1252,16 +1252,16 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/scope-manager@7.1.1: - resolution: {integrity: sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==} + /@typescript-eslint/scope-manager@7.2.0: + resolution: {integrity: sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.1.1 - '@typescript-eslint/visitor-keys': 7.1.1 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 dev: true - /@typescript-eslint/type-utils@7.1.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==} + /@typescript-eslint/type-utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1270,8 +1270,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.1.1(typescript@5.4.2) - '@typescript-eslint/utils': 7.1.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) debug: 4.3.4 eslint: 8.57.0 ts-api-utils: 1.2.1(typescript@5.4.2) @@ -1285,8 +1285,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@7.1.1: - resolution: {integrity: sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==} + /@typescript-eslint/types@7.2.0: + resolution: {integrity: sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -1311,8 +1311,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.1.1(typescript@5.4.2): - resolution: {integrity: sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==} + /@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.2): + resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1320,8 +1320,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.1.1 - '@typescript-eslint/visitor-keys': 7.1.1 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1353,8 +1353,8 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.1.1(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==} + /@typescript-eslint/utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1362,9 +1362,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.1.1 - '@typescript-eslint/types': 7.1.1 - '@typescript-eslint/typescript-estree': 7.1.1(typescript@5.4.2) + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1380,11 +1380,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.1.1: - resolution: {integrity: sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==} + /@typescript-eslint/visitor-keys@7.2.0: + resolution: {integrity: sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.1.1 + '@typescript-eslint/types': 7.2.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1392,38 +1392,38 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitest/expect@1.3.1: - resolution: {integrity: sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==} + /@vitest/expect@1.4.0: + resolution: {integrity: sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==} dependencies: - '@vitest/spy': 1.3.1 - '@vitest/utils': 1.3.1 + '@vitest/spy': 1.4.0 + '@vitest/utils': 1.4.0 chai: 4.4.1 dev: true - /@vitest/runner@1.3.1: - resolution: {integrity: sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==} + /@vitest/runner@1.4.0: + resolution: {integrity: sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==} dependencies: - '@vitest/utils': 1.3.1 + '@vitest/utils': 1.4.0 p-limit: 5.0.0 pathe: 1.1.2 dev: true - /@vitest/snapshot@1.3.1: - resolution: {integrity: sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==} + /@vitest/snapshot@1.4.0: + resolution: {integrity: sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==} dependencies: magic-string: 0.30.8 pathe: 1.1.2 pretty-format: 29.7.0 dev: true - /@vitest/spy@1.3.1: - resolution: {integrity: sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==} + /@vitest/spy@1.4.0: + resolution: {integrity: sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==} dependencies: tinyspy: 2.2.1 dev: true - /@vitest/utils@1.3.1: - resolution: {integrity: sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==} + /@vitest/utils@1.4.0: + resolution: {integrity: sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==} dependencies: diff-sequences: 29.6.3 estree-walker: 3.0.3 @@ -2290,7 +2290,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.1.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -2311,7 +2311,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.1.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -2319,7 +2319,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.1.1)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -2329,7 +2329,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.1.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.4 array.prototype.flat: 1.3.2 @@ -2338,7 +2338,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.1.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.1 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2354,8 +2354,8 @@ packages: - supports-color dev: true - /eslint-plugin-jsdoc@48.2.0(eslint@8.57.0): - resolution: {integrity: sha512-O2B1XLBJnUCRkggFzUQ+PBYJDit8iAgXdlu8ucolqGrbmOWPvttZQZX8d1sC0MbqDMSLs8SHSQxaNPRY1RQREg==} + /eslint-plugin-jsdoc@48.2.1(eslint@8.57.0): + resolution: {integrity: sha512-iUvbcyDZSO/9xSuRv2HQBw++8VkV/pt3UWtX9cpPH0l7GKPq78QC/6+PmyQHHvNZaTjAce6QVciEbnc6J/zH5g==} engines: {node: '>=18'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 @@ -2408,16 +2408,16 @@ packages: eslint: 8.57.0 dev: true - /eslint-plugin-react-refresh@0.4.5(eslint@8.57.0): - resolution: {integrity: sha512-D53FYKJa+fDmZMtriODxvhwrO+IOqrxoEo21gMA0sjHdU6dPVH4OhyFip9ypl8HOF5RV5KdTo+rBQLvnY2cO8w==} + /eslint-plugin-react-refresh@0.4.6(eslint@8.57.0): + resolution: {integrity: sha512-NjGXdm7zgcKRkKMua34qVO9doI7VOxZ6ancSvBELJSSoX97jyndXcSoa8XBh69JoB31dNz3EEzlMcizZl7LaMA==} peerDependencies: eslint: '>=7' dependencies: eslint: 8.57.0 dev: true - /eslint-plugin-react@7.34.0(eslint@8.57.0): - resolution: {integrity: sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==} + /eslint-plugin-react@7.34.1(eslint@8.57.0): + resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 @@ -3405,16 +3405,16 @@ packages: json-buffer: 3.0.1 dev: true - /kysely-bun-worker@0.5.7(kysely@0.27.2): + /kysely-bun-worker@0.5.7(kysely@0.27.3): resolution: {integrity: sha512-P4W5moWU6A1xJ2GvGbdrPDiasSKTjuBfItU1vj+wZlA+A6AXv8Nxk0nScuBu8F12UnalrIDDu+oLCF5wC3Z4EA==} peerDependencies: kysely: '>=0.26' dependencies: - kysely: 0.27.2 + kysely: 0.27.3 dev: true - /kysely@0.27.2: - resolution: {integrity: sha512-DmRvEfiR/NLpgsTbSxma2ldekhsdcd65+MNiKXyd/qj7w7X5e3cLkXxcj+MypsRDjPhHQ/CD5u3Eq1sBYzX0bw==} + /kysely@0.27.3: + resolution: {integrity: sha512-lG03Ru+XyOJFsjH3OMY6R/9U38IjDPfnOfDgO3ynhbDr+Dz8fak+X6L62vqu3iybQnj+lG84OttBuU9KY3L9kA==} engines: {node: '>=14.0.0'} dev: true @@ -4901,7 +4901,7 @@ packages: engines: {node: '>=6.10'} dev: true - /ts-node-dev@2.0.0(@types/node@20.11.25)(typescript@5.4.2): + /ts-node-dev@2.0.0(@types/node@20.11.28)(typescript@5.4.2): resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==} engines: {node: '>=0.8.0'} hasBin: true @@ -4920,7 +4920,7 @@ packages: rimraf: 2.7.1 source-map-support: 0.5.21 tree-kill: 1.2.2 - ts-node: 10.9.2(@types/node@20.11.25)(typescript@5.4.2) + ts-node: 10.9.2(@types/node@20.11.28)(typescript@5.4.2) tsconfig: 7.0.0 typescript: 5.4.2 transitivePeerDependencies: @@ -4929,7 +4929,7 @@ packages: - '@types/node' dev: true - /ts-node@10.9.2(@types/node@20.11.25)(typescript@5.4.2): + /ts-node@10.9.2(@types/node@20.11.28)(typescript@5.4.2): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -4948,7 +4948,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.25 + '@types/node': 20.11.28 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -5138,8 +5138,8 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@1.3.1(@types/node@20.11.25): - resolution: {integrity: sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==} + /vite-node@1.4.0(@types/node@20.11.28): + resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: @@ -5147,7 +5147,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.5(@types/node@20.11.25) + vite: 5.1.5(@types/node@20.11.28) transitivePeerDependencies: - '@types/node' - less @@ -5159,7 +5159,7 @@ packages: - terser dev: true - /vite@5.1.5(@types/node@20.11.25): + /vite@5.1.5(@types/node@20.11.28): resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5187,7 +5187,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.25 + '@types/node': 20.11.28 esbuild: 0.19.12 postcss: 8.4.35 rollup: 4.12.1 @@ -5195,15 +5195,15 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.3.1(@types/node@20.11.25): - resolution: {integrity: sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==} + /vitest@1.4.0(@types/node@20.11.28): + resolution: {integrity: sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.3.1 - '@vitest/ui': 1.3.1 + '@vitest/browser': 1.4.0 + '@vitest/ui': 1.4.0 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -5220,12 +5220,12 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.11.25 - '@vitest/expect': 1.3.1 - '@vitest/runner': 1.3.1 - '@vitest/snapshot': 1.3.1 - '@vitest/spy': 1.3.1 - '@vitest/utils': 1.3.1 + '@types/node': 20.11.28 + '@vitest/expect': 1.4.0 + '@vitest/runner': 1.4.0 + '@vitest/snapshot': 1.4.0 + '@vitest/spy': 1.4.0 + '@vitest/utils': 1.4.0 acorn-walk: 8.3.2 chai: 4.4.1 debug: 4.3.4 @@ -5238,8 +5238,8 @@ packages: strip-literal: 2.0.0 tinybench: 2.6.0 tinypool: 0.8.2 - vite: 5.1.5(@types/node@20.11.25) - vite-node: 1.3.1(@types/node@20.11.25) + vite: 5.1.5(@types/node@20.11.28) + vite-node: 1.4.0(@types/node@20.11.28) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From d199d825c2d6a44a88781399b9f2c0b109090e52 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 17 Mar 2024 21:21:43 +0100 Subject: [PATCH 16/29] feat: adjust comment serialization --- src/ast/property-node.ts | 10 +++++++--- src/core/fixtures/migrate.ts | 9 +++++++++ src/core/metadata/column-metadata.ts | 6 +++--- src/core/outputs/postgres.output.ts | 5 +++++ src/dialects/postgres/postgres-introspector.ts | 1 + src/serializer/serializer.test.ts | 5 +++++ src/serializer/serializer.ts | 12 ++++++++---- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/ast/property-node.ts b/src/ast/property-node.ts index e47b9ef..9682332 100644 --- a/src/ast/property-node.ts +++ b/src/ast/property-node.ts @@ -2,14 +2,18 @@ import type { ExpressionNode } from './expression-node'; import { NodeType } from './node-type'; export class PropertyNode { + readonly comment: string | null; readonly key: string; readonly type = NodeType.PROPERTY; readonly value: ExpressionNode; - readonly comment?: string; - constructor(key: string, value: ExpressionNode, comment?: string) { + constructor( + key: string, + value: ExpressionNode, + comment: string | null = null, + ) { + this.comment = comment; this.key = key; this.value = value; - this.comment = comment; } } diff --git a/src/core/fixtures/migrate.ts b/src/core/fixtures/migrate.ts index b6fe7a3..62d5a89 100644 --- a/src/core/fixtures/migrate.ts +++ b/src/core/fixtures/migrate.ts @@ -83,6 +83,15 @@ const up = async (db: Kysely, dialect: Dialect) => { } await builder.execute(); + + if (dialect instanceof PostgresDialect) { + await trx.executeQuery( + sql` + comment on column foo_bar.false is + 'This is a comment on a column.\r\n\r\nIt''s nice, isn''t it?'; + `.compile(trx), + ); + } }); }; diff --git a/src/core/metadata/column-metadata.ts b/src/core/metadata/column-metadata.ts index e9c7d75..2f9b10a 100644 --- a/src/core/metadata/column-metadata.ts +++ b/src/core/metadata/column-metadata.ts @@ -1,4 +1,5 @@ export type ColumnMetadataOptions = { + comment?: string | null; dataType: string; dataTypeSchema?: string; enumValues?: string[] | null; @@ -7,10 +8,10 @@ export type ColumnMetadataOptions = { isAutoIncrementing?: boolean; isNullable?: boolean; name: string; - comment?: string; }; export class ColumnMetadata { + readonly comment: string | null; readonly dataType: string; readonly dataTypeSchema: string | undefined; readonly enumValues: string[] | null; @@ -19,9 +20,9 @@ export class ColumnMetadata { readonly isAutoIncrementing: boolean; readonly isNullable: boolean; readonly name: string; - readonly comment?: string; constructor(options: ColumnMetadataOptions) { + this.comment = options.comment ?? null; this.dataType = options.dataType; this.dataTypeSchema = options.dataTypeSchema; this.enumValues = options.enumValues ?? null; @@ -30,6 +31,5 @@ export class ColumnMetadata { this.isAutoIncrementing = options.isAutoIncrementing ?? false; this.isNullable = options.isNullable ?? false; this.name = options.name; - this.comment = options.comment; } } diff --git a/src/core/outputs/postgres.output.ts b/src/core/outputs/postgres.output.ts index 3719419..14b1288 100644 --- a/src/core/outputs/postgres.output.ts +++ b/src/core/outputs/postgres.output.ts @@ -23,6 +23,11 @@ export interface FooBar { childDomain: number | null; defaultedNullablePosInt: Generated; defaultedRequiredPosInt: Generated; + /** + * This is a comment on a column. + * + * It's nice, isn't it? + */ false: boolean; id: Generated; nullablePosInt: number | null; diff --git a/src/dialects/postgres/postgres-introspector.ts b/src/dialects/postgres/postgres-introspector.ts index 6e57618..e2dd79e 100644 --- a/src/dialects/postgres/postgres-introspector.ts +++ b/src/dialects/postgres/postgres-introspector.ts @@ -48,6 +48,7 @@ export class PostgresIntrospector extends Introspector { return { ...column, + comment: column.comment ?? null, dataType: isArray ? dataType.slice(1) : dataType, dataTypeSchema: column.dataTypeSchema, enumValues: enums.get( diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 757c310..89079af 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -276,6 +276,7 @@ export const testSerializer = () => { new TableMetadata({ columns: [ new ColumnMetadata({ + comment: 'Hello!\nThis is a comment.', dataType: 'json', hasDefaultValue: false, isAutoIncrementing: false, @@ -308,6 +309,10 @@ export const testSerializer = () => { 'export type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n' + '\n' + 'export interface Foo {\n' + + ' /**\n' + + ' * Hello!\n' + + ' * This is a comment.\n' + + ' */\n' + ' json: Json;\n' + '}\n' + '\n' + diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index fd2d8bb..16bc885 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -286,6 +286,7 @@ export class Serializer { ); for (const property of sortedProperties) { + data += ' '; data += this.serializeProperty(property); } } @@ -299,12 +300,15 @@ export class Serializer { let data = ''; if (node.comment) { - data += ` /**\n`; - data += ` * ${node.comment}\n`; - data += ` */\n`; + data += '/**\n'; + + for (const line of node.comment.split(/\r?\n/)) { + data += ` *${line ? ` ${line}` : ''}\n`; + } + + data += ' */\n '; } - data += ' '; data += this.serializeKey(node.key); data += ': '; data += this.serializeExpression(node.value); From 3a5fc56cc7791ba320bda577c087f33ddc6b943f Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 17 Mar 2024 21:34:25 +0100 Subject: [PATCH 17/29] refactor: adjust code for runtime enums --- src/generator/generator.ts | 5 +- src/serializer/serializer.test.ts | 13 +---- src/serializer/serializer.ts | 78 ++++++++++++++-------------- src/transformer/symbol-collection.ts | 4 +- src/transformer/transformer.ts | 14 ++--- 5 files changed, 54 insertions(+), 60 deletions(-) diff --git a/src/generator/generator.ts b/src/generator/generator.ts index 95094c6..9350bf8 100644 --- a/src/generator/generator.ts +++ b/src/generator/generator.ts @@ -59,7 +59,10 @@ export class Generator { const serializer = options.serializer ?? - new Serializer({ typeOnlyImports: options.typeOnlyImports, camelCase: !!options.camelCase }); + new Serializer({ + camelCase: !!options.camelCase, + typeOnlyImports: options.typeOnlyImports, + }); const data = serializer.serialize(nodes); const relativeOutDir = options.outFile diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 857399e..7346fac 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -279,9 +279,6 @@ export const testSerializer = () => { new ColumnMetadata({ comment: 'Hello!\nThis is a comment.', dataType: 'json', - hasDefaultValue: false, - isAutoIncrementing: false, - isNullable: false, name: 'json', }), ], @@ -291,7 +288,6 @@ export const testSerializer = () => { ], enums, ), - runtimeEnums: false, }); strictEqual( @@ -338,13 +334,7 @@ export const testSerializer = () => { [ new TableMetadata({ columns: [ - new ColumnMetadata({ - dataType: 'json', - hasDefaultValue: false, - isAutoIncrementing: false, - isNullable: false, - name: 'json', - }), + new ColumnMetadata({ dataType: 'json', name: 'json' }), ], name: 'foo', schema: 'public', @@ -352,7 +342,6 @@ export const testSerializer = () => { ], enums, ), - runtimeEnums: false, }); strictEqual( diff --git a/src/serializer/serializer.ts b/src/serializer/serializer.ts index ecd109d..cd031af 100644 --- a/src/serializer/serializer.ts +++ b/src/serializer/serializer.ts @@ -24,20 +24,20 @@ import { toCamelCase } from '../transformer'; const IDENTIFIER_REGEXP = /^[$A-Z_a-z][\w$]*$/; export type SerializerOptions = { - typeOnlyImports?: boolean; camelCase?: boolean; + typeOnlyImports?: boolean; }; /** * Creates a TypeScript output string from a codegen AST. */ export class Serializer { - readonly typeOnlyImports: boolean; readonly camelCase: boolean; + readonly typeOnlyImports: boolean; constructor(options: SerializerOptions = {}) { - this.typeOnlyImports = options.typeOnlyImports ?? true; this.camelCase = options.camelCase ?? false; + this.typeOnlyImports = options.typeOnlyImports ?? true; } serialize(nodes: StatementNode[]) { @@ -70,41 +70,6 @@ export class Serializer { return data; } - serializeRuntimeEnum(node: RuntimeEnumDeclarationNode) { - let data = 'enum '; - data += node.name; - data += ' {\n'; - - const args = - node.body.type === NodeType.UNION_EXPRESSION - ? node.body.args - : [node.body]; - const sortedArgs = args.sort((a, b) => - (a as LiteralNode).value.localeCompare( - (b as LiteralNode).value, - ), - ); - - for (const arg of sortedArgs) { - if (arg.type === NodeType.LITERAL && typeof arg.value === 'string') { - const serializedArg = this.serializeLiteral(arg); - const enumValueName = this.camelCase - ? toCamelCase(arg.value) - : arg.value; - data += ' '; - data += enumValueName; - data += ' = '; - data += serializedArg; - data += ','; - data += '\n'; - } - } - - data += '}'; - - return data; - } - serializeAliasDeclaration(node: AliasDeclarationNode) { const expression = node.body.type === NodeType.TEMPLATE ? node.body.expression : node.body; @@ -360,6 +325,43 @@ export class Serializer { return data; } + serializeRuntimeEnum(node: RuntimeEnumDeclarationNode) { + let data = 'enum '; + + data += node.name; + data += ' {\n'; + + const args = + node.body.type === NodeType.UNION_EXPRESSION + ? node.body.args + : [node.body]; + + args.sort((a, b) => { + return (a as LiteralNode).value.localeCompare( + (b as LiteralNode).value, + ); + }); + + for (const arg of args) { + if (arg.type === NodeType.LITERAL && typeof arg.value === 'string') { + const serializedArg = this.serializeLiteral(arg); + const enumValueName = this.camelCase + ? toCamelCase(arg.value) + : arg.value; + data += ' '; + data += enumValueName; + data += ' = '; + data += serializedArg; + data += ','; + data += '\n'; + } + } + + data += '}'; + + return data; + } + serializeUnionExpression(node: UnionExpressionNode) { let data = ''; let i = 0; diff --git a/src/transformer/symbol-collection.ts b/src/transformer/symbol-collection.ts index 9539a9a..e5df7cd 100644 --- a/src/transformer/symbol-collection.ts +++ b/src/transformer/symbol-collection.ts @@ -11,14 +11,14 @@ export type SymbolNameMap = { export type SymbolNode = | { node: ExpressionNode | TemplateNode; type: SymbolType.DEFINITION } - | { node: ModuleReferenceNode; type: SymbolType.MODULE_REFERENCE } | { node: ExpressionNode; type: SymbolType.RUNTIME_ENUM_DEFINITION } + | { node: ModuleReferenceNode; type: SymbolType.MODULE_REFERENCE } | { type: SymbolType.TABLE }; export const enum SymbolType { DEFINITION = 'Definition', - RUNTIME_ENUM_DEFINITION = 'RuntimeEnumDefinition', MODULE_REFERENCE = 'ModuleReference', + RUNTIME_ENUM_DEFINITION = 'RuntimeEnumDefinition', TABLE = 'Table', } diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 77b1b42..31bd482 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -55,11 +55,11 @@ export type TransformContext = { }; export type TransformOptions = { - camelCase: boolean; + camelCase?: boolean; defaultSchema?: string; dialect: Dialect; metadata: DatabaseMetadata; - runtimeEnums: boolean; + runtimeEnums?: boolean; }; /** @@ -146,7 +146,7 @@ export class Transformer { #createContext(options: TransformOptions): TransformContext { return { - camelCase: options.camelCase, + camelCase: !!options.camelCase, defaultScalar: options.dialect.adapter.defaultScalar ?? new IdentifierNode('unknown'), defaultSchema: @@ -161,7 +161,7 @@ export class Transformer { ...options.dialect.adapter.imports, }, metadata: options.metadata, - runtimeEnums: options.runtimeEnums, + runtimeEnums: !!options.runtimeEnums, scalars: { ...options.dialect.adapter.scalars, }, @@ -201,9 +201,9 @@ export class Transformer { } } - return runtimeEnumDefinitionNodes.sort((a, b) => - a.argument.name.localeCompare(b.argument.name), - ); + return runtimeEnumDefinitionNodes.sort((a, b) => { + return a.argument.name.localeCompare(b.argument.name); + }); } #createDefinitionNodes(context: TransformContext) { From bd18848d4ffabf137eba4c92ca37af4ecc44ed30 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 17 Mar 2024 21:35:14 +0100 Subject: [PATCH 18/29] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31b1c51..b5f285e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kysely-codegen", - "version": "0.13.1", + "version": "0.14.0", "author": "Robin Blomberg", "license": "MIT", "main": "./dist/index.js", From 441145137c8328563bfc365a01dd324ececeea73 Mon Sep 17 00:00:00 2001 From: brettbedarfmw Date: Sun, 17 Mar 2024 16:17:17 -0600 Subject: [PATCH 19/29] fix lowercase --- .gitignore | 1 + src/cli/cli.ts | 4 ---- src/transformer/transformer.ts | 16 +++++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 59e1144..167174d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ .vscode/settings.json output/ gen/ +.vscode/settings.json diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 2b65bac..f4f4b0e 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -196,10 +196,6 @@ export class Cli { ' --url=env(DATABASE_URL)', ); } - - if (camelCase && lowerCase) { - throw new Error('Cannot use --camel-case and --lower-case at the same time.') - } } catch (error) { if (logLevel > LogLevel.SILENT) { if (error instanceof Error) { diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index 9f4e664..b02fbf0 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -42,7 +42,7 @@ const unionize = (args: ExpressionNode[]) => { export type TransformContext = { camelCase: boolean; - lowerCase:boolean; + lowerCase: boolean; defaultScalar: ExpressionNode; defaultSchema: string | null; definitions: Definitions; @@ -146,6 +146,7 @@ export class Transformer { #createContext(options: TransformOptions): TransformContext { return { camelCase: options.camelCase, + lowerCase: options.lowerCase, defaultScalar: options.dialect.adapter.defaultScalar ?? new IdentifierNode('unknown'), defaultSchema: @@ -312,13 +313,14 @@ export class Transformer { } #transformName(name: string, context: TransformContext) { - if (context.camelCase){ - toCamelCase(name) - } else if (context.lowerCase) { - return name.toLowerCase(); - } else { - return name; + let transformed = name; + if (context.lowerCase) { + transformed = name.toLowerCase(); + } + if (context.camelCase) { + transformed = toCamelCase(transformed); } + return transformed; } #transformTables(context: TransformContext) { From 9c13bac91127e1f6630ea88beb71be9b101a2101 Mon Sep 17 00:00:00 2001 From: brettbedarfmw Date: Mon, 18 Mar 2024 10:46:30 -0600 Subject: [PATCH 20/29] lowercase setting ignores existing camel/pascal/mixed case identifiers --- .gitignore | 1 + src/serializer/serializer.test.ts | 2 ++ src/transformer/transformer.test.ts | 8 ++++++-- src/transformer/transformer.ts | 8 +++++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 167174d..ca59de7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ output/ gen/ .vscode/settings.json +gen/vis-full-db.d.ts \ No newline at end of file diff --git a/src/serializer/serializer.test.ts b/src/serializer/serializer.test.ts index 5035d05..6607a81 100644 --- a/src/serializer/serializer.test.ts +++ b/src/serializer/serializer.test.ts @@ -270,6 +270,7 @@ export const testSerializer = () => { const ast = transformer.transform({ camelCase: true, + lowerCase: false, dialect, metadata: new DatabaseMetadata( [ @@ -326,6 +327,7 @@ export const testSerializer = () => { const ast = transformer.transform({ camelCase: true, + lowerCase: false, dialect, metadata: new DatabaseMetadata( [ diff --git a/src/transformer/transformer.test.ts b/src/transformer/transformer.test.ts index e48b3cb..78cde31 100644 --- a/src/transformer/transformer.test.ts +++ b/src/transformer/transformer.test.ts @@ -31,11 +31,15 @@ export const testTransformer = () => { 'public.mood_': ['', ',', "'", "'','"], }); - const transform = (tables: TableMetadata[], camelCase: boolean) => { + const transform = ( + tables: TableMetadata[], + camelCase: boolean, + lowerCase = false, + ) => { const dialect = new PostgresDialect(); const transformer = new Transformer(); const metadata = new DatabaseMetadata(tables, enums); - return transformer.transform({ camelCase, dialect, metadata }); + return transformer.transform({ camelCase, lowerCase, dialect, metadata }); }; void it('should transform correctly', () => { diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index b02fbf0..fb6a251 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -315,7 +315,10 @@ export class Transformer { #transformName(name: string, context: TransformContext) { let transformed = name; if (context.lowerCase) { - transformed = name.toLowerCase(); + // only lowercase if orig string is UPPER_SNAKE_CASE (not camel/pascal case) + if (/^[A-Z0-9]+(_[A-Z0-9]+)*$/.test(name)) { + transformed = name.toLowerCase(); + } } if (context.camelCase) { transformed = toCamelCase(transformed); @@ -330,8 +333,7 @@ export class Transformer { const tableProperties: PropertyNode[] = []; for (const column of table.columns) { - const lowerColumnName = column.name.toLowerCase(); - const key = this.#transformName(lowerColumnName, context); + const key = this.#transformName(column.name, context); const value = this.#transformColumn(column, context); const tableProperty = new PropertyNode(key, value); tableProperties.push(tableProperty); From 684d30a67b068eff5faccd228b63748370c6e7f1 Mon Sep 17 00:00:00 2001 From: Robin Clowers Date: Mon, 18 Mar 2024 14:05:37 -0700 Subject: [PATCH 21/29] fix: domain flag is respected --- src/cli/cli.ts | 2 +- src/core/dialect-manager.ts | 4 ++-- src/dialects/postgres/postgres-dialect.ts | 4 ++-- src/dialects/postgres/postgres-introspector.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 3c24b4a..8eb6850 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -66,7 +66,7 @@ export class Cli { } const dialectManager = new DialectManager({ - skipDomains: !!options.domains, + domains: !!options.domains, }); const dialect = dialectManager.getDialect( options.dialectName ?? inferredDialectName, diff --git a/src/core/dialect-manager.ts b/src/core/dialect-manager.ts index b64e85e..aed560f 100644 --- a/src/core/dialect-manager.ts +++ b/src/core/dialect-manager.ts @@ -17,7 +17,7 @@ export type DialectName = | 'sqlite'; export type DialectManagerOptions = { - skipDomains?: boolean; + domains: boolean; }; /** @@ -26,7 +26,7 @@ export type DialectManagerOptions = { export class DialectManager { readonly #options: DialectManagerOptions; - constructor(options: DialectManagerOptions = {}) { + constructor(options: DialectManagerOptions = { domains: true }) { this.#options = options; } diff --git a/src/dialects/postgres/postgres-dialect.ts b/src/dialects/postgres/postgres-dialect.ts index a61d6f0..50120c3 100644 --- a/src/dialects/postgres/postgres-dialect.ts +++ b/src/dialects/postgres/postgres-dialect.ts @@ -5,7 +5,7 @@ import { PostgresAdapter } from './postgres-adapter'; import { PostgresIntrospector } from './postgres-introspector'; export type PostgresDialectOptions = { - skipDomains?: boolean; + domains: boolean; }; export class PostgresDialect extends Dialect { @@ -13,7 +13,7 @@ export class PostgresDialect extends Dialect { readonly adapter = new PostgresAdapter(); readonly introspector; - constructor(options: PostgresDialectOptions = {}) { + constructor(options: PostgresDialectOptions = { domains: true }) { super(); this.#options = options; this.introspector = new PostgresIntrospector(this.adapter, this.#options); diff --git a/src/dialects/postgres/postgres-introspector.ts b/src/dialects/postgres/postgres-introspector.ts index e2dd79e..1600a7a 100644 --- a/src/dialects/postgres/postgres-introspector.ts +++ b/src/dialects/postgres/postgres-introspector.ts @@ -18,7 +18,7 @@ type PostgresDomainInspector = { }; export type PostgresIntrospectorOptions = { - skipDomains?: boolean; + domains: boolean; }; export class PostgresIntrospector extends Introspector { @@ -27,7 +27,7 @@ export class PostgresIntrospector extends Introspector { constructor( adapter: PostgresAdapter, - options: PostgresIntrospectorOptions = {}, + options: PostgresIntrospectorOptions = { domains: true }, ) { super(); this.adapter = adapter; @@ -104,7 +104,7 @@ export class PostgresIntrospector extends Introspector { } async #introspectDomains(db: Kysely) { - if (this.#options.skipDomains) { + if (!this.#options.domains) { return []; } From 2faec07b24f41111030bfdadd2243f1b2d6de1be Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Tue, 19 Mar 2024 06:42:24 +0100 Subject: [PATCH 22/29] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5f285e..fc93419 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kysely-codegen", - "version": "0.14.0", + "version": "0.14.1", "author": "Robin Blomberg", "license": "MIT", "main": "./dist/index.js", From 569096cdcf6ee94d83d27566bc4f4a5b8302071e Mon Sep 17 00:00:00 2001 From: jrhizor Date: Tue, 26 Mar 2024 17:53:06 -0700 Subject: [PATCH 23/29] fix flags in readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d617b0..e86f33b 100644 --- a/README.md +++ b/README.md @@ -99,21 +99,21 @@ export interface DB { ## Include/exclude patterns -You can choose which tables should be included during code generation by providing a glob pattern to the `--include` and `--exclude` flags. We use [micromatch](https://github.com/micromatch/micromatch) under the hood which provides advanced glob support. For instance, if you only want to include your public tables: +You can choose which tables should be included during code generation by providing a glob pattern to the `--include-pattern` and `--exclude-pattern` flags. We use [micromatch](https://github.com/micromatch/micromatch) under the hood which provides advanced glob support. For instance, if you only want to include your public tables: ```bash -kysely-codegen --include="public.*" +kysely-codegen --include-pattern="public.*" ``` You can also include only certain tables within a schema: ```bash -kysely-codegen --include="public.+(user|post)" +kysely-codegen --include-pattern="public.+(user|post)" ``` Or exclude an entire class of tables: ```bash -kysely-codegen --exclude="documents.*" +kysely-codegen --exclude-pattern="documents.*" ``` ## Help From be70e2556d9e80313b693288f9328a113458e290 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 31 Mar 2024 11:06:08 +0200 Subject: [PATCH 24/29] docs: add polar.sh funding information --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index e86f33b..51f61d0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ - [Installation](#installation) - [Generating type definitions](#generating-type-definitions) +- [Include/exclude patterns](#includeexclude-patterns) +- [Help](#help) - [Using the type definitions](#using-the-type-definitions) +- [Issue funding](#issue-funding) ## Installation @@ -112,11 +115,13 @@ kysely-codegen --include-pattern="public.+(user|post)" ``` Or exclude an entire class of tables: + ```bash kysely-codegen --exclude-pattern="documents.*" ``` ## Help + For more options, run `kysely-codegen --help`. ## Using the type definitions @@ -139,3 +144,9 @@ const db = new Kysely({ const rows = await db.selectFrom('user').selectAll().execute(); // ^ { company_id: number | null; created_at: Date; email: string; id: number; ... }[] ``` + +## Issue funding + +We use [Polar.sh](https://polar.sh/RobinBlomberg) to upvote and promote specific features that you would like to see implemented. Check the backlog and help out: + + From 8ff7048957d6ba7793b4faabc033ca360bc803b4 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 31 Mar 2024 16:08:34 +0200 Subject: [PATCH 25/29] fix(cli): make --print work again --- package.json | 2 +- src/cli/cli.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fc93419..621bad2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kysely-codegen", - "version": "0.14.1", + "version": "0.14.2", "author": "Robin Blomberg", "license": "MIT", "main": "./dist/index.js", diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 8eb6850..f8eec9d 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -44,6 +44,7 @@ export class Cli { const excludePattern = options.excludePattern; const includePattern = options.includePattern; const outFile = options.outFile; + const print = !!options.print; const runtimeEnums = options.runtimeEnums; const schema = options.schema; const typeOnlyImports = options.typeOnlyImports; @@ -87,6 +88,7 @@ export class Cli { includePattern, logger, outFile, + print, runtimeEnums, schema, typeOnlyImports, From e7f8d145dff481c25a86c516d88d062dc57aa908 Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Sun, 31 Mar 2024 16:40:14 +0200 Subject: [PATCH 26/29] chore: bump dependencies --- package.json | 23 ++- pnpm-lock.yaml | 276 ++++++++++++++++------------ src/dialects/mssql/mssql-dialect.ts | 4 +- 3 files changed, 172 insertions(+), 131 deletions(-) diff --git a/package.json b/package.json index 621bad2..dc75865 100644 --- a/package.json +++ b/package.json @@ -49,29 +49,29 @@ "devDependencies": { "@libsql/kysely-libsql": "^0.3.0", "@robinblomberg/eslint-config-prettier": "^0.1.4", - "@robinblomberg/eslint-config-robinblomberg": "0.27.0", + "@robinblomberg/eslint-config-robinblomberg": "0.28.0", "@robinblomberg/prettier-config": "^0.1.2", "@types/better-sqlite3": "^7.6.9", "@types/git-diff": "^2.0.7", "@types/micromatch": "^4.0.6", "@types/minimist": "^1.2.5", - "@types/node": "^20.11.28", - "@types/pg": "^8.11.2", + "@types/node": "^20.12.2", + "@types/pg": "^8.11.4", "@types/tedious": "^4.0.14", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/parser": "^7.4.0", "better-sqlite3": "^9.4.3", "eslint": "^8.57.0", "kysely": "^0.27.3", - "kysely-bun-worker": "^0.5.7", - "mysql2": "^3.9.2", + "kysely-bun-worker": "^0.6.0", + "mysql2": "^3.9.3", "npm-run-all": "^4.1.5", - "pg": "^8.11.3", - "pnpm": "^8.15.4", + "pg": "^8.11.4", + "pnpm": "^8.15.5", "prettier": "^3.2.5", "rimraf": "^5.0.5", "ts-node-dev": "^2.0.0", "tsx": "^4.7.1", - "typescript": "^5.4.2", + "typescript": "^5.4.3", "vitest": "^1.4.0" }, "peerDependencies": { @@ -119,7 +119,10 @@ "@robinblomberg/robinblomberg", "@robinblomberg/prettier" ], - "ignorePatterns": "**/src/core/outputs/*.ts" + "ignorePatterns": "**/src/core/outputs/*.ts", + "rules": { + "unicorn/prefer-node-protocol": 0 + } }, "prettier": "@robinblomberg/prettier-config" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b8dfa7..7b049bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,8 +41,8 @@ devDependencies: specifier: ^0.1.4 version: 0.1.4 '@robinblomberg/eslint-config-robinblomberg': - specifier: 0.27.0 - version: 0.27.0(eslint@8.57.0)(typescript@5.4.2) + specifier: 0.28.0 + version: 0.28.0(eslint@8.57.0)(typescript@5.4.3) '@robinblomberg/prettier-config': specifier: ^0.1.2 version: 0.1.2 @@ -59,17 +59,17 @@ devDependencies: specifier: ^1.2.5 version: 1.2.5 '@types/node': - specifier: ^20.11.28 - version: 20.11.28 + specifier: ^20.12.2 + version: 20.12.2 '@types/pg': - specifier: ^8.11.2 - version: 8.11.2 + specifier: ^8.11.4 + version: 8.11.4 '@types/tedious': specifier: ^4.0.14 version: 4.0.14 '@typescript-eslint/parser': - specifier: ^7.2.0 - version: 7.2.0(eslint@8.57.0)(typescript@5.4.2) + specifier: ^7.4.0 + version: 7.4.0(eslint@8.57.0)(typescript@5.4.3) better-sqlite3: specifier: ^9.4.3 version: 9.4.3 @@ -80,20 +80,20 @@ devDependencies: specifier: ^0.27.3 version: 0.27.3 kysely-bun-worker: - specifier: ^0.5.7 - version: 0.5.7(kysely@0.27.3) + specifier: ^0.6.0 + version: 0.6.0(kysely@0.27.3) mysql2: - specifier: ^3.9.2 - version: 3.9.2 + specifier: ^3.9.3 + version: 3.9.3 npm-run-all: specifier: ^4.1.5 version: 4.1.5 pg: - specifier: ^8.11.3 - version: 8.11.3 + specifier: ^8.11.4 + version: 8.11.4 pnpm: - specifier: ^8.15.4 - version: 8.15.4 + specifier: ^8.15.5 + version: 8.15.5 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -102,16 +102,16 @@ devDependencies: version: 5.0.5 ts-node-dev: specifier: ^2.0.0 - version: 2.0.0(@types/node@20.11.28)(typescript@5.4.2) + version: 2.0.0(@types/node@20.12.2)(typescript@5.4.3) tsx: specifier: ^4.7.1 version: 4.7.1 typescript: - specifier: ^5.4.2 - version: 5.4.2 + specifier: ^5.4.3 + version: 5.4.3 vitest: specifier: ^1.4.0 - version: 1.4.0(@types/node@20.11.28) + version: 1.4.0(@types/node@20.12.2) packages: @@ -928,19 +928,19 @@ packages: resolution: {integrity: sha512-gAGbmxj3fJFS2VQWfhyNCQ/GS96BrEDak+Axh1usVLkibVh7fTPIulR3RkttQP84BT8EP0OF+Uast4pqpDTKzg==} dev: true - /@robinblomberg/eslint-config-robinblomberg@0.27.0(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-YgBFXy9DmeVcC4gjK53FEhBDy9Kr+4W7qSoZY1jjTHd+4FhfY50EbCc3dcqbFqfqeFoLA7CfSqJX3dCpdE+UBg==} + /@robinblomberg/eslint-config-robinblomberg@0.28.0(eslint@8.57.0)(typescript@5.4.3): + resolution: {integrity: sha512-QjDPHYVR0YqA4M3Y/gvgP9pi1WqHZjnXhzkwwHreF+odRb/m3FwJm1oqyTKjVflce5Ct3HJ5JTLD4MLJWI4cRQ==} peerDependencies: eslint: ^8.43.0 typescript: '>=4.2.0' dependencies: '@babel/core': 7.24.0 '@babel/eslint-parser': 7.23.10(@babel/core@7.24.0)(eslint@8.57.0) - '@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.4.0)(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/parser': 7.4.0(eslint@8.57.0)(typescript@5.4.3) eslint: 8.57.0 eslint-define-config: 2.1.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.4.0)(eslint@8.57.0) eslint-plugin-jsdoc: 48.2.1(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.1(eslint@8.57.0) @@ -949,9 +949,9 @@ packages: eslint-plugin-sonarjs: 0.24.0(eslint@8.57.0) eslint-plugin-sort-exports: 0.9.1(eslint@8.57.0) eslint-plugin-sort-keys: 2.3.5 - eslint-plugin-storybook: 0.8.0(eslint@8.57.0)(typescript@5.4.2) + eslint-plugin-storybook: 0.8.0(eslint@8.57.0)(typescript@5.4.3) eslint-plugin-unicorn: 51.0.1(eslint@8.57.0) - typescript: 5.4.2 + typescript: 5.4.3 transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -1106,7 +1106,7 @@ packages: /@types/better-sqlite3@7.6.9: resolution: {integrity: sha512-FvktcujPDj9XKMJQWFcl2vVl7OdRIqsSRX9b0acWwTmwLK9CF2eqo/FRcmMLNpugKoX/avA6pb7TorDLmpgTnQ==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 dev: true /@types/braces@3.0.4: @@ -1142,12 +1142,12 @@ packages: /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 form-data: 4.0.0 dev: true - /@types/node@20.11.28: - resolution: {integrity: sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==} + /@types/node@20.12.2: + resolution: {integrity: sha512-zQ0NYO87hyN6Xrclcqp7f8ZbXNbRfoGWNcMvHTPQp9UUrwI0mI7XBz+cu7/W6/VClYo2g63B0cjull/srU7LgQ==} dependencies: undici-types: 5.26.5 @@ -1155,10 +1155,10 @@ packages: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true - /@types/pg@8.11.2: - resolution: {integrity: sha512-G2Mjygf2jFMU/9hCaTYxJrwdObdcnuQde1gndooZSOHsNSaCehAuwc7EIuSA34Do8Jx2yZ19KtvW8P0j4EuUXw==} + /@types/pg@8.11.4: + resolution: {integrity: sha512-yw3Bwbda6vO+NvI1Ue/YKOwtl31AYvvd/e73O3V4ZkNzuGpTDndLSyc0dQRB2xrQqDePd20pEGIfqSp/GH3pRw==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 pg-protocol: 1.6.0 pg-types: 4.0.2 dev: true @@ -1166,7 +1166,7 @@ packages: /@types/readable-stream@4.0.10: resolution: {integrity: sha512-AbUKBjcC8SHmImNi4yK2bbjogQlkFSg7shZCcicxPQapniOlajG8GCc39lvXzCWX4lLRRs7DM3VAeSlqmEVZUA==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 safe-buffer: 5.1.2 dev: false @@ -1185,16 +1185,16 @@ packages: /@types/tedious@4.0.14: resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 dev: true /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 dev: true - /@typescript-eslint/eslint-plugin@7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2): + /@typescript-eslint/eslint-plugin@7.2.0(@typescript-eslint/parser@7.4.0)(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1206,10 +1206,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.4.0(eslint@8.57.0)(typescript@5.4.3) '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/type-utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/type-utils': 7.2.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.3) '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4 eslint: 8.57.0 @@ -1217,15 +1217,15 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.2.1(typescript@5.4.2) - typescript: 5.4.2 + ts-api-utils: 1.2.1(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/parser@7.4.0(eslint@8.57.0)(typescript@5.4.3): + resolution: {integrity: sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==} + engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 typescript: '*' @@ -1233,13 +1233,13 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 7.2.0 + '@typescript-eslint/scope-manager': 7.4.0 + '@typescript-eslint/types': 7.4.0 + '@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.3) + '@typescript-eslint/visitor-keys': 7.4.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.4.2 + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true @@ -1260,7 +1260,15 @@ packages: '@typescript-eslint/visitor-keys': 7.2.0 dev: true - /@typescript-eslint/type-utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + /@typescript-eslint/scope-manager@7.4.0: + resolution: {integrity: sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.4.0 + '@typescript-eslint/visitor-keys': 7.4.0 + dev: true + + /@typescript-eslint/type-utils@7.2.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1270,12 +1278,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) - '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.3) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.3) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.2.1(typescript@5.4.2) - typescript: 5.4.2 + ts-api-utils: 1.2.1(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true @@ -1290,7 +1298,12 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.2): + /@typescript-eslint/types@7.4.0: + resolution: {integrity: sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1305,13 +1318,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.0 - tsutils: 3.21.0(typescript@5.4.2) - typescript: 5.4.2 + tsutils: 3.21.0(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.2): + /@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.3): resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1327,13 +1340,35 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.2.1(typescript@5.4.2) - typescript: 5.4.2 + ts-api-utils: 1.2.1(typescript@5.4.3) + typescript: 5.4.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/typescript-estree@7.4.0(typescript@5.4.3): + resolution: {integrity: sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.4.0 + '@typescript-eslint/visitor-keys': 7.4.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + ts-api-utils: 1.2.1(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.2): + /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1344,7 +1379,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.2) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.3) eslint: 8.57.0 eslint-scope: 5.1.1 semver: 7.6.0 @@ -1353,7 +1388,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + /@typescript-eslint/utils@7.2.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1364,7 +1399,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 7.2.0 '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.3) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1388,6 +1423,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@7.4.0: + resolution: {integrity: sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.4.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -1756,11 +1799,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /buffer-writer@2.0.0: - resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} - engines: {node: '>=4'} - dev: true - /buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} dependencies: @@ -2290,7 +2328,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.4.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -2311,7 +2349,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.4.0(eslint@8.57.0)(typescript@5.4.3) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -2319,7 +2357,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.4.0)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -2329,7 +2367,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.4.0(eslint@8.57.0)(typescript@5.4.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.4 array.prototype.flat: 1.3.2 @@ -2338,7 +2376,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.4.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.1 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2467,14 +2505,14 @@ packages: natural-compare: 1.4.0 dev: true - /eslint-plugin-storybook@0.8.0(eslint@8.57.0)(typescript@5.4.2): + /eslint-plugin-storybook@0.8.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-CZeVO5EzmPY7qghO2t64oaFM+8FTaD4uzOEjHKp516exyTKo+skKAL9GI3QALS2BXhyALJjNtwbmr1XinGE8bA==} engines: {node: '>= 18'} peerDependencies: eslint: '>=6' dependencies: '@storybook/csf': 0.0.1 - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.3) eslint: 8.57.0 requireindex: 1.2.0 ts-dedent: 2.2.0 @@ -3405,8 +3443,8 @@ packages: json-buffer: 3.0.1 dev: true - /kysely-bun-worker@0.5.7(kysely@0.27.3): - resolution: {integrity: sha512-P4W5moWU6A1xJ2GvGbdrPDiasSKTjuBfItU1vj+wZlA+A6AXv8Nxk0nScuBu8F12UnalrIDDu+oLCF5wC3Z4EA==} + /kysely-bun-worker@0.6.0(kysely@0.27.3): + resolution: {integrity: sha512-EqxoVSJdKhvXq7tTP7K/d6eUsL/g0K9h9syDOGN9dBiSMcFj2EzMAppLZ1JwuVH0CYAJqlKm0wB8hHUvOwQmHQ==} peerDependencies: kysely: '>=0.26' dependencies: @@ -3662,8 +3700,8 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - /mysql2@3.9.2: - resolution: {integrity: sha512-3Cwg/UuRkAv/wm6RhtPE5L7JlPB877vwSF6gfLAS68H+zhH+u5oa3AieqEd0D0/kC3W7qIhYbH419f7O9i/5nw==} + /mysql2@3.9.3: + resolution: {integrity: sha512-+ZaoF0llESUy7BffccHG+urErHcWPZ/WuzYAA9TEeLaDYyke3/3D+VQDzK9xzRnXpd0eMtRf0WNOeo4Q1Baung==} engines: {node: '>= 8.0'} dependencies: denque: 2.1.0 @@ -3911,10 +3949,6 @@ packages: engines: {node: '>=6'} dev: true - /packet-reader@1.0.0: - resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} - dev: true - /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -4001,8 +4035,8 @@ packages: dev: true optional: true - /pg-connection-string@2.6.2: - resolution: {integrity: sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==} + /pg-connection-string@2.6.3: + resolution: {integrity: sha512-77FxhhKJQH+xJx6tDqkhhMa0nZvv3U1HYLDQgwZxZafVD583++O5LXn5oo5HaQZ0vXwYcZA1koYAJM3JvD6Gtw==} dev: true /pg-int8@1.0.1: @@ -4015,18 +4049,22 @@ packages: engines: {node: '>=4'} dev: true - /pg-pool@3.6.1(pg@8.11.3): - resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==} + /pg-pool@3.6.2(pg@8.11.4): + resolution: {integrity: sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==} peerDependencies: pg: '>=8.0' dependencies: - pg: 8.11.3 + pg: 8.11.4 dev: true /pg-protocol@1.6.0: resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} dev: true + /pg-protocol@1.6.1: + resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==} + dev: true + /pg-types@2.2.0: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} engines: {node: '>=4'} @@ -4051,8 +4089,8 @@ packages: postgres-range: 1.1.4 dev: true - /pg@8.11.3: - resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==} + /pg@8.11.4: + resolution: {integrity: sha512-pWb7JKPxGk1UFbtq7jQ0m3IfPpb7LLACCEyN8/u9DYEom+Q/BSKy+4TRl4+Hh003AOYhppB/z+QK87/hx/bk0w==} engines: {node: '>= 8.0.0'} peerDependencies: pg-native: '>=3.0.1' @@ -4060,11 +4098,9 @@ packages: pg-native: optional: true dependencies: - buffer-writer: 2.0.0 - packet-reader: 1.0.0 - pg-connection-string: 2.6.2 - pg-pool: 3.6.1(pg@8.11.3) - pg-protocol: 1.6.0 + pg-connection-string: 2.6.3 + pg-pool: 3.6.2(pg@8.11.4) + pg-protocol: 1.6.1 pg-types: 2.2.0 pgpass: 1.0.5 optionalDependencies: @@ -4109,8 +4145,8 @@ packages: engines: {node: '>=4'} dev: true - /pnpm@8.15.4: - resolution: {integrity: sha512-C9Opvp6w6aaSZ23uwAowO6IYuiedmSQUdWFrOY267t0RFG+SwoQ0WPVXsdEn4J1MFx4QW9zWthACs5aFqAFrng==} + /pnpm@8.15.5: + resolution: {integrity: sha512-sFGjLH5pWDO4SSbTspuMylclS1ifBknYmcbp0O22cLkex+KkNFm65zdZu1zmGcMmbxFr+THOItHvF1mn5Fqpbw==} engines: {node: '>=16.14'} hasBin: true dev: true @@ -4887,13 +4923,13 @@ packages: hasBin: true dev: true - /ts-api-utils@1.2.1(typescript@5.4.2): + /ts-api-utils@1.2.1(typescript@5.4.3): resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.4.2 + typescript: 5.4.3 dev: true /ts-dedent@2.2.0: @@ -4901,7 +4937,7 @@ packages: engines: {node: '>=6.10'} dev: true - /ts-node-dev@2.0.0(@types/node@20.11.28)(typescript@5.4.2): + /ts-node-dev@2.0.0(@types/node@20.12.2)(typescript@5.4.3): resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==} engines: {node: '>=0.8.0'} hasBin: true @@ -4920,16 +4956,16 @@ packages: rimraf: 2.7.1 source-map-support: 0.5.21 tree-kill: 1.2.2 - ts-node: 10.9.2(@types/node@20.11.28)(typescript@5.4.2) + ts-node: 10.9.2(@types/node@20.12.2)(typescript@5.4.3) tsconfig: 7.0.0 - typescript: 5.4.2 + typescript: 5.4.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' - '@types/node' dev: true - /ts-node@10.9.2(@types/node@20.11.28)(typescript@5.4.2): + /ts-node@10.9.2(@types/node@20.12.2)(typescript@5.4.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -4948,14 +4984,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.28 + '@types/node': 20.12.2 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.2 + typescript: 5.4.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -4986,14 +5022,14 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: false - /tsutils@3.21.0(typescript@5.4.2): + /tsutils@3.21.0(typescript@5.4.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} 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' dependencies: tslib: 1.14.1 - typescript: 5.4.2 + typescript: 5.4.3 dev: true /tsx@4.7.1: @@ -5080,8 +5116,8 @@ packages: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - /typescript@5.4.2: - resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} + /typescript@5.4.3: + resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -5138,7 +5174,7 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@1.4.0(@types/node@20.11.28): + /vite-node@1.4.0(@types/node@20.12.2): resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5147,7 +5183,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.5(@types/node@20.11.28) + vite: 5.1.5(@types/node@20.12.2) transitivePeerDependencies: - '@types/node' - less @@ -5159,7 +5195,7 @@ packages: - terser dev: true - /vite@5.1.5(@types/node@20.11.28): + /vite@5.1.5(@types/node@20.12.2): resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5187,7 +5223,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 esbuild: 0.19.12 postcss: 8.4.35 rollup: 4.12.1 @@ -5195,7 +5231,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.4.0(@types/node@20.11.28): + /vitest@1.4.0(@types/node@20.12.2): resolution: {integrity: sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5220,7 +5256,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.2 '@vitest/expect': 1.4.0 '@vitest/runner': 1.4.0 '@vitest/snapshot': 1.4.0 @@ -5238,8 +5274,8 @@ packages: strip-literal: 2.0.0 tinybench: 2.6.0 tinypool: 0.8.2 - vite: 5.1.5(@types/node@20.11.28) - vite-node: 1.4.0(@types/node@20.11.28) + vite: 5.1.5(@types/node@20.12.2) + vite-node: 1.4.0(@types/node@20.12.2) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/dialects/mssql/mssql-dialect.ts b/src/dialects/mssql/mssql-dialect.ts index 8494e49..e00e1c9 100644 --- a/src/dialects/mssql/mssql-dialect.ts +++ b/src/dialects/mssql/mssql-dialect.ts @@ -24,7 +24,9 @@ export class MssqlDialect extends Dialect { >; const tokens = parsed.server!.split(','); const server = tokens[0]!; - const port = tokens[1] ? parseInt(tokens[1], 10) : DEFAULT_MSSQL_PORT; + const port = tokens[1] + ? Number.parseInt(tokens[1], 10) + : DEFAULT_MSSQL_PORT; return { database: parsed.database!, From 928c3cda57bf725c43fbc921ab64e92f63ea2c67 Mon Sep 17 00:00:00 2001 From: Tyler Gottfredsen Date: Tue, 2 Apr 2024 13:49:36 -0500 Subject: [PATCH 27/29] Fixing bit IdentifierNode to be boolean instead of buffer --- src/dialects/mssql/mssql-adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialects/mssql/mssql-adapter.ts b/src/dialects/mssql/mssql-adapter.ts index 3fa4727..2c92bd4 100644 --- a/src/dialects/mssql/mssql-adapter.ts +++ b/src/dialects/mssql/mssql-adapter.ts @@ -6,7 +6,7 @@ export class MssqlAdapter extends Adapter { override readonly scalars = { bigint: new IdentifierNode('number'), binary: new IdentifierNode('Buffer'), - bit: new IdentifierNode('Buffer'), + bit: new IdentifierNode('boolean'), char: new IdentifierNode('string'), date: new IdentifierNode('Date'), datetime: new IdentifierNode('Date'), From a6a4889d9695723057cc24d1032635756c400eff Mon Sep 17 00:00:00 2001 From: Robin Blomberg Date: Thu, 18 Apr 2024 13:16:43 +0200 Subject: [PATCH 28/29] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc75865..adcbaa6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kysely-codegen", - "version": "0.14.2", + "version": "0.15.0", "author": "Robin Blomberg", "license": "MIT", "main": "./dist/index.js", From 61592ae55b5577b8a41ba1c8ca304e56cf0dc7e3 Mon Sep 17 00:00:00 2001 From: bbedarfmw Date: Tue, 11 Jun 2024 11:39:43 -0600 Subject: [PATCH 29/29] .env.example --- .env.example | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8644498 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +DATABASE_URL="Server=10.49.100.31;Database=MWI;User Id=QQPROD;Password={PROD_PW}" +# MWISPR +# DATABASE_URL="Server=10.49.100.208;Database=MWISPR;User Id=QQPROD;Password={PROD_PW}"