generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(javascript): add FrontendFlow and DsComponent interfaces #81
- Added `FrontendFlow` interface to handle the flow of frontend tasks in JavaScript projects. - Added methods to `FrontendFlow` interface to get routes, components, design system components, sample remote call, and sample state management. - Added `DsComponent` data class to represent design system components in JavaScript projects.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow/DsComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cc.unitmesh.ide.javascript.flow | ||
|
||
/** | ||
* the Design System Component | ||
*/ | ||
data class DsComponent( | ||
val name: String, | ||
val props: List<String>, | ||
val events: List<String> | ||
) |
45 changes: 45 additions & 0 deletions
45
javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow/FrontendFlow.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package cc.unitmesh.ide.javascript.flow | ||
|
||
import cc.unitmesh.devti.flow.TaskFlow | ||
|
||
/** | ||
* | ||
* 1. Finding Function bootstrap, like the main function in java, ReactDom.render in React | ||
* 2. IO Handing | ||
* 3. Transform data, like State in React, Vuex in Vue | ||
* 4. Processing calling, like the fetch in React, the axios in Vue | ||
* 5. Output Transform, like the render in React, the template in Vue | ||
*/ | ||
interface FrontendFlow : TaskFlow<String> { | ||
var userTask: String | ||
|
||
/** | ||
* Get all routes in the project, including the routes in the submodules | ||
* @return list of routes | ||
*/ | ||
fun getRoutes(): List<String> | ||
|
||
/** | ||
* Get all components in the project, based on the naming convention, like the PascalCase under `src/components` | ||
* @return list of components | ||
*/ | ||
fun getComponents(): List<DsComponent> | ||
|
||
/** | ||
* Get the design system components, like the Ant Design in React, the Element in Vue | ||
* @return list of design system components | ||
*/ | ||
fun getDesignSystemComponents(): List<DsComponent> | ||
|
||
/** | ||
* Get remote call as a sample, like the axios in Vue, the fetch in React | ||
* @return list of services | ||
*/ | ||
fun sampleRemoteCall(): String | ||
|
||
/** | ||
* Get the state management, like the Vuex in Vue, the Redux in React, maybe Empty | ||
* @return list of state management | ||
*/ | ||
fun sampleStateManagement(): String? | ||
} |