Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,6 @@ FodyWeavers.xsd
/BenchmarkDotNet.Artifacts
/tests/MiniExcel.Tests.AspNetMvc/packages
/TestTemplate
/tests/MiniExcelTests/TemplateOptimization
/samples/xlsx/Test_EnableWriteFilePath.xlsx
/tests/MiniExcel.Tests/TemplateOptimization
/samples/xlsx/Test_EnableWriteFilePath.xlsx
/tests/MiniExcel.Core.Tests/TemplateOptimization/
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.

37 changes: 37 additions & 0 deletions MiniExcel.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks\MiniExcel.Benchmarks\MiniExcel.Benchmarks.csproj" />
</Folder>
<Folder Name="/Docs and settings/">
<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="src\Directory.Build.props" />
<File Path="src\Directory.Packages.props" />
<File Path="miniexcel.publickey" />
<File Path="src\icon.png" />
</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.Core\MiniExcel.Core.csproj" />
<Project Path="src\MiniExcel.Csv\MiniExcel.Csv.csproj" />
<Project Path="src\MiniExcel\MiniExcel.csproj" Type="Classic C#" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj" />
<Project Path="tests/MiniExcel.Tests.Common/MiniExcel.Tests.Common.csproj" />
<Project Path="tests\MiniExcel.Core.Tests\MiniExcel.Core.Tests.csproj" />
</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,31 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using MiniExcelLibs.Benchmarks.Utils;
using MiniExcelLib.Benchmarks.Utils;
using MiniExcelLib.Core;
using NPOI.XSSF.UserModel;
using OfficeOpenXml;

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

public class CreateXlsxBenchmark : BenchmarkBase
public class CreateExcelBenchmark : BenchmarkBase
{
private OpenXmlExporter _exporter;

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

_exporter = MiniExcel.Exporters.GetOpenXmlExporter();
}

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

[Benchmark(Description = "ClosedXml Create Xlsx")]
Expand Down Expand Up @@ -72,10 +77,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 @@ -4,30 +4,35 @@
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using ExcelDataReader;
using MiniExcelLib.Core;
using NPOI.XSSF.UserModel;
using OfficeOpenXml;

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

public class QueryXlsxBenchmark : BenchmarkBase
public class QueryExcelBenchmark : BenchmarkBase
{
private OpenXmlImporter _importer;

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

_importer = MiniExcel.Importers.GetOpenXmlImporter();
}

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

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

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

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

public class TemplateXlsxBenchmark : BenchmarkBase
public class TemplateExcelBenchmark : BenchmarkBase
{
private OpenXmlTemplater _templater;

[GlobalSetup]
public void Setup()
{
_templater = MiniExcel.Templaters.GetOpenXmlTemplater();
}

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

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

[Benchmark(Description = "ClosedXml.Report Template Generate")]
Expand Down
Loading