Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5db4986
Separating into 3 assemblies, changing namespaces, renaming main APIs…
michelebastione Jun 29, 2025
e6b2335
Rebasing, fixing merge conflicts and updating workflows
michelebastione Jul 1, 2025
08d76a0
Made core and csv projects fully independent
michelebastione Jul 3, 2025
f897c8b
Reverting to standard .sln solution file to fix CodeQL analysis
michelebastione Jul 3, 2025
e145087
Codeql workflow fixes for new slnx solution format
michelebastione Jul 6, 2025
98d9098
Added global usings
michelebastione Jul 6, 2025
d579a6b
Updating directory.build.props target framework after rebasing
michelebastione Jul 6, 2025
61d9f0a
Removing facade assembly, renaming MiniExcel.Core project to MiniExcel
michelebastione Jul 6, 2025
08adb71
Added some more global usings
michelebastione Jul 7, 2025
2dcf442
Separate CSV test cases
virzak Jul 9, 2025
74dd1aa
Changing MiniExcelTests project name to MiniExcel.Tests
michelebastione Jul 9, 2025
36b98c0
Fixing commit mistake
michelebastione Jul 9, 2025
36055d1
Adjusted csv test namespaces
michelebastione Jul 9, 2025
ab8127b
Introduced extensible providers for exporter, importer and templater
michelebastione Jul 12, 2025
41e4daf
Added public api for applying a template from a template stream
michelebastione Jul 13, 2025
82e8cf4
Added assembly for legacy methods
michelebastione Jul 15, 2025
9b50b5a
Fixing build errors
michelebastione Jul 15, 2025
2d3320f
Moved the public api under relevant namespace, changed version from b…
michelebastione Jul 16, 2025
1286b12
Removing warning suppressions and adding a check on seekable stream t…
michelebastione Jul 19, 2025
f9893c4
Renamed API methods deleting Excel and Csv suffixes for simplicity
michelebastione Jul 20, 2025
2c8b317
Changed namespaces .Api to .Providers in both main and csv assemblies
michelebastione Jul 21, 2025
76d1d4f
Added Directory.Packages.props file and moved package metadata conten…
michelebastione Jul 21, 2025
ddb77b0
Reintroduced facade assembly containing legacy code
michelebastione Jul 21, 2025
771c62a
Fixed accidentally adding old tests not part of the solution
michelebastione Jul 21, 2025
48436e0
Adjusting legacy namespaces and adding old attributes signatures
michelebastione Jul 27, 2025
5d609c4
Renamed some methods and properties
michelebastione Jul 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: MiniExcel Benchmarks
on:
workflow_dispatch:
release:
branches: [master, v1.x-maintenance]
types: [published]

permissions:
Expand Down Expand Up @@ -31,7 +32,7 @@ jobs:
BenchmarkMode: Automatic
BenchmarkSection: query
- name: Renaming result file
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.QueryXlsxBenchmark-report-github.md query-benchmark.md
run: mv MiniExcelLib.Benchmarks.BenchmarkSections.QueryXlsxBenchmark-report-github.md query-benchmark.md
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
- name: Save benchmark results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
BenchmarkMode: Automatic
BenchmarkSection: create
- name: Renaming result file
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.CreateXlsxBenchmark-report-github.md create-benchmark.md
run: mv MiniExcelLib.Benchmarks.BenchmarkSections.CreateXlsxBenchmark-report-github.md create-benchmark.md
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
- name: Save benchmark results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -91,7 +92,7 @@ jobs:
BenchmarkMode: Automatic
BenchmarkSection: template
- name: Renaming result file
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.TemplateXlsxBenchmark-report-github.md template-benchmark.md
run: mv MiniExcelLib.Benchmarks.BenchmarkSections.TemplateXlsxBenchmark-report-github.md template-benchmark.md
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
- name: Save benchmark results
uses: actions/upload-artifact@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# - name: Autobuild
# uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -69,9 +70,8 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
- name: Manual build
run: dotnet build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
3 changes: 1 addition & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: .NET
on:
pull_request:
push:
branches:
- master
branches: [master, v1.x-maintenance]

jobs:
build:
Expand Down
13 changes: 1 addition & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,7 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2021 Wei Lin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
71 changes: 0 additions & 71 deletions MiniExcel.sln

This file was deleted.

31 changes: 31 additions & 0 deletions MiniExcel.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks\MiniExcel.Benchmarks\MiniExcel.Benchmarks.csproj" Type="Classic C#" />
</Folder>
<Folder Name="/Docs and setting/">
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="appveyor.yml" />
<File Path=".github\workflows\dotnet.yml" />
<File Path="LICENSE" />
<File Path="README-NuGet.md" />
<File Path="README.md" />
<File Path="README.zh-CN.md" />
<File Path="README.zh-Hant.md" />
<File Path=".github\workflows\benchmark.yml" />
<File Path=".github\workflows\codeql-analysis.yml" />
<File Path="docs\core_logic_diagram.drawio" />
</Folder>
<Folder Name="/Releases/">
<File Path="docs\README.md" />
<File Path="docs\README.zh-CN.md" />
<File Path="docs\README.zh-Hant.md" />
</Folder>
<Folder Name="/src/">
<Project Path="src\MiniExcel.Csv\MiniExcel.Csv.csproj" Type="Classic C#" />
<Project Path="src\MiniExcel\MiniExcel.csproj" Type="Classic C#" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests\MiniExcelTests\MiniExcelTests.csproj" Type="Classic C#" />
</Folder>
</Solution>
2 changes: 1 addition & 1 deletion benchmarks/MiniExcel.Benchmarks/BenchmarkBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MiniExcelLibs.Benchmarks;
namespace MiniExcelLib.Benchmarks;

public abstract class BenchmarkBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Order;

namespace MiniExcelLibs.Benchmarks;
namespace MiniExcelLib.Benchmarks;

public class Config : ManualConfig
internal class BenchmarkConfig : ManualConfig
{
private const int Launches = 1;
private const int Warmups = 3;
private const int Unrolls = 3;
private const int Iterations = 3;

public Config()
public static BenchmarkConfig Default => new();

private BenchmarkConfig()
{
AddLogger(ConsoleLogger.Default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using MiniExcelLibs.Benchmarks.Utils;
using MiniExcelLib.Benchmarks.Utils;
using NPOI.XSSF.UserModel;
using OfficeOpenXml;

namespace MiniExcelLibs.Benchmarks.BenchmarkSections;
namespace MiniExcelLib.Benchmarks.BenchmarkSections;

public class CreateXlsxBenchmark : BenchmarkBase
{
private MiniExcelExporter _exporter;

[GlobalSetup]
public void SetUp()
{
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_exporter = new MiniExcelExporter();
}

[Benchmark(Description = "MiniExcel Create Xlsx")]
public void MiniExcelCreateTest()
{
using var path = AutoDeletingPath.Create();
MiniExcel.SaveAs(path.FilePath, GetValue());
_exporter.ExportXlsx(path.FilePath, GetValue());
}

[Benchmark(Description = "ClosedXml Create Xlsx")]
Expand Down Expand Up @@ -72,10 +75,9 @@ public void NPOICreateTest()
row.CreateCell(9).SetCellValue(item.Column10);
i++;
}
using (var fs = File.Create(path.FilePath))
{
wb.Write(fs);
}

using var fs = File.Create(path.FilePath);
wb.Write(fs);
}

[Benchmark(Description = "OpenXmlSdk Create Xlsx by DOM mode")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@
using NPOI.XSSF.UserModel;
using OfficeOpenXml;

namespace MiniExcelLibs.Benchmarks.BenchmarkSections;
namespace MiniExcelLib.Benchmarks.BenchmarkSections;

public class QueryXlsxBenchmark : BenchmarkBase
{
private MiniExcelImporter _importer;

[GlobalSetup]
public void SetUp()
{
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_importer = new MiniExcelImporter();
}

[Benchmark(Description = "MiniExcel QueryFirst")]
public void MiniExcel_QueryFirst_Test()
{
_ = MiniExcel.Query(FilePath).First();
_ = _importer.QueryXlsx(FilePath).First();
}

[Benchmark(Description = "MiniExcel Query")]
public void MiniExcel_Query()
{
foreach (var _ in MiniExcel.Query(FilePath)) { }
foreach (var _ in _importer.QueryXlsx(FilePath)) { }
}

[Benchmark(Description = "ExcelDataReader QueryFirst")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
using BenchmarkDotNet.Attributes;
using ClosedXML.Report;
using MiniExcelLibs.Benchmarks.Utils;
using MiniExcelLib.Benchmarks.Utils;

namespace MiniExcelLibs.Benchmarks.BenchmarkSections;
namespace MiniExcelLib.Benchmarks.BenchmarkSections;

public class TemplateXlsxBenchmark : BenchmarkBase
{
private MiniExcelTemplater _templater;

[GlobalSetup]
public void Setup()
{
_templater = new MiniExcelTemplater();
}

[Benchmark(Description = "MiniExcel Template Generate")]
public void MiniExcel_Template_Generate_Test()
{
Expand All @@ -22,7 +30,7 @@ public void MiniExcel_Template_Generate_Test()
})
};

MiniExcel.SaveAsByTemplate(path.FilePath, templatePath, value);
_templater.ApplyXlsxTemplate(path.FilePath, templatePath, value);
}

[Benchmark(Description = "ClosedXml.Report Template Generate")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
using BenchmarkDotNet.Attributes;
using MiniExcelLibs.Benchmarks.Utils;
using MiniExcelLib.Benchmarks.Utils;

namespace MiniExcelLibs.Benchmarks.BenchmarkSections;
namespace MiniExcelLib.Benchmarks.BenchmarkSections;

public class XlsxAsyncBenchmark : BenchmarkBase
{
private MiniExcelExporter _exporter;
private MiniExcelTemplater _templater;

[GlobalSetup]
public void Setup()
{
_exporter = new MiniExcelExporter();
_templater = new MiniExcelTemplater();
}

[Benchmark(Description = "MiniExcel Create Xlsx Async")]
public async Task MiniExcelCreateAsyncTest()
{
using var path = AutoDeletingPath.Create();
using var stream = File.Create(path.FilePath);
await using var stream = File.Create(path.FilePath);

await stream.SaveAsAsync(GetValue());
await _exporter.ExportXlsxAsync(stream, GetValue());
}

[Benchmark(Description = "MiniExcel Generate Template Async")]
Expand All @@ -30,6 +40,6 @@ public async Task MiniExcel_Template_Generate_Async_Test()
})
};

await MiniExcel.SaveAsByTemplateAsync(path.FilePath, templatePath, value);
await _templater.ApplyXlsxTemplateAsync(path.FilePath, templatePath, value);
}
}
4 changes: 2 additions & 2 deletions benchmarks/MiniExcel.Benchmarks/MiniExcel.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<RootNamespace>MiniExcelLibs.Benchmarks</RootNamespace>
<RootNamespace>MiniExcelLib.Benchmarks</RootNamespace>
<NoWarn>$(NoWarn);CA2000;CA2007</NoWarn>
</PropertyGroup>

Expand Down Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\MiniExcel\MiniExcelLibs.csproj" />
<ProjectReference Include="..\..\src\MiniExcel\MiniExcel.csproj" />
</ItemGroup>

</Project>
Loading