Customizing the Path for New Boards

The boardsPath configuration key for codux.config.json lets you define the relative path for storing new board files in your project.

boardsPath 

  • Description: Default directory for new boards, relative to the project root.
  • Type: String
  • Default: "src/_codux/boards"
When you create a new board in Codux, the default relative path for the new board file is src/_codux/boards, followed by a subfolder with the name of the component. The naming convention follows the kebab naming convention unless configured otherwise. For example, the relative path for the new board file in the image below is src/_codux/boards/new-board.board.tsx.
Codux pop-up with options for creating a new board.
To change this path, configure codux.config.json with the boardsPath key like this:
1
2
3
4
{  
    "$schema": "https://wixplosives.github.io/codux-config-schema/codux.config.schema.json",
    "boardsPath": "src/components"
}  
For information on setting a path for board templates, refer here.

A Note on Monorepos 

Monorepos are repositories that have more than one project in them. In a monorepo project, you can expect to see a hierarchical directory structure like this:

├── my-monorepo
│ ├── first-package
│ │ ├── src
│ │ │├── components
│ │ │ │├── button
│ ├── second-package
│ │ ├── src
│ │ │├── components
│ │ │ │├── checkbox

Codux takes into account the hierarchy of the monorepo containing the component that you're creating a new board for, and suggests a new path for the board accordingly. For example, the suggested path for a new board belonging to the button component shown in the hierarchy above would be src/components/button, while the suggested path for the checkbox component's new board would be src/components/checkbox.