🌟 [Release]: PowerShell-Lua data conversion now available via ConvertTo-Lua and ConvertFrom-Lua#3
Conversation
- Implemented ConvertTo-Lua and ConvertFrom-Lua functions for converting PowerShell objects to Lua table strings and vice versa. - Added helper functions ConvertTo-LuaTable and Format-LuaKey for internal processing. - Created comprehensive tests for both conversion functions, covering various data types including primitives, strings, arrays, and tables. - Included test data files for validation of string and array conversions. - Ensured proper handling of comments and special characters in Lua syntax.
Bumps [PSModule/Process-PSModule/.github/workflows/workflow.yml](https://github.com/psmodule/process-psmodule) from 5.4.3 to 5.4.7. - [Release notes](https://github.com/psmodule/process-psmodule/releases) - [Commits](PSModule/Process-PSModule@60bdf8a...1111791) --- updated-dependencies: - dependency-name: PSModule/Process-PSModule/.github/workflows/workflow.yml dependency-version: 5.4.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@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 LUAPOWERSHELLSPELL_CODESPELL |
- Improved string escaping in ConvertTo-LuaTable for better handling of special characters. - Enhanced depth warning messages for better clarity. - Simplified parameter passing in ConvertTo-LuaTable calls. - Updated ConvertFrom-Lua to use array syntax for output. - Refactored ConvertTo-Lua to improve readability and maintainability. - Removed obsolete header and manifest files. - Updated tests for better clarity and consistency. - Added new Lua parsing functions: Read-LuaHexFloat, Read-LuaMultiLineString, Read-LuaNumber, Read-LuaString, Read-LuaTable, Read-LuaValue, and Skip-LuaWhitespace for comprehensive Lua support. - Adjusted data files to conform to new structure and formatting.
Super-linter summary
Super-linter detected linting errors For more information, see the GitHub Actions workflow run Powered by Super-linter POWERSHELL |
…mprove formatting in Lua.Tests
Super-linter summary
Super-linter detected linting errors For more information, see the GitHub Actions workflow run Powered by Super-linter POWERSHELL |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Adds PowerShell ↔ Lua table constructor round-trip conversion to the module (serializer + parser), replacing the previous PSModule template scaffolding with a real Lua-focused implementation, tests, and docs.
Changes:
- Introduces
ConvertTo-Lua/ConvertFrom-Luapublic cmdlets with private serializer/parser helpers. - Adds extensive Pester coverage plus Lua/JSON fixture data for validation and round-trips.
- Removes template/demo files and updates README/examples + CI workflow reference.
Reviewed changes
Copilot reviewed 54 out of 55 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/data/TestStructure.lua | Adds Lua fixture representing a config-like nested table. |
| tests/data/TestStructure.json | Adds JSON reference for TestStructure.lua fixture validation. |
| tests/data/Strings.lua | Adds Lua string-escape fixture data. |
| tests/data/Strings.json | Adds JSON reference for string-escape fixture data. |
| tests/data/DeepStructure.lua | Adds deep-nesting Lua fixture for depth/structure validation. |
| tests/data/DeepStructure.json | Adds JSON reference for deep-nesting fixture validation. |
| tests/data/Arrays.lua | Adds Lua array/sequence fixture data. |
| tests/data/Arrays.json | Adds JSON reference for arrays fixture data. |
| tests/PSModuleTest.Tests.ps1 | Removes template Pester tests for placeholder functions. |
| tests/Lua.Tests.ps1 | Adds comprehensive Pester tests for Lua parsing/serialization + round-trips. |
| src/variables/public/SolarSystems.ps1 | Removes template variable content. |
| src/variables/public/Planets.ps1 | Removes template variable content. |
| src/variables/public/Moons.ps1 | Removes template variable content. |
| src/variables/private/PrivateVariables.ps1 | Removes template private variables. |
| src/types/FileInfo.Types.ps1xml | Removes template type extension. |
| src/types/DirectoryInfo.Types.ps1xml | Removes template type extensions. |
| src/scripts/loader.ps1 | Removes template loader script. |
| src/modules/OtherPSModule.psm1 | Removes placeholder module code. |
| src/manifest.psd1 | Removes template manifest override file. |
| src/init/initializer.ps1 | Removes template initializer script. |
| src/header.ps1 | Removes template header script. |
| src/functions/public/completers.ps1 | Removes template argument completer. |
| src/functions/public/Test-PSModuleTest.ps1 | Removes placeholder public function. |
| src/functions/public/SomethingElse/SomethingElse.md | Removes template docs page. |
| src/functions/public/SomethingElse/Set-PSModuleTest.ps1 | Removes placeholder function. |
| src/functions/public/PSModule/PSModule.md | Removes template docs page. |
| src/functions/public/PSModule/New-PSModuleTest.ps1 | Removes placeholder public function. |
| src/functions/public/PSModule/Get-PSModuleTest.ps1 | Removes placeholder public function. |
| src/functions/public/Lua/ConvertTo-Lua.ps1 | Adds public serializer wrapper cmdlet. |
| src/functions/public/Lua/ConvertFrom-Lua.ps1 | Adds public parser wrapper cmdlet. |
| src/functions/private/Skip-LuaWhitespace.ps1 | Adds parser helper to skip whitespace/comments. |
| src/functions/private/Read-LuaValue.ps1 | Adds value-dispatch for parser (tables/strings/numbers/keywords). |
| src/functions/private/Read-LuaTable.ps1 | Adds table constructor parsing logic (sequence/key-value/mixed). |
| src/functions/private/Read-LuaString.ps1 | Adds quoted string parsing with escape handling. |
| src/functions/private/Read-LuaNumber.ps1 | Adds number parsing (int/float/hex/scientific/hex-float). |
| src/functions/private/Read-LuaMultiLineString.ps1 | Adds [[...]] multiline string parsing helper. |
| src/functions/private/Read-LuaHexFloat.ps1 | Adds hex-float parsing helper (e.g. 0x1.fp10). |
| src/functions/private/Format-LuaKey.ps1 | Adds key formatting (bare identifier vs ["..."]) for serialization. |
| src/functions/private/ConvertTo-LuaTable.ps1 | Adds recursive serializer implementation with depth/compress options. |
| src/functions/private/ConvertFrom-LuaTable.ps1 | Adds top-level parse entrypoint with optional leading return. |
| src/formats/Mygciview.Format.ps1xml | Removes template format view. |
| src/formats/CultureInfo.Format.ps1xml | Removes template format view. |
| src/finally.ps1 | Removes template final loader script. |
| src/data/Settings.psd1 | Removes template data file. |
| src/data/Config.psd1 | Removes template data file. |
| src/classes/public/Book.ps1 | Removes template demo classes. |
| src/classes/private/SecretWriter.ps1 | Removes template demo class. |
| src/README.md | Removes template README under src/. |
| examples/General.ps1 | Updates examples to demonstrate Lua conversion cmdlets. |
| README.md | Replaces template README with module-focused documentation and examples. |
| .github/workflows/Process-PSModule.yml | Bumps referenced Process-PSModule workflow version. |
| .github/linters/.codespellrc | Updates codespell ignore list for test data terms. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
✅ New prerelease: PowerShell Gallery - Lua 0.1.0-init001 |
|
✅ New prerelease: GitHub - Lua v0.1.0-init001 |
…examples for ConvertFrom-Lua
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
|
✅ New prerelease: PowerShell Gallery - Lua 0.1.0-init002 |
|
✅ New prerelease: GitHub - Lua v0.1.0-init002 |
…ance tests for various assignment scenarios
…WSavedVariables.json
Super-linter summary
Super-linter detected linting errors For more information, see the GitHub Actions workflow run Powered by Super-linter LUAPOWERSHELL |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 58 out of 59 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Assignment parser now accepts semicolons between statements (A = 1; B = 2) - Assignment-detection lookahead uses Skip-LuaWhitespace to handle comments between identifier and '=' - Added tests for both scenarios
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…, optimize comment skipping
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bumps [PSModule/Process-PSModule/.github/workflows/workflow.yml](https://github.com/psmodule/process-psmodule) from 5.4.3 to 5.4.7. - [Release notes](https://github.com/psmodule/process-psmodule/releases) - [Commits](PSModule/Process-PSModule@60bdf8a...1111791) --- updated-dependencies: - dependency-name: PSModule/Process-PSModule/.github/workflows/workflow.yml dependency-version: 5.4.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
|
✅ New release: PowerShell Gallery - Lua 1.0.0 |
|
✅ New release: GitHub - Lua v1.0.0 |
PowerShell objects can now be serialized to Lua table constructor strings and deserialized back — enabling round-trip data conversion between PowerShell and Lua configuration files. This is useful for managing configuration data in Lua-based applications such as World of Warcraft addons (e.g., ElvUI).
New:
ConvertTo-Lua— serialize PowerShell objects to LuaConvertTo-Luaconverts hashtables, ordered dictionaries,PSCustomObjects, arrays, and primitives into valid Lua table constructor strings per the Lua 5.4 grammar §3.4.9.Parameters:
-InputObject-Depth-Compress-EnumsAsStrings-AsArrayProperties with
$nullvalues are omitted from output (per Lua's nil-means-absent semantics). Keys use bare identifiers when valid per Lua grammar; bracket-quote notation otherwise.New:
ConvertFrom-Lua— deserialize Lua table strings to PowerShell objectsConvertFrom-Luaparses Lua table constructor strings intoPSCustomObjectby default, or ordered hashtable with-AsHashtable.Parameters:
-InputObject-AsHashtable[ordered]hashtable instead ofPSCustomObject-Depth-NoEnumerate[object[]]without pipeline enumerationSupported Lua data types: tables (sequence, key-value, mixed, nested, empty), strings (double-quoted, single-quoted, long strings with all escape sequences), numbers (integer, float, hex, scientific notation), booleans, and nil.
Lua comments (single-line
--and multi-line--[[ ]]) are correctly ignored during parsing.Technical Details
Book.ps1,SecretWriter.ps1,Get-PSModuleTest.ps1,New-PSModuleTest.ps1,Set-PSModuleTest.ps1,Test-PSModuleTest.ps1, format/type XML files, data files, variables, etc.) replaced with actual module implementation.src/functions/public/Lua/ConvertTo-Lua.ps1andsrc/functions/public/Lua/ConvertFrom-Lua.ps1— thin wrappers handling pipeline input, parameter validation, and-AsArray/-NoEnumeratebehavior.ConvertTo-LuaTable.ps1(recursive serializer with depth tracking and 4-space indent),ConvertFrom-LuaTable.ps1(recursive-descent parser with script-scoped state),Format-LuaKey.ps1(Lua identifier validation against pattern[a-zA-Z_][a-zA-Z0-9_]*and reserved word list).-Depthis exceeded.tests/Lua.Tests.ps1covering all Lua data types, comment handling, reserved words as keys, depth limits, parameter switches, round-trip conversion, and error cases. Test data files intests/data/(Lua/JSON pairs) for complex structure validation.