0.3.7 • Published 3 years ago

lebeben-go v0.3.7

Weekly downloads
13
License
ISC
Repository
github
Last release
3 years ago

Lebeben

lebeben-go

Lebeben is a single CLI to transpile, bundle, watch, and serve your javascript SPA.

Usage

CLI Options

  • All option are prefixed with a single -
  • boolean options must be passed =1
    • watch=1 serve=1, etc
NameDescriptionTypeDefault
helpdisplay the help messagebooleanfalse
jsxFactoryjsx render function to use for nodesstringh
jsxFragmentjsx render function to use for fragmentsstringFragment
minifyminify all outputbooleanfalse
nomodulegenerate the es2015 fallback bundlebooleanfalse
portthe port to servenumber5000
publicthe directory to servestringpublic
serveserve app locallybooleanfalse
watchone or many directories to watch for changesbooleanfalse

Examples

# Build your app from src/index.js
lebeben-go src/index.js
# Build/Minify your React app from src/index.jsx
lebeben-go -minify=1 --jsxFactory="React.createElement" -jsxFragment="React.Fragment" src/index.jsx
# Watch/Serve a preact app from src/index.tsx
lebeben-go -watch=1 -serve=1 src/index.tsx

Build across platforms in bash (handled by Github Actions)

env GOOS='darwin' GOARCH='amd64' go build -o builds/lebeben-go-macos/lebeben-go .
env GOOS='windows' GOARCH='amd64' go build -o builds/lebeben-go-win64/lebeben-go.exe .
env GOOS='linux' GOARCH='amd64' go build -o builds/lebeben-go-linux/lebeben-go .

chmod +x builds/lebeben-go-macos/lebeben-go
chmod +x builds/lebeben-go-win64/lebeben-go.exe
chmod +x builds/lebeben-go-linux/lebeben-go

tar -C builds -czvf lebeben-go-macos.tar.gz lebeben-go-macos
tar -C builds -czvf lebeben-go-win64.tar.gz lebeben-go-win64
tar -C builds -czvf lebeben-go-linux.tar.gz lebeben-go-linux

Development/Release Process

  • npm i
  • make changes, rebuilt, test, etc
  • bump the version in package.json and package-lock.json
  • git add .
  • git commit -m "messages"
    • precommit hooks will format go and js files
  • git tag vX.Y.Z
    • make note of the leading v
    • should match the version in package.json
  • git push origin master --tags
  • wait for github actions to
    • build the go binaries for mac, linux, and windows
    • create a release on Github
    • publish a new version to npm, pointing to that release

Performance

Comparison between the native javascript version, version pulled from go get and the version installed via npm. 30 rebuilds triggered by saving a single watched file, saving roughly every 250ms. The average of the 30 builds is shown below.

Javascriptgo getnpm i
~18s~6s~7s
0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4-alpha1

3 years ago

0.3.4

3 years ago

0.3.3-alpha6

3 years ago

0.3.2

3 years ago

0.3.3

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago