Skip to content

Commit aa72136

Browse files
committed
0.2.0 - update the project descriptions
Update the project description for explaining the usages of the React codes.
1 parent a66ba27 commit aa72136

File tree

5 files changed

+66
-8
lines changed

5 files changed

+66
-8
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ This guide shows how to compile and test this project. Anyone who want to contri
1313
* Review our [code of conduct :memo:](./CODE_OF_CONDUCT.md) before contributing to this project.
1414

1515
* The metadata of the project is defined in `pyproject.toml` and `package.json`. Modifying `package.json` will not automatically update `pyproject.toml`. Therefore, users need to ensure changes for both files if any part of the metadata needs to be changed.
16+
* The React source files are in the `src/lib/` folder. These codes are formatted by [`pretteir`:hammer:][tool-prettier].
1617

17-
* The Python codes are in the package `dash_file_cache/` folder. These codes are formatted by [`black`:hammer:][tool-black]. Note that the automatically generated files (may be introduced in the future) will not be formatted.
18+
* The Python codes are in the package `dash_file_cache/` folder. These codes are formatted by [`black`:hammer:][tool-black].
19+
20+
* The Python Compoenent codes are in the sub-package `dash_file_cache/components/` folder. Note that the automatically generated files like `_imports_.py` and `Downloader.py` will not be formatted.
21+
22+
* Currently, we do not provide the React demo application. Therefore, please do not use `yarn start`.
1823

1924
* The Dash demo apps are stored in `examples/`. These demos show the usages this package in different cases.
2025

@@ -24,7 +29,11 @@ This guide shows how to compile and test this project. Anyone who want to contri
2429

2530
* The tool configurations for `pytest`, `black`, and `pyright` are defined in `pyproject.toml`. However, the configurations for `flake8`, `pylint`, and `prettier` are still kept in their corresponding configurations files.
2631

27-
* Remember to use [`black`:hammer:][tool-black] to format any modified Python codes. [Review your code :memo:](./review_checklist.md) before sending the pull request.
32+
* If any custom styles are defined but not imported as a part of the react codes, please add these custom CSS files into the distribution folder (`dash_json_grid`).
33+
* Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
34+
* Make sure the stylesheets are added to the `_css_dist` dict in `dash_json_grid/__init__.py` so dash will serve them automatically when the component suite is requested.
35+
36+
* Remember to use [`black`:hammer:][tool-black] and [`pretteir`:hammer:][tool-prettier] to format any modified Python and React codes, respectively. [Review your code :memo:](./review_checklist.md) before sending the pull request.
2837

2938
### 2. Work with Docker
3039

@@ -119,6 +128,13 @@ At the **bottom left** corner, you should be able to see the name of the current
119128

120129
Now you will be able to start the development. You can do the following things to test the codes.
121130

131+
* Build the component
132+
133+
``` sh
134+
yarn install
135+
yarn build
136+
```
137+
122138
* Run the `pytest`:
123139

124140
``` sh
@@ -188,7 +204,7 @@ The following steps will help you configure the environment with `conda`:
188204
1. Create the environment
189205

190206
``` sh
191-
conda create -c conda-forge -n dashdev-dfc python=3.12 wheel setuptools
207+
conda create -c conda-forge -n dashdev-dfc python=3.12 wheel setuptools nodejs yarn
192208
```
193209

194210
2. Enter the environment
@@ -203,6 +219,13 @@ The following steps will help you configure the environment with `conda`:
203219
pip install -r requirements.txt -r requirements-dev.txt -r tests/requirements.txt
204220
```
205221

222+
4. Install the Node.js dependencies and build the first version.
223+
224+
``` sh
225+
yarn install
226+
yarn build
227+
```
228+
206229
#### 3.3. Run the test
207230

208231
To verify whether you have correctly prepared the environment or not, you can run the following command:
@@ -215,6 +238,13 @@ python -m pytest --headless --with-dash
215238

216239
You can do the following things to test the codes.
217240

241+
* Build the component
242+
243+
``` sh
244+
yarn install
245+
yarn build
246+
```
247+
218248
* Run the `pytest`:
219249

220250
``` sh

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
4. Update the `docker` configurations.
2828
5. Remove the unused command `yarn start` from the `package.json`.
2929
6. Update the project configurations to the newest standard.
30+
7. Update the project descriptions for explaining the usages of the React codes.
3031

3132
### 0.1.2 @ 10/13/2024
3233

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The data cache enables the following features:
2020
1. Load a server-side file dynamically and send the file to users (the frontend).
2121
2. Support in-memory files (like `io.BytesIO()`) or on-disk files (specified by a path).
2222
3. Support different kinds of cache (single-thread, multi-processing, or file-based).
23-
4. A customized component helping the dashboard trigger a download event from the server side.
23+
4. Customized components helping the dashboard trigger download events from the server side.
2424

2525
## 1. Install
2626

@@ -30,15 +30,26 @@ Intall the **latest released version** of this package by using the PyPI source:
3030
python -m pip install dash-file-cache
3131
```
3232

33-
Or use the following commands to install **the developing version** from the GitHub Source when you have already installed [Git :hammer:][tool-git]:
33+
If users want to install the developer's version, they need to ensure that the following packages are installed.
34+
35+
* [Git :hammer:][tool-git]
36+
* [NodeJS][tool-nodejs]
37+
* [Yarn][tool-yarn]
38+
39+
Then use the following commands to install it.
3440

3541
```bash
36-
git clone https://github.com/cainmagi/dash-file-cache
42+
git clone --depth 1 --single-branch https://github.com/cainmagi/dash-file-cache
3743
cd dash-file-cache
3844
python -m pip install -r requirements.txt -r requirements-dev.txt
39-
python -m pip install .
45+
yarn install
46+
yarn dlx @yarnpkg/sdks vscode
47+
yarn build
48+
python -m pip install .[dev]
4049
```
4150

51+
For VSCode users, please install the recommended extensions specified in the project workspace file.
52+
4253
## 2. Usage
4354

4455
The following codes show a minimal example of this package

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The following list shows the maintenance status of all versions.
66

77
| Version | Supported | Available on [PyPI :link:][link-pypi] |
88
| ------- | ------------------ | ------------------------------------- |
9+
| `0.2.x` | :white_check_mark: | :white_check_mark: |
910
| `0.1.x` | :white_check_mark: | :white_check_mark: |
1011

1112
## Reporting a Vulnerability

review_checklist.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,27 @@
1818
* Scan your code for expensive operations (large computations, DOM queries, React re-renders). Have you done your possible to limit their impact? If not, it is going to slow your app down.
1919
* Can you think of cases where your current code will break? How are you handling errors? Should the user see them as notifications? Should your app try to auto-correct them for them?
2020

21+
## Component API
22+
23+
- Have you tested your component on the Python side by creating an app in `usage.py` ?
24+
25+
Do all of your component's props work when set from the back-end?
26+
27+
Should all of them be settable from the back-end or are some only relevant to user interactions in the front-end?
28+
29+
- Have you provided some basic documentation about your component? The Dash community uses [react docstrings](https://github.com/plotly/dash-docs/blob/master/tutorial/plugins.py#L45) to provide basic information about dash components. Take a look at this [Checklist component example](https://github.com/plotly/dash-core-components/blob/master/src/components/Checklist.react.js) and others from the dash-core-components repository.
30+
31+
At a minimum, you should describe what your component does, and describe its props and the features they enable.
32+
33+
Be careful to use the correct formatting for your docstrings for them to be properly recognized.
34+
2135
## Tests
2236

2337
- The Dash team uses integration tests extensively, and we highly encourage you to write tests for the main functionality of your component. In the `tests` folder of the boilerplate, you can see a sample integration test. By launching it, you will run a sample Dash app in a browser. You can run the test with:
2438
```
25-
python -m pytest
39+
python -m tests.test_render
2640
```
41+
[Browse the Dash component code on GitHub for more examples of testing.](https://github.com/plotly/dash-core-components)
2742
2843
## Ready to publish? Final scan
2944

0 commit comments

Comments
 (0)