Jroc.SDK
0.11.7
dotnet add package Jroc.SDK --version 0.11.7
NuGet\Install-Package Jroc.SDK -Version 0.11.7
<PackageReference Include="Jroc.SDK" Version="0.11.7" />
<PackageVersion Include="Jroc.SDK" Version="0.11.7" />
<PackageReference Include="Jroc.SDK" />
paket add Jroc.SDK --version 0.11.7
#r "nuget: Jroc.SDK, 0.11.7"
#:package Jroc.SDK@0.11.7
#addin nuget:?package=Jroc.SDK&version=0.11.7
#tool nuget:?package=Jroc.SDK&version=0.11.7
Jroc.SDK
Jroc.SDK is the consumer-facing NuGet package for compiling JavaScript sources during dotnet build.
It imports MSBuild props/targets, invokes Jroc.Core in-process, and exposes the generated module assembly back to the host project as a normal MSBuild output.
Which package should I use?
Jroc.SDK- Use this when your project should compile JavaScript during
dotnet build.
- Use this when your project should compile JavaScript during
jroc- Use this when you want the standalone CLI/global tool for manual compilation.
Jroc.Core- Use this when you need the compiler as a reusable .NET library.
Jroc.Runtime- Use this when your host application needs the runtime support library used by compiled modules.
Official releases publish Jroc.Runtime, jroc, Jroc.Core, and Jroc.SDK together at the same version. When validating a local feed for SDK consumers, also pack Jroc.Runtime into that feed because host projects reference it directly.
Install
<ItemGroup>
<PackageReference Include="Jroc.SDK" Version="VERSION" />
<PackageReference Include="Jroc.Runtime" Version="VERSION" />
</ItemGroup>
Jroc.Runtime is the package your host references for Jroc.Runtime.JsEngine and the runtime support assembly.
Basic usage
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jroc.SDK" Version="VERSION" />
<PackageReference Include="Jroc.Runtime" Version="VERSION" />
<JrocCompile Include="JavaScript\HostedMathModule.js" />
</ItemGroup>
</Project>
By default:
JrocCompileitems are compiled beforeResolveAssemblyReferences- the generated module assembly is added as a normal
Reference - generated files are written under
$(IntermediateOutputPath)\jroc\<SourceFileName>\
That means a host project can compile against the generated exports contracts with no extra custom .proj file or CLI invocation.
Package/module-id entrypoints work too. For example, if the host project restores the npm package in its own directory:
<JrocCompile Include="@mixmark-io/domino"
CopyToOutputDirectory="true" />
When Include is a module id and RootModuleId is not set, the SDK preserves that module id as the root module id automatically, matching the CLI --moduleid behavior.
JrocCompile metadata and matching properties
You can set metadata per item or apply defaults with properties:
OutputDirectory/JrocOutputRoot- Where generated files are written.
ModuleResolutionBaseDirectory/JrocModuleResolutionBaseDirectory- Base directory used when
Includeis a package/module id instead of a file path. Defaults to$(MSBuildProjectDirectory). Set the project property once for the common case, or use per-item metadata only when a specific item needs an override.
- Base directory used when
RootModuleId/JrocRootModuleId- Optional module id override for the root entry module. For package-style inputs such as
@mixmark-io/domino, you usually do not need to set this because the SDK will use the module id automatically.
- Optional module id override for the root entry module. For package-style inputs such as
ReferenceOutputAssembly/JrocReferenceOutputAssembly- Defaults to
true. When enabled, the generated module assembly is added toReferencebefore assembly resolution.
- Defaults to
CopyToOutputDirectory/JrocCopyToOutputDirectory- Defaults to
false. When enabled, the generated outputs are copied into$(TargetDir)after build.
- Defaults to
EmitPdb/JrocEmitPdb- Defaults to
truefor Debug builds andfalseotherwise.
- Defaults to
Verbose/JrocVerboseAnalyzeUnused/JrocAnalyzeUnusedDiagnosticFilePath/JrocDiagnosticFilePath
MSBuild outputs
After JrocCompile runs, the package populates:
@(JrocCompiledAssembly)- ItemSpec is the generated
.dll - Metadata includes
SourcePath,OutputDirectory,AssemblyName,RuntimeConfigPath,RuntimeAssemblyPath,PdbPath, andRootModuleId
- ItemSpec is the generated
@(JrocGeneratedOutput)- ItemSpec is every generated file
- Metadata includes
Kind(Assembly,AssemblyPdb,RuntimeConfig,RuntimeAssembly,RuntimePdb)
Bundled hosting samples
This package ships the repo hosting samples under samples/ so the packaged samples exercise the same MSBuild/NuGet flow end users consume.
To validate a sample from the .nupkg:
# Download the package (replace VERSION)
$version = "VERSION"
$url = "https://api.nuget.org/v3-flatcontainer/jroc.sdk/$version/jroc.sdk.$version.nupkg"
Invoke-WebRequest -Uri $url -OutFile "Jroc.SDK.$version.nupkg"
# Extract it (a .nupkg is a zip; Expand-Archive expects a .zip extension)
Copy-Item "Jroc.SDK.$version.nupkg" "Jroc.SDK.$version.zip" -Force
Expand-Archive -Path "Jroc.SDK.$version.zip" -DestinationPath "jroc_sdk_pkg" -Force
# Build + run a sample
dotnet build .\jroc_sdk_pkg\samples\Basic\host
dotnet run --project .\jroc_sdk_pkg\samples\Basic\host
If you are validating a locally packed prerelease feed instead of NuGet.org, pack Jroc.Runtime, Jroc.Core, and Jroc.SDK into the same feed, then override JrocPackageVersion (or the individual JrocSdkPackageVersion / JrocRuntimePackageVersion properties) when building the sample. The legacy JavaScriptRuntimePackageVersion property is still accepted as an alias.
Repo hosting sample pattern
samples\Basicandsamples\Typed- The host project references
Jroc.SDKdirectly and declares aJrocCompileitem that points atcompiler\JavaScript\*.js.
- The host project references
samples\Domino- The host project keeps
package.json/package-lock.jsonnext to the.csproj, runsnpm ciin place, and compiles@mixmark-io/dominodirectly using the default module-resolution base.
- The host project keeps
samples\Picocolors- Same flat layout as
Dominobut compiles thepicocolorspackage and calls color/style functions from C#.
- Same flat layout as
Links
- SDK docs: https://github.com/tomacox74/jroc/blob/master/docs/sdk/Index.md
- Source, issues, docs: https://github.com/tomacox74/jroc
- License: Apache-2.0
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Jroc.Core (>= 0.11.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.11.7 | 0 | 6/30/2026 |
| 0.11.6 | 0 | 6/30/2026 |
| 0.11.5 | 8 | 6/29/2026 |
| 0.11.4 | 44 | 6/29/2026 |
| 0.11.3 | 51 | 6/28/2026 |
| 0.11.2 | 52 | 6/27/2026 |
| 0.11.1 | 46 | 6/27/2026 |
| 0.11.0 | 43 | 6/26/2026 |
| 0.10.1 | 75 | 6/23/2026 |
| 0.10.0 | 98 | 6/21/2026 |
| 0.9.32 | 95 | 6/20/2026 |
| 0.9.31 | 96 | 6/20/2026 |
| 0.9.30 | 98 | 6/19/2026 |
| 0.9.29 | 97 | 6/19/2026 |
| 0.9.28 | 94 | 6/17/2026 |