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

@composy/code-editor-core

v0.0.1

Published

Core functionality for code editor based on Monaco Editor

Readme

@composy/code-editor-core

Framework-neutral Monaco Editor runtime for LDesign code editing surfaces.

Features

  • CodeEditor wrapper for value, language, theme, selection, markers, commands and providers.
  • DiffEditor wrapper for original/modified models with automatic disposal.
  • Factory lifecycle helpers for single editor and diff editor instances.
  • Built-in Monaco language extensions for Vue, Svelte, Prisma, GraphQL, TOML and dotenv.
  • Built-in Monaco themes plus custom theme/language registration.
  • LDesign DOM namespace and token-backed UI styles.

Install

pnpm add @composy/code-editor-core monaco-editor

monaco-editor is a peer dependency.

Usage

import {
  createEditor,
  createDiffEditor,
  destroyEditor,
  detectLanguage,
  codeEditorClasses
} from '@composy/code-editor-core'

const editor = createEditor({
  container: document.querySelector('#editor') as HTMLElement,
  value: 'console.log("hello")',
  language: detectLanguage('main.ts'),
  theme: 'github-light',
  placeholder: 'Start typing...',
  styleVars: {
    height: 'var(--size-40)',
    accent: 'var(--color-primary-500)'
  }
})

editor.on('save', value => {
  console.log(value)
})

const diff = createDiffEditor({
  container: document.querySelector('#diff') as HTMLElement,
  original: 'const a = 1',
  modified: 'const a = 2',
  language: 'typescript'
})

destroyEditor(editor)
diff.dispose()
console.log(codeEditorClasses.container)

Class And Token Rules

All DOM classes use the ldesign-code-editor namespace:

  • ldesign-code-editor
  • ldesign-code-editor__container
  • ldesign-code-editor__placeholder
  • ldesign-code-editor-diff
  • ldesign-code-editor-diff__container

Component UI styles are injected by ensureCodeEditorStyles() and expose --ldesign-code-editor-* variables. Defaults reference LDesign token CSS variables:

  • Colors use packages/color / styles/color.css variables such as --color-gray-200, --color-primary-500, --color-danger-500.
  • Sizes use packages/size / styles/size.css variables such as --size-radius-md, --size-spacing-md, --size-font-base.

Load the global LDesign color and size CSS before mounting editors. Monaco syntax themes still use Monaco's required hex color format because monaco.editor.defineTheme() does not consume CSS variables.

Main APIs

  • createEditor(options) / destroyEditor(target)
  • createDiffEditor(options) / destroyDiffEditor(target)
  • getEditorByContainer(container) / getDiffEditorByContainer(container)
  • destroyAllEditors() / destroyAllDiffEditors()
  • registerTheme(theme) / getAvailableThemes()
  • registerLanguage(language) / detectLanguage(filename)
  • ensureCodeEditorStyles(document?)

Build Outputs

The package uses @composy/builder and generates:

  • dist/index.js
  • es/**
  • esm/**
  • lib/**

Commands

pnpm --filter @composy/code-editor-core type-check
pnpm --filter @composy/code-editor-core build

License

MIT