@everymundo/theme-services-parser
v0.0.34
Published
Helpers for translate the EveryMundo Theme
Downloads
241
Readme
@everymundo/theme-services-parser
Library that transforms a raw EveryMundo theme (Registry Services format) into the parsed design-token structure consumed by airModules and related integrations.
It centralizes theme parsing logic so changes are applied once and reused across every consumer.
Note: This package was previously published as
@front10/theme-services-integration. Some downstream projects may still reference that name until they are migrated.
Consumers
This library is used in:
- air-modules — registry integration and theme loading
- om-theme-services-worker — Cloudflare Worker that receives theme edit notifications from EveryMundo, parses the theme, and publishes it to the CDN
- airmodules-vertical-booking-popup — Booking/Popup vertical built for VanGogh
Installation
yarn add @everymundo/theme-services-parserUsage
import { ParserTheme, getVersion } from '@everymundo/theme-services-parser';
const themeRaw = /* raw theme from Registry Services / EveryMundo */;
const parsedTheme = ParserTheme(themeRaw);
console.log(parsedTheme.version); // @everymundo/theme-services-parser:0.0.32
console.log(getVersion()); // same value as parsedTheme.versionAPI
| Export | Description |
| --- | --- |
| ParserTheme(themeRaw) | Parses a raw theme object and merges the result with the built-in base theme (src/theme/base_theme.json). Returns the final theme payload. |
| getVersion() | Returns the parser version in the format @everymundo/theme-services-parser:<semver>. |
Output shape
The parsed theme includes:
version— parser package identifiertypography.css— concatenated@font-facerules from the raw theme fontsdesignTokens— normalized tokens for:colors,text,links,radii,shadowseds— EDS component tokens (buttons, checkbox, menu, datepicker, inputfield, calendar, radiobutton, table, typo, utilities)buttons,forms,separators,layout,menus
The expected structure is validated in tests with a Zod schema (src/Parser/parsedTheme.schema.ts).
Development
Prerequisites
- Node.js
- Yarn
Scripts
| Command | Description |
| --- | --- |
| yarn build | Cleans and builds ESM + CJS outputs into lib/ |
| yarn test | Runs Mocha tests (src/**/*.spec.ts) |
| yarn clean | Removes the lib/ directory |
Local build helpers for linked consumers:
| Command | Description |
| --- | --- |
| yarn build-registry | Builds and copies lib/ into the local air-modules dependency |
| yarn build-vacations | Builds and copies lib/ into the local booking-popup dependency |
Project structure
src/
├── index.ts # Public exports
├── Parser/
│ ├── index.ts # ParserTheme implementation
│ ├── parsedTheme.schema.ts
│ └── index.spec.ts
├── theme/
│ ├── base_theme.json # Default theme merged into every parse
│ └── themeMocked.json # Fixture used in tests
└── utils/
├── mergeDeep.ts
└── utils.ts # Token helpers (EDS linearization, fonts, colors)Release
Releases are automated with semantic-release on the main branch.
- Merge changes into
mainwith conventional commit messages. - CI runs
yarn semantic-release, which bumps the version, updatespackage.json, and publishes the package.
For manual version bumps during development, ensure the working tree is clean and run:
npm version <patch|minor|major>The prepack hook runs yarn build automatically before publishing.
