2828 * npx dialtone-migrate --only color-stops,hsl-to-oklch
2929 */
3030
31- import { spawn } from 'node:child_process' ;
31+ import { spawn , execFileSync } from 'node:child_process' ;
3232import fs from 'fs/promises' ;
3333import path from 'path' ;
3434import readline from 'readline' ;
@@ -302,11 +302,12 @@ const MIGRATIONS = [
302302 {
303303 id : 'vue3-to-vue-imports' ,
304304 name : 'Vue 3 Import Paths' ,
305- description : '@dialpad/dialtone-icons/vue3 and @dialpad/dialtone-vue/vue3 import paths renamed to /vue.' ,
305+ description : '@dialpad/dialtone/vue3, @dialpad/dialtone -icons/vue3, and @dialpad/dialtone-vue/vue3 import paths renamed to /vue.' ,
306306 category : 'required' ,
307307 type : 'config' ,
308308 configName : 'vue3-to-vue-imports' ,
309309 detectPatterns : [
310+ / @ d i a l p a d \/ d i a l t o n e \/ v u e 3 / ,
310311 / @ d i a l p a d \/ d i a l t o n e - i c o n s \/ v u e 3 / ,
311312 / @ d i a l p a d \/ d i a l t o n e - v u e \/ v u e 3 / ,
312313 ] ,
@@ -370,7 +371,7 @@ Examples:
370371// File walker (shared utility)
371372// ---------------------------------------------------------------------------
372373
373- const DEFAULT_IGNORE = [ 'node_modules' , 'dist' , '.git' , '.vuepress/public' , '.vuepress/.temp' , '.vuepress/.cache' , 'storybook-static' ] ;
374+ const DEFAULT_IGNORE = [ 'node_modules' , 'dist' , '.git' , '.vuepress/public' , '.vuepress/.temp' , '.vuepress/.cache' , 'storybook-static' , 'compiled' ] ;
374375
375376function isIgnoredPath ( fullPath ) {
376377 const segments = fullPath . split ( path . sep ) ;
@@ -386,6 +387,31 @@ function isIgnoredPath (fullPath) {
386387 } ) ;
387388}
388389
390+ /**
391+ * Filter out files that are ignored by .gitignore using git check-ignore.
392+ * Falls back gracefully if git is not available.
393+ */
394+ function filterGitIgnored ( files , cwd ) {
395+ if ( files . length === 0 ) return files ;
396+ try {
397+ const input = files . join ( '\n' ) ;
398+ const output = execFileSync ( 'git' , [ 'check-ignore' , '--stdin' ] , {
399+ input,
400+ cwd,
401+ encoding : 'utf8' ,
402+ stdio : [ 'pipe' , 'pipe' , 'ignore' ] ,
403+ } ) ;
404+ const ignored = new Set ( output . trim ( ) . split ( '\n' ) . filter ( Boolean ) ) ;
405+ return files . filter ( f => ! ignored . has ( f ) ) ;
406+ } catch ( err ) {
407+ // status 1 → no paths ignored; status 128 → not a git repo; ENOENT → git missing
408+ if ( err . status === 1 || err . status === 128 || err . code === 'ENOENT' ) {
409+ return files ;
410+ }
411+ throw err ;
412+ }
413+ }
414+
389415async function findFiles ( dir , extensions ) {
390416 const results = [ ] ;
391417 async function walk ( currentDir ) {
@@ -404,7 +430,7 @@ async function findFiles (dir, extensions) {
404430 }
405431 }
406432 await walk ( dir ) ;
407- return results ;
433+ return filterGitIgnored ( results , dir ) ;
408434}
409435
410436// ---------------------------------------------------------------------------
0 commit comments