@shiftapi/vite-plugin 0.0.9 → 0.0.10

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  mkdirSync,
7
7
  existsSync
8
8
  } from "fs";
9
+ import { createRequire } from "module";
9
10
  import { spawn } from "child_process";
10
11
  import { createServer as createTcpServer } from "net";
11
12
 
@@ -76,6 +77,7 @@ export { createClient };
76
77
  }
77
78
 
78
79
  // src/index.ts
80
+ var pluginRequire = createRequire(import.meta.url);
79
81
  var MODULE_ID = "@shiftapi/client";
80
82
  var RESOLVED_MODULE_ID = "\0" + MODULE_ID;
81
83
  var DEV_API_PREFIX = "/__shiftapi";
@@ -317,10 +319,13 @@ ${generatedDts.split("\n").map((line) => line ? " " + line : line).join("\n")}
317
319
  await regenerate();
318
320
  writeDtsFile();
319
321
  },
320
- resolveId(id) {
322
+ resolveId(id, importer) {
321
323
  if (id === MODULE_ID) {
322
324
  return RESOLVED_MODULE_ID;
323
325
  }
326
+ if (id === "openapi-fetch" && importer === RESOLVED_MODULE_ID) {
327
+ return pluginRequire.resolve("openapi-fetch");
328
+ }
324
329
  },
325
330
  load(id) {
326
331
  if (id === RESOLVED_MODULE_ID) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shiftapi/vite-plugin",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Vite plugin for fully-typed TypeScript clients from shiftapi Go servers",
5
5
  "author": "Frank Chiarulli Jr. <frank@frankchiarulli.com>",
6
6
  "license": "MIT",