npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@obinexusltd/obix-config-babel

v0.1.0

Published

OBIX Babel configuration for OBIX CLI and SDK packages

Readme

@obinexusltd/obix-config-babel

Babel 7 configuration for OBIX SDK packages — part of the @obinexusltd/obix-monorepo.

Provides typed factory functions, ready-to-use config files, environment-specific presets, and the OBIX-specific plugin preset (obix-plugins.js) for transforming OBIX SDK source code with Babel 7+.


Installation

Registered automatically as an npm workspace package:

# From monorepo root
npm install

To add it as a dependency in a consumer package:

{
  "devDependencies": {
    "@obinexusltd/obix-config-babel": "workspace:*"
  }
}

Package Structure

packages/config/babel/
├── babel.config.js          ← Base config (env-switched: development/production/test)
├── obix-plugins.js          ← OBIX-specific Babel preset (component syntax, state optimisation)
├── development/
│   └── babel.config.js      ← Dev config (ESM, sourcemaps, verbose)
├── production/
│   └── babel.config.js      ← Prod config (ESM, compact, no comments)
├── presets/
│   └── index.js             ← Named preset exports (obixPreset, obixTestPreset, etc.)
└── src/
    └── index.ts             ← TypeScript programmatic API (compiled to dist/)

Programmatic API

import {
  createBaseConfig,
  createDevConfig,
  createProdConfig,
  createTestConfig,
  resolveConfig,
} from '@obinexusltd/obix-config-babel';

// Development — ESM, sourcemaps, verbose
export default createDevConfig();

// Production — ESM, compact, runtime helpers
export default createProdConfig({ runtime: true });

// Test — CommonJS for Jest
export default createTestConfig();

// Resolve by environment string
export default resolveConfig('production', { react: true });

Factory Functions

| Function | Description | |----------|-------------| | createBaseConfig(opts?) | Base config, ESM modules, TypeScript | | createDevConfig(opts?) | Dev: sourcemaps, verbose, no compact | | createProdConfig(opts?) | Prod: sourcemaps, compact, comments stripped | | createTestConfig(opts?) | Test: CommonJS modules, inline sourcemaps | | resolveConfig(env, opts?) | Delegates by 'development'|'production'|'test' |

ObixBabelOptions

interface ObixBabelOptions {
  targets?:        BabelTargets;  // default: '> 0.5%, last 2 versions, not dead, node >= 18'
  modules?:        false | 'commonjs' | 'auto' | ...;  // default: false (ESM)
  react?:          boolean;       // default: false
  typescript?:     boolean;       // default: true
  decorators?:     boolean;       // default: false
  runtime?:        boolean;       // default: false
  obixPlugins?:    boolean;       // default: false
  obixValidation?: boolean;       // default: false
}

Static Descriptors

import { baseConfig, developmentConfig, productionConfig, testConfig } from '@obinexusltd/obix-config-babel';

Using Config Files Directly

Base config (env-switched)

Reference from your project's babel.config.js:

// babel.config.js — extend the OBIX base config
export { default } from '@obinexusltd/obix-config-babel/base';

Or reference inline:

{
  "babel": {
    "extends": "@obinexusltd/obix-config-babel/base"
  }
}

Development only

BABEL_ENV=development babel src --out-dir dist \
  --config-file ./node_modules/@obinexusltd/obix-config-babel/development/babel.config.js

Production only

BABEL_ENV=production babel src --out-dir dist \
  --config-file ./node_modules/@obinexusltd/obix-config-babel/production/babel.config.js

OBIX Plugin Preset

obix-plugins.js is a Babel preset that wires the OBIX-specific transform plugins. The plugins are optional — the preset degrades gracefully if they are not installed.

| Plugin | Purpose | Required? | |--------|---------|-----------| | babel-plugin-obix-component-syntax | OBIX component definition transforms | No | | babel-plugin-obix-state-optimization | DFA/NFA state machine code optimisation | No | | babel-plugin-obix-validation | Schema validation injection | No (env-gated) |

Enable the validation plugin

# Via environment variable
OBIX_ENABLE_VALIDATION=1 babel src --out-dir dist

Or via preset options:

export default {
  presets: [
    ['@obinexusltd/obix-config-babel/plugins', { validation: true }],
  ],
};

Wire the OBIX preset manually

// babel.config.js
import obixPlugins from '@obinexusltd/obix-config-babel/plugins';

export default {
  presets: [
    '@babel/preset-env',
    '@babel/preset-typescript',
    obixPlugins,
  ],
};

Preset Utilities

Import named presets from @obinexusltd/obix-config-babel/presets:

import {
  obixPreset,           // @babel/preset-env with OBIX defaults
  obixTypeScriptPreset, // @babel/preset-typescript with OBIX defaults
  obixReactPreset,      // @babel/preset-react (automatic runtime)
  obixTestPreset,       // @babel/preset-env with CommonJS modules (for Jest)
  obixLibraryPresets,   // [obixPreset, obixTypeScriptPreset]
  obixTestPresets,      // [obixTestPreset, obixTypeScriptPreset]
} from '@obinexusltd/obix-config-babel/presets';

export default { presets: obixLibraryPresets };

Environment Reference

| Environment | modules | sourcemaps | compact | Use case | |-------------|-----------|------------|---------|----------| | development | false (ESM) | true | false | Bundler dev build | | production | false (ESM) | true | true | Bundler prod build | | test | 'commonjs' | 'inline' | false | Jest test runs |


Peer Dependencies

Required:

{
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "@babel/preset-typescript": "^7.0.0"
  }
}

Optional:

{
  "devDependencies": {
    "@babel/preset-react": "^7.0.0",
    "@babel/plugin-transform-runtime": "^7.0.0",
    "@babel/plugin-proposal-decorators": "^7.0.0",
    "@babel/runtime": "^7.0.0",
    "core-js": "^3.0.0"
  }
}

Comparison with obix-config-rollup / obix-config-webpack

| Feature | Babel | Rollup | Webpack | |---------|-------|--------|---------| | Primary role | Syntax transforms | Library bundling | App bundling | | TypeScript | @babel/preset-typescript | @rollup/plugin-typescript | ts-loader | | Type checking | None (transform only) | Full tsc | Full tsc | | Tree-shaking | Preserves ESM for bundlers | Native | usedExports | | Best for | Polyfills, JSX, decorators | SDK packages | Browser apps |

Use Babel alongside Rollup or Webpack — not instead of them.


Author

Nnamdi Michael Okpala — OBINexus <[email protected]>

Part of the OBIX Heart/Soul UI/UX SDK monorepo.