@@ -1596,88 +1596,6 @@ describe('extract-import-map.mjs — tree-sitter init graceful failure', () => {
15961596 expect ( result . output . stats . filesWithImports ) . toBe ( 0 ) ;
15971597 expect ( result . output . stats . totalEdges ) . toBe ( 0 ) ;
15981598 } ) ;
1599-
1600- it ( 'resolves tsconfig paths with "./" prefix in targets (Next.js/Vite default)' , ( ) => {
1601- projectRoot = setupTree ( {
1602- 'tsconfig.json' : JSON . stringify ( {
1603- compilerOptions : {
1604- baseUrl : '.' ,
1605- paths : {
1606- '@/*' : [ './*' ] ,
1607- } ,
1608- } ,
1609- } ) ,
1610- 'app/page.tsx' : `import { cn } from '@/lib/utils';\ncn();\n` ,
1611- 'lib/utils.ts' : `export function cn(...args: string[]) { return args.join(' '); }\n` ,
1612- } ) ;
1613-
1614- const result = runScript ( projectRoot , {
1615- projectRoot,
1616- files : [
1617- { path : 'app/page.tsx' , language : 'typescript' , fileCategory : 'code' } ,
1618- { path : 'lib/utils.ts' , language : 'typescript' , fileCategory : 'code' } ,
1619- ] ,
1620- } ) ;
1621-
1622- expect ( result . status ) . toBe ( 0 ) ;
1623- expect ( result . output . scriptCompleted ) . toBe ( true ) ;
1624- expect ( result . output . importMap [ 'app/page.tsx' ] ) . toEqual ( [ 'lib/utils.ts' ] ) ;
1625- } ) ;
1626-
1627- it ( 'resolves tsconfig paths with "./src/*" prefix in targets' , ( ) => {
1628- projectRoot = setupTree ( {
1629- 'tsconfig.json' : JSON . stringify ( {
1630- compilerOptions : {
1631- baseUrl : '.' ,
1632- paths : {
1633- '@/*' : [ './src/*' ] ,
1634- } ,
1635- } ,
1636- } ) ,
1637- 'src/index.ts' : `import { Button } from '@/components/Button';\n` ,
1638- 'src/components/Button.tsx' : `export function Button() { return null; }\n` ,
1639- } ) ;
1640-
1641- const result = runScript ( projectRoot , {
1642- projectRoot,
1643- files : [
1644- { path : 'src/index.ts' , language : 'typescript' , fileCategory : 'code' } ,
1645- { path : 'src/components/Button.tsx' , language : 'typescript' , fileCategory : 'code' } ,
1646- ] ,
1647- } ) ;
1648-
1649- expect ( result . status ) . toBe ( 0 ) ;
1650- expect ( result . output . scriptCompleted ) . toBe ( true ) ;
1651- expect ( result . output . importMap [ 'src/index.ts' ] ) . toEqual ( [ 'src/components/Button.tsx' ] ) ;
1652- } ) ;
1653-
1654- it ( 'resolves tsconfig paths with multiple "./"-prefixed targets (fallback)' , ( ) => {
1655- projectRoot = setupTree ( {
1656- 'tsconfig.json' : JSON . stringify ( {
1657- compilerOptions : {
1658- baseUrl : '.' ,
1659- paths : {
1660- '~/*' : [ './src/*' , './shared/*' ] ,
1661- } ,
1662- } ,
1663- } ) ,
1664- 'src/index.ts' : `import { helper } from '~/helper';\n` ,
1665- 'shared/helper.ts' : `export function helper() {}\n` ,
1666- } ) ;
1667-
1668- const result = runScript ( projectRoot , {
1669- projectRoot,
1670- files : [
1671- { path : 'src/index.ts' , language : 'typescript' , fileCategory : 'code' } ,
1672- { path : 'shared/helper.ts' , language : 'typescript' , fileCategory : 'code' } ,
1673- ] ,
1674- } ) ;
1675-
1676- expect ( result . status ) . toBe ( 0 ) ;
1677- expect ( result . output . scriptCompleted ) . toBe ( true ) ;
1678- // helper.ts only exists in shared/, so the second target should match
1679- expect ( result . output . importMap [ 'src/index.ts' ] ) . toEqual ( [ 'shared/helper.ts' ] ) ;
1680- } ) ;
16811599} ) ;
16821600
16831601describe ( 'extract-import-map.mjs — deterministic stderr ordering across loaders' , ( ) => {
0 commit comments