Most of the code you write will go in the
app/features folder. Each folder within represents a discrete feature for your app where you can group related code together The same principle that applies when organizing your kitchen -- keep related tools together -- will help you organize and understand your code over the long run.
Features can be enabled or disabled at any time by editing
app/config/app.js and modifying the
features object. This can be helpful when you don't need to use certain Nodewood features for your application, or to use a feature flag to disable certain features in production.
# Creating a new feature
From the root of your project, run
nodewood add feature NAME. This will create a new feature in
app/features/NAME and fill it with examples of Controllers, Services, Vue Pages, etc. It will also create a migration in
app/migrations. These examples all work together such that the default Page for the feature will load the list of entities from the database over the API and display them in a table. Obviously your needs will be different, but you can customize your feature from here.
# No examples
If you don't want examples for your feature, you can append
--no-examples to your command, and the feature will be created with just the empty default folders.
# Overwriting existing features
By default, a feature will not be created in a feature folder that already exists. If you want to overwrite that existing folder (careful!), append
--overwrite to your command.
# Custom plurals
Nodewood will attempt to automatically determine the plural for your feature name for the appropriate files, but that can fail hilariously on certain words. To provide a custom plural for your feature, append
PLURAL will be used for the plural form of your feature's name.