TSRichTextEditor is a TypeScript-first package built around the existing RichTextEditor browser runtime.
This repository focuses on four things:
- keeping the shipping editor runtime intact and synced from the JavaScript project
- exposing a typed browser API for initialization and common editor methods
- giving the repo a clean TypeScript build and demo flow
- producing publishable package outputs for npm, GitHub Packages, and NuGet
src/: typed wrapper and public APIpublic/richtexteditor/: synced runtime assets copied from the JavaScript projectdist/: compiled package output plus runtime filesdemo/: plain browser demo written in TypeScriptnuget/TSRichTextEditor.AspNetCore/: ASP.NET Core static web assets package projectscripts/: runtime sync, build, and packaging helpers
npm install
npm run build
npm run demo:serveThen open:
http://127.0.0.1:4174/demo/index.html
Runtime assets are copied from the sibling JavaScript repo at:
../JSRichTextEditor/RichTextEditorJS/Demos/AspNetCoreRazor/wwwroot/richtexteditor
Run npm run sync:runtime any time the JavaScript editor runtime changes.
Build the normal package output and create the local tarball:
npm run build
npm packGitHub's npm registry requires a scoped package name, so this repo keeps the standard package name for local/npm use and generates a scoped publish variant only for GitHub Packages.
Create the GitHub-ready tarball:
npm run pack:githubOptional environment variables:
GITHUB_PACKAGE_SCOPE: package scope to use, without the leading@GITHUB_REPOSITORY: repository inowner/repoform, used for metadataGITHUB_REPOSITORY_OWNER: fallback scope source
If no scope is provided, the scripts default to richscripts.
Publish to GitHub Packages:
npm run publish:githubAuthentication can come from either a local .npmrc or NODE_AUTH_TOKEN.
Build the ASP.NET Core static web assets package:
npm run pack:nugetThat produces a .nupkg in artifacts/nuget/.
The NuGet package exposes the editor files through ASP.NET Core static web assets under:
/_content/TSRichTextEditor.AspNetCore/ts-rich-text-editor/dist/index.js/_content/TSRichTextEditor.AspNetCore/ts-rich-text-editor/dist/richtexteditor
This repo also includes .github/workflows/publish-packages.yml for:
- publishing the scoped npm variant to GitHub Packages
- building the NuGet package
- pushing the NuGet package to nuget.org when
NUGET_API_KEYis configured
The editor core is still the existing browser runtime, but the package surface is now TypeScript:
- typed
createRichTextEditor(...) - typed runtime loader
- typed option and instance interfaces
- typed browser globals for
window.RichTextEditor
That keeps the package practical for immediate use while the underlying runtime remains aligned with the shipping editor.