Registry / devops / siroc
library0.16.0jsnpmunverified

Siroc is a zero-configuration yet extensible framework designed for developing Node.js applications and libraries. It aims to simplify the build process by intelligently supporting TypeScript and modern JavaScript syntax, leveraging industry-standard tools like Rollup and esbuild under the hood for bundling and type definition generation. The package, currently at `v0.16.0` (as of August 2021), maintains a frequent release cadence, often introducing minor versions with significant breaking changes, aligning with its declared "work in progress" status. Key differentiators include its convention-over-configuration approach, extensibility through custom commands and build hooks, and comprehensive TypeScript support. Siroc automatically infers build configurations from `package.json` fields such as `main`, `module`, `browser`, `bin`, and `exports`, and offers robust support for Yarn workspaces in monorepo setups. It also handles `.d.ts` generation and transpires subpath patterns efficiently using `mkdist`.

npm install siroc
INSTALL
IMPORT
SIG · SIROC
S
siroc
devopsjavascriptv0.16.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defineSirocConfig
import { defineSirocConfig } from 'siroc'
const defineSirocConfig = require('siroc')
Used to create a fully typed siroc configuration file (e.g., `siroc.config.ts`). CommonJS `require` is not supported for this named export.
SirocConfig
import type { SirocConfig } from 'siroc'
import { SirocConfig } from 'siroc'
This is a type definition for the configuration object. Import using `import type` for type safety and to prevent bundling issues.

Demonstrates setting up a `package.json` for siroc, a basic TypeScript entry file, and a `siroc.config.ts` file with `defineSirocConfig`.

{ "name": "my-siroc-package", "version": "1.0.0", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { "build": "siroc build", "dev": "siroc dev" }, "devDependencies": { "siroc": "^0.16.0" } } // src/index.ts export const greet = (name: string) => `Hello, ${name}!` // siroc.config.ts import { defineSirocConfig } from 'siroc' export default defineSirocConfig({ // Custom configuration options (fully typed) // Example: Add a custom build hook hooks: { 'build:done': (ctx) => { console.log('Build completed for:', ctx.pkg.name) } } })
siroc --version
Debug
Known issues
breakingSiroc versions >=0.10.0 require Node.js 12 or higher. Earlier versions of Node.js are no longer supported.
fix
Upgrade your Node.js environment to version 12 or newer (e.g., using `nvm install 16` and `nvm use 16`).
affects: >=0.10.0
breakingStarting with v0.10.0, subpath exports will produce `.mjs` files by default, which may affect module resolution and bundling in consumer packages.
fix
Ensure your `package.json` `exports` map `.mjs` files correctly for ES module consumers, and that downstream tools or build processes are configured to resolve `.mjs`.
affects: >=0.10.0
breakingVersion 0.11.0 included a significant upgrade to `esbuild` (to v0.12), which could introduce changes in build output, performance, or behavior due to `esbuild`'s own breaking changes.
fix
Review the esbuild v0.12 changelog for specific breaking changes and adjust any custom `siroc` or Rollup configurations accordingly.
affects: >=0.11.0
breakingVersion 0.12.0 introduced a breaking change by switching to regular expressions for matching dependency externals. This alters how external dependencies are identified and excluded from the bundle.
fix
If you have custom externalization logic or a complex dependency graph, update your `siroc` configuration to use regular expressions for external matching, or verify existing configurations are still valid.
affects: >=0.12.0
breakingVersion 0.15.0 included major version changes in `@rollup/plugin-commonjs` and `@rollup/plugin-replace`. This can lead to unexpected build failures or altered behavior for projects relying on specific features or older versions of these Rollup plugins.
fix
Consult the changelogs for `@rollup/plugin-commonjs` and `@rollup/plugin-replace` for their respective breaking changes and update your `siroc.config.ts` or Rollup configuration as needed.
affects: >=0.15.0
gotchaSiroc is explicitly stated as 'still a work in progress' with 'frequent changes'. Expect API instability and potentially frequent breaking changes between minor versions.
fix
Pin `siroc` to exact versions in production environments (`"siroc": "0.x.y"`) and thoroughly test updates before deploying. Keep a close eye on release notes.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Your current Node.js version is <12.x.y. Siroc requires Node.js >=12.
Running `siroc` on a Node.js version older than 12.
fix
Upgrade your Node.js environment to version 12 or newer. Use `nvm install 16` and `nvm use 16` or similar version management tools.
RollupError: '...' is not exported by ...
This often occurs after `siroc` updates due to underlying `@rollup/plugin-commonjs` or `esbuild` upgrades changing how CommonJS modules or exports are handled.
fix
Check the `siroc` changelog for relevant plugin updates. Ensure named exports are correctly handled, or that your module resolver is configured to handle interop correctly.
Module not found: Can't resolve '...' in '.../dist/index.mjs'
A consuming package or bundler is failing to resolve a `.mjs` entry point correctly after `siroc` started producing them in subpath exports (v0.10.0+).
fix
Verify that your `package.json`'s `exports` field and the consumer's build configuration (e.g., Webpack, Node.js resolution) are set up to correctly resolve `.mjs` files as ES modules.
TypeError: (0, siroc_1.defineSirocConfig) is not a function
Attempting to use `require()` for ESM named exports, or a transpilation issue with CommonJS/ESM interop.
fix
Ensure you are using `import { defineSirocConfig } from 'siroc'` in an ESM context (e.g., `.mjs` file or `type: "module"` in `package.json`).
Upgrade
Version history
0.16.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources