Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit 35d8a31

Browse files
authored
Deprecates project (#17)
1 parent 43210c4 commit 35d8a31

File tree

4 files changed

+100
-21
lines changed

4 files changed

+100
-21
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### ⚠️ DEPRECATED
11+
12+
**This `sc` package has been renamed to `statifier`**
13+
14+
- **Migration Required**: All users must migrate to the new `statifier` package
15+
- **Repository**: <https://github.com/riddler/statifier>
16+
- **Hex Package**: `{:statifier, "~> 1.1"}`
17+
- **Code Changes**: Replace all `SC.` references with `Statifier.`
18+
- **Deprecation Warnings**: All public functions now emit deprecation warnings
19+
- **No New Features**: All future development continues in the `statifier` package
20+
1021
### Added
1122

1223
#### Phase 1 Enhanced Expression Evaluation
@@ -209,7 +220,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
209220
#### ActionExecutor API Modernization
210221

211222
- **REMOVED**: `SC.Actions.ActionExecutor.execute_onentry_actions/2` function clause that accepted `%Document{}` as second parameter
212-
- **REMOVED**: `SC.Actions.ActionExecutor.execute_onexit_actions/2` function clause that accepted `%Document{}` as second parameter
223+
- **REMOVED**: `SC.Actions.ActionExecutor.execute_onexit_actions/2` function clause that accepted `%Document{}` as second parameter
213224
- **BREAKING**: These functions now only accept `%StateChart{}` as the second parameter for proper event queue integration
214225
- **Migration**: Replace `ActionExecutor.execute_*_actions(states, document)` with `ActionExecutor.execute_*_actions(states, state_chart)`
215226
- **Benefit**: Action execution now properly integrates with the StateChart event queue system, enabling raised events to be processed correctly

README.md

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
# SC - StateCharts for Elixir
1+
# ⚠️ DEPRECATED: SC - StateCharts for Elixir
2+
3+
> **This project has been renamed to [Statifier](https://github.com/riddler/statifier)**
4+
> All active development continues at **<https://github.com/riddler/statifier>**
5+
> Please migrate to `{:statifier, "~> 1.1"}` for ongoing updates and support.
26
37
[![CI](https://github.com/riddler/sc/workflows/CI/badge.svg?branch=main)](https://github.com/riddler/sc/actions)
48
[![Coverage](https://codecov.io/gh/riddler/sc/branch/main/graph/badge.svg)](https://codecov.io/gh/riddler/sc)
59

10+
---
11+
12+
**⚠️ MIGRATION NOTICE**: This SC project has been renamed to **[Statifier](https://github.com/riddler/statifier)** for better discoverability and communication. All modules have been renamed from `SC.*` to `Statifier.*`.
13+
14+
**New Repository**: <https://github.com/riddler/statifier>
15+
**New Hex Package**: `{:statifier, "~> 1.1"}`
16+
17+
---
18+
619
An Elixir implementation of SCXML (State Chart XML) state charts with a focus on W3C compliance.
720

821
## Features
922

1023
-**Complete SCXML Parser** - Converts XML documents to structured data with precise location tracking
11-
-**State Chart Interpreter** - Runtime engine for executing SCXML state charts
24+
-**State Chart Interpreter** - Runtime engine for executing SCXML state charts
1225
-**Modular Validation** - Document validation with focused sub-validators for maintainability
1326
-**Compound States** - Support for hierarchical states with automatic initial child entry
1427
-**Initial State Elements** - Full support for `<initial>` elements with transitions (W3C compliant)
@@ -32,7 +45,7 @@ An Elixir implementation of SCXML (State Chart XML) state charts with a focus on
3245
### Working Features
3346

3447
-**Basic state transitions** and event-driven changes
35-
-**Hierarchical states** with optimized O(1) state lookup and automatic initial child entry
48+
-**Hierarchical states** with optimized O(1) state lookup and automatic initial child entry
3649
-**Initial state elements** - Full `<initial>` element support with transitions and comprehensive validation
3750
-**Parallel states** with concurrent execution of multiple regions and proper cross-boundary exit semantics
3851
-**Eventless transitions** - Automatic transitions without event attributes (also called NULL transitions in SCXML spec), with cycle detection and microstep processing
@@ -72,23 +85,23 @@ An Elixir implementation of SCXML (State Chart XML) state charts with a focus on
7285
### **✅ Enhanced Parallel State Support**
7386

7487
- **`Cross-Parallel Boundaries`** - Proper exit semantics when transitions leave parallel regions
75-
- **`Sibling State Management`** - Automatic exit of parallel siblings when transitions exit their shared parent
88+
- **`Sibling State Management`** - Automatic exit of parallel siblings when transitions exit their shared parent
7689
- **`Self-Transitions`** - Transitions within parallel regions preserve unaffected parallel regions
7790
- **`SCION Compatibility`** - All 4 `cond_js` tests now pass, 6 parallel interrupt tests fixed
7891
- **`Regression Prevention`** - 62 regression tests now validate all critical functionality
7992

8093
### **✅ Feature-Based Test Validation System**
8194

8295
- **`SC.FeatureDetector`** - Analyzes SCXML documents to detect used features
83-
- **Feature validation** - Tests fail when they depend on unsupported features
96+
- **Feature validation** - Tests fail when they depend on unsupported features
8497
- **False positive prevention** - No more "passing" tests that silently ignore unsupported features
8598
- **Capability tracking** - Clear visibility into which SCXML features are supported
8699

87100
### **✅ Modular Validator Architecture**
88101

89102
- **`SC.Validator`** - Main orchestrator (from 386-line monolith)
90103
- **`SC.Validator.StateValidator`** - State ID validation
91-
- **`SC.Validator.TransitionValidator`** - Transition target validation
104+
- **`SC.Validator.TransitionValidator`** - Transition target validation
92105
- **`SC.Validator.InitialStateValidator`** - All initial state constraints
93106
- **`SC.Validator.ReachabilityAnalyzer`** - State reachability analysis
94107
- **`SC.Validator.Utils`** - Shared utilities
@@ -110,25 +123,40 @@ The next major areas for development focus on expanding SCXML feature support:
110123
- **Datamodel Support** - `<data>` elements with expression evaluation
111124
- **History States** - Shallow and deep history state support
112125

113-
### **Medium Priority Features**
126+
### **Medium Priority Features**
114127

115128
- **Internal Transitions** - `type="internal"` transition support
116129
- **Targetless Transitions** - Transitions without target for pure actions
117130
- **Enhanced Error Handling** - Better error messages with source locations
118131
- **Performance Benchmarking** - Establish performance baselines and optimize hot paths
119132

120-
## Installation
133+
## ⚠️ Deprecated Installation (Use Statifier Instead)
121134

122-
Add `sc` to your list of dependencies in `mix.exs`:
135+
**⚠️ DO NOT USE**: This package is deprecated. Use the new `statifier` package instead:
123136

124137
```elixir
125138
def deps do
126139
[
127-
{:sc, "~> 1.0.0"}
140+
{:statifier, "~> 1.1"} # ✅ USE THIS
141+
# {:sc, "~> 1.0.0"} # ❌ DEPRECATED
128142
]
129143
end
130144
```
131145

146+
**Migration Guide**: Simply replace `SC.` with `Statifier.` in your code:
147+
148+
```elixir
149+
# Old (deprecated)
150+
{:ok, document} = SC.parse(xml)
151+
{:ok, state_chart} = SC.interpret(document)
152+
active_states = SC.Interpreter.active_states(state_chart)
153+
154+
# New (current)
155+
{:ok, document} = Statifier.parse(xml)
156+
{:ok, state_chart} = Statifier.interpret(document)
157+
active_states = Statifier.Interpreter.active_states(state_chart)
158+
```
159+
132160
## Usage
133161

134162
### Basic Example
@@ -227,7 +255,7 @@ active_states = SC.Interpreter.active_states(state_chart)
227255
{:ok, document} = SC.parse(xml)
228256

229257
case SC..validate(document) do
230-
{:ok, optimized_document, warnings} ->
258+
{:ok, optimized_document, warnings} ->
231259
# Document is valid and optimized, warnings are non-fatal
232260
IO.puts("Valid document with #{length(warnings)} warnings")
233261
# optimized_document now has O(1) lookup maps built
@@ -253,7 +281,7 @@ xml = """
253281
</onentry>
254282
<transition target="working"/>
255283
</state>
256-
284+
257285
<state id="working">
258286
<onentry>
259287
<assign location="counter" expr="counter + 1"/>
@@ -264,7 +292,7 @@ xml = """
264292
</onexit>
265293
<transition event="finish" target="done"/>
266294
</state>
267-
295+
268296
<final id="done"/>
269297
</scxml>
270298
"""
@@ -375,7 +403,7 @@ mix test test/sc/parser/scxml_test.exs
375403
# 1. Parse: XML → Document structure
376404
{:ok, document} = SC.parse(xml)
377405

378-
# 2. Validate: Check semantics + optimize with lookup maps
406+
# 2. Validate: Check semantics + optimize with lookup maps
379407
{:ok, optimized_document, warnings} = SC..validate(document)
380408

381409
# 3. Interpret: Run state chart with optimized lookups
@@ -389,7 +417,7 @@ The implementation includes several key optimizations for production use:
389417
### **O(1) State and Transition Lookups**
390418

391419
- **State Lookup Map**: `%{state_id => state}` for instant state access
392-
- **Transition Lookup Map**: `%{state_id => [transitions]}` for fast transition queries
420+
- **Transition Lookup Map**: `%{state_id => [transitions]}` for fast transition queries
393421
- **Built During Validation**: Lookup maps only created for valid documents
394422
- **Memory Efficient**: Uses existing document structure, no duplication
395423

@@ -402,7 +430,7 @@ active_states = SC.Interpreter.active_states(state_chart)
402430
# Returns only leaf states (compound/parallel states entered automatically)
403431

404432
# Fast ancestor computation when needed
405-
ancestors = SC.Interpreter.active_ancestors(state_chart)
433+
ancestors = SC.Interpreter.active_ancestors(state_chart)
406434
# O(1) state lookups + O(d) ancestor traversal
407435

408436
# Parallel states enter ALL child regions simultaneously
@@ -418,7 +446,7 @@ ancestors = SC.Interpreter.active_ancestors(state_chart)
418446
**Performance Impact:**
419447

420448
- O(1) vs O(n) state lookups during interpretation
421-
- O(1) vs O(n) transition queries for event processing
449+
- O(1) vs O(n) transition queries for event processing
422450
- Source field optimization eliminates expensive lookups during event processing
423451
- Critical for responsive event processing in complex state charts
424452

lib/sc.ex

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
defmodule SC do
22
@moduledoc """
3-
Documentation for `SC`.
3+
⚠️ **DEPRECATED**: This package has been renamed to **Statifier**.
4+
5+
## Migration
6+
7+
This `sc` package is deprecated. Please migrate to the new `statifier` package:
8+
9+
```elixir
10+
# In mix.exs
11+
def deps do
12+
[
13+
{:statifier, "~> 1.1"} # ✅ Use this instead
14+
# {:sc, "~> 1.0"} # ❌ Deprecated
15+
]
16+
end
17+
```
18+
19+
## Code Migration
20+
21+
Simply replace `SC.` with `Statifier.` throughout your codebase:
22+
23+
```elixir
24+
# Old (deprecated)
25+
{:ok, document} = SC.parse(xml)
26+
{:ok, state_chart} = SC.interpret(document)
27+
28+
# New (current)
29+
{:ok, document} = Statifier.parse(xml)
30+
{:ok, state_chart} = Statifier.interpret(document)
31+
```
32+
33+
**New Repository**: https://github.com/riddler/statifier
34+
**Documentation**: https://hexdocs.pm/statifier
435
"""
536

637
alias SC.{Interpreter, Parser.SCXML, Validator}
738

39+
@deprecated "Use Statifier.parse/1 instead. Add {:statifier, \"~> 1.1\"} to deps and replace SC with Statifier."
840
defdelegate parse(source_string), to: SCXML
41+
42+
@deprecated "Use Statifier.validate/1 instead. Add {:statifier, \"~> 1.1\"} to deps and replace SC with Statifier."
943
defdelegate validate(document), to: Validator
44+
45+
@deprecated "Use Statifier.interpret/1 instead. Add {:statifier, \"~> 1.1\"} to deps and replace SC with Statifier."
1046
defdelegate interpret(document), to: Interpreter, as: :initialize
1147
end

mix.exs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ defmodule SC.MixProject do
22
use Mix.Project
33

44
@app :sc
5-
@version "1.0.0"
6-
@description "StateCharts for Elixir"
5+
@version "1.0.1"
6+
@description "[DEPRECATED] Use 'statifier' package instead: https://github.com/riddler/statifier"
77
@source_url "https://github.com/riddler/sc"
88
@deps [
99
# Documentation (split out to reduce compile time in dev/test)
@@ -32,6 +32,10 @@ defmodule SC.MixProject do
3232
docs: docs(),
3333
description: @description,
3434
package: package(),
35+
deprecated: [
36+
reason: "Package renamed to 'statifier'. Use {:statifier, \"~> 1.1\"} instead.",
37+
replacement: :statifier
38+
],
3539
test_coverage: [tool: ExCoveralls],
3640
preferred_cli_env: [
3741
coveralls: :test,

0 commit comments

Comments
 (0)