Files
strata-compile/scripts/env.sh
Carlos Gutierrez a63a758cc5 feat: initial release of Strata framework v0.1.0
- Static compiler with STRC pattern (Static Template Resolution with
   Compartmentalized Layers)
   - Template syntax: { } interpolation, { s-for }, { s-if/s-elif/s-else
    }
   - File types: .strata, .compiler.sts, .service.sts, .api.sts, .sts,
   .scss
   - CLI tools: strata-compile dev, strata-compile build, strata-compile
    g (generators)
   - create-strata-compile scaffolding CLI with Pokemon API example
   - Dev server with WebSocket HMR (Hot Module Replacement)
   - Documentation: README, ARCHITECTURE, CHANGELOG, CONTRIBUTING,
   LICENSE
2026-01-16 09:13:14 -05:00

68 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Strata Framework - Environment Setup
# Source this file to set up the Strata environment without installing
# Usage: source ./scripts/env.sh
# or: . ./scripts/env.sh
# Get the directory of this script
if [ -n "$BASH_SOURCE" ]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
elif [ -n "$ZSH_VERSION" ]; then
SCRIPT_DIR="$(cd "$(dirname "${(%):-%x}")" && pwd)"
else
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
fi
REPO_DIR="$(dirname "$SCRIPT_DIR")"
# Check if binary exists
if [ ! -x "$REPO_DIR/bin/strata" ]; then
echo "Strata binary not found. Building..."
(cd "$REPO_DIR" && make build)
fi
# Set environment variables
export STRATA_DEV=1
export STRATA_REPO="$REPO_DIR"
export PATH="$REPO_DIR/bin:$PATH"
# Set aliases
alias st='strata-compile'
alias stdev='strata-compile dev'
alias stbuild='strata-compile build'
alias stgen='strata-compile generate'
alias stnew='npx create-strata-compile'
# Development aliases
alias stmake='make -C "$STRATA_REPO"'
alias stbuild-compiler='make -C "$STRATA_REPO" build'
alias stclean='make -C "$STRATA_REPO" clean'
alias sttest='make -C "$STRATA_REPO" test'
# Quick function to rebuild and run
strebuild() {
make -C "$STRATA_REPO" build && strata "$@"
}
# Function to run example app
stexample() {
cd "$STRATA_REPO/examples/basic-app" && strata-compile dev
}
echo ""
echo "Strata development environment activated!"
echo ""
echo " Binary: $REPO_DIR/bin/strata"
echo " Version: $(strata version 2>/dev/null || echo 'unknown')"
echo ""
echo " Commands:"
echo " strata - Run strata CLI"
echo " strebuild - Rebuild compiler and run command"
echo " stexample - Run example app"
echo " stmake <cmd> - Run make command in repo"
echo ""
echo " Aliases:"
echo " st, stdev, stbuild, stgen, stnew"
echo ""