Skip to content

Commit c2bf1de

Browse files
committed
feat: Compare dart-sass versions in sources
1 parent 41368a7 commit c2bf1de

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

.github/workflows/sync-dart-sass-version.yaml

Whitespace-only changes.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dev = [
4848
"esbonio>=0.16.5",
4949
"hatchling>=1.27.0",
5050
"pytest>=8.3.5",
51+
"pyyaml>=6.0.2",
5152
"ruff>=0.11.2",
5253
"ty>=0.0.0a10",
5354
]

tools/sync-latest-sass.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
from pathlib import Path
3+
4+
import yaml
5+
6+
from sass_embedded import _const as const
7+
8+
root = Path(__file__).parents[1]
9+
10+
11+
def pick_sass_version(aqua: dict):
12+
for pkg in aqua["packages"]:
13+
if pkg["name"].startswith("sass/dart-sass@"):
14+
return pkg["name"].split("@")[1]
15+
raise Exception("Package is not found")
16+
17+
18+
def main():
19+
aqua_yaml_path = root / "aqua.yaml"
20+
aqua = yaml.safe_load(aqua_yaml_path.read_text())
21+
sass_version = pick_sass_version(aqua)
22+
print(f"- Current version: {const.DART_SASS_VERSION}")
23+
print(f"- Loaded version: {sass_version}")
24+
if sass_version == const.DART_SASS_VERSION:
25+
return 0
26+
print("Detect newer Dart Sass.")
27+
pass
28+
29+
30+
if __name__ == "__main__":
31+
main()

uv.lock

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)