-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] cookiecutter for the boilerplate #14
Conversation
This is pretty cool! The readme is pretty confusing though, because it has the |
Maybe the readme could say under step 2 something like "the |
I also think more guidance would be good during the Q&A step... Does
I wasn't sure if "full_name" was my name? the name of the project? Email... will someone send me email? Does it add me to a mailing list? How are these things used? What's the difference between description, project name and project slug? (to be clear, I know the answers to most of these, but an average user likely will not). Finally: I know "slug" is fairly common but is kind of a gross word and a turnoff to most non-/junior-programmers I know. I would prefer "shortname" personally :) |
Right, I was changing alot of things in there and just copy/pasted from one to the other, I'll make the root one more readable alone.
Ahah, did not think about that, the cookiecutter example used that so I just went with it.
It only allows for defaults inbetween the brackets, we could put a better description in there and verify in a hook if it's still the default explanatory text. |
afa5bb3
to
d35d4b5
Compare
I'm getting this error running |
@valentijnnieman can you try with https ?
Answer |
@T4rk1n That worked, thanks :) |
@plotly/dash I'd like to merge this soon so we can work on more features in subsequent PR's. Please review. Here's the files I want reviewed:
|
@@ -0,0 +1,86 @@ | |||
# {{cookiecutter.project_name}} | |||
|
|||
This project was generated by the [dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate) it contains the minimal set of code required to create your own custom Dash component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move this to CONTRIBUTING.md
and then have README.md
contain something like:
# {{cookiecutter.project_name}}
{{cookiecutter.project_name}} is a Dash component library.
Get started with:
1. Install Dash and its dependencies: https://dash.plot.ly/installation
2. Run `python usage.py`
3. Visit http://localhost:8050 in your web browser
### Contributing
See [CONTRIBUTING.md](/CONTRIBUTING.md)
|
||
3. Test your tarball by copying it into a new environment and installing it locally: | ||
``` | ||
$ pip install my_dash_component-0.0.1.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be templated too?
- publish_on_npm: Set to false to only serve locally from the package data. | ||
- install_dependencies: Set to false to only generate the project structure. | ||
4. The project will be generated in the folder of `project_shortname`. | ||
5. Follow the directions in the generated README to start developing your new Dash component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we create a little ascii-cenima recording of this process and include it here? https://asciinema.org/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to but it's not for windows, if someone wants to do it after merge and include it, I'll create an issue for it.
README.md
Outdated
$ cookiecutter [email protected]:plotly/dash-component-boilerplate.git | ||
``` | ||
3. Answer the questions about the project. | ||
- project name: Clean project name, can contains spaces and special characters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say:
- Project name: This is the "human-readable" name of your project. For example, "Dash Core Components".
- Component library name: This is the "python library" name of your project. By default, this is generated from your "Project name" by lowercasing the name and replacing spaces * `-` with underscores. For example, for "Dash Core Components" this would be "dash_core_components".
And just in case you missed it, let's rename "Component name" to "Component library name".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the library name is project_shortname derived from project_name, the component_name is the name of the generated initial Component.
README.md
Outdated
- component name: derived from project_name, lowercase, spaces and '-' are replaced by '_', ascii only. | ||
- author info: author_name and author_email for package.json metadata. | ||
- description: the project description, included in package.json. | ||
- version: The initial version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we leave this out and just default this to 0.0.1
?
README.md
Outdated
- author info: author_name and author_email for package.json metadata. | ||
- description: the project description, included in package.json. | ||
- version: The initial version. | ||
- license: License type for the component lib. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
component library
This looks really great! |
This PR transform the repo into a cookiecutter
Try it right now with:
$ pip install cookiecutter
(if not installed)$ cookiecutter https://github.com/plotly/dash-component-boilerplate.git --checkout=cookie-cutter
Then follow the instructions in the generated README
Closes #13, closes #12, closes #9