@@ -11,6 +11,7 @@ The project follows the AGPL-3.0 license and is maintained by Jerry Bruwes.
1111## Architecture and Implementation
1212
1313The library transforms a JSON tree into a flat array while preserving the tree structure through computed properties added to each child object:
14+
1415- ` branch ` : Array of objects representing the path from root to current node
1516- ` index ` : Index of the object in the sibling array
1617- ` next ` : Next object in the sibling array
@@ -23,35 +24,45 @@ The main implementation is in `src/index.ts` as a default export function that t
2324## Building and Running
2425
2526### Prerequisites
27+
2628- Node.js and npm
2729
2830### Build Process
31+
2932To build the project:
33+
3034``` bash
3135npm run build
3236```
37+
3338This command uses TypeScript compiler (tsc) to compile the source code.
3439
3540### Linting
41+
3642To lint the code:
43+
3744``` bash
3845npm run lint
3946```
4047
4148### Development Setup
49+
42501 . Clone the repository
43512 . Run ` npm install ` to install dependencies
44523 . Run ` npm run build ` to build the project
4553
4654## Key Features and API
4755
4856### Main Function
57+
4958` useFlatJsonTree(tree, options?) ` - The main composable function with the following return value:
59+
5060- ` nodes ` : ComputedRef with the flat array of objects
5161- ` nodesMap ` : ComputedRef with an object mapping unique IDs to objects
5262- Manipulation functions: ` add ` , ` addChild ` , ` remove ` , ` down ` , ` left ` , ` right ` , ` up `
5363
5464### Manipulation Functions
65+
5566- ` add ` : Add an empty object to the siblings
5667- ` addChild ` : Add an empty object to the children
5768- ` remove ` : Remove an object from the tree
@@ -63,16 +74,19 @@ npm run lint
6374## Development Conventions
6475
6576### Coding Style
77+
6678- The project uses TypeScript with Vue 3 reactivity
6779- Follows ESLint linting rules defined in ` @vuebro/configs/eslint `
6880- TypeScript configuration extends ` @vuebro/configs/tsconfig `
6981- Uses Prettier formatting with ` @vuebro/configs/prettierrc ` configuration
7082
7183### File Structure
84+
7285- ` src/index.ts ` : Main implementation file
7386- ` dist/ ` : Compiled output directory
7487- Configuration files at root level (eslint.config.ts, tsconfig.json, etc.)
7588
7689### Dependencies
90+
7791- Vue 3 (reactivity system) as main dependency
78- - Development dependencies include TypeScript, Node types, and VueBro configuration packages
92+ - Development dependencies include TypeScript, Node types, and VueBro configuration packages
0 commit comments