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
This commit is contained in:
2026-01-16 09:13:14 -05:00
parent 9e451469f5
commit a63a758cc5
19 changed files with 160 additions and 161 deletions

View File

@@ -11,15 +11,15 @@
build:
@echo "Building Strata compiler..."
@mkdir -p bin
@cd compiler && go mod tidy && go build -ldflags="-s -w" -o ../bin/strata ./cmd/strata
@echo "Done! Binary at ./bin/strata"
@cd compiler && go mod tidy && go build -ldflags="-s -w" -o ../bin/strata-compile ./cmd/strata
@echo "Done! Binary at ./bin/strata-compile"
# Build with race detector (for development)
build-debug:
@echo "Building Strata compiler (debug)..."
@mkdir -p bin
@cd compiler && go build -race -o ../bin/strata-debug ./cmd/strata
@echo "Done! Binary at ./bin/strata-debug"
@cd compiler && go build -race -o ../bin/strata-compile-debug ./cmd/strata
@echo "Done! Binary at ./bin/strata-compile-debug"
# ============================================================================
# INSTALLATION
@@ -46,27 +46,27 @@ setup: build
@npm install --silent
@echo ""
@echo "Strata setup complete!"
@echo " Binary: ./bin/strata"
@echo " Binary: ./bin/strata-compile"
@echo ""
@echo "Run 'make install' for full installation with shell config."
# Link binary to /usr/local/bin (quick global access)
link: build
@echo "Linking strata to /usr/local/bin..."
@echo "Linking strata-compile to /usr/local/bin..."
@if [ -w /usr/local/bin ]; then \
ln -sf "$(PWD)/bin/strata" /usr/local/bin/strata; \
ln -sf "$(PWD)/bin/strata-compile" /usr/local/bin/strata-compile; \
else \
sudo ln -sf "$(PWD)/bin/strata" /usr/local/bin/strata; \
sudo ln -sf "$(PWD)/bin/strata-compile" /usr/local/bin/strata-compile; \
fi
@echo "Done! 'strata' command is now available globally."
@echo "Done! 'strata-compile' command is now available globally."
# Unlink from /usr/local/bin
unlink:
@echo "Unlinking strata from /usr/local/bin..."
@echo "Unlinking strata-compile from /usr/local/bin..."
@if [ -w /usr/local/bin ]; then \
rm -f /usr/local/bin/strata; \
rm -f /usr/local/bin/strata-compile; \
else \
sudo rm -f /usr/local/bin/strata; \
sudo rm -f /usr/local/bin/strata-compile; \
fi
@echo "Done!"
@@ -110,19 +110,19 @@ doctor-fix:
# Run dev server on example app
dev: build
@cd examples/basic-app && ../../bin/strata dev
@cd examples/basic-app && ../../bin/strata-compile dev
# Run dev server with browser open
dev-open: build
@cd examples/basic-app && ../../bin/strata dev --open
@cd examples/basic-app && ../../bin/strata-compile dev --open
# Build example app for production
example-build: build
@cd examples/basic-app && ../../bin/strata build
@cd examples/basic-app && ../../bin/strata-compile build
# Preview example app production build
example-preview: build
@cd examples/basic-app && ../../bin/strata preview
@cd examples/basic-app && ../../bin/strata-compile preview
# Watch and rebuild compiler on changes
watch:
@@ -171,7 +171,7 @@ gen-component: build
echo "Usage: make gen-component NAME=MyComponent"; \
exit 1; \
fi
@cd examples/basic-app && ../../bin/strata generate component $(NAME)
@cd examples/basic-app && ../../bin/strata-compile generate component $(NAME)
# Generate page (usage: make gen-page NAME=about)
gen-page: build
@@ -179,7 +179,7 @@ gen-page: build
echo "Usage: make gen-page NAME=about"; \
exit 1; \
fi
@cd examples/basic-app && ../../bin/strata generate page $(NAME)
@cd examples/basic-app && ../../bin/strata-compile generate page $(NAME)
# Generate store (usage: make gen-store NAME=cart)
gen-store: build
@@ -187,7 +187,7 @@ gen-store: build
echo "Usage: make gen-store NAME=cart"; \
exit 1; \
fi
@cd examples/basic-app && ../../bin/strata generate store $(NAME)
@cd examples/basic-app && ../../bin/strata-compile generate store $(NAME)
# Shorthand aliases
c: gen-component
@@ -223,11 +223,11 @@ clean-all: clean
release:
@echo "Building release binaries..."
@mkdir -p dist/release
@cd compiler && GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-darwin-amd64 ./cmd/strata
@cd compiler && GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ../dist/release/strata-darwin-arm64 ./cmd/strata
@cd compiler && GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-linux-amd64 ./cmd/strata
@cd compiler && GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o ../dist/release/strata-linux-arm64 ./cmd/strata
@cd compiler && GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-windows-amd64.exe ./cmd/strata
@cd compiler && GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-compile-darwin-amd64 ./cmd/strata
@cd compiler && GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ../dist/release/strata-compile-darwin-arm64 ./cmd/strata
@cd compiler && GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-compile-linux-amd64 ./cmd/strata
@cd compiler && GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o ../dist/release/strata-compile-linux-arm64 ./cmd/strata
@cd compiler && GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ../dist/release/strata-compile-windows-amd64.exe ./cmd/strata
@echo "Release binaries built in dist/release/"
# ============================================================================