npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bimba-cli

v0.2.4

Published

The CLI tool to run Imba projects under Bun

Downloads

118

Readme

This tool helps to work with Imba projects under Bun. That is why it is called Bun+IMBA = BIMBA 😉

It includes the plugin for Bun to compile .imba files and also the CLI tool for buiding .imba files, since the plugins can't be passed to Bun via shell command bun build.

First of all install this tool like any other npm package:

bun add bimba-cli -d

Then create a bunfig.toml file in the root folder of your project, and add only one line in it (I could not find any workaround to do this automatically):

preload = ["bimba-cli/plugin.js"]

You are done!

Backend development

Now to run an .imba file in Bun's environment you can use the usual Bun syntax:

bun run src/index.imba

Or with the watch argument:

bun --watch run src/index.imba

Frontend development

For frontend you will need to compile and bundle your source code from .imba to .js. And here the bimba-cli will help:

bunx bimba src/index.imba --outdir public

Or with the watch argument:

bunx bimba src/index.imba --outdir public --watch

Here are all the available argumentsthat you can pass to the bimba:

--watch - Monitors changes in the directory where the entry point is located, and rebuilds the projects when the change occures. Keep entrypoint file in the subfolder, otherwise Bun will trigger several times since the cache dir update also triggers rebuilding.

--clearcache - If is set, the cache directory is deleted when bimba exits. Works only in the watch mode, since when bundling cache will be used next time to speed up the compiling time.

bunx bimba src/index.imba --outdir public --watch --clearcache

--sourcemap - Tells Bun how to inculde sourcemap files in the final .js. It is none by default.

bunx bimba src/index.imba --outdir public --sourcemap inline

--minify - If is set the final JS code in the bundle produced by Bun will be minified. It is false by default.

bunx bimba src/index.imba --outdir public --minify

--platform - The value of this argument will be passed to the Imba compiler. By default it is browswer. The value node does not work under Bun.

bunx bimba src/index.imba --outdir public --platform browser

Live reload

Initially I have implemented the live reload functionality, but then decided to refuse it. There is a pretty good VS Code extension: Lite Server. It does everything needed out of the box.

Just let bimba rebuild the sources on change and Lite Server will reload the page in the browser.