resforge 0.4.3__tar.gz → 0.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {resforge-0.4.3 → resforge-0.4.4}/PKG-INFO +4 -8
- {resforge-0.4.3 → resforge-0.4.4}/README.md +1 -5
- {resforge-0.4.3 → resforge-0.4.4}/pyproject.toml +5 -2
- resforge-0.4.4/src/resforge/__init__.py +7 -0
- resforge-0.4.4/src/resforge/_codegen/__init__.py +2 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/_codegen/kotlin.py +8 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/_utils.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/android/__init__.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/android/compose.py +8 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/android/types.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/android/values.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/apple/__init__.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/apple/_base.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/apple/_colorset.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/apple/catalog.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/apple/types.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/color.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/io.py +3 -0
- resforge-0.4.4/tests/__init__.py +2 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_android_compose.py +8 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_android_values.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_apple_catalog.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_atomic_write.py +3 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_codegen_kotlin.py +9 -0
- {resforge-0.4.3 → resforge-0.4.4}/tests/test_color.py +3 -0
- resforge-0.4.3/src/resforge/__init__.py +0 -4
- resforge-0.4.3/src/resforge/_codegen/__init__.py +0 -0
- resforge-0.4.3/tests/__init__.py +0 -0
- {resforge-0.4.3 → resforge-0.4.4}/.gitignore +0 -0
- {resforge-0.4.3 → resforge-0.4.4}/src/resforge/py.typed +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: resforge
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A type-safe Python DSL for cross-platform mobile resource generation
|
|
5
5
|
Project-URL: Homepage, https://kipila.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/kipila-dev/forje
|
|
7
7
|
Author-email: Kipila Ltd <hello@kipila.dev>
|
|
8
|
-
License:
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
9
|
Keywords: android-xml,automation,code-generation,design-tokens,dsl,mobile-infra,type-safety,white-label,xcassets
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
|
-
Classifier: License :: OSI Approved ::
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -34,7 +34,7 @@ design tokens.
|
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
37
|
-
```
|
|
37
|
+
```bash
|
|
38
38
|
pip install resforge
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -172,7 +172,3 @@ with AssetCatalog("App", "Assets") as catalog:
|
|
|
172
172
|
- SwiftUI dimensions
|
|
173
173
|
- Typography
|
|
174
174
|
- Images (ImageSet, IconSet, `res/drawable` vectors)
|
|
175
|
-
|
|
176
|
-
## License
|
|
177
|
-
|
|
178
|
-
MIT
|
|
@@ -14,7 +14,7 @@ design tokens.
|
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
```
|
|
17
|
+
```bash
|
|
18
18
|
pip install resforge
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -152,7 +152,3 @@ with AssetCatalog("App", "Assets") as catalog:
|
|
|
152
152
|
- SwiftUI dimensions
|
|
153
153
|
- Typography
|
|
154
154
|
- Images (ImageSet, IconSet, `res/drawable` vectors)
|
|
155
|
-
|
|
156
|
-
## License
|
|
157
|
-
|
|
158
|
-
MIT
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kipila Ltd
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
[build-system]
|
|
2
5
|
requires = ["hatchling"]
|
|
3
6
|
build-backend = "hatchling.build"
|
|
@@ -8,7 +11,7 @@ dynamic = ["version"]
|
|
|
8
11
|
description = "A type-safe Python DSL for cross-platform mobile resource generation"
|
|
9
12
|
readme = "README.md"
|
|
10
13
|
requires-python = ">=3.12"
|
|
11
|
-
license =
|
|
14
|
+
license = "Apache-2.0"
|
|
12
15
|
authors = [{ name = "Kipila Ltd", email = "hello@kipila.dev" }]
|
|
13
16
|
keywords = [
|
|
14
17
|
"dsl",
|
|
@@ -26,7 +29,7 @@ classifiers = [
|
|
|
26
29
|
"Programming Language :: Python :: 3.12",
|
|
27
30
|
"Programming Language :: Python :: 3.13",
|
|
28
31
|
"Programming Language :: Python :: 3.14",
|
|
29
|
-
"License :: OSI Approved ::
|
|
32
|
+
"License :: OSI Approved :: Apache Software License",
|
|
30
33
|
"Intended Audience :: Developers",
|
|
31
34
|
"Topic :: Software Development :: Build Tools",
|
|
32
35
|
]
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kipila Ltd
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
from dataclasses import dataclass
|
|
2
5
|
from typing import IO, Literal, Self, final
|
|
3
6
|
|
|
@@ -52,6 +55,11 @@ class KotlinFile:
|
|
|
52
55
|
"""A Kotlin file declaration."""
|
|
53
56
|
|
|
54
57
|
def __init__(self, package: str) -> None:
|
|
58
|
+
package = package.strip()
|
|
59
|
+
if not package:
|
|
60
|
+
msg = "Package must not be empty"
|
|
61
|
+
raise ValueError(msg)
|
|
62
|
+
|
|
55
63
|
self._package = package
|
|
56
64
|
self._imports: set[str] = set()
|
|
57
65
|
self._members: list[KotlinProperty | KotlinObject] = []
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kipila Ltd
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
from __future__ import annotations
|
|
2
5
|
|
|
3
6
|
from io import BytesIO
|
|
@@ -128,6 +131,11 @@ class ComposeWriter(_BaseComposeScope):
|
|
|
128
131
|
sink: The custom output to write data to. If None,
|
|
129
132
|
defaults to a standard file write.
|
|
130
133
|
"""
|
|
134
|
+
package = package.strip()
|
|
135
|
+
if not package:
|
|
136
|
+
msg = "Package must not be empty"
|
|
137
|
+
raise ValueError(msg)
|
|
138
|
+
|
|
131
139
|
self._active = False
|
|
132
140
|
self._path = Path(path)
|
|
133
141
|
self._package = package
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kipila Ltd
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
from pathlib import Path
|
|
2
5
|
|
|
3
6
|
import pytest
|
|
@@ -129,3 +132,8 @@ def test_unsupported_dimension_unit_raises(tmp_path: Path):
|
|
|
129
132
|
ComposeWriter(output, package="com.example.theme") as compose,
|
|
130
133
|
):
|
|
131
134
|
compose.dimension(padding=Dimension(8, "px"))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def test_empty_package_raises():
|
|
138
|
+
with pytest.raises(ValueError, match="Package"):
|
|
139
|
+
ComposeWriter("Color.kt", package="")
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kipila Ltd
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
1
5
|
from resforge._codegen.kotlin import KotlinFile, KotlinObject, KotlinProperty
|
|
2
6
|
|
|
3
7
|
|
|
@@ -102,3 +106,8 @@ def test_top_level_property():
|
|
|
102
106
|
assert f.render() == (
|
|
103
107
|
"package com.example\n\nval primary: Color = Color(0xFF6200EE)\n"
|
|
104
108
|
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def test_empty_package_raises():
|
|
112
|
+
with pytest.raises(ValueError, match="Package"):
|
|
113
|
+
KotlinFile(package="")
|
|
File without changes
|
resforge-0.4.3/tests/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|