diff --git a/README.md b/README.md index fc75555..1c42ed4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ backend; `make check` checks the source and runs the nonvisual indicator test. The checked-in `ziran.lock` pins both Ziran and Kryon to exact commits. Plot exports `src/module.zi` for other packages. That module re-exports Plot's charts and Kryon's public UI surface; app code can use -`using Charts :: #import "plot";`. +`using Charts :: #import "Plot";`. To add Plot to another Ziran project, run: @@ -25,7 +25,7 @@ ziran add kryonlabs/plot Then import its public module: ```zi -using Charts :: #import "plot"; +using Charts :: #import "Plot"; ``` The package exports `PriceBar`, `CandleChartProps`, `CandleChart`, @@ -37,3 +37,6 @@ links or copied chart files are needed in a consuming package. Run ATR currently uses source links while its older project layout is migrated to a Ziran package manifest. Other packages can use the dependency directly. +Public module names use `UpperCamelCase` (`Kryon`, `PlotWidget`, `Plot`). +Lowercase names such as `plot_widget` are implementation modules; the +lowercase `plot` export remains available for existing consumers. diff --git a/src/candle_chart.zi b/src/candle_chart.zi index 94d6536..b40211f 100644 --- a/src/candle_chart.zi +++ b/src/candle_chart.zi @@ -1,5 +1,5 @@ -using UI :: #import "kryon"; -using PlotWidget :: #import "plot_widget"; +using UI :: #import "Kryon"; +using PlotWidget :: #import "PlotWidget"; PriceBar :: struct { timestamp: s64 diff --git a/src/line_chart.zi b/src/line_chart.zi index f0ebe5b..0601a43 100644 --- a/src/line_chart.zi +++ b/src/line_chart.zi @@ -1,5 +1,5 @@ -using UI :: #import "kryon"; -using PlotWidget :: #import "plot_widget"; +using UI :: #import "Kryon"; +using PlotWidget :: #import "PlotWidget"; ChartRange :: struct { low: float32 diff --git a/src/module.zi b/src/module.zi index af98014..10b4726 100644 --- a/src/module.zi +++ b/src/module.zi @@ -1,4 +1,4 @@ // Reusable chart API, independent of the demo application's entry. -using UI :: #import "kryon"; +using UI :: #import "Kryon"; using Candle :: #import "candle_chart"; using Line :: #import "line_chart"; diff --git a/tests/indicator_test.zi b/tests/indicator_test.zi index 5eb1e53..f464f60 100644 --- a/tests/indicator_test.zi +++ b/tests/indicator_test.zi @@ -1,5 +1,5 @@ #import "candle_chart" -using UI :: #import "kryon"; +using UI :: #import "Kryon"; #program_export main :: () -> s32 { diff --git a/ziran.toml b/ziran.toml index 92188e0..ede6c53 100644 --- a/ziran.toml +++ b/ziran.toml @@ -11,9 +11,10 @@ ref = "master" [dependencies.kryon] git = "https://github.com/kryonlabs/kryon.git" ref = "master" -module_aliases = { Kryon = "kryon", PlotWidget = "plot_widget" } +module_aliases = { Kryon = "Kryon", PlotWidget = "PlotWidget" } [exports] +# Public module is Plot; the lowercase export is retained for older imports. plot = "src/module.zi" Plot = "src/module.zi"