Skip to content

Commit b02971c

Browse files
MaxymGornCopilot
andauthored
Refactor: Transition to TypeScript and Webpack build system (#449)
## Target <!-- Why are you making this change? --> #### Open Questions <!-- OPTIONAL - [ ] Use the GitHub checklists to spark discussion on issues that may arise from your approach. Please tick the box and explain your answer. --> ## Checklist <!-- It serves as a gentle reminder for common tasks. Confirm it's done and check everything that applies. --> - [x] Tests cover new or modified code - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the site documentation - [x] I have made corresponding changes to the README, NuGet README file - [x] My changes generate no new warnings - [x] New dependencies added or updated - [x] Includes breaking changes - [x] Version bumped ## Visuals <!-- OPTIONAL Show results both before and after this change. When the output changes, it can be a screenshot of a trace, metric, or log illustrating the change. --> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent bf6a9a5 commit b02971c

75 files changed

Lines changed: 2268 additions & 1290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
root = true
2-
3-
# All files
4-
[*]
52
indent_style = space
6-
csharp_indent_labels = no_change
7-
csharp_using_directive_placement = outside_namespace:silent
8-
csharp_prefer_simple_using_statement = true:suggestion
9-
csharp_prefer_braces = true:silent
10-
csharp_style_namespace_declarations = block_scoped:silent
11-
csharp_style_prefer_method_group_conversion = true:silent
12-
csharp_style_prefer_top_level_statements = true:silent
13-
csharp_style_prefer_primary_constructors = true:suggestion
14-
csharp_style_expression_bodied_methods = false:silent
15-
csharp_style_expression_bodied_constructors = false:silent
16-
csharp_style_expression_bodied_operators = false:silent
17-
csharp_style_expression_bodied_properties = true:silent
18-
csharp_style_expression_bodied_indexers = true:silent
19-
csharp_style_expression_bodied_accessors = true:silent
20-
csharp_style_expression_bodied_lambdas = true:silent
21-
csharp_style_expression_bodied_local_functions = false:silent
223

234
[*.{csproj,sln,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
245
indent_size = 4
@@ -44,7 +25,23 @@ indent_style = space
4425
indent_size = 2
4526

4627
[*.{cs,vb}]
47-
#### Naming styles ####
28+
# Naming styles
29+
csharp_indent_labels = no_change
30+
csharp_using_directive_placement = outside_namespace:silent
31+
csharp_prefer_simple_using_statement = true:suggestion
32+
csharp_prefer_braces = true:silent
33+
csharp_style_namespace_declarations = block_scoped:silent
34+
csharp_style_prefer_method_group_conversion = true:silent
35+
csharp_style_prefer_top_level_statements = true:silent
36+
csharp_style_prefer_primary_constructors = true:suggestion
37+
csharp_style_expression_bodied_methods = false:silent
38+
csharp_style_expression_bodied_constructors = false:silent
39+
csharp_style_expression_bodied_operators = false:silent
40+
csharp_style_expression_bodied_properties = true:silent
41+
csharp_style_expression_bodied_indexers = true:silent
42+
csharp_style_expression_bodied_accessors = true:silent
43+
csharp_style_expression_bodied_lambdas = true:silent
44+
csharp_style_expression_bodied_local_functions = false:silent
4845

4946
# Naming rules
5047

@@ -64,33 +61,21 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
6461

6562
dotnet_naming_symbols.interface.applicable_kinds = interface
6663
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
67-
dotnet_naming_symbols.interface.required_modifiers =
6864

6965
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
7066
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
71-
dotnet_naming_symbols.types.required_modifiers =
7267

7368
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
7469
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
75-
dotnet_naming_symbols.non_field_members.required_modifiers =
7670

7771
# Naming styles
7872

7973
dotnet_naming_style.begins_with_i.required_prefix = I
80-
dotnet_naming_style.begins_with_i.required_suffix =
81-
dotnet_naming_style.begins_with_i.word_separator =
8274
dotnet_naming_style.begins_with_i.capitalization = pascal_case
83-
84-
dotnet_naming_style.pascal_case.required_prefix =
85-
dotnet_naming_style.pascal_case.required_suffix =
86-
dotnet_naming_style.pascal_case.word_separator =
8775
dotnet_naming_style.pascal_case.capitalization = pascal_case
88-
89-
dotnet_naming_style.pascal_case.required_prefix =
90-
dotnet_naming_style.pascal_case.required_suffix =
91-
dotnet_naming_style.pascal_case.word_separator =
9276
dotnet_naming_style.pascal_case.capitalization = pascal_case
9377
dotnet_style_operator_placement_when_wrapping = beginning_of_line
78+
9479
tab_width = 4
9580
indent_size = 4
9681
end_of_line = crlf

.github/linters/.jscpd.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"**/*.md",
88
"**/*excubowebcompiler.json",
99
"**/bin/**",
10-
"**/obj/**"
10+
"**/obj/**",
11+
"**/node_modules/**"
1112
],
1213
"absolute": true,
1314
"minTokens": 75

.github/workflows/cd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
uses: CropperBlazor/Cropper.Blazor/.github/workflows/build-test-template.yml@dev
2121
secrets:
2222
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
23+
with:
24+
run-js-tests: true
2325

2426
deploy-to-github-pages:
2527
permissions:

.github/workflows/ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@ jobs:
2121
uses: CropperBlazor/Cropper.Blazor/.github/workflows/build-test-template.yml@dev
2222
secrets:
2323
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
24+
with:
25+
run-js-tests: true
26+
27+
es-linting:
28+
permissions:
29+
contents: read
30+
needs: code-quality-check
31+
name: ESLint - TypeScript Linting
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v5
36+
with:
37+
persist-credentials: false
38+
39+
- name: Install npm dependencies
40+
run: npm install
41+
working-directory: src/Cropper.Blazor/Cropper.Blazor
42+
43+
- name: Run ESLint
44+
run: npm run lint
45+
working-directory: src/Cropper.Blazor/Cropper.Blazor
2446

2547
code-linting:
2648
permissions:
@@ -63,8 +85,10 @@ jobs:
6385
VALIDATE_MARKDOWN_PRETTIER: false
6486
VALIDATE_YAML_PRETTIER: false
6587
VALIDATE_JSON_PRETTIER: false
88+
VALIDATE_TYPESCRIPT_PRETTIER: false
89+
VALIDATE_TYPESCRIPT_ES: false
6690

67-
FILTER_REGEX_EXCLUDE: '(\W|^)(obj/|bin/)|(\W|^)(.*([.]min[.]css))($)|(\W|^)(.*([.]min[.]js))($)'
91+
FILTER_REGEX_EXCLUDE: '(\W|^)(obj/|bin/|node_modules/|webpack\.config\.js)|(\W|^).*([.]min[.]css)($)|(\W|^).*([.]min[.]js)($)'
6892
FILTER_REGEX_INCLUDE: "/github/workspace/src/Cropper.Blazor/.*|/github/workspace/.github/.*"
6993

7094
JSCPD_CONFIG_FILE: ".jscpd.json"

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
with:
1919
configuration: "Release"
2020
publish-coverage: true
21+
run-js-tests: true
2122

2223
deploy-to-nuget:
2324
name: Deploy to NuGet
@@ -73,6 +74,15 @@ jobs:
7374
if ! jq -e '.Root.Children["cropper.min.js"]' "$json_path" > /dev/null; then
7475
error_messages+="For .NET $net_version: Key 'cropper.min.js' does not exist.\n"
7576
fi
77+
if ! jq -e '.Root.Children["blob-helper.d.ts"]' "$json_path" > /dev/null; then
78+
error_messages+="For .NET $net_version: Key 'blob-helper.d.ts' does not exist.\n"
79+
fi
80+
if ! jq -e '.Root.Children["cropperJsInterop.d.ts"]' "$json_path" > /dev/null; then
81+
error_messages+="For .NET $net_version: Key 'cropperJsInterop.d.ts' does not exist.\n"
82+
fi
83+
if ! jq -e '.Root.Children["cropper-url-image-helper.d.ts"]' "$json_path" > /dev/null; then
84+
error_messages+="For .NET $net_version: Key 'cropper-url-image-helper.d.ts' does not exist.\n"
85+
fi
7686
else
7787
error_messages+="File $json_path does not exist for .NET $net_version.\n"
7888
fi

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ _ReSharper*/
2929
[Tt]est[Rr]esult*
3030
.vs/
3131
.idea/
32+
*.cobertura.xml
3233
#Nuget packages folder
3334
packages/
35+
# Node.js
36+
node_modules/
37+
coverage/
38+
package-lock.json

NuGet_README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![NuGet Downloads](https://img.shields.io/nuget/dt/Cropper.Blazor?logo=nuget&label=nuget%20downloads&color=ff5c9b)](https://www.nuget.org/packages/Cropper.Blazor)
99
[![NuGet Version](https://img.shields.io/nuget/v/Cropper.Blazor?logo=nuget&label=nuget%20version&color=009DEA)](https://www.nuget.org/packages/Cropper.Blazor)
1010

11-
The most powerful image cropping tool for Blazor WebAssembly / Server, Hybrid with MAUI, MVC and
11+
The most powerful image cropping tool for Blazor Web App / WebAssembly / Server, Hybrid with MAUI, MVC and
1212
other frameworks.
1313

1414
Cropper.Blazor is an essential component for building interactive image cropping and manipulation features in Blazor web applications. This versatile Blazor library empowers developers to integrate intuitive image cropping functionality directly into their Blazor projects, offering users a seamless and responsive image editing experience.
@@ -33,6 +33,7 @@ Cropper.Blazor is an essential component for building interactive image cropping
3333
| 1.5.x | [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0), [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0), [.NET 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0), [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) | :heavy_check_mark: |
3434

3535
- Supported .NET 10.0, .NET 9.0, .NET 8.0, .NET 7.0, .NET 6.0 versions for these web platforms:
36+
- Blazor Web App
3637
- Blazor WebAssembly
3738
- Blazor Server
3839
- Blazor Server Hybrid with MVC

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[![NuGet Downloads](https://img.shields.io/nuget/dt/Cropper.Blazor?logo=nuget&label=nuget%20downloads&color=ff5c9b)](https://www.nuget.org/packages/Cropper.Blazor)
1919
[![NuGet Version](https://img.shields.io/nuget/v/Cropper.Blazor?logo=nuget&label=nuget%20version&color=009DEA)](https://www.nuget.org/packages/Cropper.Blazor)
2020

21-
The most powerful image cropping tool for Blazor WebAssembly / Server, Hybrid with MAUI, MVC and
21+
The most powerful image cropping tool for Blazor Web App / WebAssembly / Server, Hybrid with MAUI, MVC and
2222
other frameworks.
2323

2424
Cropper.Blazor is an essential component for building interactive image cropping and manipulation features in Blazor web applications. This versatile Blazor library empowers developers to integrate intuitive image cropping functionality directly into their Blazor projects, offering users a seamless and responsive image editing experience.
@@ -36,6 +36,7 @@ Cropper.Blazor is an essential component for building interactive image cropping
3636
| 1.5.x | [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0), [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0), [.NET 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0), [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) | :heavy_check_mark: |
3737

3838
- Supported .NET 10.0, .NET 9.0, .NET 8.0, .NET 7.0, .NET 6.0 versions for these web platforms:
39+
- Blazor Web App
3940
- Blazor WebAssembly
4041
- Blazor Server
4142
- Blazor Server Hybrid with MVC

examples/Cropper.Blazor.MAUI.Net9/Cropper.Blazor.MAUI.Net9.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<ItemGroup>
6161
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
6262
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.120" />
63-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.11" />
64-
<PackageReference Include="MudBlazor" Version="8.14.0" />
63+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.12" />
64+
<PackageReference Include="MudBlazor" Version="8.15.0" />
6565
</ItemGroup>
6666

6767
<ItemGroup>

examples/Cropper.Blazor.Server.Net8/Cropper.Blazor.Server.Net8.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="MudBlazor" Version="8.14.0" />
10+
<PackageReference Include="MudBlazor" Version="8.15.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

0 commit comments

Comments
 (0)