Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cookiecutter template for creating ReactPy-compatible Javascript components

License

NotificationsYou must be signed in to change notification settings

reactive-python/reactpy-js-component-template

Repository files navigation

Test

Acookiecutter template for packaging Javascript components with ReactPy

About 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.

Usage

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:

FieldDescription
author_nameyour name or the name of your organization
author_emailyour email of the email of your organization
repository_namethe name of your repository's root directory
repository_urlthe URL your repository can be found at
python_package_namethe name of the "backend" Python package your Javascript components will be used in
npm_package_namethe name of the "frontend" Javascript package used by your Python package
project_short_descriptiona short summary used to describe both Python and Javascript packages

After this you should find a new directory named after the givenrepository_name.

Template Manifest

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/DirectoryContents
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

Run the Tests

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

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp