- Notifications
You must be signed in to change notification settings - Fork4
Cookiecutter template for creating ReactPy-compatible Javascript components
License
reactive-python/reactpy-js-component-template
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Acookiecutter
template for packaging Javascript components with ReactPy
ReactPy is a framework for creating highly interactive web pages purely in Python. However,ReactPy also provides a way to natively interface with the Javascript ecosystem. Thisrepository defines a basic template for creating packages wich distribute Javascript foruse in ReactPy-based applications.
For more information about ReactPy refer to itsdocumentation.
Installcookiecutter
withpip
:
pip install cookiecutter
Then use this repostory template as a cookiecutter to initalize a repository:
cookiecutter https://github.com/reactive-python/reactpy-react-component-cookiecutter.git
As the template is being constructed you will be prompted to fill out the following information:
Field | Description |
---|---|
author_name | your name or the name of your organization |
author_email | your email of the email of your organization |
repository_name | the name of your repository's root directory |
repository_url | the URL your repository can be found at |
python_package_name | the name of the "backend" Python package your Javascript components will be used in |
npm_package_name | the name of the "frontend" Javascript package used by your Python package |
project_short_description | a short summary used to describe both Python and Javascript packages |
After this you should find a new directory named after the givenrepository_name
.
The template generates the following files:
├── {python_package_name}│ ├── __init__.py│ └── example.py├── js│ ├── src│ │ ├── index.js│ ├── package.json│ ├── README.md│ └── rollup.config.js├── tests│ ├── __init__.py│ ├── conftest.py│ └── test_example.py├── .gitignore├── MANIFEST.in├── README.md├── setup.cfg└── setup.py
The key consituents of the generated repository are briefly described below:
File/Directory | Contents |
---|---|
js/ | a bare-bones Javascript component that is bundled withRollup |
{python_package_name}/ | minimial code required to load the Javascript component |
tests/ | a basicselenium -based test suite for your component |
To run the tests for this repository you'll need theChromeDriver in yourPATH
. Once that'sdone, simplypip
install the requirements:
pip install -r requirements.txt
And run thetest
session withNox:
nox -stest
To open the browser when the tests run:
nox -stest
About
Cookiecutter template for creating ReactPy-compatible Javascript components
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.