Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
57fb708
Reconfigure eslint to work with prettier
judah-sotomayor Jul 10, 2025
b88ca91
Apply eslint auto-fixes.
judah-sotomayor Jul 10, 2025
8d666e8
Add block scope to cases in src/lib/video/index.ts
judah-sotomayor Jul 10, 2025
cc0f194
Split bkk.chapters expectation into two tests.
judah-sotomayor Jul 10, 2025
eafb9b2
ESLint ignore require import in tailwind config.
judah-sotomayor Jul 10, 2025
d9e545a
Make firstTwoChars const in lexicon/+page.ts.
judah-sotomayor Jul 10, 2025
0c06134
Create block scope around case in contents/[id]/+page.svelte.
judah-sotomayor Jul 10, 2025
6a04932
Fix toBeDefined() function call in worker-messenger test.
judah-sotomayor Jul 10, 2025
769f3e5
Fix toBeDefined() call in search data test.
judah-sotomayor Jul 10, 2025
8ff2939
Make results const in searchDictionary.
judah-sotomayor Jul 10, 2025
73b449b
Replace calls to hasOwnProperty.
judah-sotomayor Jul 10, 2025
d1f6d28
Satisfy ESLint with comment in lib/data/scripture.js.
judah-sotomayor Jul 10, 2025
8a67ec3
Remove empty object types from CatalogData.
judah-sotomayor Jul 10, 2025
d9b7c00
Change sourceMp3 to a const in lib/data/audio.ts.
judah-sotomayor Jul 10, 2025
f7072e3
Add block around darwin case in example/index.js.
judah-sotomayor Jul 10, 2025
ca72c94
Add block around case in BottomNavigationBar.
judah-sotomayor Jul 10, 2025
0a37760
Replace ugly one-line comparision in Sidebar.
judah-sotomayor Jul 10, 2025
104721d
Update eslint-plugin-svelte.
judah-sotomayor Jul 10, 2025
cd90be2
Disable eslint each-block warnings.
judah-sotomayor Jul 10, 2025
2c73dd3
Fix useless moustaches.
judah-sotomayor Jul 10, 2025
7cd2390
Disable svelte/no-unused-svelte-ignore eslint rule.
judah-sotomayor Jul 10, 2025
25b19dd
Silence spurious goto warnings.
judah-sotomayor Jul 10, 2025
10b5c29
Fix font-family misspelling in FontList.svelte.
judah-sotomayor Jul 10, 2025
5585aff
Apply prettier changes.
judah-sotomayor Jul 10, 2025
740a9ee
Add `curly` rule to eslint, fix errors.
judah-sotomayor Jul 11, 2025
cdce158
Move globals, typescript-eslint to devDependencies.
judah-sotomayor Jul 11, 2025
760760b
Disable eslint for @html in about page.
judah-sotomayor Jul 12, 2025
4c69395
Ignore remaining eslint errors.
judah-sotomayor Jul 22, 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
41 changes: 0 additions & 41 deletions .eslintrc.cjs

This file was deleted.

8 changes: 6 additions & 2 deletions convert/convertAbout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export function convertAbout(dataDir: string, verbose: number) {
const srcFile = path.join(dataDir, 'about.partial.html');
const dstFile = path.join('static', 'about.partial.html');
copyFile(srcFile, dstFile, function (err: any) {
if (err) throw err;
if (verbose) console.log(`copied ${srcFile} to ${dstFile}`);
if (err) {
throw err;
}
if (verbose) {
console.log(`copied ${srcFile} to ${dstFile}`);
}
});
}
export class ConvertAbout extends Task {
Expand Down
8 changes: 6 additions & 2 deletions convert/convertBadges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ export async function convertBadges(
if (existsSync(srcFile)) {
foundLanguages.push(language);
copyFile(srcFile, dstFile, function (err: any) {
if (err) throw err;
if (verbose) console.log(`copied ${srcFile} to ${dstFile}`);
if (err) {
throw err;
}
if (verbose) {
console.log(`copied ${srcFile} to ${dstFile}`);
}
});
}
}
Expand Down
59 changes: 43 additions & 16 deletions convert/convertBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function handleNoCaptionFigures(text: string, _bcId: string, _bookId: string): s
const parts = figContent.split('|');

// Extract the image caption
let imageCaption = parts[0];
const imageCaption = parts[0];

// Check if the image caption is missing
if (!imageCaption) {
Expand Down Expand Up @@ -236,7 +236,7 @@ function moveFigureToNextNonVerseMarker(text: string): string {
let carryOverFigures: string[] = [];

const lines = text.split('\n');
for (let line of lines) {
for (const line of lines) {
// Add any figures that were carried over from the previous lines
if (carryOverFigures.length > 0) {
if (!line.startsWith('\\v ') && !line.startsWith('\\fig')) {
Expand Down Expand Up @@ -373,10 +373,11 @@ export async function convertBooks(
);
}
usedLangs.add(context.lang);
if (verbose)
if (verbose) {
console.log(
'converting collection: ' + collection.id + ' to docSet: ' + context.docSet
);
}
/**array of promises of Proskomma mutations*/
const inputFiles = await fs.promises.readdir(
path.join(context.dataDir, 'books', context.bcId)
Expand Down Expand Up @@ -432,14 +433,18 @@ export async function convertBooks(
continue;
}
}
if (verbose) console.time('convert ' + collection.id);
if (verbose) {
console.time('convert ' + collection.id);
}
//wait for documents to finish being added to Proskomma
await Promise.all(docs);
if (ignoredBooks.length > 0) {
process.stdout.write(` -- Not Supported: ${ignoredBooks.join(' ')}`);
}
process.stdout.write('\n');
if (verbose) console.timeEnd('convert ' + collection.id);
if (verbose) {
console.timeEnd('convert ' + collection.id);
}
//start freezing process and map promise to docSet name
const frozen = freeze(pk);
freezer.set(context.docSet, frozen[context.docSet]);
Expand All @@ -449,14 +454,18 @@ export async function convertBooks(
//check if folder exists for collection
const collPath = path.join('static', 'collections', context.bcId);
if (!fs.existsSync(collPath)) {
if (verbose) console.log('creating: ' + collPath);
if (verbose) {
console.log('creating: ' + collPath);
}
fs.mkdirSync(collPath, { recursive: true });
}
//add quizzes path if necessary
if (quizzes[context.docSet].length > 0) {
const qPath = path.join('static', 'collections', context.bcId, 'quizzes');
if (!fs.existsSync(qPath)) {
if (verbose) console.log('creating: ' + qPath);
if (verbose) {
console.log('creating: ' + qPath);
}
fs.mkdirSync(qPath, { recursive: true });
}
}
Expand All @@ -465,7 +474,9 @@ export async function convertBooks(
const entries = await Promise.all(catalogEntries);
const catalogPath = path.join('static', 'collections', 'catalog');
if (!fs.existsSync(catalogPath)) {
if (verbose) console.log('creating: ' + catalogPath);
if (verbose) {
console.log('creating: ' + catalogPath);
}
fs.mkdirSync(catalogPath, { recursive: true });
}
entries.forEach((entry) => {
Expand All @@ -474,7 +485,9 @@ export async function convertBooks(
JSON.stringify(transformCatalogEntry(entry, quizzes, htmlBooks))
);
});
if (verbose) console.time('freeze');
if (verbose) {
console.time('freeze');
}
//write frozen archives for import
//const vals = await Promise.all(freezer.values());
//write frozen archives
Expand All @@ -501,7 +514,9 @@ export async function convertBooks(
return s;
})()}]`
);
if (verbose) console.timeEnd('freeze');
if (verbose) {
console.timeEnd('freeze');
}
return {
files,
taskName: 'ConvertBooks'
Expand Down Expand Up @@ -701,7 +716,9 @@ function convertScriptureBook(
) {
function processBookContent(resolve: () => void, err: any, content: string) {
//process.stdout.write(`processBookContent: bookId:${book.id}, error:${err}\n`);
if (err) throw err;
if (err) {
throw err;
}
content = applyFilters(content, usfmFilterFunctions, context.bcId, book.id);
if (context.scriptureConfig.traits['has-glossary']) {
content = verifyGlossaryEntries(content, bcGlossary);
Expand Down Expand Up @@ -763,7 +780,9 @@ function convertScriptureBook(
const filenameWithoutExt = basename(file, ext).normalize('NFC');

// Check if the filename starts with baseFilename
if (!filenameWithoutExt.startsWith(baseFilename)) return false;
if (!filenameWithoutExt.startsWith(baseFilename)) {
return false;
}

// Get the part after baseFilename
const suffix = filenameWithoutExt.slice(baseFilename.length);
Expand Down Expand Up @@ -836,17 +855,25 @@ export class ConvertBooks extends Task {
* recursively deep-compares two objects based on properties passed in include.
*/
function deepCompareObjects(obj1: any, obj2: any, include: Set<string> = new Set()): boolean {
if (typeof obj1 !== typeof obj2) return false;
if (typeof obj1 !== typeof obj2) {
return false;
}
if (typeof obj1 === 'object') {
if (Array.isArray(obj1)) {
if (obj1.length !== obj2.length) return false;
if (obj1.length !== obj2.length) {
return false;
}
for (let i = 0; i < obj1.length; i++) {
if (!deepCompareObjects(obj1[i], obj2[i])) return false;
if (!deepCompareObjects(obj1[i], obj2[i])) {
return false;
}
}
} else {
for (const k in obj1) {
if (include.has(k)) {
if (!deepCompareObjects(obj1[k], obj2[k])) return false;
if (!deepCompareObjects(obj1[k], obj2[k])) {
return false;
}
}
}
}
Expand Down
Loading
Loading