You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/custom-components/command-reference.md
+4-50Lines changed: 4 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,9 @@ Options:
22
22
--help Show this message and exit.
23
23
24
24
Commands:
25
-
build Build a custom component.
26
25
init Initialize a custom component.
27
-
publish Publish a custom component.
28
-
""")
26
+
build Build a custom component.
27
+
share Collect more details on the published package for gallery.""")
29
28
```
30
29
31
30
## reflex component init
@@ -140,54 +139,9 @@ Options:
140
139
141
140
## reflex component publish
142
141
143
-
To publish to a package index, a user is required to already have an account with them. As of **0.4.3**, Reflex only supports uploading to PyPI and TestPyPI. Those indices are separate PyPI and TestPyPI should have sufficient documentation on the account creation and how to generate API tokens. We also have a [short guide]({custom_components.overview.path}) covering this topic.
144
-
145
-
The publish process starts with a build if needed. If the distribution files for the version specified in pyproject.toml file already exist, the command prompts the user to confirm rebuilding the files nor not. After making sure the distribution files are ready, the command proceeds to upload them to the specified python package index.
146
-
147
-
```python eval
148
-
doccmdoutput(
149
-
command="reflex component publish --help",
150
-
output="""
151
-
reflex component publish --help
152
-
Usage: reflex component publish [OPTIONS]
153
-
154
-
Publish a custom component. Must be run from the project root directory
155
-
where the pyproject.toml is.
156
-
157
-
Args: repository: The name of the Python package repository, such pypi,
158
-
testpypi. token: The token to use for authentication on python package
159
-
repository. If token is provided, no username/password should be provided at
160
-
the same time. username: The username to use for authentication on
161
-
python package repository. password: The password to use for
162
-
authentication on python package repository. loglevel: The log level to
163
-
use.
142
+
To publish to a package index, a user is required to already have an account with them. As of **0.7.5**, Reflex does not handle the publishing process for you. You can do so manually by first running `reflex component build` followed by `twine upload` or `uv publish` or your choice of a publishing utility.
164
143
165
-
Raises: Exit: If arguments provided are not correct or the publish
166
-
fails.
167
-
168
-
Options:
169
-
-r, --repository TEXT The name of the repository. Defaults to
170
-
pypi. Only supports pypi and testpypi (Test
171
-
PyPI) for now.
172
-
-t, --token TEXT The API token to use for authentication on
173
-
python package repository. If token is
174
-
provided, no username/password should be
175
-
provided at the same time
176
-
-u, --username TEXT The username to use for authentication on
177
-
python package repository. Username and
178
-
password must both be provided.
179
-
-p, --password TEXT The password to use for authentication on
180
-
python package repository. Username and
181
-
password must both be provided.
182
-
--build / --no-build Whether to build the package before
183
-
publishing. If the package is already built,
184
-
set this to False. [default: build]
185
-
--loglevel [debug|info|warning|error|critical]
186
-
The log level to use. [default:
187
-
LogLevel.INFO]
188
-
--help Show this message and exit.
189
-
""")
190
-
```
144
+
You can then share your build on our website with `reflex component share`.
Copy file name to clipboardExpand all lines: docs/custom-components/overview.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,10 @@ from pcweb.pages.docs.custom_components import custom_components as custom_compo
8
8
9
9
Reflex users create many components of their own: ready to use high level components, or nicely wrapped React components. With **Custom Components**, the community can easily share these components now.
10
10
11
-
Release **0.4.3** introduces a series of `reflex component` commands that help developers wrap react components, test, and publish them as python packages. As shown in the image below, there are already a few custom components published on PyPI, such as `reflex-spline`, `reflex-webcam`.
11
+
Release **0.4.3** introduces a series of `reflex component` commands that help developers wrap react components, test, and publish them as python packages. As shown in the image below, there are already a few custom components published on PyPI, such as `reflex-spline`, `reflex-webcam`.
12
12
13
13
Check out the custom components gallery [here]({custom_components_gallery.path}).
@@ -29,7 +28,8 @@ Follow these steps to publish the custom component as a python package:
29
28
30
29
1.`reflex component init`: creates a new custom component project from templates.
31
30
2. dev and test: developer implements and tests the custom component.
32
-
3.`reflex component publish`: builds and uploads the package to a python package index.
31
+
3.`reflex component build`: builds the package.
32
+
4.`twine upload` or `uv publish`: uploads the package to a python package index.
33
33
34
34
### Initialization
35
35
@@ -64,7 +64,11 @@ After finishing the custom component implementation, the user is encouraged to f
64
64
### Publish
65
65
66
66
```bash
67
-
reflex component publish
67
+
reflex component build
68
68
```
69
69
70
-
Once ready to publish, execute `reflex component publish` with the credentials in the command options (either `--username` and `--password` together or `--token`). First the command builds the distribution files if they are not already built. The end result is a `dist` folder containing the distribution files. The user does not need to do anything manually with these distribution files. The the command proceeds to publish those files. The same version of the package can only be published once. If already exists, the publish ends in error. The user can go to the `pyproject.toml` file and update the version number as desired. After the `publish` command finishes successfully, the package is uploaded to PyPI. 🎉
70
+
Once you're ready to publish your package, run `reflex component build` to build the package. The command builds the distribution files if they are not already built. The end result is a `dist` folder containing the distribution files. The user does not need to do anything manually with these distribution files.
71
+
72
+
In order to publish these files as a Python package, you need to use a publishing utility. Any would work, but we recommend either [Twine](https://twine.readthedocs.io/en/stable/) or (uv)[https://docs.astral.sh/uv/guides/package/#publishing-your-package]. Make sure to keep your package version in pyproject.toml updated.
73
+
74
+
You can also share your components with the rest of the community at our website using the command `reflex component share`. See you there!
Copy file name to clipboardExpand all lines: docs/custom-components/prerequisites-for-publishing.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ image_style = {
10
10
}
11
11
```
12
12
13
-
In order to publish a Python package, an account with the package index is required. As of **0.4.3**, Reflex only supports publishing to PyPI and TestPyPI. PyPI is short for **Python Package Index**, the official third-party software repository for Python. TestPyPI is a separate instance of index that allows users to test the distribution and installation of the package before publishing it to the real index.
13
+
In order to publish a Python package, you need to use a publishing utility. Any would work, but we recommend either [Twine](https://twine.readthedocs.io/en/stable/) or (uv)[https://docs.astral.sh/uv/guides/package/#publishing-your-package].
14
14
15
15
## PyPI
16
16
@@ -22,7 +22,7 @@ rx.center(
22
22
)
23
23
```
24
24
25
-
A user can use username and password to authenticate with PyPI when publishing. Reflex does not store your PyPI credentials. If an API token is preferred, it can be generated in the account settings.
25
+
A user can use username and password to authenticate with PyPI when publishing.
0 commit comments