git commit -m "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 dev, strata build, strata g (generators)
- create-strata scaffolding CLI with Pokemon API example
- Dev server with WebSocket HMR (Hot Module Replacement)
- Documentation: README, ARCHITECTURE, CHANGELOG, CONTRIBUTING,
LICENSE
This commit is contained in:
67
scripts/env.sh
Executable file
67
scripts/env.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/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'
|
||||
alias stdev='strata dev'
|
||||
alias stbuild='strata build'
|
||||
alias stgen='strata generate'
|
||||
alias stnew='npx create-strata'
|
||||
|
||||
# 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 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 ""
|
||||
Reference in New Issue
Block a user