Skip to content

Commit

Permalink
[v2.3.3] Merge pull request #607 from bridge-core/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelant05 committed Sep 10, 2022
2 parents 4f08ae7 + 7342f2d commit ed7e609
Show file tree
Hide file tree
Showing 56 changed files with 1,721 additions and 3,272 deletions.
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug in Edge",
"type": "msedge",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
},
{
"name": "Debug in Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "2.3.2",
"version": "2.3.3",
"private": true,
"scripts": {
"dev": "vite",
Expand All @@ -23,7 +23,7 @@
"comlink": "^4.3.0",
"compare-versions": "^3.6.0",
"core-js": "^3.6.5",
"dash-compiler": "^0.9.28",
"dash-compiler": "^0.9.29",
"escape-string-regexp": "^5.0.0",
"fflate": "^0.6.7",
"idb-keyval": "^5.1.3",
Expand Down
Binary file modified public/packages.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ export class App {

public readonly bridgeFolderSetup = new Signal<void>()
async setupBridgeFolder(forceReselect = false) {
if (!forceReselect && this.bridgeFolderSetup.hasFired) return true

let fileHandle = await get<AnyDirectoryHandle | undefined>(
'bridgeBaseDir'
)
Expand Down
20 changes: 12 additions & 8 deletions src/components/Data/JSONDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AnyFileHandle } from '../FileSystem/Types'
import { Tab } from '../TabSystem/CommonTab'
import { ComponentSchemas } from '../Compiler/Worker/Plugins/CustomComponent/ComponentSchemas'
import { loadMonaco, useMonaco } from '../../utils/libs/useMonaco'
import { Task } from '../TaskManager/Task'

let globalSchemas: Record<string, IMonacoSchemaArrayEntry> = {}
let loadedGlobalSchemas = false
Expand All @@ -19,6 +20,7 @@ export class JsonDefaults extends EventDispatcher<void> {
protected localSchemas: Record<string, IMonacoSchemaArrayEntry> = {}
protected disposables: IDisposable[] = []
public readonly componentSchemas = new ComponentSchemas()
protected task: Task | null = null

constructor(protected project: Project) {
super()
Expand Down Expand Up @@ -60,22 +62,24 @@ export class JsonDefaults extends EventDispatcher<void> {
this.disposables.forEach((disposable) => disposable.dispose())
this.componentSchemas.dispose()
this.disposables = []
this.task?.complete()
this.task = null
}

async loadAllSchemas() {
this.localSchemas = {}
const app = await App.getApp()
const task = app.taskManager.create({
this.task = app.taskManager.create({
icon: 'mdi-book-open-outline',
name: 'taskManager.tasks.loadingSchemas.name',
description: 'taskManager.tasks.loadingSchemas.description',
totalTaskSteps: 10,
})

await app.dataLoader.fired
task.update(1)
this.task?.update(1)
const packages = await app.dataLoader.readdir('data/packages')
task.update(2)
this.task?.update(2)

// Static schemas
for (const packageName of packages) {
Expand All @@ -92,11 +96,11 @@ export class JsonDefaults extends EventDispatcher<void> {
}
}
loadedGlobalSchemas = true
task.update(3)
this.task?.update(3)

// Schema scripts
await this.runSchemaScripts(app)
task.update(5)
this.task?.update(5)
const tab = this.project.tabSystem?.selectedTab
if (tab && tab instanceof FileTab) {
const fileType = App.fileType.getId(tab.getPath())
Expand All @@ -111,11 +115,11 @@ export class JsonDefaults extends EventDispatcher<void> {

// Schemas generated from lightning cache
this.addSchemas(await this.getDynamicSchemas())
task.update(4)
this.task?.update(4)

this.loadedSchemas = true
task.update(6)
task.complete()
this.task?.update(6)
this.task?.complete()
}

async setJSONDefaults(validate = true) {
Expand Down
8 changes: 7 additions & 1 deletion src/components/Data/TypeLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ export class TypeLoader {
const app = await App.getApp()

await app.project.packIndexer.fired
const allFiles = await app.project.packIndexer.service.getAllFiles()
let allFiles
try {
allFiles = await app.project.packIndexer.service.getAllFiles()
} catch {
// We failed to access the pack indexer service -> fail silently
return
}

const typeScriptFiles = allFiles.filter(
(filePath) => filePath.endsWith('.ts') || filePath.endsWith('.js')
Expand Down
26 changes: 0 additions & 26 deletions src/components/Editors/FunctionValidator/Error.vue

This file was deleted.

Loading

0 comments on commit ed7e609

Please sign in to comment.