Skip to content

Commit 131a975

Browse files
committed
fix package json
1 parent 1abffcb commit 131a975

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

reflex/compiler/templates.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import json
56
from collections.abc import Callable
67
from typing import Any
78

@@ -500,14 +501,16 @@ def _package_json_template(**kwargs):
500501
Returns:
501502
Rendered package.json content as string.
502503
"""
503-
return f"""{{
504-
"name": "frontend",
505-
"version": "0.1.0",
506-
"private": true,
507-
"dependencies": {kwargs.get("dependencies", {})},
508-
"devDependencies": {kwargs.get("dev_dependencies", {})},
509-
"scripts": {kwargs.get("scripts", {})}
510-
}}"""
504+
return json.dumps(
505+
{
506+
"name": "reflex",
507+
"type": "module",
508+
"scripts": kwargs.get("scripts", {}),
509+
"dependencies": kwargs.get("dependencies", {}),
510+
"devDependencies": kwargs.get("dev_dependencies", {}),
511+
"overrides": kwargs.get("overrides", {}),
512+
}
513+
)
511514

512515

513516
def _vite_config_template(**kwargs):

reflex/plugins/shared_tailwind.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import dataclasses
44
from copy import deepcopy
5-
from typing import Any, Literal, TypedDict
5+
from typing import Any, Literal, TypedDict, Unpack
66

77
from typing_extensions import NotRequired
88

@@ -78,10 +78,13 @@ class TailwindConfig(TypedDict):
7878
plugins: NotRequired[list[TailwindPluginConfig]]
7979

8080

81-
def tailwind_config_js_template(**kwargs):
81+
def tailwind_config_js_template(
82+
*, default_content: list[str], **kwargs: Unpack[TailwindConfig]
83+
):
8284
"""Get the Tailwind config template.
8385
8486
Args:
87+
default_content: The default content to use if none is provided.
8588
**kwargs: The template variables.
8689
8790
Returns:
@@ -99,7 +102,6 @@ def tailwind_config_js_template(**kwargs):
99102
important = kwargs.get("important")
100103
prefix = kwargs.get("prefix")
101104
separator = kwargs.get("separator")
102-
default_content = kwargs.get("DEFAULT_CONTENT", [])
103105

104106
# Extract destructured imports from plugin dicts only
105107
imports = [

reflex/plugins/tailwind_v3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def compile_config(config: TailwindConfig):
5050
"""
5151
return Constants.CONFIG, tailwind_config_js_template(
5252
**config,
53-
DEFAULT_CONTENT=Constants.CONTENT,
53+
default_content=Constants.CONTENT,
5454
)
5555

5656

reflex/plugins/tailwind_v4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def compile_config(config: TailwindConfig):
4949
"""
5050
return Constants.CONFIG, tailwind_config_js_template(
5151
**config,
52-
DEFAULT_CONTENT=Constants.CONTENT,
52+
default_content=Constants.CONTENT,
5353
)
5454

5555

0 commit comments

Comments
 (0)