### Install CodeMirror Packages Source: https://github.com/codemirror/dev/blob/main/README.md Run this command after cloning the repository to install all necessary packages, dependencies, and build the system. ```bash node bin/cm.js install ``` -------------------------------- ### Start Development Server Source: https://github.com/codemirror/dev/blob/main/README.md Initiates a development server that automatically rebuilds packages on changes and provides access to the demo and browser tests on port 8090. ```bash npm run dev ``` -------------------------------- ### Start Development Server with Source Maps Source: https://context7.com/codemirror/dev/llms.txt Starts the development server with source maps enabled for debugging purposes. This allows for easier debugging of the compiled code. ```bash node bin/cm.js devserver --source-map ``` -------------------------------- ### Install CodeMirror Packages (SSH) Source: https://context7.com/codemirror/dev/llms.txt Clones all CodeMirror packages and installs npm dependencies using SSH. This method is suitable for developers with write access to the repository. ```bash node bin/cm.js install --ssh ``` -------------------------------- ### CodeMirror 6 Editor Integration with Custom Theming Source: https://context7.com/codemirror/dev/llms.txt Example of creating a CodeMirror 6 editor instance with HTML language support, syntax highlighting, and custom theming. Requires `@codemirror/lang-html` and `@lezer/highlight`. ```typescript import { EditorView, basicSetup } from "codemirror"; import { html } from "@codemirror/lang-html"; import { HighlightStyle, syntaxHighlighting } from "@codemirror/language"; import { tags } from "@lezer/highlight"; // Define custom syntax highlighting colors const customHighlight = HighlightStyle.define([ { tag: tags.keyword, color: "#ff7b72" }, { tag: tags.string, color: "#a5d6ff" }, { tag: tags.number, color: "#79c0ff" }, { tag: tags.variableName, color: "#ffa657" }, { tag: tags.function(tags.variableName), color: "#d2a8ff" }, { tag: tags.comment, color: "#6e7681" }, ]); // Create editor with HTML language support and custom theme const view = new EditorView({ doc: "\n Hello World\n", extensions: [ basicSetup, html(), syntaxHighlighting(customHighlight), EditorView.theme({ "&": { height: "300px", backgroundColor: "#111111" }, ".cm-content": { caretColor: "#ffffff" }, ".cm-gutters": { backgroundColor: "#111111", color: "#555555" }, ".cm-activeLine": { backgroundColor: "#1a1a1a" }, }), ], parent: document.body, }); // Access the editor state console.log(view.state.doc.toString()); ``` -------------------------------- ### Build CodeMirror Packages Source: https://github.com/codemirror/dev/blob/main/README.md Use this command to rebuild all packages in the CodeMirror system. Alternatively, run `npm run prepare` in a specific package's subdirectory. ```bash node bin/cm.js build ``` -------------------------------- ### Load and Access CodeMirror Packages Source: https://context7.com/codemirror/dev/llms.txt Demonstrates how to load package metadata and access specific package information using the CodeMirror packages module. ```javascript const { core, nonCore, all, loadPackages, Pkg } = require("./packages"); // Core packages (fundamental editor functionality) console.log(core); // ['state', 'view', 'language', 'commands', 'search', // 'autocomplete', 'lint', 'collab', 'language-data', // 'merge', 'lsp-client', 'codemirror'] // Non-core packages (language modes and themes) console.log(nonCore); // ['lang-javascript', 'lang-java', 'lang-json', 'lang-cpp', // 'lang-php', 'lang-python', 'lang-go', 'lang-css', // 'lang-sass', 'lang-html', 'lang-sql', 'lang-rust', // 'lang-xml', 'lang-markdown', 'lang-lezer', 'lang-wast', // 'lang-angular', 'lang-vue', 'lang-liquid', 'lang-less', // 'lang-yaml', 'lang-jinja', 'legacy-modes', 'theme-one-dark'] // Load all packages with their metadata const { packages, packageNames, buildPackages } = loadPackages(); // Access a specific package by name const viewPkg = packageNames['view']; console.log(viewPkg.name); // 'view' console.log(viewPkg.dir); // '/path/to/view' console.log(viewPkg.main); // '/path/to/view/src/index.ts' ``` -------------------------------- ### Build README for Non-Core Packages Source: https://context7.com/codemirror/dev/llms.txt Command to generate API documentation READMEs for non-core CodeMirror packages using the `cm.js` build script. ```bash # Build README for a language package node bin/cm.js build-readme lang-javascript # The generated README.md includes: # - Package description from source README template # - Full API documentation extracted from TypeScript source # - Proper links to CodeMirror and Lezer documentation ``` -------------------------------- ### List All Monorepo Packages Source: https://context7.com/codemirror/dev/llms.txt Outputs the names of all packages included in the CodeMirror monorepo. This command helps in understanding the project structure. ```bash node bin/cm.js packages ``` -------------------------------- ### Run Test Suite (Node.js Only) Source: https://context7.com/codemirror/dev/llms.txt Executes the test suite in a Node.js environment, without launching a browser. Useful for tests that do not require DOM interaction. ```bash node bin/cm.js test --no-browser ``` -------------------------------- ### Run Test Suite (Firefox) Source: https://context7.com/codemirror/dev/llms.txt Executes the test suite across all CodeMirror packages in the Firefox browser. ```bash node bin/cm.js test --firefox ``` -------------------------------- ### Run Specific Tests by Pattern Source: https://context7.com/codemirror/dev/llms.txt Executes only the tests that match the provided pattern. This is useful for focusing on specific functionalities during development. ```bash node bin/cm.js test --grep "selection" ``` -------------------------------- ### Release Package (Interactive Release Notes) Source: https://context7.com/codemirror/dev/llms.txt Releases a specified package and enables interactive editing of the release notes. This provides an opportunity to refine release descriptions before finalizing. ```bash node bin/cm.js release language --edit ``` -------------------------------- ### Run Test Suite (Chrome) Source: https://context7.com/codemirror/dev/llms.txt Executes the test suite across all CodeMirror packages in the Chrome browser. This is the default browser for running tests. ```bash node bin/cm.js test ``` -------------------------------- ### Run Command in All Packages Source: https://context7.com/codemirror/dev/llms.txt Executes an arbitrary command within each package directory of the monorepo. This is useful for running package-specific scripts or checks. ```bash node bin/cm.js run npm outdated ``` -------------------------------- ### Grep Source Code Across Packages Source: https://context7.com/codemirror/dev/llms.txt Searches for a specified pattern within the source code of all packages in the monorepo. This is helpful for finding where specific code elements are used. ```bash node bin/cm.js grep "EditorView" ``` -------------------------------- ### Release Package (Manual Version Override) Source: https://context7.com/codemirror/dev/llms.txt Releases a specified package and allows manual overriding of the version number. Use this when a specific version needs to be set. ```bash node bin/cm.js release state --version 6.1.0 ``` -------------------------------- ### Release Package (Automatic Version Bump) Source: https://context7.com/codemirror/dev/llms.txt Creates a release commit for a specified package, automatically bumping its version based on changelog entries. This command simplifies the release process. ```bash node bin/cm.js release view ``` -------------------------------- ### Clean Build Artifacts Source: https://context7.com/codemirror/dev/llms.txt Removes all build artifacts, specifically the `dist` directories, from all packages in the monorepo. This command is useful for performing a clean build. ```bash node bin/cm.js clean ``` -------------------------------- ### Push Unpushed Commits Source: https://context7.com/codemirror/dev/llms.txt Runs `git push` for all packages that have unpushed commits. This command synchronizes local changes with the remote repository. ```bash node bin/cm.js push ``` -------------------------------- ### Show Package Git Status Source: https://context7.com/codemirror/dev/llms.txt Displays the git status for all packages in the monorepo. It only shows packages that have uncommitted changes or unpushed commits. ```bash node bin/cm.js status ``` -------------------------------- ### Commit Changes in Modified Packages Source: https://context7.com/codemirror/dev/llms.txt Runs `git commit` across all packages that have uncommitted changes. A commit message is required. ```bash node bin/cm.js commit -m "Fix cursor position bug" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.