# xeira

> One Web Dev stack tool to rule them all

Latest version **2.0.0-beta.6** (published 2025-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install xeira
pnpm add xeira
yarn add xeira
bun add xeira
```

Provides the command `xeira`.

## Health

**Score 40/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.0-beta.6 |
| Published | 2025-09-07 |
| First published | 2022-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=21 |
| Dependencies | 58 |
| Unpacked size | 167.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | donato@afialapis.com |
| Maintainers | afialapis |

## Links

- npm: https://www.npmjs.com/package/xeira
- Repository: https://github.com/afialapis/xeira
- Homepage: https://www.afialapis.com/os/xeira
- Issues: https://github.com/afialapis/xeira/issues
- npm.io page: https://npm.io/package/xeira

## Dependencies (58)

- [chai](https://npm.io/package/chai.md) ^6.0.1
- [diff](https://npm.io/package/diff.md) ^8.0.2
- [sass](https://npm.io/package/sass.md) ^1.92.0
- [jsdom](https://npm.io/package/jsdom.md) ^26.1.0
- [mocha](https://npm.io/package/mocha.md) ^11.7.2
- [eslint](https://npm.io/package/eslint.md) ^9.34.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [nollup](https://npm.io/package/nollup.md) ^0.21.0
- [rollup](https://npm.io/package/rollup.md) ^4.50.0
- [vitest](https://npm.io/package/vitest.md) ^3.2.4
- [globals](https://npm.io/package/globals.md) ^16.3.0
- [postcss](https://npm.io/package/postcss.md) ^8.5.6
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [tinguir](https://npm.io/package/tinguir.md) ^0.0.7
- [arredemo](https://npm.io/package/arredemo.md) ^2.0.0
- [chokidar](https://npm.io/package/chokidar.md) ^4.0.3
- [uglify-js](https://npm.io/package/uglify-js.md) ^3.19.3
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.28.3
- [@eslint/js](https://npm.io/package/@eslint/js.md) ^9.34.0
- [merge-deep](https://npm.io/package/merge-deep.md) ^3.0.3
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.28.3
- [@babel/node](https://npm.io/package/@babel/node.md) ^7.28.0
- [babel-merge](https://npm.io/package/babel-merge.md) ^3.0.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.6
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^10.4.21
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^22.0.0
- [ignore-styles](https://npm.io/package/ignore-styles.md) ^5.0.1
- [@eslint/compat](https://npm.io/package/@eslint/compat.md) ^1.3.2
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.28.3
- [@eslint/eslintrc](https://npm.io/package/@eslint/eslintrc.md) ^3.3.1
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.28.3
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.27.1
- [@rollup/plugin-json](https://npm.io/package/@rollup/plugin-json.md) ^6.1.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.37.5
- [rollup-plugin-serve](https://npm.io/package/rollup-plugin-serve.md) ^3.0.0
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.28.0
- [@babel/eslint-plugin](https://npm.io/package/@babel/eslint-plugin.md) ^7.27.1
- [@rollup/plugin-alias](https://npm.io/package/@rollup/plugin-alias.md) ^5.1.1
- [@rollup/plugin-babel](https://npm.io/package/@rollup/plugin-babel.md) ^6.0.4
- [@tailwindcss/postcss](https://npm.io/package/@tailwindcss/postcss.md) ^4.1.12
- [@testing-library/dom](https://npm.io/package/@testing-library/dom.md) ^10.4.1
- [@babel/preset-modules](https://npm.io/package/@babel/preset-modules.md) ^0.1.6
- [@rollup/plugin-terser](https://npm.io/package/@rollup/plugin-terser.md) ^0.4.4
- [rollup-plugin-postcss](https://npm.io/package/rollup-plugin-postcss.md) ^4.0.2
- [@rollup/plugin-replace](https://npm.io/package/@rollup/plugin-replace.md) ^6.0.2
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) 16.3.0
- [@rollup/plugin-commonjs](https://npm.io/package/@rollup/plugin-commonjs.md) ^28.0.6
- [rollup-plugin-livereload](https://npm.io/package/rollup-plugin-livereload.md) ^2.0.5
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^5.2.0
- [@rollup/plugin-node-resolve](https://npm.io/package/@rollup/plugin-node-resolve.md) ^16.0.1
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^14.6.1
- [rollup-plugin-polyfill-node](https://npm.io/package/rollup-plugin-polyfill-node.md) ^0.13.0
- [babel-plugin-module-resolver](https://npm.io/package/babel-plugin-module-resolver.md) ^5.0.2
- [rollup-plugin-node-externals](https://npm.io/package/rollup-plugin-node-externals.md) ^8.1.1
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.28.0
- [babel-plugin-transform-import-meta](https://npm.io/package/babel-plugin-transform-import-meta.md) ^2.3.3
- [babel-plugin-replace-import-extension](https://npm.io/package/babel-plugin-replace-import-extension.md) ^1.1.5
- [@babel/plugin-transform-modules-commonjs](https://npm.io/package/@babel/plugin-transform-modules-commonjs.md) ^7.27.1

## Recent versions

- 2.0.0-beta.6 (latest) — 2025-09-07
- 2.0.0-beta.10 (beta) — 2026-02-11
- 2.0.0-beta.9 — 2026-02-09
- 2.0.0-beta.8 — 2025-10-14
- 2.0.0-beta.7 — 2025-09-07
- 2.0.0-beta.5 — 2025-09-04
- 2.0.0-beta.4 — 2025-09-03
- 2.0.0-beta.3 — 2025-09-03
- 2.0.0-beta.2 — 2025-09-03
- 2.0.0-beta.1 — 2025-09-03
- 1.3.1 — 2025-08-28
- 1.3.0 — 2025-08-28
- 1.2.3 — 2025-07-14
- 1.2.2 — 2025-07-14
- 1.2.1 — 2025-07-14
- … 98 more at https://npm.io/package/xeira/versions

## README

# xeira
[![NPM Version](https://badge.fury.io/js/xeira.svg)](https://www.npmjs.com/package/xeira)
[![NPM Downloads](https://img.shields.io/npm/dm/xeira.svg?style=flat)](https://www.npmjs.com/package/xeira)

![xeira logo](https://www.afialapis.com/os/xeira/logo.png)

---

> **[xeira](https://academia.gal/dicionario/-/termo/xeira)**


> **2** Cantidade de traballo que se fai durante unha xornada ou dunha soa vez, ou serie de cousas feitas sen interrupción.

> _Agora descansamos e pola tarde dámoslle outra xeira._

> _Entre os catro fixemos unha boa xeira._

---


## Intro

> One web-dev-stack command to rule them all

[`xeira`](https://www.afialapis.com/os/xeira) aims to group all the Web Dev stack processes you need from a single, zero config command.
Under the hoods, it calls well known, community-trusted tools:

- linting trough [ESLint](https://github.com/eslint/eslint)
- transpiling with [Babel](https://github.com/babel/babel)
- minifying with [Uglify](https://github.com/mishoo/UglifyJS)
- bundling with [Rollup](https://github.com/rollup/rollup)
- serving dev servers both with [Rollup](https://github.com/rollup/rollup) or [Nollup](https://github.com/PepsRyuu/nollup)
- testing with [Mocha](https://github.com/mochajs/mocha) and [Chai](https://github.com/chaijs/chai)
- building static site for your package trough [arredemo](https://github.com/afialapis/arredemo)

It supports [working with monorepos](#working-with-monorepos).

Future versions will try to add more tools (so, for example, letting you to pick your
preferred bundler). It's also very opinionated, using pretty standard configurations.

## Install

```
  npm i -D xeira
```

## Commands

`xeira` usage is always like:

```
  npx xeira <command> [...options] [...config] [--filter]
```

`xeira` commands will provide some particular `[...options]` depending on each case. 

`[...config]`: you can also pass any value from [`xeira`'s config](#configuration) as parameter,
taking priority over `xeira.json` file (if any).

`--filter`: [working with monorepos?](#working-with-monorepos)

### help

In case of doubts, `--help` is always there for you:

```
  npx xeira --help
  npx xeira <command> --help
```

### init

This one-shot command will guide you in the creation of `xeira`'s 
[config file (`xeira.json`)](#configuration).

```
  npx xeira init [--force] [config] [--filter]
```

If `--force=true`, you will be asked about values even if they already exist on your `xeira.json`.

This command will also update some values of your `package.json` file (just... trust `xeira`!).

### lint

```
  npx xeira lint [--folder=./] [config] [--filter]
```

### transpile

```
  npx xeira transpile [--source_folder=./src] [config] [--filter] [--watch]
```

### bundle

```
  npx xeira bundle [config] [--filter] [--watch]
```

### test

```
  npx xeira test [--files] [--timeout] [config] [--filter]
```
### dev

```
  npx xeira dev [--host] [--port] [config] [--filter]
```

### demo

```
  npx xeira demo [--init [--force]] [--port] [config] [--filter]
```

### version

```
  npx xeira version [--type | --number] [config] [--filter]
```

### static site

```
  npx xeira site [config] [--filter]
```

## Configuration

Alongside your `package.json`, in your main folder, `xeira.json` will store your `xeira`' configuration.

This file may be automatically generated by running [`init` command](#init).

Notice this `xeira.json` is not mandatory. You can specify `[options]` when running any `xeira` command. 
For example, you could do the next, and `xeira` will just work as expected:

```
  npx xeira bundle --source_index=./src/index.mjs --bundle_folder=./dist --verbose=true
```

Existence of a `xeira.json` may be a good idea, though:

- more explicit (and transparent) usage of `xeira`
- simpler `npm run` scripts!

### `product`

Can be `package` (default) or `app`. It determines how bundle files are made (and which ones).

### `target`

Can be `node` (default), `browser` or `both`. It determines how bundle files are made (and which ones).

### `source_index`

Entry point to your source code. Default value is `./src/index.js`.

### `linter`

Which tool to use for linting your code. Default is `eslint`. 

### `transpile_folder`

Destination folder for your transpiled code. Default is `./lib`.

### `transpiler`

Tool in charge of transpiling. Default is `babel`.

### `minifier`

Tool in charge of minifying transpiled code and bundled files. Default is `uglify`.

If you wanna disable it for transpiling, just specify `null`.

### `bundle_folder`

Destination folder for bundle files. Default is `./dist`.

### `bundle_name`

Base name for the built bundles.
Default value is `package.json`'s `name` field.

### `bundle_extension`

`xeira` will bundle output files based on `target` prop.
But if you want to bundle particular output formats, you may pass `bundle_extension`, a comma-separated list.
Possible values are: `cjs`, `mjs`, `mjs.min`, `umd`, `umd.min`, `umd.bundle`, `umd.bundle.min`, `iife`, `iife.min`, `iife.bundle`, `iife.bundle.min`.

### `bundle_inline_dynamic_imports`

Sets the `rollup`'s [`inlineDynamicImports`](https://github.com/FredKSchott/rollup-plugin-polyfill-node) option. `true` by default.

If `false`, each bundle will consist on several files (`xeira` will create subdirectories, 
like `./dist/cjs`, `./dist/mjs`...).

`umd` and `iife` bundles cannot be split. So, if your `target` is `browser`, this option will be ignored.

### `bundle_node_polyfill`

If `true`, [`Polyfills Node builtin modules`](https://rollupjs.org/configuration-options/#output-inlinedynamicimports) for your `rollup` bundle. It applies just to `esm`, `umd` and `iife` bundles.

It is `false` by default.

If `xeira`'s output shows a warning like this:

```
Creating a browser bundle that depends on Node.js built-in modules ("node:<module>")...
```

Consider setting this option as `true` or, if possible, try to remove your dependencies on `Node`s modules.

### `bundler`

Tool in charge of source code bundling. Default is `rollup`.

### `test_folder`

Folder where your test files are at. Default is `./test`.

### `dev_server`

Tool in charge of bundling, serving and watching your dev app. Possible values 
are `rollup` (default) or `nollup`.

### `demo_mode`

Mode for `demo --init` command. Default is `auto`.

### `demo_demoer`

Tool in charge of bundling, serving and watching your demo app. Possible values 
are `rollup` (default) or `nollup`.

### `verbose`

If `true`, `xeira` will just print more logs in the console output. Default is `false`. 


## Working with monorepos

When working with monorepos, you may `--filter` folders to apply the command on.

When using this option, by default, `packages` folder is inspected. So, for example:

```
  npx xeira lint --filter=react-*
```

will filter all the `./packages/react-*` folders.

If you want to search on another folder, just specify it with a relative path. So:

```
  npx xeira lint --filter=./custom_folder/react-*
```

will filter all the `./custom_folder/react-*` folders.

## API

`xeira`'s commands are also available as JS calls.


```js

import {
  xeiraInit,
  xeiraLint,
  xeiraTest,
  xeiraDemo,
  xeiraTranspile,
  xeiraBundle,
  xeiraVersion,
  xeiraSite
} from 'xeira'


await xeiraInit(options)
await xeiraLint(options)
await xeiraTest(options)
await xeiraDemo(options)
await xeiraTranspile(options, callback)
await xeiraBundle(options, callback)
await xeiraVersion(options)
await xeiraSite(options)
```

`options` parameters are the same as for the commands.

`callback` param is useful if you call `transpile` or `bundle` in `watch` mode. It must be an `async`function,
and will be called accordingly.


## Others

### Define aliases just once

You may have find yourself having to duplicate your aliases configuration:

- first on bundler files (`.babelrc` or similar)
- then on your editor's config  (`jsconfig.json` or similar)

With `xeira`, just do it once. Define your aliases just for your editor. 
In your root folder, file `jsconfig.json`:

```json
  {
    "compilerOptions": {
      "baseUrl": ".",
      "paths": {
        "*": ["src/*"],
        "test/*": ["test/*"],
        "underscore": ["lodash"]
      }
    }
  }
```

And `xeira` will use them both for transpiling and bundling.

---
_Source: https://npm.io/package/xeira · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
