Giter VIP home page Giter VIP logo

reactpy-js-component-template's Introduction

ReactPy Package Cookiecutter

Test

A cookiecutter 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. This repository defines a basic template for creating packages wich distribute Javascript for use in ReactPy-based applications.

For more information about ReactPy refer to its documentation.

Usage

Install cookiecutter with pip:

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 given repository_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/Directory Contents
js/ a bare-bones Javascript component that is bundled with Rollup
{python_package_name}/ minimial code required to load the Javascript component
tests/ a basic selenium-based test suite for your component

Run the Tests

To run the tests for this repository you'll need the ChromeDriver in your PATH. Once that's done, simply pip install the requirements:

pip install -r requirements.txt

And run the test session with Nox:

nox -s test

To open the browser when the tests run:

nox -s test

reactpy-js-component-template's People

Contributors

rmorshea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mergeforward

reactpy-js-component-template's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.