Create Package
Creating new packages is extremely simple, and done via the package create CLI command. Simply pass the command the alias of the new package, for example to create a package named "my-shop" you would run the command:
apex package create my-shop
The resulting message will state the package has been successfully created along with several new directories which are explained below.
Directory | Description |
---|---|
/etc/<PACKAGE>/ | Package configuration files including database migrations. |
/src/<PACKAGE>/ | Source code files of the package. |
/tests/<PACKAGE>/ | Unit tests for the package. |
/docs/<PACKAGE>/ | Documentation for the package in markdown format |
Aside from the /etc/ directory, the other three directories are blank providing you with a blank canvas to develop in any style and design you wish. There are various tools available to aide in development, but are all optional and by no means required.
/etc/ Configuration Directory
The newly created /etc/<PACKAGE>/ directory contains a blank /Migrations/ directory plus the following files:
File | Descriptionn |
---|---|
install.sql | Contains the SQL code that is executed during package installation. |
migrate.php | The PHP class for the initial database migration. See Package Installation Migration for details. |
package.yml | The main configuration file of the package itself as explained in the next chapter. |
registry.yml | Contains items that are global in scope but registered to this package such as views and HTTP controllers. See Package Registry page for more detailt. |
remove.sql | Contains the SQL code that is executed when package is removed. |
reset.sql | Contains the SQL code that is executed when the package is reset. |