- add wwvStaticCompiler to SDK vite/ subpath export [Minor] - export createPluginContext and PluginContext type from SDK [Minor] - update viteGlobals mapping for lucide-react [Patch] - overhaul all docs/ for decoupled plugin development workflow [Minor] - update README with new CLI-based plugin creation instructions [Minor] - fix marketplace load route CORS and error handling [Patch] - add test coverage for DeclarativePlugin edge cases [Patch] - bump root to v1.18.0, SDK to v1.5.0
1.8 KiB
1.8 KiB
Development
Development on WorldWideView leverages modern, rigid structural constraints to ensure cross-plugin consistency, extreme browser optimization, and a minimal global footprint.
New features are designed within isolated workspaces, using SDK structures rather than forcing logic into the core engine.
Code Style
- TypeScript Strictness: Strict types are enforced across all domains (
tsconfig.jsonlines 4-20). Any use ofanyinside platform routers is forbidden. - Styling constraints: All CSS is strictly limited to Vanilla CSS via CSS Modules (
.module.css). Tailwind is prohibited to prevent styling collisions natively with dynamically loaded elements from third-party plugins. (src/app/globals.css).
Common Patterns
- Env Variable Injection: Plugins read remote contexts generically instantiated via the SDK.
// From wwv-plugin-aviation/src/index.ts:60-70
let engineBase = this.context?.env?.DATA_ENGINE_URL || "https://dataengine.worldwideview.dev";
- Zustand Slices: The store is heavily splintered based on structural domain, keeping the hook listeners granular so mapping updates don't aggressively trigger
AppShellroot rerenders. (src/core/state/globeSlice.ts).
Workflows
- Local Database Setup: Run
pnpm db:resetto nuke and redeploy the standard Prisma schema acrossdata/wwv.db. - Generating Plugins: Use the global CLI
npx @worldwideview/create-plugin@latest <name>to initialize a decoupled plugin outside of the monorepo. - Linking Plugins: Use
npm run linkin the plugin directory after settingnpx wwv config set wwv-path <path>.
Reference
File size is constrained to a 150-line soft cap. Hooks and computational math helpers must be rigorously offloaded (e.g. src/core/globe/hooks/useModelRendering.ts).