nwutils/nw-builder

Confusing debug message shown if `srcDir/package.json` doesn't include `nwbuild` property

sysrage opened this issue · 0 comments

Issue Type

  • Bug Report
  • Feature Request
  • Other

Current/Missing Behaviour

if (typeof nwPkg.nwbuild === "object") {
opts = { ...nwPkg.nwbuild };
} else if (typeof nwPkg.nwbuild === "undefined") {
log.debug(`nwbuild property is not defined in package.json`);
} else {
throw new Error(
`nwbuild property in the package.json is of type ${typeof nwPkg.nwbuild}. Expected type object.`,
);
}

The section of code linked above results in confusing behavior. The package.json inside srcDir probably should never include nwbuild. Very rarely will the "production" app package.json match the "development" package.json, so the one in srcDir should be the bare-minimum needed (no devDependencies, no nwbuild, etc.).

Expected/Proposed Behaviour

I suggest removing this debug message altogether, as it doesn't really mean anything. If you keep it, only display it if nwbuild() was called without a configuration object (or however the CLI handles it).

Additional Info

  • Package version: 4.1.1