create .NET Interactive extension package#155
create .NET Interactive extension package#155cartermp merged 11 commits intofslaborg:masterfrom colombod:create_interactive_extension
Conversation
cartermp
left a comment
There was a problem hiding this comment.
To get CI to pass I think we'll also have to change the tool manifest file and pull in the very latest version of paket and fake-cli
| let newScript = StringBuilder() | ||
| newScript.AppendLine("""<script type="text/javascript">""") |> ignore | ||
| newScript.AppendLine(""" | ||
| var renderPlotly = function() { | ||
| var xplotRequire = require.config({context:'xplot-3.0.1',paths:{plotly:'https://cdn.plot.ly/plotly-1.49.2.min'}}) || require; | ||
| xplotRequire(['plotly'], function(Plotly) {" """) |> ignore | ||
| newScript.AppendLine(script) |> ignore | ||
| newScript.AppendLine(@"}); | ||
| };" | ||
| ) |> ignore | ||
| newScript.AppendLine(JavascriptUtilities.GetCodeForEnsureRequireJs(Uri("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"), "renderPlotly")) |> ignore | ||
| newScript.ToString() |
There was a problem hiding this comment.
Just for fun, this can now be an interpolated string since it's using the .NET 5 SDK
NuGet.config
Outdated
| <add key="dotnet3-dev" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" /> | ||
| <add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" /> | ||
| <add key="MachineLearning" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json" /> | ||
| <add key="PSGallery" value="https://www.powershellgallery.com/api/v2/" /> |
There was a problem hiding this comment.
Unless you are going to pull PowerShell modules in this repo, this feed probably should be removed.
There was a problem hiding this comment.
I think I have to implement in this repo the code that the powershell kernel was doing to integrate the xplot types. What do you think?
There was a problem hiding this comment.
Yes, the New-PlotyChart cmdlet needs to be moved here. But the PSGallery is not needed for that. You will need to reference to PowerShellStandard.Library.
| override _.BeginProcessing() = () | ||
|
|
||
| override _.ProcessRecord() = () |
There was a problem hiding this comment.
Please do the same as the original implementation. This makes sure the piping behavior is as expected.
private List<Trace> _traces;
/// <summary>
/// BeginProcessing override.
/// </summary>
protected override void BeginProcessing()
{
_traces = new List<Trace>();
}
/// <summary>
/// ProcessRecord override.
/// </summary>
protected override void ProcessRecord()
{
_traces.AddRange(Trace);
}
NuGet.config
Outdated
| <add key="dotnet3-dev" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" /> | ||
| <add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" /> | ||
| <add key="MachineLearning" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json" /> | ||
| <add key="PSGallery" value="https://www.powershellgallery.com/api/v2/" /> |
|
|
||
|
|
||
| override this.EndProcessing() = | ||
| let traces = if isNull this.Trace then [||] else this.Trace |
Add .NET Interactive extension pakcage