Skip to content

feat!: emit esm package#206

Open
elringus wants to merge 12 commits into
mainfrom
feat/es-modules
Open

feat!: emit esm package#206
elringus wants to merge 12 commits into
mainfrom
feat/es-modules

Conversation

@elringus
Copy link
Copy Markdown
Owner

@elringus elringus commented May 19, 2026

Resolves #161 by switching to the modern ES module shape of the generated package.

Example

Given C# source:

namespace Greeter;

public partial class Api
{
    [Export]  public static string Hello (string name) => $"Hello, {name}!";
    [Import]  public static partial void Log (string message);
}

Before (all bindings under root package):

import { Greeter } from "bootsharp";

Greeter.Api.log = msg => console.log(msg);
const greeting = Greeter.Api.hello("world");

Now (bindings grouped by module):

import { Api } from "bootsharp/greeter";

Api.log = msg => console.log(msg);
const greeting = Api.hello("world");

Breaking changes

  • Bindings no longer emitted under the root module, but grouped under ES modules per C# namespace
  • Preferences changed:
    • Function renamed to Method
    • Type renamed to Name
    • Added Property and Event
  • Bootsharp no longer auto-trims I from interfaces; use the preferences to do this if desired
  • MSBuild targets renamed:
    • BootsharpEmit -> BootsharpCS
    • BootsharpPack -> BootsharpJS

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (40399bc) to head (92fa32e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #206   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           57        59    +2     
  Lines         2785      2726   -59     
  Branches       458       457    -1     
=========================================
- Hits          2785      2726   -59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore mapping C# spaces to ES modules

1 participant