216 lines
9 KiB
Markdown
216 lines
9 KiB
Markdown
# Contributing to SVGLayoutDesigner
|
|
|
|
First off, thank you for contributing to the project.
|
|
You will be able to navigate through this document with the table of contents.
|
|
|
|
# Table of contents
|
|
|
|
- [Contributing to SVGLayoutDesigner](#contributing-to-svglayoutdesigner)
|
|
- [Table of contents](#table-of-contents)
|
|
- [I want to contribute](#i-want-to-contribute)
|
|
- [I want to contribute to the .NETFramework API](#i-want-to-contribute-to-the-netframework-api)
|
|
- [Getting Started](#getting-started)
|
|
- [Before developing](#before-developing)
|
|
- [Testing](#testing)
|
|
- [Releasing](#releasing)
|
|
- [I want to contribute to the React component](#i-want-to-contribute-to-the-react-component)
|
|
- [Getting Started](#getting-started-1)
|
|
- [Before developing](#before-developing-1)
|
|
- [CORS](#cors)
|
|
- [Develop with Vite and pnpm](#develop-with-vite-and-pnpm)
|
|
- [Develop with mprocs](#develop-with-mprocs)
|
|
- [Testing the external API without .NETFramework or Windows](#testing-the-external-api-without-netframework-or-windows)
|
|
- [Setup debugging with chrome](#setup-debugging-with-chrome)
|
|
- [Testing](#testing-1)
|
|
- [Releasing](#releasing-1)
|
|
- [I want to report a bug](#i-want-to-report-a-bug)
|
|
- [Before submitting a bug report](#before-submitting-a-bug-report)
|
|
- [How do i submit a good bug report?](#how-do-i-submit-a-good-bug-report)
|
|
- [I want to suggest enhancements](#i-want-to-suggest-enhancements)
|
|
- [Before submitting an enhancement](#before-submitting-an-enhancement)
|
|
- [How do i submit a good enhancement suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
|
|
|
|
# I want to contribute
|
|
|
|
- Assign a `work item` in Azure DevOps to yourself and set it to `Work-in-progress`
|
|
- There are two main projects: the back-end API SVGLDLibs in .NETFramework and, the front-end SVGLD in Vite.
|
|
|
|
## I want to contribute to the .NETFramework API
|
|
|
|
### Getting Started
|
|
|
|
Requirements:
|
|
- `Windows` >= 10.x
|
|
- `MSBuildTools` >= 2017.x or `Visual Studio` >= 2017.x
|
|
- `dotnet` >= 6.x
|
|
|
|
Anything below is not officially supported.
|
|
|
|
### Before developing
|
|
|
|
- Make sure you have an existing work item
|
|
- Create a new branch for the new API
|
|
- Push the branch
|
|
- Create a pull request
|
|
- Link the work item to the pull request
|
|
|
|
### Testing
|
|
|
|
SVGLDLibs is a set of models and does not run anything.
|
|
Any API must be build from scratch by the end-user.
|
|
|
|
In order to test the models, the project SVGLDWebAPI was created.
|
|
|
|
- Make sure the dll is compiling with `pnpm build:dotnet`
|
|
- Update SVGLDWebAPI with new or updated models
|
|
- After that run `pnpm test:full`
|
|
|
|
### Releasing
|
|
|
|
When the tests are valids and the feature is ready to deploy, please update the version by following the versioning method in [RELEASING.md](RELEASING.md).
|
|
|
|
Updating the API is usually a breaking change, so most of the time, the major version will change. So please, create a release candidate branch (or tag if merged on master).
|
|
|
|
|
|
## I want to contribute to the React component
|
|
|
|
### Getting Started
|
|
|
|
If you are new to React and Node.js, please install these tools:
|
|
|
|
- A chromium-based browser (`chromium`, `chrome`, `edge`, `brave`, `vivaldi`).
|
|
- [VSCode](https://code.visualstudio.com/)
|
|
- [pnpm](https://pnpm.io/)
|
|
- [React DevTools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi)
|
|
- [Typescript React code snippets](https://marketplace.visualstudio.com/items?itemName=infeng.vscode-react-typescript)
|
|
- [vscode-tailwindcss](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
|
|
- [vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
- [vscode-drawio](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio)
|
|
|
|
### Before developing
|
|
|
|
- Make sure you have an existing work item
|
|
- Create a new branch for the new feature
|
|
- Push the branch
|
|
- Create a pull request
|
|
- Link the work item to the pull request
|
|
- Copy the `.env.development` to `.env.development.local`
|
|
- Update `.env.development.local` urls to the test server `http://localhost:5000` or `https://localhost/SmartMenuiserieTemplate`
|
|
|
|
### CORS
|
|
|
|
If you are getting CORS or HTTPS related error, please access the test server with your browser to allow the access to the unsecure website.
|
|
|
|
### Develop with Vite and pnpm
|
|
|
|
Install the dependencies :
|
|
|
|
```
|
|
pnpm i
|
|
```
|
|
|
|
Then run the following command to run the projet in a dev environment:
|
|
|
|
```
|
|
pnpm dev
|
|
```
|
|
|
|
### Develop with mprocs
|
|
|
|
[Mprocs](https://github.com/pvolok/mprocs) runs multiple commands in parallel and shows output of each command separately.
|
|
|
|
It is useful to run `vite` and the test server at the same time with `mprocs`.
|
|
|
|
Run `pnpm d` or `pnpm mprocs` to run mprocs.
|
|
|
|
### Testing the external API without .NETFramework or Windows
|
|
|
|
Use the Node.js server in `/test-server` to simulate the api.
|
|
|
|
```bash
|
|
node run ./test-server/http.js
|
|
```
|
|
|
|
The web server will be running at `http://localhost:5000`
|
|
|
|
### Setup debugging with chrome
|
|
|
|
Inside `.vscode/settings.json`, set the following :
|
|
|
|
```json
|
|
{
|
|
// Use IntelliSense to learn about possible attributes.
|
|
// Hover to view descriptions of existing attributes.
|
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"type": "chrome",
|
|
"request": "launch",
|
|
"name": "Launch Chrome against localhost",
|
|
"url": "http://localhost:5173",
|
|
"webRoot": "${workspaceFolder}",
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
Change the `url` to the dev server url. Additionally, set the `runtimeExecutable` to your favorite chromium browser.
|
|
|
|
### Testing
|
|
|
|
Run `pnpm test` to test.
|
|
|
|
### Releasing
|
|
|
|
When the tests are valids and the feature is ready to deploy, please update the version by following the versioning method in [RELEASING.md](RELEASING.md).
|
|
|
|
|
|
# I want to report a bug
|
|
|
|
## Before submitting a bug report
|
|
|
|
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
|
|
|
|
- Make sure that you are using the last version for both the project `svg-layout-designer` and the API `SVGLDLibs`
|
|
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
|
|
- Determine if your bug is really a bug and not an error on your side e.g. e.g. using incompatible environment components/versions.
|
|
- Make sure you have read the [documentation](docs/%23Project/Home.md).
|
|
- Make sure the issue is not already duplicated or solved in [the issue list](https://dev.azure.com/techformsa/SmartConfigurator/_backlogs/backlog/SmartConfigurator%20Team/Epics/?workitem=7092)
|
|
- Make sure to search the internet
|
|
|
|
Collect the information about the bug:
|
|
- Stack trace
|
|
- OS, Platform and Version (`Windows`, `Linux`, `macOS`, `x86`, `arm`)
|
|
- Browser and version (`Chrome`, `Chromium`, `Firefox` and any chromium and gecko based browsers)
|
|
|
|
## How do i submit a good bug report?
|
|
|
|
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <enguyen@techform.fr>.
|
|
|
|
- Open an [Issue](https://dev.azure.com/techformsa/SmartConfigurator/_backlogs/backlog/SmartConfigurator%20Team/Epics/?workitem=7763)
|
|
- Explain the behavior you would expect and the actual behavior
|
|
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
|
|
- Provide the information you collected in the previous section.
|
|
|
|
Once it's filed:
|
|
|
|
- The project team will assign the bug accordingly
|
|
- If the team is not able to reproduce the issue, more information will be asked
|
|
- If the team is able to reproduce the issue, it will be marked `TODO`
|
|
|
|
# I want to suggest enhancements
|
|
|
|
## Before submitting an enhancement
|
|
|
|
- Make sure you are using the latest version
|
|
- Read the [documentation](docs/%23Project/Home.md) carefully and find out if the functionality is already covered, maybe by an individual configuration.
|
|
|
|
## How do i submit a good enhancement suggestion?
|
|
|
|
- Use a **clear and descriptive title** for the issue to identify the suggestion.
|
|
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
|
|
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
|
|
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to
|
|
- **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
|
|
- Use Azure DevOps to add the new feature request under the [epic](https://dev.azure.com/techformsa/SmartConfigurator/_backlogs/backlog/SmartConfigurator%20Team/Epics/?workitem=7092).
|