Repository: pmcelhaney/counterfact
Pull request #333 (2022-12-09 20:01:03)

don't put transpiled js files in a temp directory
first of all, it's a waste of disk space that wasn't getting cleaned up

it also prevents people from importing node modules



Patch:
diff --git a/.changeset/slimy-ravens-drive.md b/.changeset/slimy-ravens-drive.md
new file mode 100644
index 0000000..e58442b
--- /dev/null
+++ b/.changeset/slimy-ravens-drive.md
@@ -0,0 +1,5 @@
+---
+"counterfact": patch
+---
+
+fix an issue where importing from $.context.ts did not work
diff --git a/README.md b/README.md
index 81e2d95..1a16440 100644
--- a/README.md
+++ b/README.md
@@ -77,7 +77,8 @@ export const POST = ({ context, response, body }) => {
 ```
 
 ```js
-// ./paths/$.context.js
+
+// ./paths/$.context.ts
 class PetStore () {
     pets = {};
 
diff --git a/docs/usage.md b/docs/usage.md
index 6baad6b..39c201e 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -139,7 +139,7 @@ export const POST: HTTP_POST = ($) => {
  };
 ```
 
-The `context` object is defined in `$.context.js` in the same directory as the file that uses it. It's up to you to define the API for a context object. For example, your `$.context.js` file might look like this.
+The `context` object is defined in `$.context.ts` in the same directory as the file that uses it. It's up to you to define the API for a context object. For example, your `$.context.ts` file might look like this.
 
 ```ts
 class PetStore {
diff --git a/package.json b/package.json
index fc4ba8b..debf946 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,7 @@
     "prepare": "husky install",
     "lint": "eslint . --plugin file-progress --rule 'file-progress/activate: 1'",
     "lint:quickfix": "eslint --fix . eslint --fix demo-ts --rule=\"import/namespace: 0,etc/no-deprecated:0,import/no-cycle:0,no-explicit-type-exports/no-explicit-type-exports:0,import/no-deprecated:0,import/no-self-import:0,import/default:0,import/no-named-as-default:0\"",
-    "go:petstore": "yarn counterfact  https://petstore3.swagger.io/api/v3/openapi.json out",
+    "go:petstore": "yarn counterfact https://petstore3.swagger.io/api/v3/openapi.json out",
     "go:petstore2": "yarn counterfact  https://petstore.swagger.io/v2/swagger.json out",
     "go:example": "yarn counterfact ./openapi-example.yaml out --open",
     "counterfact": "./bin/counterfact.js"
diff --git a/src/server/counterfact.js b/src/server/counterfact.js
index 8dbb883..73c303b 100644
--- a/src/server/counterfact.js
+++ b/src/server/counterfact.js
@@ -1,7 +1,7 @@
 /* eslint-disable import/max-dependencies */
 import fs from "node:fs/promises";
 import nodePath from "node:path";
-import os from "node:os";
+import { constants as fsConstants } from "node:fs";
 
 import $RefParser from "json-schema-ref-parser";
 import yaml from "js-yaml";
@@ -15,6 +15,14 @@ import { ModuleLoader } from "./module-loader.js";
 import { Transpiler } from "./transpiler.js";
 import { ContextRegistry } from "./context-registry.js";
 
+async function ensureDirectoryExists(directory) {
+  try {
+    await fs.access(directory, fsConstants.W_OK);
+  } catch {
+    await fs.mkdir(directory, { recursive: true });
+  }
+}
+
 async function loadOpenApiDocument(source) {
   try {
     return $RefParser.dereference(await yaml.load(await readFile(source)));
@@ -32,18 +40,23 @@ export async function counterfact(
 
   const registry = new Registry();
 
-  const modulesPath = `${await fs.mkdtemp(
-    nodePath.join(os.tmpdir(), "counterfact-")
-  )}/`;
+  const modulesPath = `${nodePath.join(basePath, "js")}/`;
 
-  try {
-    await fs.writeFile(
-      nodePath.join(modulesPath, "package.json"),
-      '{"type": "module"}'
-    );
-  } catch {
-    throw new Error("could not write package.json");
-  }
+  await ensureDirectoryExists(modulesPath);
+
+  // try {
+  //   await fs.writeFile(
+  //     nodePath.join(modulesPath, "package.json"),
+  //     '{"type": "module"}'
+  //   );
+  // } catch {
+  //   throw new Error(
+  //     `could not write package.json to ${nodePath.join(
+  //       modulesPath,
+  //       "package.json"
+  //     )}`
+  //   );
+  // }
 
   const transpiler = new Transpiler(basePath, modulesPath);
 
diff --git a/src/server/transpiler.js b/src/server/transpiler.js
index 72b8168..c7d3c94 100644
--- a/src/server/transpiler.js
+++ b/src/server/transpiler.js
@@ -26,7 +26,9 @@ export class Transpiler extends EventTarget {
   }
 
   async watch() {
-    this.watcher = chokidar.watch(`${this.sourcePath}/**/*.{js,mjs,ts,mts}`);
+    this.watcher = chokidar.watch(`${this.sourcePath}/**/*.{ts,mts,js,mjs}`, {
+      ignored: `${this.sourcePath}/js`,
+    });
 
     const transpiles = [];
 
@@ -54,6 +56,7 @@ export class Transpiler extends EventTarget {
       }
     });
     await once(this.watcher, "ready");
+
     await Promise.all(transpiles);
   }
 
@@ -75,7 +78,7 @@ export class Transpiler extends EventTarget {
         nodePath.join(
           sourcePath
             .replace(this.sourcePath, this.destinationPath)
-            .replace(".ts", ".js")
+            .replace(".ts", ".mjs")
         ),
         result
       );
diff --git a/src/typescript-generator/context-coder.js b/src/typescript-generator/context-coder.js
index 65bfcbd..5726d76 100644
--- a/src/typescript-generator/context-coder.js
+++ b/src/typescript-generator/context-coder.js
@@ -43,7 +43,7 @@ class Context {
 
     script.repository.get(parentPath).exportDefault(this);
 
-    return { raw: 'export { default } from "../$.context.js"' };
+    return { raw: 'export { default } from "../$.context.mjs"' };
   }
 
   modulePath() {


Test patch:
diff --git a/test/server/transpiler.test.js b/test/server/transpiler.test.js
index 58154e8..b79b5fe 100644
--- a/test/server/transpiler.test.js
+++ b/test/server/transpiler.test.js
@@ -27,7 +27,7 @@ describe("a Transpiler", () => {
 
       await transpiler.watch();
 
-      await expect(fs.readFile(path("dist/found.js"), "utf8")).resolves.toBe(
+      await expect(fs.readFile(path("dist/found.mjs"), "utf8")).resolves.toBe(
         JAVASCRIPT_SOURCE
       );
 
@@ -50,7 +50,7 @@ describe("a Transpiler", () => {
         await add("src/added.ts", TYPESCRIPT_SOURCE);
         await write;
 
-        await expect(fs.readFile(path("dist/added.js"), "utf8")).resolves.toBe(
+        await expect(fs.readFile(path("dist/added.mjs"), "utf8")).resolves.toBe(
           JAVASCRIPT_SOURCE
         );
 
@@ -78,7 +78,7 @@ describe("a Transpiler", () => {
       await overwrite;
 
       await expect(
-        fs.readFile(path("dist/update-me.js"), "utf8")
+        fs.readFile(path("dist/update-me.mjs"), "utf8")
       ).resolves.toBe(JAVASCRIPT_SOURCE);
 
       transpiler.stopWatching();
diff --git a/test/typescript-generator/__snapshots__/end-to-end.test.js.snap b/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
index 52521c6..8f70119 100644
--- a/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
+++ b/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
@@ -1061,7 +1061,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -1276,7 +1276,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -1508,7 +1508,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -1723,7 +1723,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2027,7 +2027,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2169,7 +2169,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2215,7 +2215,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2376,7 +2376,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2518,7 +2518,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2564,7 +2564,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2725,7 +2725,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2867,7 +2867,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -2913,7 +2913,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -3078,7 +3078,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -3220,7 +3220,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -3266,7 +3266,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -3389,7 +3389,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
@@ -3526,7 +3526,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
@@ -3679,7 +3679,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
@@ -3784,7 +3784,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
@@ -3913,7 +3913,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
@@ -4056,7 +4056,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
@@ -4268,7 +4268,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -4345,7 +4345,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -4492,7 +4492,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -4569,7 +4569,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -4720,7 +4720,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -4797,7 +4797,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -5234,7 +5234,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -5384,7 +5384,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -5553,7 +5553,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -5674,7 +5674,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -5788,7 +5788,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -5887,7 +5887,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6101,7 +6101,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6178,7 +6178,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6224,7 +6224,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6391,7 +6391,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6468,7 +6468,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6514,7 +6514,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6681,7 +6681,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6758,7 +6758,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6804,7 +6804,7 @@ class Context {
 }
 ",
                     "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
+                      "raw": "export { default } from \\"../$.context.mjs\\"",
                     },
                     "done": true,
                     "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -6975,7 +6975,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -7052,7 +7052,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -7098,7 +7098,7 @@ class Context {
 }
 ",
               "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
+                "raw": "export { default } from \\"../$.context.mjs\\"",
               },
               "done": true,
               "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
@@ -7278,7 +7278,7 @@ class Context {
 }
 ",
         "code": Object {
-          "raw": "export { default } from \\"../$.context.js\\"",
+          "raw": "export { default } from \\"../$.context.mjs\\"",
         },
         "done": true,
         "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
@@ -7319,7 +7319,7 @@ class Context {
 }
 ",
         "code": Object {
-          "raw": "export { default } from \\"../$.context.js\\"",
+          "raw": "export { default } from \\"../$.context.mjs\\"",
         },
         "done": true,
         "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
@@ -7386,7 +7386,7 @@ class Context {
 }
 ",
         "code": Object {
-          "raw": "export { default } from \\"../$.context.js\\"",
+          "raw": "export { default } from \\"../$.context.mjs\\"",
         },
         "done": true,
         "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
@@ -7453,7 +7453,7 @@ class Context {
 }
 ",
         "code": Object {
-          "raw": "export { default } from \\"../$.context.js\\"",
+          "raw": "export { default } from \\"../$.context.mjs\\"",
         },
         "done": true,
         "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
@@ -7520,7 +7520,7 @@ class Context {
 }
 ",
         "code": Object {
-          "raw": "export { default } from \\"../$.context.js\\"",
+          "raw": "export { default } from \\"../$.context.mjs\\"",
         },
         "done": true,
         "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",