Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f490f15
Update sidebar.svelte to use imported images.
judah-sotomayor Aug 8, 2025
ad7d653
Update bottomNavigationBar to import icons.
judah-sotomayor Aug 8, 2025
12883c9
Update BookTabs.svelte to import icons
FyreByrd Nov 13, 2025
2301d21
Write images to generatedAssets
FyreByrd Nov 13, 2025
31a3919
Use glob import with base
FyreByrd Nov 14, 2025
e63ec49
Use cache-busted icons in root
FyreByrd Nov 14, 2025
762b892
Use cache-busted manifest
FyreByrd Nov 14, 2025
ba850c4
Create main workflow for shared/cached setup
FyreByrd Nov 17, 2025
550210e
Remove old workflow definitions
FyreByrd Nov 17, 2025
fc7ae05
Prettier ignore project_data folder
FyreByrd Nov 17, 2025
d9a8dc7
Add svelte-kit sync to npm run check
FyreByrd Nov 17, 2025
9685d0f
Fix file names in manifest.json
FyreByrd Nov 17, 2025
1857496
Use cache-busted video thumbnails
FyreByrd Nov 17, 2025
1b76c38
Extract utility functions for hashed files
FyreByrd Nov 17, 2025
ca5be90
Write all media to src/generatedAssets
FyreByrd Nov 17, 2025
7f91eae
Use cache-busted illustrations
FyreByrd Nov 17, 2025
47daa8b
Add base back into HTML book image path
FyreByrd Nov 18, 2025
90bd5d7
Clear tmp directory when extracting example
FyreByrd Nov 18, 2025
f8b05f1
Use cache-busted fonts/styles
FyreByrd Nov 18, 2025
4d21986
Add optional chaining in font selection
FyreByrd Nov 18, 2025
b080d58
Use cache-busted audio/timings
FyreByrd Nov 18, 2025
043efe2
format
FyreByrd Nov 18, 2025
cca66e4
Use cache-busted border image
FyreByrd Nov 18, 2025
9f98d51
Use cache-busted clips
FyreByrd Nov 18, 2025
2c7ad5c
Use cache-busted videos
FyreByrd Nov 18, 2025
ba042c7
Remove unneeded ignores/deletions
FyreByrd Nov 18, 2025
22e777d
Add TODO notes for later
FyreByrd Nov 18, 2025
eb2be76
format quiz page
FyreByrd Nov 18, 2025
3ea1abd
Use CSS var for border image
FyreByrd Nov 18, 2025
49865cf
Add empty string as default for illustrations
FyreByrd Nov 18, 2025
0497353
Fix Sidebar.svelte
FyreByrd Nov 18, 2025
4e3dd03
Use collection from page params in quiz
FyreByrd Nov 18, 2025
a1e5336
Get fonts from cloud subfolder
FyreByrd Nov 18, 2025
c2940a5
Use cache-busted badges
FyreByrd Nov 18, 2025
d335a46
Use cache-busted about.partial.html
FyreByrd Nov 18, 2025
1247082
Use quiz assets
FyreByrd Nov 18, 2025
a845228
Get cache-busted clips in milestones
FyreByrd Nov 18, 2025
ef955dc
Use cache-busted plan data
FyreByrd Nov 18, 2025
4e12cfc
Use cache-busted assets for contents menu
FyreByrd Nov 19, 2025
1d71b32
Use cache-busted books/collections
FyreByrd Nov 19, 2025
6b755f0
Fix badge import
FyreByrd Nov 19, 2025
e5344fe
Fix milestone links for test
FyreByrd Nov 19, 2025
b75f07c
Use cache-busted reversals
FyreByrd Nov 19, 2025
db55474
Fix bug with audio search in DAB
FyreByrd Nov 19, 2025
55a8234
Use cache-busted sqlite and wasm
FyreByrd Nov 19, 2025
389753e
Bump actions/checkout
FyreByrd Nov 19, 2025
24c0d1a
Fix function signatures
FyreByrd Nov 19, 2025
468296b
Add error handling to getHashedName
FyreByrd Nov 19, 2025
5ca032b
Fix config.js path in clean
FyreByrd Nov 19, 2025
7b6deb0
Remove console.log
FyreByrd Nov 19, 2025
ac2e1f4
Fix imgSrcSet in Sidebar
FyreByrd Nov 19, 2025
e254ec3
Throw/log errors for missing files
FyreByrd Nov 19, 2025
dd7d0ae
Rename generatedAssets to gen-assets
FyreByrd Nov 19, 2025
b702d70
Add import default to glob
FyreByrd Nov 19, 2025
c1027bc
Better caching for fonts
FyreByrd Nov 19, 2025
91e1857
Remove unneeded ignore/clean
FyreByrd Nov 19, 2025
9743e2c
Throw error for missing Quiz JSON
FyreByrd Nov 19, 2025
6c1bbda
Remove unused import
FyreByrd Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/workflows/lint.yml

This file was deleted.

216 changes: 216 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
name: PWA Lint & Test

on:
push:
branches: ['*']
pull_request:
branches: ['*']

jobs:
setup:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: volta-cli/action@v4

- name: Get environment info
run: |
node --version
npm --version
- name: Restore node_modules cache
id: restore-node-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.restore-node-cache.outputs.cache-hit != 'true'
run: |
echo "Installing dependencies..."
npm ci
- name: Cache node_modules
if: steps.restore-node-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Restore Projects cache
id: restore-projects-cache
uses: actions/cache@v4
with:
path: project_data
key: ${{ runner.os }}-projects-${{ hashFiles('test_data/projects', 'convert/*.ts') }}

- name: Setup Java
if: steps.restore-projects-cache.outputs.cache-hit != 'true'
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
java-package: 'jdk'

- name: Install JFX
if: steps.restore-projects-cache.outputs.cache-hit != 'true'
uses: ConorMacBride/install-package@v1
with:
apt: openjfx libopenjfx-jni

- name: App Builders Install
if: steps.restore-projects-cache.outputs.cache-hit != 'true'
run: |
docker pull ghcr.io/sillsdev/app-builders:latest
container_id=$(docker create ghcr.io/sillsdev/app-builders:latest bash)
mkdir $HOME/app-builders
docker cp "$container_id:/" $HOME/app-builders
docker rm "$container_id"
chmod +x $HOME/app-builders/*.sh
java -version
$HOME/app-builders/sab.sh -? | head -n 4
- name: Convert Projects
if: steps.restore-projects-cache.outputs.cache-hit != 'true'
run: |
WORK_DIR=$(pwd)
mkdir project_data
for PROGRAM in sab dab; do
echo "Processing projects for $PROGRAM"
mkdir -p "$HOME/projects/$PROGRAM"
# Get all projects as JSON array
PROJECTS_JSON=$(jq -r ".${PROGRAM}.projects" "test_data/projects/index.json")
# Get number of projects
NUM_PROJECTS=$(echo "$PROJECTS_JSON" | jq '. | length')
# Iterate through projects using index
for ((i=0; i<$NUM_PROJECTS; i++)); do
# Get project path
PROJECT_ZIP=$(echo "$PROJECTS_JSON" | jq -r ".[$i].path")
PROJECT_NAME=$(basename "$PROJECT_ZIP" .zip)
echo "Project: $PROJECT_NAME"
PROJECT_DIR="$HOME/projects/${PROGRAM}/$PROJECT_NAME"
mkdir -p "$PROJECT_DIR"
unzip -q "test_data/projects/${PROGRAM}/$PROJECT_ZIP" -d "$PROJECT_DIR"
npm run clean:all > /dev/null
pushd "$PROJECT_DIR" > /dev/null
PROJECT_FILE=$(find . -type f -name "*.appDef")
"$HOME/app-builders/${PROGRAM}.sh" -load "$PROJECT_FILE" -build-modern-pwa-data-files -no-save -fp pwa-repo="$WORK_DIR" > /dev/null
popd > /dev/null
mkdir "project_data/$PROJECT_NAME"
mv data/* "project_data/$PROJECT_NAME"
du -h "project_data/$PROJECT_NAME"
done
done
du -h project_data
- name: Cache Extracted Projects
if: steps.restore-projects-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: project_data
key: ${{ runner.os }}-projects-${{ hashFiles('test_data/projects', 'convert/*.ts') }}

lint:
runs-on: ubuntu-latest

needs: setup

steps:
- uses: actions/checkout@v4

- uses: volta-cli/action@v4

- name: Restore node_modules cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Restore Projects cache
uses: actions/cache@v4
with:
path: project_data
key: ${{ runner.os }}-projects-${{ hashFiles('test_data/projects', 'convert/*.ts') }}

- name: Convert minimal project
run: |
npm run convert -- --data-dir=project_data/web_gospels
- name: TypeScript/Svelte Check
run: |
npm list --depth=0 typescript
npm run check
- name: ESLint
run: |
npm list --depth=0 eslint eslint-plugin-import prettier
npm run lint
- name: Run minimal build
run: |
npx vite build
test:
runs-on: ubuntu-latest

needs: setup

steps:
- uses: actions/checkout@v4

- uses: volta-cli/action@v4

- name: Restore node_modules cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Restore Projects cache
uses: actions/cache@v4
with:
path: project_data
key: ${{ runner.os }}-projects-${{ hashFiles('test_data/projects', 'convert/*.ts') }}

- name: Run Tests
run: |
WORK_DIR=$(pwd)
for PROGRAM in sab dab; do
echo "Processing projects for $PROGRAM"
mkdir -p "$HOME/projects/$PROGRAM"
# Get all projects as JSON array
PROJECTS_JSON=$(jq -r ".${PROGRAM}.projects" "test_data/projects/index.json")
# Get number of projects
NUM_PROJECTS=$(echo "$PROJECTS_JSON" | jq '. | length')
# Iterate through projects using index
for ((i=0; i<$NUM_PROJECTS; i++)); do
# Get project path and test directories
PROJECT_ZIP=$(echo "$PROJECTS_JSON" | jq -r ".[$i].path")
TEST_DIRS=$(echo "$PROJECTS_JSON" | jq -r ".[$i].tests[]")
PROJECT_NAME=$(basename "$PROJECT_ZIP" .zip)
echo "Project: $PROJECT_NAME"
npm run clean:all > /dev/null
cp -r "project_data/$PROJECT_NAME/." data
npm run build
# Run tests for each specified directory
for TEST_DIR in $TEST_DIRS; do
echo "Running tests in directory: $TEST_DIR"
npm run test "$TEST_DIR"
done
done
done
81 changes: 0 additions & 81 deletions .github/workflows/test.yml

This file was deleted.

22 changes: 2 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,14 @@ data-*/*
data-sandbox/node_modules
!data/.empty
static/sab-stylesheet.css
static/badges
static/fonts
static/images
static/audio
static/styles
static/illustrations
static/collections
static/timings
static/backgrounds
static/watermarks
static/borders
static/clips
static/videos
static/icons
static/*.partial.html
static/manifest.json
static/manifest*.json
static/assets
static/contents
static/songs
static/plans
static/quiz
static/data.sqlite
static/reversal
static/wasm
src/lib/data/catalog.js
src/lib/data/firebase-config.js
src/lib/data/config.js
src/lib/data/contents.js
src/gen-assets
vite.config.js.timestamp*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ src/lib/data/firebase-config.js
static
example_data
test_data
/project_data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here?

Copy link
Collaborator Author

@FyreByrd FyreByrd Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project_data is the folder that the gha puts extracted projects into for caching later. When lint is run, prettier complains about the formatting of the files in this folder, causing the lint action to fail.

*.md

# Ignore files for PNPM, NPM and YARN
Expand Down
1 change: 1 addition & 0 deletions config/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type BookConfig = {
chaptersLabels?: { [key: string]: string };
fonts: string[];
file: string;
hashedFileName?: string; // currently just for HTML books
audio: BookCollectionAudioConfig[];
features: any;
quizFeatures?: any;
Expand Down
Loading