@cequrebackends/plugin-vite 1.0.1 → 1.0.2

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/dist/index.d.ts CHANGED
@@ -9,10 +9,7 @@ export interface CequreViteOptions {
9
9
  }
10
10
  export declare function resolveApiPrefix(customPrefix?: string): string;
11
11
  export declare function resolveEntryPoint(customEntry?: string): string;
12
- export declare function getExecutableCommand(): {
13
- command: string;
14
- argsPrefix: string[];
15
- };
12
+ export declare function getExecutableCommand(): string;
16
13
  export declare function cequreVite(options?: CequreViteOptions): Plugin;
17
14
  export declare namespace cequreVite {
18
15
  var build: (options?: CequreViteBuildOptions) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAalD,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8JAA8J;IAC9J,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAOD,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAsD9D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAuB9D;AAED,wBAAgB,oBAAoB,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAMhF;AAsFD,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAkMlE;yBAlMe,UAAU;0BA2MkB,sBAAsB;;AAPlE,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAalD,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8JAA8J;IAC9J,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAOD,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAsD9D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAuB9D;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAsFD,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAyMlE;yBAzMe,UAAU;0BAkNkB,sBAAsB;;AAPlE,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
package/dist/index.js CHANGED
@@ -89,11 +89,7 @@ function resolveEntryPoint(customEntry) {
89
89
  return "cequre/index.ts";
90
90
  }
91
91
  function getExecutableCommand() {
92
- const localBin = path.join(process.cwd(), "node_modules", ".bin", "cequre");
93
- if (fs.existsSync(localBin)) {
94
- return { command: localBin, argsPrefix: [] };
95
- }
96
- return { command: "bunx", argsPrefix: ["cequre"] };
92
+ return "cequre";
97
93
  }
98
94
  function lockPathFor(port) {
99
95
  const root = path.resolve(process.cwd());
@@ -229,7 +225,7 @@ function cequreVite(options = {}) {
229
225
  },
230
226
  [resolvedApiPrefix]: {
231
227
  target: `http://127.0.0.1:${globalWsPort}`,
232
- changeOrigin: true,
228
+ changeOrigin: false,
233
229
  ws: true,
234
230
  configure: (proxy, _options) => {
235
231
  proxy.on("proxyReq", (proxyReq, req) => {
@@ -272,12 +268,12 @@ function cequreVite(options = {}) {
272
268
  }
273
269
  const resolvedEntry = resolveEntryPoint(options.entry);
274
270
  const exec = getExecutableCommand();
275
- const args = [...exec.argsPrefix, "dev"];
271
+ const args = ["dev"];
276
272
  if (resolvedEntry) {
277
273
  args.push("--entry", resolvedEntry);
278
274
  }
279
275
  server.config.logger.info(`[cequre.vite] Attached Cequre API (${resolvedApiPrefix}) to Vite host.`);
280
- globalCequreProcess = spawn(exec.command, args, {
276
+ globalCequreProcess = spawn(exec, args, {
281
277
  cwd: process.cwd(),
282
278
  stdio: ["ignore", "ignore", "pipe"],
283
279
  env: { ...process.env, PORT: String(globalWsPort), HOST: "127.0.0.1", CEQURE_VITE_MODE: "1" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cequrebackends/plugin-vite",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "license": "BSL-1.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",