Root
Here is a complete list of all available files and folders in the root directory with a short description.
You don't need to know the contents of each file individually, as you will learn what they do over time. Just make sure you understand what you are responsible for (see the links). In addition, folders/files marked with a prefixed π‘ are important for getting started (that means, learn more about it).
All files and folders written in italics are not saved in Git, but automatically arranged when you develop or deploy the projects.
Don't give up too early, because it can take a while until you find your way in the modern (WordPress plugin) development!
Folder structure
π
my-pluginFolder you created withcreate-wp-react-app create-workspaceπ
coverageCoverage reports, see thisπ
commonCommon files can be reused by plugins and packages, or are root specificπ
create-wp-react-appTemplates or new plugins created withcreate-wp-react-app, but you can ignore it - just commit it to your repositoryπ
patch-packageSee patch-package packageπ
.env-defaultDefault values for environment variables which are used in Docker Composeπ
.eslintrcESLint configuration fileπ
generate-launch-json.tsDynamically createlaunch.jsonfile with all available plugins and packages (used for PHP debugging)π
Gruntfile.plugin.tsPredefined tasks for Grunt (only plugin, e. g. build a plugin)π
Gruntfile.tsPredefined tasks for Grunt (packages and plugins)π
hookdoc.jsonConfiguration file for wp-hookdoc, used inyarn docs:hooksπ
jest.base.jsBase Jest configuration fileπ
phpcs.xmlBase PHP CodeSniffer configuration fileπ
phpunit.base.phpBase PHPUnit bootstrap fileπ π‘
tsconfig.jsonBase TypeScript configuration fileπ
vuepress-php.tsphpDocumentor VuePress theme configuration file, used inyarn docs:phpπ π‘
webpack.factory.tsBase webpack configuration file for plugins, see hereπ
webpack.multi.tsMulti-package configuration foryarn docker:start
π
devopsFiles related to CI/CD, Docker and so onπ
.gitlabCI/CD predefined jobs, included in root.gitlab-ci.ymlπ
stage-containerize.ymlJobs for building and pushing docker files to GitLab container registryπ
stage-build.ymlJobs for build plugin, docs and lintingπ
stage-release.ymlJobs for release, review applications and wordpress.org deploymentπ
stage-test.ymlJobs for testsπ
stage-validate.ymlJobs for Docker garbage collection, semantic versioning and license scanner
π
dockerPredefined docker imagesπ
gitlab-ciDockerfile used in GitLab CI/CD jobs
π
docker-composeCompose files for different contextsπ
docker-compose.e2e.ymlUsed in Cypress E2E testsπ
docker-compose.local.ymlUsed locally with port exposeπ
docker-compose.traefik.ymlUsed for Review Appsπ
docker-compose.ymlBase compose file, merged automatically with{plugins,packages}/*/devops/docker-compose/docker-compose.ymlfiles for extensibility, see here
π
scriptsUsed in Docker containers (mounted)π
container-wordpress-cli-entrypoint.shExtended entrypoint forwordpress-cliserviceπ
container-wordpress-command.shCommand forwordpressserviceπ
e2e-tests-autologin-plugin.phpMicro-plugin for automatic login via URL in WordPress for E2E testsπ
lerna-ready-ci.shMakelernawork in GitLab CI environmentπ
purge-ci.shPurge Socker resources for E2E tests and Review Apps in CI/CDπ
task-xdebug-start.shUsed intasks.jsonfile, starts XDebug in WordPress containerπ
task-xdebug-stop.shUsed intasks.jsonfile, stops XDebug in WordPress containerπ π‘
wordpress-startup.shGlobal bash script to for custom actions not specific to single plugins, which get executed in start of the WordPress Docker container
π
docsDocumentation you currently read available as markdown filesπ
node_modulesNode dependenciesπ
packagesNon-plugin packages (e.g. for shared styles)π
utilsPredefined utils package coming withcreate-wp-react-app create-workspaceπ
devopsFiles related to CI/CD, Docker and so on for this specific packageπ
.gitlabπ
.gitab-ci.ymlCI/CD similar root file, included in root.gitlab-ci.ymlπ
stage-build.ymlPredefined jobs for lint, included in./.gitlab-ci.ymlπ
stage-test.ymlJobs for testsπ
stage-validate.ymlJobs for license scanner
π
languagesLanguages files for this packageπ
backendServer-side language filesπ
utils.potLanguage file can be translated with Poedit
π
frontendClient-side language filesπ
utils.potLanguage file can be translated with Poedit
π
libTypeScript coding you will consume in your dependentsπ
componentsPredefined ReactJS componentsπ
factoryFactory functions (pass arguments, get dynamic functions)π π
ajax.tsxAJAX related functions (e. g. do WP REST API calls)π π‘
context.tsxReact Context helpersπ π‘
i18n.tsx__()and so on for your client-side translations (uses@wordpress/i18n)π
index.tsxExport all files from this folder
π
typesAdditional declaration filesπ
global.d.tsAvoid errors on plain JS packages (see this)
π
wp-apiPredefined WP REST API typesπ
index.tsxExport all files from this folderπ
rest.plugin.get.tsxTypes forwp-json/your-plugin/plugin
π
helpers.tsxSome helper functionsπ
index.tsxExport all files from this folderπ π‘
options.tsxBase options class ofsrc/inc/base/Assets.phpoutput
π
scriptsScripts related to developmentπ π‘
Gruntfile.tsGruntfile for this package, extendscommon/Gruntfile.ts
π
srcPHP coding you will consume in your dependentsπ π‘
Activator.phpAbstract trait for activate, deactivate and install actionsπ π‘
Assets.phpAbstract trait for assets managementπ π‘
Base.phpAbstract base traitπ π‘
Core.phpAbstract core trait for main initialization of namespacing and so on, similar to the well-knownfunctions.phpπ π‘
PluginReceiver.phpAbstract trait for package developmentπ π‘
Localization.phpAbstract trait for i18n functionalityπ π‘
Service.phpFinal class for boilerplate related endpointsπ π‘
PackageLocalization.phpExtends from Localization class and is a helper class for package localization
π
node_modulesNode dependenciesπ
testπ
jestPut all your Jest tests hereπ
phpunitPut all your PHPUnit tests hereπ
jest.config.jsJest configuration fileπ
jest.setup.jsJest setup fileπ
patchwork.jsonPatchwork configuration fileπ
phpunit.bootstrap.phpPHPUnit bootstrap fileπ
phpunit.xdebug.phpPHPUnit + [XDebug filtering]((https://xdebug.org/docs/code_coverage)) for faster code coverage analysisπ
phpunit.xmlPHPUnit configuration file
π
CHANGELOG.mdConventional changelog outputπ
composer.jsonComposer configuration fileπ
composer.lockComposer lock fileπ
LICENSEPackage license fileπ
LICENSE_3RD_PARTY_JS.mdYarn dependencies disclaimer, see License checkerπ
LICENSE_3RD_PARTY_PHP.mdComposer dependencies disclaimer, see License checkerπ
package.jsonPackage definition fileπ
README.md"Because no one can read your mind (yet)" - makeareadme.comπ
tsconfig.jsonTypeScript configuration file, extendscommon/tsconfig.json
π π‘
pluginsSee Plugin folder structureπ
.gitignoreIgnore files in your Git repository on commit (see this)π π‘
.gitlab-ci.ymlCI/CD root file, should include all{packages,plugins}/*/devops/.gitlab/.gitlab-ci.ymlfilesπ
.prettierignoreIgnore files to be prettified (see this)π
package.jsonPackage definition file with Yarn Workspace definitionπ
README.md"Because no one can read your mind (yet)" - makeareadme.comπ
yarn.lockLock file for JavaScript dependencies
Last updated