npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@findsl/editor

v1.0.1

Published

Einbettbarer FinDSL-Editor (Monaco + @findsl/web-LSP-Worker). mountFindslEditor() liefert Editor + check/generate — ohne Preview-/Ergebnis-UI.

Readme

@findsl/editor

Einbettbarer FinDSL-Editor (Monaco + @findsl/web-LSP-Worker) für Bundler-basierte Websites. mountFindslEditor() liefert den Editor mit VS-Code-paritätischem Highlighting, Diagnostics, CodeLens „Testfälle ausführen", Gutter-Play-Pfeilen — plus check()/generate().

Scope: nur Editor + check/generate. Die Preview-/Ergebnis-UI (Tabs, Artefakt-Rendering, PDF/PAP) bleibt beim Konsumenten.

Installation

@findsl/editor hält den (versionssensiblen) Monaco-Stack als peerDependencies — der Konsument installiert ihn, damit genau eine @codingame/*-Instanz existiert (sonst Service-Init-Deadlock):

npm i @findsl/editor @findsl/web \
  monaco-languageclient \
  @codingame/[email protected] \
  @codingame/[email protected] \
  @codingame/[email protected]

Die @codingame/*-Versionen müssen im Lockstep sein (alle 25.1.2) — Minor-Drift zwischen -api und -editor-api ist eine bekannte Bruchquelle.

Worker hosten

Der LSP-Worker (@findsl/web/dist, ~2 MB mit Lazy-Chunks) wird als statisches Asset ausgeliefert — kein Re-Bundling. Ein mitgeliefertes Bin kopiert ihn:

// package.json
{
  "scripts": {
    "predev":   "findsl-editor-copy-worker",   // → public/findsl-web/
    "prebuild": "findsl-editor-copy-worker"
  }
}

mountFindslEditor lädt ihn per Default root-absolut unter /findsl-web/worker.js — funktioniert auch auf Unterseiten. Abweichendes Hosting über workerUrl.

Hinweis: Hostest du den Worker NICHT am Root (z. B. unter einem Base-Path), setze workerUrl explizit. Ein nicht gefundener Worker äußert sich als irreführendes Illegal worker configuration detected — der Editor mountet, scheitert erst an der Worker-Connection.

Vite-Konfiguration

@findsl/editor ist Vite-first (webpack/CDN: best effort, ungetestet). Der Monaco-Stack braucht ES-Module-Worker + Pre-Bundling:

import importMetaUrlPlugin from '@codingame/esbuild-import-meta-url-plugin';

export default {
  worker: { format: 'es' },
  optimizeDeps: {
    include: [
      'monaco-languageclient/vscodeApiWrapper',
      'monaco-languageclient/editorApp',
      'monaco-languageclient/lcwrapper',
      'monaco-languageclient/workerFactory',
      '@codingame/monaco-vscode-configuration-service-override',
      '@codingame/monaco-vscode-editor-api',
      '@codingame/monaco-vscode-api/extensions',
    ],
    esbuildOptions: { plugins: [importMetaUrlPlugin] },
  },
};

Verwendung

import { mountFindslEditor } from '@findsl/editor';

const editor = await mountFindslEditor(document.getElementById('app')!, {
  initialCode: 'modul beispiel\n',
  theme: 'auto',                       // 'light' | 'dark' | 'auto' | ThemeSpec
  appearance: { fontFamily: "'IBM Plex Mono', monospace" },
  onRun: () => void runPruefen(),      // CodeLens / Gutter-Play
});

const result = await editor.check();              // CheckResult
const java   = await editor.generate('java');     // GenerateResult
const wert   = await editor.evaluate('Kst(50000)'); // EvalResult: { value, type, text }
editor.getCode();
editor.setCode('…');
editor.dispose();

Theme an ein eigenes Design-System koppeln

theme akzeptiert einen ThemeSpec mit aufgelösten sRGB-Hex (kein oklch):

const handle = await mountFindslEditor(el, {
  theme: { base: 'dark', colorCustomizations: { 'editor.background': '#050f13' } },
});
// Bei eigenem Theme-Wechsel zur Laufzeit:
handle.setTheme({ base: 'light', colorCustomizations: { 'editor.background': '#fdfcfa' } });

Die Theme-Quelle (CSS-Var, data-theme, Toggle) bleibt beim Konsumenten; das Paket liest kein DOM-Attribut. 'auto' folgt prefers-color-scheme live.

CSS-Custom-Properties / data-theme (Convenience): Hat dein Design-System oklch-Tokens + einen data-theme-Toggle, kapselt der optionale Helfer themeFromCssVars das Auflösen zu sRGB-Hex (Canvas-Probe) und das Lesen der Basis — kein API-Zwang:

import { mountFindslEditor, themeFromCssVars } from '@findsl/editor';

const colorMap = { 'editor.background': '--paper', 'editorGutter.background': '--paper' };
const handle = await mountFindslEditor(el, { theme: themeFromCssVars(colorMap) });

// Editor dem Theme-Toggle folgen lassen:
new MutationObserver(() => handle.setTheme(themeFromCssVars(colorMap)))
  .observe(document.documentElement, { attributeFilter: ['data-theme'] });

Gutter-Play-Pfeile (CSS)

Die Play-Pfeile je testfall nutzen die Klasse findsl-editor__playglyph — der Konsument stylt sie (z. B. ein ▶-Glyph):

.findsl-editor__playglyph::before { content: '▶'; cursor: pointer; }

API

mountFindslEditor(container, options?) → Promise<FindslEditorHandle>

| Handle | | |--------|--| | getCode() / setCode(code) | Inhalt lesen/setzen (setCode löst onChange nicht aus) | | check() | findsl/checkCheckResult | | generate(target) | findsl/generateGenerateResult | | evaluate(expr) | findsl/evalEvalResult (Ausdruck im Dokument-Scope) | | onChange(fn) / onRun(fn) | Listener; geben Unsubscribe zurück | | setTheme(theme) | Theme zur Laufzeit | | dispose() | alle Wrapper + Listener abräumen | | advanced.{client, uri} | Escape-Hatch (KEINE stabile API) |

Lizenz

EUPL-1.2 — siehe LICENSE im Repo-Root.