Skip to content

Commit

Permalink
Add README to SeqFlow package
Browse files Browse the repository at this point in the history
  • Loading branch information
allevo committed May 9, 2024
1 parent 4552da2 commit 107438f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/create-seqflow/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-seqflow",
"version": "1.0.0",
"description": "",
"description": "SeqFlow CLI",
"main": "dist/index.js",
"type": "module",
"bin": {
Expand All @@ -17,7 +17,7 @@
"start": "vite -c vite.config.js",
"build": "vite build --emptyOutDir -c vite.config.js"
},
"keywords": [],
"keywords": ["seqflow", "cli"],
"author": "",
"license": "MIT",
"devDependencies": {
Expand Down
52 changes: 52 additions & 0 deletions packages/seqflow-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SeqFlow JS

SeqFlowJS is a JavaScript library for creating and managing frontend workflows. The core ideas are:
- Events over State Management
- Simplicity over Complexity
- Linearity over Complex Abstractions
- Explicitness over Implicitiveness

## Installation

```bash
pnpm install seqflow-js
```

## Usage

```tsx
import { start, SeqflowFunctionContext } from 'seqflow-js'

async function Main(this: SeqflowFunctionContext) {
let counter = 0

const decrementButton = <button type="button">Decrement</button>
const incrementButton = <button type="button">Increment</button>
const counterDiv = <div>{counter}</div>
this.renderSync(
<>
<div>
{decrementButton}
{incrementButton}
</div>
{counterDiv}
</>
)

const events = this.waitEvents(
this.domEvent('click', { el: this._el })
)
for await (const ev of events) {
if (ev.target === incrementButton) {
counter++
} else if (ev.target === decrementButton) {
counter--
}

counterDiv.textContent = `${counter}`
}
}

start(document.getElementById('root')!, Main)
```

5 changes: 3 additions & 2 deletions packages/seqflow-js/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "seqflow-js",
"version": "1.0.0",
"description": "",
"description": "SeqFlow is a modern web framework that is designed to be simple and easy to use. It optimizes the development process by providing a simple and easy-to-understand API. It is a good choice for those who want to create web applications without the complexity of other frameworks.",
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"homepage": "https://seqflow.dev",
"scripts": {
"test": "npm-run-all biome unit build",
"unit": "vitest --run --coverage",
Expand All @@ -25,7 +26,7 @@
"vite-plugin-dts": "^3.9.0",
"vitest": "^1.5.2"
},
"keywords": [],
"keywords": ["seqflow", "framework", "jsx", "typescript", "tsx", "ui", "web", "library", "router", "state", "management", "reactive", "modern"],
"author": "",
"license": "ISC"
}

0 comments on commit 107438f

Please sign in to comment.