From df89cc5002cdc9f0fe8deaa0d39cb27681cdb6a0 Mon Sep 17 00:00:00 2001 From: danielyxie Date: Thu, 11 Apr 2019 01:37:40 -0700 Subject: [PATCH] Improved module import styling for all top-level src files --- src/ActiveScriptsUI.js | 63 +++++---- src/Alias.ts | 4 +- src/Bladeburner.js | 66 +++++---- src/CinematicText.js | 39 +++--- src/CodingContractGenerator.js | 19 +-- src/CodingContracts.ts | 19 ++- src/Constants.ts | 2 +- src/DevMenu.jsx | 94 ++++++------- src/Gang.js | 51 ++++--- src/Infiltration.js | 36 ++--- src/InteractiveTutorial.js | 21 +-- src/Literature.js | 2 +- src/Missions.js | 27 ++-- src/NetscriptBladeburner.js | 6 +- src/NetscriptEnvironment.js | 4 +- src/NetscriptEvaluator.js | 32 ++--- src/NetscriptFunctions.js | 242 +++++++++++++++++++-------------- src/NetscriptGang.js | 6 +- src/NetscriptJSEvaluator.js | 2 +- src/NetscriptPort.js | 2 +- src/NetscriptWorker.js | 52 +++---- src/Prestige.js | 109 ++++++++------- src/RedPill.js | 32 +++-- src/SaveObject.js | 81 ++++++----- src/Terminal.js | 149 ++++++++++---------- src/TextFile.ts | 7 +- src/engine.jsx | 213 ++++++++++++++++------------- 27 files changed, 751 insertions(+), 629 deletions(-) diff --git a/src/ActiveScriptsUI.js b/src/ActiveScriptsUI.js index 1cdc66b26..910dde947 100644 --- a/src/ActiveScriptsUI.js +++ b/src/ActiveScriptsUI.js @@ -1,35 +1,38 @@ -import {workerScripts, - killWorkerScript} from "./NetscriptWorker"; -import { Player } from "./Player"; -import { getServer } from "./Server/ServerHelpers"; -import {numeralWrapper} from "./ui/numeralFormat"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {createAccordionElement} from "../utils/uiHelpers/createAccordionElement"; -import {arrayToString} from "../utils/helpers/arrayToString"; -import {createElement} from "../utils/uiHelpers/createElement"; -import {createProgressBarText} from "../utils/helpers/createProgressBarText"; -import {exceptionAlert} from "../utils/helpers/exceptionAlert"; -import {getElementById} from "../utils/uiHelpers/getElementById"; -import {logBoxCreate} from "../utils/LogBox"; -import {formatNumber, - convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions"; -import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement"; -import {removeElement} from "../utils/uiHelpers/removeElement"; -import {roundToTwo} from "../utils/helpers/roundToTwo"; -import {Page, routing} from "./ui/navigationTracking"; +// TODO - Convert this to React +import { workerScripts, killWorkerScript } from "./NetscriptWorker"; +import { Player } from "./Player"; +import { getServer } from "./Server/ServerHelpers"; -/* { - * serverName: { - * header: Server Header Element - * panel: Server Panel List (ul) element - * scripts: { - * script id: Ref to Script information - * } - * } - * ... +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { logBoxCreate } from "../utils/LogBox"; +import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions"; +import { arrayToString } from "../utils/helpers/arrayToString"; +import { createProgressBarText } from "../utils/helpers/createProgressBarText"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { roundToTwo } from "../utils/helpers/roundToTwo"; +import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { getElementById } from "../utils/uiHelpers/getElementById"; +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; +import { removeElement } from "../utils/uiHelpers/removeElement"; + + +/** + * { + * serverName: { + * header: Server Header Element + * panel: Server Panel List (ul) element + * scripts: { + * script id: Ref to Script information + * } + * } + * ... */ -let ActiveScriptsUI = {}; -let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements +const ActiveScriptsUI = {}; +const ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements const getHeaderHtml = (server) => { // TODO: calculate the longest hostname length rather than hard coding it diff --git a/src/Alias.ts b/src/Alias.ts index 587c73209..f512fe9c7 100644 --- a/src/Alias.ts +++ b/src/Alias.ts @@ -1,5 +1,5 @@ -import { IMap } from "./types"; -import { post } from "./ui/postToTerminal"; +import { IMap } from "./types"; +import { post } from "./ui/postToTerminal"; export let Aliases: IMap = {}; export let GlobalAliases: IMap = {}; diff --git a/src/Bladeburner.js b/src/Bladeburner.js index 7b37b9745..b5b36df72 100644 --- a/src/Bladeburner.js +++ b/src/Bladeburner.js @@ -1,34 +1,40 @@ -import { Augmentations } from "./Augmentation/Augmentations"; -import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; -import { CONSTANTS } from "./Constants"; -import { Engine } from "./engine"; -import { Faction } from "./Faction/Faction"; -import { Factions, factionExists } from "./Faction/Factions"; -import { joinFaction, displayFactionContent } from "./Faction/FactionHelpers"; -import { Player } from "./Player"; -import { hackWorldDaemon, redPillFlag } from "./RedPill"; -import { numeralWrapper } from "./ui/numeralFormat"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; -import { KEY } from "../utils/helpers/keyCodes"; +import { Augmentations } from "./Augmentation/Augmentations"; +import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; +import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; +import { CONSTANTS } from "./Constants"; +import { Engine } from "./engine"; +import { Faction } from "./Faction/Faction"; +import { Factions, factionExists } from "./Faction/Factions"; +import { joinFaction, displayFactionContent } from "./Faction/FactionHelpers"; +import { Player } from "./Player"; +import { hackWorldDaemon, redPillFlag } from "./RedPill"; -import { createProgressBarText } from "../utils/helpers/createProgressBarText"; -import { dialogBoxCreate } from "../utils/DialogBox"; -import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; -import { Reviver, Generic_toJSON, - Generic_fromJSON } from "../utils/JSONReviver"; -import { addOffset } from "../utils/helpers/addOffset"; -import { appendLineBreaks } from "../utils/uiHelpers/appendLineBreaks"; -import { clearObject } from "../utils/helpers/clearObject"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { createPopup } from "../utils/uiHelpers/createPopup"; -import { Page, routing } from "./ui/navigationTracking"; -import { exceptionAlert } from "../utils/helpers/exceptionAlert"; -import { formatNumber } from "../utils/StringHelperFunctions"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { getTimestamp } from "../utils/helpers/getTimestamp"; -import { removeElement } from "../utils/uiHelpers/removeElement"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { + Reviver, + Generic_toJSON, + Generic_fromJSON +} from "../utils/JSONReviver"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { formatNumber } from "../utils/StringHelperFunctions"; + +import { addOffset } from "../utils/helpers/addOffset"; +import { clearObject } from "../utils/helpers/clearObject"; +import { createProgressBarText } from "../utils/helpers/createProgressBarText"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { getTimestamp } from "../utils/helpers/getTimestamp"; +import { KEY } from "../utils/helpers/keyCodes"; + +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; +import { appendLineBreaks } from "../utils/uiHelpers/appendLineBreaks"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; +import { removeElement } from "../utils/uiHelpers/removeElement"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; const stealthIcon = ` ` const killIcon = `` diff --git a/src/CinematicText.js b/src/CinematicText.js index 32bf59bde..ae0fc2aa9 100644 --- a/src/CinematicText.js +++ b/src/CinematicText.js @@ -1,29 +1,29 @@ -import {Engine} from "./engine"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { Engine } from "./engine"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; -import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement"; -import {createElement} from "../utils/uiHelpers/createElement"; -import {exceptionAlert} from "../utils/helpers/exceptionAlert"; -import {isString} from "../utils/helpers/isString"; +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { isString } from "../utils/helpers/isString"; -var cinematicTextFlag = false; +export let cinematicTextFlag = false; -//Lines must be an array of strings -function writeCinematicText(lines) { +// Lines must be an array of strings +export function writeCinematicText(lines) { cinematicTextFlag = true; if (lines.constructor !== Array) { throw new Error("Invalid non-array argument passed into writeCinematicText()"); } - //We'll reuse the 'Red Pill' content + // Reuse the 'Red Pill' content Engine.loadCinematicTextContent(); - var container = document.getElementById("cinematic-text-container"); + const container = document.getElementById("cinematic-text-container"); container.style.width = "75%"; if (container == null) {throw new Error("Could not find cinematic-text-container for writeCinematicText()");} removeChildrenFromElement(container); - for (var i = 0; i < lines.length; ++i) { + for (let i = 0; i < lines.length; ++i) { if (!isString(lines[i])) { throw new Error("Invalid non-string element in 'lines' argument. writeCinematicText() failed"); } @@ -45,11 +45,11 @@ function writeCinematicTextRecurse(lines, lineNumber=0) { function writeCinematicTextLine(line) { return new Promise(function(resolve, reject) { - var container = document.getElementById("cinematic-text-container"); - var pElem = document.createElement("p"); + const container = document.getElementById("cinematic-text-container"); + const pElem = document.createElement("p"); container.appendChild(pElem); - var promise = writeCinematicTextLetter(pElem, line, 0); + const promise = writeCinematicTextLetter(pElem, line, 0); promise.then(function(res) { resolve(res); }, function(e) { @@ -61,14 +61,15 @@ function writeCinematicTextLine(line) { function writeCinematicTextLetter(pElem, line, i=0) { return new Promise(function(resolve, reject) { setTimeoutRef(function() { + const textToShow = line.substring(0, i); + if (i >= line.length) { - var textToShow = line.substring(0, i); pElem.innerHTML = textToShow; return resolve(true); } - var textToShow = line.substring(0, i); + pElem.innerHTML = textToShow + ""; - var promise = writeCinematicTextLetter(pElem, line, i+1); + const promise = writeCinematicTextLetter(pElem, line, i+1); promise.then(function(res) { resolve(res); }, function(e) { @@ -96,5 +97,3 @@ function cinematicTextEnd() { })); }); } - -export {cinematicTextFlag, writeCinematicText}; diff --git a/src/CodingContractGenerator.js b/src/CodingContractGenerator.js index 135d47863..354a2e849 100644 --- a/src/CodingContractGenerator.js +++ b/src/CodingContractGenerator.js @@ -1,12 +1,15 @@ -import { CodingContract, - CodingContractRewardType, - CodingContractTypes } from "./CodingContracts"; -import { Factions } from "./Faction/Factions"; -import { Player } from "./Player"; -import { AllServers } from "./Server/AllServers"; -import { GetServerByHostname } from "./Server/ServerHelpers"; +import { + CodingContract, + CodingContractRewardType, + CodingContractTypes +} from "./CodingContracts"; +import { Factions } from "./Faction/Factions"; +import { Player } from "./Player"; +import { AllServers } from "./Server/AllServers"; +import { GetServerByHostname } from "./Server/ServerHelpers"; + +import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; export function generateRandomContract() { // First select a random problem type diff --git a/src/CodingContracts.ts b/src/CodingContracts.ts index 8128eb934..222c8ef69 100644 --- a/src/CodingContracts.ts +++ b/src/CodingContracts.ts @@ -1,11 +1,17 @@ -import { codingContractTypesMetadata, - DescriptionFunc, - GeneratorFunc, - SolverFunc } from "./data/codingcontracttypes"; +import { + codingContractTypesMetadata, + DescriptionFunc, + GeneratorFunc, + SolverFunc +} from "./data/codingcontracttypes"; -import { IMap } from "./types"; +import { IMap } from "./types"; -import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; +import { + Generic_fromJSON, + Generic_toJSON, + Reviver +} from "../utils/JSONReviver"; import { KEY } from "../utils/helpers/keyCodes"; import { createElement } from "../utils/uiHelpers/createElement"; import { createPopup } from "../utils/uiHelpers/createPopup"; @@ -13,6 +19,7 @@ import { removeElementById } from "../utils/uiHelpers/removeElementById"; + /* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */ /* Represents different types of problems that a Coding Contract can have */ diff --git a/src/Constants.ts b/src/Constants.ts index 6402b3e8a..a37ff6534 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -3,7 +3,7 @@ * * Constants for specific mechanics or features will NOT be here. */ -import {IMap} from "./types"; +import { IMap } from "./types"; export let CONSTANTS: IMap = { Version: "0.46.1", diff --git a/src/DevMenu.jsx b/src/DevMenu.jsx index 4b3417d79..9d3ec83cd 100644 --- a/src/DevMenu.jsx +++ b/src/DevMenu.jsx @@ -1,33 +1,35 @@ -import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import { CodingContractTypes } from "./CodingContracts"; -import { generateContract, - generateRandomContract, - generateRandomContractOnHome } from "./CodingContractGenerator"; -import { Companies } from "./Company/Companies"; -import { Company } from "./Company/Company"; -import { Programs } from "./Programs/Programs"; -import { Factions } from "./Faction/Factions"; -import { Player } from "./Player"; -import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; -import { AllServers } from "./Server/AllServers"; -import { GetServerByHostname } from "./Server/ServerHelpers"; -import { hackWorldDaemon } from "./RedPill"; -import { StockMarket, - SymbolToStockMap } from "./StockMarket/StockMarket"; -import { Stock } from "./StockMarket/Stock"; -import { Terminal } from "./Terminal"; +import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; +import { CodingContractTypes } from "./CodingContracts"; +import { + generateContract, + generateRandomContract, + generateRandomContractOnHome +} from "./CodingContractGenerator"; +import { Companies } from "./Company/Companies"; +import { Company } from "./Company/Company"; +import { Programs } from "./Programs/Programs"; +import { Factions } from "./Faction/Factions"; +import { Player } from "./Player"; +import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; +import { AllServers } from "./Server/AllServers"; +import { GetServerByHostname } from "./Server/ServerHelpers"; +import { hackWorldDaemon } from "./RedPill"; +import { StockMarket, SymbolToStockMap } from "./StockMarket/StockMarket"; +import { Stock } from "./StockMarket/Stock"; +import { Terminal } from "./Terminal"; -import { numeralWrapper } from "./ui/numeralFormat"; +import { numeralWrapper } from "./ui/numeralFormat"; -import { dialogBoxCreate } from "../utils/DialogBox"; -import { exceptionAlert } from "../utils/helpers/exceptionAlert"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { createOptionElement } from "../utils/uiHelpers/createOptionElement"; -import { getSelectText } from "../utils/uiHelpers/getSelectData"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createOptionElement } from "../utils/uiHelpers/createOptionElement"; +import { getSelectText } from "../utils/uiHelpers/getSelectData"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; import React from "react"; -import ReactDOM from "react-dom"; +import ReactDOM from "react-dom"; + const Component = React.Component; @@ -713,11 +715,11 @@ class DevMenuComponent extends Component { Hacking: - @@ -726,7 +728,7 @@ class DevMenuComponent extends Component { Strength: - Defense: - Dexterity: - Agility: - Charisma: - Intelligence: - Reputation: - Favor: - Reputation: - Favor: - Rank: - Cycles: - Cycles: - Cycles: - - + diff --git a/src/Gang.js b/src/Gang.js index e1cf03ab8..fcd9ddfbd 100644 --- a/src/Gang.js +++ b/src/Gang.js @@ -3,29 +3,36 @@ Also add police clashes balance point to keep them from running out of control */ -import { gangMemberTasksMetadata } from "./data/gangmembertasks"; -import { gangMemberUpgradesMetadata } from "./data/gangmemberupgrades"; +import { gangMemberTasksMetadata } from "./data/gangmembertasks"; +import { gangMemberUpgradesMetadata } from "./data/gangmemberupgrades"; + +import { Engine } from "./engine"; +import { Faction } from "./Faction/Faction"; +import { Factions } from "./Faction/Factions"; +import { displayFactionContent } from "./Faction/FactionHelpers"; + +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { + Reviver, + Generic_toJSON, + Generic_fromJSON +} from "../utils/JSONReviver"; +import { formatNumber } from "../utils/StringHelperFunctions"; + +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { KEY } from "../utils/helpers/keyCodes"; + +import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; +import { removeElement } from "../utils/uiHelpers/removeElement"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; -import { Engine } from "./engine"; -import { Faction } from "./Faction/Faction"; -import { Factions } from "./Faction/Factions"; -import { displayFactionContent } from "./Faction/FactionHelpers"; -import { numeralWrapper } from "./ui/numeralFormat"; -import { dialogBoxCreate } from "../utils/DialogBox"; -import { Reviver, Generic_toJSON, - Generic_fromJSON } from "../utils/JSONReviver"; -import { KEY } from "../utils/helpers/keyCodes"; -import { createAccordionElement } from "../utils/uiHelpers/createAccordionElement"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { createPopup } from "../utils/uiHelpers/createPopup"; -import { Page, - routing } from "./ui/navigationTracking"; -import { formatNumber } from "../utils/StringHelperFunctions"; -import { exceptionAlert } from "../utils/helpers/exceptionAlert"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; -import { removeElement } from "../utils/uiHelpers/removeElement"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; // Constants const GangRespectToReputationRatio = 5; // Respect is divided by this to get rep gain diff --git a/src/Infiltration.js b/src/Infiltration.js index 8997c0f18..5b78e5f86 100644 --- a/src/Infiltration.js +++ b/src/Infiltration.js @@ -1,30 +1,12 @@ -import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; -import { CONSTANTS } from "./Constants"; -import { Engine } from "./engine"; -import { Player } from "./Player"; -import { dialogBoxCreate } from "../utils/DialogBox"; -import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { infiltrationBoxCreate } from "../utils/InfiltrationBox"; -import { formatNumber } from "../utils/StringHelperFunctions"; - -/* Infiltration.js - * - * Kill - * Knockout (nonlethal) - * Stealth Knockout (nonlethal) - * Assassinate - * - * Hack Security - * Destroy Security - * Sneak past Security - * - * Pick the locked door - * - * Bribe security - * - * Escape - */ +import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; +import { CONSTANTS } from "./Constants"; +import { Engine } from "./engine"; +import { Player } from "./Player"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; +import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { infiltrationBoxCreate } from "../utils/InfiltrationBox"; +import { formatNumber } from "../utils/StringHelperFunctions"; let InfiltrationScenarios = { Guards: "You see an armed security guard patrolling the area.", diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index 976e8aa18..81f2c0bb6 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -1,12 +1,15 @@ -import { Engine } from "./engine"; -import { Player } from "./Player"; -import { Settings } from "./Settings/Settings"; -import { initializeMainMenuLinks } from "./ui/MainMenu/Links"; -import { exceptionAlert } from "../utils/helpers/exceptionAlert"; -import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { createPopup } from "../utils/uiHelpers/createPopup"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; +import { Engine } from "./engine"; +import { Player } from "./Player"; +import { Settings } from "./Settings/Settings"; + +import { initializeMainMenuLinks } from "./ui/MainMenu/Links"; + +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; + //Ordered array of keys to Interactive Tutorial Steps const orderedITutorialSteps = [ diff --git a/src/Literature.js b/src/Literature.js index 67d4f517c..0bc10e109 100644 --- a/src/Literature.js +++ b/src/Literature.js @@ -1,4 +1,4 @@ -import {dialogBoxCreate} from "../utils/DialogBox"; +import { dialogBoxCreate } from "../utils/DialogBox"; /* Literature.js * Lore / world building literature that can be found on servers diff --git a/src/Missions.js b/src/Missions.js index 17b2d9378..8a446b523 100644 --- a/src/Missions.js +++ b/src/Missions.js @@ -1,14 +1,19 @@ -import { CONSTANTS } from "./Constants"; -import { Engine } from "./engine"; -import { displayFactionContent } from "./Faction/FactionHelpers"; -import { Player } from "./Player"; -import { dialogBoxCreate } from "../utils/DialogBox"; -import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; -import { addOffset } from "../utils/helpers/addOffset"; -import { formatNumber } from "../utils/StringHelperFunctions"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { isString } from "../utils/helpers/isString"; -import jsplumb from 'jsplumb' +import { CONSTANTS } from "./Constants"; +import { Engine } from "./engine"; +import { displayFactionContent } from "./Faction/FactionHelpers"; +import { Player } from "./Player"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { formatNumber } from "../utils/StringHelperFunctions"; + +import { addOffset } from "../utils/helpers/addOffset"; +import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { isString } from "../utils/helpers/isString"; + +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; + +import jsplumb from "jsplumb"; + let inMission = false; //Flag to denote whether a mission is running let currMission = null; diff --git a/src/NetscriptBladeburner.js b/src/NetscriptBladeburner.js index 66298a6cc..61daa782f 100644 --- a/src/NetscriptBladeburner.js +++ b/src/NetscriptBladeburner.js @@ -1,6 +1,6 @@ -import {Player} from "./Player"; -import {Bladeburner} from "./Bladeburner"; -import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; +import { Player } from "./Player"; +import { Bladeburner } from "./Bladeburner"; +import { makeRuntimeRejectMsg } from "./NetscriptEvaluator"; function unknownBladeburnerActionErrorMessage(functionName, actionType, actionName) { return `ERROR: bladeburner.${functionName}() failed due to an invalid action specified. ` + diff --git a/src/NetscriptEnvironment.js b/src/NetscriptEnvironment.js index 480e4b45f..2c01abcfa 100644 --- a/src/NetscriptEnvironment.js +++ b/src/NetscriptEnvironment.js @@ -1,5 +1,5 @@ -import {NetscriptFunctions} from "./NetscriptFunctions"; -import {NetscriptPort} from "./NetscriptPort"; +import { NetscriptFunctions } from "./NetscriptFunctions"; +import { NetscriptPort } from "./NetscriptPort"; /* Environment * NetScript program environment diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index 6196d77bd..2321c1314 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -1,21 +1,21 @@ -import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; -import { CONSTANTS } from "./Constants"; -import { Player } from "./Player"; -import { Environment } from "./NetscriptEnvironment"; -import { WorkerScript, addWorkerScript} from "./NetscriptWorker"; -import { Server } from "./Server/Server"; -import { getServer } from "./Server/ServerHelpers"; -import { Settings } from "./Settings/Settings"; -import { RunningScript } from "./Script/RunningScript"; -import { Script } from "./Script/Script"; -import { findRunningScript } from "./Script/ScriptHelpers"; +import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; +import { CONSTANTS } from "./Constants"; +import { Player } from "./Player"; +import { Environment } from "./NetscriptEnvironment"; +import { WorkerScript, addWorkerScript } from "./NetscriptWorker"; +import { Server } from "./Server/Server"; +import { getServer } from "./Server/ServerHelpers"; +import { Settings } from "./Settings/Settings"; +import { RunningScript } from "./Script/RunningScript"; +import { Script } from "./Script/Script"; +import { findRunningScript } from "./Script/ScriptHelpers"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { parse, Node } from "../utils/acorn"; -import {parse, Node} from "../utils/acorn"; -import {arrayToString} from "../utils/helpers/arrayToString"; -import {isValidIPAddress} from "../utils/helpers/isValidIPAddress"; -import {isString} from "../utils/helpers/isString"; +import { arrayToString } from "../utils/helpers/arrayToString"; +import { isValidIPAddress } from "../utils/helpers/isValidIPAddress"; +import { isString } from "../utils/helpers/isString"; export function evaluateImport(exp, workerScript, checkingRam=false) { //When its checking RAM, it exports an array of nodes for each imported function diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index bb5755043..fe9ca7c76 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1,117 +1,149 @@ -var sprintf = require('sprintf-js').sprintf, - vsprintf = require('sprintf-js').vsprintf +const sprintf = require("sprintf-js").sprintf; +const vsprintf = require("sprintf-js").vsprintf; -import {updateActiveScriptsItems} from "./ActiveScriptsUI"; -import { Augmentation } from "./Augmentation/Augmentation"; -import { Augmentations } from "./Augmentation/Augmentations"; -import { augmentationExists, - installAugmentations } from "./Augmentation/AugmentationHelpers"; -import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; -import { findCrime } from "./Crime/CrimeHelpers"; -import {Bladeburner} from "./Bladeburner"; -import {Company} from "./Company/Company"; -import {Companies, companyExists} from "./Company/Companies"; -import {CompanyPosition} from "./Company/CompanyPosition"; -import {CompanyPositions} from "./Company/CompanyPositions"; -import {CONSTANTS} from "./Constants"; -import { DarkWebItems } from "./DarkWeb/DarkWebItems"; -import {calculateHackingChance, - calculateHackingExpGain, - calculatePercentMoneyHacked, - calculateHackingTime, - calculateGrowTime, - calculateWeakenTime} from "./Hacking"; -import {AllGangs} from "./Gang"; -import { Faction } from "./Faction/Faction"; -import { Factions, - factionExists } from "./Faction/Factions"; -import { joinFaction, - purchaseAugmentation } from "./Faction/FactionHelpers"; -import { FactionWorkType } from "./Faction/FactionWorkTypeEnum"; -import { netscriptCanGrow, - netscriptCanHack, - netscriptCanWeaken } from "./Hacking/netscriptCanHack"; +import { updateActiveScriptsItems } from "./ActiveScriptsUI"; +import { Augmentation } from "./Augmentation/Augmentation"; +import { Augmentations } from "./Augmentation/Augmentations"; +import { + augmentationExists, + installAugmentations +} from "./Augmentation/AugmentationHelpers"; +import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; +import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; +import { findCrime } from "./Crime/CrimeHelpers"; +import { Bladeburner } from "./Bladeburner"; +import { Company } from "./Company/Company"; +import { Companies, companyExists } from "./Company/Companies"; +import { CompanyPosition } from "./Company/CompanyPosition"; +import { CompanyPositions } from "./Company/CompanyPositions"; +import { CONSTANTS } from "./Constants"; +import { DarkWebItems } from "./DarkWeb/DarkWebItems"; +import { + calculateHackingChance, + calculateHackingExpGain, + calculatePercentMoneyHacked, + calculateHackingTime, + calculateGrowTime, + calculateWeakenTime +} from "./Hacking"; +import { AllGangs } from "./Gang"; +import { Faction } from "./Faction/Faction"; +import { Factions, factionExists } from "./Faction/Factions"; +import { joinFaction, purchaseAugmentation } from "./Faction/FactionHelpers"; +import { FactionWorkType } from "./Faction/FactionWorkTypeEnum"; +import { + netscriptCanGrow, + netscriptCanHack, + netscriptCanWeaken +} from "./Hacking/netscriptCanHack"; -import { getCostOfNextHacknetNode, - getCostOfNextHacknetServer, - purchaseHacknet, - hasHacknetServers, - purchaseHashUpgrade } from "./Hacknet/HacknetHelpers"; -import { CityName } from "./Locations/data/CityNames"; -import { LocationName } from "./Locations/data/LocationNames"; +import { + getCostOfNextHacknetNode, + getCostOfNextHacknetServer, + purchaseHacknet, + hasHacknetServers, + purchaseHashUpgrade +} from "./Hacknet/HacknetHelpers"; +import { CityName } from "./Locations/data/CityNames"; +import { LocationName } from "./Locations/data/LocationNames"; -import { HacknetServer } from "./Hacknet/HacknetServer"; -import { Message } from "./Message/Message"; -import { Messages } from "./Message/MessageHelpers"; -import {inMission} from "./Missions"; -import {Player} from "./Player"; -import { Programs } from "./Programs/Programs"; -import { Script } from "./Script/Script"; -import { findRunningScript } from "./Script/ScriptHelpers"; -import { isScriptFilename } from "./Script/ScriptHelpersTS"; -import { AllServers, - AddToAllServers } from "./Server/AllServers"; -import { Server } from "./Server/Server"; -import { GetServerByHostname, - getServer, - getServerOnNetwork, - numCycleForGrowth, - processSingleServerGrowth } from "./Server/ServerHelpers"; -import { getPurchaseServerCost, - getPurchaseServerLimit, - getPurchaseServerMaxRam } from "./Server/ServerPurchases"; -import {Settings} from "./Settings/Settings"; -import {SpecialServerIps} from "./Server/SpecialServerIps"; -import {Stock} from "./StockMarket/Stock"; -import {StockMarket, StockSymbols, SymbolToStockMap, - initStockMarket, initSymbolToStockMap, buyStock, - sellStock, updateStockPlayerPosition, - shortStock, sellShort, OrderTypes, - PositionTypes, placeOrder, cancelOrder} from "./StockMarket/StockMarket"; -import { getStockmarket4SDataCost, - getStockMarket4STixApiCost } from "./StockMarket/StockMarketCosts"; -import { SourceFileFlags } from "./SourceFile/SourceFileFlags" -import {TextFile, getTextFile, createTextFile} from "./TextFile"; +import { HacknetServer } from "./Hacknet/HacknetServer"; +import { Message } from "./Message/Message"; +import { Messages } from "./Message/MessageHelpers"; +import { inMission } from "./Missions"; +import { Player } from "./Player"; +import { Programs } from "./Programs/Programs"; +import { Script } from "./Script/Script"; +import { findRunningScript } from "./Script/ScriptHelpers"; +import { isScriptFilename } from "./Script/ScriptHelpersTS"; +import { AllServers, AddToAllServers } from "./Server/AllServers"; +import { Server } from "./Server/Server"; +import { + GetServerByHostname, + getServer, + getServerOnNetwork, + numCycleForGrowth, + processSingleServerGrowth +} from "./Server/ServerHelpers"; +import { + getPurchaseServerCost, + getPurchaseServerLimit, + getPurchaseServerMaxRam +} from "./Server/ServerPurchases"; +import { Settings } from "./Settings/Settings"; +import { SpecialServerIps } from "./Server/SpecialServerIps"; +import { Stock } from "./StockMarket/Stock"; +import { + StockMarket, + StockSymbols, + SymbolToStockMap, + initStockMarket, + initSymbolToStockMap, + buyStock, + sellStock, + updateStockPlayerPosition, + shortStock, + sellShort, + OrderTypes, + PositionTypes, + placeOrder, + cancelOrder +} from "./StockMarket/StockMarket"; +import { + getStockmarket4SDataCost, + getStockMarket4STixApiCost +} from "./StockMarket/StockMarketCosts"; +import { SourceFileFlags } from "./SourceFile/SourceFileFlags"; +import { TextFile, getTextFile, createTextFile } from "./TextFile"; -import {unknownBladeburnerActionErrorMessage, - unknownBladeburnerExceptionMessage, - checkBladeburnerAccess} from "./NetscriptBladeburner"; -import * as nsGang from "./NetscriptGang"; -import {WorkerScript, workerScripts, - killWorkerScript, NetscriptPorts} from "./NetscriptWorker"; -import {makeRuntimeRejectMsg, netscriptDelay, - runScriptFromScript} from "./NetscriptEvaluator"; -import {NetscriptPort} from "./NetscriptPort"; -import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum"; -import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/Sleeve"; +import { + unknownBladeburnerActionErrorMessage, + unknownBladeburnerExceptionMessage, + checkBladeburnerAccess +} from "./NetscriptBladeburner"; +import * as nsGang from "./NetscriptGang"; +import { + WorkerScript, + workerScripts, + killWorkerScript, + NetscriptPorts +} from "./NetscriptWorker"; +import { + makeRuntimeRejectMsg, + netscriptDelay, + runScriptFromScript +} from "./NetscriptEvaluator"; +import { NetscriptPort } from "./NetscriptPort"; +import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum"; +import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/Sleeve"; -import {Page, routing} from "./ui/navigationTracking"; -import {numeralWrapper} from "./ui/numeralFormat"; -import {post} from "./ui/postToTerminal"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; -import { is2DArray } from "./utils/helpers/is2DArray"; +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; +import { post } from "./ui/postToTerminal"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { is2DArray } from "./utils/helpers/is2DArray"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {isPowerOfTwo} from "../utils/helpers/isPowerOfTwo"; -import {arrayToString} from "../utils/helpers/arrayToString"; -import {createRandomIp} from "../utils/IPAddress"; -import {formatNumber, isHTML} from "../utils/StringHelperFunctions"; -import {isString} from "../utils/helpers/isString"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { isPowerOfTwo } from "../utils/helpers/isPowerOfTwo"; +import { arrayToString } from "../utils/helpers/arrayToString"; +import { createRandomIp } from "../utils/IPAddress"; +import { formatNumber, isHTML } from "../utils/StringHelperFunctions"; +import { isString } from "../utils/helpers/isString"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { createPopup } from "../utils/uiHelpers/createPopup"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; -var hasCorporationSF = false, //Source-File 3 - hasSingularitySF = false, //Source-File 4 - hasAISF = false, //Source-File 5 - hasBladeburnerSF = false, //Source-File 6 - hasBladeburner2079SF = false, //Source-File 7 - hasWallStreetSF = false, //Source-File 8 - hasBn11SF = false; //Source-File 11 +let hasCorporationSF = false; //Source-File 3 +let hasSingularitySF = false; //Source-File 4 +let hasAISF = false; //Source-File 5 +let hasBladeburnerSF = false; //Source-File 6 +let hasBladeburner2079SF = false; //Source-File 7 +let hasWallStreetSF = false; //Source-File 8 +let hasBn11SF = false; //Source-File 11 -var singularitySFLvl=1, wallStreetSFLvl=1; +let singularitySFLvl = 1; +let wallStreetSFLvl = 1; var possibleLogs = { ALL: true, diff --git a/src/NetscriptGang.js b/src/NetscriptGang.js index 638bba084..1fce46666 100644 --- a/src/NetscriptGang.js +++ b/src/NetscriptGang.js @@ -1,6 +1,6 @@ -import {Player} from "./Player"; -import {Gang} from "./Gang"; -import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; +import { Player } from "./Player"; +import { Gang } from "./Gang"; +import { makeRuntimeRejectMsg } from "./NetscriptEvaluator"; export function unknownGangApiExceptionMessage(functionName, err) { return `gang.${functionName}() failed with exception: ` + err; diff --git a/src/NetscriptJSEvaluator.js b/src/NetscriptJSEvaluator.js index dc2606968..0f8032f90 100644 --- a/src/NetscriptJSEvaluator.js +++ b/src/NetscriptJSEvaluator.js @@ -1,4 +1,4 @@ -import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; +import { makeRuntimeRejectMsg } from "./NetscriptEvaluator"; // Makes a blob that contains the code of a given script. export function makeScriptBlob(code) { diff --git a/src/NetscriptPort.js b/src/NetscriptPort.js index 5820c77bf..df5fa842d 100644 --- a/src/NetscriptPort.js +++ b/src/NetscriptPort.js @@ -1,4 +1,4 @@ -import {Settings} from "./Settings/Settings"; +import { Settings } from "./Settings/Settings"; function NetscriptPort() { this.data = []; diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index e698166f8..7dcba4852 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -1,28 +1,34 @@ -import {addActiveScriptsItem, - deleteActiveScriptsItem, - updateActiveScriptsItems} from "./ActiveScriptsUI"; -import {CONSTANTS} from "./Constants"; -import {Engine} from "./engine"; -import {Interpreter} from "./JSInterpreter"; -import {Environment} from "./NetscriptEnvironment"; -import {evaluate, isScriptErrorMessage, - makeRuntimeRejectMsg, - killNetscriptDelay} from "./NetscriptEvaluator"; -import {NetscriptFunctions} from "./NetscriptFunctions"; -import {executeJSScript} from "./NetscriptJSEvaluator"; -import {NetscriptPort} from "./NetscriptPort"; -import { AllServers } from "./Server/AllServers"; -import {Settings} from "./Settings/Settings"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { + addActiveScriptsItem, + deleteActiveScriptsItem, + updateActiveScriptsItems +} from "./ActiveScriptsUI"; +import { CONSTANTS } from "./Constants"; +import { Engine } from "./engine"; +import { Interpreter } from "./JSInterpreter"; +import { Environment } from "./NetscriptEnvironment"; +import { + evaluate, + isScriptErrorMessage, + makeRuntimeRejectMsg, + killNetscriptDelay +} from "./NetscriptEvaluator"; +import { NetscriptFunctions } from "./NetscriptFunctions"; +import { executeJSScript } from "./NetscriptJSEvaluator"; +import { NetscriptPort } from "./NetscriptPort"; +import { AllServers } from "./Server/AllServers"; +import { Settings } from "./Settings/Settings"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; -import {generate} from 'escodegen'; +import { generate } from "escodegen"; + +import { parse, Node } from "../utils/acorn"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { compareArrays } from "../utils/helpers/compareArrays"; +import { arrayToString } from "../utils/helpers/arrayToString"; +import { roundToTwo } from "../utils/helpers/roundToTwo"; +import { isString } from "../utils/StringHelperFunctions"; -import {parse, Node} from "../utils/acorn"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {compareArrays} from "../utils/helpers/compareArrays"; -import {arrayToString} from "../utils/helpers/arrayToString"; -import {roundToTwo} from "../utils/helpers/roundToTwo"; -import {isString} from "../utils/StringHelperFunctions"; const walk = require("acorn/dist/walk"); diff --git a/src/Prestige.js b/src/Prestige.js index 98ba2d6b0..8eaab913e 100755 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -1,55 +1,68 @@ -import {deleteActiveScriptsItem} from "./ActiveScriptsUI"; -import { Augmentations } from "./Augmentation/Augmentations"; -import { augmentationExists, - initAugmentations } from "./Augmentation/AugmentationHelpers"; -import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import { initBitNodeMultipliers } from "./BitNode/BitNode"; -import {Bladeburner} from "./Bladeburner"; -import {writeCinematicText} from "./CinematicText"; -import {Companies, initCompanies} from "./Company/Companies"; -import { resetIndustryResearchTrees } from "./Corporation/IndustryData"; -import { Programs } from "./Programs/Programs"; -import {Engine} from "./engine"; -import { Faction } from "./Faction/Faction"; -import { Factions, - initFactions } from "./Faction/Factions"; -import { joinFaction } from "./Faction/FactionHelpers"; -import {deleteGangDisplayContent} from "./Gang"; -import { Message } from "./Message/Message"; -import { initMessages, - Messages } from "./Message/MessageHelpers"; -import {initSingularitySFFlags, hasWallStreetSF}from "./NetscriptFunctions"; -import {WorkerScript, workerScripts, - prestigeWorkerScripts} from "./NetscriptWorker"; -import {Player} from "./Player"; +import { deleteActiveScriptsItem } from "./ActiveScriptsUI"; +import { Augmentations } from "./Augmentation/Augmentations"; +import { + augmentationExists, + initAugmentations +} from "./Augmentation/AugmentationHelpers"; +import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; +import { initBitNodeMultipliers } from "./BitNode/BitNode"; +import { Bladeburner } from "./Bladeburner"; +import { writeCinematicText } from "./CinematicText"; +import { Companies, initCompanies } from "./Company/Companies"; +import { resetIndustryResearchTrees } from "./Corporation/IndustryData"; +import { Programs } from "./Programs/Programs"; +import { Engine } from "./engine"; +import { Faction } from "./Faction/Faction"; +import { Factions, initFactions } from "./Faction/Factions"; +import { joinFaction } from "./Faction/FactionHelpers"; +import { deleteGangDisplayContent } from "./Gang"; +import { Message } from "./Message/Message"; +import { initMessages, Messages } from "./Message/MessageHelpers"; +import { initSingularitySFFlags, hasWallStreetSF } from "./NetscriptFunctions"; +import { + WorkerScript, + workerScripts, + prestigeWorkerScripts +} from "./NetscriptWorker"; +import { Player } from "./Player"; -import { AllServers, - AddToAllServers, - initForeignServers, - prestigeAllServers } from "./Server/AllServers"; -import { Server } from "./Server/Server" -import { prestigeHomeComputer } from "./Server/ServerHelpers"; -import { SourceFileFlags, - updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; -import { SpecialServerIps, - SpecialServerIpsMap, - prestigeSpecialServerIps, - SpecialServerNames} from "./Server/SpecialServerIps"; -import {initStockMarket, initSymbolToStockMap, - stockMarketContentCreated, - setStockMarketContentCreated} from "./StockMarket/StockMarket"; -import {Terminal, postNetburnerText} from "./Terminal"; +import { + AllServers, + AddToAllServers, + initForeignServers, + prestigeAllServers +} from "./Server/AllServers"; +import { Server } from "./Server/Server"; +import { prestigeHomeComputer } from "./Server/ServerHelpers"; +import { + SourceFileFlags, + updateSourceFileFlags +} from "./SourceFile/SourceFileFlags"; +import { + SpecialServerIps, + SpecialServerIpsMap, + prestigeSpecialServerIps, + SpecialServerNames +} from "./Server/SpecialServerIps"; +import { + initStockMarket, + initSymbolToStockMap, + stockMarketContentCreated, + setStockMarketContentCreated +} from "./StockMarket/StockMarket"; +import { Terminal, postNetburnerText } from "./Terminal"; -import {Page, routing} from "./ui/navigationTracking"; +import { Page, routing } from "./ui/navigationTracking"; -import Decimal from "decimal.js"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {removeElementById} from "../utils/uiHelpers/removeElementById"; -import {createElement} from "../utils/uiHelpers/createElement"; -import {createPopup} from "../utils/uiHelpers/createPopup"; -import {exceptionAlert} from "../utils/helpers/exceptionAlert"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; -let BitNode8StartingMoney = 250e6; +import Decimal from "decimal.js"; + +const BitNode8StartingMoney = 250e6; //Prestige by purchasing augmentation function prestigeAugmentation() { diff --git a/src/RedPill.js b/src/RedPill.js index 5420e43c5..f0e701d37 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -1,18 +1,22 @@ -import { BitNodes } from "./BitNode/BitNode"; -import { Engine } from "./engine"; -import { Player } from "./Player"; -import { prestigeSourceFile } from "./Prestige"; -import { SourceFiles, - SourceFile } from "./SourceFile"; -import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; -import { Terminal } from "./Terminal"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { BitNodes } from "./BitNode/BitNode"; +import { Engine } from "./engine"; +import { Player } from "./Player"; +import { prestigeSourceFile } from "./Prestige"; +import { SourceFiles, SourceFile } from "./SourceFile"; +import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; +import { Terminal } from "./Terminal"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { + yesNoBoxCreate, + yesNoBoxGetYesButton, + yesNoBoxGetNoButton, + yesNoBoxClose +} from "../utils/YesNoBox"; +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; -import {clearEventListeners} from "../utils/uiHelpers/clearEventListeners"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {removeChildrenFromElement} from "../utils/uiHelpers/removeChildrenFromElement"; -import {yesNoBoxCreate, yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; /* RedPill.js * Implements what happens when you have Red Pill augmentation and then hack the world daemon */ diff --git a/src/SaveObject.js b/src/SaveObject.js index d382765c9..0f2606198 100755 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -1,41 +1,52 @@ -import {loadAliases, loadGlobalAliases, - Aliases, GlobalAliases} from "./Alias"; -import {Companies, loadCompanies} from "./Company/Companies"; -import {CompanyPosition} from "./Company/CompanyPosition"; -import {CONSTANTS} from "./Constants"; -import {Engine} from "./engine"; -import { Factions, - loadFactions } from "./Faction/Factions"; -import { processPassiveFactionRepGain } from "./Faction/FactionHelpers"; -import { loadFconf } from "./Fconf/Fconf"; -import { FconfSettings } from "./Fconf/FconfSettings"; -import {loadAllGangs, AllGangs} from "./Gang"; -import { hasHacknetServers, - processHacknetEarnings } from "./Hacknet/HacknetHelpers"; +import { + loadAliases, + loadGlobalAliases, + Aliases, + GlobalAliases +} from "./Alias"; +import { Companies, loadCompanies } from "./Company/Companies"; +import { CompanyPosition } from "./Company/CompanyPosition"; +import { CONSTANTS } from "./Constants"; +import { Engine } from "./engine"; +import { Factions, loadFactions } from "./Faction/Factions"; +import { processPassiveFactionRepGain } from "./Faction/FactionHelpers"; +import { loadFconf } from "./Fconf/Fconf"; +import { FconfSettings } from "./Fconf/FconfSettings"; +import { loadAllGangs, AllGangs } from "./Gang"; +import { + hasHacknetServers, + processHacknetEarnings +} from "./Hacknet/HacknetHelpers"; import { loadMessages, initMessages, Messages } from "./Message/MessageHelpers"; -import {Player, loadPlayer} from "./Player"; -import { loadAllRunningScripts } from "./Script/ScriptHelpers"; -import { AllServers, - loadAllServers } from "./Server/AllServers"; -import { Settings } from "./Settings/Settings"; -import { loadSpecialServerIps, - SpecialServerIps } from "./Server/SpecialServerIps"; -import {loadStockMarket, StockMarket} from "./StockMarket/StockMarket"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { Player, loadPlayer } from "./Player"; +import { loadAllRunningScripts } from "./Script/ScriptHelpers"; +import { AllServers, loadAllServers } from "./Server/AllServers"; +import { Settings } from "./Settings/Settings"; +import { + loadSpecialServerIps, + SpecialServerIps +} from "./Server/SpecialServerIps"; +import { loadStockMarket, StockMarket } from "./StockMarket/StockMarket"; -import {dialogBoxCreate} from "../utils/DialogBox"; -import {gameOptionsBoxClose} from "../utils/GameOptions"; -import {clearEventListeners} from "../utils/uiHelpers/clearEventListeners"; -import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver"; -import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions"; -import {createElement} from "../utils/uiHelpers/createElement"; -import {createPopup} from "../utils/uiHelpers/createPopup"; -import {createStatusText} from "./ui/createStatusText"; -import {numeralWrapper} from "./ui/numeralFormat"; -import {removeElementById} from "../utils/uiHelpers/removeElementById"; +import { createStatusText } from "./ui/createStatusText"; +import { numeralWrapper } from "./ui/numeralFormat"; -import Decimal from "decimal.js"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; + +import { dialogBoxCreate } from "../utils/DialogBox"; +import { gameOptionsBoxClose } from "../utils/GameOptions"; +import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions"; +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; +import { + Reviver, + Generic_toJSON, + Generic_fromJSON +} from "../utils/JSONReviver"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { createPopup } from "../utils/uiHelpers/createPopup"; +import { removeElementById } from "../utils/uiHelpers/removeElementById"; + +import Decimal from "decimal.js"; /* SaveObject.js * Defines the object used to save/load games diff --git a/src/Terminal.js b/src/Terminal.js index 544c9e602..76516c6b3 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -8,77 +8,85 @@ import { removeLeadingSlash, removeTrailingSlash } from "./Terminal/DirectoryHelpers"; +import { determineAllPossibilitiesForTabCompletion } from "./Terminal/determineAllPossibilitiesForTabCompletion"; +import { TerminalHelpText, HelpTexts } from "./Terminal/HelpText"; +import { tabCompletion } from "./Terminal/tabCompletion"; import { - determineAllPossibilitiesForTabCompletion -} from "./Terminal/determineAllPossibilitiesForTabCompletion"; - + Aliases, + GlobalAliases, + parseAliasDeclaration, + printAliases, + removeAlias, + substituteAliases +} from "./Alias"; +import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; import { - TerminalHelpText, - HelpTexts -} from "./Terminal/HelpText"; - + CodingContract, + CodingContractResult, + CodingContractRewardType +} from "./CodingContracts"; +import { CONSTANTS } from "./Constants"; +import { Programs } from "./Programs/Programs"; import { - tabCompletion -} from "./Terminal/tabCompletion"; - -import { Aliases, - GlobalAliases, - parseAliasDeclaration, - printAliases, - removeAlias, - substituteAliases } from "./Alias"; -import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; -import {CodingContract, CodingContractResult, - CodingContractRewardType} from "./CodingContracts"; -import {CONSTANTS} from "./Constants"; -import { Programs } from "./Programs/Programs"; -import { executeDarkwebTerminalCommand, - checkIfConnectedToDarkweb } from "./DarkWeb/DarkWeb"; -import { DarkWebItems } from "./DarkWeb/DarkWebItems"; -import {Engine} from "./engine"; -import { parseFconfSettings, - createFconf } from "./Fconf/Fconf"; -import { FconfSettings } from "./Fconf/FconfSettings"; -import {calculateHackingChance, - calculateHackingExpGain, - calculatePercentMoneyHacked, - calculateHackingTime, - calculateGrowTime, - calculateWeakenTime} from "./Hacking"; -import { HacknetServer } from "./Hacknet/HacknetServer"; -import {iTutorialNextStep, iTutorialSteps, - ITutorial} from "./InteractiveTutorial"; -import {showLiterature} from "./Literature"; -import { Message } from "./Message/Message"; -import { showMessage } from "./Message/MessageHelpers"; -import {killWorkerScript, addWorkerScript} from "./NetscriptWorker"; -import {Player} from "./Player"; -import {hackWorldDaemon} from "./RedPill"; -import { RunningScript } from "./Script/RunningScript"; -import { findRunningScript } from "./Script/ScriptHelpers"; -import { isScriptFilename } from "./Script/ScriptHelpersTS"; -import { AllServers } from "./Server/AllServers"; -import { Server } from "./Server/Server"; -import { GetServerByHostname, - getServer, - getServerOnNetwork } from "./Server/ServerHelpers"; -import {Settings} from "./Settings/Settings"; -import { SpecialServerIps, - SpecialServerNames } from "./Server/SpecialServerIps"; -import {getTextFile} from "./TextFile"; -import { setTimeoutRef } from "./utils/SetTimeoutRef"; -import {Page, routing} from "./ui/navigationTracking"; -import {numeralWrapper} from "./ui/numeralFormat"; -import {KEY} from "../utils/helpers/keyCodes"; -import {addOffset} from "../utils/helpers/addOffset"; -import {isString} from "../utils/helpers/isString"; -import {arrayToString} from "../utils/helpers/arrayToString"; -import {getTimestamp} from "../utils/helpers/getTimestamp"; -import {logBoxCreate} from "../utils/LogBox"; -import {yesNoBoxCreate, - yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; + executeDarkwebTerminalCommand, + checkIfConnectedToDarkweb +} from "./DarkWeb/DarkWeb"; +import { DarkWebItems } from "./DarkWeb/DarkWebItems"; +import { Engine } from "./engine"; +import { parseFconfSettings, createFconf } from "./Fconf/Fconf"; +import { FconfSettings } from "./Fconf/FconfSettings"; +import { + calculateHackingChance, + calculateHackingExpGain, + calculatePercentMoneyHacked, + calculateHackingTime, + calculateGrowTime, + calculateWeakenTime +} from "./Hacking"; +import { HacknetServer } from "./Hacknet/HacknetServer"; +import { + iTutorialNextStep, + iTutorialSteps, + ITutorial +} from "./InteractiveTutorial"; +import { showLiterature } from "./Literature"; +import { Message } from "./Message/Message"; +import { showMessage } from "./Message/MessageHelpers"; +import { killWorkerScript, addWorkerScript } from "./NetscriptWorker"; +import { Player } from "./Player"; +import { hackWorldDaemon } from "./RedPill"; +import { RunningScript } from "./Script/RunningScript"; +import { findRunningScript } from "./Script/ScriptHelpers"; +import { isScriptFilename } from "./Script/ScriptHelpersTS"; +import { AllServers } from "./Server/AllServers"; +import { Server } from "./Server/Server"; +import { + GetServerByHostname, + getServer, + getServerOnNetwork +} from "./Server/ServerHelpers"; +import { Settings } from "./Settings/Settings"; +import { + SpecialServerIps, + SpecialServerNames +} from "./Server/SpecialServerIps"; +import { getTextFile } from "./TextFile"; +import { setTimeoutRef } from "./utils/SetTimeoutRef"; +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; +import { KEY } from "../utils/helpers/keyCodes"; +import { addOffset } from "../utils/helpers/addOffset"; +import { isString } from "../utils/helpers/isString"; +import { arrayToString } from "../utils/helpers/arrayToString"; +import { getTimestamp } from "../utils/helpers/getTimestamp"; +import { logBoxCreate } from "../utils/LogBox"; +import { + yesNoBoxCreate, + yesNoBoxGetYesButton, + yesNoBoxGetNoButton, + yesNoBoxClose +} from "../utils/YesNoBox"; import { post, postContent, @@ -87,9 +95,10 @@ import { hackProgressPost } from "./ui/postToTerminal"; -import autosize from 'autosize'; -import * as JSZip from 'jszip'; -import * as FileSaver from 'file-saver'; +import autosize from "autosize"; +import * as JSZip from "jszip"; +import * as FileSaver from "file-saver"; + function postNetburnerText() { post("Bitburner v" + CONSTANTS.Version); diff --git a/src/TextFile.ts b/src/TextFile.ts index 74254fff2..0e5a6bd3e 100644 --- a/src/TextFile.ts +++ b/src/TextFile.ts @@ -1,6 +1,11 @@ import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { dialogBoxCreate } from "../utils/DialogBox"; -import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; +import { + Generic_fromJSON, + Generic_toJSON, + Reviver +} from "../utils/JSONReviver"; + /** * Represents a plain text file that is typically stored on a server. diff --git a/src/engine.jsx b/src/engine.jsx index d7cd68d36..3613d73b9 100644 --- a/src/engine.jsx +++ b/src/engine.jsx @@ -1,104 +1,129 @@ -import {formatNumber, - convertTimeMsToTimeElapsedString, - replaceAt} from "../utils/StringHelperFunctions"; -import {loxBoxCreate, logBoxUpdateText, - logBoxOpened} from "../utils/LogBox"; -import {updateActiveScriptsItems} from "./ActiveScriptsUI"; -import { Augmentations } from "./Augmentation/Augmentations"; -import { installAugmentations, - initAugmentations, - displayAugmentationsContent, - PlayerOwnedAugmentation } from "./Augmentation/AugmentationHelpers"; -import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; +import { + formatNumber, + convertTimeMsToTimeElapsedString, + replaceAt +} from "../utils/StringHelperFunctions"; +import { loxBoxCreate, logBoxUpdateText, logBoxOpened } from "../utils/LogBox"; +import { updateActiveScriptsItems } from "./ActiveScriptsUI"; +import { Augmentations } from "./Augmentation/Augmentations"; +import { + installAugmentations, + initAugmentations, + displayAugmentationsContent, + PlayerOwnedAugmentation +} from "./Augmentation/AugmentationHelpers"; +import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; -import {BitNodes, initBitNodes, - initBitNodeMultipliers} from "./BitNode/BitNode"; -import {Bladeburner} from "./Bladeburner"; -import { CharacterOverviewComponent } from "./ui/React/CharacterOverview"; -import {cinematicTextFlag} from "./CinematicText"; -import {generateRandomContract} from "./CodingContractGenerator"; -import {CompanyPositions} from "./Company/CompanyPositions"; -import {initCompanies} from "./Company/Companies"; -import { Corporation } from "./Corporation/Corporation"; -import {CONSTANTS} from "./Constants"; -import {createDevMenu, closeDevMenu} from "./DevMenu"; -import { Factions, initFactions } from "./Faction/Factions"; -import { displayFactionContent, joinFaction, - processPassiveFactionRepGain, - inviteToFaction } from "./Faction/FactionHelpers"; -import { FconfSettings } from "./Fconf/FconfSettings"; -import { hasHacknetServers, - renderHacknetNodesUI, - clearHacknetNodesUI, - processHacknetEarnings } from "./Hacknet/HacknetHelpers"; -import {iTutorialStart} from "./InteractiveTutorial"; -import {initLiterature} from "./Literature"; -import { LocationName } from "./Locations/data/LocationNames"; -import { LocationRoot } from "./Locations/ui/Root"; -import { checkForMessagesToSend, initMessages } from "./Message/MessageHelpers"; -import {inMission, currMission} from "./Missions"; -import {initSingularitySFFlags, - hasSingularitySF, hasCorporationSF} from "./NetscriptFunctions"; -import {updateOnlineScriptTimes, - runScriptsLoop} from "./NetscriptWorker"; -import {Player} from "./Player"; -import {prestigeAugmentation, - prestigeSourceFile} from "./Prestige"; -import { Programs } from "./Programs/Programs"; -import { displayCreateProgramContent, - getNumAvailableCreateProgram, - initCreateProgramButtons } from "./Programs/ProgramHelpers"; -import {redPillFlag, hackWorldDaemon} from "./RedPill"; -import {saveObject, loadGame} from "./SaveObject"; -import { getCurrentEditor, - loadAllRunningScripts, - scriptEditorInit, - updateScriptEditorContent } from "./Script/ScriptHelpers"; -import { AllServers, - initForeignServers } from "./Server/AllServers"; +import { + BitNodes, + initBitNodes, + initBitNodeMultipliers +} from "./BitNode/BitNode"; +import { Bladeburner } from "./Bladeburner"; +import { CharacterOverviewComponent } from "./ui/React/CharacterOverview"; +import { cinematicTextFlag } from "./CinematicText"; +import { generateRandomContract } from "./CodingContractGenerator"; +import { CompanyPositions } from "./Company/CompanyPositions"; +import { initCompanies } from "./Company/Companies"; +import { Corporation } from "./Corporation/Corporation"; +import { CONSTANTS } from "./Constants"; +import { createDevMenu, closeDevMenu } from "./DevMenu"; +import { Factions, initFactions } from "./Faction/Factions"; +import { + displayFactionContent, + joinFaction, + processPassiveFactionRepGain, + inviteToFaction +} from "./Faction/FactionHelpers"; +import { FconfSettings } from "./Fconf/FconfSettings"; +import { + hasHacknetServers, + renderHacknetNodesUI, + clearHacknetNodesUI, + processHacknetEarnings +} from "./Hacknet/HacknetHelpers"; +import { iTutorialStart } from "./InteractiveTutorial"; +import { initLiterature } from "./Literature"; +import { LocationName } from "./Locations/data/LocationNames"; +import { LocationRoot } from "./Locations/ui/Root"; +import { checkForMessagesToSend, initMessages } from "./Message/MessageHelpers"; +import { inMission, currMission } from "./Missions"; +import { + initSingularitySFFlags, + hasSingularitySF, + hasCorporationSF +} from "./NetscriptFunctions"; +import { updateOnlineScriptTimes, runScriptsLoop } from "./NetscriptWorker"; +import { Player } from "./Player"; +import { prestigeAugmentation, prestigeSourceFile } from "./Prestige"; +import { Programs } from "./Programs/Programs"; +import { + displayCreateProgramContent, + getNumAvailableCreateProgram, + initCreateProgramButtons +} from "./Programs/ProgramHelpers"; +import { redPillFlag, hackWorldDaemon } from "./RedPill"; +import { saveObject, loadGame } from "./SaveObject"; +import { + getCurrentEditor, + loadAllRunningScripts, + scriptEditorInit, + updateScriptEditorContent +} from "./Script/ScriptHelpers"; +import { AllServers, initForeignServers } from "./Server/AllServers"; -import { Server } from "./Server/Server"; -import {Settings} from "./Settings/Settings"; -import { initSourceFiles, SourceFiles } from "./SourceFile"; -import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; -import {SpecialServerIps, initSpecialServerIps} from "./Server/SpecialServerIps"; -import {StockMarket, StockSymbols, - SymbolToStockMap, initStockSymbols, - initSymbolToStockMap, stockMarketCycle, - processStockPrices, - displayStockMarketContent} from "./StockMarket/StockMarket"; -import {Terminal, postNetburnerText} from "./Terminal"; +import { Server } from "./Server/Server"; +import { Settings } from "./Settings/Settings"; +import { initSourceFiles, SourceFiles } from "./SourceFile"; +import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; +import { + SpecialServerIps, + initSpecialServerIps +} from "./Server/SpecialServerIps"; +import { + StockMarket, + StockSymbols, + SymbolToStockMap, + initStockSymbols, + initSymbolToStockMap, + stockMarketCycle, + processStockPrices, + displayStockMarketContent +} from "./StockMarket/StockMarket"; +import { Terminal, postNetburnerText } from "./Terminal"; -import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; -import { clearSleevesPage, - createSleevesPage, - updateSleevesPage } from "./PersonObjects/Sleeve/SleeveUI"; -import { clearResleevesPage, - createResleevesPage } from "./PersonObjects/Resleeving/ResleevingUI"; +import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; +import { + clearSleevesPage, + createSleevesPage, + updateSleevesPage +} from "./PersonObjects/Sleeve/SleeveUI"; +import { + clearResleevesPage, + createResleevesPage +} from "./PersonObjects/Resleeving/ResleevingUI"; -import { createStatusText } from "./ui/createStatusText"; -import { displayCharacterInfo } from "./ui/displayCharacterInfo"; -import {Page, routing} from "./ui/navigationTracking"; -import {numeralWrapper} from "./ui/numeralFormat"; -import {setSettingsLabels} from "./ui/setSettingsLabels"; -import { initializeMainMenuHeaders } from "./ui/MainMenu/Headers"; -import { initializeMainMenuLinks, - MainMenuLinks } from "./ui/MainMenu/Links"; +import { createStatusText } from "./ui/createStatusText"; +import { displayCharacterInfo } from "./ui/displayCharacterInfo"; +import { Page, routing } from "./ui/navigationTracking"; +import { numeralWrapper } from "./ui/numeralFormat"; +import { setSettingsLabels } from "./ui/setSettingsLabels"; +import { initializeMainMenuHeaders } from "./ui/MainMenu/Headers"; +import { initializeMainMenuLinks, MainMenuLinks } from "./ui/MainMenu/Links"; +import { dialogBoxCreate } from "../utils/DialogBox"; +import { gameOptionsBoxClose, gameOptionsBoxOpen } from "../utils/GameOptions"; +import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; +import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; +import { createElement } from "../utils/uiHelpers/createElement"; +import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { removeLoadingScreen } from "../utils/uiHelpers/removeLoadingScreen"; +import { KEY } from "../utils/helpers/keyCodes"; -import { dialogBoxCreate} from "../utils/DialogBox"; -import { gameOptionsBoxClose, - gameOptionsBoxOpen } from "../utils/GameOptions"; -import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; -import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { exceptionAlert } from "../utils/helpers/exceptionAlert"; -import { removeLoadingScreen } from "../utils/uiHelpers/removeLoadingScreen"; -import {KEY} from "../utils/helpers/keyCodes"; +import React from "react"; +import ReactDOM from "react-dom"; -import React from "react"; -import ReactDOM from "react-dom"; // These should really be imported with the module that is presenting that UI, but because they very much depend on the // cascade order, we'll pull them all in here.