CodeMirror Development Environment

repository·main·Indexed 27 days ago

https://github.com/codemirror/dev

Central development hub for CodeMirror 6 packages, intended for contributors. Includes documentation for setting up the environment with Node.js 16, building packages, and using the 'cm' CLI tool for package installation, testing, and release management.

Tokens
925
Snippets
3
Records
8
Agent score
43%

What's inside codemirror-dev

  1. Set up CodeMirror development environment

    main

    To develop on CodeMirror, ensure you are running Node.js version 16. After cloning this repository, use the provided installation script to clone the necessary packages, install dependencies, and build the system.

    node bin/cm.js install
  2. Build CodeMirror packages

    main

    You can rebuild the packages at any time. You can either run npm run prepare within a specific package's subdirectory, or rebuild all packages simultaneously using the central build script.

    node bin/cm.js build
  3. Use the CodeMirror CLI (cm) to manage the development environment

    main

    The cm CLI tool is used to manage the CodeMirror development environment, including package installation, building, testing, and releasing.

    Basic Usage:

    cm <command> [args]

    Available Commands:

    • install [--ssh]: Clones and symlinks packages, installs dependencies, and builds them. Use --ssh to clone via SSH instead of HTTPS.
    • packages: Lists all package names.
    • status: Shows git status for packages that have changes.
    • build: Builds the bundle files.
    • clean: Deletes files created by the build (e.g., dist directories).
    • devserver [--source-map]: Starts a development server on port 8090.
    • release <package> [--edit] [--version <version>]: Creates commits and tags for a package release.
    • build-readme <pkg>: Regenerates the README file for a non-core package.
    • commit <args>: Runs git commit in all packages that have changes.
    • push: Runs git push in packages that have new commits.
    • run <command>: Runs a specific command in each package directory.
    • test [--no-browser] [--firefox] [--chrome] [--grep <pattern>]: Runs the test suite across all packages.
    • grep <pattern>: Searches for a pattern through the source code of all packages.
    • --help: Displays the help menu.
  4. Install CodeMirror packages via cm install

    main

    The cm install command sets up the local development environment by cloning the necessary packages, installing npm dependencies, and performing an initial build.

    • HTTPS (Default): Clones from https://code.haverbeke.berlin/codemirror/.
    • SSH: Use the --ssh flag to clone from git@code.haverbeke.berlin:codemirror/.

    If a package directory already exists, the tool will skip cloning for that specific package.

  5. Release a package using cm release

    main

    The cm release <package> command automates the release process for a specific package. It pulls the latest changes, determines the next version number based on changelog entries (fix, feature, or breaking), updates package.json, updates CHANGELOG.md, and creates a git tag.

    Options:

    • <package>: The name of the package to release.
    • --edit: Opens the release notes in your default editor (defined by $EDITOR) for manual adjustment before committing.
    • --version <version>: Manually specify the version number to use for the release.
  6. Run tests with the cm test command

    main

    The cm test command executes the test suite for all packages. It can be configured to run in specific browsers or filter tests using a grep pattern.

    Options:

    • --no-browser: Runs tests without launching a browser.
    • --firefox: Includes Firefox in the test run.
    • --chrome: Includes Chrome in the test run (default if no browser is specified).
    • --grep <pattern>: Filters tests by a specific pattern.