MCPcopy Index your code
hub / github.com/dvajs/dva-ast

github.com/dvajs/dva-ast @0.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.1 ↗ · + Follow
155 symbols 359 edges 51 files 4 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dva-ast

NPM version Build Status

dva static analysis based on javascript ast.

Development Workflow

After cloning this repo.

$ npm install
$ npm run debug

API

runner

  • runner(sourcePath, options)

transform

  • transform({ source, path }, { jscodeshift })

api

models

All apis of models contains sourcePath and filePath.

  • create({ namespace, entry?, modelPath? })
  • remove({ namespace })
  • updateNamespace({ namespace, newNamespace })
  • updateState({ namespace, source })
  • addReducer({ namespace, name, [source] })
  • updateReducer({ namespace, name, source })
  • removeReducer({ namespace, name })
  • addEffect({ namespace, name, [source] })
  • updateEffect({ namespace, name, source })
  • removeEffect({ namespace, name })
  • addSubscription({ namespace, name, [source] })
  • updateSubscription({ namespace, name, source })
  • removeSubscription({ namespace, name })

routeComponents

All apis of routeComponents contains sourcePath and filePath.

  • create({ componentName })
  • remove()
  • update()
  • addDispatch({ actionType })

project

  • loadAll({ sourcePath })
  • loadAll({ sourcePath, filePath })

router

  • createRoute({ path, component, [parentId] })
  • component <object>
  • componentName
  • filePath, if file is not exist, dva-ast will create a new component for you
  • createIndexRoute({ component, [parentId] })
  • createRedirect({ from, to, [parentId] })
  • createIndexRedirect({ to, [parentId] })
  • remove({ id })
  • moveTo({ id, parentId })

entry

  • addModel({ entry, modelPath })

LICENSE

MIT

Core symbols most depended-on inside this repo

writeFile
called by 15
src/api/utils.js
_action
called by 11
src/api/models.js
readFile
called by 8
src/api/utils.js
prepareRouterjs
called by 7
test/api/router-test.js
addDispatch
called by 5
src/transform.js
request
called by 4
test/fixtures/projects/user-dashboard/actual/src/utils/request.js
findRouteById
called by 4
src/api/router.js
prepareComponent
called by 3
test/api/router-test.js

Shape

Function 155

Languages

TypeScript100%

Modules by API surface

src/collections/Model.js22 symbols
src/api/models.js14 symbols
test/fixtures/projects/user-dashboard/actual/src/models/users.js12 symbols
src/collections/RouteComponent.js12 symbols
src/api/router.js12 symbols
test/fixtures/projects/user-dashboard/actual/src/routes/Users.jsx10 symbols
src/combine.js6 symbols
src/utils/index.js5 symbols
src/collections/Router.js5 symbols
src/collections/Entry.js5 symbols
src/api/routeComponents.js5 symbols
test/fixtures/projects/user-dashboard/actual/src/services/users.js4 symbols

For agents

$ claude mcp add dva-ast \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact