Registry / web-framework / powerlines

powerlines

JSON →
library0.42.41jsnpmunverified

Powerlines is a 'framework framework' and build toolkit (currently at version 0.42.41) designed to simplify the use of modern development tools and improve developer experience. Developed by Storm Software, it achieves this by providing a unified abstraction layer over various build ecosystems such as Vite, Rollup, Webpack, esbuild, Nuxt, Astro, and Next.js. It supports generating virtual or actual code modules, streamlining complex build configurations. The project maintains a very active, rapid release cadence with frequent updates across its core and plugin packages, reflecting its ongoing development. Its key differentiator is its ambition to be a meta-framework, offering a consistent approach to tooling integration and module generation, contrasting with single-bundler-focused solutions. While highly functional, it is still in an initial development phase, and users should expect potential bugs and API evolution.

npm install powerlines
INSTALL
IMPORT
SIG · POWERLINES
P
powerlines
web-frameworkjavascriptv0.42.41
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.

definePowerlinesConfig
import { definePowerlinesConfig } from 'powerlines'
const { defineConfig } = require('powerlines')
Used for defining Powerlines configuration in `powerlines.config.ts`. Primarily ESM-first.
createPowerlines
import { createPowerlines } from 'powerlines'
import Powerlines from 'powerlines'
Main factory function to programmatically create a Powerlines instance. Destructured named import is standard.
PowerlinesPlugin
import type { PowerlinesPlugin } from 'powerlines'
TypeScript type import for defining custom Powerlines plugins.

Demonstrates setting up `powerlines.config.ts` with `definePowerlinesConfig`, integrating Vite and esbuild plugins, and adding a custom plugin with basic hooks.

import { definePowerlinesConfig } from 'powerlines'; import { createVitePlugin } from '@powerlines/plugin-vite'; import { createEsbuildPlugin } from '@powerlines/plugin-esbuild'; export default definePowerlinesConfig({ /** * Project-wide options for Powerlines. * For example, specifying where virtual modules should be resolved from. */ output: { dir: './dist', clean: true }, /** * Define your Powerlines plugins here. * These plugins can interact with various build tools. */ plugins: [ createVitePlugin({ // Vite specific options optimizeDeps: { exclude: ['my-excluded-lib'] } }), createEsbuildPlugin({ // esbuild specific options target: 'es2022', minify: process.env.NODE_ENV === 'production' }), { name: 'my-custom-plugin', setup(powerlines) { // Example hook: Intercepting a build event powerlines.onBuildStart(() => { console.log('Custom plugin: Powerlines build started!'); }); // You can register virtual modules, transform code, etc. } } ], /** * Optional: Define global constants or environment variables * that Powerlines can inject into your builds. */ define: { __APP_VERSION__: JSON.stringify('1.0.0'), __API_URL__: JSON.stringify(process.env.API_URL ?? 'http://localhost:3000') } });
Debug
Known issues
gotchaPowerlines is explicitly stated to be in its 'initial development phase' where 'bugs and issues are expected.' It is not yet considered a 'proper release,' so exercise caution in production environments.
fix
Monitor GitHub issues and releases for stability improvements. Plan for potential breaking changes in minor versions. Report bugs to the developers.
affects: >=0.1.0
breakingThe project uses `0.x.x` versioning, indicating that minor versions (`0.x.y` to `0.z.0`) may introduce breaking API changes without adhering to Semantic Versioning expectations for stable releases. Frequent updates mean rapid evolution.
fix
Always pin exact versions (`'powerlines': '0.x.y'`) rather than using ranges (`'^0.x.y'`). Thoroughly review release notes for each update to identify breaking changes and necessary code modifications.
affects: >=0.1.0
gotchaPowerlines has an extensive list of peer dependencies, requiring many build tools (e.g., Vite, Rollup, Webpack, esbuild, Nuxt, Astro) to be installed separately. Missing or incompatible peer dependencies can lead to runtime errors or unexpected behavior.
fix
Ensure all necessary peer dependencies for the specific plugins you use are explicitly installed in your project. Pay close attention to the version requirements listed in the `package.json` for compatibility.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_MODULE_NOT_FOUND: Cannot find package 'powerlines'
The 'powerlines' package or one of its plugins is not installed.
fix
Run `pnpm add -D powerlines` (or `npm install -D powerlines`, `yarn add -D powerlines`) to install the core package. Also, ensure any specific `@powerlines/plugin-*` packages are installed if you are using them.
TypeError: (0 , powerlines__WEBPACK_IMPORTED_MODULE_0__.definePowerlinesConfig) is not a function
Attempting to use `definePowerlinesConfig` in a CommonJS context or with incorrect module resolution in a build tool, or a version mismatch where the function signature changed.
fix
Ensure your configuration file (`powerlines.config.ts`) is treated as an ESM module (e.g., using `type: 'module'` in `package.json` or configuring your bundler/TypeScript compiler accordingly). Verify the `powerlines` package version is compatible with your setup.
Error: Peer dependency "X@Y" is not installed or incompatible
A plugin for Powerlines requires a specific version of a build tool (e.g., `vite`, `esbuild`) that is either missing or does not meet the specified version range.
fix
Install the required peer dependency with the correct version. For example, if 'vite@^4.0.0' is required, run `pnpm add -D vite@latest` (or the specific compatible version).
Upgrade
Version history
0.42.41latest on npm
Audit
Dependencies
@farmfe/clioptionalPeer dependency for Farm integration
@farmfe/coreoptionalPeer dependency for Farm integration
@nuxt/kitoptionalPeer dependency for Nuxt integration
@nuxt/schemaoptionalPeer dependency for Nuxt integration
astrooptionalPeer dependency for Astro integration
esbuildoptionalPeer dependency for esbuild plugin functionality
nextoptionalPeer dependency for Next.js integration
rolldownoptionalPeer dependency for Rolldown plugin functionality
rollupoptionalPeer dependency for Rollup plugin functionality
rspackoptionalPeer dependency for Rspack plugin functionality
tsdownoptionalPeer dependency for tsdown plugin functionality
typescriptoptionalPeer dependency for TypeScript projects and type definition support
unloaderoptionalPeer dependency for module unloading utilities
viteoptionalPeer dependency for Vite plugin functionality
webpackoptionalPeer dependency for Webpack plugin functionality
Agent activity
4 hits · last 30 days
node
4
Resources