Registry / devops / parcel-transformer-transcrypt

parcel-transformer-transcrypt

JSON →
library1.0.3jsnpmunverified

A Parcel v2 transformer plugin that converts Python files to JavaScript using the Transcrypt transpiler. Version 1.0.3 is current, with no active release cadence. Unlike other Python-to-JS bridges, this integrates directly with Parcel's build pipeline, enabling bundling, code splitting, and HMR. Requires Transcrypt (Python transpiler) installed in a virtual environment; Python version must match Transcrypt version. Supports custom CLI arguments and output directory configuration.

npm install parcel-transformer-transcrypt
INSTALL
IMPORT
SIG · PARCEL-TRANSFORMER
P
parcel-transformer-transcrypt
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default (plugin registration)
no JavaScript import needed; configure in .parcelrc
import parcelTransformerTranscrypt from 'parcel-transformer-transcrypt'
This is a Parcel transformer plugin, not a library. No JS imports required.
Parcel config (JSON)
{ "transformers": { "*.py": ["parcel-transformer-transcrypt"] } }
{ "plugins": ["parcel-transformer-transcrypt"] }
Configure in .parcelrc under transformers, not plugins.
Package config (JSON)
"parcel-transformer-transcrypt": { "transcryptVersion": "3.9", "watchAllFiles": true, "command": "python -m transcrypt", "arguments": ["--nomin", "--map"] }
"parcel-transformer-transcrypt": { "version": "3.9" }
Configuration goes in package.json under 'parcel-transformer-transcrypt' key, not in a separate file.

Sets up a Parcel project with Python-to-JS support: installs parcel and transformer, creates Python file and HTML entry, configures .parcelrc, and runs build.

# Create a basic Python file (example.py) print('Hello from Python!') # Initialize project and install dependencies npm init -y npm install parcel --save-dev npm install parcel-transformer-transcrypt --save-dev # Set up Python virtual environment with Transcrypt (Python 3.9) python3.9 -m venv venv source venv/bin/activate pip install transcrypt # Configure .parcelrc cat > .parcelrc << 'EOF' { "extends": ["@parcel/config-default"], "transformers": { "*.py": ["parcel-transformer-transcrypt"] } } EOF # Create an HTML entry that imports the Python module cat > index.html << 'EOF' <!DOCTYPE html> <html><body> <script type="module" src="./example.py"></script> </body></html> EOF # Build with Parcel npx parcel build index.html
Debug
Known issues
gotchaPython version must match Transcrypt version (e.g., Python 3.9 with Transcrypt 3.9, Python 3.7 with Transcrypt 3.7.16). Mismatch causes transpilation errors.
fix
Use compatible Python/Transcrypt versions as documented.
affects: all
deprecatedTranscrypt 3.7 is outdated and may have security vulnerabilities. Use Python 3.9 + Transcrypt 3.9+.
fix
Upgrade to Python 3.9 and Transcrypt 3.9 or later.
affects: <=3.7
gotchaThe --outdir argument is ignored for Transcrypt 3.7. Output directory customization only works with 3.9 and above.
fix
Use Transcrypt 3.9+ for --outdir support.
affects: >=3.7 <3.9
gotchaThe transformer automatically detects Python and Transcrypt versions by running `python --version` and `transcrypt --help`. If multiple Python versions are installed, it may pick the wrong one.
fix
Ensure `python` in PATH points to the correct version, or set 'transcryptVersion' in package.json config.
affects: all
gotchaTranscrypt must be installed in a Python virtual environment, not globally. The transformer assumes 'python' and 'transcrypt' commands are available in the build environment.
fix
Activate the virtual environment before running Parcel, or specify full path in 'command' config.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'parcel-transformer-transcrypt'
Package not installed or not listed in devDependencies
fix
Run `npm install parcel-transformer-transcrypt --save-dev`
Module script failed because the module is not a valid JavaScript module
Python file not transpiled correctly, possibly due to version mismatch
fix
Check Python & Transcrypt versions are compatible (3.9 with 3.9). Re-run build with --verbose.
Transcrypt: error: unrecognized arguments: --outdir
Using Transcrypt 3.7 which doesn't support --outdir
fix
Upgrade to Transcrypt 3.9+ or remove --outdir from arguments.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
parcelrequiredPlugin runs only within Parcel v2 build system (peer dependency)
transcryptrequiredRuntime dependency — the Python-to-JS transpiler (installed via pip, not npm)
Agent activity
2 hits · last 30 days
node
2
Resources
parcel-transformer-transcrypt — npm install parcel-transformer-transcrypt · libregistry