Merge branch 'dev' into feat/add-ctrl-u-clear-line

This commit is contained in:
Billy Vong 2021-12-16 17:07:39 -05:00
commit 9b64551197
14 changed files with 41 additions and 16 deletions

6
dist/bitburner.d.ts vendored

@ -2138,9 +2138,11 @@ export declare interface NodeStats {
* ```ts * ```ts
* export async function main(ns) { * export async function main(ns) {
* // Basic ns functions can be accessed on the ns object * // Basic ns functions can be accessed on the ns object
* await ns.getHostname(); * ns.getHostname();
* // Some related functions are gathered under a sub-property of the ns object * // Some related functions are gathered under a sub-property of the ns object
* await ns.stock.getPrice(); * ns.stock.getPrice();
* // Some functions need to be await ed
* await ns.hack('n00dles');
* } * }
* ``` * ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs} * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}

File diff suppressed because one or more lines are too long

@ -12,6 +12,7 @@ const debug = false;
function createWindow(killall) { function createWindow(killall) {
const win = new BrowserWindow({ const win = new BrowserWindow({
show: false, show: false,
backgroundThrottling: false,
}); });
win.removeMenu(); win.removeMenu();

@ -14221,7 +14221,7 @@
{ {
"kind": "Interface", "kind": "Interface",
"canonicalReference": "bitburner!NS:interface", "canonicalReference": "bitburner!NS:interface",
"docComment": "/**\n * Collection of all functions passed to scripts\n *\n * @remarks\n *\n * <b>Basic ns1 usage example:</b>\n * ```ts\n * // Basic ns functions can be used directly\n * getHostname();\n * // Some related functions are gathered within a common namespace\n * stock.getPrice();\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html | ns1 in-game docs} <hr> <b>Basic ns2 usage example:</b>\n * ```ts\n * export async function main(ns) {\n * // Basic ns functions can be accessed on the ns object\n * await ns.getHostname();\n * // Some related functions are gathered under a sub-property of the ns object\n * await ns.stock.getPrice();\n * }\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html | ns2 in-game docs} <hr>\n *\n * @public\n */\n", "docComment": "/**\n * Collection of all functions passed to scripts\n *\n * @remarks\n *\n * <b>Basic ns1 usage example:</b>\n * ```ts\n * // Basic ns functions can be used directly\n * getHostname();\n * // Some related functions are gathered within a common namespace\n * stock.getPrice();\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html | ns1 in-game docs} <hr> <b>Basic ns2 usage example:</b>\n * ```ts\n * export async function main(ns) {\n * // Basic ns functions can be accessed on the ns object\n * ns.getHostname();\n * // Some related functions are gathered under a sub-property of the ns object\n * ns.stock.getPrice();\n * // Some functions need to be await ed\n * await ns.hack('n00dles');\n * }\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html | ns2 in-game docs} <hr>\n *\n * @public\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -28,9 +28,11 @@ export interface NS extends Singularity
```ts ```ts
export async function main(ns) { export async function main(ns) {
// Basic ns functions can be accessed on the ns object // Basic ns functions can be accessed on the ns object
await ns.getHostname(); ns.getHostname();
// Some related functions are gathered under a sub-property of the ns object // Some related functions are gathered under a sub-property of the ns object
await ns.stock.getPrice(); ns.stock.getPrice();
// Some functions need to be await ed
await ns.hack('n00dles');
} }
``` ```
[ns2 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html) <hr> [ns2 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html) <hr>

@ -109,6 +109,7 @@
"test:watch": "jest --watch", "test:watch": "jest --watch",
"watch": "webpack --watch --mode production", "watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development", "watch:dev": "webpack --watch --mode development",
"electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package/dist/ && cp -r dist/ext .package/dist/ && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png" "electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package/dist/ && cp -r dist/ext .package/dist/ && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
"allbuild": "npm run build && npm run electron && git add --all && git commit --amend --no-edit"
} }
} }

2
src/@types/global.d.ts vendored Normal file

@ -0,0 +1,2 @@
// Defined by webpack on startup or compilation
declare const __COMMIT_HASH__: string;

@ -3740,9 +3740,11 @@ interface Stanek {
* ```ts * ```ts
* export async function main(ns) { * export async function main(ns) {
* // Basic ns functions can be accessed on the ns object * // Basic ns functions can be accessed on the ns object
* await ns.getHostname(); * ns.getHostname();
* // Some related functions are gathered under a sub-property of the ns object * // Some related functions are gathered under a sub-property of the ns object
* await ns.stock.getPrice(); * ns.stock.getPrice();
* // Some functions need to be await ed
* await ns.hack('n00dles');
* } * }
* ``` * ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs} * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}

@ -6,6 +6,7 @@ import makeStyles from "@mui/styles/makeStyles";
import MuiDrawer from "@mui/material/Drawer"; import MuiDrawer from "@mui/material/Drawer";
import List from "@mui/material/List"; import List from "@mui/material/List";
import Divider from "@mui/material/Divider"; import Divider from "@mui/material/Divider";
import Tooltip from "@mui/material/Tooltip";
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import ListItem from "@mui/material/ListItem"; import ListItem from "@mui/material/ListItem";
@ -337,7 +338,11 @@ export function SidebarRoot(props: IProps): React.ReactElement {
<ListItemIcon> <ListItemIcon>
{!open ? <ChevronRightIcon color="primary" /> : <ChevronLeftIcon color="primary" />} {!open ? <ChevronRightIcon color="primary" /> : <ChevronLeftIcon color="primary" />}
</ListItemIcon> </ListItemIcon>
<ListItemText primary={<Typography>Bitburner v{CONSTANTS.VersionString}</Typography>} /> <ListItemText primary={
<Tooltip title={__COMMIT_HASH__}>
<Typography>Bitburner v{CONSTANTS.VersionString}</Typography>
</Tooltip>
} />
</ListItem> </ListItem>
<Divider /> <Divider />
<List> <List>

@ -77,7 +77,7 @@ export class Terminal implements ITerminal {
commandHistory: string[] = []; commandHistory: string[] = [];
commandHistoryIndex = 0; commandHistoryIndex = 0;
outputHistory: (Output | Link | RawOutput)[] = [new Output(`Bitburner v${CONSTANTS.VersionString}`, "primary")]; outputHistory: (Output | Link | RawOutput)[] = [new Output(`Bitburner v${CONSTANTS.VersionString} (${__COMMIT_HASH__})`, "primary")];
// True if a Coding Contract prompt is opened // True if a Coding Contract prompt is opened
contractOpen = false; contractOpen = false;
@ -555,7 +555,7 @@ export class Terminal implements ITerminal {
} }
clear(): void { clear(): void {
this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString}`, "primary")]; this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${__COMMIT_HASH__})`, "primary")];
TerminalEvents.emit(); TerminalEvents.emit();
TerminalClearEvents.emit(); TerminalClearEvents.emit();
} }

@ -69,7 +69,7 @@ export function LoadingScreen(): React.ReactElement {
<CircularProgress size={150} color="primary" /> <CircularProgress size={150} color="primary" />
</Grid> </Grid>
<Grid item> <Grid item>
<Typography variant="h3">Loading Bitburner v{CONSTANTS.VersionString}</Typography> <Typography variant="h3">Loading Bitburner v{CONSTANTS.VersionString} ({__COMMIT_HASH__})</Typography>
</Grid> </Grid>
{show && ( {show && (
<Grid item> <Grid item>

@ -42,6 +42,13 @@ module.exports = (env, argv) => {
}; };
} }
// Get the current commit hash to inject into the app
// https://stackoverflow.com/a/38401256
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
return { return {
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
@ -105,6 +112,9 @@ module.exports = (env, argv) => {
}, },
}, },
}), }),
new webpack.DefinePlugin({
__COMMIT_HASH__: JSON.stringify(commitHash)
}),
// In dev mode, use a faster method of create sourcemaps // In dev mode, use a faster method of create sourcemaps
// while keeping lines/columns accurate // while keeping lines/columns accurate
isDevServer && isDevServer &&