Skip to content

Commit b50b5df

Browse files
committed
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.
1 parent 2bf3e9c commit b50b5df

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package cc.unitmesh.ide.javascript.flow
2+
3+
/**
4+
* the Design System Component
5+
*/
6+
data class DsComponent(
7+
val name: String,
8+
val props: List<String>,
9+
val events: List<String>
10+
)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package cc.unitmesh.ide.javascript.flow
2+
3+
import cc.unitmesh.devti.flow.TaskFlow
4+
5+
/**
6+
*
7+
* 1. Finding Function bootstrap, like the main function in java, ReactDom.render in React
8+
* 2. IO Handing
9+
* 3. Transform data, like State in React, Vuex in Vue
10+
* 4. Processing calling, like the fetch in React, the axios in Vue
11+
* 5. Output Transform, like the render in React, the template in Vue
12+
*/
13+
interface FrontendFlow : TaskFlow<String> {
14+
var userTask: String
15+
16+
/**
17+
* Get all routes in the project, including the routes in the submodules
18+
* @return list of routes
19+
*/
20+
fun getRoutes(): List<String>
21+
22+
/**
23+
* Get all components in the project, based on the naming convention, like the PascalCase under `src/components`
24+
* @return list of components
25+
*/
26+
fun getComponents(): List<DsComponent>
27+
28+
/**
29+
* Get the design system components, like the Ant Design in React, the Element in Vue
30+
* @return list of design system components
31+
*/
32+
fun getDesignSystemComponents(): List<DsComponent>
33+
34+
/**
35+
* Get remote call as a sample, like the axios in Vue, the fetch in React
36+
* @return list of services
37+
*/
38+
fun sampleRemoteCall(): String
39+
40+
/**
41+
* Get the state management, like the Vuex in Vue, the Redux in React, maybe Empty
42+
* @return list of state management
43+
*/
44+
fun sampleStateManagement(): String?
45+
}

0 commit comments

Comments
 (0)