@vyr/engine 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
- "name": "@vyr/engine",
3
- "version": "0.0.16",
4
- "description": "",
5
- "main": "./src/index.ts",
6
- "author": "",
7
- "license": "MIT",
8
- "dependencies": {
9
- "@vyr/locale": "0.0.16",
10
- "tinycolor2": "1.6.0"
11
- },
12
- "devDependencies": {
13
- "@types/tinycolor2": "1.4.6"
14
- },
15
- "files": [
16
- "package.json",
17
- "src/"
18
- ]
19
- }
2
+ "name": "@vyr/engine",
3
+ "version": "0.0.17",
4
+ "description": "",
5
+ "main": "./src/index.ts",
6
+ "author": "",
7
+ "license": "MIT",
8
+ "dependencies": {
9
+ "@vyr/locale": "0.0.17",
10
+ "tinycolor2": "1.6.0"
11
+ },
12
+ "devDependencies": {
13
+ "@types/tinycolor2": "1.4.6"
14
+ },
15
+ "files": [
16
+ "package.json",
17
+ "src/"
18
+ ]
19
+ }
package/src/Engine.ts CHANGED
@@ -78,13 +78,13 @@ class Engine extends Listener<EngineListener> {
78
78
  }
79
79
 
80
80
  switch(scheduler: ServiceSchedulerDescriptor) {
81
- const url = Asset.getUrlByUuid(scheduler.uuid)
82
-
83
- if (!url) throw language.get('engine.switch.url.notFound')
84
-
85
81
  const current = Asset.get<ServiceSchedulerDescriptor>(this.active)
86
82
  if (current) this.compilation.unlisten(current)
87
83
 
84
+ const url = Asset.getUrlByUuid(scheduler.uuid)
85
+
86
+ if (!url) return console.warn(language.get('engine.switch.url.notFound'))
87
+
88
88
  const graphics = this.compilation.ensureExists(url, scheduler, this)
89
89
 
90
90
  this.compilation.listen(graphics)
@@ -185,6 +185,7 @@ class Asset {
185
185
 
186
186
  static async compileDataset(url: string, engine: Engine) {
187
187
  const descriptor = this.get<ServiceSchedulerDescriptor>(url)
188
+ if (descriptor === null) return
188
189
  const graphics = engine.ensureGraphicsExists(url, descriptor)
189
190
  const dependencide = Asset.graph.getDependencide(url)
190
191
 
@@ -93,8 +93,9 @@ class Graphics {
93
93
  const interpreter = this.getInterpreter<ServiceSchedulerInterpreter>(descriptor)
94
94
  interpreter.uninstall(descriptor)
95
95
 
96
- const master = this.unitCollection.get(this.scheduler.uuid) as Unit
97
- const assets = [...this._assetCollection.values(), master]
96
+ const master = this.unitCollection.get(this.scheduler.uuid)
97
+ const assets = [...this._assetCollection.values()]
98
+ if (master !== undefined) assets.push(master)
98
99
 
99
100
  for (const asset of assets) {
100
101
  const unit = this.removeRoot(asset.queue.url)