Repository navigation
chore: local quality checks: knip, size-limit, madge, assets, html, doctor (supersedes #1060) - #1078
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… + check:html + doctor); narration paths now point to the existing .wav clips
…add check:sw, check:a11y-static, check:i18n to doctor
Swissystem7
marked this pull request as ready for review
November 14, 2026 21:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
מה נוסף
PR נפרד, שנפתח מ-
master. הוא לא נוגע ב-#1060.madge@8.0.0כ-devDependency מדויק, כולל עדכוןpackage-lock.jsonnpm run check:circularמריץmadge --circular --extensions js src pilot/jsnpm run check:assetsמריץtools/check-assets.js, סקריפט Node קצר בלי תלויות:sw.js,manifest.webmanifest,src/**,pilot/*.htmlו-pilot/js/**.pilot/עבורpilot/js), או יחסית לקובץ ה-HTML עצמו.'prompt_counting.wav', שמחובר ל-basePath בזמן ריצה. מספיק שיהיה קיים איפשהו תחתsounds/אוicons/.'sounds/voice/he/') חייבת להתקיים.data:ו-template strings עם${...}.תוצאות ההרצה המקומית
npm run check:circular: קוד יציאה 0madge עיבד 191 מודולים ומצא 132 קשרי require. אין תלויות מעגליות, לא ב-
src/ולא ב-pilot/js/.npm run check:assets: קוד יציאה 1נבדקו 46 נתיבים, ו-7 חסרים:
src/lib/narrationPlayer.js:13-18sounds/voice/he/prompt_addition.mp3,prompt_subtraction.mp3,prompt_multiplication.mp3,prompt_division.mp3,feedback_good.mp3,feedback_retry.mp3sounds/voice/he/יש רק קובצי.wav. ה-mp3 אמורים להיווצר עםtools/elevenNarration.js, שדורש מפתח ElevenLabs, ועוד לא נוצרו.narrationPlayer.jsלא נטען כרגע באף דף (רק בבדיקות), ויש בו fallback שקט, ולכן אין היום השפעה על המשתמש.pilot/js/app.js:231../sounds/pilot/(תיקיית בסיס ל-<id>.mp3)sounds/pilot/לא קיימת, ולכן כל קריינות ב-pilot תיפול ל-fallback.כל האייקונים (
icons/*, manifest ו-sw.js) וכל 16 קובצי ה-.wavש-voicePrompt.jsמפנה אליהם קיימים.npm test2710 עברו, 0 נכשלו (2728 בסך הכול).
הערות
npm auditמדווח על 2 חולשות ברמה moderate בתלויות עקיפות של madge (minimatch, דרך@typescript-eslint/typescript-estree). זה כלי פיתוח מקומי בלבד, ולא מגיע לדפדפן.package.jsonואתpackage-lock.json. מי שימוזג שני יצטרך פתרון קונפליקט קטן.Draft. לא למזג אוטומטית.
סבב 3: PR מאוחד (מחליף את #1060)
ה-PR הזה כולל עכשיו את כל כלי הבדיקה, עם
package.jsonאחד ו-package-lock.jsonאחד:npm run knip) ו-size-limit@14.3.0 +@size-limit/file(npm run size). הגיעו מ-chore: הוספת knip ו-size-limit כסקריפטים מקומיים #1060.npm run check:circular) ו-tools/check-assets.js(npm run check:assets).tools/check-html.js(npm run check:html): בודק בלי תלויות ids כפולים, קובצי<script src>ו-<link href>מקומיים שלא קיימים, ו-<img>בליalt. אפשר לשמור baseline עם--update-baseline.tools/doctor.js(npm run doctor): מריץ test, knip, size ו-check:html ברצף ומציג סיכום.תיקון 7 נכסים חסרים (check:assets: 46/46)
src/lib/narrationPlayer.js: 6 הנתיבים הפנו ל-.mp3שלא קיימים. עכשיו הם מפנים לקובצי.wavשכבר נמצאים ב-sounds/voice/he/. למפתחfeedback_goodאין קובץ בשם הזה, ולכן הוא מפנה ל-feedback_correct.wav. שם המפתח לא השתנה. הבדיקה ב-test/elevenNarration.test.jsעודכנה בהתאם.pilot/js/app.js:231מחפש../sounds/pilot/<id>.mp3כמקום אופציונלי, ומסתיר את הכפתור כשאין קובץ. לא שיניתי את הקוד. הוספתי את התיקייהsounds/pilot/עם README שמסביר את המקום הזה.tools/elevenNarration.js, הכלי שמייצר את ההקלטות, עדיין כותב קבצים בשם*.mp3. לא נגעתי בו.שינויים קטנים בהגדרות
src/**/*.jsב-.size-limit.jsonעלה מ-620 ל-645 kB. מאז סבב 2 נוספו ל-master תכנים (AreaWorlds: perimeter, area, triangles, parallelograms, composites and solids, heard (42 items) #1057, PartsNumerals: fraction models, quotients, Roman and Hebrew numerals, place value, heard (12 items) #1058), והגודל עכשיו 628.47 kB.knip.jsonהוגדרrules.exports: "warn". knip מסמן 7 ייצואים בקובצי UMD, למשלsrc/lib/measurementConversion.js, אבל הוא לא רואה את השימוש דרךglobalThis. הם מוצגים כאזהרה ולא נמחקו.תוצאות
npm testnpm run knipnpm run sizenpm run check:circularnpm run check:assetsnpm run check:htmlnpm run doctorסבב 4 (דחיפה אחת)
tools/elevenNarration.js: יוצר עכשיו בדיוק את קובצי ה-.wavש-narrationPlayerמנגן*.mp3ל-*.wav. ההקלטה של המפתחfeedback_goodנכתבת ל-feedback_correct.wav, כמו המיפוי בנגן.?output_format=pcm_22050, כלומר PCM גולמי במונו, 16 ביט, 22.05 kHz. האפשרות הזו זמינה בכל מסלול מנוי (44.1 kHz דורש Pro). את הבייטים עוטפת כותרת WAV שנבנית מקומית (pcmToWav, בלי תלויות). אם מתקבל קובץ שכבר הוא WAV, הוא נשמר כמו שהוא. אפשר לבחור פורמט אחר עםoptions.outputFormat.fetchמוחלף בפונקציה מדומה.test/elevenNarration.test.jsעודכנו ונוספו חדשות:output_format, והקובץ שנכתב הוא RIFF/WAVE עם קצב הדגימה הנכון.NarrationPlayer.NARRATION_ASSETS.pcmToWavבונה נכונה.sounds/voice/he/הם 8 kHz במונו, 16 ביט. הנגן מנגן כל קצב דגימה, כך שהבדל ב-22.05 kHz לא משנה לו.בדיקות חדשות (כולן נכנסו ל-
npm run doctor)check:sw(tools/check-sw.js): מוודא שכל כתובת ברשימתASSETSב-sw.jsקיימת בדיסק. כתובת שמסתיימת ב-/צריכהindex.html. התוצאה: 181 כתובות, 0 חסרות.check:a11y-static(tools/check-a11y-static.js): בודק:<html>ישlang, ובדף בעברית גםdir="rtl".<button>ריק בליaria-label, aria-labelledbyאוtitle.<input>ו-<select>ישlabel, aria-labelאוtitle.check:i18n(tools/check-i18n.js): אין בריפו קובצי שפה. הממשק בעברית בלבד. לכן הבדיקה טוענת את 172 המודולים ב-src/(קריאה בלבד) ובודקת את טבלאות המחרוזות שהם מייצאים:he.heולחלקם אין.תוצאות
npm testnpm run doctorcheck:assets/check:circular