{"id":14818,"library":"powerlines","title":"Powerlines: The Framework Framework","description":"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.","status":"active","version":"0.42.41","language":"javascript","source_language":"en","source_url":"https://github.com/storm-software/powerlines","tags":["javascript","powerlines","storm-software","unplugin","typescript","dotenv","babel","esbuild","unbuild"],"install":[{"cmd":"npm install powerlines","lang":"bash","label":"npm"},{"cmd":"yarn add powerlines","lang":"bash","label":"yarn"},{"cmd":"pnpm add powerlines","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Farm integration","package":"@farmfe/cli","optional":true},{"reason":"Peer dependency for Farm integration","package":"@farmfe/core","optional":true},{"reason":"Peer dependency for Nuxt integration","package":"@nuxt/kit","optional":true},{"reason":"Peer dependency for Nuxt integration","package":"@nuxt/schema","optional":true},{"reason":"Peer dependency for Astro integration","package":"astro","optional":true},{"reason":"Peer dependency for esbuild plugin functionality","package":"esbuild","optional":true},{"reason":"Peer dependency for Next.js integration","package":"next","optional":true},{"reason":"Peer dependency for Rolldown plugin functionality","package":"rolldown","optional":true},{"reason":"Peer dependency for Rollup plugin functionality","package":"rollup","optional":true},{"reason":"Peer dependency for Rspack plugin functionality","package":"rspack","optional":true},{"reason":"Peer dependency for tsdown plugin functionality","package":"tsdown","optional":true},{"reason":"Peer dependency for TypeScript projects and type definition support","package":"typescript","optional":true},{"reason":"Peer dependency for module unloading utilities","package":"unloader","optional":true},{"reason":"Peer dependency for Vite plugin functionality","package":"vite","optional":true},{"reason":"Peer dependency for Webpack plugin functionality","package":"webpack","optional":true}],"imports":[{"note":"Used for defining Powerlines configuration in `powerlines.config.ts`. Primarily ESM-first.","wrong":"const { defineConfig } = require('powerlines')","symbol":"definePowerlinesConfig","correct":"import { definePowerlinesConfig } from 'powerlines'"},{"note":"Main factory function to programmatically create a Powerlines instance. Destructured named import is standard.","wrong":"import Powerlines from 'powerlines'","symbol":"createPowerlines","correct":"import { createPowerlines } from 'powerlines'"},{"note":"TypeScript type import for defining custom Powerlines plugins.","symbol":"PowerlinesPlugin","correct":"import type { PowerlinesPlugin } from 'powerlines'"}],"quickstart":{"code":"import { definePowerlinesConfig } from 'powerlines';\nimport { createVitePlugin } from '@powerlines/plugin-vite';\nimport { createEsbuildPlugin } from '@powerlines/plugin-esbuild';\n\nexport default definePowerlinesConfig({\n  /**\n   * Project-wide options for Powerlines.\n   * For example, specifying where virtual modules should be resolved from.\n   */\n  output: {\n    dir: './dist',\n    clean: true\n  },\n  /**\n   * Define your Powerlines plugins here.\n   * These plugins can interact with various build tools.\n   */\n  plugins: [\n    createVitePlugin({\n      // Vite specific options\n      optimizeDeps: {\n        exclude: ['my-excluded-lib']\n      }\n    }),\n    createEsbuildPlugin({\n      // esbuild specific options\n      target: 'es2022',\n      minify: process.env.NODE_ENV === 'production'\n    }),\n    {\n      name: 'my-custom-plugin',\n      setup(powerlines) {\n        // Example hook: Intercepting a build event\n        powerlines.onBuildStart(() => {\n          console.log('Custom plugin: Powerlines build started!');\n        });\n        // You can register virtual modules, transform code, etc.\n      }\n    }\n  ],\n  /**\n   * Optional: Define global constants or environment variables\n   * that Powerlines can inject into your builds.\n   */\n  define: {\n    __APP_VERSION__: JSON.stringify('1.0.0'),\n    __API_URL__: JSON.stringify(process.env.API_URL ?? 'http://localhost:3000')\n  }\n});","lang":"typescript","description":"Demonstrates setting up `powerlines.config.ts` with `definePowerlinesConfig`, integrating Vite and esbuild plugins, and adding a custom plugin with basic hooks."},"warnings":[{"fix":"Monitor GitHub issues and releases for stability improvements. Plan for potential breaking changes in minor versions. Report bugs to the developers.","message":"Powerlines 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"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.","message":"The 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.","severity":"breaking","affected_versions":">=0.1.0"},{"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.","message":"Powerlines 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.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"The 'powerlines' package or one of its plugins is not installed.","error":"ERR_MODULE_NOT_FOUND: Cannot find package 'powerlines'"},{"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.","cause":"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.","error":"TypeError: (0 , powerlines__WEBPACK_IMPORTED_MODULE_0__.definePowerlinesConfig) is not a function"},{"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).","cause":"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.","error":"Error: Peer dependency \"X@Y\" is not installed or incompatible"}],"ecosystem":"npm"}