@@ -2,7 +2,7 @@ import fs from 'fs';
22import path from 'path' ;
33import { createRequire } from 'module' ;
44import { fileURLToPath } from 'url' ;
5- import { log , confirm , note } from '@clack/prompts' ;
5+ import { log , confirm } from '@clack/prompts' ;
66import chalk from 'chalk' ;
77
88// Get the directory name in ES modules
@@ -231,38 +231,9 @@ export async function copyMigrations({
231231 }
232232 }
233233
234- // If no files to copy, show message with details and return false (no changes made)
234+ // If no files to copy, show message and return false (no changes made)
235235 if ( filesToCopy . length === 0 ) {
236- // Show success message
237- log . success ( 'All pgflow migrations are already in place' ) ;
238-
239- // Show details of already installed migrations
240- if ( skippedFiles . length > 0 ) {
241- const detailedMsg = [
242- 'Already installed migrations:' ,
243- ...skippedFiles . map ( ( file ) => {
244- // Find the matching existing file to show how it was installed
245- const matchingFile = existingFiles . find ( ( existingFile ) =>
246- existingFile . includes ( file )
247- ) ;
248-
249- if ( matchingFile === file ) {
250- // Installed with old direct method
251- return ` ${ chalk . dim ( '•' ) } ${ chalk . bold ( file ) } ` ;
252- } else {
253- // Installed with new timestamped method
254- const timestampPart =
255- matchingFile ?. substring ( 0 , matchingFile . indexOf ( file ) - 1 ) || '' ;
256- return ` ${ chalk . dim ( '•' ) } ${ chalk . dim (
257- timestampPart + '_'
258- ) } ${ chalk . bold ( file ) } `;
259- }
260- } ) ,
261- ] . join ( '\n' ) ;
262-
263- note ( detailedMsg , 'Existing pgflow Migrations' ) ;
264- }
265-
236+ log . success ( `All ${ skippedFiles . length } pgflow migrations are already in place` ) ;
266237 return false ;
267238 }
268239
@@ -276,40 +247,16 @@ export async function copyMigrations({
276247 file . destination = `${ baseTimestamp } _${ file . source } ` ;
277248 } ) ;
278249
279- log . info (
280- `Found ${ filesToCopy . length } migration${
281- filesToCopy . length !== 1 ? 's' : ''
282- } to install`
283- ) ;
284-
285- // Prepare summary message with colored output
286- const summaryParts = [ ] ;
287-
288- if ( filesToCopy . length > 0 ) {
289- summaryParts . push (
290- `${ chalk . green ( 'New migrations to install:' ) } \n${ filesToCopy
291- . map ( ( file ) => {
292- // Extract the timestamp part from the new filename
293- const newTimestamp = file . destination . substring ( 0 , 14 ) ;
294- // Format: dim timestamp + bright original name
295- return `${ chalk . green ( '+' ) } ${ file . source } → ${ chalk . dim (
296- newTimestamp + '_'
297- ) } ${ chalk . bold ( file . source ) } `;
298- } )
299- . join ( '\n' ) } `
300- ) ;
301- }
302-
303- if ( skippedFiles . length > 0 ) {
304- summaryParts . push (
305- `${ chalk . yellow ( 'Already installed:' ) } \n${ skippedFiles
306- . map ( ( file ) => `${ chalk . yellow ( '•' ) } ${ file } ` )
307- . join ( '\n' ) } `
308- ) ;
309- }
250+ // Build summary message similar to success output style
251+ const summaryMsg = [
252+ `New migrations to install:` ,
253+ ...filesToCopy . map ( ( file ) => {
254+ const newTimestamp = file . destination . substring ( 0 , 14 ) ;
255+ return ` ${ chalk . dim ( newTimestamp + '_' ) } ${ chalk . bold ( file . source ) } ` ;
256+ } ) ,
257+ ] . join ( '\n' ) ;
310258
311- // Show summary and ask for confirmation if not auto-confirming
312- note ( summaryParts . join ( '\n\n' ) , 'pgflow Migrations' ) ;
259+ log . info ( summaryMsg ) ;
313260
314261 let shouldContinue = autoConfirm ;
315262
0 commit comments