Registry / web-framework / piral-cli-parcel

piral-cli-parcel

JSON →
library1.1.0jsnpmunverified

Piral CLI Parcel is a plugin designed to integrate Parcel Bundler (specifically Parcel v1) into the Piral CLI ecosystem. It enables developers to use Parcel for bundling both Piral instances and individual pilets, simplifying the build and debug processes. The current stable version is v1.1.0, with ongoing active development and recent updates including a move to a dedicated repository. This plugin eliminates the need for manual Parcel installation or configuration, providing a 'batteries included' approach by bundling essential Parcel plugins such as `parcel-plugin-at-alias`, `parcel-plugin-codegen`, `parcel-plugin-externals`, and `parcel-plugin-import-maps`. While it offers a streamlined development experience for Piral projects using Parcel v1, users should be aware of its reliance on the older Parcel version, which has different features and behavior compared to Parcel v2. Its primary differentiator is seamless integration with `piral-cli`, offering an alternative bundling solution alongside other options like Webpack or ESBuild within the Piral framework.

npm install piral-cli-parcel
INSTALL
IMPORT
SIG · PIRAL-CLI-PARCEL
P
piral-cli-parcel
web-frameworkjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This script demonstrates installing `piral-cli-parcel` into a new Piral instance project and verifies that Piral CLI commands like `piral build` now utilize Parcel v1 as the underlying bundler.

import { execSync } from 'child_process'; import path from 'path'; // This quickstart demonstrates how piral-cli-parcel enables Parcel v1 bundling // for Piral CLI commands by installing it into a new Piral instance. const projectName = 'my-parcel-app'; const projectDir = path.join(process.cwd(), projectName); try { // Ensure piral-cli is installed globally (recommended for Piral development) console.log('Installing piral-cli globally...'); execSync('npm install -g piral-cli@latest', { stdio: 'inherit' }); // Create a new Piral instance project console.log(`\nCreating Piral instance: ${projectName}`); execSync(`piral new ${projectName} --template default --npm`, { stdio: 'inherit' }); process.chdir(projectDir); // Change to the newly created project directory // Install piral-cli-parcel as a development dependency. // The presence of this package automatically configures `piral-cli` to use Parcel v1. console.log('\nInstalling piral-cli-parcel into the project...'); execSync('npm install piral-cli-parcel --save-dev', { stdio: 'inherit' }); console.log('\nConfiguration complete. Piral CLI commands will now use Parcel v1.'); console.log('To start debugging your Piral instance: run `piral debug` from this directory.'); console.log('To build your Piral instance for production: run `piral build` from this directory.'); // Demonstrating a build command that completes quickly console.log('\nExecuting a Piral build command (using Parcel v1) to demonstrate functionality...'); execSync('piral build --target release', { stdio: 'inherit' }); console.log('\nBuild completed using Parcel v1. Check the `dist/release` directory.'); console.log(`\nQuickstart finished. To clean up, run: rm -rf ${projectName}`); } catch (error) { console.error('An error occurred during the quickstart setup or execution:', error); } finally { process.chdir(process.cwd()); // Return to the original directory }
Debug
Known issues
gotchaThis plugin is specifically built for and relies on Parcel v1. Users expecting Parcel v2 features, bug fixes, or a more modern bundling experience may find limitations. Parcel v1 is no longer actively maintained by the Parcel team.
fix
If Parcel v2 or another bundler is required, consider using `piral-cli-webpack` or `piral-cli-esbuild` with custom configurations.
affects: >=0.1.0
gotchaThe `piral-cli-parcel` plugin must be explicitly installed as a development dependency (`npm i piral-cli-parcel --save-dev`) within a Piral instance or pilet project for `piral-cli` to detect and use Parcel as the bundler. A global Parcel installation is not sufficient.
fix
Always install `piral-cli-parcel` in the `devDependencies` of your Piral or pilet project's `package.json`.
affects: >=0.1.0
breakingAs of v0.15.0, the `piral-cli-parcel` package was moved to a dedicated repository. While this is generally transparent for npm installations, it could affect users who previously relied on internal paths or specific monorepo structures for direct imports or tooling integrations.
fix
Ensure you are installing `piral-cli-parcel` via npm and not relying on any direct file paths from a previous monorepo setup.
affects: >=0.15.0
Errors
Common errors & fixes
No bundler found for the current project.
The `piral-cli` could not detect an installed bundler plugin (like `piral-cli-parcel`) in the project's `devDependencies`.
fix
Run `npm install piral-cli-parcel --save-dev` in the root of your Piral instance or pilet project to install the Parcel bundler plugin.
Parcel build failed: Cannot find module 'some-external-package'
Parcel v1's module resolution, especially for external dependencies in Piral, might fail to locate a required package.
fix
Ensure 'some-external-package' is correctly listed in your `package.json` `dependencies` (for the Piral instance or pilet). If it's a shared Pilet external, verify it's correctly declared and provided by the Piral instance. For complex resolution issues, review Parcel v1's documentation regarding externals or consider explicit aliases.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
piral-clirequiredThis package is a plugin for piral-cli and extends its functionality. piral-cli must be installed to utilize piral-cli-parcel.
Agent activity
4 hits · last 30 days
node
4
Resources
piral-cli-parcel — npm install piral-cli-parcel · libregistry