You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,55 @@ If you want to help improve Craft’s translations, [sign up to be a translator]
67
67
68
68
If you would like to work on a new core feature or improvement, first create a [GitHub issue](https://github.com/craftcms/cms/issues) for it if there’s not one already. As much as we appreciate community contributions, we are pretty selective about which sorts of features should make it into Craft itself rather than a plugin, so don’t take it the wrong way if we advise you to pursue the idea as a plugin instead.
69
69
70
+
## Control Panel Front End
71
+
72
+
In order to work on the control panel front end, we recommend opening two terminal windows.
73
+
74
+
1. Run `npm run dev` in one window to start the Vite development server.
75
+
2. Run `npm run dev:cp` in the other window to start the Vite process for the `@craftcms/cp` package.
76
+
77
+
With both processes running, you'll be able to work on most aspects of the control panel.
78
+
79
+
If getting into the weeds is your thing, more detail on these pieces is provided below.
80
+
81
+
### Control Panel Assets
82
+
83
+
The assets specific to the control panel live in the `resources` folder. Those are built using a fairly typical Vite setup. To develop assets for the control panel, there are two commands:
84
+
```shell
85
+
# Run the Vite development server
86
+
npm run dev
87
+
88
+
# Build assets for production
89
+
npm run build
90
+
```
91
+
92
+
### `@craftcms/cp` package
93
+
94
+
The control panel is largely backed by web components that live in the `@craftcms/cp` package within the `packages/craftcms-cp` directory. Like other packages, it has its own build process that can be run independently of the control panel.
95
+
```shell
96
+
# Run the build in watch mode. Assets will be rebuilt on every change
97
+
npm run dev:cp
98
+
99
+
# Run the build for production
100
+
npm run build:cp
101
+
```
102
+
103
+
In practice, you rarely work on one without the other, so we recommend having two terminal panes open. One running the main control panel assets build and another building the web components.
104
+
105
+
### Legacy Bundles
106
+
107
+
> [!NOTE]
108
+
> Updating the legacy bundles should be a rare occurrence. Avoid when possible.
109
+
110
+
All the styles and scripts used to support the control panel up until Craft 5 live in the [yii2-adapter](https://github.com/craftcms/yii2-adapter) package. That package has its own NPM dependencies and build process, but because it's common to have that package symlinked into your Craft 6 project, you're able to run the build scripts via the `build:bundles` command.
111
+
```sh
112
+
# Build assets for production
113
+
npm run build:bundles
114
+
115
+
# Run dev server to develop a specific package
116
+
npm run dev:bundles -- -- --config-name=cp
117
+
```
118
+
70
119
## Pull Requests
71
120
72
121
Pull requests should clearly describe the problem and solution. Include the relevant issue number if there is one. If the pull request fixes a bug, it should include a new test case that demonstrates the issue, if possible.
0 commit comments