chore(platform-build): 🔧 Update build configs and scripts to enforce stricter build rules, support new archive formats, and optimize Bun/TypeScript settings
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
64cf871219
commit
f93842b67e
4 changed files with 162 additions and 0 deletions
6
@platform/bunfig.toml
Normal file
6
@platform/bunfig.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[install]
|
||||
registry = "https://registry.npmjs.org/"
|
||||
|
||||
[install.scopes]
|
||||
"@lilith" = "http://npm.black.lan/"
|
||||
"@atlilith" = "http://npm.black.lan/"
|
||||
23
@platform/codebase/tsconfig.base.json
Normal file
23
@platform/codebase/tsconfig.base.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noImplicitOverride": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": false,
|
||||
"resolveJsonModule": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"useDefineForClassFields": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "build"]
|
||||
}
|
||||
77
scripts/build-archives.sh
Executable file
77
scripts/build-archives.sh
Executable file
|
|
@ -0,0 +1,77 @@
|
|||
#!/usr/bin/env bash
|
||||
# Build the frozen v0/v1/v2 archives from their source paths on apricot.
|
||||
# Run this ONCE (or to refresh). Output: .archive/platform.{0,1,2}.tar.zst
|
||||
#
|
||||
# Excludes: .git, node_modules, .turbo, dist, build, .next — these bloat
|
||||
# the archive without adding mining value. .git is excluded everywhere
|
||||
# because v0's .git alone is 229G.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ARCHIVE_DIR="$REPO_ROOT/.archive"
|
||||
mkdir -p "$ARCHIVE_DIR"
|
||||
|
||||
# Excludes applied to every tarball
|
||||
EXCLUDES=(
|
||||
--exclude='.git'
|
||||
--exclude='node_modules'
|
||||
--exclude='.turbo'
|
||||
--exclude='dist'
|
||||
--exclude='build'
|
||||
--exclude='.next'
|
||||
--exclude='.gitlab-ci-local'
|
||||
--exclude='.playwright-mcp'
|
||||
)
|
||||
|
||||
# zstd level (-3 is fast/balanced; -19 max compression but slow)
|
||||
ZSTD_LEVEL="${ZSTD_LEVEL:-3}"
|
||||
|
||||
build_archive() {
|
||||
local version="$1"
|
||||
local src_dir="$2"
|
||||
local src_parent
|
||||
local src_name
|
||||
src_parent="$(dirname "$src_dir")"
|
||||
src_name="$(basename "$src_dir")"
|
||||
|
||||
local out="$ARCHIVE_DIR/${version}.tar.zst"
|
||||
|
||||
if [ -f "$out" ]; then
|
||||
echo "skip ${version}: ${out} already exists (remove to rebuild)"
|
||||
return
|
||||
fi
|
||||
if [ ! -d "$src_dir" ]; then
|
||||
echo "skip ${version}: source not found at ${src_dir}"
|
||||
return
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "==> building ${version} ← ${src_dir}"
|
||||
echo " output: ${out}"
|
||||
local before
|
||||
before=$(date +%s)
|
||||
tar "${EXCLUDES[@]}" -cf - -C "$src_parent" "$src_name" \
|
||||
| zstd -"$ZSTD_LEVEL" -T0 -o "$out"
|
||||
local after
|
||||
after=$(date +%s)
|
||||
local size
|
||||
size=$(du -h "$out" | cut -f1)
|
||||
echo " done in $((after - before))s, size: ${size}"
|
||||
}
|
||||
|
||||
# v0 — egirl-platform (viky-era predecessor)
|
||||
build_archive "platform.0" \
|
||||
"/mnt/bigdisk/_/last-linux-backup/applications/src/@egirl/egirl-platform"
|
||||
|
||||
# v1 — lilith-platform (54-feature SaaS, never shipped)
|
||||
build_archive "platform.1" \
|
||||
"$HOME/Code/@projects/@lilith/lilith-platform"
|
||||
|
||||
# v2 — lilith-platform.live (Quinn-personal, currently in prod — do not touch original)
|
||||
build_archive "platform.2" \
|
||||
"$HOME/Code/@projects/@lilith/lilith-platform.live"
|
||||
|
||||
echo
|
||||
echo "all archives built. files in: ${ARCHIVE_DIR}"
|
||||
ls -lh "$ARCHIVE_DIR"/*.tar.zst 2>/dev/null || true
|
||||
56
scripts/extract-archive.sh
Executable file
56
scripts/extract-archive.sh
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
# Extract a frozen platform archive to /tmp for review or porting.
|
||||
# Usage: ./scripts/extract-archive.sh <version>
|
||||
# Example: ./scripts/extract-archive.sh platform.1
|
||||
#
|
||||
# Available versions: see `.archive/*.tar.zst`
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ARCHIVE_DIR="$REPO_ROOT/.archive"
|
||||
EXTRACT_ROOT="/tmp/atlilith-archive"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <version>"
|
||||
echo
|
||||
echo "Available archives:"
|
||||
if compgen -G "$ARCHIVE_DIR/platform.*.tar.zst" > /dev/null; then
|
||||
for f in "$ARCHIVE_DIR"/platform.*.tar.zst; do
|
||||
name=$(basename "$f" .tar.zst)
|
||||
size=$(du -h "$f" | cut -f1)
|
||||
echo " $name ($size)"
|
||||
done
|
||||
else
|
||||
echo " (no archives present — run scripts/build-archives.sh on apricot first)"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -eq 1 ] || usage
|
||||
|
||||
VERSION="$1"
|
||||
ARCHIVE="$ARCHIVE_DIR/${VERSION}.tar.zst"
|
||||
DEST="$EXTRACT_ROOT/${VERSION}"
|
||||
|
||||
if [ ! -f "$ARCHIVE" ]; then
|
||||
echo "error: archive not found: $ARCHIVE" >&2
|
||||
echo
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -d "$DEST" ]; then
|
||||
echo "destination exists: $DEST"
|
||||
read -rp "remove and re-extract? [y/N] " ans
|
||||
[[ "$ans" =~ ^[yY] ]] || { echo "aborted"; exit 1; }
|
||||
rm -rf "$DEST"
|
||||
fi
|
||||
|
||||
mkdir -p "$DEST"
|
||||
echo "extracting $ARCHIVE → $DEST"
|
||||
zstd -dc "$ARCHIVE" | tar -xf - -C "$DEST"
|
||||
|
||||
echo
|
||||
echo "done. extracted to: $DEST"
|
||||
echo
|
||||
echo "to clean up later: rm -rf $DEST"
|
||||
Loading…
Add table
Reference in a new issue