Skip to content

Commit

Permalink
chore(docs): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Jan 21, 2024
1 parent 833a797 commit f996de2
Show file tree
Hide file tree
Showing 7 changed files with 1,228 additions and 57 deletions.
38 changes: 16 additions & 22 deletions docs/bld.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ <h1 class="page-title">Source: bld.js</h1>
/**
* @async
* @function
* @param {BuildOptions} options
* @return {Promise&lt;void>}
* @param {BuildOptions} options - Build options
* @returns {Promise&lt;void>}
*
* @example
* // Minimal Usage (uses default values)
Expand Down Expand Up @@ -166,8 +166,7 @@ <h1 class="page-title">Source: bld.js</h1>
*
* @example
* // Rebuild Node native modules
* // This behaviour is currently disabled.
* // Tracking issue: https://github.com/nwutils/nw-builder/pull/993
* // This assumes you have a binding.gyp file in your options.srcDir.
* nwbuild({
* mode: "build",
* nodeAddon: "gyp"
Expand Down Expand Up @@ -246,7 +245,7 @@ <h1 class="page-title">Source: bld.js</h1>
typeof managedManifest === "object" ||
typeof managedManifest === "string"
) {
manageManifest({ manifest, managedManifest, outDir, platform });
await manageManifest({ manifest, managedManifest, outDir, platform });
}

if (platform === "linux") {
Expand Down Expand Up @@ -308,11 +307,11 @@ <h1 class="page-title">Source: bld.js</h1>
);

if (manifest.packageManager.startsWith("npm")) {
child_process.exec(`npm install`);
child_process.execSync(`npm install`);
} else if (manifest.packageManager.startsWith("yarn")) {
child_process.exec(`yarn install`);
child_process.execSync(`yarn install`);
} else if (manifest.packageManager.startsWith("pnpm")) {
child_process.exec(`pnpm install`);
child_process.execSync(`pnpm install`);
}
};

Expand Down Expand Up @@ -398,10 +397,12 @@ <h1 class="page-title">Source: bld.js</h1>
await fsm.rename(path.resolve(outDir, "nw.exe"), outDirAppExe);
await rcedit(outDirAppExe, rcEditOptions);
} catch (error) {
console.warn(
"Renaming EXE failed or unable to modify EXE. If it's the latter, ensure WINE is installed or build your application Windows platform",
);
console.error(error);
if (process.platform !== "win32") {
console.warn(
"Ensure WINE is installed or build your application on Windows platform",
);
}
throw error;
}
};

Expand Down Expand Up @@ -481,14 +482,7 @@ <h1 class="page-title">Source: bld.js</h1>
),
);

child_process.exec(
`node-gyp rebuild --target=${nodeVersion} --nodedir=${nodePath}`,
(error) => {
if (error !== null) {
console.error(error);
}
},
);
child_process.execSync(`node-gyp rebuild --target=${nodeVersion} --nodedir=${nodePath}`);
};

const compress = async ({
Expand Down Expand Up @@ -517,13 +511,13 @@ <h1 class="page-title">Source: bld.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#bld">bld</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#run">run</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#bld">bld</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#nwbuild">nwbuild</a></li><li><a href="global.html#run">run</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Tue Dec 26 2023 16:38:03 GMT+0530 (India Standard Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sun Jan 21 2024 18:15:08 GMT-0500 (Eastern Standard Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
27 changes: 6 additions & 21 deletions docs/get.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ <h1 class="page-title">Source: get.js</h1>

<section>
<article>
<pre class="prettyprint source linenums"><code>import child_process from "node:child_process";
import console from "node:console";
import fs from "node:fs";
<pre class="prettyprint source linenums"><code>import fs from "node:fs";
import fsm from "node:fs/promises";
import https from "node:https";
import path from "node:path";
Expand Down Expand Up @@ -176,8 +174,8 @@ <h1 class="page-title">Source: get.js</h1>
options.downloadUrl === "https://npmmirror.com/mirrors/nwjs"
) {
url = `${options.downloadUrl}/v${options.version}/nwjs${options.flavor === "sdk" ? "-sdk" : ""
}-v${options.version}-${options.platform}-${options.arch}.${options.platform === "linux" ? "tar.gz" : "zip"
}`;
}-v${options.version}-${options.platform}-${options.arch}.${options.platform === "linux" ? "tar.gz" : "zip"
}`;
}

https.get(url, (response) => {
Expand Down Expand Up @@ -338,20 +336,7 @@ <h1 class="page-title">Source: get.js</h1>
path.resolve(options.cacheDir, "node"),
path.resolve(options.cacheDir, `node-v${options.version}-${options.platform}-${options.arch}`),
);

child_process.exec(
"patch " +
path.resolve(
options.cacheDir,
`node-v${options.version}-${options.platform}-${options.arch}`,
"common.gypi",
) +
" " +
path.resolve("..", "..", "patches", "node_header.patch"),
(error) => {
console.error(error);
},
);
return;
}

const stream = fs.createWriteStream(out);
Expand Down Expand Up @@ -417,13 +402,13 @@ <h1 class="page-title">Source: get.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#bld">bld</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#run">run</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#bld">bld</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#nwbuild">nwbuild</a></li><li><a href="global.html#run">run</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Tue Dec 26 2023 16:38:03 GMT+0530 (India Standard Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sun Jan 21 2024 18:15:08 GMT-0500 (Eastern Standard Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit f996de2

Please sign in to comment.