@harmoniclabs/pebble 0.1.3-dev4 → 0.1.3-dev6

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.
@@ -86,6 +86,12 @@ export class AstCompiler extends DiagnosticEmitter {
86
86
  this.cfg = cfg;
87
87
  this.io = io;
88
88
  this.program = new TypedProgram(this.diagnostics);
89
+ // normalize entry to absolute path so import resolution works correctly
90
+ if (typeof cfg.entry === "string" && typeof cfg.root === "string") {
91
+ const resolved = getEnvRelativePath(cfg.entry, cfg.root);
92
+ if (resolved)
93
+ cfg.entry = resolved;
94
+ }
89
95
  this._isExporting = false;
90
96
  }
91
97
  _isExporting;
@@ -205,7 +211,7 @@ export class AstCompiler extends DiagnosticEmitter {
205
211
  * the result is store in `this.program`
206
212
  */
207
213
  async compile() {
208
- const filePath = this.cfg.entry; // getEnvRelativePath( this.cfg.entry, this.rootPath );
214
+ const filePath = this.cfg.entry;
209
215
  if (!filePath) {
210
216
  this.error(DiagnosticCode.File_0_not_found, undefined, this.cfg.entry);
211
217
  throw new Error("entry file not found");
@@ -58,5 +58,6 @@ function memoryFsWrite(filename, contents) {
58
58
  this.set(filename, contents);
59
59
  }
60
60
  function exsistSync(filename) {
61
+ filename = memoryFsAdaptFilename(filename);
61
62
  return this.has(filename);
62
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmoniclabs/pebble",
3
- "version": "0.1.3-dev4",
3
+ "version": "0.1.3-dev6",
4
4
  "description": "A simple, yet rock solid, functional language with an imperative bias, targeting UPLC",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",