feat!: emit esm package by elringus · Pull Request #206 · elringus/bootsharp · GitHub
Skip to content

feat!: emit esm package#206

Merged
elringus merged 13 commits into
mainfrom
feat/es-modules
May 20, 2026
Merged

feat!: emit esm package#206
elringus merged 13 commits into
mainfrom
feat/es-modules

Conversation

@elringus

@elringus elringus commented May 19, 2026

Copy link
Copy Markdown
Owner

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

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

@elringus elringus merged commit c6f5d42 into main May 20, 2026
8 checks passed
@elringus elringus deleted the feat/es-modules branch May 20, 2026 15:40
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