Skip to content

Commit

Permalink
feat(javascript): add FrontendFlow and DsComponent interfaces #81
Browse files Browse the repository at this point in the history
- 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
phodal committed Jan 24, 2024
1 parent 2bf3e9c commit b50b5df
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
@@ -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>
)
@@ -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?
}

0 comments on commit b50b5df

Please sign in to comment.