Wesa is a CLI and library for performing storage schema migrations in browser extensions (Chrome/Firefox) packaged with webpack. The current stable version is 0.7.1, released sparsely. It helps manage storage revisions using a revision repository, similar to database migrations. Unlike generic migration tools, it targets browser.storage (local, session, sync) and integrates with webpack code splitting via dynamic imports. It requires Node.js >=24.0.0 and expects background scripts to call the migrate function with a context object.
npm install wesaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This shows the typical setup: initializing the repository, creating a revision, and applying migration in a browser extension background script.
Update Node.js to >=24.0.0 or downgrade to an earlier version (if available).
Ensure each context function returns a Promise with the expected shape: getAvailableRevisions returns array of revision numbers, getCurrentRevision returns number or undefined, getRevision returns module with default export function.
Use 'export default async function upgrade() { ... }' in revision files.Ensure your webpack config and target browser support import assertions, or adjust the context function to use fetch or XMLHttpRequest.
Loop over areas: await migrate(context, { area: 'local' }); await migrate(context, { area: 'sync' }); etc.Ensure you have run 'wesa init' to create the storage/config.json file and that it exports the revisions object.
Provide an object with getAvailableRevisions, getCurrentRevision, and getRevision as async functions.
Use import { migrate } from 'wesa'.Create at least one revision with 'wesa revision -m "message"' and ensure getAvailableRevisions returns it.
No dependency data recorded yet.