Skip to content

Commit 2653057

Browse files
Merge pull request #221 from StartAutomating/MorePipeScript
0.1.3
2 parents 624734b + af80af0 commit 2653057

File tree

145 files changed

+5149
-1428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+5149
-1428
lines changed

.github/workflows/TestAndPublish.yml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ jobs:
410410
run: |
411411
$Parameters = @{}
412412
$Parameters.ModulePath = ${env:ModulePath}
413+
$Parameters.Exclude = ${env:Exclude}
414+
$Parameters.Exclude = $parameters.Exclude -split ';' -replace '^[''"]' -replace '[''"]$'
413415
foreach ($k in @($parameters.Keys)) {
414416
if ([String]::IsNullOrEmpty($parameters[$k])) {
415417
$parameters.Remove($k)
@@ -418,19 +420,33 @@ jobs:
418420
Write-Host "::debug:: PublishPowerShellGallery $(@(foreach ($p in $Parameters.GetEnumerator()) {'-' + $p.Key + ' ' + $p.Value}) -join ' ')"
419421
& {param(
420422
[string]
421-
$ModulePath
423+
$ModulePath,
424+
425+
[string[]]
426+
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg', '*.gif', 'docs[/\]*')
422427
)
428+
423429
$gitHubEvent = if ($env:GITHUB_EVENT_PATH) {
424430
[IO.File]::ReadAllText($env:GITHUB_EVENT_PATH) | ConvertFrom-Json
425431
} else { $null }
426432
433+
if (-not $Exclude) {
434+
$Exclude = @('*.png', '*.mp4', '*.jpg','*.jpeg', '*.gif','docs[/\]*')
435+
}
436+
427437
428438
@"
429439
::group::GitHubEvent
430440
$($gitHubEvent | ConvertTo-Json -Depth 100)
431441
::endgroup::
432442
"@ | Out-Host
433443
444+
@"
445+
::group::PSBoundParameters
446+
$($PSBoundParameters | ConvertTo-Json -Depth 100)
447+
::endgroup::
448+
"@ | Out-Host
449+
434450
if (-not ($gitHubEvent.head_commit.message -match "Merge Pull Request #(?<PRNumber>\d+)") -and
435451
(-not $gitHubEvent.psobject.properties['inputs'])) {
436452
"::warning::Pull Request has not merged, skipping Gallery Publish" | Out-Host
@@ -473,9 +489,24 @@ jobs:
473489
if (Test-Path $moduleGitPath) {
474490
Remove-Item -Recurse -Force $moduleGitPath
475491
}
492+
493+
if ($Exclude) {
494+
"::notice::Attempting to Exlcude $exclude" | Out-Host
495+
Get-ChildItem $moduleTempPath -Recurse |
496+
Where-Object {
497+
foreach ($ex in $exclude) {
498+
if ($_.FullName -like $ex) {
499+
"::notice::Excluding $($_.FullName)" | Out-Host
500+
return $true
501+
}
502+
}
503+
} |
504+
Remove-Item
505+
}
506+
476507
Write-Host "Module Files:"
477508
Get-ChildItem $moduleTempPath -Recurse
478-
Write-Host "Publishing $moduleName [$($imported.Version)] to Gallery"
509+
Write-Host "Publishing $moduleName [$($imported.Version)] to Gallery"
479510
Publish-Module -Path $moduleTempPath -NuGetApiKey $gk
480511
if ($?) {
481512
Write-Host "Published to Gallery"
@@ -485,39 +516,18 @@ jobs:
485516
}
486517
}
487518
} @Parameters
488-
UsePiecemeal:
489-
runs-on: ubuntu-latest
490-
if: ${{ success() }}
491-
steps:
492-
- name: Check out repository
493-
uses: actions/checkout@v2
494-
- name: UsePiecemeal
495-
uses: StartAutomating/Piecemeal@main
496-
BuildPipeScript:
519+
BuildModule:
497520
runs-on: ubuntu-latest
498521
if: ${{ success() }}
499522
steps:
500523
- name: Check out repository
501524
uses: actions/checkout@v2
502525
- name: BuildPipeScript
503526
uses: StartAutomating/PipeScript@main
504-
RunEZOut:
505-
runs-on: ubuntu-latest
506-
if: ${{ success() }}
507-
steps:
508-
- name: Check out repository
509-
uses: actions/checkout@v2
510527
- name: UseEZOut
511528
uses: StartAutomating/EZOut@master
512-
- name: Push Changes
513-
shell: pwsh
514-
run: git push; exit 0
515-
HelpOut:
516-
runs-on: ubuntu-latest
517-
if: ${{ success() }}
518-
steps:
519-
- name: Check out repository
520-
uses: actions/checkout@v2
529+
- name: UsePiecemeal
530+
uses: StartAutomating/Piecemeal@main
521531
- name: UseHelpOut
522532
uses: StartAutomating/HelpOut@master
523533
env:

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 0.1.3:
2+
* New Protocols: UDP (Fixes #208)
3+
* New Inline Language Support:
4+
* ADA (Fixes #207)
5+
* Basic/VB/VBScript (Fixes #206)
6+
* R (Fixes #204)
7+
* SQL (Fixes #200)
8+
* TCL/TK (Fixes #205)
9+
* Keyword improvements:
10+
* new keyword now allows static members as constructor arguments (Fixes #214)
11+
* until keyword uses do{} until (Fixes #217)
12+
* General Improvements:
13+
* Core Transpiler now respects .Rank (Fixes #210 #211)
14+
* New-PipeScript:
15+
* Fixing -Link behavior (Fixes #201)
16+
* Trimming ends of examples (Fixes #202)
17+
* Plurally aliasing -Examples and -Links (Fixes #203)
18+
* Search-PipeScript:
19+
* Now supports plural aliases for -RegularExpression (Fixes #219)
20+
* ParameterTypeConstraint now ignores [ordered] (Fixes #190)
21+
* Extended Type System Improvements:
22+
* [ScriptBlock].Transpile() now throws (Fixes #212)
23+
---
24+
125
## 0.1.2:
226
* New Inline Language support
327
* Batch support (Fixes #198)

ListOfTranspilers.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
These are all of the transpilers currently included in PipeScript:
2+
3+
4+
5+
|Name |Synopsis |
6+
|-------------------------------------------------------------------------------------------------|-------------------------------------------------|
7+
|[Aliases](Transpilers/Parameters/Aliases.psx.ps1) |Dynamically Defines Aliases |
8+
|[Assert](Transpilers/Keywords/Assert.psx.ps1) |Assert keyword |
9+
|[Await](Transpilers/Keywords/Await.psx.ps1) |awaits asynchronous operations |
10+
|[Bash](Transpilers/Wrappers/Bash.psx.ps1) |Wraps PowerShell in a Bash Script |
11+
|[Batch](Transpilers/Wrappers/Batch.psx.ps1) |Wraps PowerShell in a Windows Batch Script |
12+
|[BatchPowerShell](Transpilers/Wrappers/BatchPowerShell.psx.ps1) |Wraps PowerShell in a Windows Batch Script |
13+
|[Decorate](Transpilers/Decorate.psx.ps1) |
14+
|[Dot](Transpilers/Syntax/Dot.psx.ps1) |Dot Notation |
15+
|[EqualityComparison](Transpilers/Syntax/EqualityComparison.psx.ps1) |Allows equality comparison. |
16+
|[EqualityTypeComparison](Transpilers/Syntax/EqualityTypeComparison.psx.ps1) |Allows equality type comparison. |
17+
|[Explicit](Transpilers/Explicit.psx.ps1) |Makes Output from a PowerShell function Explicit.|
18+
|[Help](Transpilers/Help.psx.ps1) |Help Transpiler |
19+
|[Http.Protocol](Transpilers/Protocols/Http.Protocol.psx.ps1) |http protocol |
20+
|[Include](Transpilers/Include.psx.ps1) |Includes Files |
21+
|[Inline.ADA](Transpilers/Inline/Inline.ADA.psx.ps1) |ADA PipeScript Transpiler. |
22+
|[Inline.ATOM](Transpilers/Inline/Inline.ATOM.psx.ps1) |ATOM Inline PipeScript Transpiler. |
23+
|[Inline.Bash](Transpilers/Inline/Inline.Bash.psx.ps1) |Bash PipeScript Transpiler. |
24+
|[Inline.Basic](Transpilers/Inline/Inline.Basic.psx.ps1) |Basic PipeScript Transpiler. |
25+
|[Inline.Batch](Transpilers/Inline/Inline.Batch.psx.ps1) |Batch PipeScript Transpiler. |
26+
|[Inline.Bicep](Transpilers/Inline/Inline.Bicep.psx.ps1) |Bicep Inline PipeScript Transpiler. |
27+
|[Inline.CPlusPlus](Transpilers/Inline/Inline.CPlusPlus.psx.ps1) |C/C++ PipeScript Transpiler. |
28+
|[Inline.CSharp](Transpilers/Inline/Inline.CSharp.psx.ps1) |C# Inline PipeScript Transpiler. |
29+
|[Inline.CSS](Transpilers/Inline/Inline.CSS.psx.ps1) |CSS Inline PipeScript Transpiler. |
30+
|[Inline.Go](Transpilers/Inline/Inline.Go.psx.ps1) |Go PipeScript Transpiler. |
31+
|[Inline.HLSL](Transpilers/Inline/Inline.HLSL.psx.ps1) |HLSL Inline PipeScript Transpiler. |
32+
|[Inline.HTML](Transpilers/Inline/Inline.HTML.psx.ps1) |HTML PipeScript Transpiler. |
33+
|[Inline.Java](Transpilers/Inline/Inline.Java.psx.ps1) |Java Inline PipeScript Transpiler. |
34+
|[Inline.JavaScript](Transpilers/Inline/Inline.JavaScript.psx.ps1) |JavaScript Inline PipeScript Transpiler. |
35+
|[Inline.Json](Transpilers/Inline/Inline.Json.psx.ps1) |JSON PipeScript Transpiler. |
36+
|[Inline.Kotlin](Transpilers/Inline/Inline.Kotlin.psx.ps1) |Kotlin Inline PipeScript Transpiler. |
37+
|[Inline.Markdown](Transpilers/Inline/Inline.Markdown.psx.ps1) |Markdown File Transpiler. |
38+
|[Inline.ObjectiveC](Transpilers/Inline/Inline.ObjectiveC.psx.ps1) |Objective C PipeScript Transpiler. |
39+
|[Inline.OpenSCAD](Transpilers/Inline/Inline.OpenSCAD.psx.ps1) |OpenSCAD Inline PipeScript Transpiler. |
40+
|[Inline.Perl](Transpilers/Inline/Inline.Perl.psx.ps1) |Perl Inline PipeScript Transpiler. |
41+
|[Inline.PHP](Transpilers/Inline/Inline.PHP.psx.ps1) |PHP PipeScript Transpiler. |
42+
|[Inline.PSD1](Transpilers/Inline/Inline.PSD1.psx.ps1) |PSD1 Inline PipeScript Transpiler. |
43+
|[Inline.Python](Transpilers/Inline/Inline.Python.psx.ps1) |Python Inline PipeScript Transpiler. |
44+
|[Inline.R](Transpilers/Inline/Inline.R.psx.ps1) |R PipeScript Transpiler. |
45+
|[Inline.Razor](Transpilers/Inline/Inline.Razor.psx.ps1) |Razor Inline PipeScript Transpiler. |
46+
|[Inline.RSS](Transpilers/Inline/Inline.RSS.psx.ps1) |RSS Inline PipeScript Transpiler. |
47+
|[Inline.Ruby](Transpilers/Inline/Inline.Ruby.psx.ps1) |Ruby Inline PipeScript Transpiler. |
48+
|[Inline.Rust](Transpilers/Inline/Inline.Rust.psx.ps1) |Rust Inline PipeScript Transpiler. |
49+
|[Inline.SQL](Transpilers/Inline/Inline.SQL.psx.ps1) |SQL PipeScript Transpiler. |
50+
|[Inline.TCL](Transpilers/Inline/Inline.TCL.psx.ps1) |TCL/TK PipeScript Transpiler. |
51+
|[Inline.TOML](Transpilers/Inline/Inline.TOML.psx.ps1) |TOML Inline PipeScript Transpiler. |
52+
|[Inline.TypeScript](Transpilers/Inline/Inline.TypeScript.psx.ps1) |TypeScript Inline PipeScript Transpiler. |
53+
|[Inline.XML](Transpilers/Inline/Inline.XML.psx.ps1) |XML Inline PipeScript Transpiler. |
54+
|[Inline.YAML](Transpilers/Inline/Inline.YAML.psx.ps1) |Yaml File Transpiler. |
55+
|[ModuleExports](Transpilers/Modules/ModuleExports.psx.ps1) |Gets Module Exports |
56+
|[ModuleRelationship](Transpilers/Modules/ModuleRelationship.psx.ps1) |Gets Module Relationships |
57+
|[New](Transpilers/Keywords/New.psx.ps1) |'new' keyword |
58+
|[OutputFile](Transpilers/OutputFile.psx.ps1) |Outputs to a File |
59+
|[PipedAssignment](Transpilers/Syntax/PipedAssignment.psx.ps1) |Piped Assignment Transpiler |
60+
|[PipeScript.AttributedExpression](Transpilers/Core/PipeScript.AttributedExpression.psx.ps1) |The PipeScript AttributedExpression Transpiler |
61+
|[Pipescript.FunctionDefinition](Transpilers/Core/Pipescript.FunctionDefinition.psx.ps1) |PipeScript Function Transpiler |
62+
|[PipeScript.Inline](Transpilers/Core/PipeScript.Inline.psx.ps1) |Inline Transpiler |
63+
|[PipeScript.ParameterAttribute](Transpilers/Core/PipeScript.ParameterAttribute.psx.ps1) |
64+
|[PipeScript.ParameterTypeConstraint](Transpilers/Core/PipeScript.ParameterTypeConstraint.psx.ps1)|Transpiles Parameter Type Constraints |
65+
|[PipeScript.Protocol](Transpilers/Core/PipeScript.Protocol.psx.ps1) |Core Protocol Transpiler |
66+
|[Pipescript](Transpilers/Core/Pipescript.psx.ps1) |The Core PipeScript Transpiler |
67+
|[PipeScript.TypeExpression](Transpilers/Core/PipeScript.TypeExpression.psx.ps1) |The PipeScript TypeExpression Transpiler |
68+
|[ProxyCommand](Transpilers/ProxyCommand.psx.ps1) |Creates Proxy Commands |
69+
|[RegexLiteral](Transpilers/Syntax/RegexLiteral.psx.ps1) |Regex Literal Transpiler |
70+
|[RemoveParameter](Transpilers/Parameters/RemoveParameter.psx.ps1) |Removes Parameters from a ScriptBlock |
71+
|[RenameVariable](Transpilers/RenameVariable.psx.ps1) |Renames variables |
72+
|[Rest](Transpilers/Rest.psx.ps1) |Generates PowerShell to talk to a REST api. |
73+
|[UDP.Protocol](Transpilers/Protocols/UDP.Protocol.psx.ps1) |udp protocol |
74+
|[Until](Transpilers/Keywords/Until.psx.ps1) |until keyword |
75+
|[ValidateExtension](Transpilers/Parameters/ValidateExtension.psx.ps1) |Validates Extensions |
76+
|[ValidatePlatform](Transpilers/Parameters/ValidatePlatform.psx.ps1) |Validates the Platform |
77+
|[ValidatePropertyName](Transpilers/Parameters/ValidatePropertyName.psx.ps1) |Validates Property Names |
78+
|[ValidateScriptBlock](Transpilers/Parameters/ValidateScriptBlock.psx.ps1) |Validates Script Blocks |
79+
|[ValidateTypes](Transpilers/Parameters/ValidateTypes.psx.ps1) |Validates if an object is one or more types. |
80+
|[VBN](Transpilers/Parameters/VBN.psx.ps1) |ValueFromPiplineByPropertyName Shorthand |
81+
|[VFP](Transpilers/Parameters/VFP.psx.ps1) |ValueFromPipline Shorthand |
82+
83+
84+

ListOfTranspilers.ps1.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
These are all of the transpilers currently included in PipeScript:
2+
3+
4+
~~~PipeScript{
5+
[PSCustomObject]@{
6+
Table = Get-Transpiler |
7+
Sort-Object Name |
8+
Select-Object @{
9+
Name = 'Name'
10+
Expression = {
11+
"[$($_.DisplayName)]($($_.Source -replace '^.+(?=Transpilers)'))"
12+
}
13+
},
14+
Synopsis
15+
}
16+
}
17+
~~~

New-PipeScript.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ HTTP Accept indicates what content types the web request will accept as a respon
166166
[string]
167167
$Synopsis,
168168
# A list of examples to use in help. Will be ignored if -Synopsis and -Description are not passed.
169+
[Alias('Examples')]
169170
[string[]]
170171
$Example,
171172
# A list of links to use in help. Will be ignored if -Synopsis and -Description are not passed.
173+
[Alias('Links')]
172174
[string[]]
173175
$Link,
174176
# A list of attributes to declare on the scriptblock.
@@ -201,7 +203,7 @@ HTTP Accept indicates what content types the web request will accept as a respon
201203
if ($Synopsis -and $Description) {
202204
function indentHelpLine {
203205
foreach ($line in $args -split '(?>\r\n|\n)') {
204-
(' ' * 4) + $line.Trim()
206+
(' ' * 4) + $line.TrimEnd()
205207
}
206208

207209
}
@@ -218,7 +220,7 @@ HTTP Accept indicates what content types the web request will accept as a respon
218220
}
219221
foreach ($helplink in $Link) {
220222
".Link"
221-
indentHelpLine $link
223+
indentHelpLine $helplink
222224
}
223225
"#>"
224226
) -join [Environment]::Newline
@@ -311,14 +313,18 @@ HTTP Accept indicates what content types the web request will accept as a respon
311313
$parameter -is [Reflection.MethodInfo] -or
312314
$parameter -as [Reflection.MethodInfo[]]
313315
) {
316+
# check to see if it's a method
314317
if ($parameter -is [Reflection.MethodInfo] -or
315318
$parameter -as [Reflection.MethodInfo[]]) {
316319
$parameter = @(foreach ($methodInfo in $parameter) {
317-
$methodInfo.GetParameters()
320+
$methodInfo.GetParameters() # if so, reflect the method's parameters
318321
})
319322
}
323+
# Walk over each parameter
320324
foreach ($prop in $Parameter) {
325+
# If it is a property info that cannot be written, skip.
321326
if ($prop -is [Reflection.PropertyInfo] -and -not $prop.CanWrite) { continue }
327+
# Determine the reflected parameter type.
322328
$paramType =
323329
if ($prop.ParameterType) {
324330
$prop.ParameterType

0 commit comments

Comments
 (0)