• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    JavaScript
  • License
    GNU Lesser Genera...
  • Created almost 4 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚑ Blazing fast dev server powered by sandpack

Blazepack ⚑

Blazing fast dev server powered by sandpack

Build Status PRs Welcome

Motivation

I always wanted the super fast feedback that codesandbox provides in my local environment, so I have built a tiny wrapper around the codesandbox bundler sandpack and it runs locally πŸŽ‰

Why Blazepack?

  • It is blazing fast ⚑
  • Super tiny (24kb) πŸ‘Œ
  • Run projects without npm install πŸ’ƒ
  • Supports private npm packages πŸ˜‰
  • React fast refresh ❀️
  • Supports React, Vue, Angular, Preact, Svelte and more πŸ”¨
  • Save disk space πŸ’Ύ

Install

Install it globally

npm i -g blazepack

You can also use the blazepack vscode extension

Usage

Create project from Template

Create your first create react app

blazepack create my-cra --template=react

# create the app and also start the dev server

blazepack create my-angular-app --template=angular --open
Available Templates
  • static
  • react
  • react-ts
  • react-native-web
  • vanilla
  • preact
  • vue2
  • vue3
  • angular
  • svelte
  • reason
  • cxjs
  • dojo

Start project

To use it in your existing create react app, angular, preact, svelte, vue cli app just run

blazepack start

It will start the dev server at port 3000 and open it in browser, you can change the default port by using the port option

blazepack start --port 3001

You can also run it using the npx command and not install it globally

npx blazepack start

Install dependency

You can install a new package pretty fast using the below command. It does not create node_modules so you are gonna save a lot of space πŸ˜‰

blazepack install redux [--dev|-save-dev|-D]

# or

blazepack i redux [--dev|-save-dev|-D]

# or

blazepack add redux [--dev|-save-dev|-D]

Remove dependency

You can quickly remove a unused dependency by running following command:

blazepack remove redux

# or

blazepack uninstall redux

Check version

To know the version of blazepack you are running use the --version option

blazepack --version

Clone Sandbox

You can clone an existing codesandox, by just running the below commands:

Clone from URL

blazepack clone https://codesandbox.io/s/use-undo-redo-yrts1

Cloning from embed url

blazepack clone https://codesandbox.io/embed/use-undo-redo-yrts1

Clone from Sandbox Id

blazepack clone use-undo-redo-yrts1

Export to codesandbox.io

You can export your current project to codesandbox for sharing with your friends in a jiffy

blazepack export

# use --open option to also open the newly created sandbox in a browser tab

blazepack export --open

Private npm packages

We honour the project level .npmrc file and if it is not found we fallback to user level .npmrc file and then finally the global .npmrc file. Currently we only support scoped private npm packages. To use the scoped private npm packages you need to fist login into the npm registry and add the scope config to .npmrc

@myorg:registry=https://registry.myorg.com
//registry.myorg.com/:_authToken=secrettoken

Aliases for blazepack

We create two more alias for blazepack to help you with lesser typing πŸ˜‡

bpk create my-cra

# or

blaze create my-cra

Help

You can know more about the available commands and their options using the help command

blazepack --help

# get help on individual command

blazepack start --help

Node Interface

Blazepack exposes a Node.js API which can be directly used in Node.js runtime. Blazepack vscode extension is using the same API.

const bpk = require('blazepack');

// start the dev server
bpk.commands.startDevServer({
  directory: process.cwd(),      // directory of your project
  port: 3000,                   // port on which the dev server should start, by default it is 3000
  openInBrowser: true,         // open the project in browser once the dev server starts
  onSuccess: (server) => {},  // success callback with node http server instance when the server is ready
  onError = (err) => {},     // error callback when something goes wrong
});

// create a new project
bpk.commands.createProject({
  projectName: 'my-cra',                         // name of the project
  templateId: bpk.constants.TEMPLATES['react'], // template to use
  startServer: true,                           // start the dev server once the project is created
  portL 3000,                                 // port on which the dev server should start, by default it is 3000
  onSuccess: () => {},                       // success callback when the the project is created
  onError: (err) => {}                      // error callback when something goes wrong
});

// export a project to codesandbox.io
bpk.commands.exportSandbox({
  directory: process.cwd(),       // path to the project that has to be exported
  openInBrowser: true,           // open the sandbox in browser once exported
  onSuccess: (sandboxId) => {}, // success callback with sandboxId when the export was successful
  onError = (err) => {},       // error callback when something goes wrong
})

// detect the template being used in a particular project
try {
  const template = bpk.utils.detectTemplate(process.cwd());

  console.log(`${template} is being used at ${process.cwd()}`);
} catch {
  console.log('Unknown project template');
}

Facing issues?

Run blazepack in verbose mode and share the log by raising an issue

blazepack start --verbose > blazepack.log

Development Setup

Fork this repository to make your own copy

git clone https://github.com/yourusername/blazepack
cd blazepack
npm install
mkdir playground # playground directory is part of .gitignore
cd playground
node ../bin/blazepack.js <command> <name> <template> # Executes our local blazepack project in playground folder

Now we can make use of node relative-path-to-bin/blazepack.js <command> in playground folder to run and execute our local blazepack project

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Ameer Jhan

πŸ’» πŸ“– πŸ› πŸ€”

Yash Joshi

πŸ’» πŸ“– πŸ› πŸ€”

Philip Murphy

πŸ’» πŸ›

Sahil Rajput

πŸ“– πŸ€”

dhruw lalan

πŸ’» πŸ›

Sai Deepesh

πŸ€” πŸ’» πŸ“– πŸ›

Khushal Sharma

πŸ›

Shivam Bhanushali

πŸ€” πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Show your support by ⭐ the repo

License

GPL Β© Ameer Jhan

More Repositories

1

kubelive

kubectl tool reinvented to be more reactive and interactive πŸ”₯
JavaScript
587
star
2

deno-vscode

πŸ”¨ A vscode extension to enhance development experience for deno
TypeScript
142
star
3

deno-cli-spinners

Awesome deno terminal spinners 🎨
TypeScript
58
star
4

envase

https://envase-website.vercel.app/
TypeScript
43
star
5

covid-vaccine-gh-action

GitHub action to get notification whenever vaccine slot is availble in cowin portal πŸŽ‰
JavaScript
33
star
6

qnd-react

My own quick and dirty implementation of react to learn how react works under the hood πŸ’₯
JavaScript
30
star
7

ts-native

Build native apps using typescript powered by llvm πŸŽ‰
ANTLR
28
star
8

fake-fetch

Fake fetch responses in browser πŸ’₯
TypeScript
23
star
9

frame-rpc

Iframe communications using json rpc
TypeScript
20
star
10

webpack-starter-pack

This is a very basic webpack setup with just ES6 support and everything else is left upto your creativity
JavaScript
15
star
11

better-default-avatar

Generate avatars with first letter of user's first and last name πŸ“·
JavaScript
13
star
12

jquery-simple-validator

🍻 It is a lightweight jQuery form validator which enhances on html5 validations
JavaScript
11
star
13

XamarinFormValidationDemo

This is a demo app for my medium blog on xamarin form validations
C#
8
star
14

corona-status

Handy website to track corona status in your state or country πŸ”₯
TypeScript
8
star
15

blazepack-vscode

VSCode extension for Blazepack ⚑
JavaScript
7
star
16

express-slick-css

🎈 An express middleware which cleans all the unused css in the template and makes the css slick
JavaScript
6
star
17

express-icode

πŸ”₯ It is an express backend for an online coding challenge website
JavaScript
6
star
18

github-analytics

Get insights into how many visit your profile, repositories and from which country πŸ”₯
TypeScript
6
star
19

karma-material-reporter

Visualize karma test results in real time with material designed reporter 🎨
TypeScript
6
star
20

portfolio-os

πŸ‘· It is a mac os look alike portfolio
TypeScript
5
star
21

ng-flash-messages

πŸ’₯ flash messages for angular
JavaScript
5
star
22

hackbox-olx

A fully open-sourced light weight web IDE
TypeScript
5
star
23

XamarinFormValidation

Delcarative, flexible and highly configurable validations in Xamarin without a sweat
C#
4
star
24

jomato

A zomato clone to demonstrate micro frontends
JavaScript
4
star
25

fullstack-template

TypeScript
3
star
26

containers-for-rest-of-us

Containers for rest of us talk deck
3
star
27

colossus

🎨 Rich set of react styled components that anyone would ever need
TypeScript
3
star
28

Graph.js

A simple graph ADT made for JavaScript πŸ”₯
JavaScript
3
star
29

mdx-slides

Build awesome presentations using mdx
JavaScript
3
star
30

reyna

Build frontend applications with full end to end type safety
TypeScript
3
star
31

portfolio-old

πŸ‘· This is my personal portfolio where you can read more about all the works I have been doing in my office, opensource communities and in my pet projects
JavaScript
3
star
32

blockchain

My own blockchain from scratch for udemy course
JavaScript
2
star
33

kickstarting-your-oss-journey

2
star
34

probot-question-tagger-demo

Demo github repository for question tagger probot app
2
star
35

ola-studios

An online music streaming app with downloads, history
Java
2
star
36

awesome

Links to awesome stuffs that I found on the internet (mostly tech πŸ˜‰)
2
star
37

angular-icode

🎨 Its an angular4 frontend for an online coding challenge website
TypeScript
2
star
38

tax-manager

It is a tax management app for a village office, made with angular, express and electron πŸ’Ό
TypeScript
2
star
39

SlamBook

πŸ“– It is a full fledged online slambook with facebook login, following users, slamming them and comment on slams and much more...
Ruby
2
star
40

riggy

Swiggy clone built with React, Redux
JavaScript
2
star
41

gekko

TypeScript
2
star
42

kubelive-go

Next generation of kubelive built using golang
Go
1
star
43

mdx-slides-demo

MDX slides demo
1
star
44

valorant-live-loadouts

Electron app to get live Valorant loadouts during a match
1
star
45

codemod-demo

Demo for use of codemods
JavaScript
1
star
46

tslox

TypeScript
1
star
47

ng-flash-messages-demo

It is an demo angular app for using the ng-flash-messages library
TypeScript
1
star
48

hackbox2

Next version of hackbox
TypeScript
1
star
49

portfolio

Personal portfolio powered by astro
Astro
1
star
50

rslox

Repo for learning compiler design using rust
Rust
1
star
51

cargo-core

Cargoes that can be used to build on containerised applications
Dockerfile
1
star
52

ammus-website

JavaScript
1
star
53

node-calculator

A simple app for automated tests using jest
JavaScript
1
star
54

isogit-demo

HTML
1
star
55

reactify-remix-workshop-starter

Starter template for remix workshop
JavaScript
1
star
56

react-boilerplate

A react scaffold with react, typescript, jest, prettier, tslint, scss, husky ❀️
JavaScript
1
star
57

gulp-boilerplate

It is a boilerplate for gulp build environment with support for sass, es2015 with minification
JavaScript
1
star
58

kube-crazy-web-api

πŸ”¨ A demo project to run a simple .NET Core Web API in Kubernetes
C#
1
star
59

github-profile-clone

JavaScript
1
star
60

portfolio-core

πŸ”¨ This repository consists of markdowns and configuration for my portfolio website
1
star
61

opentodo

A self hosted todo list for myself to learn golang πŸŽ‰
Go
1
star
62

scalable-js-apps-jsconf

JavaScript
1
star
63

blazepack-templates

Templates used by blazepack
1
star
64

vscode-web

vscode that runs on the browser
HTML
1
star
65

mini-bundler

JavaScript
1
star
66

cargo-cli

Download and build with containerized project recipies πŸ€–
JavaScript
1
star
67

ts-type-alias-bench

To check whether simple type unions need to be type aliased and if so does it give a perf boost
JavaScript
1
star
68

letschat

It is an angular5 simple chatting application built with firebase ;)
TypeScript
1
star
69

codesandbox-template-remix

Remix template for CodeSandbox Projects
TypeScript
1
star