Implement Toml module with full TOML 1.0.0 support#15
Open
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Open
Implement Toml module with full TOML 1.0.0 support#15Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Conversation
- Add ConvertFrom-Toml, ConvertTo-Toml, Import-Toml, Export-Toml public commands - Add TomlDocument class with Data (OrderedDictionary) and FilePath properties - Add private helpers: ConvertFrom-TomlDateTime, ConvertFrom-TomlynTable, ConvertFrom-TomlynValue, ConvertTo-TomlynArray, ConvertTo-TomlynTable, ConvertTo-TomlynValue - Back with Tomlyn v2.0.0 (.NET TOML library) via src/assemblies/Tomlyn.dll - Enforce TOML 1.0.0 duplicate key and table redefinition rules via SyntaxParser.ParseStrict before deserializing - Map all 8 TOML types to PowerShell types (string, long, double, bool, DateTimeOffset, DateTime, TimeSpan, OrderedDictionary/object[]) - Add 116 Pester tests covering spec compliance, round-trips, file I/O, error handling, and all TOML 1.0.0 type categories - Add build.ps1 for local module assembly and test running - Add tests/bootstrap.ps1 for test module import - Add tests/data/ with 9 TOML fixture files - Update README.md with type mapping table, command reference, usage examples - Update examples/General.ps1 with comprehensive usage examples - Remove template placeholder files (LsonLib.dll, format/type XMLs, sample modules/scripts/variables) - Fix PSScriptAnalyzer warnings: UTF-8 BOM, indentation consistency PSScriptAnalyzer: 0 errors, 0 warnings Tests: 116/116 pass Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Super-linter summary
Super-linter detected linting errors For more information, see the GitHub Actions workflow run Powered by Super-linter MARKDOWNPOWERSHELL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a production-quality PowerShell module for reading and writing TOML data, following PSModule and MSXOrg standards.
Public API
ConvertFrom-TomlTomlDocumentConvertTo-TomlTomlDocument→ TOML textImport-TomlTomlDocumentwithFilePathExport-TomlTomlDocumentto file (supports-WhatIf)Architecture
src/assemblies/Tomlyn.dllTomlDocumentclass withData([OrderedDictionary]) andFilePath([string])ConvertFrom-TomlynValue/Table/DateTime+ConvertTo-TomlynValue/Table/Array— all with comment-based helpTOML type mapping
[string][long][double][bool][DateTimeOffset][DateTime](Kind=Unspecified)[DateTime](00:00:00)[TimeSpan][object[]][ordered]hashtable[object[]]of hashtablesTests: 116/116 passing
ConvertFrom-Toml.Tests.ps1— 63 tests covering full TOML 1.0.0 specConvertTo-Toml.Tests.ps1— 26 tests for serialization + round-tripsImport-Toml.Tests.ps1— 13 tests for file importExport-Toml.Tests.ps1— 14 tests for file export + WhatIf + encodingtests/data/— 9 TOML fixture filesPSScriptAnalyzer: 0 errors, 0 warnings
Local development