Question: Interest in replacing build-grammar.js with a purely PowerShell solution?

Open
#159 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, powershell

Research direction

Start by comparing tools/build-grammar.js with the referenced build_grammar.ps1 and the PwshReadXmlPList implementation. Check whether their generated JSON and PowerShell version requirements match the existing build behavior. The issue is a proposal, so completion criteria and maintainer direction are not established.

Written by the indexing model from the issue text.

Description

Would there be any interest in replacing the build-grammar.js script (in tools) with a purely PowerShell based solution? I have created a script/function/class that provides the equivalent of 'fast-plist' using the .NET XML reader and a PowerShell script (using a class) to 'ConvertFrom-Plist'.

Two caveats.

  1. For performance reasons, I used a class, due to the fact that the inner function is highly recursive. The class with static method improved performance in excess of 4:1. This limits to PowerShell 5.0+.
  2. In order to as closely match the formatting of the existing JSON file output, PowerShell 6.0+ is required, and a -replace operation to replace the space indent with tabs.

Reference:
https://github.com/msftrncs/PwshReadXmlPList

https://github.com/msftrncs/EditorSyntax/blob/build_grammar.ps1/tools/build-grammar.ps1

Dominant language
PowerShell
Stars
151
Forks
55
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/EditorSyntax

All issues in PowerShell/EditorSyntax

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.