Skip to content

Commit

Permalink
Bugfix checker improvements (#13)
Browse files Browse the repository at this point in the history
* add delays after notifications to update display

* add delays after notifications to update display

* fix for windows path

* tweak checking for twl or tn resources

* navigate to folder if error, but repo was created

* fix for original language

* fix to make sure we have original languages

* add delays after notifications to update display

* add delays after notifications to update display

* tweak checking for twl or tn resources

* navigate to folder if error, but repo was created

* fix for original language

* fix to make sure we have original languages

* revert navigation

* added modal pops for errors

* reduced modal pops for errors

* fix for original bibles

* fix for bibles that are missing book

* progress tweak

* progress tweak

* fix for progress

* progress work and github actions package

* bump node version

* working on github actions to generate package

* working on github actions to generate package

* update checking-tool-rcl to fix font selection

---------

Co-authored-by: PhotoNomad0 <[email protected]>
  • Loading branch information
PhotoNomad0 and PhotoNomad0 authored Jul 24, 2024
1 parent 0a0d3b0 commit e8279a9
Show file tree
Hide file tree
Showing 6 changed files with 484 additions and 15 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
run: npm install --global pnpm
- run: pnpm --version
- name: Install dependencies
run: pnpm run install:all
- name: Build Extension
run: pnpm run build:webview
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Package Extension
run: vsce package
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"vscode": "^1.75.0"
},
"main": "./out/extension.js",
"activationEvents": [
],
"contributes": {
"commands": [
{
Expand Down
11 changes: 7 additions & 4 deletions src/CheckingProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,23 +281,26 @@ export class CheckingProvider implements CustomTextEditorProvider {
}

private static async initProjectWithProgress(repoPath: string, targetLanguageId: string, targetOwner: string | undefined, targetBibleId: string | undefined, glLanguageId: string, glOwner: string | undefined, catalog: object[] | null):Promise<object> {
const increment = 5;
const promise = new Promise<object>((resolve) => {
vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
// this will show progress bar, but times out
// location: vscode.ProgressLocation.Notification,
title: 'Downloading GL resources...',
cancellable: false
}, async (progressTracker) => {
async function updateProgress(message:string) {
console.log(`updateProgress - ${message}`)
progressTracker.report({ increment: 10 });
progressTracker.report({ increment });
// await showInformationMessage(message);
await delay(200)
}

progressTracker.report({ increment: 10 });
progressTracker.report({ increment });
await delay(100)
const results = await initProject(repoPath, targetLanguageId, targetOwner || "", targetBibleId || "", glLanguageId, glOwner || "", resourcesPath, null, catalog, updateProgress);
progressTracker.report({ increment: 10 });
progressTracker.report({ increment });
await delay(100)
resolve(results)
})
Expand Down Expand Up @@ -552,7 +555,7 @@ export class CheckingProvider implements CustomTextEditorProvider {
return new Promise((resolve) => {
window.showInformationMessage("Checking DCS for GLs - can take minutes");
vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
location: vscode.ProgressLocation.Notification,
title: 'Downloading Catalog...',
cancellable: false
}, async (progressTracker) => {
Expand Down
3 changes: 3 additions & 0 deletions src/utilities/checkerFileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ async function getLatestLangHelpsResourcesFromCatalog(catalog:null|any[], langua
foundResources[item.resourceId] = resourceObject
} else {
console.log('getLatestLangHelpsResourcesFromCatalog - downloading', item)
callback && await callback(`downloading ${item.languageId}/${item.resourceId}`)
const resource_ = await downloadAndProcessResource(item, resourcesPath, item.bookRes, false)
callback && await callback(`downloaded ${item.languageId}/${item.resourceId}`)
if (resource_) {
Expand Down Expand Up @@ -812,6 +813,7 @@ export async function getLatestLangGlResourcesFromCatalog(catalog:null|any[], la
const item = findResource(updatedCatalogResources || [], languageId_, owner_, bibleId)
if (item) {
console.log('getLangResourcesFromCatalog - downloading', item)
callback && await callback(`downloading ${item.languageId}/${item.resourceId}`)
const resource = await downloadAndProcessResource(item, resourcesPath, item.bookRes, false)
if (resource) {
processed.push(resource)
Expand Down Expand Up @@ -993,6 +995,7 @@ export async function initProject(repoPath:string, targetLanguageId:string, targ
}

if (!hasBibleFiles) {
callback && await callback(`verifying target ${targetLanguageId}/${targetBibleId}`)
const foundPath = verifyHaveBibleResource(targetBibleId, resourcesBasePath, targetLanguageId, targetOwner, catalog, true);
if (foundPath) {
fs.copySync(foundPath, repoPath);
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"scripts": {
"start": "vite",
"build": "cross-env MINIFY=true npm run buildSub",
"build:dev": "cross-env MINIFY=true npm run buildSub",
"build:dev": "cross-env MINIFY=false npm run buildSub",
"buildSub": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@vscode/webview-ui-toolkit": "^1.4.0",
"checking-tool-rcl": "0.9.5",
"checking-tool-rcl": "0.9.6",
"dompurify": "^3.0.9",
"marked": "^12.0.0",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit e8279a9

Please sign in to comment.