Development
You develop an Eddy extension against a real Drupal site. The build assembles a Drupal codebase in the build directory and links your extension into it. It then serves the codebase with PHP's built-in webserver and installs Drupal on an SQLite database. The site runs on the PHP and Composer of your machine, and CI builds it the same way. The browser of FunctionalJavascript tests runs on your machine too, unless you pick a Selenium container (see FunctionalJavascript tests).
This section covers the commands you use every day, how the build works and how to change what it does.
Commands at a glance
Run each command through the wrapper you kept, such as make build or ahoy build. The following table lists the commands:
| Command | What it does | Aliases |
|---|---|---|
build | Runs assemble, start and provision. | None |
assemble | Checks the project and stops a running webserver, then assembles the codebase in build and links the extension into it. | None |
start | Starts or restarts the PHP webserver, without XDebug unless XDEBUG is set. | debug-off, xdebug-off |
stop | Stops the webserver. | None |
provision | Installs Drupal with the extension enabled. | None |
info | Prints a read-only summary of the environment. | describe |
debug | Starts the webserver with XDebug, or restarts it with XDebug when it runs without. Does nothing while XDebug is on. | debug-on, xdebug, xdebug-on |
drush | Runs a Drush command against the site. | None |
login | Prints a one-time login link. | None |
lint | Checks coding standards. | None |
lint-fix | Fixes what the linters can fix. | None |
test | Starts the FunctionalJavascript browser and leaves it running, then runs every PHPUnit suite and the Jest tests. | None |
test-unit | Runs the PHPUnit Unit suite. | None |
test-kernel | Runs the PHPUnit Kernel suite. | None |
test-functional | Runs the PHPUnit Functional suite. | None |
test-functional-javascript | Starts the browser and leaves it running, then runs the PHPUnit FunctionalJavascript suite. | None |
test-javascript | Runs the Jest tests. | test-js |
browser-start | Starts the browser for FunctionalJavascript tests. | None |
browser-stop | Stops that browser. | None |
reset | Stops the webserver and the browser, and removes build, .logs and vendor. | delete, destroy |
tooling | Installs the tooling package into vendor. Make has this command and runs it before the commands that need it. Ahoy installs the package before every command apart from reset. | None |
The installer removes the commands of each tool you dropped, so a project without PHPUnit has no suite commands. lint, lint-fix and test stay and run the tools you kept. A bare make runs build, so run make help to list the make commands. A bare ahoy lists the Ahoy ones.
Without a wrapper, the tooling commands cover assemble, start, stop, provision, info, login, browser-start and browser-stop. The CONTRIBUTING.md of your extension lists the commands for the rest.
In this section
- Build the site - the steps of
buildand how to see the full output. - Tooling package - where the commands come from and how to change one.
- Drupal versions - building another Drupal release, and how the build picks versions.
- Dependencies - patches, suggested extensions, frontend packages and GitHub rate limits.
- Provision the site - the install profile, the database, Drush and login links.
- Webserver - the URL, the port and how projects share a machine.
- Lifecycle scripts - your own steps in each phase.
- Bundled extensions - a module in your theme or a theme in your module, for the site or for your tests.
- Public tunnel - reaching the site from outside your machine.
- Debug your extension - XDebug, command output and logs.
- Coding standards - the linters and how to fix what they report.
- Environment variables - every variable the commands read.