- The framework offers a very modular way of structuring your files within your application, the only restriction is that they must be included in the src/ folder as this represents level 0 of your application (also called root directory). -
-
- This folder contains the files needed to start the application.
- You will find the index, the entry point of the application which initializes the application.
-
- Providers are files that have certain methods defined in advance.
- You can create them at will as long as they are built in the following way :
-
- These files are read first, even before the recovery of the command files, events... - It can be very interesting to use them to record a default behaviour before the application is ready to run. -
-- A concrete example would be the console display of the files instantiated in your application : -
-- The context object collects the various file types in your application -
-
- The src/ folder is the base folder for your project.
- This is where you will work.
- Please consider this folder as the root of your application.
-
- The advantage of considering the src/ folder as the base of your application is that you can structure it as you see fit.
- It can be interesting to look at design patterns, here are some of them :
-
- Please use the factory make:file command to create a file quickly
-
- The src/ folder is the base folder for your project.
- To simplify the import of your files, the alias App/ is available.
- This alias refers to the root folder src/.
-
- It is very important to test your code using unit tests for small features or integration tests for large features.
- his folder allows you to write tests on files named foo.spec.ts.
- The default test framework used in the Discord Factory framework is ava but you can replace it with any other.
-
- The strict minimum code is as follows : -
-- Then you can use the followed command to run your tests : -
-or
-