tekta
v1.2.2
Published
Generates and udpates WordPress plugins using the Tekta framework
Downloads
12
Maintainers
Readme
generator-tekta
Generates (or regenerates) structure for a WordPress plugin, using the Tekta framework.
Installation
# npm
npm install -g tekta
# yarn
yarn global add tekta
- Generate your new project:
mkdir my-new-plugin
cd my-new-plugin
tekta
Usage
The first time you run tekta
in a directory, it will walk you through the
plugin scaffolding process, asking you questions, and generating a plugin.
Your answers are written out to a file called tekta.json
. Keep this. Check it
into your plugin's Git repo. This stores all the information that Tekta knows
about your plugin.
If you want to change your answers and re-generate the plugin framework, you can
run tekta --ask-answered
or you can just edit the tekta.json
file and run
tekta
again.
Note: most files within the app/
diretory will only be generated if they
do not exist, so if you do something like change the namespace of your plugin,
it will not be updated here. To regenerate those files, you can just delete (or
move aside) the app/
directory and re-run tekta
.
If a run of tekta
is going to edit files (which it will, if Tekta has been
updated or if you changed anything in tekta.json
), it will prompt you for each
change. You can press d
to see the diff of changes, and y
(or just return
)
to accept the change. If you want to blindly apply the changes, you can run
tekta --force
.
Structure
├── LICENSE * # Your license file.
├── app # Your app directory.
│ ├── Plugin.php # Your main plugin file.
│ ├── functions.php # A place for namespaced helper functions.
│ └── setup.php # For things like plugin activation hooks.
├── index.php * # Your plugin entry file.
├── lib # Library files.
│ ├── Tekta * # Tekta support files.
│ └── Mozart * # Namespaced Mozart (Composer) packages.
├── load.php * # Bootstrap file for your plugin.
└── tekta.json # Tekta configuration.
* = do not edit
Anything marked with a *
should never be edited. These files and directories
are auto-generated every time you run tekta
.
License
MIT © Mark Jaquith