Skip to content

Commit

Permalink
feat: Switched to Vite (#21)
Browse files Browse the repository at this point in the history
* chore: Restructured .sln

* refactor: Minor improvements.

* feat: Switched to Vite (#19)

* chore(deps-dev): Bump the dependencies group in /src/WebUI/ClientApp with 1 update (#20)

* chore(deps-dev): Bump the dependencies group

Bumps the dependencies group in /src/WebUI/ClientApp with 1 update: [prettier](https://github.com/prettier/prettier).

- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.0.0...3.0.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Changed dependabot npm interval

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philipp Meier <philipp@p-meier.dev>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
philipp-meier and dependabot[bot] authored Aug 20, 2023
1 parent 90035a2 commit 22c503c
Show file tree
Hide file tree
Showing 28 changed files with 4,018 additions and 32,433 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: "npm"
directory: "/src/WebUI/ClientApp"
schedule:
interval: "weekly"
interval: "monthly"
target-branch: "develop"
groups:
dependencies:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore tests/Chrono.Tests.sln && dotnet restore src/Chrono.sln
run: dotnet restore
- name: Build (Frontend & Backend)
run: dotnet publish src/Chrono.sln -c Release --no-restore
run: dotnet publish -c Release --no-restore
- name: Test
run: dotnet test tests/Chrono.Tests.sln --verbosity normal
run: dotnet test --verbosity normal
78 changes: 78 additions & 0 deletions Chrono.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1B56785E-8524-4444-B576-23AB945131D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application.UnitTests", "tests\Application.UnitTests\Application.UnitTests.csproj", "{A76820C9-BFA4-4CC1-98A2-74104D96D658}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{268A3319-C632-40CB-A35E-1DDE745B2E81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "src\Application\Application.csproj", "{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebUI", "src\WebUI\WebUI.csproj", "{9BA631F2-D082-437D-8100-99F826858941}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_docs", "_docs", "{79449CD2-6C8D-4E22-BD09-1AB18846078C}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
LICENSE = LICENSE
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "static", "static", "{11D354DB-4870-4256-A40C-44781E39CA2A}"
ProjectSection(SolutionItems) = preProject
static\AddTask.png = static\AddTask.png
static\List.png = static\List.png
static\MasterData.png = static\MasterData.png
static\Mobile.png = static\Mobile.png
static\Start.png = static\Start.png
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_config", "_config", "{C6C4884B-F513-4419-8326-6DA9F3CE3189}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.gitkeep = .gitkeep
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{56763119-C6D6-40E9-9D27-A16C2A2C132E}"
ProjectSection(SolutionItems) = preProject
.github\dependabot.yml = .github\dependabot.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E59B02BF-6028-4353-BB9D-2270F7A95541}"
ProjectSection(SolutionItems) = preProject
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A76820C9-BFA4-4CC1-98A2-74104D96D658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A76820C9-BFA4-4CC1-98A2-74104D96D658}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A76820C9-BFA4-4CC1-98A2-74104D96D658}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A76820C9-BFA4-4CC1-98A2-74104D96D658}.Release|Any CPU.Build.0 = Release|Any CPU
{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0}.Release|Any CPU.Build.0 = Release|Any CPU
{9BA631F2-D082-437D-8100-99F826858941}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BA631F2-D082-437D-8100-99F826858941}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BA631F2-D082-437D-8100-99F826858941}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BA631F2-D082-437D-8100-99F826858941}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A76820C9-BFA4-4CC1-98A2-74104D96D658} = {1B56785E-8524-4444-B576-23AB945131D4}
{5DE651B8-3CF2-4EBC-8956-3EBC85A8E8E0} = {268A3319-C632-40CB-A35E-1DDE745B2E81}
{9BA631F2-D082-437D-8100-99F826858941} = {268A3319-C632-40CB-A35E-1DDE745B2E81}
{11D354DB-4870-4256-A40C-44781E39CA2A} = {79449CD2-6C8D-4E22-BD09-1AB18846078C}
{56763119-C6D6-40E9-9D27-A16C2A2C132E} = {C6C4884B-F513-4419-8326-6DA9F3CE3189}
{E59B02BF-6028-4353-BB9D-2270F7A95541} = {56763119-C6D6-40E9-9D27-A16C2A2C132E}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions src/Application/Common/Behaviors/PerformanceBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace Chrono.Application.Common.Behaviors;
public class PerformanceBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : notnull
{
private readonly Stopwatch _timer;
private readonly ILogger<TRequest> _logger;
private readonly ILogger<PerformanceBehavior<TRequest, TResponse>> _logger;

public PerformanceBehavior(ILogger<TRequest> logger)
public PerformanceBehavior(ILogger<PerformanceBehavior<TRequest, TResponse>> logger)
{
_timer = new Stopwatch();
_logger = logger;
Expand Down
6 changes: 4 additions & 2 deletions src/Application/Infrastructure/ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public static void AddInfrastructureServices(this IServiceCollection services, I
services.AddScoped<TaskSaveChangesInterceptor>();

services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(configuration.GetConnectionString("DefaultConnection"),
builder => builder.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName)));
options.UseSqlite(configuration.GetConnectionString("DefaultConnection"), builder => {
builder.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName);
builder.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery);
}));

services.AddScoped<IApplicationDbContext>(provider => provider.GetRequiredService<ApplicationDbContext>());

Expand Down
28 changes: 0 additions & 28 deletions src/Chrono.sln

This file was deleted.

18 changes: 18 additions & 0 deletions src/WebUI/ClientApp/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
41 changes: 21 additions & 20 deletions src/WebUI/ClientApp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
57 changes: 19 additions & 38 deletions src/WebUI/ClientApp/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,27 @@
# Getting Started with Create React App
# React + TypeScript + Vite

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Available Scripts
Currently, two official plugins are available:

In the project directory, you can run:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `npm start`
## Expanding the ESLint configuration

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

The page will reload if you make edits.\
You will also see any lint errors in the console.
- Configure the top-level `parserOptions` property like this:

### `npm test`
```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions src/WebUI/ClientApp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link href="/favicon.ico" rel="icon"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>Chrono</title>
</head>
<body>
<div id="root"></div>
<script src="/src/main.tsx" type="module"></script>
</body>
</html>
Loading

0 comments on commit 22c503c

Please sign in to comment.