Skip to content

Commit

Permalink
Merge pull request #118 from Confidenceman02/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Confidenceman02 authored Sep 18, 2024
2 parents 14e3566 + 39422ec commit 623ea77
Show file tree
Hide file tree
Showing 15 changed files with 316 additions and 97 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ jobs:
run: |
poetry run doit prepare_e2e_tests &
poetry run tox -e e2e
- name: Run browser tests after delete compile
run: |
rm -rf example/elm_programs/static_src/elm-stuff/djelm*
rm -rf example/elm_programs/static/dist
poetry run tox -e e2e
4 changes: 2 additions & 2 deletions .run/compile_dev.run.xml → .run/compile.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="compile:dev" type="PythonConfigurationType" factoryName="Python">
<configuration default="false" name="compile" type="PythonConfigurationType" factoryName="Python">
<module name="django-elm" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
Expand All @@ -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 npm test_elm run compile:dev" />
<option name="PARAMETERS" value="djelm compile 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.16.1] - 2024-09-18

### Fixed

- Generating compile files when running compile command

## [0.16.0] - 2024-09-08

### Breaking
Expand Down Expand Up @@ -259,6 +265,7 @@ type alias A_B__

- First version to pyPI

[0.16.1]: https://github.com/Confidenceman02/django-elm/compare/0.16.0...0.16.1
[0.16.0]: https://github.com/Confidenceman02/django-elm/compare/0.15.0...0.16.0
[0.15.0]: https://github.com/Confidenceman02/django-elm/compare/0.14.0...0.15.0
[0.14.0]: https://github.com/Confidenceman02/django-elm/compare/0.13.0...0.14.0
Expand Down
12 changes: 6 additions & 6 deletions example/elm_programs/static_src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"@parcel/config-default": "^2.10.0",
"@parcel/core": "^2.10.0",
"@parcel/transformer-elm": "^2.10.0",
"elm": "^0.19.1-5",
"@parcel/config-default": "^2.12.0",
"@parcel/core": "^2.12.0",
"@parcel/transformer-elm": "^2.12.0",
"elm": "0.19.1-6",
"elm-json": "^0.2.13",
"parcel": "^2.9.3",
"typescript": "^5.2.2"
"parcel": "^2.12.0",
"typescript": "^5.4.4"
},
"dependencies": {
"@icelab/defo": "^0.0.3"
Expand Down
76 changes: 39 additions & 37 deletions example/elm_programs/static_src/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example/tests_e2e/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import shutil
from django.apps import apps
from django.core.management import call_command

from playwright.sync_api import Page, expect


call_command("djelm", "compile", "elm_programs")
# remove parcel-cache
path = apps.get_app_config("elm_programs").path
Expand Down
31 changes: 10 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 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.16.0"
version = "0.16.1"
description = "A framework for using Elm programs in a Django project"
authors = ["Confidenceman02"]
readme = "README_pypi.md"
Expand Down Expand Up @@ -37,7 +37,7 @@ pydantic = "^2.4.2"
aiofiles = "^24.1.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.2"
pytest = "^8.0.0"
pytest-django = "^4.5.2"
hypothesis = "^6.92.2"
pytest-playwright = "^0.4.4"
Expand Down
8 changes: 8 additions & 0 deletions src/djelm/cookiecutters/entrypoint_template/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"base_name": "",
"base_path": "",
"dir": "",
"program_name": "",
"scope": "",
"view_name": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Do not manually edit this file, it was auto-generated by djelm
https://github.com/Confidenceman02/djelm
*/
import defo from "@icelab/defo";

const views = {
djelm{{cookiecutter.view_name}}: async (el: HTMLElement, data: any) => {
//@ts-ignore
const { Elm } = await import("../../../src/{{cookiecutter.base_path}}{{cookiecutter.program_name}}.elm")

const app = Elm.{{cookiecutter.base_name}}{{cookiecutter.program_name}}.init({
node: el,
flags: data,
});

return {
// Called whenever the value of the `djelm` attribute changes
update: (newData, oldData) => {},
// Called when the element (or its djelm attribute) is removed from the DOM
destroy: () => {},
};
}
}

defo({ views, prefix: "{{cookiecutter.scope}}" })
Loading

0 comments on commit 623ea77

Please sign in to comment.