Skip to content

Commit dca220a

Browse files
ferraraferFilledStacks
authored andcommitted
Update Stacked Config section
1 parent 8009f54 commit dca220a

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

docs/tooling/stacked-cli.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -244,35 +244,45 @@ Now if you run `stacked create dialog error` you'll see that all the files are g
244244

245245
If you want to use `stacked_cli` in a package that doesn't fit the structure that the CLI expects, then you can configure Stacked to look in the correct places. Create a new file in the root folder of your package called `stacked.json`. Inside the file, create a JSON body with the following properties:
246246

247-
- `views_path`: The relative path where Views and ViewModels will be generated. Default: `ui/views`.
248-
- `services_path`: The relative path where Services will be generated. Default: `services`.
249-
- `bottom_sheets_path`: The relative path where BottomSheets will be generated. Default: `ui/bottom_sheets`.
250-
- `dialogs_path`: The relative path where Dialogs will be generated. Default: `ui/dialogs`.
251-
- `stacked_app_path`: The relative path to the file that contains the `StackedApp` setup. Default: `app/app.dart`.
252-
- `test_helpers_path`: The relative path to the file that contains the test_helpers (mocks, registerService, etc). Default: `helpers/test_helpers.dart`.
253-
- `test_services_path`: The relative path to where the Services' unit tests will be generated. Default: `services`.
254-
- `test_views_path`: The relative path to where the ViewModels' unit tests will be generated. Default: `viewmodels`.
255-
- `locator_name`: The name of the locator that Services are registered with. This is used when creating a new Service using the `create service` command. Default: `locator`.
256-
- `register_mocks_function`: The name of the function that registers all the Mocks when running a test. This is used when generating a test file during `create service` command. Default: `registerServices`.
247+
| Property | Description |
248+
| -------- | ----------- |
249+
| bottom_sheets_path | The path where BottomSheets will be generated. |
250+
| dialogs_sheets_path | The path where Dialogs will be generated. |
251+
| line_length | Passed into the Flutter formatter when running CLI commands. |
252+
| locator_name | The name of the locator that Services are registered with. This is used when creating a new Service using the `create service` command. |
253+
| prefer_web | Determines to use or not web template when no template argument is passed. |
254+
| register_mocks_function | The name of the function that registers all the Mocks when running a test. This is used when generating a test file during `create service` command. |
255+
| services_path | The path where Services will be generated. |
256+
| stacked_app_file_path | The path to the file that contains the `StackedApp` setup. |
257+
| test_helpers_file_path | The path to the file that contains the test helpers (mocks, registerService, etc). |
258+
| test_services_path | The path where the unit tests of the Services will be generated. |
259+
| test_views_path | The path where the unit tests of the ViewModels will be generated. |
260+
| test_widgets_path | The path where the unit tests of the Widgets will be generated. |
261+
| v1 | Indicates whether you want to use ViewModelBuilder (v1) or StackedView (v2). |
262+
| views_path | The path where Views and ViewModels will be generated. |
263+
| widgets_path | The path where Widgets and WidgetModels will be generated. |
257264

258265
Only include the paths you want to customize. If you exclude a path, the default value will be used for it.
259266

260-
### Example
267+
### Default Stacked configuration
261268

262269
```json
263270
{
264-
"stacked_app_file_path" : "app/app.dart",
265-
"services_path" : "services",
266-
"views_path" : "ui/views",
267271
"bottom_sheets_path": "ui/bottom_sheets",
268272
"dialogs_path": "ui/dialogs",
269-
"test_helpers_file_path" : "helpers/test_helpers.dart",
270-
"test_services_path" : "services",
271-
"test_views_path" : "viewmodels",
272-
"locator_name" : "locator",
273-
"register_mocks_function" : "registerServices",
274-
"v1": false, // Indicates whether you want to use ViewModelBuilder(v1) or the the new StackedView (v2)
275-
"line_length": 80 // Passed into the flutter formatter when running CLI commands
273+
"line_length": 80,
274+
"locator_name": "locator",
275+
"prefer_web": true,
276+
"register_mocks_function": "registerServices",
277+
"services_path": "services",
278+
"stacked_app_file_path": "app/app.dart",
279+
"test_helpers_file_path": "helpers/test_helpers.dart",
280+
"test_services_path": "services",
281+
"test_views_path": "viewmodels",
282+
"test_widgets_path": "widget_models",
283+
"v1": false,
284+
"views_path": "ui/views",
285+
"widgets_path": "ui/widgets/common"
276286
}
277287
```
278288

0 commit comments

Comments
 (0)