Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excludeRegExp requires sources to be relative to file run #295

Open
dustinsgoodman opened this issue Sep 27, 2021 · 0 comments
Open

excludeRegExp requires sources to be relative to file run #295

dustinsgoodman opened this issue Sep 27, 2021 · 0 comments
Labels

Comments

@dustinsgoodman
Copy link

I'm running madge against apollo-client to detect dependencies of certain files. I'm working against this version of apollo-client for context.

Specifically I'm testing the following command:

madge --extensions ts,tsx --image useQueryAfter.svg src/react/hooks/useQuery.ts

The Issue:
I've already ported several of the dependency files so I want to omit them from the output. However, to do so, I have to exclude them relative to the file being analyzed. Below is my .madgerc. As you can see I'm having to relatively path to the top level of the project to detect the correct files. However, I want to be able to rapidly switch between files in the project. It would be nice if the excludeRegExp field worked from the root directory instead of relative paths from the analyzed file.

.madgerc

{
  "detectiveOptions": {
    "ts": {
      "skipTypeImports": true
    },
    "es6": {
      "skipTypeImports": true
    }
  },
	"graphVizOptions": {
		"G": {
			"rankdir": "LR"
		}
	},
	"tsConfig": "tsconfig.json",
  "excludeRegExp": [
    "../../cache/inmemory/object-canon.ts",
    "../../cache/inmemory/policies.ts",
    "../../cache/inmemory/types.ts",
    "../../cache/core/types/Cache.ts",
    "../../cache/core/types/common.ts",
    "../../cache/core/types/DataProxy.ts",
    "../../core/ApolloClient.ts",
    "../../core/ObservableQuery.ts",
    "../../core/QueryInfo.ts",
    "../../core/networkStatus.ts",
    "../../core/types.ts",
    "../../core/index.ts",
    "../../core/watchQueryOptions.ts",
    "../../core/watchQueryOptions_types.ts",
    "../../errors/index.ts",
    "../../link/core/index.ts",
    "../../link/core/types.ts",
    "../../link/utils/createOperation.ts",
    "../../link/utils/transformOperation.ts",
    "../../link/utils/validateOperation.ts",
    "../../utilities/common/arrays.ts",
    "../../utilities/common/bootstrap.ts",
    "../../utilities/common/canUse.ts",
    "../../utilities/common/compact.ts",
    "../../utilities/common/errorHandling.ts",
    "../../utilities/common/global.ts",
    "../../utilities/common/makeUniqueId.ts",
    "../../utilities/common/maybe.ts",
    "../../utilities/common/objects.ts",
    "../../utilities/globals/DEV.ts",
    "../../utilities/globals/graphql.ts",
    "../../utilities/globals/init.ts",
    "../../utilities/graphql/getFromAST.ts",
    "../../utilities/graphql/storeUtils.ts",
    "../../utilities/observables/Observable.ts",
    "../../utilities/observables/asyncMap.ts",
    "../../utilities/observables/iteration.ts",
    "../../utilities/testing/index.ts",
    "../../utilities/testing/itAsync.ts",
    "../../utilities/testing/withErrorSpy.ts",
    "../context/ApolloConsumer.ts",
    "../context/ApolloContext.ts",
    "../context/ApolloProvider.ts",
    "../context/index.ts",
    "../data/MutationData.ts",
    "../data/OperationData.ts",
    "../data/QueryData.ts",
    "../data/index.ts",
    "../hooks/utils/useBaseQuery.ts",
    "../hooks/utils/useDeepMemo.ts",
    "../hooks/useApolloClient.ts",
    "../hooks/index.ts",
    "../parser/index.ts",
    "../types/types.ts"
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants