Giter Site home page Giter Site logo

luisj135 / create-wp-react-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devowlio/create-wp-react-app

0.0 1.0 0.0 33 KB

Create React WordPress plugin with no build configuration.

Home Page: https://matthias-web.com

License: MIT License

JavaScript 100.00%

create-wp-react-app's Introduction

๐Ÿ†• ๐Ÿ”ฅ

create-wp-react-app

Create React WordPress plugin with no build configuration.


This CLI tool enables you to create a modern WordPress ReactJS plugin with no build configuration based on WP ReactJS Starter boilerplate with Babel, Webpack and more.

Installation

$ npm install -g create-wp-react-app

Create plugin

$ create-wp-react-app create my-plugin

generate cli

Usage

Usage: create-wp-react-app create [options] <slug>

Create a new WP plugin with the given plugin slug

Options:

  -r, --repository [repository]  The repository URL, default is https://github.com/matzeeable/wp-reactjs-starter
  -h, --help                     output usage information

The repository options allows you to build your own forked boilerplate based on the WP ReactJS Starter boilerplate. For example you can offer your plugin users to quick-start an Add-On. For example have a look at matzeeable/wp-real-media-library-add-on.

Extensibility

If you are using your own forked boilerplate you can create a build/create-wp-react-app.js file to modify the generation process.

prompts

This export function allows you to add an input field to the generation process (prompts). For this, listr-input tasks are used.

/**
 * Add the minimum required Real Media Library version to the prompts.
 */
exports.prompts = ({ task, pluginCwd, createInputTask }) => {
    task.add(createInputTask({
        name: 'Minimum Real Media Library version',
        key: 'minRML',
        defaultValue: '3.0.0'
    }));
};

phpFunctions

Pass a function name to the functions parameter so the wprjss is replaced with your defined name.

/**
 * Add the RML admin notice for the min required RML version.
 */
exports.phpFunctions = ({ functions }) => {
    functions.push('wprjss_skip_rml_admin_notice');
};

create-wp-react-app's People

Contributors

renovate-bot avatar

Watchers

luis jhoham venegas tobar avatar

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.