0.0.1 • Published 1 year ago

@instant-bun/instant-bun v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Instant Bun

brandonschabel_simple_flat_geometric_multi_color_modern_logo_bu_a6489642-e13f-48c8-a342-746f9f698143

A Zero Dependency Toolkit For Developing Bun Apps Instantly

This project is a collection of utility functions and modules designed to provide users with an easy-to-use and efficient set of tools for various tasks in web development, data manipulation, networking, and more.

The Docs Are Mostly Generated In This Repo

Most of the documentation in this repo is generated by using the cli-app to generate documentation - you can also use bun run docs-gen although you would need to configure your Open AI key in .env in the root of the repo (see .env.example)

Project Overview

The intention of this project is to create a comprehensive library that helps developers tackle common problems and tasks that they might encounter in their day-to-day work without cumbersome sub-dependencies. By providing well-documented and tested functions and modules, we aim to save developers time and effort and reduce the likelihood of bugs and other issues in their projects.

Features

This project includes a variety of modules and utility functions, such as:

Text Utils:

Functions for converting markdown to HTML, handling strings, and more.

CLI Utils:

Functions for handling command-line input, parsing arguments, and interacting with the file system.

Networking Utils:

Functions for creating CRUD servers, handling HTTP requests, and working with the OpenAI API.

Data Storage Utils:

Functions for working with SQLite databases and data validation.

Type Utils:

Functions for validating data against a schema and inferring data types from objects.

Security Utils:

Functions for generating encryption keys, encrypting and decrypting data, and more.

GPT Utils:

Functions for generating debug prompts using OpenAI's GPT models.

Error Handler and Validation Utils:

Functions for handling and validating errors in a user-friendly way.

Files and Folders Utils:

Functions for working with files and directories, such as retrieving files from a specific directory or saving results to a file.

Getting Started

To get started with this project, clone the repository and install the required dependencies. Then, you can begin using the utility functions and modules in your own projects by importing them as needed.

Contributing

We welcome contributions to this project! If you have a utility function or module that you think would be a useful addition, please feel free to submit a pull request. We also appreciate any bug reports, suggestions, or other feedback.

License This project is licensed under the MIT License.

Ever had a brilliant idea but felt overwhelmed by the countless options and dependencies? Worry no more! Introducing Instant Bun, your sleek and simplified solution for indie hacker apps.

Say goodbye to the cumbersome stacks of large companies, and hello to a toolkit designed to deliver lightning-fast experiences in your app. Built with hobbyists at heart, Instant Bun streamlines project building, putting the excitement and joy back into programming. Dive into a world where every design choice fuels your creative endeavors, and let the fun begin!

The goal will always to be building this toolkit with no extra dependencies so your apps stay lean and fast, just Bun itself

This is a toolkit to develop servers, decentralized networks, developer tools, custom raspberry pi software, realtime software. Use tiny direct bun source code modules to solve your problem.

Limitations and Dependencies

The project has the following limitations:

  • Only Bun can be used as a dependency.
  • Everything should be built from scratch in a reusable way.
  • If something becomes overly complicated, create a new version.
  • Focus on learning and contributing to Bun.

Project Structure and Ideas

Each idea should be its own module within the project. Modules should be modular, unit testable, and only export things that are worth using outside the module. They should be able to operate independently and may depend on each other. Maintain a flat hierarchy within modules.

Modules

  • generated
  • html-formatter
  • markdown-to-html
  • error-handling
  • types
  • files-folders
  • sqlite-interface
  • gpt-utils
  • validations
  • templating-engine
  • fetch-utils
  • code-generators
  • scripts
  • web-page-render
  • cli-utils

Contributing

Because there are a lot of generated docs you can begin by look at the _docs folder and look for each module, this folder contains all modules documentation, summaries, etc.

To get the project setup run: bun install

this will just install the types for bun there are no distributed dependencies besides bun itself

if you want to test this in your own project while making changes you can link this project by running the following command in this directory: bun link

Then in your app run bun link instant-bun

this will allow you to make changes to this repo and se the changes reflect in your own repo. Since instant-bun has no dependencies, I've decided to do away with any build step and just distribute as raw source code. Eventually i don't want o distribute the apps and plugins, so I will have to create a script to publish, but ignore those.

Installation Details

If you don't have bun installed run:

curl -fsSL https://bun.sh/install | bash

ceate a new directory and cd into it :

mkdir playground && cd playground

init bun project

bun init 

Install instant-bun in your bun app,

bun add https://github.com/Modular-Architecture-Toolkit/instant-bun

OR do an install from the npm registry

bun add instant-bun

Why would I add the repo directly you might ask? Because you use the source code directly, every commit is a new version, and you can use whatever version of each module that you want.

then import into your module

import { fetchUtils } from 'instant-bun'

You can even use a single module directly

bun add https://github.com/Modular-Architecture-Toolkit/instant-bun/tree/main/modules/sqlite-interface

you'll have node modules which will contain the source code directly to instant-bun

Fork the project and you can even start making your own versions of each module. Do whatever you want, everything is highly modular.

watch tests bun --watch test

I will move unnesssary things out of the source code as the project matures, my goal is to simplify constantly.

0.0.1

1 year ago