Add Release protocol

This commit is contained in:
Eric NGUYEN 2022-11-21 16:41:48 +01:00
parent 58a881c813
commit a442ffa144
8 changed files with 318 additions and 114 deletions

View file

@ -1,3 +1,7 @@
**/*.md
/csharp
/dist /dist
/docs
/public /public
/src/dts /src/dts

196
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,196 @@
# 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)
- [I want to contribute to the React component](#i-want-to-contribute-to-the-react-component)
- [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
```
### 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.
Please use Azure DevOps and add new feature request under the [epic](https://dev.azure.com/techformsa/SmartConfigurator/_backlogs/backlog/SmartConfigurator%20Team/Epics/?workitem=7092).

116
README.md
View file

@ -1,121 +1,27 @@
# SVG Layout Designer React # SVG Layout Designer React
[![Build Status](https://dev.azure.com/enguyen0660/SVGLayoutDesignerReact/_apis/build/status/SVGLayoutDesignerReact?branchName=dev)](https://dev.azure.com/enguyen0660/SVGLayoutDesignerReact/_build/latest?definitionId=4&branchName=dev) [![Build Status](https://dev.azure.com/enguyen0660/SVGLayoutDesignerReact/_apis/build/status/SVGLayoutDesignerReact?branchName=master)](https://dev.azure.com/techformsa/SVGLayoutDesignerReact/_build/latest?definitionId=4&branchName=master)
An svg layout designer. An svg layout designer.
# Getting Started # Getting Started
Requirements : Install these dependancies :
- `node` >= 16.x (>= 17.x to run vitest tests)
- `npm` (included with node) - [`node`](https://nodejs.org/en/) >= 18.x
- [`dotnet`](https://dotnet.microsoft.com/en-us/download/visual-studio-sdks) >= 6.x (optional) used for api test
- [`git-lfs`](https://git-lfs.github.com/) (in order to clone the documentation) - [`git-lfs`](https://git-lfs.github.com/) (in order to clone the documentation)
- `dotnet` (optional) used for api test
# Test the project
# Recommanded tools for developers Test the project with these commands :
- [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)
# Develop
Run `npm i`
Run `npm run dev`
# Deploy
Run `npm i`
Run `npm run build`
# Run the tests
Run `npm i`
Run `npm test`
Or run `npm test:full` to also test the C# API
# API
You can preload a state by setting the `state` URL parameter
with a url address to a `state.json` file.
Example: `http://localhost:4000/?state=http://localhost:5000/state.json`
# Testing the external API
This program fetch the data structure from others applications, allowing it to assemble them later.
```bash
node run ./test-server/http.js
```
The web server will be running at `http://localhost:5000`
Copy `.env.development` to the file `.env.development.local`
and change the url to whatever you want to use.
# 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. Set the `runtimeExecutable` to your favorite chromium browser.
# Generate definition files for SmartModeler
Prerequisites: `typescript`, `python3`
Go to the `src/dts` directory and run the following command
``` ```
npx tsc --project tsconfig.dts.json npm i
npm run dev
``` ```
Or if installed globally # Contributing
``` If you want to contribute to the project, please read [CONTRIBUTING.md](CONTRIBUTING.md)
tsc --project tsconfig.dts.json
```
Then, run `python3` (or `py` on Windows) on `generate_dts.py`:
```
python3 generate_dts.py SVGLD svgld.d.ts
```
A definition will be generated as `svgld.d.ts` with the namespace `SVGLD`.

64
RELEASING.md Normal file
View file

@ -0,0 +1,64 @@
# Versioning
Le projet utilise [la méthode sémantique de version](https://semver.org/lang/fr/).
> Étant donné un numéro de version MAJEUR.MINEUR.CORRECTIF, il faut incrémenter :
>
> 1. le numéro de version MAJEUR quand il y a des changements non rétrocompatibles,
> 1. le numéro de version MINEUR quand il y a des ajouts de fonctionnalités rétrocompatibles,
> 1. le numéro de version de CORRECTIF quand il y a des corrections danomalies rétrocompatibles.
>
> Des libellés supplémentaires peuvent être ajoutés pour les versions de pré-livraison et pour des méta-données de construction sous forme dextension du format MAJEURE.MINEURE.CORRECTIF.
Ainsi nous utilerons le format `MAJOR.MINOR.PATCH` pour nos versions.
Le libellé supplémentaire sera le suffixe `-rcX` pour les version en pré-release (release candidate).
Examples de noms de versions valides: `1.0.0`, `1.0.1`, `1.1.0`, `2.0.0`, `2.0-rc1`, `2.0-rc2` .
Un example réel: https://kernel.org/
# `package.json`
La version courante complète est indiquée dans le `package.json`.
En utilisant `npm`, on peut facilement mettre à jour ce nombre :
```
npm version major
npm version minor
npm version patch
```
# Git
Chaque version est tag par git sur la branche master.
Pour tag :
```
git tag -a v1.0.0 -m "Release v1.0.0"
```
Pour pousser les modifications puis les tags :
```
git push origin master
git push origin master --tags
```
Ou pour faire les deux en même temps
```
git push origin master --follow-tags
```
Si vous êtes sur une branche autre que `master`, veuillez **NE PAS TAG**. Si vous voulez versionner la branche, créez une branche avec la version dans le nom : `v1.1-rc1`.
# Azure Pipeline
Les tests d'Azure Pipeline sont lancés à condition que le nom de la branche soit `master` ou soit préfixée par la lettre `v`
Exemples: `master`, `v1.0.2`, `v1.0-rc1`, `v1.0.1-mafeature` etc.

View file

@ -5,9 +5,7 @@
trigger: trigger:
- master - master
- dev - v*
- dev*
- 0.*
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
@ -33,19 +31,25 @@ steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '16.x' versionSpec: '18.x'
displayName: 'Install Node.js 16.x LTS' displayName: 'Install Node.js 18.x LTS'
- bash: | - bash: |
set -euo pipefail set -euo pipefail
node --version node --version
node ./test-server/http.js &
dotnet run --project=$(CSWebProjectLocation) &
jobs
sleep 10
pnpm i pnpm i
pnpm run test:nowatch
pnpm run build pnpm run build
displayName: 'Test on Node.js 16.x LTS' kill -2 %1 %2 2>/dev/null
displayName: 'Test on Node.js 18.x LTS'
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '>=18.7.0' versionSpec: '>=19.1.0'
displayName: 'Install Node.js Latest' displayName: 'Install Node.js Latest'
- bash: | - bash: |
@ -59,7 +63,7 @@ steps:
pnpm run test:nowatch pnpm run test:nowatch
pnpm run build pnpm run build
kill -2 %1 %2 2>/dev/null kill -2 %1 %2 2>/dev/null
displayName: 'Test on Node.js 18.x Latest' displayName: 'Test on Node.js Latest'
- bash: | - bash: |
pnpm run linter pnpm run linter

View file

@ -18,5 +18,6 @@ Liens :
- [Implémentation du système de cote](Pages/SVGLD_Cotes.pdf) - [Implémentation du système de cote](Pages/SVGLD_Cotes.pdf)
- [Web workers](Pages/WebWorkers.md) (pdf) - [Web workers](Pages/WebWorkers.md) (pdf)
- [Traductions](Pages/Translations.drawio) (nécessite diagrams.net) - [Traductions](Pages/Translations.drawio) (nécessite diagrams.net)
- [Méthode de release](../../RELEASING.md)
- [Système de CI/CD](Pages/Behaviors.md) - [Système de CI/CD](Pages/Behaviors.md)
- [Mise en place du SmartComponent sur Modeler](Pages/SmartComponent.md) - [Mise en place du SmartComponent sur Modeler](Pages/SmartComponent.md)

View file

@ -24,6 +24,35 @@ Il y deux manières de récupérer les builds du projets:
- Rebuild le projet (recommandé) - Rebuild le projet (recommandé)
- Récupérer des prébuild - Récupérer des prébuild
Mais avant tout cela il faut mettre à jour le fichier de types à fournir.
# Générer des fichiers de définition pour SmartModeler
Pré-requis : `typescript`, `python3`
Allez dans le répertoire `src/dts` et exécutez la commande suivante
```
npx tsc --project tsconfig.dts.json
```
Ou si l'installation est globale
```
tsc --projet tsconfig.dts.json
```
Ensuite, exécutez `python3` (ou `py` sous Windows) sur `generate_dts.py` :
```
python3 generate_dts.py SVGLD svgld.d.ts
```
Une définition sera générée sous la forme `svgld.d.ts` avec l'espace de nom `SVGLD`.
# Customiser et build le projet (recommandé) # Customiser et build le projet (recommandé)
Customiser le build du projet permet de modifier les urls de l'API et de personnaliser des fonctionnalités. Customiser le build du projet permet de modifier les urls de l'API et de personnaliser des fonctionnalités.

View file

@ -1,7 +1,7 @@
{ {
"name": "svg-layout-designer-react", "name": "svg-layout-designer-react",
"private": true, "private": true,
"version": "0.1.0", "version": "v1.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",