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
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,16 @@ Please use the [Kanban board](https://github.com/orgs/RSE-Sheffield/projects/19)
12
12
13
13
## Proposing changes
14
14
15
-
1.[Raise an issue](https://github.com/RSE-Sheffield/SORT/issues/new?template=Blank+issue) clearly describing the problem or user requirements;
16
-
2.[Create a branch](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-a-branch-for-an-issue) that is associated with that issue. It can be helpful to prefix the branch name to match the type of changes e.g. `feat/123-my-feature` for features or `docs/my-guide` for documentation, etc. See [Semantic branch names](https://damiandabrowski.medium.com/semantic-branch-names-and-commit-messages-3ac38a6fcbb6).
15
+
1.[Raise an issue](https://github.com/RSE-Sheffield/SORT/issues/new?template=Blank+issue) clearly describing the
16
+
problem or user requirements;
17
+
2.[Create a branch](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-a-branch-for-an-issue)
18
+
that is associated with that issue. It can be helpful to prefix the branch name to match the type of changes
19
+
e.g. `feat/123-my-feature` for features or `docs/my-guide` for documentation, etc.
20
+
See [Semantic branch names](https://damiandabrowski.medium.com/semantic-branch-names-and-commit-messages-3ac38a6fcbb6).
17
21
3. In that branch, make changes that aim to resolve that issue;
18
-
4. Create a [draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests) (PR) while the changes are being designed;
22
+
4. Create
23
+
a [draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests) (
24
+
PR) while the changes are being designed;
19
25
5. When ready, mark the PR "Ready for review" and request for reviewers to look at the proposed changes;
20
26
21
27
## Environments
@@ -25,6 +31,15 @@ There are two main environments:
25
31
- Development (the `dev` branch and the `sort-web-dev` virtual machine)
26
32
- Production (the `main` branch and the `sort-web-app` virtual machine)
27
33
34
+
### Local development environment
35
+
36
+
```bash
37
+
python -m venv .venv
38
+
source .venv/bin/activate
39
+
pip install --editable .
40
+
pip install -r requirements-dev.txt
41
+
```
42
+
28
43
## Change process
29
44
30
45
Any proposed changes should be proposed in pull requests that would be merged into the `dev` branch.
@@ -63,3 +78,7 @@ gitGraph
63
78
# Code of Conduct
64
79
65
80
We expect all contributors to follow the SORT [Code of Conduct](CODE_OF_CONDUCT.md).
81
+
82
+
# Testing
83
+
84
+
Please read the [testing documentation](docs/testing.md).
The SORT app uses some javascript components such as the survey configurator and the survey response form. This is
102
-
implemented using the svelte framework and vite is used as the bundler. Vite also provides a live server for
103
-
development which includes HMR (hot module reloading).
101
+
The SORT app uses some JavaScript components such as the survey configurator and the survey response form. This is
102
+
implemented using the svelte framework and vite is used as the bundler. [Vite](https://vite.dev/) also provides a live server for development which includes HMR (hot module reloading).
104
103
105
-
In order to integrate this into the html template, a tag library is created at `/home/templatetags/vite_integration.py`.
106
-
- The `vite_client` template tag is used to include Vite's HMR javascript code.
107
-
- The `vite_asset` tag is used to include asset files (e.g. typescript files) in the template.
108
-
- In debug mode, this creates a link directly to the vite dev server normally located at `http://localhost:5173`
109
-
- In production mode, it links to assets within the `/static/`url path.
104
+
In order to integrate this into the HTML template, a [custom template tag](https://docs.djangoproject.com/en/5.1/howto/custom-template-tags/) library is created at `/home/templatetags/vite_integration.py`.
105
+
- The `vite_client` template tag is used to include Vite's HMR JavaScript code.
106
+
- The `vite_asset` tag is used to include asset files (e.g. TypeScript files) in the template.
107
+
- In debug mode, this creates a link directly to the Vite dev server normally located at `http://localhost:5173`
108
+
- In production mode, the link changes to the location of the file in the `/static/`folder
110
109
110
+
For more information, please [read the README](ui-components/README.md).
111
+
112
+
## Installation
113
+
114
+
Install the JavaScript package using [`npm install`](https://docs.npmjs.com/cli/v8/commands/npm-install/)
115
+
116
+
```bash
117
+
npm install
118
+
```
119
+
120
+
## Usage
121
+
122
+
The development mode will run the test page at http://localhost:5173
123
+
124
+
```bash
125
+
npm run dev
126
+
```
111
127
112
128
## Before deployment
113
129
114
-
The script files within `/ui_components` must be built into the static folder before deployment. This
130
+
The script files within `./ui_components/` must be built into the static folder before deployment. This
Create dummy objects and fixtures for testing using [Factory Boy](https://factoryboy.readthedocs.io/en/stable/) which [supports the Django ORM](https://factoryboy.readthedocs.io/en/stable/orms.html#module-factory.django).
0 commit comments