@incremark/devtools 0.0.1 โ 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +103 -0
- package/README.md +2 -0
- package/package.json +8 -2
package/README.en.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @incremark/devtools
|
|
2
|
+
|
|
3
|
+
Developer tools for Incremark, framework agnostic.
|
|
4
|
+
|
|
5
|
+
**[๐จ๐ณ ไธญๆ](./README.md)** | ๐บ๐ธ English
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- ๐ **Real-time State** - View parsing state, block list, AST
|
|
10
|
+
- ๐ **Timeline** - Record each append operation
|
|
11
|
+
- ๐จ **Themes** - Supports dark/light themes
|
|
12
|
+
- ๐ฆ **Framework Agnostic** - Works with Vue, React, or vanilla JS
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @incremark/devtools
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### With Vue
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { useIncremark, useDevTools } from '@incremark/vue'
|
|
26
|
+
|
|
27
|
+
const incremark = useIncremark()
|
|
28
|
+
useDevTools(incremark)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### With React
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { useIncremark, useDevTools } from '@incremark/react'
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
const incremark = useIncremark()
|
|
38
|
+
useDevTools(incremark)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Standalone Usage
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { createIncremarkParser } from '@incremark/core'
|
|
46
|
+
import { mountDevTools } from '@incremark/devtools'
|
|
47
|
+
|
|
48
|
+
const parser = createIncremarkParser()
|
|
49
|
+
parser.setOnChange(mountDevTools())
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API
|
|
53
|
+
|
|
54
|
+
### mountDevTools(options?, target?)
|
|
55
|
+
|
|
56
|
+
Create and mount DevTools, returns onChange callback.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const callback = mountDevTools({
|
|
60
|
+
open: false,
|
|
61
|
+
position: 'bottom-right',
|
|
62
|
+
theme: 'dark'
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
parser.setOnChange(callback)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### IncremarkDevTools
|
|
69
|
+
|
|
70
|
+
DevTools class for fine-grained control.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
const devtools = new IncremarkDevTools(options)
|
|
74
|
+
devtools.mount()
|
|
75
|
+
devtools.update(parserState)
|
|
76
|
+
devtools.unmount()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Configuration Options
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
interface DevToolsOptions {
|
|
83
|
+
open?: boolean // Initially open
|
|
84
|
+
position?: Position // Position
|
|
85
|
+
theme?: 'dark' | 'light' // Theme
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type Position = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Feature Panels
|
|
92
|
+
|
|
93
|
+
| Panel | Function |
|
|
94
|
+
|-------|----------|
|
|
95
|
+
| Overview | Shows character count, block count, etc. |
|
|
96
|
+
| Blocks | View all parsed blocks |
|
|
97
|
+
| AST | Complete AST in JSON format |
|
|
98
|
+
| Timeline | History of append operations |
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
|
103
|
+
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incremark/devtools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Incremark DevTools - Framework-agnostic debugging panel",
|
|
6
6
|
"type": "module",
|
|
@@ -18,12 +18,18 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@incremark/core": "0.0.
|
|
21
|
+
"@incremark/core": "0.0.4"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.0.0",
|
|
25
25
|
"typescript": "^5.3.0"
|
|
26
26
|
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/kingshuaishuai/incremark.git",
|
|
30
|
+
"directory": "packages/devtools"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://incremark-docs.vercel.app/",
|
|
27
33
|
"scripts": {
|
|
28
34
|
"build": "tsup",
|
|
29
35
|
"dev": "tsup --watch"
|