73 lines
1.7 KiB
Bash
73 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
echo "[1/6] package.json scripts"
|
|
node -e "const p=require('./package.json'); console.log('dev =', p.scripts?.dev ?? ''); console.log('build =', p.scripts?.build ?? ''); console.log('deploy=', p.scripts?.deploy ?? '');"
|
|
|
|
echo
|
|
echo "[2/6] required starter files"
|
|
for path in babel.config.js index.js src/pages/_404.tsx; do
|
|
if [[ -f "$path" ]]; then
|
|
echo "OK: $path"
|
|
else
|
|
echo "Missing: $path"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo
|
|
echo "[3/6] granite.config.ts target"
|
|
if rg -n "target:\s*['\"]0\.84\.0['\"]" granite.config.ts >/dev/null; then
|
|
rg -n "target:\s*['\"]0\.84\.0['\"]" granite.config.ts
|
|
else
|
|
echo "target: '0.84.0' not found in granite.config.ts"
|
|
fi
|
|
|
|
echo
|
|
echo "[4/6] babel preset"
|
|
node -e "const p=require('./babel.config.js'); const presets=Array.isArray(p.presets)?p.presets:[]; console.log('presets =', presets.join(', ')); if(!presets.includes('babel-preset-granite')) process.exit(1);"
|
|
|
|
echo
|
|
echo "[5/6] build"
|
|
npm run build
|
|
|
|
echo
|
|
echo "[6/6] .ait bundles"
|
|
python3 - <<'PY'
|
|
import pathlib
|
|
import zipfile
|
|
import sys
|
|
|
|
ait_files = sorted(pathlib.Path('.').glob('*.ait'))
|
|
if not ait_files:
|
|
print('No .ait file found')
|
|
sys.exit(1)
|
|
|
|
path = ait_files[0]
|
|
print(path.name)
|
|
|
|
with zipfile.ZipFile(path) as z:
|
|
bundles = [
|
|
name for name in z.namelist()
|
|
if name.startswith('bundle.') and name.endswith('.js')
|
|
]
|
|
|
|
for name in bundles:
|
|
print(name)
|
|
|
|
required = {
|
|
'bundle.ios.0_84_0.js',
|
|
'bundle.android.0_84_0.js',
|
|
}
|
|
|
|
missing = sorted(required.difference(bundles))
|
|
if missing:
|
|
print('\nMissing required 0.84 bundles:')
|
|
for name in missing:
|
|
print(name)
|
|
sys.exit(1)
|
|
|
|
print('\nOK: RN 0.84.0 bundles found')
|
|
PY
|