This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Web-Maker is a blazing fast offline web playground that supports multiple preprocessors and offers both a Chrome extension and web app. The codebase is built with Preact and includes a comprehensive build system for both web and extension distributions.
npm run dev- Start development server with hot reloadnpm run build- Production build using Preact CLInpm start- Start dev server with preview server (combines dev + gulp start-preview-server)npm run start:all- Start dev server + preview server + collab server
npm test- Run Jest tests (usestests/directory with mocks intests/__mocks__/)npm run lint- Run ESLint on src directorynpm run cypress- Run end-to-end tests with Cypressnpm run cypress:open- Open Cypress test runner interactively
gulp release- Full production release (web app + extension)gulp devRelease- Development releasegulp buildExtension- Build Chrome extension only
npm run extract- Extract translatable strings from sourcenpm run compile- Compile translations for runtime usenpm run add-locale- Add new locale
- src/components/app.jsx - Main application component managing global state, modals, and user interactions. State flows down through props (no state management library).
- src/components/ContentWrap.jsx - 3-pane editor layout (HTML/CSS/JS)
- src/components/ContentWrapFiles.jsx - File-based project mode with sidebar navigation
- src/components/MainHeader.jsx - Top toolbar with actions and controls
- src/itemService.js - Handles creation storage/retrieval (local & cloud)
- src/firebaseInit.js + src/auth.js - Firebase authentication and user management
- src/db.js - Database abstraction layer for settings and local storage
- src/analytics.js - Event tracking via GA; web app and extension use different GA configs
- src/notifications.js - Alert system service
- src/computes.js - Code preprocessing (HTML/CSS/JS transformations)
- src/codeModes.js - Defines supported preprocessors (Pug, SCSS, TypeScript, etc.)
- src/fileUtils.js - File system operations for file-based projects
- src/utils.js - Core utilities including HTML generation, preview handling, and
window.IS_EXTENSIONflag
- gulpfile.js - Build pipeline that packages for both web app and Chrome extension
- preact.config.js - Preact CLI configuration with webpack customizations (disables HTML minification, sets relative paths for prod)
The app communicates with the preview iframe via postMessage:
- Main app sends code to iframe:
frame.contentWindow.postMessage(obj, '*') - Preview iframe sends console logs back:
mainWindow.postMessage({ logs }, '*') - Preview frame runs on localhost:7888 (dev) or wbmakr.com (prod)
src/lib/screenlog.jshandles console interception inside the previewsrc/detached-window.jsmanages the detached preview window mode
The Chrome extension shares the same codebase. Key differences are handled via window.IS_EXTENSION (set in src/utils.js), which adds is-extension or is-app CSS class to body. Extension-specific files:
- src/manifest.json - MV3 extension manifest
- src/eventPage.js - Background service worker
- src/options.js - Extension options page
All styles live in one file: src/style.css. No CSS modules or component-scoped CSS.
- Use BEM-like naming (e.g.,
.help-modal__title,.console__log) - Use CSS custom properties for theming:
:rootfor dark theme,body.light-themefor light overrides - When adding light theme support, add
body.light-theme .your-classoverrides
Use Stack, VStack, HStack from src/components/Stack.jsx for flex layouts instead of writing custom CSS. They accept gap (index into predefined scale or raw value), align, justify, wrap, fullWidth, fullHeight props.
All user-facing strings must be wrapped for translation using @lingui/macro:
- JSX content:
<Trans>Hello world</Trans> - Attribute strings: Use
<I18n>{({ i18n }) => <div title={i18n._(ttooltip)} />}</I18n> - Config:
.linguirc.jsonand.babelrc(includesmacrosplugin) - Locale files:
src/locales/{lang}/messages.js
- Tests in
cypress/integration/*.test.js - Custom
cy.init()command visits app and closes the welcome modal - Use
data-testidattributes for element selection
- 3-Pane Mode: Traditional HTML/CSS/JS editors side-by-side
- File Mode: Full file system with folder structure, limited to 2 projects for free users, unlimited for PRO