mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
* Add bin scripts for setup, build, and test Add standardized bin scripts following the PostHog template pattern: - bin/setup: installs dependencies via pnpm install - bin/build: runs setup if needed, then builds all packages - bin/test: runs tests for specific packages or all packages - Interactive menu when no package specified - Package aliases (js, rn, lite, etc.) - Test type flags (--unit, --functional, --e2e) - Pre-flight checks for dependencies and build status - bin/helpers/_utils.sh: shared utility functions * Remove run_command and simplify bin scripts The run_command function had a quoting bug when handling commands with arguments. Replace it with direct echo statements and command execution. Applies changes from PostHog/template#6. * Always run bin/setup in bin/build Checking for node_modules existence doesn't guarantee dependencies are up to date with the lockfile. Always running setup is safer and pnpm is fast when deps are already satisfied.
24 lines
447 B
Python
Executable File
24 lines
447 B
Python
Executable File
#!/usr/bin/env bash
|
|
#/ Usage: bin/build
|
|
#/ Description: Builds all packages in the monorepo
|
|
#/
|
|
#/ This script runs bin/setup first to ensure dependencies are installed.
|
|
|
|
source bin/helpers/_utils.sh
|
|
set_source_and_root_dir
|
|
|
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
|
show_help
|
|
exit 0
|
|
fi
|
|
|
|
# Ensure dependencies are installed and up to date
|
|
bin/setup || exit 1
|
|
|
|
set -e
|
|
|
|
echo "→ Building packages"
|
|
pnpm build
|
|
|
|
success "Build complete"
|