Skip to content

Big refactoring before first beta release - #821

Merged
michelebastione merged 6 commits into
mini-software:masterfrom
michelebastione:big_refactoring
Jun 23, 2025
Merged

michelebastione merged 6 commits into
mini-software:masterfrom
michelebastione:big_refactoring

Conversation

@michelebastione

@michelebastione michelebastione commented Jun 22, 2025 •

Copy link
Copy Markdown
Collaborator

Given our decision to move forwards with a v2 release, I tought this was a good moment to implement a number of changes to the codebase, some long overdue:

  • Bumped version to 2.0.0-beta.1
  • Bumped language version to 13 to make use of new syntax features
  • Added suuport for nullable reference types
  • Changed block scoped namespaces to file scoped
  • Changed namespace MiniExcelLibs.OpenXml.SaveByTemplate to MiniExcelLibs.SaveByTemplate
  • Changed using statements to using declarations where possible and appropriate
  • Implemented collections expressions where possible and appropriate
  • Changed == null and != null checks to is null and is not null
  • Implemented pattern matching and primary constructors where possible and appropriate
  • Removed License code file
  • Added the TaskHelper class
  • Renamed OpenXml.Config class to OpenXml.Constants.Schemas
  • Renamed IConfiguration and Configuration classes to IMiniExcelConfiguration and MiniExcelConfiguration
  • Renamed calChainHelper.cs file to CalcChainHelper.cs
  • Fixes issues 814, 815 and 817 with commit 1103aedda by @shps951023
  • Resolves conflicting TargetFrameworks in main project file
  • Upgrades ClosedXml and Epplus packages in test project
  • Adds EpplusLicense class that specifies the context as non commercial
  • Adds codeql analysis to pushes and PRs of maintenance branch
  • Fixes typo in drawio diagram
  • Minor style changes (sorting modifiers, renaming variables, etc...)
  • Removed MiniExcelTask.cs, it was only included for compatibility with .net45

I would also like to separate everything in 3 main assemblies: MiniExcelLibs.Core, MiniExcelLibs.OpenXml and MiniExcelLibs.Csv. I'm not sure yet if it's approprate to add this other big change here or to make a subsequent PR.
Let me know what you guys think about it all.

michelebastione and others added 3 commits June 22, 2025 10:39
- Bumped language version to 13
- Added suuport for nullable reference types
- Changed block scoped namespaces to file scoped
- Changed MiniExcelLibs.OpenXml.SaveByTemplate to MiniExcelLibs.SaveByTemplate
- Changed using statements to using declarations where possible and appropriate
- Implemented collections expressions where possible and appropriate
- Chanegd == null and != null checks to is null and is not null
- Implemented pattern matching and primary constructors where possible and appropriate
- Removed License code file
- Added the TaskHelper class
- Renamed OpenXml.Config class to OpenXml.Constants.Schemas
- Renamed IConfiguration and Configuration classes to IMiniExcelConfiguration and MiniExcelConfiguration
- Renamed calChainHelper.cs file to CalcChainHelper.cs
- Minor style changes (sorting modifiers, renaming variables, etc...)
* v1.41.2 AddPicture not working mini-software#814

* mini-software#814 samples

* Fix v1.41.1 AddPicture image max column and row are 2 cells mini-software#815

* Fix AddPicture get error same export file and second time. mini-software#817

---------

Signed-off-by: Wei Lin <shps951002@gmail.com>

(cherry picked from commit 1103aed)
- Fixes issues 814, 815 and 817
- Upgrades ClosedXml and Epplus packages in test project
- Adds EpplusLicense class that specifies the context as non commercial
- Resolves conflicting targetframeworks in main csproj and bumps version to 2.0.0-beta.1
- Addds codeql analysis to pushes and prs of maintenance branch
- Fixes typo in drawio diagram

Co-Authored-By: Wei Lin <shps951002@gmail.com>
@michelebastione

michelebastione commented Jun 22, 2025 •

Copy link
Copy Markdown
Collaborator Author

On further thought, separating the assemblies will be a big enough endeavour on its own, so it's probably for the best if we take our time with it.

@michelebastione
michelebastione marked this pull request as ready for review June 22, 2025 20:53
@izanhzh

izanhzh commented Jun 23, 2025 •

Copy link
Copy Markdown
Member

Reply

A very good and very big refactoring. I like it ❤. The following are some of my simple opinions:

  • Added suport for nullable reference types

    Great, and we still need to make extensive code adjustments to eliminate all compilation warning messages (e.g. CS8601、CS8604 ... ). Let's handle these improvements in follow-up PRs.
    image

  • Changed block scoped namespaces to file scoped

    I added a configuration item to .editorconfig to make VS use file-scoped style by default when creating new files

  • I would also like to separate everything in 3 main assemblies: MiniExcelLibs.Core, MiniExcelLibs.OpenXml and MiniExcelLibs.Csv

    Super nice. It is recommended to set a unified RootNamespace MiniExcelLibs for all 3 main assemblies through the Directory.Build.props file. This will help maintain consistency across the projects and simplify future maintenance.

Others

I've added one more change: Removed MiniExcelTask.cs

Comment thread docs/README.zh-CN.md Resolved
@izanhzh
izanhzh self-requested a review June 23, 2025 02:24
@michelebastione
michelebastione merged commit e7f94a0 into mini-software:master Jun 23, 2025
@michelebastione
michelebastione deleted the big_refactoring branch June 28, 2025 19:49
shps951023 added a commit that referenced this pull request Aug 29, 2026
* Refactoring first draft

- Bumped language version to 13
- Added suuport for nullable reference types
- Changed block scoped namespaces to file scoped
- Changed MiniExcelLibs.OpenXml.SaveByTemplate to MiniExcelLibs.SaveByTemplate
- Changed using statements to using declarations where possible and appropriate
- Implemented collections expressions where possible and appropriate
- Chanegd == null and != null checks to is null and is not null
- Implemented pattern matching and primary constructors where possible and appropriate
- Removed License code file
- Added the TaskHelper class
- Renamed OpenXml.Config class to OpenXml.Constants.Schemas
- Renamed IConfiguration and Configuration classes to IMiniExcelConfiguration and MiniExcelConfiguration
- Renamed calChainHelper.cs file to CalcChainHelper.cs
- Minor style changes (sorting modifiers, renaming variables, etc...)

* 1 41 3 fix bugs (#818)

* v1.41.2 AddPicture not working #814

* #814 samples

* Fix v1.41.1 AddPicture image max column and row are 2 cells #815

* Fix AddPicture get error same export file and second time. #817

---------

Signed-off-by: Wei Lin <shps951002@gmail.com>

(cherry picked from commit 7020fda)

* Bugfix for AddPicture method

- Fixes issues 814, 815 and 817
- Upgrades ClosedXml and Epplus packages in test project
- Adds EpplusLicense class that specifies the context as non commercial
- Resolves conflicting targetframeworks in main csproj and bumps version to 2.0.0-beta.1
- Addds codeql analysis to pushes and prs of maintenance branch
- Fixes typo in drawio diagram

Co-Authored-By: Wei Lin <shps951002@gmail.com>

* Remove `MiniExcelTask.cs`

* fix docs description

* Add configuration items to `.editorconfig`

---------

Co-authored-by: Wei Lin <shps951002@gmail.com>
Co-authored-by: izanhzh <hzh990094740@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants