Skip to content

Tool for generating common WordPress code from structured spec file.

License

Notifications You must be signed in to change notification settings

wpsk/wp-spec2code

Repository files navigation

wp-spec2code

Tool for generating common WordPress code from structured spec file.

Why should I use it?

Why not? DRY - Don't repeat yourself

Minimum requirements

Requirements are defined by the requirements of default adapters.

Do you need to work with earlier versions of PHP or WordPress? It is possible to implement adapters with lower requirements.

How does it work?

  • add wp-spec2code as a composer dependency
  • create spec file
  • run wp s2c gen
  • include s2c/vendor/autoload.php
  • init by Bootstrap::boot()
  • carry on with the rest of your project

Configuration file

Supported libraries (drivers)

  • native WordPress, ACF, metaxbox.io...

Plan for Contributor Day on WordCamp 2019 Bratislava (11.10.2019)

Config file reading

Code generation from templates

Autoloader wiring

Actions and filters

Future Improvements

  • create config file from existing WordPress installation
  • allow adapters to register themselves with factories
  • options for inclusion of third party composer dependencies required by adapters
    • add as a part of generated composer.json file in target folder
    • add to an existing compose.json file (in the root of your context or defined file as script argument)
    • print the required dependencies to the console (or composer require commands)

About

Tool for generating common WordPress code from structured spec file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages