pahen / madge

Create graphs from your CommonJS, AMD or ES6 module dependencies
MIT License
9.09k stars 317 forks source link

Madge 8.0.0 does not find any file #434

Open crystalfp opened 3 months ago

crystalfp commented 3 months ago

Madge has worked well in the past so now I want to use it on a new project (also to see how it process vue files). The problem is that madge 8.0.0 does not find any file. And I don't know where to start investigating this problem.

There is no configuration around and the command line is:

madge --extensions ts,vue --ts-config tsconfig.json -i madge.png --debug  new old

But the result is:

⠋ Finding files  madge using tsconfig { compilerOptions: { target: 99, module: 99, lib: [ 'lib.esnext.d.ts', 'lib.dom.d.ts', 'lib.dom.iterable.d.ts' ], skipLibCheck: true, verbatimModuleSyntax: true, noErrorTruncation: true, esModuleInterop: true, composite: true, allowSyntheticDefaultImports: true, useUnknownInCatchVariables: true, useDefineForClassFields: true, moduleResolution: 100, allowImportingTsExtensions: true, resolveJsonModule: true, isolatedModules: true, noEmit: true, jsx: 1, removeComments: true, strict: true, noUnusedLocals: true, noUnusedParameters: true, noFallthroughCasesInSwitch: true, noImplicitReturns: true, baseUrl: '.', paths: { '@/*': [Array] }, pathsBasePath: '.', configFilePath: undefined }, include: [ 'old/**/*.ts', 'old/**/*.vue', 'vite.config.mts', 'troika-three-text.d.ts', 'new/**/*.ts', 'new/**/*.vue' ] } +0ms
  madge using src paths [ 'D:\\Projects\\STMexperimental\\new', 'D:\\Projects\\STMexperimental\\old' ] +3ms
  madge using config { baseDir: null, excludeRegExp: false, fileExtensions: [ 'ts vue' ], includeNpm: false, requireConfig: null, webpackConfig: null, tsConfig: { compilerOptions: { target: 99, module: 99, lib: [Array], skipLibCheck: true, verbatimModuleSyntax: true, noErrorTruncation: true, esModuleInterop: true, composite: true, allowSyntheticDefaultImports: true, useUnknownInCatchVariables: true, useDefineForClassFields: true, moduleResolution: 100, allowImportingTsExtensions: true, resolveJsonModule: true, isolatedModules: true, noEmit: true, jsx: 1, removeComments: true, strict: true, noUnusedLocals: true, noUnusedParameters: true, noFallthroughCasesInSwitch: true, noImplicitReturns: true, baseUrl: '.', paths: [Object], pathsBasePath: '.', configFilePath: undefined }, include: [ 'old/**/*.ts', 'old/**/*.vue', 'vite.config.mts', 'troika-three-text.d.ts', 'new/**/*.ts', 'new/**/*.vue' ] }, rankdir: 'LR', layout: 'dot', fontName: 'Arial', fontSize: '14px', backgroundColor: '#111111', nodeColor: '#c6c5fe', nodeShape: 'box', nodeStyle: 'rounded', noDependencyColor: '#cfffac', cyclicNodeColor: '#ff6c60', edgeColor: '#757575', graphVizOptions: false, graphVizPath: false, dependencyFilter: [Function (anonymous)], extensions: 'ts vue', 'ts-config': 'tsconfig.json', i: 'madge.png', debug: true, version: [Function: version], image: 'madge.png' } +0ms
  madge using base directory D:/Projects/STMexperimental +4ms
Processed 0 files (802ms)

✔ Image created at D:\Projects\STMexperimental\madge.png

Instead, if I put the path to ONE file only, it works.

> madge --extensions ts,vue --ts-config tsconfig.json -i madge.png .\new\components\ControlsContainer.vue
Processed 38 files (1.3s) (3 warnings)

✔ Image created at D:\Projects\STMexperimental\madge.png

Where am I doing wrong? Thanks! mario

joshuambg commented 3 months ago

Confirmed same issue. This does not work in 8.0.0 or 7.0.0, only *.d.ts files are output.

Downgrading to 6.1.0 outputs all the files.

// dep.js
const madge = require('madge');
const path = require('path');

madge('src/client/index.ts', {
  resolve: {
    alias: {
      src: path.resolve(__dirname, './src'),
    },
    extensions: ['.js', '.ts', '.jsx', '.tsx'],
  },
  fileExtensions: ['js', 'ts', 'jsx', 'tsx'],
}).then((res) => {
  console.log(res.obj());
});
crystalfp commented 2 months ago

Any news?