firefly-compiler 0.5.64 → 0.5.65

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.
@@ -146,7 +146,11 @@ process(fetch: HttpClient, dependencyLock: DependencyLock, path: Path): Resolved
146
146
  let workspace = Workspace.loadWorkspace(path)
147
147
  let self = Dependencies(workspace, [].toMap(), [].toMap(), [].toSet())
148
148
  let packageInfo = self.loadPackageInfo(PackagePair("script", "script"), path).else {
149
- panic("Not a main file: " + path.absolute())
149
+ if(!path.exists()) {
150
+ throw(CompileError(Location(path.absolute(), 1, 1), "File not found"))
151
+ } else {
152
+ throw(CompileError(Location(path.absolute(), 1, 1), "Could not load package info"))
153
+ }
150
154
  }
151
155
  let newDependencies = self.processPackageInfo(packageInfo)
152
156
  self.processDependencies(path, fetch, dependencyLock, newDependencies)
@@ -124,7 +124,11 @@ export function process_(fetch_, dependencyLock_, path_) {
124
124
  const workspace_ = ff_compiler_Workspace.loadWorkspace_(path_);
125
125
  const self_ = ff_compiler_Dependencies.Dependencies(workspace_, ff_core_List.List_toMap([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
126
126
  const packageInfo_ = ff_core_Option.Option_else(ff_compiler_Dependencies.Dependencies_loadPackageInfo(self_, ff_compiler_Syntax.PackagePair("script", "script"), path_), (() => {
127
- return ff_core_Core.panic_(("Not a main file: " + ff_core_Path.Path_absolute(path_)))
127
+ if((!ff_core_Path.Path_exists(path_, false, false, false))) {
128
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(ff_core_Path.Path_absolute(path_), 1, 1), "File not found"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
129
+ } else {
130
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(ff_core_Path.Path_absolute(path_), 1, 1), "Could not load package info"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
131
+ }
128
132
  }));
129
133
  const newDependencies_ = ff_compiler_Dependencies.Dependencies_processPackageInfo(self_, packageInfo_);
130
134
  ff_compiler_Dependencies.Dependencies_processDependencies(self_, path_, fetch_, dependencyLock_, newDependencies_);
@@ -164,7 +168,11 @@ export async function process_$(fetch_, dependencyLock_, path_, $task) {
164
168
  const workspace_ = (await ff_compiler_Workspace.loadWorkspace_$(path_, $task));
165
169
  const self_ = ff_compiler_Dependencies.Dependencies(workspace_, ff_core_List.List_toMap([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toMap([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair), ff_core_List.List_toSet([], ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_PackagePair));
166
170
  const packageInfo_ = (await ff_core_Option.Option_else$((await ff_compiler_Dependencies.Dependencies_loadPackageInfo$(self_, ff_compiler_Syntax.PackagePair("script", "script"), path_, $task)), (async ($task) => {
167
- return ff_core_Core.panic_(("Not a main file: " + (await ff_core_Path.Path_absolute$(path_, $task))))
171
+ if((!(await ff_core_Path.Path_exists$(path_, false, false, false, $task)))) {
172
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location((await ff_core_Path.Path_absolute$(path_, $task)), 1, 1), "File not found"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
173
+ } else {
174
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location((await ff_core_Path.Path_absolute$(path_, $task)), 1, 1), "Could not load package info"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
175
+ }
168
176
  }), $task));
169
177
  const newDependencies_ = (await ff_compiler_Dependencies.Dependencies_processPackageInfo$(self_, packageInfo_, $task));
170
178
  (await ff_compiler_Dependencies.Dependencies_processDependencies$(self_, path_, fetch_, dependencyLock_, newDependencies_, $task));
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.64",
7
+ "version": "0.5.65",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.64",
7
+ "version": "0.5.65",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"