Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit fec4272

Browse files
authored
Merge pull request #79 from plotly/update-tooling
Update tooling
2 parents a32e800 + d54cf4a commit fec4272

File tree

278 files changed

+4683
-5263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+4683
-5263
lines changed

.circleci/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ jobs:
2424
python -m venv venv || virtualenv venv
2525
2626
- restore_cache:
27-
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "circlejob.txt" }}
27+
key: deps1-{{ .Branch }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "circlejob.txt" }}
2828

2929
- run:
3030
name: Install dependencies
3131
command: |
3232
. venv/bin/activate
33-
pip install -r requirements.txt
33+
pip install -r dev-requirements.txt
3434
npm install --ignore-scripts
3535
3636
- save_cache:
37-
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "circlejob.txt" }}
37+
key: deps1-{{ .Branch }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "circlejob.txt" }}
3838
paths:
3939
- "venv"
4040
- "node_modules"
@@ -52,7 +52,6 @@ jobs:
5252
- run:
5353
name: Run tests
5454
command: |
55-
npm run test
5655
. venv/bin/activate
5756
python --version
5857
python -m unittest tests.test_dash_html_components

README.md

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,53 @@
22

33
Vanilla HTML components for [Dash][]
44

5-
6-
## Getting Started
7-
8-
### Installation
9-
10-
```sh
11-
# Install dependencies
12-
$ npm install
13-
14-
# Watch source for changes and build to `lib/`
15-
$ npm start
16-
```
5+
### Install dependencies
6+
7+
1. Create a virtual env and activate.
8+
```
9+
$ virtualenv venv
10+
$ venv/bin/activate
11+
```
12+
_Note: venv\Scripts\activate for windows_
13+
14+
2. Install python packages required to build components.
15+
```
16+
$ pip install -r dev-requirements.txt
17+
```
18+
3. Generate components and install npm packages
19+
```
20+
$ npm install
21+
```
1722
1823
### Generating HTML Components
1924
2025
The components in `src/components`, as well as the export index in
2126
`src/index.js` are programmatically generated from element definitions in
2227
`scripts/`. To regenerate:
2328
24-
The list of attributes is regenerated by scraping the
25-
[MDN HTML attribute reference][].
2629
2730
```sh
2831
$ npm run generate-components
2932
```
33+
The list of attributes is regenerated by scraping the
34+
[MDN HTML attribute reference][].
35+
36+
_Note: This step will have already been done for you when you ran `npm install`_
37+
3038
### Development
3139

3240
#### Testing your components in Dash
3341

34-
1. Build development bundle to `lib/` and watch for changes
42+
1. Watch for changes
3543

36-
# Once this is started, you can just leave it running.
37-
$ npm start
44+
$ npm run build:watch
3845

3946
2. Install module locally (after every change)
4047

4148
# Generate metadata, and build the JavaScript bundle
4249
$ npm run install-local
4350

44-
# Now you're done. For subsequent changes, if you've got `npm start`
45-
# running in a separate process, it's enough to just do:
51+
# Now you're done. For subsequent changes, if you've got `npm run build:watch`
4652
$ python setup.py install
4753

4854
3. Run the dash layout you want to test
@@ -69,18 +75,40 @@ $ npm run uninstall-local
6975

7076
See the [contributing guide](CONTRIBUTING.md) for guidelines on contributing to this project.
7177

72-
## Publishing
7378

74-
## Builder / Archetype
79+
### Create a production build and publish:
80+
81+
1. Build your code:
82+
```
83+
$ npm run build:all
84+
```
85+
2. Create a Python tarball
86+
```
87+
$ python setup.py sdist
88+
```
89+
This distribution tarball will get generated in the `dist/` folder
90+
91+
3. Test your tarball by copying it into a new environment and installing it locally:
92+
```
93+
$ pip install dash-html-components-<new-version>.tar.gz
94+
```
95+
96+
4. If it works, then you can publish the component to NPM and PyPI:
97+
1. Publish on PyPI
98+
```
99+
$ twine upload dist/*
100+
```
101+
2. Cleanup the dist folder (optional)
102+
```
103+
$ rm -rf dist
104+
```
105+
3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
106+
```
107+
$ npm publish
108+
```
109+
_Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash servers the component library's CSS and JS from the remote unpkg CDN, so if you haven't published the component package to NPM you'll need to set the `serve_locally` flags to `True` (unless you choose `False` on `publish_on_npm`). We will eventually make `serve_locally=True` the default, [follow our progress in this issue](https://github.com/plotly/dash/issues/284)._
75110
76-
We use [Builder][] to centrally manage build configuration, dependencies, and
77-
scripts. See the [dash-components-archetype][] repo for more information.
78-
79-
80-
[Builder]: https://github.com/FormidableLabs/builder
81111
[Dash]: https://plot.ly/dash
82-
[dash-components-archetype]: https://github.com/plotly/dash-components-archetype
83112
[MDN HTML attribute reference]: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
84113
[NPM package authors]: https://www.npmjs.com/package/dash-html-components/access
85114
[PyPi]: https://pypi.python.org/pypi
86-

dash_html_components/A.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class A(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Abbr.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Abbr(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Acronym.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Acronym(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Address.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Address(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Area.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Area(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Article.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Article(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Aside.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Aside(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Audio.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Audio(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/B.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class B(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

dash_html_components/Base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ class Base(Component):
99
1010
Keyword arguments:
1111
- children (a list of or a singular dash component, string or number; optional): The children of this component
12-
- id (string; optional): The ID of this component, used to identify dash components
13-
in callbacks. The ID needs to be unique across all of the
12+
- id (string; optional): The ID of this component, used to identify dash components
13+
in callbacks. The ID needs to be unique across all of the
1414
components in an app.
15-
- n_clicks (optional): An integer that represents the number of times
15+
- n_clicks (optional): An integer that represents the number of times
1616
that this element has been clicked on.
17-
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18-
at which n_clicks changed. This can be used to tell
17+
- n_clicks_timestamp (optional): An integer that represents the time (in ms since 1970)
18+
at which n_clicks changed. This can be used to tell
1919
which button was changed most recently.
20-
- key (string; optional): A unique identifier for the component, used to improve
21-
performance by React.js while rendering components
20+
- key (string; optional): A unique identifier for the component, used to improve
21+
performance by React.js while rendering components
2222
See https://reactjs.org/docs/lists-and-keys.html for more info
2323
- role (string; optional): The ARIA role attribute
2424
- data-* (string; optional): A wildcard data attribute

0 commit comments

Comments
 (0)