https://github.com/dvajs/dva-ast
dva static analysis based on javascript ast.
https://github.com/dvajs/dva-ast
Last synced: about 2 months ago
JSON representation
dva static analysis based on javascript ast.
- Host: GitHub
- URL: https://github.com/dvajs/dva-ast
- Owner: dvajs
- License: mit
- Created: 2016-07-25T13:47:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T09:59:37.000Z (over 7 years ago)
- Last Synced: 2024-05-14T01:04:52.386Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 179 KB
- Stars: 52
- Watchers: 6
- Forks: 15
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dva-ast
[](https://npmjs.org/package/dva-ast)
[](https://travis-ci.org/dvajs/dva-ast)dva static analysis based on javascript ast.
## Development Workflow
After cloning this repo.
```bash
$ 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 ``
- 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