Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CodePress Engine

npm versionNode.js

Instrumentation engine for the CodePress visual editor. Ships Babel and SWC plugins, a webpack plugin, a development server, and a CLI for React and Next.js projects.

Installation

npm install @codepress/codepress-engine

Next.js Setup

// next.config.mjsimport{createSWCPlugin}from"@codepress/codepress-engine/swc";importCodePressWebpackPluginfrom"@codepress/codepress-engine/webpack-plugin";constnextConfig={experimental: {swcPlugins: [createSWCPlugin()],},webpack: (config,{ isServer, dev })=>{config.plugins.push(newCodePressWebpackPlugin({ isServer, dev }));returnconfig;},};exportdefaultnextConfig;

Babel Setup

// babel.config.mjsexportdefault{plugins: ["@codepress/codepress-engine"],};

Vite Setup

// vite.config.tsimport{codepressVitePlugin}from"@codepress/codepress-engine/vite-plugin";exportdefault{plugins: [codepressVitePlugin()],};

Local Development Server

Run the CodePress dev server alongside your app for local visual editing:

npx codepress && npm start

See npx codepress help for all available commands.

Package Exports

ExportDescription
@codepress/codepress-engineMain entry (Babel plugin)
@codepress/codepress-engine/babelBabel plugin (CommonJS)
@codepress/codepress-engine/swcSWC plugin factory & WASM helpers
@codepress/codepress-engine/webpack-pluginWebpack plugin for production module map
@codepress/codepress-engine/vite-pluginVite plugin
@codepress/codepress-engine/esbuildesbuild plugin
@codepress/codepress-engine/serverFastify development server
@codepress/codepress-engine/cliCLI (codepress binary)

How It Works

  1. Build time — The Babel or SWC plugin injects codepress-data-fp attributes into JSX elements, encoding source file paths and line numbers
  2. Runtime — The CodePress browser extension reads these attributes to identify source locations when you select an element
  3. Editing — Changes flow to either the local dev server (writes to disk) or the CodePress backend (commits to GitHub)
  4. Production — The webpack plugin creates a module map enabling hot module replacement in production builds

Reporting Bugs

Found a bug? Open an issue on this repository.

License

Copyright (c) 2025 CodePress. All rights reserved. See LICENSE for details.

About

CodePress Engine — visual editing instrumentation for React and Next.js. Install via npm.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors