diff --git a/.browserslistrc b/.browserslistrc index aa6359805..1af9a66cd 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,3 +1,3 @@ -last 4 versions +last 8 versions not dead not ie <= 11 diff --git a/.eslintrc.js b/.eslintrc.js index f76817b2a..da124eaee 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -353,6 +353,7 @@ module.exports = { "no-useless-constructor": [ "off", // Valid for typescript due to property ctor shorthand ], + "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-ignore": "off", "@typescript-eslint/camelcase": "off", diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 000000000..e9a2c3b24 --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,71 @@ +name: CI Pull Request + +on: + # Triggers the workflow on pull request events but only for the dev branch, checking only diffs + pull_request: + branches: [dev] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Build the production app + run: npm run build + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Run linter + run: npm run lint:report-diff + prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Run prettier check + run: npm run format:report-diff + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Run tests + run: npm run test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c714b6b14..5f75d20d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,9 @@ name: CI on: - # Triggers the workflow on push or pull request events but only for the dev branch + # Triggers the workflow on push events but only for the dev branch push: branches: [dev] - pull_request: - branches: [dev] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..1399f2b63 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +# Default "npm version" commit message +# See: https://stackoverflow.com/a/34606092 +message=":bookmark: Build v%s" diff --git a/dist/bitburner.d.ts b/dist/bitburner.d.ts index 2553d10f0..57d578d6a 100644 --- a/dist/bitburner.d.ts +++ b/dist/bitburner.d.ts @@ -3,7 +3,7 @@ */ export declare interface ActiveFragment { id: number; - avgCharge: number; + highestCharge: number; numCharge: number; rotation: number; x: number; @@ -182,7 +182,7 @@ export declare interface BitNodeMultipliers { /** Influences the maximum allowed RAM for a purchased server */ PurchasedServerMaxRam: number; /** Influences cost of any purchased server at or above 128GB */ - PurchasedServerSoftCap: number; + PurchasedServerSoftcap: number; /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */ RepToDonateToFaction: number; /** Influences how much the money on a server can be reduced when a script performs a hack against it. */ @@ -709,10 +709,10 @@ export declare interface CharacterInfo { factions: string[]; /** Current health points */ hp: number; - /** Array of all companies at which you have jobs */ - company: string[]; + /** Array of all jobs */ + jobs: string[]; /** Array of job positions for all companies you are employed at. Same order as 'jobs' */ - jobTitle: string[]; + jobTitles: string[]; /** Maximum health points */ maxHp: number; /** Boolean indicating whether or not you have a tor router */ @@ -737,6 +737,18 @@ export declare interface CharacterInfo { workRepGain: number; /** Money earned so far from work, if applicable */ workMoneyGain: number; + /** total hacking exp */ + hackingExp: number; + /** total strength exp */ + strengthExp: number; + /** total defense exp */ + defenseExp: number; + /** total dexterity exp */ + dexterityExp: number; + /** total agility exp */ + agilityExp: number; + /** total charisma exp */ + charismaExp: number; } /** @@ -747,6 +759,10 @@ export declare interface CharacterMult { agility: number; /** Agility exp */ agilityExp: number; + /** Charisma stat */ + charisma: number; + /** Charisma exp */ + charismaExp: number; /** Company reputation */ companyRep: number; /** Money earned from crimes */ @@ -1177,6 +1193,8 @@ export declare type FilenameOrPID = number | string; * @public */ export declare interface Formulas { + /** Reputation formulas */ + reputation: ReputationFormulas; /** Skills formulas */ skills: SkillsFormulas; /** Hacking formulas */ @@ -2101,7 +2119,7 @@ export declare interface Hacknet { * // NS1: * var upgradeName = "Sell for Corporation Funds"; * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) { - * hacknet.spendHashes(upgName); + * hacknet.spendHashes(upgradeName); * } * ``` * @example @@ -2109,7 +2127,7 @@ export declare interface Hacknet { * // NS2: * const upgradeName = "Sell for Corporation Funds"; * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) { - * ns.hacknet.spendHashes(upgName); + * ns.hacknet.spendHashes(upgradeName); * } * ``` * @param upgName - Name of the upgrade of Hacknet Node. @@ -2442,6 +2460,10 @@ export declare interface Material { qty: number; /** Quality of the material */ qlt: number; + /** Demand for the material, only present if "Market Research - Demand" unlocked */ + dmd: number | undefined; + /** Competition for the material, only present if "Market Research - Competition" unlocked */ + cmp: number | undefined; /** Amount of material produced */ prod: number; /** Amount of material sold */ @@ -2574,7 +2596,7 @@ export declare interface NodeStats { * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs} *