From 8105588f6aaee492e451823cb53733b3b7613e14 Mon Sep 17 00:00:00 2001 From: Kravets <57632712+kravetsone@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:33:24 +0300 Subject: [PATCH 1/4] Replace `chalk` with `picocolors` Replace `chalk` with `picocolors` for better perfomance and reduce bundle size --- drizzle-kit/package.json | 2 +- drizzle-kit/src/cli/commands/drop.ts | 8 +- drizzle-kit/src/cli/commands/introspect.ts | 38 +-- drizzle-kit/src/cli/commands/migrate.ts | 44 +-- .../src/cli/commands/mysqlPushUtils.ts | 26 +- drizzle-kit/src/cli/commands/mysqlUp.ts | 2 +- drizzle-kit/src/cli/commands/pgPushUtils.ts | 22 +- drizzle-kit/src/cli/commands/pgUp.ts | 4 +- drizzle-kit/src/cli/commands/push.ts | 60 ++-- .../src/cli/commands/sqlitePushUtils.ts | 10 +- drizzle-kit/src/cli/commands/sqliteUp.ts | 4 +- drizzle-kit/src/cli/commands/utils.ts | 10 +- drizzle-kit/src/cli/index.ts | 4 +- drizzle-kit/src/cli/schema.ts | 4 +- drizzle-kit/src/cli/selector-ui.ts | 4 +- drizzle-kit/src/cli/validations/common.ts | 10 +- drizzle-kit/src/cli/validations/outputs.ts | 14 +- drizzle-kit/src/cli/views.ts | 74 ++--- drizzle-kit/src/jsonStatements.ts | 6 +- drizzle-kit/src/serializer/index.ts | 4 +- drizzle-kit/src/serializer/mysqlSerializer.ts | 58 ++-- drizzle-kit/src/serializer/pgSerializer.ts | 52 ++-- .../src/serializer/sqliteSerializer.ts | 34 +-- drizzle-kit/src/snapshotsDiffer.ts | 2 +- drizzle-kit/src/utils.ts | 10 +- pnpm-lock.yaml | 280 ++++++------------ 26 files changed, 347 insertions(+), 439 deletions(-) diff --git a/drizzle-kit/package.json b/drizzle-kit/package.json index d4477dbd6f..9fd302d15e 100644 --- a/drizzle-kit/package.json +++ b/drizzle-kit/package.json @@ -52,7 +52,6 @@ "ava": "^5.1.0", "better-sqlite3": "^9.4.3", "camelcase": "^7.0.1", - "chalk": "^5.2.0", "commander": "^12.1.0", "dockerode": "^3.3.4", "dotenv": "^16.0.3", @@ -72,6 +71,7 @@ "mysql2": "2.3.3", "node-fetch": "^3.3.2", "pg": "^8.11.5", + "picocolors": "^1.0.1", "pluralize": "^8.0.0", "postgres": "^3.4.4", "prettier": "^2.8.1", diff --git a/drizzle-kit/src/cli/commands/drop.ts b/drizzle-kit/src/cli/commands/drop.ts index 183e9459d2..e2e386c9bd 100644 --- a/drizzle-kit/src/cli/commands/drop.ts +++ b/drizzle-kit/src/cli/commands/drop.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { readFileSync, rmSync, writeFileSync } from 'fs'; import fs from 'fs'; import { render } from 'hanji'; @@ -19,7 +19,7 @@ export const dropMigration = async ({ if (journal.entries.length === 0) { console.log( - `[${chalk.blue('i')}] no migration entries found in ${metaFilePath}`, + `[${pico.blue('i')}] no migration entries found in ${metaFilePath}`, ); return; } @@ -51,8 +51,8 @@ export const dropMigration = async ({ } console.log( - `[${chalk.green('✓')}] ${ - chalk.bold( + `[${pico.green('✓')}] ${ + pico.bold( result.data.tag, ) } migration successfully dropped`, diff --git a/drizzle-kit/src/cli/commands/introspect.ts b/drizzle-kit/src/cli/commands/introspect.ts index 61ba0b44a1..7ac034daee 100644 --- a/drizzle-kit/src/cli/commands/introspect.ts +++ b/drizzle-kit/src/cli/commands/introspect.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { writeFileSync } from 'fs'; import { render, renderWithTask } from 'hanji'; import { Minimatch } from 'minimatch'; @@ -116,7 +116,7 @@ export const introspectPostgres = async ( } else { render( `[${ - chalk.blue( + pico.blue( 'i', ) }] No SQL generated, you already have migrations in project`, @@ -125,20 +125,20 @@ export const introspectPostgres = async ( render( `[${ - chalk.green( + pico.green( '✓', ) - }] You schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, + }] You schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, ); render( `[${ - chalk.green( + pico.green( '✓', ) }] You relations file is ready ➜ ${ - chalk.bold.underline.blue( + pico.blue(pico.bold(pico.underline( relationsFile, - ) + ))) } 🚀`, ); process.exit(0); @@ -226,7 +226,7 @@ export const introspectMysql = async ( } else { render( `[${ - chalk.blue( + pico.blue( 'i', ) }] No SQL generated, you already have migrations in project`, @@ -235,20 +235,20 @@ export const introspectMysql = async ( render( `[${ - chalk.green( + pico.green( '✓', ) - }] You schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, + }] You schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, ); render( `[${ - chalk.green( + pico.green( '✓', ) }] You relations file is ready ➜ ${ - chalk.bold.underline.blue( + pico.blue(pico.bold(pico.underline( relationsFile, - ) + ))) } 🚀`, ); process.exit(0); @@ -337,7 +337,7 @@ export const introspectSqlite = async ( } else { render( `[${ - chalk.blue( + pico.blue( 'i', ) }] No SQL generated, you already have migrations in project`, @@ -346,20 +346,20 @@ export const introspectSqlite = async ( render( `[${ - chalk.green( + pico.green( '✓', ) - }] You schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, + }] You schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, ); render( `[${ - chalk.green( + pico.green( '✓', ) }] You relations file is ready ➜ ${ - chalk.bold.underline.blue( + pico.blue(pico.bold(pico.underline( relationsFile, - ) + ))) } 🚀`, ); process.exit(0); diff --git a/drizzle-kit/src/cli/commands/migrate.ts b/drizzle-kit/src/cli/commands/migrate.ts index 8ef469fa19..0010fc4098 100644 --- a/drizzle-kit/src/cli/commands/migrate.ts +++ b/drizzle-kit/src/cli/commands/migrate.ts @@ -8,7 +8,7 @@ import { prepareSqliteMigrationSnapshot, } from '../../migrationPreparator'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { render } from 'hanji'; import path, { join } from 'path'; import { TypeOf } from 'zod'; @@ -276,15 +276,15 @@ function mysqlSchemaSuggestions( `\n` + withStyle.suggestion( `We are suggesting to change ${ - chalk.blue( + pico.blue( column.name, ) } column in ${ - chalk.blueBright( + pico.blueBright( table.name, ) } table from serial to bigint unsigned\n\n${ - chalk.blueBright( + pico.blueBright( `bigint("${column.name}", { mode: "number", unsigned: true }).notNull().autoincrement().unique(${ uniqueForSerial?.name ? `"${uniqueForSerial?.name}"` : '' })`, @@ -526,8 +526,8 @@ export const promptColumnsConflicts = async ( if (isRenamePromptItem(data)) { console.log( - `${chalk.yellow('~')} ${data.from.name} › ${data.to.name} ${ - chalk.gray( + `${pico.yellow('~')} ${data.from.name} › ${data.to.name} ${ + pico.gray( 'column will be renamed', ) }`, @@ -539,8 +539,8 @@ export const promptColumnsConflicts = async ( leftMissing = leftMissing.filter(Boolean); } else { console.log( - `${chalk.green('+')} ${data.name} ${ - chalk.gray( + `${pico.green('+')} ${data.name} ${ + pico.gray( 'column will be created', ) }`, @@ -550,7 +550,7 @@ export const promptColumnsConflicts = async ( index += 1; } while (index < newColumns.length); console.log( - chalk.gray(`--- all columns conflicts in ${tableName} table resolved ---\n`), + pico.gray(`--- all columns conflicts in ${tableName} table resolved ---\n`), ); result.deleted.push(...leftMissing); @@ -609,8 +609,8 @@ export const promptNamedWithSchemasConflict = async ( : `${data.to.schema}.`; console.log( - `${chalk.yellow('~')} ${schemaFromPrefix}${data.from.name} › ${schemaToPrefix}${data.to.name} ${ - chalk.gray( + `${pico.yellow('~')} ${schemaFromPrefix}${data.from.name} › ${schemaToPrefix}${data.to.name} ${ + pico.gray( `${entity} will be renamed/moved`, ) }`, @@ -632,8 +632,8 @@ export const promptNamedWithSchemasConflict = async ( leftMissing = leftMissing.filter(Boolean); } else { console.log( - `${chalk.green('+')} ${data.name} ${ - chalk.gray( + `${pico.green('+')} ${data.name} ${ + pico.gray( `${entity} will be created`, ) }`, @@ -642,7 +642,7 @@ export const promptNamedWithSchemasConflict = async ( } index += 1; } while (index < newItems.length); - console.log(chalk.gray(`--- all ${entity} conflicts resolved ---\n`)); + console.log(pico.gray(`--- all ${entity} conflicts resolved ---\n`)); result.deleted.push(...leftMissing); return result; }; @@ -680,8 +680,8 @@ export const promptSchemasConflict = async ( if (isRenamePromptItem(data)) { console.log( - `${chalk.yellow('~')} ${data.from.name} › ${data.to.name} ${ - chalk.gray( + `${pico.yellow('~')} ${data.from.name} › ${data.to.name} ${ + pico.gray( 'schema will be renamed', ) }`, @@ -691,8 +691,8 @@ export const promptSchemasConflict = async ( leftMissing = leftMissing.filter(Boolean); } else { console.log( - `${chalk.green('+')} ${data.name} ${ - chalk.gray( + `${pico.green('+')} ${data.name} ${ + pico.gray( 'schema will be created', ) }`, @@ -701,7 +701,7 @@ export const promptSchemasConflict = async ( } index += 1; } while (index < newSchemas.length); - console.log(chalk.gray('--- all schemas conflicts resolved ---\n')); + console.log(pico.gray('--- all schemas conflicts resolved ---\n')); result.deleted.push(...leftMissing); return result; }; @@ -799,12 +799,12 @@ export const writeResult = ({ render( `[${ - chalk.green( + pico.green( '✓', ) }] Your SQL migration file ➜ ${ - chalk.bold.underline.blue( - path.join(`${outFolder}/${tag}.sql`), + pico.blue(pico.bold(pico.underline( + path.join(`${outFolder}/${tag}.sql`),)) ) } 🚀`, ); diff --git a/drizzle-kit/src/cli/commands/mysqlPushUtils.ts b/drizzle-kit/src/cli/commands/mysqlPushUtils.ts index db1134e63b..369ff48a4b 100644 --- a/drizzle-kit/src/cli/commands/mysqlPushUtils.ts +++ b/drizzle-kit/src/cli/commands/mysqlPushUtils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { render } from 'hanji'; import { TypeOf } from 'zod'; import { JsonAlterColumnTypeStatement, JsonStatement } from '../../jsonStatements'; @@ -127,7 +127,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.tableName, ) } table with ${count} items`, @@ -143,7 +143,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${statement.tableName} table with ${count} items`, @@ -159,7 +159,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.name, ) } schema with ${count} tables`, @@ -175,14 +175,14 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.columnName, ) } column type from ${ - chalk.underline( + pico.underline( statement.oldDataType, ) - } to ${chalk.underline(statement.newDataType)} with ${count} items`, + } to ${pico.underline(statement.newDataType)} with ${count} items`, ); statementsToExecute.push(`truncate table ${statement.tableName};`); tablesToTruncate.push(statement.tableName); @@ -198,7 +198,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to remove default value from ${ - chalk.underline( + pico.underline( statement.columnName, ) } not-null column with ${count} items`, @@ -221,7 +221,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to set not-null constraint to ${ - chalk.underline( + pico.underline( statement.columnName, ) } column without default, which contains ${count} items`, @@ -258,7 +258,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.tableName, ) } primary key. This statements may fail and you table may left without primary key`, @@ -295,7 +295,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( statement.column.name, ) } column without default value, which contains ${count} items`, @@ -316,11 +316,11 @@ export const logSuggestionsAndReturn = async ( const unsquashedUnique = MySqlSquasher.unsquashUnique(statement.data); console.log( `· You're about to add ${ - chalk.underline( + pico.underline( unsquashedUnique.name, ) } unique constraint to the table, which contains ${count} items. If this statement fails, you will receive an error from the database. Do you want to truncate ${ - chalk.underline( + pico.underline( statement.tableName, ) } table?\n`, diff --git a/drizzle-kit/src/cli/commands/mysqlUp.ts b/drizzle-kit/src/cli/commands/mysqlUp.ts index 6c7d2ebe50..ac3d1594d6 100644 --- a/drizzle-kit/src/cli/commands/mysqlUp.ts +++ b/drizzle-kit/src/cli/commands/mysqlUp.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import fs, { writeFileSync } from 'fs'; import path from 'path'; import { Column, MySqlSchema, MySqlSchemaV4, MySqlSchemaV5, mysqlSchemaV5, Table } from '../../serializer/mysqlSchema'; diff --git a/drizzle-kit/src/cli/commands/pgPushUtils.ts b/drizzle-kit/src/cli/commands/pgPushUtils.ts index eee0dc954f..0b58508b13 100644 --- a/drizzle-kit/src/cli/commands/pgPushUtils.ts +++ b/drizzle-kit/src/cli/commands/pgPushUtils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { render } from 'hanji'; import type { JsonStatement } from '../../jsonStatements'; import { PgSquasher } from '../../serializer/pgSchema'; @@ -97,7 +97,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.tableName, ) } table with ${count} items`, @@ -123,7 +123,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${statement.tableName} table with ${count} items`, @@ -139,7 +139,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.name, ) } schema with ${count} tables`, @@ -162,14 +162,14 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.columnName, ) } column type from ${ - chalk.underline( + pico.underline( statement.oldDataType, ) - } to ${chalk.underline(statement.newDataType)} with ${count} items`, + } to ${pico.underline(statement.newDataType)} with ${count} items`, ); statementsToExecute.push( `truncate table ${ @@ -199,7 +199,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.tableName, ) } primary key. This statements may fail and you table may left without primary key`, @@ -251,7 +251,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { if (count > 0) { infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( statement.column.name, ) } column without default value, which contains ${count} items`, @@ -288,11 +288,11 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { const unsquashedUnique = PgSquasher.unsquashUnique(statement.data); console.log( `· You're about to add ${ - chalk.underline( + pico.underline( unsquashedUnique.name, ) } unique constraint to the table, which contains ${count} items. If this statement fails, you will receive an error from the database. Do you want to truncate ${ - chalk.underline( + pico.underline( statement.tableName, ) } table?\n`, diff --git a/drizzle-kit/src/cli/commands/pgUp.ts b/drizzle-kit/src/cli/commands/pgUp.ts index f3faaeb62b..72c7d5950b 100644 --- a/drizzle-kit/src/cli/commands/pgUp.ts +++ b/drizzle-kit/src/cli/commands/pgUp.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { writeFileSync } from 'fs'; import { Column, @@ -33,7 +33,7 @@ export const upPgHandler = (out: string) => { const result = updateUpToV7(resultV6); - console.log(`[${chalk.green('✓')}] ${path}`); + console.log(`[${pico.green('✓')}] ${path}`); writeFileSync(path, JSON.stringify(result, null, 2)); }); diff --git a/drizzle-kit/src/cli/commands/push.ts b/drizzle-kit/src/cli/commands/push.ts index e48a5da9e1..1886081796 100644 --- a/drizzle-kit/src/cli/commands/push.ts +++ b/drizzle-kit/src/cli/commands/push.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { render } from 'hanji'; import { fromJson } from '../../sqlgenerator'; import { Select } from '../selector-ui'; @@ -36,7 +36,7 @@ export const mysqlPush = async ( try { if (filteredStatements.length === 0) { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } else { const { shouldAskForApprove, @@ -69,14 +69,14 @@ export const mysqlPush = async ( if (verbose) { console.log(); - // console.log(chalk.gray('Verbose logs:')); + // console.log(pico.gray('Verbose logs:')); console.log( withStyle.warning('You are about to execute current statements:'), ); console.log(); console.log( [...uniqueSqlStatementsToExecute, ...uniqueFilteredSqlStatements] - .map((s) => chalk.blue(s)) + .map((s) => pico.blue(s)) .join('\n'), ); console.log(); @@ -88,7 +88,7 @@ export const mysqlPush = async ( new Select(['No, abort', `Yes, I want to execute all statements`]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -99,12 +99,12 @@ export const mysqlPush = async ( console.log(infoToPrint.join('\n')); console.log(); console.log( - chalk.red.bold( + pico.red(pico.bold( 'THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED\n', - ), + )), ); - console.log(chalk.white('Do you still want to push changes?')); + console.log(pico.white('Do you still want to push changes?')); const { status, data } = await render( new Select([ @@ -127,7 +127,7 @@ export const mysqlPush = async ( ]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -140,9 +140,9 @@ export const mysqlPush = async ( await db.query(statement); } if (filteredStatements.length > 0) { - render(`[${chalk.green('✓')}] Changes applied`); + render(`[${pico.green('✓')}] Changes applied`); } else { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } } } catch (e) { @@ -171,7 +171,7 @@ export const pgPush = async ( try { if (statements.sqlStatements.length === 0) { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } else { // const filteredStatements = filterStatements(statements.statements); const { @@ -186,12 +186,12 @@ export const pgPush = async ( if (verbose) { console.log(); - // console.log(chalk.gray('Verbose logs:')); + // console.log(pico.gray('Verbose logs:')); console.log( withStyle.warning('You are about to execute current statements:'), ); console.log(); - console.log(statementsToExecute.map((s) => chalk.blue(s)).join('\n')); + console.log(statementsToExecute.map((s) => pico.blue(s)).join('\n')); console.log(); } @@ -201,7 +201,7 @@ export const pgPush = async ( new Select(['No, abort', `Yes, I want to execute all statements`]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -212,12 +212,12 @@ export const pgPush = async ( console.log(infoToPrint.join('\n')); console.log(); console.log( - chalk.red.bold( + pico.red(pico.bold( 'THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED\n', - ), + )), ); - console.log(chalk.white('Do you still want to push changes?')); + console.log(pico.white('Do you still want to push changes?')); const { status, data } = await render( new Select([ @@ -240,7 +240,7 @@ export const pgPush = async ( ]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -250,9 +250,9 @@ export const pgPush = async ( } if (statements.statements.length > 0) { - render(`[${chalk.green('✓')}] Changes applied`); + render(`[${pico.green('✓')}] Changes applied`); } else { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } } } catch (e) { @@ -278,7 +278,7 @@ export const sqlitePush = async ( const statements = await prepareSQLitePush(schemaPath, schema); if (statements.sqlStatements.length === 0) { - render(`\n[${chalk.blue('i')}] No changes detected`); + render(`\n[${pico.blue('i')}] No changes detected`); } else { const { shouldAskForApprove, @@ -302,7 +302,7 @@ export const sqlitePush = async ( withStyle.warning('You are about to execute current statements:'), ); console.log(); - console.log(statementsToExecute.map((s) => chalk.blue(s)).join('\n')); + console.log(statementsToExecute.map((s) => pico.blue(s)).join('\n')); console.log(); } @@ -312,7 +312,7 @@ export const sqlitePush = async ( new Select(['No, abort', `Yes, I want to execute all statements`]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -323,12 +323,12 @@ export const sqlitePush = async ( console.log(infoToPrint.join('\n')); console.log(); console.log( - chalk.red.bold( + pico.red(pico.bold( 'THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED\n', - ), + )), ); - console.log(chalk.white('Do you still want to push changes?')); + console.log(pico.white('Do you still want to push changes?')); const { status, data } = await render( new Select([ @@ -352,13 +352,13 @@ export const sqlitePush = async ( ]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } if (statementsToExecute.length === 0) { - render(`\n[${chalk.blue('i')}] No changes detected`); + render(`\n[${pico.blue('i')}] No changes detected`); } else { if (!('driver' in credentials)) { await db.query('begin'); @@ -375,7 +375,7 @@ export const sqlitePush = async ( } else if (credentials.driver === 'turso') { await db.batch!(statementsToExecute.map((it) => ({ query: it }))); } - render(`[${chalk.green('✓')}] Changes applied`); + render(`[${pico.green('✓')}] Changes applied`); } } }; diff --git a/drizzle-kit/src/cli/commands/sqlitePushUtils.ts b/drizzle-kit/src/cli/commands/sqlitePushUtils.ts index 451f035a70..da964778f0 100644 --- a/drizzle-kit/src/cli/commands/sqlitePushUtils.ts +++ b/drizzle-kit/src/cli/commands/sqlitePushUtils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { SQLiteSchemaInternal, SQLiteSchemaSquashed, SQLiteSquasher } from '../../serializer/sqliteSchema'; import { @@ -131,7 +131,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.tableName, ) } table with ${count} items`, @@ -169,7 +169,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${newTableName} table with ${count} items`, @@ -224,7 +224,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( statement.column.name, ) } column without default value, which contains ${count} items`, @@ -294,7 +294,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null constraint to ${ - chalk.underline( + pico.underline( statement.columnName, ) } column without default value, which contains ${count} items`, diff --git a/drizzle-kit/src/cli/commands/sqliteUp.ts b/drizzle-kit/src/cli/commands/sqliteUp.ts index b76b9e2cde..780eedb310 100644 --- a/drizzle-kit/src/cli/commands/sqliteUp.ts +++ b/drizzle-kit/src/cli/commands/sqliteUp.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { writeFileSync } from 'fs'; import { mapEntries } from 'src/global'; import { SQLiteSchema, sqliteSchemaV5 } from 'src/serializer/sqliteSchema'; @@ -17,7 +17,7 @@ export const upSqliteHandler = (out: string) => { const path = it.path; const result = updateUpToV6(it.raw); - console.log(`[${chalk.green('✓')}] ${path}`); + console.log(`[${pico.green('✓')}] ${path}`); writeFileSync(path, JSON.stringify(result, null, 2)); }); diff --git a/drizzle-kit/src/cli/commands/utils.ts b/drizzle-kit/src/cli/commands/utils.ts index aeb5c05ad4..b411acf456 100644 --- a/drizzle-kit/src/cli/commands/utils.ts +++ b/drizzle-kit/src/cli/commands/utils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { existsSync } from 'fs'; import { render } from 'hanji'; import { join, resolve } from 'path'; @@ -152,7 +152,7 @@ export const prepareGenerateConfig = async ( const fileNames = prepareFilenames(schema); if (fileNames.length === 0) { - render(`[${chalk.blue('i')}] No schema file in ${schema} was found`); + render(`[${pico.blue('i')}] No schema file in ${schema} was found`); process.exit(0); } @@ -242,7 +242,7 @@ export const preparePushConfig = async ( const schemaFiles = prepareFilenames(config.schema); if (schemaFiles.length === 0) { - render(`[${chalk.blue('i')}] No schema file in ${config.schema} was found`); + render(`[${pico.blue('i')}] No schema file in ${config.schema} was found`); process.exit(0); } @@ -614,7 +614,7 @@ export const drizzleConfigFromFile = async ( if (!configPath) { console.log( - chalk.gray( + pico.gray( `No config path provided, using default '${defaultConfigPath}'`, ), ); @@ -627,7 +627,7 @@ export const drizzleConfigFromFile = async ( process.exit(1); } - console.log(chalk.grey(`Reading config file '${path}'`)); + console.log(pico.gray(`Reading config file '${path}'`)); const { unregister } = await safeRegister(); const required = require(`${path}`); const content = required.default ?? required; diff --git a/drizzle-kit/src/cli/index.ts b/drizzle-kit/src/cli/index.ts index a7272ffef0..d8b0de8344 100644 --- a/drizzle-kit/src/cli/index.ts +++ b/drizzle-kit/src/cli/index.ts @@ -1,5 +1,5 @@ import { command, run } from '@drizzle-team/brocli'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { check, drop, generate, migrate, pull, push, studio, up } from './schema'; import { ormCoreVersions } from './utils'; @@ -9,7 +9,7 @@ const version = async () => { const envVersion = process.env.DRIZZLE_KIT_VERSION; const kitVersion = envVersion ? `v${envVersion}` : '--'; const versions = `drizzle-kit: ${kitVersion}\n${ormVersion}`; - console.log(chalk.gray(versions), '\n'); + console.log(pico.gray(versions), '\n'); }; const legacyCommand = (name: string, newName: string) => { diff --git a/drizzle-kit/src/cli/schema.ts b/drizzle-kit/src/cli/schema.ts index 642344bda9..610ed57e6a 100644 --- a/drizzle-kit/src/cli/schema.ts +++ b/drizzle-kit/src/cli/schema.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { checkHandler } from './commands/check'; import { assertOrmCoreVersion, assertPackages, assertStudioNodeVersion, ormVersionGt } from './utils'; import '../@types/utils'; @@ -593,7 +593,7 @@ export const studio = command({ console.log( `\nDrizzle Studio is up and running on ${ - chalk.blue( + pico.blue( `https://local.drizzle.studio${queryString ? `?${queryString}` : ''}`, ) }`, diff --git a/drizzle-kit/src/cli/selector-ui.ts b/drizzle-kit/src/cli/selector-ui.ts index f384831d0e..132ac36d74 100644 --- a/drizzle-kit/src/cli/selector-ui.ts +++ b/drizzle-kit/src/cli/selector-ui.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { Prompt, SelectState } from 'hanji'; export class Select extends Prompt<{ index: number; value: string }> { @@ -21,7 +21,7 @@ export class Select extends Prompt<{ index: number; value: string }> { let text = ``; this.data.items.forEach((it, idx) => { text += idx === this.data.selectedIdx - ? `${chalk.green('❯ ' + it.label)}` + ? `${pico.green('❯ ' + it.label)}` : ` ${it.label}`; text += idx != this.data.items.length - 1 ? '\n' : ''; }); diff --git a/drizzle-kit/src/cli/validations/common.ts b/drizzle-kit/src/cli/validations/common.ts index fe57fa64a9..508cade0ea 100644 --- a/drizzle-kit/src/cli/validations/common.ts +++ b/drizzle-kit/src/cli/validations/common.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { UnionToIntersection } from 'hono/utils/types'; import { any, boolean, enum as enum_, literal, object, string, TypeOf, union } from 'zod'; import { dialect } from '../../schemaValidator'; @@ -160,8 +160,8 @@ export const wrapParam = ( param: any | undefined, optional: boolean = false, ) => { - const check = `[${chalk.green('✓')}]`; - const cross = `[${chalk.red('x')}]`; + const check = `[${pico.green('✓')}]`; + const cross = `[${pico.red('x')}]`; if (typeof param === 'string') { if (param.length === 0) { return ` ${cross} ${name}: ''`; @@ -169,7 +169,7 @@ export const wrapParam = ( return ` ${check} ${name}: '${param}'`; } if (optional) { - return chalk.gray(` ${name}?: `); + return pico.gray(` ${name}?: `); } - return ` ${cross} ${name}: ${chalk.gray('undefined')}`; + return ` ${cross} ${name}: ${pico.gray('undefined')}`; }; diff --git a/drizzle-kit/src/cli/validations/outputs.ts b/drizzle-kit/src/cli/validations/outputs.ts index 6b92829d57..865d08c5f8 100644 --- a/drizzle-kit/src/cli/validations/outputs.ts +++ b/drizzle-kit/src/cli/validations/outputs.ts @@ -1,13 +1,13 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { sqliteDriversLiterals } from './common'; export const withStyle = { - error: (str: string) => `${chalk.red(`${chalk.white.bgRed(' Invalid input ')} ${str}`)}`, - warning: (str: string) => `${chalk.white.bgGray(' Warning ')} ${str}`, - errorWarning: (str: string) => `${chalk.red(`${chalk.white.bgRed(' Warning ')} ${str}`)}`, - fullWarning: (str: string) => `${chalk.black.bgYellow(' Warning ')} ${chalk.bold(str)}`, - suggestion: (str: string) => `${chalk.white.bgGray(' Suggestion ')} ${str}`, - info: (str: string) => `${chalk.grey(str)}`, + error: (str: string) => `${pico.red(`${pico.bgRed(pico.white(' Invalid input '))} ${str}`)}`, + warning: (str: string) => `${pico.bgGray(pico.white(' Warning '))} ${str}`, + errorWarning: (str: string) => `${pico.red(`${pico.bgRed(pico.white(' Warning '))} ${str}`)}`, + fullWarning: (str: string) => `${pico.bgYellow(pico.black(' Warning '))} ${pico.bold(str)}`, + suggestion: (str: string) => `${pico.bgGray(pico.white(' Suggestion '))} ${str}`, + info: (str: string) => `${pico.gray(str)}`, }; export const outputs = { diff --git a/drizzle-kit/src/cli/views.ts b/drizzle-kit/src/cli/views.ts index 56e0331df2..ad9c90227a 100644 --- a/drizzle-kit/src/cli/views.ts +++ b/drizzle-kit/src/cli/views.ts @@ -1,40 +1,40 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { Prompt, render, SelectState, TaskView } from 'hanji'; import type { CommonSchema } from '../schemaValidator'; import { objectValues } from '../utils'; import type { Named, NamedWithSchema } from './commands/migrate'; export const warning = (msg: string) => { - render(`[${chalk.yellow('Warning')}] ${msg}`); + render(`[${pico.yellow('Warning')}] ${msg}`); }; export const err = (msg: string) => { - render(`${chalk.bold.red('Error')} ${msg}`); + render(`${pico.red(pico.bold('Error'))} ${msg}`); }; export const info = (msg: string, greyMsg: string = ''): string => { - return `${chalk.blue.bold('Info:')} ${msg} ${greyMsg ? chalk.grey(greyMsg) : ''}`.trim(); + return `${pico.blue(pico.bold('Info:'))} ${msg} ${greyMsg ? pico.gray(greyMsg) : ''}`.trim(); }; export const grey = (msg: string): string => { - return chalk.grey(msg); + return pico.gray(msg); }; export const error = (error: string, greyMsg: string = ''): string => { - return `${chalk.bgRed.bold(' Error ')} ${error} ${greyMsg ? chalk.grey(greyMsg) : ''}`.trim(); + return `${pico.bgRed(pico.bold(' Error '))} ${error} ${greyMsg ? pico.gray(greyMsg) : ''}`.trim(); }; export const schema = (schema: CommonSchema): string => { type TableEntry = (typeof schema)['tables'][keyof (typeof schema)['tables']]; const tables = Object.values(schema.tables) as unknown as TableEntry[]; - let msg = chalk.bold(`${tables.length} tables\n`); + let msg = pico.bold(`${tables.length} tables\n`); msg += tables .map((t) => { const columnsCount = Object.values(t.columns).length; const indexesCount = Object.values(t.indexes).length; const foreignKeys = Object.values(t.foreignKeys).length; - return `${chalk.bold.blue(t.name)} ${ - chalk.gray( + return `${pico.blue(pico.bold(t.name))} ${ + pico.gray( `${columnsCount} columns ${indexesCount} indexes ${foreignKeys} fks`, ) }`; @@ -53,12 +53,12 @@ export const schema = (schema: CommonSchema): string => { if (enums.length > 0) { msg += '\n'; - msg += chalk.bold(`${enums.length} enums\n`); + msg += pico.bold(`${enums.length} enums\n`); msg += enums .map((it) => { - return `${chalk.bold.blue(it.name)} ${ - chalk.gray( + return `${pico.blue(pico.bold(it.name))} ${ + pico.gray( `[${Object.values(it.values).join(', ')}]`, ) }`; @@ -102,12 +102,12 @@ export class ResolveColumnSelect extends Prompt< } let text = `\nIs ${ - chalk.bold.blue( - this.base.name, + pico.blue(pico.bold( + this.base.name) ) } column in ${ - chalk.bold.blue( - this.tableName, + pico.blue(pico.bold( + this.tableName,) ) } table created or renamed from another column?\n`; @@ -116,8 +116,8 @@ export class ResolveColumnSelect extends Prompt< ); const selectedPrefix = isSelectedRenamed - ? chalk.yellow('❯ ') - : chalk.green('❯ '); + ? pico.yellow('❯ ') + : pico.green('❯ '); const labelLength: number = this.data.items .filter((it) => isRenamePromptItem(it)) @@ -138,8 +138,8 @@ export class ResolveColumnSelect extends Prompt< ? `${it.from.name} › ${it.to.name}`.padEnd(labelLength, ' ') : it.name.padEnd(labelLength, ' '); const label = isRenamed - ? `${chalk.yellow('~')} ${title} ${chalk.gray('rename column')}` - : `${chalk.green('+')} ${title} ${chalk.gray('create column')}`; + ? `${pico.yellow('~')} ${title} ${pico.gray('rename column')}` + : `${pico.green('+')} ${title} ${pico.gray('create column')}`; text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`; text += idx != this.data.items.length - 1 ? '\n' : ''; @@ -181,15 +181,15 @@ export class ResolveSelect extends Prompt< } const key = tableKey(this.base); - let text = `\nIs ${chalk.bold.blue(key)} ${this.entityType} created or renamed from another ${this.entityType}?\n`; + let text = `\nIs ${pico.blue(pico.bold(key))} ${this.entityType} created or renamed from another ${this.entityType}?\n`; const isSelectedRenamed = isRenamePromptItem( this.state.items[this.state.selectedIdx], ); const selectedPrefix = isSelectedRenamed - ? chalk.yellow('❯ ') - : chalk.green('❯ '); + ? pico.yellow('❯ ') + : pico.green('❯ '); const labelLength: number = this.state.items .filter((it) => isRenamePromptItem(it)) @@ -215,8 +215,8 @@ export class ResolveSelect extends Prompt< : tableKey(it).padEnd(labelLength, ' '); const label = isRenamed - ? `${chalk.yellow('~')} ${title} ${chalk.gray(`rename ${entityType}`)}` - : `${chalk.green('+')} ${title} ${chalk.gray(`create ${entityType}`)}`; + ? `${pico.yellow('~')} ${title} ${pico.gray(`rename ${entityType}`)}` + : `${pico.green('+')} ${title} ${pico.gray(`create ${entityType}`)}`; text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`; text += idx != this.state.items.length - 1 ? '\n' : ''; @@ -248,16 +248,16 @@ export class ResolveSchemasSelect extends Prompt< } let text = `\nIs ${ - chalk.bold.blue( - this.base.name, + pico.blue(pico.bold( + this.base.name) ) } schema created or renamed from another schema?\n`; const isSelectedRenamed = isRenamePromptItem( this.state.items[this.state.selectedIdx], ); const selectedPrefix = isSelectedRenamed - ? chalk.yellow('❯ ') - : chalk.green('❯ '); + ? pico.yellow('❯ ') + : pico.green('❯ '); const labelLength: number = this.state.items .filter((it) => isRenamePromptItem(it)) @@ -278,8 +278,8 @@ export class ResolveSchemasSelect extends Prompt< ? `${it.from.name} › ${it.to.name}`.padEnd(labelLength, ' ') : it.name.padEnd(labelLength, ' '); const label = isRenamed - ? `${chalk.yellow('~')} ${title} ${chalk.gray('rename schema')}` - : `${chalk.green('+')} ${title} ${chalk.gray('create schema')}`; + ? `${pico.yellow('~')} ${title} ${pico.gray('rename schema')}` + : `${pico.green('+')} ${title} ${pico.gray('create schema')}`; text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`; text += idx != this.state.items.length - 1 ? '\n' : ''; @@ -404,7 +404,7 @@ export class IntrospectProgress extends TaskView { const { name, count } = stage; const isDone = stage.status === 'done'; - const prefix = isDone ? `[${chalk.green('✓')}]` : `[${spinner}]`; + const prefix = isDone ? `[${pico.green('✓')}]` : `[${spinner}]`; const formattedCount = this.formatCount(count); const suffix = isDone @@ -445,7 +445,7 @@ export class MigrateProgress extends TaskView { const spin = this.spinner.value(); return `[${spin}] applying migrations...`; } - return `[${chalk.green('✓')}] migrations applied successfully!`; + return `[${pico.green('✓')}] migrations applied successfully!`; } } @@ -471,7 +471,7 @@ export class ProgressView extends TaskView { const spin = this.spinner.value(); return `[${spin}] ${this.progressText}\n`; } - return `[${chalk.green('✓')}] ${this.successText}\n`; + return `[${pico.green('✓')}] ${this.successText}\n`; } } @@ -491,8 +491,8 @@ export class DropMigrationView extends Prompt { return '\n'; } - let text = chalk.bold('Please select migration to drop:\n'); - const selectedPrefix = chalk.yellow('❯ '); + let text = pico.bold('Please select migration to drop:\n'); + const selectedPrefix = pico.yellow('❯ '); const data = trimmedRange(this.data.items, this.data.selectedIdx, 9); const labelLength: number = data.trimmed @@ -509,7 +509,7 @@ export class DropMigrationView extends Prompt { data.trimmed.forEach((it, idx) => { const isSelected = idx === this.data.selectedIdx - data.offset; let title = it.tag.padEnd(labelLength, ' '); - title = isSelected ? chalk.yellow(title) : title; + title = isSelected ? pico.yellow(title) : title; text += isSelected ? `${selectedPrefix}${title}` : ` ${title}`; text += idx != this.data.items.length - 1 ? '\n' : ''; diff --git a/drizzle-kit/src/jsonStatements.ts b/drizzle-kit/src/jsonStatements.ts index ad2afea7f5..cfb26d832a 100644 --- a/drizzle-kit/src/jsonStatements.ts +++ b/drizzle-kit/src/jsonStatements.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { table } from 'console'; import { warning } from './cli/views'; import { CommonSquashedSchema, Dialect } from './schemaValidator'; @@ -1146,7 +1146,7 @@ export const prepareAlterColumnsMysql = ( if (columnGenerated?.type === 'virtual') { warning( `You are trying to add virtual generated constraint to ${ - chalk.blue( + pico.blue( columnName, ) } column. As MySQL docs mention: "Nongenerated columns can be altered to stored but not virtual generated columns". We will drop an existing column and add it with a virtual generated statement. This means that the data previously stored in this column will be wiped, and new data will be generated on each read for this column\n`, @@ -1187,7 +1187,7 @@ export const prepareAlterColumnsMysql = ( if (columnGenerated?.type === 'virtual') { warning( `You are trying to remove virtual generated constraint from ${ - chalk.blue( + pico.blue( columnName, ) } column. As MySQL docs mention: "Stored but not virtual generated columns can be altered to nongenerated columns. The stored generated values become the values of the nongenerated column". We will drop an existing column and add it without a virtual generated statement. This means that this column will have no data after migration\n`, diff --git a/drizzle-kit/src/serializer/index.ts b/drizzle-kit/src/serializer/index.ts index 214ca38c72..1015165016 100644 --- a/drizzle-kit/src/serializer/index.ts +++ b/drizzle-kit/src/serializer/index.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import type { SQL } from 'drizzle-orm'; import fs from 'fs'; import * as glob from 'glob'; @@ -41,7 +41,7 @@ export const serializeMySql = async ( ): Promise => { const filenames = prepareFilenames(path); - console.log(chalk.gray(`Reading schema files:\n${filenames.join('\n')}\n`)); + console.log(pico.gray(`Reading schema files:\n${filenames.join('\n')}\n`)); const { prepareFromMySqlImports } = await import('./mysqlImports'); const { generateMySqlSnapshot } = await import('./mysqlSerializer'); diff --git a/drizzle-kit/src/serializer/mysqlSerializer.ts b/drizzle-kit/src/serializer/mysqlSerializer.ts index eb18743fb9..43e590fbde 100644 --- a/drizzle-kit/src/serializer/mysqlSerializer.ts +++ b/drizzle-kit/src/serializer/mysqlSerializer.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { getTableName, is } from 'drizzle-orm'; import { SQL } from 'drizzle-orm'; import { AnyMySqlTable, MySqlDialect, type PrimaryKey as PrimaryKeyORM, uniqueKeyName } from 'drizzle-orm/mysql-core'; @@ -91,22 +91,22 @@ export const generateMySqlSnapshot = ( console.log( `\n${ withStyle.errorWarning(`We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( - tableName, + pico.blue(pico.underline( + tableName,) ) } table. The unique constraint ${ - chalk.underline.blue( - column.uniqueName, + pico.blue(pico.underline( + column.uniqueName,) ) } on the ${ - chalk.underline.blue( - column.name, + pico.blue(pico.underline( + column.name) ) } column is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( existingUnique.columns.join(','), - ) + )) } columns\n`) }`, ); @@ -177,20 +177,20 @@ export const generateMySqlSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( - tableName, + pico.blue(pico.underline( + tableName,) ) } table. \nThe unique constraint ${ - chalk.underline.blue( - name, + pico.blue(pico.underline( + name,) ) } on the ${ - chalk.underline.blue( - columnNames.join(','), + pico.blue(pico.underline( + columnNames.join(',')), ) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( - existingUnique.columns.join(','), + pico.blue(pico.underline( + existingUnique.columns.join(','),) ) } columns\n`, ) @@ -269,21 +269,21 @@ export const generateMySqlSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( - tableName, + pico.blue(pico.underline( + tableName,) ) } table. \nThe unique index ${ - chalk.underline.blue( + pico.blue(pico.underline( name, - ) + )) } on the ${ - chalk.underline.blue( + pico.blue(pico.underline( indexColumns.join(','), - ) + )) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( uniqueConstraintObject[name].columns.join(','), - ) + )) } columns\n`, ) }`, @@ -296,13 +296,13 @@ export const generateMySqlSnapshot = ( `\n${ withStyle.errorWarning( `In MySQL, when creating a foreign key, an index is automatically generated with the same name as the foreign key constraint.\n\nWe have encountered a collision between the index name on columns ${ - chalk.underline.blue( + pico.blue(pico.underline( indexColumns.join(','), - ) + )) } and the foreign key on columns ${ - chalk.underline.blue( + pico.blue(pico.underline( foreignKeysObject[name].columnsFrom.join(','), - ) + )) }. Please change either the index name or the foreign key name. For more information, please refer to https://dev.mysql.com/doc/refman/8.0/en/constraint-foreign-key.html\n `, ) diff --git a/drizzle-kit/src/serializer/pgSerializer.ts b/drizzle-kit/src/serializer/pgSerializer.ts index bcf8a6a5e0..9cd0717da9 100644 --- a/drizzle-kit/src/serializer/pgSerializer.ts +++ b/drizzle-kit/src/serializer/pgSerializer.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { getTableName, is, SQL } from 'drizzle-orm'; import { AnyPgTable, @@ -172,22 +172,22 @@ export const generatePgSnapshot = ( console.log( `\n${ withStyle.errorWarning(`We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.blue(pico.underline( tableName, - ) + )) } table. The unique constraint ${ - chalk.underline.blue( + pico.blue(pico.underline( column.uniqueName, - ) + )) } on the ${ - chalk.underline.blue( + pico.blue(pico.underline( column.name, - ) + )) } column is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( existingUnique.columns.join(','), - ) + )) } columns\n`) }`, ); @@ -255,22 +255,22 @@ export const generatePgSnapshot = ( console.log( `\n${ withStyle.errorWarning(`We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.blue(pico.underline( tableName, - ) + )) } table. The unique constraint ${ - chalk.underline.blue( + pico.blue(pico.underline( name, - ) + )) } on the ${ - chalk.underline.blue( + pico.blue(pico.underline( columnNames.join(','), - ) + )) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( existingUnique.columns.join(','), - ) + )) } columns\n`) }`, ); @@ -348,25 +348,25 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `You are specifying an index on the ${ - chalk.blueBright( + pico.blueBright( it.name, ) } column inside the ${ - chalk.blueBright( + pico.blueBright( tableName, ) } table with the ${ - chalk.blueBright( + pico.blueBright( 'vector', ) } type without specifying an operator class. Vector extension doesn't have a default operator class, so you need to specify one of the available options. Here is a list of available op classes for the vector extension: [${ vectorOps - .map((it) => `${chalk.underline(`${it}`)}`) + .map((it) => `${pico.underline(`${it}`)}`) .join( ', ', ) }].\n\nYou can specify it using current syntax: ${ - chalk.underline( + pico.underline( `index("${value.config.name}").using("${value.config.method}", table.${it.name}.op("${ vectorOps[0] }"))`, @@ -417,13 +417,13 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated index name across ${ - chalk.underline.blue( + pico.blue(pico.underline( schema ?? 'public', - ) + )) } schema. Please rename your index in either the ${ - chalk.underline.blue( + pico.blue(pico.underline( tableName, - ) + )) } table or the table with the duplicated index name`, ) }`, diff --git a/drizzle-kit/src/serializer/sqliteSerializer.ts b/drizzle-kit/src/serializer/sqliteSerializer.ts index c673daafbb..f9ecd76577 100644 --- a/drizzle-kit/src/serializer/sqliteSerializer.ts +++ b/drizzle-kit/src/serializer/sqliteSerializer.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { getTableName, is, SQL } from 'drizzle-orm'; import { // AnySQLiteColumnBuilder, @@ -92,22 +92,22 @@ export const generateSqliteSnapshot = ( console.log( `\n${ withStyle.errorWarning(`We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.blue(pico.underline( tableName, - ) + )) } table. The unique constraint ${ - chalk.underline.blue( + pico.blue(pico.underline( column.uniqueName, - ) + )) } on the ${ - chalk.underline.blue( + pico.blue(pico.underline( column.name, - ) + )) } column is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( existingUnique.columns.join(','), - ) + )) } columns\n`) }`, ); @@ -205,21 +205,21 @@ export const generateSqliteSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.blue(pico.underline( tableName, - ) + )) } table. \nThe unique constraint ${ - chalk.underline.blue( + pico.blue(pico.underline( name, - ) + )) } on the ${ - chalk.underline.blue( + pico.blue(pico.underline( columnNames.join(','), - ) + )) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.blue(pico.underline( existingUnique.columns.join(','), - ) + )) } columns\n`, ) }`, diff --git a/drizzle-kit/src/snapshotsDiffer.ts b/drizzle-kit/src/snapshotsDiffer.ts index 9ad2d9e32f..00b774cc65 100644 --- a/drizzle-kit/src/snapshotsDiffer.ts +++ b/drizzle-kit/src/snapshotsDiffer.ts @@ -1016,7 +1016,7 @@ export const applyPgSnapshotsDiff = async ( // if (hasEnumValuesDeletions) { // console.log(error("Deletion of enum values is prohibited in Postgres - see here")); // for(let entry of enumValuesDeletions){ - // console.log(error(`You're trying to delete ${chalk.blue(`[${entry.values.join(", ")}]`)} values from ${chalk.blue(`${entry.schema}.${entry.name}`)}`)) + // console.log(error(`You're trying to delete ${pico.blue(`[${entry.values.join(", ")}]`)} values from ${pico.blue(`${entry.schema}.${entry.name}`)}`)) // } // } // if (hasEnumValuesDeletions && action === "push") { diff --git a/drizzle-kit/src/utils.ts b/drizzle-kit/src/utils.ts index 279520ea6c..4990ab4069 100644 --- a/drizzle-kit/src/utils.ts +++ b/drizzle-kit/src/utils.ts @@ -1,5 +1,5 @@ import type { RunResult } from 'better-sqlite3'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'fs'; import { join } from 'path'; import { parse } from 'url'; @@ -48,9 +48,9 @@ export const assertV1OutFolder = (out: string) => { if (oldMigrationFolders.length > 0) { console.log( `Your migrations folder format is outdated, please run ${ - chalk.green.bold( + pico.green(pico.bold( `drizzle-kit up`, - ) + )) }`, ); process.exit(1); @@ -193,7 +193,7 @@ export const prepareMigrationFolder = ( .map((it) => { return `${it}/snapshot.json is not of the latest version`; }) - .concat(`Run ${chalk.green.bold(`drizzle-kit up`)}`) + .concat(`Run ${pico.green(pico.bold(`drizzle-kit up`))}`) .join('\n'), ); process.exit(0); @@ -224,7 +224,7 @@ export const prepareMigrationFolder = ( .join('\n') .trim(); if (message) { - console.log(chalk.red.bold('Error:'), message); + console.log(pico.red(pico.bold('Error:')), message); } const abort = report.malformed.length!! || collisionEntries.length > 0; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13f2aed914..42de15edac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,9 +185,6 @@ importers: camelcase: specifier: ^7.0.1 version: 7.0.1 - chalk: - specifier: ^5.2.0 - version: 5.3.0 commander: specifier: ^12.1.0 version: 12.1.0 @@ -245,6 +242,9 @@ importers: pg: specifier: ^8.11.5 version: 8.11.5 + picocolors: + specifier: ^1.0.1 + version: 1.0.1 pluralize: specifier: ^8.0.0 version: 8.0.0 @@ -310,7 +310,7 @@ importers: version: 0.9.0 '@op-engineering/op-sqlite': specifier: ^2.0.16 - version: 2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + version: 2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1) '@opentelemetry/api': specifier: ^1.4.1 version: 1.8.0 @@ -358,7 +358,7 @@ importers: version: 10.1.0 expo-sqlite: specifier: ^13.2.0 - version: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) + version: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) knex: specifier: ^2.4.2 version: 2.5.1(better-sqlite3@8.7.0)(mysql2@3.3.3)(pg@8.11.5)(sqlite3@5.1.7) @@ -8249,9 +8249,6 @@ packages: pgpass@1.0.5: resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} - picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -10253,7 +10250,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.569.0 + '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/client-sts': 3.569.0 '@aws-sdk/core': 3.567.0 '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0) @@ -10352,7 +10349,7 @@ snapshots: '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -10391,7 +10388,7 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.569.0': + '@aws-sdk/client-sso-oidc@3.569.0(@aws-sdk/client-sts@3.569.0)': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -10434,6 +10431,7 @@ snapshots: '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 transitivePeerDependencies: + - '@aws-sdk/client-sts' - aws-crt '@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)': @@ -10442,7 +10440,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -10659,7 +10657,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.569.0 + '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/core': 3.567.0 '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0) '@aws-sdk/middleware-host-header': 3.567.0 @@ -10700,59 +10698,13 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)': - dependencies: - '@aws-crypto/sha256-browser': 3.0.0 - '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.569.0 - '@aws-sdk/core': 3.567.0 - '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) - '@aws-sdk/middleware-host-header': 3.567.0 - '@aws-sdk/middleware-logger': 3.568.0 - '@aws-sdk/middleware-recursion-detection': 3.567.0 - '@aws-sdk/middleware-user-agent': 3.567.0 - '@aws-sdk/region-config-resolver': 3.567.0 - '@aws-sdk/types': 3.567.0 - '@aws-sdk/util-endpoints': 3.567.0 - '@aws-sdk/util-user-agent-browser': 3.567.0 - '@aws-sdk/util-user-agent-node': 3.568.0 - '@smithy/config-resolver': 2.2.0 - '@smithy/core': 1.4.2 - '@smithy/fetch-http-handler': 2.5.0 - '@smithy/hash-node': 2.2.0 - '@smithy/invalid-dependency': 2.2.0 - '@smithy/middleware-content-length': 2.2.0 - '@smithy/middleware-endpoint': 2.5.1 - '@smithy/middleware-retry': 2.3.1 - '@smithy/middleware-serde': 2.3.0 - '@smithy/middleware-stack': 2.2.0 - '@smithy/node-config-provider': 2.3.0 - '@smithy/node-http-handler': 2.5.0 - '@smithy/protocol-http': 3.3.0 - '@smithy/smithy-client': 2.5.1 - '@smithy/types': 2.12.0 - '@smithy/url-parser': 2.2.0 - '@smithy/util-base64': 2.3.0 - '@smithy/util-body-length-browser': 2.2.0 - '@smithy/util-body-length-node': 2.3.0 - '@smithy/util-defaults-mode-browser': 2.2.1 - '@smithy/util-defaults-mode-node': 2.3.1 - '@smithy/util-endpoints': 1.2.0 - '@smithy/util-middleware': 2.2.0 - '@smithy/util-retry': 2.2.0 - '@smithy/util-utf8': 2.3.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt - '@aws-sdk/client-sts@3.583.0': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -10890,26 +10842,9 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': - dependencies: - '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) - '@aws-sdk/credential-provider-env': 3.568.0 - '@aws-sdk/credential-provider-process': 3.568.0 - '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) - '@aws-sdk/types': 3.567.0 - '@smithy/credential-provider-imds': 2.3.0 - '@smithy/property-provider': 2.2.0 - '@smithy/shared-ini-file-loader': 2.4.0 - '@smithy/types': 2.12.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt - '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0)': dependencies: - '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/client-sts': 3.569.0 '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) @@ -10924,13 +10859,13 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': + '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0)': dependencies: - '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/client-sts': 3.569.0 '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -10941,12 +10876,12 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-ini@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0)': + '@aws-sdk/credential-provider-ini@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0)': dependencies: '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -10974,25 +10909,6 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': - dependencies: - '@aws-sdk/credential-provider-env': 3.568.0 - '@aws-sdk/credential-provider-http': 3.568.0 - '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) - '@aws-sdk/credential-provider-process': 3.568.0 - '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) - '@aws-sdk/types': 3.567.0 - '@smithy/credential-provider-imds': 2.3.0 - '@smithy/property-provider': 2.2.0 - '@smithy/shared-ini-file-loader': 2.4.0 - '@smithy/types': 2.12.0 - tslib: 2.6.2 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - '@aws-sdk/client-sts' - - aws-crt - '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0)': dependencies: '@aws-sdk/credential-provider-env': 3.568.0 @@ -11012,14 +10928,14 @@ snapshots: - '@aws-sdk/client-sts' - aws-crt - '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': + '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0)': dependencies: '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-http': 3.568.0 - '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -11031,13 +10947,13 @@ snapshots: - '@aws-sdk/client-sts' - aws-crt - '@aws-sdk/credential-provider-node@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0)': + '@aws-sdk/credential-provider-node@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0)': dependencies: '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-http': 3.582.0 - '@aws-sdk/credential-provider-ini': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-ini': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -11112,10 +11028,10 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-sso@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)': + '@aws-sdk/credential-provider-sso@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))': dependencies: '@aws-sdk/client-sso': 3.583.0 - '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 @@ -11132,14 +11048,6 @@ snapshots: '@smithy/types': 2.12.0 tslib: 2.6.2 - '@aws-sdk/credential-provider-web-identity@3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': - dependencies: - '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) - '@aws-sdk/types': 3.567.0 - '@smithy/property-provider': 2.2.0 - '@smithy/types': 2.12.0 - tslib: 2.6.2 - '@aws-sdk/credential-provider-web-identity@3.568.0(@aws-sdk/client-sts@3.569.0)': dependencies: '@aws-sdk/client-sts': 3.569.0 @@ -11160,15 +11068,15 @@ snapshots: dependencies: '@aws-sdk/client-cognito-identity': 3.569.0 '@aws-sdk/client-sso': 3.568.0 - '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/client-sts': 3.569.0 '@aws-sdk/credential-provider-cognito-identity': 3.569.0 '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-http': 3.568.0 - '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) - '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -11342,7 +11250,7 @@ snapshots: '@aws-sdk/token-providers@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.569.0 + '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) '@aws-sdk/types': 3.567.0 '@smithy/property-provider': 2.2.0 '@smithy/shared-ini-file-loader': 2.4.0 @@ -11358,7 +11266,7 @@ snapshots: '@smithy/types': 2.12.0 tslib: 2.6.2 - '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.583.0)': + '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))': dependencies: '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 @@ -13032,7 +12940,7 @@ snapshots: mv: 2.1.1 safe-json-stringify: 1.2.0 - '@expo/cli@0.18.13(bufferutil@4.0.8)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)': + '@expo/cli@0.18.13(bufferutil@4.0.8)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(utf-8-validate@6.0.3)': dependencies: '@babel/runtime': 7.24.6 '@expo/code-signing-certificates': 0.0.5 @@ -13050,7 +12958,7 @@ snapshots: '@expo/rudder-sdk-node': 1.1.1(encoding@0.1.13) '@expo/spawn-async': 1.7.2 '@expo/xcpretty': 4.3.1 - '@react-native/dev-middleware': 0.74.83(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native/dev-middleware': 0.74.83(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@urql/core': 2.3.6(graphql@15.8.0) '@urql/exchange-retry': 0.3.0(graphql@15.8.0) accepts: 1.3.8 @@ -13676,10 +13584,10 @@ snapshots: rimraf: 3.0.2 optional: true - '@op-engineering/op-sqlite@2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)': + '@op-engineering/op-sqlite@2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1)': dependencies: react: 18.3.1 - react-native: 0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) + react-native: 0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3) '@opentelemetry/api@1.8.0': {} @@ -13816,7 +13724,7 @@ snapshots: transitivePeerDependencies: - encoding - '@react-native-community/cli-server-api@13.6.6(bufferutil@4.0.8)(encoding@0.1.13)': + '@react-native-community/cli-server-api@13.6.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)': dependencies: '@react-native-community/cli-debugger-ui': 13.6.6 '@react-native-community/cli-tools': 13.6.6(encoding@0.1.13) @@ -13826,7 +13734,7 @@ snapshots: nocache: 3.0.4 pretty-format: 26.6.2 serve-static: 1.15.0 - ws: 6.2.2(bufferutil@4.0.8) + ws: 6.2.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) transitivePeerDependencies: - bufferutil - encoding @@ -13853,14 +13761,14 @@ snapshots: dependencies: joi: 17.13.1 - '@react-native-community/cli@13.6.6(bufferutil@4.0.8)(encoding@0.1.13)': + '@react-native-community/cli@13.6.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)': dependencies: '@react-native-community/cli-clean': 13.6.6(encoding@0.1.13) '@react-native-community/cli-config': 13.6.6(encoding@0.1.13) '@react-native-community/cli-debugger-ui': 13.6.6 '@react-native-community/cli-doctor': 13.6.6(encoding@0.1.13) '@react-native-community/cli-hermes': 13.6.6(encoding@0.1.13) - '@react-native-community/cli-server-api': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native-community/cli-server-api': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@react-native-community/cli-tools': 13.6.6(encoding@0.1.13) '@react-native-community/cli-types': 13.6.6 chalk: 4.1.2 @@ -13949,16 +13857,16 @@ snapshots: transitivePeerDependencies: - supports-color - '@react-native/community-cli-plugin@0.74.83(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)': + '@react-native/community-cli-plugin@0.74.83(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)': dependencies: - '@react-native-community/cli-server-api': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native-community/cli-server-api': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@react-native-community/cli-tools': 13.6.6(encoding@0.1.13) - '@react-native/dev-middleware': 0.74.83(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native/dev-middleware': 0.74.83(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@react-native/metro-babel-transformer': 0.74.83(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6)) chalk: 4.1.2 execa: 5.1.1 - metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) - metro-config: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) + metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) + metro-config: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) metro-core: 0.80.9 node-fetch: 2.7.0(encoding@0.1.13) querystring: 0.2.1 @@ -13973,7 +13881,7 @@ snapshots: '@react-native/debugger-frontend@0.74.83': {} - '@react-native/dev-middleware@0.74.83(bufferutil@4.0.8)(encoding@0.1.13)': + '@react-native/dev-middleware@0.74.83(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)': dependencies: '@isaacs/ttlcache': 1.4.1 '@react-native/debugger-frontend': 0.74.83 @@ -13987,7 +13895,7 @@ snapshots: selfsigned: 2.4.1 serve-static: 1.15.0 temp-dir: 2.0.0 - ws: 6.2.2(bufferutil@4.0.8) + ws: 6.2.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) transitivePeerDependencies: - bufferutil - encoding @@ -14010,12 +13918,12 @@ snapshots: '@react-native/normalize-colors@0.74.83': {} - '@react-native/virtualized-lists@0.74.83(@types/react@18.3.1)(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)': + '@react-native/virtualized-lists@0.74.83(@types/react@18.3.1)(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1)': dependencies: invariant: 2.2.4 nullthrows: 1.1.1 react: 18.3.1 - react-native: 0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) + react-native: 0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3) optionalDependencies: '@types/react': 18.3.1 @@ -16517,7 +16425,7 @@ snapshots: '@electric-sql/pglite': 0.1.5 '@libsql/client': 0.4.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@neondatabase/serverless': 0.9.3 - '@op-engineering/op-sqlite': 2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + '@op-engineering/op-sqlite': 2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1) '@opentelemetry/api': 1.8.0 '@planetscale/database': 1.18.0 '@prisma/client': 5.14.0(prisma@5.14.0) @@ -16530,7 +16438,7 @@ snapshots: '@xata.io/client': 0.29.4(typescript@5.4.5(patch_hash=q3iy4fwdhi5sis3wty7d4nbsme)) better-sqlite3: 9.6.0 bun-types: 1.0.3 - expo-sqlite: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) + expo-sqlite: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) knex: 3.1.0(better-sqlite3@9.6.0)(mysql2@2.3.3)(pg@8.11.5)(sqlite3@5.1.7) kysely: 0.27.3 mysql2: 2.3.3 @@ -17359,35 +17267,35 @@ snapshots: expand-template@2.0.3: {} - expo-asset@10.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-asset@10.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: '@react-native/assets-registry': 0.74.83 - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) - expo-constants: 16.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) + expo-constants: 16.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) invariant: 2.2.4 md5-file: 3.2.3 transitivePeerDependencies: - supports-color - expo-constants@16.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-constants@16.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: '@expo/config': 9.0.2 - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) transitivePeerDependencies: - supports-color - expo-file-system@17.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-file-system@17.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) - expo-font@12.0.5(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-font@12.0.5(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) fontfaceobserver: 2.3.0 - expo-keep-awake@13.0.2(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-keep-awake@13.0.2(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) expo-modules-autolinking@1.11.1: dependencies: @@ -17401,24 +17309,24 @@ snapshots: dependencies: invariant: 2.2.4 - expo-sqlite@13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): + expo-sqlite@13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: '@expo/websql': 1.0.1 - expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) - expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13): + expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3): dependencies: '@babel/runtime': 7.24.6 - '@expo/cli': 0.18.13(bufferutil@4.0.8)(encoding@0.1.13)(expo-modules-autolinking@1.11.1) + '@expo/cli': 0.18.13(bufferutil@4.0.8)(encoding@0.1.13)(expo-modules-autolinking@1.11.1)(utf-8-validate@6.0.3) '@expo/config': 9.0.2 '@expo/config-plugins': 8.0.4 '@expo/metro-config': 0.18.4 '@expo/vector-icons': 14.0.2 babel-preset-expo: 11.0.6(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6)) - expo-asset: 10.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) - expo-file-system: 17.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) - expo-font: 12.0.5(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) - expo-keep-awake: 13.0.2(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) + expo-asset: 10.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) + expo-file-system: 17.0.1(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) + expo-font: 12.0.5(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) + expo-keep-awake: 13.0.2(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) expo-modules-autolinking: 1.11.1 expo-modules-core: 1.12.11 fbemitter: 3.0.0(encoding@0.1.13) @@ -18924,12 +18832,12 @@ snapshots: metro-core: 0.80.9 rimraf: 3.0.2 - metro-config@0.80.9(bufferutil@4.0.8)(encoding@0.1.13): + metro-config@0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3): dependencies: connect: 3.7.0 cosmiconfig: 5.2.1 jest-validate: 29.7.0 - metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) + metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) metro-cache: 0.80.9 metro-core: 0.80.9 metro-runtime: 0.80.9 @@ -19005,13 +18913,13 @@ snapshots: transitivePeerDependencies: - supports-color - metro-transform-worker@0.80.9(bufferutil@4.0.8)(encoding@0.1.13): + metro-transform-worker@0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3): dependencies: '@babel/core': 7.24.6 '@babel/generator': 7.24.6 '@babel/parser': 7.24.6 '@babel/types': 7.24.6 - metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) + metro: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) metro-babel-transformer: 0.80.9 metro-cache: 0.80.9 metro-cache-key: 0.80.9 @@ -19025,7 +18933,7 @@ snapshots: - supports-color - utf-8-validate - metro@0.80.9(bufferutil@4.0.8)(encoding@0.1.13): + metro@0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3): dependencies: '@babel/code-frame': 7.24.6 '@babel/core': 7.24.6 @@ -19051,7 +18959,7 @@ snapshots: metro-babel-transformer: 0.80.9 metro-cache: 0.80.9 metro-cache-key: 0.80.9 - metro-config: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) + metro-config: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) metro-core: 0.80.9 metro-file-map: 0.80.9 metro-resolver: 0.80.9 @@ -19059,7 +18967,7 @@ snapshots: metro-source-map: 0.80.9 metro-symbolicate: 0.80.9 metro-transform-plugins: 0.80.9 - metro-transform-worker: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13) + metro-transform-worker: 0.80.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) mime-types: 2.1.35 node-fetch: 2.7.0(encoding@0.1.13) nullthrows: 1.1.1 @@ -19068,7 +18976,7 @@ snapshots: source-map: 0.5.7 strip-ansi: 6.0.1 throat: 5.0.0 - ws: 7.5.9(bufferutil@4.0.8) + ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) yargs: 17.7.2 transitivePeerDependencies: - bufferutil @@ -19732,8 +19640,6 @@ snapshots: dependencies: split2: 4.2.0 - picocolors@1.0.0: {} - picocolors@1.0.1: {} picomatch@2.3.1: {} @@ -19965,10 +19871,10 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-devtools-core@5.2.0(bufferutil@4.0.8): + react-devtools-core@5.2.0(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: shell-quote: 1.8.1 - ws: 7.5.9(bufferutil@4.0.8) + ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -19981,19 +19887,19 @@ snapshots: react-is@18.3.1: {} - react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1): + react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3): dependencies: '@jest/create-cache-key-function': 29.7.0 - '@react-native-community/cli': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native-community/cli': 13.6.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@react-native-community/cli-platform-android': 13.6.6(encoding@0.1.13) '@react-native-community/cli-platform-ios': 13.6.6(encoding@0.1.13) '@react-native/assets-registry': 0.74.83 '@react-native/codegen': 0.74.83(@babel/preset-env@7.24.6(@babel/core@7.24.6)) - '@react-native/community-cli-plugin': 0.74.83(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13) + '@react-native/community-cli-plugin': 0.74.83(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) '@react-native/gradle-plugin': 0.74.83 '@react-native/js-polyfills': 0.74.83 '@react-native/normalize-colors': 0.74.83 - '@react-native/virtualized-lists': 0.74.83(@types/react@18.3.1)(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + '@react-native/virtualized-lists': 0.74.83(@types/react@18.3.1)(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1) abort-controller: 3.0.0 anser: 1.4.10 ansi-regex: 5.0.1 @@ -20012,14 +19918,14 @@ snapshots: pretty-format: 26.6.2 promise: 8.3.0 react: 18.3.1 - react-devtools-core: 5.2.0(bufferutil@4.0.8) + react-devtools-core: 5.2.0(bufferutil@4.0.8)(utf-8-validate@6.0.3) react-refresh: 0.14.2 react-shallow-renderer: 16.15.0(react@18.3.1) regenerator-runtime: 0.13.11 scheduler: 0.24.0-canary-efb381bbf-20230505 stacktrace-parser: 0.1.10 whatwg-fetch: 3.6.20 - ws: 6.2.2(bufferutil@4.0.8) + ws: 6.2.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) yargs: 17.7.2 optionalDependencies: '@types/react': 18.3.1 @@ -21592,7 +21498,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -21626,7 +21532,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -21660,7 +21566,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -21694,7 +21600,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -21872,15 +21778,17 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.0.2 - ws@6.2.2(bufferutil@4.0.8): + ws@6.2.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: async-limiter: 1.0.1 optionalDependencies: bufferutil: 4.0.8 + utf-8-validate: 6.0.3 - ws@7.5.9(bufferutil@4.0.8): + ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@6.0.3): optionalDependencies: bufferutil: 4.0.8 + utf-8-validate: 6.0.3 ws@8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): optionalDependencies: From 49823d914e24198cc1c6b55b51b383758ccf3b1f Mon Sep 17 00:00:00 2001 From: kravetsone <57632712+kravetsone@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:08:31 +0300 Subject: [PATCH 2/4] Complete chalk => picocolors replacement --- drizzle-kit/imports-checker/index.ts | 6 +- drizzle-kit/src/cli/commands/introspect.ts | 133 +---------- .../src/cli/commands/libSqlPushUtils.ts | 16 +- drizzle-kit/src/cli/commands/migrate.ts | 16 +- drizzle-kit/src/cli/commands/pgPushUtils.ts | 2 +- drizzle-kit/src/cli/commands/push.ts | 26 +-- .../src/cli/commands/singlestorePushUtils.ts | 26 +-- .../src/cli/commands/sqlitePushUtils.ts | 2 +- drizzle-kit/src/cli/commands/utils.ts | 2 +- drizzle-kit/src/cli/views.ts | 10 +- drizzle-kit/src/jsonStatements.ts | 7 +- drizzle-kit/src/serializer/index.ts | 2 +- drizzle-kit/src/serializer/mysqlSerializer.ts | 13 +- drizzle-kit/src/serializer/pgSerializer.ts | 34 +-- .../src/serializer/singlestoreSerializer.ts | 54 ++--- .../src/serializer/sqliteSerializer.ts | 12 +- drizzle-kit/tests/bin.test.ts | 8 +- drizzle-kit/tests/push/libsql.test.ts | 10 +- drizzle-kit/tests/push/pg.test.ts | 4 +- drizzle-kit/tests/push/sqlite.test.ts | 10 +- drizzle-kit/tests/wrap-param.test.ts | 10 +- pnpm-lock.yaml | 210 ++++++++++++------ 22 files changed, 281 insertions(+), 332 deletions(-) diff --git a/drizzle-kit/imports-checker/index.ts b/drizzle-kit/imports-checker/index.ts index 7a4e908382..b989a7d484 100644 --- a/drizzle-kit/imports-checker/index.ts +++ b/drizzle-kit/imports-checker/index.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { analyzeImports, ChainLink } from './checker'; const issues = analyzeImports({ @@ -35,7 +35,7 @@ const chainToString = (chains: ChainLink[]) => { out += ' '.repeat(indentation) + '└' + chain.import - + ` ${chalk.gray(chain.file)}\n`; + + ` ${pico.gray(chain.file)}\n`; indentation += 1; } return out; @@ -43,6 +43,6 @@ const chainToString = (chains: ChainLink[]) => { console.log(); for (const issue of issues) { - console.log(chalk.red(issue.imports.map((it) => it.name).join('\n'))); + console.log(pico.red(issue.imports.map((it) => it.name).join('\n'))); console.log(issue.accessChains.map((it) => chainToString(it)).join('\n')); } diff --git a/drizzle-kit/src/cli/commands/introspect.ts b/drizzle-kit/src/cli/commands/introspect.ts index c86cf0abc5..b06e155020 100644 --- a/drizzle-kit/src/cli/commands/introspect.ts +++ b/drizzle-kit/src/cli/commands/introspect.ts @@ -269,7 +269,7 @@ export const introspectMysql = async ( pico.green( '✓', ) - }] You schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, + }] You schema file is ready ➜ ${pico.bold(pico.underline(schemaFile))} 🚀`, ); render( `[${ @@ -277,7 +277,7 @@ export const introspectMysql = async ( '✓', ) }] You relations file is ready ➜ ${ - chalk.bold.underline.blue( + pico.blue(pico.bold(pico.underline( relationsFile, ))) } 🚀`, @@ -377,18 +377,7 @@ export const introspectSingleStore = async ( pico.green( '✓', ) - }] Your schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, - ); - render( - `[${ - chalk.green( - '✓', - ) - }] Your relations file is ready ➜ ${ - pico.blue(pico.bold(pico.underline( - relationsFile, - ) - } 🚀`, + }] You schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, ); process.exit(0); }; @@ -601,7 +590,7 @@ export const introspectLibSQL = async ( pico.green( '✓', ) - }] Your schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, + }] Your schema file is ready ➜ ${pico.blue(pico.bold(pico.underline(schemaFile)))} 🚀`, ); render( `[${ @@ -609,7 +598,7 @@ export const introspectLibSQL = async ( '✓', ) }] Your relations file is ready ➜ ${ - chalk.bold.underline.blue( + pico.blue(pico.bold(pico.underline( relationsFile, ))) } 🚀`, @@ -617,118 +606,6 @@ export const introspectLibSQL = async ( process.exit(0); }; -export const introspectLibSQL = async ( - casing: Casing, - out: string, - breakpoints: boolean, - credentials: LibSQLCredentials, - tablesFilter: string[], - prefix: Prefix, -) => { - const { connectToLibSQL } = await import('../connections'); - const db = await connectToLibSQL(credentials); - - const matchers = tablesFilter.map((it) => { - return new Minimatch(it); - }); - - const filter = (tableName: string) => { - if (matchers.length === 0) return true; - - let flags: boolean[] = []; - - for (let matcher of matchers) { - if (matcher.negate) { - if (!matcher.match(tableName)) { - flags.push(false); - } - } - - if (matcher.match(tableName)) { - flags.push(true); - } - } - - if (flags.length > 0) { - return flags.every(Boolean); - } - return false; - }; - - const progress = new IntrospectProgress(); - const res = await renderWithTask( - progress, - fromSqliteDatabase(db, filter, (stage, count, status) => { - progress.update(stage, count, status); - }), - ); - - const schema = { id: originUUID, prevId: '', ...res } as SQLiteSchema; - const ts = sqliteSchemaToTypeScript(schema, casing); - const relationsTs = relationsToTypeScript(schema, casing); - - // check orm and orm-pg api version - - const schemaFile = join(out, 'schema.ts'); - writeFileSync(schemaFile, ts.file); - const relationsFile = join(out, 'relations.ts'); - writeFileSync(relationsFile, relationsTs.file); - console.log(); - - const { snapshots, journal } = prepareOutFolder(out, 'sqlite'); - - if (snapshots.length === 0) { - const { sqlStatements, _meta } = await applyLibSQLSnapshotsDiff( - squashSqliteScheme(drySQLite), - squashSqliteScheme(schema), - tablesResolver, - columnsResolver, - sqliteViewsResolver, - drySQLite, - schema, - ); - - writeResult({ - cur: schema, - sqlStatements, - journal, - _meta, - outFolder: out, - breakpoints, - type: 'introspect', - prefixMode: prefix, - }); - } else { - render( - `[${ - chalk.blue( - 'i', - ) - }] No SQL generated, you already have migrations in project`, - ); - } - - render( - `[${ - chalk.green( - '✓', - ) - }] Your schema file is ready ➜ ${chalk.bold.underline.blue(schemaFile)} 🚀`, - ); - render( - `[${ - chalk.green( - '✓', - ) - }] Your relations file is ready ➜ ${ - chalk.bold.underline.blue( - relationsFile, - ) - } 🚀`, - ); - process.exit(0); -}; - const withCasing = (value: string, casing: Casing) => { if (casing === 'preserve') { return value; diff --git a/drizzle-kit/src/cli/commands/libSqlPushUtils.ts b/drizzle-kit/src/cli/commands/libSqlPushUtils.ts index 31e90c8722..e96c2571c7 100644 --- a/drizzle-kit/src/cli/commands/libSqlPushUtils.ts +++ b/drizzle-kit/src/cli/commands/libSqlPushUtils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { JsonStatement } from 'src/jsonStatements'; import { findAddedAndRemoved, SQLiteDB } from 'src/utils'; @@ -134,7 +134,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.tableName, ) } table with ${count} items`, @@ -156,7 +156,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${tableName} table with ${count} items`, @@ -182,7 +182,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( statement.column.name, ) } column without default value, which contains ${count} items`, @@ -212,7 +212,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null constraint to ${ - chalk.underline( + pico.underline( statement.columnName, ) } column without default value, which contains ${count} items`, @@ -253,7 +253,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( removedColumn, ) } column in ${tableName} table with ${count} items`, @@ -278,7 +278,7 @@ export const libSqlLogSuggestionsAndReturn = async ( infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( addedColumn, ) } column without default value to table, which contains ${count} items`, @@ -324,7 +324,7 @@ export const libSqlLogSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${tableName} table with ${count} items`, diff --git a/drizzle-kit/src/cli/commands/migrate.ts b/drizzle-kit/src/cli/commands/migrate.ts index ab66d0a700..6f231b12c6 100644 --- a/drizzle-kit/src/cli/commands/migrate.ts +++ b/drizzle-kit/src/cli/commands/migrate.ts @@ -614,15 +614,15 @@ function singleStoreSchemaSuggestions( `\n` + withStyle.suggestion( `We are suggesting to change ${ - chalk.blue( + pico.blue( column.name, ) } column in ${ - chalk.blueBright( + pico.blue( table.name, ) } table from serial to bigint unsigned\n\n${ - chalk.blueBright( + pico.blue( `bigint("${column.name}", { mode: "number", unsigned: true }).notNull().autoincrement().unique(${ uniqueForSerial?.name ? `"${uniqueForSerial?.name}"` : '' })`, @@ -1172,8 +1172,8 @@ export const promptNamedConflict = async ( if (isRenamePromptItem(data)) { console.log( - `${chalk.yellow('~')} ${data.from.name} › ${data.to.name} ${ - chalk.gray( + `${pico.yellow('~')} ${data.from.name} › ${data.to.name} ${ + pico.gray( `${entity} will be renamed/moved`, ) }`, @@ -1187,8 +1187,8 @@ export const promptNamedConflict = async ( leftMissing = leftMissing.filter(Boolean); } else { console.log( - `${chalk.green('+')} ${data.name} ${ - chalk.gray( + `${pico.green('+')} ${data.name} ${ + pico.gray( `${entity} will be created`, ) }`, @@ -1197,7 +1197,7 @@ export const promptNamedConflict = async ( } index += 1; } while (index < newItems.length); - console.log(chalk.gray(`--- all ${entity} conflicts resolved ---\n`)); + console.log(pico.gray(`--- all ${entity} conflicts resolved ---\n`)); result.deleted.push(...leftMissing); return result; }; diff --git a/drizzle-kit/src/cli/commands/pgPushUtils.ts b/drizzle-kit/src/cli/commands/pgPushUtils.ts index 2ed615c5f4..0cde29e9ae 100644 --- a/drizzle-kit/src/cli/commands/pgPushUtils.ts +++ b/drizzle-kit/src/cli/commands/pgPushUtils.ts @@ -95,7 +95,7 @@ export const pgSuggestions = async (db: DB, statements: JsonStatement[]) => { const count = Number(res[0].count); if (count > 0) { infoToPrint.push( - `· You're about to delete "${chalk.underline(statement.name)}" materialized view with ${count} items`, + `· You're about to delete "${pico.underline(statement.name)}" materialized view with ${count} items`, ); matViewsToRemove.push(statement.name); diff --git a/drizzle-kit/src/cli/commands/push.ts b/drizzle-kit/src/cli/commands/push.ts index 570760c94d..28f7eb140e 100644 --- a/drizzle-kit/src/cli/commands/push.ts +++ b/drizzle-kit/src/cli/commands/push.ts @@ -140,7 +140,7 @@ export const mysqlPush = async ( ]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -153,9 +153,9 @@ export const mysqlPush = async ( await db.query(statement); } if (filteredStatements.length > 0) { - render(`[${chalk.green('✓')}] Changes applied`); + render(`[${pico.green('✓')}] Changes applied`); } else { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } } } catch (e) { @@ -194,7 +194,7 @@ export const singlestorePush = async ( try { if (filteredStatements.length === 0) { - render(`[${chalk.blue('i')}] No changes detected`); + render(`[${pico.blue('i')}] No changes detected`); } else { const { shouldAskForApprove, @@ -570,7 +570,7 @@ export const libSQLPush = async ( const statements = await prepareLibSQLPush(schemaPath, schema, casing); if (statements.sqlStatements.length === 0) { - render(`\n[${chalk.blue('i')}] No changes detected`); + render(`\n[${pico.blue('i')}] No changes detected`); } else { const { shouldAskForApprove, @@ -593,7 +593,7 @@ export const libSQLPush = async ( withStyle.warning('You are about to execute current statements:'), ); console.log(); - console.log(statementsToExecute.map((s) => chalk.blue(s)).join('\n')); + console.log(statementsToExecute.map((s) => pico.blue(s)).join('\n')); console.log(); } @@ -603,7 +603,7 @@ export const libSQLPush = async ( new Select(['No, abort', `Yes, I want to execute all statements`]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } @@ -614,12 +614,12 @@ export const libSQLPush = async ( console.log(infoToPrint.join('\n')); console.log(); console.log( - chalk.red.bold( + pico.red(pico.bold( 'THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED\n', - ), + )), ); - console.log(chalk.white('Do you still want to push changes?')); + console.log(pico.white('Do you still want to push changes?')); const { status, data } = await render( new Select([ @@ -643,16 +643,16 @@ export const libSQLPush = async ( ]), ); if (data?.index === 0) { - render(`[${chalk.red('x')}] All changes were aborted`); + render(`[${pico.red('x')}] All changes were aborted`); process.exit(0); } } if (statementsToExecute.length === 0) { - render(`\n[${chalk.blue('i')}] No changes detected`); + render(`\n[${pico.blue('i')}] No changes detected`); } else { await db.batchWithPragma!(statementsToExecute); - render(`[${chalk.green('✓')}] Changes applied`); + render(`[${pico.green('✓')}] Changes applied`); } } }; diff --git a/drizzle-kit/src/cli/commands/singlestorePushUtils.ts b/drizzle-kit/src/cli/commands/singlestorePushUtils.ts index 80fad9b2dc..1fabb95dcb 100644 --- a/drizzle-kit/src/cli/commands/singlestorePushUtils.ts +++ b/drizzle-kit/src/cli/commands/singlestorePushUtils.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { render } from 'hanji'; import { TypeOf } from 'zod'; import { JsonAlterColumnTypeStatement, JsonStatement } from '../../jsonStatements'; @@ -127,7 +127,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.tableName, ) } table with ${count} items`, @@ -143,7 +143,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.columnName, ) } column in ${statement.tableName} table with ${count} items`, @@ -159,7 +159,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to delete ${ - chalk.underline( + pico.underline( statement.name, ) } schema with ${count} tables`, @@ -175,14 +175,14 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.columnName, ) } column type from ${ - chalk.underline( + pico.underline( statement.oldDataType, ) - } to ${chalk.underline(statement.newDataType)} with ${count} items`, + } to ${pico.underline(statement.newDataType)} with ${count} items`, ); statementsToExecute.push(`truncate table ${statement.tableName};`); tablesToTruncate.push(statement.tableName); @@ -198,7 +198,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to remove default value from ${ - chalk.underline( + pico.underline( statement.columnName, ) } not-null column with ${count} items`, @@ -221,7 +221,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to set not-null constraint to ${ - chalk.underline( + pico.underline( statement.columnName, ) } column without default, which contains ${count} items`, @@ -258,7 +258,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to change ${ - chalk.underline( + pico.underline( statement.tableName, ) } primary key. This statements may fail and you table may left without primary key`, @@ -295,7 +295,7 @@ export const logSuggestionsAndReturn = async ( if (count > 0) { infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( statement.column.name, ) } column without default value, which contains ${count} items`, @@ -316,11 +316,11 @@ export const logSuggestionsAndReturn = async ( const unsquashedUnique = SingleStoreSquasher.unsquashUnique(statement.data); console.log( `· You're about to add ${ - chalk.underline( + pico.underline( unsquashedUnique.name, ) } unique constraint to the table, which contains ${count} items. If this statement fails, you will receive an error from the database. Do you want to truncate ${ - chalk.underline( + pico.underline( statement.tableName, ) } table?\n`, diff --git a/drizzle-kit/src/cli/commands/sqlitePushUtils.ts b/drizzle-kit/src/cli/commands/sqlitePushUtils.ts index bf658442f1..c362c3c226 100644 --- a/drizzle-kit/src/cli/commands/sqlitePushUtils.ts +++ b/drizzle-kit/src/cli/commands/sqlitePushUtils.ts @@ -262,7 +262,7 @@ export const logSuggestionsAndReturn = async ( dataLoss = true; infoToPrint.push( `· You're about to add not-null ${ - chalk.underline( + pico.underline( addedColumn, ) } column without default value to table, which contains ${count} items`, diff --git a/drizzle-kit/src/cli/commands/utils.ts b/drizzle-kit/src/cli/commands/utils.ts index 339d768aa2..c18064ec1b 100644 --- a/drizzle-kit/src/cli/commands/utils.ts +++ b/drizzle-kit/src/cli/commands/utils.ts @@ -213,7 +213,7 @@ export const prepareExportConfig = async ( const fileNames = prepareFilenames(schema); if (fileNames.length === 0) { - render(`[${chalk.blue('i')}] No schema file in ${schema} was found`); + render(`[${pico.blue('i')}] No schema file in ${schema} was found`); process.exit(0); } return { diff --git a/drizzle-kit/src/cli/views.ts b/drizzle-kit/src/cli/views.ts index d83f5da0f4..f5dd62f156 100644 --- a/drizzle-kit/src/cli/views.ts +++ b/drizzle-kit/src/cli/views.ts @@ -187,15 +187,15 @@ export class ResolveSelectNamed extends Prompt< } const key = this.base.name; - let text = `\nIs ${chalk.bold.blue(key)} ${this.entityType} created or renamed from another ${this.entityType}?\n`; + let text = `\nIs ${pico.blue(pico.bold(key))} ${this.entityType} created or renamed from another ${this.entityType}?\n`; const isSelectedRenamed = isRenamePromptItem( this.state.items[this.state.selectedIdx], ); const selectedPrefix = isSelectedRenamed - ? chalk.yellow('❯ ') - : chalk.green('❯ '); + ? pico.yellow('❯ ') + : pico.green('❯ '); const labelLength: number = this.state.items .filter((it) => isRenamePromptItem(it)) @@ -221,8 +221,8 @@ export class ResolveSelectNamed extends Prompt< : it.name.padEnd(labelLength, ' '); const label = isRenamed - ? `${chalk.yellow('~')} ${title} ${chalk.gray(`rename ${entityType}`)}` - : `${chalk.green('+')} ${title} ${chalk.gray(`create ${entityType}`)}`; + ? `${pico.yellow('~')} ${title} ${pico.gray(`rename ${entityType}`)}` + : `${pico.green('+')} ${title} ${pico.gray(`create ${entityType}`)}`; text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`; text += idx != this.state.items.length - 1 ? '\n' : ''; diff --git a/drizzle-kit/src/jsonStatements.ts b/drizzle-kit/src/jsonStatements.ts index 9760641fd3..9052d1fdc2 100644 --- a/drizzle-kit/src/jsonStatements.ts +++ b/drizzle-kit/src/jsonStatements.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { table } from 'console'; import { warning } from './cli/views'; import { CommonSquashedSchema } from './schemaValidator'; @@ -22,6 +22,7 @@ import { View as SqliteView, } from './serializer/sqliteSchema'; import { AlteredColumn, Column, Sequence, Table } from './snapshotsDiffer'; +import { getNewTableName } from './cli/commands/sqlitePushUtils'; export interface JsonSqliteCreateTableStatement { type: 'sqlite_create_table'; @@ -1919,7 +1920,7 @@ export const prepareAlterColumnsSingleStore = ( // TODO: Change warning message according to SingleStore docs warning( `You are trying to add virtual generated constraint to ${ - chalk.blue( + pico.blue( columnName, ) } column. As MySQL docs mention: "Nongenerated columns can be altered to stored but not virtual generated columns". We will drop an existing column and add it with a virtual generated statement. This means that the data previously stored in this column will be wiped, and new data will be generated on each read for this column\n`, @@ -1961,7 +1962,7 @@ export const prepareAlterColumnsSingleStore = ( // TODO: Change warning message according to SingleStore docs warning( `You are trying to remove virtual generated constraint from ${ - chalk.blue( + pico.blue( columnName, ) } column. As MySQL docs mention: "Stored but not virtual generated columns can be altered to nongenerated columns. The stored generated values become the values of the nongenerated column". We will drop an existing column and add it without a virtual generated statement. This means that this column will have no data after migration\n`, diff --git a/drizzle-kit/src/serializer/index.ts b/drizzle-kit/src/serializer/index.ts index 29b365d9d4..cef8d82aa0 100644 --- a/drizzle-kit/src/serializer/index.ts +++ b/drizzle-kit/src/serializer/index.ts @@ -60,7 +60,7 @@ export const serializeSingleStore = async ( ): Promise => { const filenames = prepareFilenames(path); - console.log(chalk.gray(`Reading schema files:\n${filenames.join('\n')}\n`)); + console.log(pico.gray(`Reading schema files:\n${filenames.join('\n')}\n`)); const { prepareFromSingleStoreImports } = await import('./singlestoreImports'); const { generateSingleStoreSnapshot } = await import('./singlestoreSerializer'); diff --git a/drizzle-kit/src/serializer/mysqlSerializer.ts b/drizzle-kit/src/serializer/mysqlSerializer.ts index 8a61157a15..acf414c5bf 100644 --- a/drizzle-kit/src/serializer/mysqlSerializer.ts +++ b/drizzle-kit/src/serializer/mysqlSerializer.ts @@ -379,13 +379,13 @@ export const generateMySqlSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated check constraint name in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) - }. Please rename your check constraint in the ${ - chalk.underline.blue( + )) + } table. Please rename your check constraint in the ${ + pico.underline(pico.blue( tableName, - ) + )) } table`, ) }`, @@ -437,9 +437,10 @@ export const generateMySqlSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated view name across ${ - chalk.underline.blue( + pico.underline(pico.blue( schema ?? 'public', ) + ) } schema. Please rename your view`, ) }`, diff --git a/drizzle-kit/src/serializer/pgSerializer.ts b/drizzle-kit/src/serializer/pgSerializer.ts index 1b228e6704..9a8e1fd9e4 100644 --- a/drizzle-kit/src/serializer/pgSerializer.ts +++ b/drizzle-kit/src/serializer/pgSerializer.ts @@ -504,11 +504,11 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated policy name across ${ - chalk.underline.blue(tableKey) + pico.underline(pico.blue(tableKey)) } table. Please rename one of the policies with ${ - chalk.underline.blue( + pico.underline(pico.blue( policy.name, - ) + )) } name`, ) }`, @@ -535,17 +535,17 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated check constraint name across ${ - chalk.underline.blue( + pico.underline(pico.blue( schema ?? 'public', - ) + )) } schema in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) }. Please rename your check constraint in either the ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) } table or the table with the duplicated check contraint name`, ) }`, @@ -626,11 +626,11 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated policy name across ${ - chalk.underline.blue(tableKey) + pico.underline(pico.blue(tableKey)) } table. Please rename one of the policies with ${ - chalk.underline.blue( + pico.underline(pico.blue( policy.name, - ) + )) } name`, ) }`, @@ -730,7 +730,7 @@ export const generatePgSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated view name across ${ - chalk.underline.blue(schema ?? 'public') + pico.underline(pico.blue(schema ?? 'public')) } schema. Please rename your view`, ) }`, @@ -796,13 +796,13 @@ export const generatePgSnapshot = ( console.log( `\n${ withStyle.errorWarning( - `We\'ve found duplicated unique constraint names in ${chalk.underline.blue(viewName)} table. - The unique constraint ${chalk.underline.blue(column.uniqueName)} on the ${ - chalk.underline.blue( + `We\'ve found duplicated unique constraint names in ${pico.underline(pico.blue(viewName))} table. + The unique constraint ${pico.underline(pico.blue(column.uniqueName))} on the ${ + pico.underline(pico.blue( column.name, ) } column is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue(existingUnique.columns.join(',')) + pico.underline(pico.blue(existingUnique.columns.join(','))) } columns\n`, ) }`, diff --git a/drizzle-kit/src/serializer/singlestoreSerializer.ts b/drizzle-kit/src/serializer/singlestoreSerializer.ts index e65f53d258..a746c0e442 100644 --- a/drizzle-kit/src/serializer/singlestoreSerializer.ts +++ b/drizzle-kit/src/serializer/singlestoreSerializer.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { is, SQL } from 'drizzle-orm'; import { AnySingleStoreTable, @@ -96,22 +96,22 @@ export const generateSingleStoreSnapshot = ( console.log( `\n${ withStyle.errorWarning(`We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) } table. The unique constraint ${ - chalk.underline.blue( + pico.underline(pico.blue( column.uniqueName, - ) + )) } on the ${ - chalk.underline.blue( + pico.underline(pico.blue( column.name, - ) + )) } column is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.underline(pico.blue( existingUnique.columns.join(','), - ) + )) } columns\n`) }`, ); @@ -182,21 +182,21 @@ export const generateSingleStoreSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) } table. \nThe unique constraint ${ - chalk.underline.blue( + pico.underline(pico.blue( name, - ) + )) } on the ${ - chalk.underline.blue( + pico.underline(pico.blue( columnNames.join(','), - ) + )) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.underline(pico.blue( existingUnique.columns.join(','), - ) + )) } columns\n`, ) }`, @@ -246,21 +246,21 @@ export const generateSingleStoreSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated unique constraint names in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) } table. \nThe unique index ${ - chalk.underline.blue( + pico.underline(pico.blue( name, - ) + )) } on the ${ - chalk.underline.blue( + pico.underline(pico.blue( indexColumns.join(','), - ) + )) } columns is confilcting with a unique constraint name already defined for ${ - chalk.underline.blue( + pico.underline(pico.blue( uniqueConstraintObject[name].columns.join(','), - ) + )) } columns\n`, ) }`, @@ -311,9 +311,9 @@ export const generateSingleStoreSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated view name across ${ - chalk.underline.blue( + pico.underline(pico.blue( schema ?? 'public', - ) + )) } schema. Please rename your view`, ) }`, diff --git a/drizzle-kit/src/serializer/sqliteSerializer.ts b/drizzle-kit/src/serializer/sqliteSerializer.ts index 8ed993b759..10445d13a3 100644 --- a/drizzle-kit/src/serializer/sqliteSerializer.ts +++ b/drizzle-kit/src/serializer/sqliteSerializer.ts @@ -289,13 +289,13 @@ export const generateSqliteSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated check constraint name in ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) }. Please rename your check constraint in the ${ - chalk.underline.blue( + pico.underline(pico.blue( tableName, - ) + )) } table`, ) }`, @@ -335,9 +335,9 @@ export const generateSqliteSnapshot = ( `\n${ withStyle.errorWarning( `We\'ve found duplicated view name across ${ - chalk.underline.blue( + pico.underline(pico.blue( schema ?? 'public', - ) + )) } schema. Please rename your view`, ) }`, diff --git a/drizzle-kit/tests/bin.test.ts b/drizzle-kit/tests/bin.test.ts index 8264966767..8376abe233 100644 --- a/drizzle-kit/tests/bin.test.ts +++ b/drizzle-kit/tests/bin.test.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { assert, test } from 'vitest'; import { analyzeImports, ChainLink } from '../imports-checker/checker'; @@ -22,7 +22,7 @@ test('imports-issues', () => { '@hono/*', 'crypto', 'hanji', - 'chalk', + 'picocolors', 'dotenv/config', 'camelcase', 'semver', @@ -42,7 +42,7 @@ test('imports-issues', () => { out += ' '.repeat(indentation) + '└' + chain.import - + ` ${chalk.gray(chain.file)}\n`; + + ` ${pico.gray(chain.file)}\n`; indentation += 1; } return out; @@ -50,7 +50,7 @@ test('imports-issues', () => { console.log(); for (const issue of issues) { - console.log(chalk.red(issue.imports.map((it) => it.name).join('\n'))); + console.log(pico.red(issue.imports.map((it) => it.name).join('\n'))); console.log(issue.accessChains.map((it) => chainToString(it)).join('\n')); } diff --git a/drizzle-kit/tests/push/libsql.test.ts b/drizzle-kit/tests/push/libsql.test.ts index 2ae2e38110..8de78fdaff 100644 --- a/drizzle-kit/tests/push/libsql.test.ts +++ b/drizzle-kit/tests/push/libsql.test.ts @@ -1,5 +1,5 @@ import { createClient } from '@libsql/client'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { sql } from 'drizzle-orm'; import { blob, @@ -266,7 +266,7 @@ test('added column not null and without default to table with data', async (t) = expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to add not-null ${ - chalk.underline( + pico.underline( 'age', ) } column without default value, which contains 2 items`, @@ -410,7 +410,7 @@ test('drop autoincrement. drop column with data', async (t) => { expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to delete ${ - chalk.underline( + pico.underline( 'name', ) } column in companies table with 2 items`, @@ -665,7 +665,7 @@ test('drop table with data', async (t) => { expect(sqlStatements![0]).toBe(`DROP TABLE \`users\`;`); expect(columnsToRemove!.length).toBe(0); expect(infoToPrint!.length).toBe(1); - expect(infoToPrint![0]).toBe(`· You're about to delete ${chalk.underline('users')} table with 1 items`); + expect(infoToPrint![0]).toBe(`· You're about to delete ${pico.underline('users')} table with 1 items`); expect(shouldAskForApprove).toBe(true); expect(tablesToRemove!.length).toBe(1); expect(tablesToRemove![0]).toBe('users'); @@ -886,7 +886,7 @@ test('recreate table with added column not null and without default', async (t) expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to add not-null ${ - chalk.underline('new_column') + pico.underline('new_column') } column without default value to table, which contains 2 items`, ); expect(shouldAskForApprove).toBe(true); diff --git a/drizzle-kit/tests/push/pg.test.ts b/drizzle-kit/tests/push/pg.test.ts index a7bed413d3..e220de6915 100644 --- a/drizzle-kit/tests/push/pg.test.ts +++ b/drizzle-kit/tests/push/pg.test.ts @@ -1,5 +1,5 @@ import { PGlite } from '@electric-sql/pglite'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { bigint, bigserial, @@ -2540,7 +2540,7 @@ test('drop mat view with data', async () => { expect(sqlStatements.length).toBe(1); expect(sqlStatements[0]).toBe(`DROP MATERIALIZED VIEW "public"."view";`); expect(infoToPrint!.length).toBe(1); - expect(infoToPrint![0]).toBe(`· You're about to delete "${chalk.underline('view')}" materialized view with 3 items`); + expect(infoToPrint![0]).toBe(`· You're about to delete "${pico.underline('view')}" materialized view with 3 items`); expect(columnsToRemove!.length).toBe(0); expect(schemasToRemove!.length).toBe(0); expect(shouldAskForApprove).toBe(true); diff --git a/drizzle-kit/tests/push/sqlite.test.ts b/drizzle-kit/tests/push/sqlite.test.ts index e2c85233a3..37513d846e 100644 --- a/drizzle-kit/tests/push/sqlite.test.ts +++ b/drizzle-kit/tests/push/sqlite.test.ts @@ -1,5 +1,5 @@ import Database from 'better-sqlite3'; -import chalk from 'chalk'; +import pico from 'picocolors'; import { sql } from 'drizzle-orm'; import { blob, @@ -262,7 +262,7 @@ test('added column not null and without default to table with data', async (t) = expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to add not-null ${ - chalk.underline( + pico.underline( 'age', ) } column without default value, which contains 2 items`, @@ -405,7 +405,7 @@ test('drop autoincrement. drop column with data', async (t) => { expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to delete ${ - chalk.underline( + pico.underline( 'name', ) } column in companies table with 2 items`, @@ -523,7 +523,7 @@ test('drop autoincrement. drop column with data with pragma off', async (t) => { expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to delete ${ - chalk.underline( + pico.underline( 'name', ) } column in companies table with 2 items`, @@ -1194,7 +1194,7 @@ test('recreate table with added column not null and without default with data', expect(infoToPrint!.length).toBe(1); expect(infoToPrint![0]).toBe( `· You're about to add not-null ${ - chalk.underline('new_column') + pico.underline('new_column') } column without default value to table, which contains 2 items`, ); expect(shouldAskForApprove).toBe(true); diff --git a/drizzle-kit/tests/wrap-param.test.ts b/drizzle-kit/tests/wrap-param.test.ts index a27d27d450..166155197f 100644 --- a/drizzle-kit/tests/wrap-param.test.ts +++ b/drizzle-kit/tests/wrap-param.test.ts @@ -1,16 +1,16 @@ -import chalk from 'chalk'; +import pico from 'picocolors'; import { assert, expect, test } from 'vitest'; import { wrapParam } from '../src/cli/validations/common'; test('wrapParam', () => { - expect(wrapParam('password', 'password123', false, 'secret')).toBe(` [${chalk.green('✓')}] password: '*****'`); + expect(wrapParam('password', 'password123', false, 'secret')).toBe(` [${pico.green('✓')}] password: '*****'`); expect(wrapParam('url', 'mysql://user:password@localhost:3306/database', false, 'url')).toBe( - ` [${chalk.green('✓')}] url: 'mysql://user:****@localhost:3306/database'`, + ` [${pico.green('✓')}] url: 'mysql://user:****@localhost:3306/database'`, ); expect(wrapParam('url', 'singlestore://user:password@localhost:3306/database', false, 'url')).toBe( - ` [${chalk.green('✓')}] url: 'singlestore://user:****@localhost:3306/database'`, + ` [${pico.green('✓')}] url: 'singlestore://user:****@localhost:3306/database'`, ); expect(wrapParam('url', 'postgresql://user:password@localhost:5432/database', false, 'url')).toBe( - ` [${chalk.green('✓')}] url: 'postgresql://user:****@localhost:5432/database'`, + ` [${pico.green('✓')}] url: 'postgresql://user:****@localhost:5432/database'`, ); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bd2bdf431..d90a8ffa42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,7 +40,7 @@ importers: version: link:drizzle-orm/dist drizzle-orm-old: specifier: npm:drizzle-orm@^0.27.2 - version: drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20241112.0)(@libsql/client@0.10.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@11.5.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@11.5.0)(mysql2@3.11.0)(pg@8.13.1)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.13.1)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7) + version: drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20241112.0)(@libsql/client@0.10.0(bufferutil@4.0.8)(utf-8-validate@6.0.3))(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@11.5.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@11.5.0)(mysql2@3.11.0)(pg@8.13.1)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.13.1)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7) eslint: specifier: ^8.50.0 version: 8.50.0 @@ -73,7 +73,7 @@ importers: version: 0.8.16(typescript@5.6.3) tsup: specifier: ^7.2.0 - version: 7.2.0(postcss@8.4.39)(ts-node@10.9.2(typescript@5.6.3))(typescript@5.6.3) + version: 7.2.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@22.9.1)(typescript@5.6.3))(typescript@5.6.3) tsx: specifier: ^4.10.5 version: 4.10.5 @@ -371,9 +371,7 @@ importers: version: 10.1.0 expo-sqlite: specifier: ^14.0.0 - version: 14.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)) - specifier: ^13.2.0 - version: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) + version: 14.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) knex: specifier: ^2.4.2 version: 2.5.1(better-sqlite3@8.7.0)(mysql2@3.3.3)(pg@8.11.5)(sqlite3@5.1.7) @@ -9427,12 +9425,15 @@ packages: sudo-prompt@8.2.5: resolution: {integrity: sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. sudo-prompt@9.1.1: resolution: {integrity: sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. sudo-prompt@9.2.1: resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. superjson@2.2.1: resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==} @@ -10576,7 +10577,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/client-sso-oidc': 3.569.0 '@aws-sdk/client-sts': 3.569.0 '@aws-sdk/core': 3.567.0 '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0) @@ -10675,7 +10676,7 @@ snapshots: '@aws-sdk/client-sso-oidc': 3.583.0 '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -10714,7 +10715,7 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.569.0(@aws-sdk/client-sts@3.569.0)': + '@aws-sdk/client-sso-oidc@3.569.0': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -10757,7 +10758,6 @@ snapshots: '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 transitivePeerDependencies: - - '@aws-sdk/client-sts' - aws-crt '@aws-sdk/client-sso-oidc@3.583.0': @@ -10766,7 +10766,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -10982,7 +10982,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/client-sso-oidc': 3.569.0 '@aws-sdk/core': 3.567.0 '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0) '@aws-sdk/middleware-host-header': 3.567.0 @@ -11023,13 +11023,59 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sts@3.583.0': + '@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)': + dependencies: + '@aws-crypto/sha256-browser': 3.0.0 + '@aws-crypto/sha256-js': 3.0.0 + '@aws-sdk/client-sso-oidc': 3.569.0 + '@aws-sdk/core': 3.567.0 + '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/middleware-host-header': 3.567.0 + '@aws-sdk/middleware-logger': 3.568.0 + '@aws-sdk/middleware-recursion-detection': 3.567.0 + '@aws-sdk/middleware-user-agent': 3.567.0 + '@aws-sdk/region-config-resolver': 3.567.0 + '@aws-sdk/types': 3.567.0 + '@aws-sdk/util-endpoints': 3.567.0 + '@aws-sdk/util-user-agent-browser': 3.567.0 + '@aws-sdk/util-user-agent-node': 3.568.0 + '@smithy/config-resolver': 2.2.0 + '@smithy/core': 1.4.2 + '@smithy/fetch-http-handler': 2.5.0 + '@smithy/hash-node': 2.2.0 + '@smithy/invalid-dependency': 2.2.0 + '@smithy/middleware-content-length': 2.2.0 + '@smithy/middleware-endpoint': 2.5.1 + '@smithy/middleware-retry': 2.3.1 + '@smithy/middleware-serde': 2.3.0 + '@smithy/middleware-stack': 2.2.0 + '@smithy/node-config-provider': 2.3.0 + '@smithy/node-http-handler': 2.5.0 + '@smithy/protocol-http': 3.3.0 + '@smithy/smithy-client': 2.5.1 + '@smithy/types': 2.12.0 + '@smithy/url-parser': 2.2.0 + '@smithy/util-base64': 2.3.0 + '@smithy/util-body-length-browser': 2.2.0 + '@smithy/util-body-length-node': 2.3.0 + '@smithy/util-defaults-mode-browser': 2.2.1 + '@smithy/util-defaults-mode-node': 2.3.1 + '@smithy/util-endpoints': 1.2.0 + '@smithy/util-middleware': 2.2.0 + '@smithy/util-retry': 2.2.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - aws-crt + + '@aws-sdk/client-sts@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sso-oidc': 3.583.0 '@aws-sdk/core': 3.582.0 - '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -11168,9 +11214,26 @@ snapshots: transitivePeerDependencies: - aws-crt + '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': + dependencies: + '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/credential-provider-env': 3.568.0 + '@aws-sdk/credential-provider-process': 3.568.0 + '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/types': 3.567.0 + '@smithy/credential-provider-imds': 2.3.0 + '@smithy/property-provider': 2.2.0 + '@smithy/shared-ini-file-loader': 2.4.0 + '@smithy/types': 2.12.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - aws-crt + '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0)': dependencies: - '@aws-sdk/client-sts': 3.569.0 + '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) @@ -11185,13 +11248,13 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0)': + '@aws-sdk/credential-provider-ini@3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': dependencies: - '@aws-sdk/client-sts': 3.569.0 + '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -11202,12 +11265,12 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-ini@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0)': + '@aws-sdk/credential-provider-ini@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0)': dependencies: '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) + '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -11235,6 +11298,25 @@ snapshots: transitivePeerDependencies: - aws-crt + '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': + dependencies: + '@aws-sdk/credential-provider-env': 3.568.0 + '@aws-sdk/credential-provider-http': 3.568.0 + '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-process': 3.568.0 + '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.569.0) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/types': 3.567.0 + '@smithy/credential-provider-imds': 2.3.0 + '@smithy/property-provider': 2.2.0 + '@smithy/shared-ini-file-loader': 2.4.0 + '@smithy/types': 2.12.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - '@aws-sdk/client-sts' + - aws-crt + '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)(@aws-sdk/client-sts@3.569.0)': dependencies: '@aws-sdk/credential-provider-env': 3.568.0 @@ -11254,14 +11336,14 @@ snapshots: - '@aws-sdk/client-sts' - aws-crt - '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0)': + '@aws-sdk/credential-provider-node@3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0))': dependencies: '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-http': 3.568.0 - '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -11273,13 +11355,13 @@ snapshots: - '@aws-sdk/client-sts' - aws-crt - '@aws-sdk/credential-provider-node@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0)': + '@aws-sdk/credential-provider-node@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0)': dependencies: '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-http': 3.582.0 - '@aws-sdk/credential-provider-ini': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/credential-provider-ini': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) + '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -11354,10 +11436,10 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-sso@3.583.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))': + '@aws-sdk/credential-provider-sso@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)': dependencies: '@aws-sdk/client-sso': 3.583.0 - '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)) + '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 @@ -11402,15 +11484,15 @@ snapshots: dependencies: '@aws-sdk/client-cognito-identity': 3.569.0 '@aws-sdk/client-sso': 3.568.0 - '@aws-sdk/client-sts': 3.569.0 + '@aws-sdk/client-sts': 3.569.0(@aws-sdk/client-sso-oidc@3.569.0) '@aws-sdk/credential-provider-cognito-identity': 3.569.0 '@aws-sdk/credential-provider-env': 3.568.0 '@aws-sdk/credential-provider-http': 3.568.0 - '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) - '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-ini': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) + '@aws-sdk/credential-provider-node': 3.569.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) '@aws-sdk/credential-provider-process': 3.568.0 '@aws-sdk/credential-provider-sso': 3.568.0(@aws-sdk/client-sso-oidc@3.583.0) - '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/credential-provider-web-identity': 3.568.0(@aws-sdk/client-sts@3.569.0(@aws-sdk/client-sso-oidc@3.569.0)) '@aws-sdk/types': 3.567.0 '@smithy/credential-provider-imds': 2.3.0 '@smithy/property-provider': 2.2.0 @@ -11584,7 +11666,7 @@ snapshots: '@aws-sdk/token-providers@3.568.0(@aws-sdk/client-sso-oidc@3.569.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.569.0(@aws-sdk/client-sts@3.569.0) + '@aws-sdk/client-sso-oidc': 3.569.0 '@aws-sdk/types': 3.567.0 '@smithy/property-provider': 2.2.0 '@smithy/shared-ini-file-loader': 2.4.0 @@ -11600,7 +11682,7 @@ snapshots: '@smithy/types': 2.12.0 tslib: 2.8.1 - '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0))': + '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.583.0)': dependencies: '@aws-sdk/client-sso-oidc': 3.583.0 '@aws-sdk/types': 3.577.0 @@ -16846,7 +16928,7 @@ snapshots: transitivePeerDependencies: - supports-color - drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20241112.0)(@libsql/client@0.10.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@11.5.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@11.5.0)(mysql2@3.11.0)(pg@8.13.1)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.13.1)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7): + drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20241112.0)(@libsql/client@0.10.0(bufferutil@4.0.8)(utf-8-validate@6.0.3))(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@11.5.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@11.5.0)(mysql2@3.11.0)(pg@8.13.1)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.13.1)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7): optionalDependencies: '@aws-sdk/client-rds-data': 3.583.0 '@cloudflare/workers-types': 4.20241112.0 @@ -16868,36 +16950,6 @@ snapshots: sql.js: 1.10.3 sqlite3: 5.1.7 - drizzle-orm@0.32.1(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@electric-sql/pglite@0.1.5)(@libsql/client@0.4.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3))(@neondatabase/serverless@0.9.3)(@op-engineering/op-sqlite@2.0.22(react@18.3.1))(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@prisma/client@5.14.0)(@tidbcloud/serverless@0.1.1)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/react@18.3.1)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(@xata.io/client@0.29.4(typescript@5.4.5(patch_hash=q3iy4fwdhi5sis3wty7d4nbsme)))(better-sqlite3@9.6.0)(bun-types@1.0.3)(expo-sqlite@13.4.0)(knex@3.1.0(better-sqlite3@9.6.0)(mysql2@2.3.3)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.27.3)(mysql2@2.3.3)(pg@8.11.5)(postgres@3.4.4)(react@18.3.1)(sql.js@1.10.3)(sqlite3@5.1.7): - optionalDependencies: - '@aws-sdk/client-rds-data': 3.583.0 - '@cloudflare/workers-types': 4.20240524.0 - '@electric-sql/pglite': 0.1.5 - '@libsql/client': 0.4.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) - '@neondatabase/serverless': 0.9.3 - '@op-engineering/op-sqlite': 2.0.22(react-native@0.74.1(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(@types/react@18.3.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@6.0.3))(react@18.3.1) - '@opentelemetry/api': 1.8.0 - '@planetscale/database': 1.18.0 - '@prisma/client': 5.14.0(prisma@5.14.0) - '@tidbcloud/serverless': 0.1.1 - '@types/better-sqlite3': 7.6.10 - '@types/pg': 8.11.6 - '@types/react': 18.3.1 - '@types/sql.js': 1.4.9 - '@vercel/postgres': 0.8.0 - '@xata.io/client': 0.29.4(typescript@5.4.5(patch_hash=q3iy4fwdhi5sis3wty7d4nbsme)) - better-sqlite3: 9.6.0 - bun-types: 1.0.3 - expo-sqlite: 13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)) - knex: 3.1.0(better-sqlite3@9.6.0)(mysql2@2.3.3)(pg@8.11.5)(sqlite3@5.1.7) - kysely: 0.27.3 - mysql2: 2.3.3 - pg: 8.11.5 - postgres: 3.4.4 - react: 18.3.1 - sql.js: 1.10.3 - sqlite3: 5.1.7 - drizzle-prisma-generator@0.1.4: dependencies: '@prisma/generator-helper': 5.16.1 @@ -17761,8 +17813,7 @@ snapshots: dependencies: invariant: 2.2.4 - expo-sqlite@14.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)): - expo-sqlite@13.4.0(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): + expo-sqlite@14.0.6(expo@51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3)): dependencies: '@expo/websql': 1.0.1 expo: 51.0.8(@babel/core@7.24.6)(@babel/preset-env@7.24.6(@babel/core@7.24.6))(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3) @@ -20163,13 +20214,13 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-load-config@4.0.1(postcss@8.4.39)(ts-node@10.9.2(typescript@5.6.3)): + postcss-load-config@4.0.1(postcss@8.4.39)(ts-node@10.9.2(@types/node@22.9.1)(typescript@5.6.3)): dependencies: lilconfig: 2.1.0 yaml: 2.3.1 optionalDependencies: postcss: 8.4.39 - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.6.3) + ts-node: 10.9.2(@types/node@22.9.1)(typescript@5.6.3) postcss-load-config@6.0.1(postcss@8.4.39)(tsx@3.14.0)(yaml@2.4.2): dependencies: @@ -21430,6 +21481,25 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-node@10.9.2(@types/node@22.9.1)(typescript@5.6.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.9.1 + 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.6.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optional: true + tsconfck@3.0.3(typescript@5.6.3): optionalDependencies: typescript: 5.6.3 @@ -21447,7 +21517,7 @@ snapshots: tslib@2.8.1: {} - tsup@7.2.0(postcss@8.4.39)(ts-node@10.9.2(typescript@5.6.3))(typescript@5.6.3): + tsup@7.2.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@22.9.1)(typescript@5.6.3))(typescript@5.6.3): dependencies: bundle-require: 4.0.2(esbuild@0.18.20) cac: 6.7.14 @@ -21457,7 +21527,7 @@ snapshots: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 4.0.1(postcss@8.4.39)(ts-node@10.9.2(typescript@5.6.3)) + postcss-load-config: 4.0.1(postcss@8.4.39)(ts-node@10.9.2(@types/node@22.9.1)(typescript@5.6.3)) resolve-from: 5.0.0 rollup: 3.27.2 source-map: 0.8.0-beta.0 From e6a20df8d2f8b8c6a118380faaab932d6d9df949 Mon Sep 17 00:00:00 2001 From: kravetsone <57632712+kravetsone@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:11:55 +0300 Subject: [PATCH 3/4] Bump picocolors --- drizzle-kit/package.json | 2 +- pnpm-lock.yaml | 62 ++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/drizzle-kit/package.json b/drizzle-kit/package.json index 60e078c22d..3a47994c8b 100644 --- a/drizzle-kit/package.json +++ b/drizzle-kit/package.json @@ -99,7 +99,7 @@ "node-fetch": "^3.3.2", "ohm-js": "^17.1.0", "pg": "^8.11.5", - "picocolors": "^1.0.1", + "picocolors": "^1.1.1", "pluralize": "^8.0.0", "postgres": "^3.4.4", "prettier": "^2.8.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d90a8ffa42..24e5bc5e70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,8 +250,8 @@ importers: specifier: ^8.11.5 version: 8.11.5 picocolors: - specifier: ^1.0.1 - version: 1.0.1 + specifier: ^1.1.1 + version: 1.1.1 pluralize: specifier: ^8.0.0 version: 8.0.0 @@ -8450,8 +8450,8 @@ packages: pgpass@1.0.5: resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -10673,8 +10673,8 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.583.0 - '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) + '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/core': 3.582.0 '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -10760,11 +10760,11 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.583.0': + '@aws-sdk/client-sso-oidc@3.583.0(@aws-sdk/client-sts@3.583.0)': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/core': 3.582.0 '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -10803,6 +10803,7 @@ snapshots: '@smithy/util-utf8': 3.0.0 tslib: 2.8.1 transitivePeerDependencies: + - '@aws-sdk/client-sts' - aws-crt '@aws-sdk/client-sso@3.478.0': @@ -11069,11 +11070,11 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/client-sts@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)': + '@aws-sdk/client-sts@3.583.0': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.583.0 + '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/core': 3.582.0 '@aws-sdk/credential-provider-node': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -11112,7 +11113,6 @@ snapshots: '@smithy/util-utf8': 3.0.0 tslib: 2.8.1 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - aws-crt '@aws-sdk/core@3.477.0': @@ -11267,7 +11267,7 @@ snapshots: '@aws-sdk/credential-provider-ini@3.583.0(@aws-sdk/client-sso-oidc@3.583.0)(@aws-sdk/client-sts@3.583.0)': dependencies: - '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 '@aws-sdk/credential-provider-sso': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) @@ -11474,7 +11474,7 @@ snapshots: '@aws-sdk/credential-provider-web-identity@3.577.0(@aws-sdk/client-sts@3.583.0)': dependencies: - '@aws-sdk/client-sts': 3.583.0(@aws-sdk/client-sso-oidc@3.583.0) + '@aws-sdk/client-sts': 3.583.0 '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/types': 3.0.0 @@ -11675,7 +11675,7 @@ snapshots: '@aws-sdk/token-providers@3.568.0(@aws-sdk/client-sso-oidc@3.583.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.583.0 + '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.567.0 '@smithy/property-provider': 2.2.0 '@smithy/shared-ini-file-loader': 2.4.0 @@ -11684,7 +11684,7 @@ snapshots: '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.583.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.583.0 + '@aws-sdk/client-sso-oidc': 3.583.0(@aws-sdk/client-sts@3.583.0) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 @@ -11793,7 +11793,7 @@ snapshots: '@babel/code-frame@7.24.6': dependencies: '@babel/highlight': 7.24.6 - picocolors: 1.0.1 + picocolors: 1.1.1 '@babel/compat-data@7.24.6': {} @@ -11994,7 +11994,7 @@ snapshots: '@babel/helper-validator-identifier': 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.1.1 '@babel/parser@7.22.10': dependencies: @@ -15653,7 +15653,7 @@ snapshots: fflate: 0.8.2 flatted: 3.3.1 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 sirv: 2.0.4 vitest: 1.6.0(@types/node@18.19.33)(@vitest/ui@1.6.0)(lightningcss@1.25.1)(terser@5.31.0) optional: true @@ -15665,7 +15665,7 @@ snapshots: fflate: 0.8.2 flatted: 3.3.1 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 sirv: 2.0.4 vitest: 2.1.2(@types/node@20.12.12)(@vitest/ui@1.6.0)(lightningcss@1.25.1)(terser@5.31.0) @@ -20171,7 +20171,7 @@ snapshots: dependencies: split2: 4.2.0 - picocolors@1.0.1: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -20233,13 +20233,13 @@ snapshots: postcss@8.4.38: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 + picocolors: 1.1.1 source-map-js: 1.2.0 postcss@8.4.39: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 + picocolors: 1.1.1 source-map-js: 1.2.0 postgres-array@2.0.0: {} @@ -21825,7 +21825,7 @@ snapshots: dependencies: browserslist: 4.23.0 escalade: 3.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 uri-js@4.4.1: dependencies: @@ -21890,7 +21890,7 @@ snapshots: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 vite: 5.3.3(@types/node@18.15.10)(lightningcss@1.25.1)(terser@5.31.0) transitivePeerDependencies: - '@types/node' @@ -21907,7 +21907,7 @@ snapshots: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 vite: 5.3.3(@types/node@18.19.33)(lightningcss@1.25.1)(terser@5.31.0) transitivePeerDependencies: - '@types/node' @@ -21924,7 +21924,7 @@ snapshots: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 vite: 5.3.3(@types/node@20.10.1)(lightningcss@1.25.1)(terser@5.31.0) transitivePeerDependencies: - '@types/node' @@ -21941,7 +21941,7 @@ snapshots: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 vite: 5.3.3(@types/node@20.12.12)(lightningcss@1.25.1)(terser@5.31.0) transitivePeerDependencies: - '@types/node' @@ -22131,7 +22131,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -22165,7 +22165,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -22199,7 +22199,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 @@ -22233,7 +22233,7 @@ snapshots: local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.8.0 From 63c59e2bfc323876a632baf9171214218e627947 Mon Sep 17 00:00:00 2001 From: kravetsone <57632712+kravetsone@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:13:40 +0300 Subject: [PATCH 4/4] Add missing bracket --- drizzle-kit/src/serializer/pgSerializer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drizzle-kit/src/serializer/pgSerializer.ts b/drizzle-kit/src/serializer/pgSerializer.ts index 9a8e1fd9e4..8c443f2612 100644 --- a/drizzle-kit/src/serializer/pgSerializer.ts +++ b/drizzle-kit/src/serializer/pgSerializer.ts @@ -800,7 +800,7 @@ export const generatePgSnapshot = ( The unique constraint ${pico.underline(pico.blue(column.uniqueName))} on the ${ pico.underline(pico.blue( column.name, - ) + )) } column is confilcting with a unique constraint name already defined for ${ pico.underline(pico.blue(existingUnique.columns.join(','))) } columns\n`,