Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0 #42

Merged
merged 21 commits into from
May 11, 2024
Merged

Release 1.0 #42

merged 21 commits into from
May 11, 2024

Conversation

SakuraIsayeki
Copy link
Member

No description provided.

SakuraIsayeki and others added 14 commits May 5, 2024 14:39
This commit adds the Nodsoft.MoltenObsidian.Tests project to the solution. The project file and necessary dependencies have been included.
This commit adds tests for the ObsidianText struct. The tests cover various scenarios, including parsing HTML from plain text, Markdown text, and Markdown text with frontmatter. It also includes tests for empty text and text with a BOM. Additionally, there are tests to verify the retrieval of frontmatter from ObsidianText instances.

The commit introduces a new file `ObsidianTextTests.cs` in the `Nodsoft.MoltenObsidian.Tests` namespace.
This commit simplifies the code in the `ObsidianText` class by removing unnecessary using statements and redundant code. It also adds a check to handle cases where the `obsidianText` parameter is null or an empty string, returning early from the constructor. Additionally, it trims the Byte Order Mark (BOM) from the text if present. The `Frontmatter` property is now initialized as an empty dictionary, and the `SplitByNewline` method returns a slice of strings instead of converting to an array.
- Added new files: app.json, appearance.json, core-plugins-migration.json, core-plugins.json, workspace.json, README.md, Hidden Note.md
- Renamed ObsidianTextTests.cs to Core/ObsidianTextTests.cs
- Updated Nodsoft.MoltenObsidian.Tests.csproj to include a reference to Nodsoft.MoltenObsidian.Vaults.FileSystem.csproj and added Assets/** to the content list in the project file
- Modified ObsidianText.cs documentation
- Reworked the `GetFolder` method in `IVault.cs` to use null coalescing operator and `GetValueOrDefault` method.
- Reworked the `GetFile` method in `IVault.cs` to use `GetValueOrDefault` method.
- Moved the `ReadBytesAsync` method from `IVaultFile.cs`, `FileSystemVaultFile.cs`, and other related classes to a new extension method in `VaultExtensions.cs`.
- Moved the `ReadDocumentAsync` method from `IVaultNote.cs`, and other related classes to a new extension method in `VaultExtensions.cs`.
- Updated references to the moved methods in relevant classes.
- Added unit tests for the FileSystemVault class
- Created a test fixture for the FileSystemVault class
- Added a collection definition for the FileSystemVaultFixtureCollection
- Implemented tests for various methods and scenarios in the FileSystemVaultTests class
- Updated the FromDirectory method in the FileSystemVault class to include excluded folders and files
- Added a constant string `allowedChars` to define the characters allowed in tags.
- Modified the while loop condition to check if the current character is within the allowed characters or if it's the first character and it's a '#'.
- Adjusted the assignment of `slice.Start` after parsing a tag.

This commit improves the logic for parsing tags in the ObsidianTagsParser class. It ensures that only valid characters are considered when determining the end position of a tag, and correctly updates `slice.Start` after parsing a tag.
This commit adds a new test class `ObsidianTagsTests` to provide tests for the Obsidian Tags parser and renderer. The class includes several test methods:
- `ParseAndRender_Standalone_Nominal`: Tests that a valid tag is correctly parsed and rendered when it stands alone.
- `ParseAndRender_Standalone_Ignored`: Tests that an invalid tag is correctly ignored when it stands alone.
- `ParseAndRender_InTextBlock_Nominal`: Tests that a valid tag is correctly parsed and rendered when it is part of a larger text block.
- `ParseAndRender_InTextBlock_Ignored`: Tests that an invalid tag is correctly ignored when it is part of a larger text block.

The tests use the MarkdownPipeline from Markdig library to parse the markdown input and assert the expected HTML output.
This commit adds a validation check to the ObsidianTagsParser class in the Tags folder. The validation checks for disallowed standalone numeric characters in tags and returns false if any are found. This prevents full-numeric tags from being created and added to the processor.
- Updated coverlet.collector to version 6.0.2
- Updated Microsoft.NET.Test.Sdk to version 17.9.0
- Updated xunit to version 2.8.0
- Updated xunit.runner.visualstudio to version 2.8.0
This commit adds new test cases to the VaultManifestTests class in order to test the generation of a vault manifest. The tests include checking that a vault manifest can be generated from a vault, that it has equivalent file paths to its source vault, that it has equivalent file sizes, and that it has equivalent file hashes. These tests ensure the correctness of the vault manifest system.

- Added VaultManifestTests class with test methods for generating a vault manifest
- Added test cases for checking equivalence of file paths, sizes, and hashes in the generated manifest
- Updated the `RemoteVaultManifest` class to use an empty array for the `Files` property.
- Modified the `GenerateManifestAsync` method in `VaultManifestGenerator` to use an empty list for the `files` variable.
- Refactored the code in `VaultManifestGenerator.GenerateFileAsync()` to compute the SHA256 hash of a stream using different approaches based on .NET version.

This commit improves the initialization of file-related properties and enhances compatibility with different versions of .NET.
Implement Unit/Integration testing
Updated README.md with a new header, and the inclusion of status badges for the following:
- Build status (on main)
- Nuget core versions for pre/release
- Nuget total core downloads

Also updated heading levels for following text.

Signed-off-by: Sakura Isayeki <[email protected]>
The code changes update the version number in two JSON files from "1.0-beta" to "1.0".
@SakuraIsayeki SakuraIsayeki marked this pull request as ready for review May 11, 2024 02:47
This commit adds the `UseArtifactsOutput` property to the `Directory.Build.props` file. This property is set to true, enabling the use of artifacts output in the build process.

More info: https://learn.microsoft.com/en-us/dotnet/core/sdk/artifacts-output
- Updated the subject-path for attesting build provenance to include all .nupkg files within any subdirectory of "artifacts".
- Updated the path for publishing debug artifacts to include all files within any subdirectory of "artifacts".
…testation

- Set `INCLUDE_SYMBOLS` to true in the NuGet push workflow
- Added a step to attest build provenance for .nupkgs using the `actions/attest-build-provenance` action
Switch to Artifacts output structure + Add CI build attestation
@SakuraIsayeki SakuraIsayeki merged commit 70f7029 into main May 11, 2024
6 checks passed
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.

2 participants