@witchcraft/nuxt-electron 0.0.6 → 0.0.8

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "electron",
3
3
  "configKey": "electron",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -226,7 +226,7 @@ const module = defineNuxtModule({
226
226
  const electronCliArgs = [
227
227
  ".",
228
228
  ...process.env.NODE_ENV !== "production" && devUserDataDir ? [
229
- "--user-data-dir",
229
+ "--dev-user-data-dir",
230
230
  devUserDataDir
231
231
  ] : [],
232
232
  ...options.extraCliArgs ?? []
@@ -7,7 +7,9 @@ export function promisifyReply(key, cb, {
7
7
  ipcMain.on(key, (e, promiseId, ...args) => {
8
8
  const win = getEventWindow(e, { defaultToFocused });
9
9
  if (!win) {
10
- throw new Error("No window to send reply to.");
10
+ const err = new Error("No window to send reply to.");
11
+ console.error(err, { key, promiseId, args });
12
+ throw err;
11
13
  }
12
14
  if (debug) {
13
15
  console.log({ key, promiseId, args });
@@ -1,8 +1,8 @@
1
1
  export function useDevDataDir() {
2
2
  if (import.meta.dev) {
3
- const index = process.argv.findIndex((arg) => arg.startsWith("--dev-user-data-dir")) + 1;
3
+ const index = process.argv.findIndex((arg) => arg.startsWith("--dev-user-data-dir"));
4
4
  if (index === -1) return void 0;
5
- return process.argv[index];
5
+ return process.argv[index + 1];
6
6
  }
7
7
  return void 0;
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@witchcraft/nuxt-electron",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Nuxt module for working with electron.",
5
5
  "repository": "witchcraftjs/nuxt-electron",
6
6
  "license": "MIT",
package/src/module.ts CHANGED
@@ -380,7 +380,7 @@ export default defineNuxtModule<ModuleOptions>({
380
380
  ...(process.env.NODE_ENV !== "production"
381
381
  && devUserDataDir
382
382
  ? [
383
- "--user-data-dir",
383
+ "--dev-user-data-dir",
384
384
  devUserDataDir
385
385
  ]
386
386
  : []),
@@ -27,7 +27,10 @@ export function promisifyReply<
27
27
  ) => {
28
28
  const win = getEventWindow(e, { defaultToFocused })
29
29
  if (!win) {
30
- throw new Error("No window to send reply to.")
30
+ const err = new Error("No window to send reply to.")
31
+ // eslint-disable-next-line no-console
32
+ console.error(err, { key, promiseId, args })
33
+ throw err
31
34
  }
32
35
  if (debug) {
33
36
  // eslint-disable-next-line no-console
@@ -1,8 +1,8 @@
1
1
  export function useDevDataDir(): string | undefined {
2
2
  if (import.meta.dev) {
3
- const index = process.argv.findIndex(arg => arg.startsWith("--dev-user-data-dir")) + 1
3
+ const index = process.argv.findIndex(arg => arg.startsWith("--dev-user-data-dir"))
4
4
  if (index === -1) return undefined
5
- return process.argv[index]
5
+ return process.argv[index + 1]
6
6
  }
7
7
  return undefined
8
8
  }