Skip to content

Commit

Permalink
Merge pull request #110 from Confidenceman02/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Confidenceman02 authored Jun 25, 2024
2 parents 8341961 + 926e17d commit 34a04ac
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .run/watch.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="manage.py" />
<option name="PARAMETERS" value="djelm watch test_elm" />
<option name="PARAMETERS" value="djelm watch elm_programs" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.14.0] - 2024-06-25

### Fixed

- Widget model's not generating when their flags change

## [0.13.0] - 2024-06-22

### Added
Expand Down Expand Up @@ -234,6 +240,7 @@ type alias A_B__

- First version to pyPI

[0.14.0]: https://github.com/Confidenceman02/django-elm/compare/0.13.0...0.14.0
[0.13.0]: https://github.com/Confidenceman02/django-elm/compare/0.12.0...0.13.0
[0.12.0]: https://github.com/Confidenceman02/django-elm/compare/0.11.0...0.12.0
[0.11.0]: https://github.com/Confidenceman02/django-elm/compare/0.10.0...0.11.0
Expand Down
50 changes: 26 additions & 24 deletions example/elm_programs/static_src/elm.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
{
"type": "application",
"source-directories": ["src"],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"Confidenceman02/elm-select": "10.4.4",
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm-community/list-extra": "8.7.0",
"rtfeldman/elm-css": "18.0.0"
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"Confidenceman02/elm-select": "10.4.4",
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm-community/list-extra": "8.7.0",
"rtfeldman/elm-css": "18.0.0"
},
"indirect": {
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3",
"robinheghan/murmur3": "1.0.0",
"rtfeldman/elm-hex": "1.0.0"
}
},
"indirect": {
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3",
"robinheghan/murmur3": "1.0.0",
"rtfeldman/elm-hex": "1.0.0"
"test-dependencies": {
"direct": {},
"indirect": {}
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins = [ "mypy_django_plugin.main" ]

[tool.poetry]
name = "djelm"
version = "0.13.0"
version = "0.14.0"
description = "A framework for using Elm programs in a Django project"
authors = ["Confidenceman02"]
readme = "README_pypi.md"
Expand Down
19 changes: 15 additions & 4 deletions src/djelm/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,31 @@ async def watch(
# If flags change generate models
# TODO Don't generate a model when a flags module is deleted
# TODO Only generate a model when the flags output is different to what has already been generated.
# TODO Handle widget programs
# TODO Validate if it's an actual flag file and not some other python file
if os.path.join(app_path, "flags") in f and f.endswith(".py"):
filename = os.path.basename(f).split(".")[0]
dirname = os.path.basename(os.path.dirname(f))
target_dirs = ["widgets", "flags"]
# bail early
if dirname not in target_dirs:
continue
filename = os.path.splitext(os.path.basename(f))[0]
namespace = ["src"]
generator: ModelBuilder = ModelGenerator()
if "widgets" == dirname:
namespace.append("Widgets")
generator = WidgetModelGenerator()
program_name = program_file(filename)
# TODO validate if program is an actual Elm program and not some other Elm file
is_program = os.path.isfile(
os.path.join(src_path, "src", program_name)
os.path.join(src_path, *namespace, program_name)
)
if is_program:
logger.write(f"FLAGS CHANGED: {f}")
try:
GenerateModelStrategy(
self.app_name,
module_name(filename),
ModelGenerator(),
generator,
from_source=True,
watch_mode=True,
).run(logger)
Expand Down

0 comments on commit 34a04ac

Please sign in to comment.