Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .stateDoc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

{
"$schema": "https://example.com/stateDoc.schema.json",
"projectTitle": "My FSM Docs",
"$schema": "https://example.com/praxisDoc.schema.json",
"projectTitle": "Praxis Application Documentation",
"source": "src/fsm",
"target": "docs/businessLogic",
"alwaysDisplayVisualizationAfterMachine": false,
"globs": ["**/*.machine.ts", "**/*.ts"],
"outline": "# [{{projectTitle}}]\n{{#each machines}}\n## {{name}}\n{{desc}}\n{{/each}}",
"alwaysDisplayVisualizationAfterLogic": false,
"globs": ["**/*.schema.ts", "**/*.schema.js", "**/*.machine.ts", "**/*.ts"],
"outline": "# [{{projectTitle}}]\n{{#each schemas}}\n## {{name}}\n{{desc}}\n{{/each}}",
"templates": {
"machineIndex": "## {{name}}\n{{desc}}\n\nStates:\n{{#each states}}- [{{name}}](./states/{{slug}}.md) — {{desc}}\n{{/each}}\n",
"statePage": "# {{machine.name}} / {{name}}\n{{desc}}\n\nTransitions:\n{{#each on}}- {{event}} → {{target}}\n{{/each}}\n"
"schemaIndex": "# {{name}}\n\n{{desc}}\n\n## Models\n{{#each models}}\n### {{name}}\n{{desc}}\n{{/each}}\n\n## Logic\n{{#each logic}}- [{{name}}](./logic/{{slug}}.md)\n{{/each}}\n",
"logicPage": "# {{schema.name}} / {{name}}\n{{desc}}\n\n## Events\n{{#each events}}- {{tag}}\n{{/each}}\n"
},
"visualization": { "format": "mermaid", "exportPng": true }
}
74 changes: 46 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.0] - 2025-12-27

### 🚨 Breaking Changes

- **Complete refactor from XState to Praxis**: The project has been refactored to focus on Praxis application schemas instead of XState state machines
- **Configuration changes**: While `.stateDoc.json` is still supported, `.praxisDoc.json` is now recommended
- **Package renamed**: `@plures/statedoc` → `@plures/praxisdoc` (package name will update in future release)
- **CLI command**: Recommend using `praxisdoc` instead of `statedoc` (both work for backwards compatibility)
- **Default globs**: Now defaults to `**/*.schema.ts` and `**/*.schema.js` for Praxis schemas
- **Output structure**: Documentation is now organized by schemas/logic instead of machines/states

### Added - Praxis Support

- **Praxis schema parsing**: Full support for Praxis application schemas with models, logic, and components
- **Schema documentation**: Generates documentation for Praxis models with fields and types
- **Logic documentation**: Documents events, facts, rules, and state transitions from Praxis logic definitions
- **Component documentation**: Lists Praxis UI components defined in schemas
- **Legacy XState support**: Automatic conversion of XState machines to Praxis schema format
- **Enhanced templates**: New templates for schema and logic documentation
- **Migration support**: Backwards compatible with v1.x XState projects

### Changed

- **Parser refactored**: Complete rewrite to support Praxis schema format
- **Type definitions**: Updated to `PraxisDocConfig`, `PraxisSchema`, and `PraxisLogic`
- **Documentation generator**: Restructured to generate schema-based documentation
- **CLI branding**: Updated help text and initialization to reflect Praxis focus
- **Example files**: Added `task.schema.ts` example demonstrating Praxis schema format
- **README**: Completely rewritten to focus on Praxis integration
- **ROADMAP**: Updated with Praxis-focused features and goals

### Migration Guide

Upgrading from v1.x to v2.0:

1. **Config file**: Rename `.stateDoc.json` to `.praxisDoc.json` (optional)
2. **Update globs**: Add `**/*.schema.ts` to your globs pattern
3. **Legacy support**: Existing `.machine.ts` files will automatically convert to Praxis format
4. **Review output**: Documentation structure has changed - check the new `schemas/` directory structure
5. **Templates**: If you have custom templates, update them to use the new schema structure

## [1.0.0] - 2025-01-XX

### Added - Release Readiness Improvements

- **Real-world example**: Shopping cart state machine example with before/after documentation
Expand Down Expand Up @@ -35,17 +78,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CI workflow expanded to test both Deno and npm builds
- CONTRIBUTING.md enhanced with good first issue guidance

## [1.0.0] - 2025-01-XX

### Added
### Initial Release Features

- Initial public release of state-docs
- FSM documentation generator for XState projects
- Dual runtime support (Deno and Node.js) from a single ESM codebase
- Markdown documentation generation from state machine definitions
- Mermaid state diagram generation
- Configurable documentation generation via `.stateDoc.json`
- Template-based output customization using Eta templating engine
- Template-based output customization using Handlebars templating engine
- Command-line interface with `init` and `gen` commands
- Installation scripts for Linux/macOS (`install.sh`) and Windows (`install.ps1`)
- Support for multiple installation methods:
Expand All @@ -57,27 +97,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Comprehensive documentation including README, CONTRIBUTING guide, and ADR templates
- GitHub Actions workflows for CI/CD

### Features

- **Documentation Generation**: Automatically generates Markdown documentation from FSM definitions
- **State Diagrams**: Creates Mermaid state diagrams for visualization
- **Flexible Configuration**: JSON-based configuration with sensible defaults
- **Template Customization**: Customizable templates for machine and state documentation
- **Cross-Platform**: Works on Windows, Linux, and macOS
- **Dual Runtime**: Single codebase runs on both Deno and Node.js

### Documentation

- README with installation and quick start guide
- CONTRIBUTING guide for contributors
- ADR process documentation
- Example configuration file (`.stateDoc.json`)

### Infrastructure

- GitHub Actions CI workflow for linting and type checking
- Automated publishing workflow for version releases
- Support for publishing to both JSR (Deno) and npm registries

[2.0.0]: https://github.com/plures/state-docs/releases/tag/v2.0.0
[1.0.0]: https://github.com/plures/state-docs/releases/tag/v1.0.0

30 changes: 25 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to state-docs
# Contributing to praxisdoc

Thank you for your interest in contributing to state-docs! This document provides guidelines and information to help you contribute effectively.
Thank you for your interest in contributing to praxisdoc! This document provides guidelines and information to help you contribute effectively.

## Quick Links

Expand Down Expand Up @@ -29,7 +29,7 @@ Thank you for your interest in contributing to state-docs! This document provide
- ✨ **Features** - Add new functionality (check roadmap first)
- 📝 **Documentation** - Improve README, guides, or code comments
- 🧪 **Tests** - Add test coverage for existing features
- 🎨 **Examples** - Create new example state machines
- 🎨 **Examples** - Create new Praxis schema examples
- 🌍 **Translations** - Help us reach more developers
- 🗣️ **Community** - Answer questions, review PRs, share the project

Expand All @@ -43,11 +43,12 @@ We label issues with **`good first issue`** to help new contributors get started
- ✅ Are self-contained and focused

**Current Good First Issue areas:**
- Adding more examples (e.g., authentication flow, modal state machine)
- Improving error messages
- Adding more Praxis schema examples (e.g., e-commerce order, user authentication)
- Improving error messages for schema parsing
- Adding JSDoc comments to functions
- Writing integration tests
- Improving CLI help text
- Supporting YAML schema parsing
- Adding configuration validation

[View all Good First Issues →](https://github.com/plures/state-docs/labels/good%20first%20issue)
Expand Down Expand Up @@ -147,6 +148,25 @@ See [docs/adr/README.md](docs/adr/README.md) for more details on our ADR process

Currently, the project uses end-to-end testing by running the documentation generator:

```sh
# Test with the example configuration
deno task gen

# Test with the task management example
cd examples/task-management
deno run -A ../../cli.ts gen --config=.praxisDoc.json

# Test with the shopping cart example (legacy XState)
cd examples/shopping-cart
deno run -A ../../cli.ts gen --config=.stateDoc.json
```

When adding new features:
- Test with both Praxis schemas and legacy XState machines
- Verify documentation output is correct
- Test with custom templates
- Test edge cases (empty schemas, malformed input, etc.)

```sh
deno task gen
```
Expand Down
Loading