From a3c92dd04d5acf3167c6762951b067689b285cbe Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Fri, 23 Sep 2022 15:00:20 -0400 Subject: [PATCH] Wrap up v2.1.0 --- doc/source/changelog.rst | 182 +++++++++++++++++ src/Augmentation/data/AugmentationCreator.tsx | 25 +-- src/Augmentation/data/AugmentationNames.ts | 2 +- src/Constants.ts | 187 +++++++++++++++++- src/CotMG/StaneksGift.ts | 11 +- src/PersonObjects/Sleeve/SleeveHelpers.ts | 7 +- tools/fetch-changelog/index.js | 96 +++++---- 7 files changed, 429 insertions(+), 81 deletions(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index fb78a5b00..625b9692a 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -3,6 +3,188 @@ Changelog ========= +v2.1.0 - 2022-09-23 Remote File API +----------------------------------- + + Dev notes + * The most important change about this update is the introduction of the remote file api. + With this we also deprecate the HTTP file api and the visual studio extension. Those things + were made during the rush of Steam and aren't well thought out. This new process works with + both the web and Steam version of the game and every text editor. Moving forward we also + won't be doing much, if any, upgrades to the in-game editor. We think it's good enough for + now and if you need more we recommend you hook up your favorite external editor. + * Added functions to resize, move, and close tail windows + * Added a new Augmentation, Z.O.Ë., which allows Sleeves to benefit from Stanek. + + API + * Remove incorrectly placed 's' in ns.tFormat() (by @LJNeon) + * More ports (previously max 20, now practically unlimited) (by @Hoekstraa) + * Corp functions now return copy of constant arrays instead of the original (by @Mughur) + * All the player sub-objects need to be copied for `getPlayer`. (by @MageKing17) + * add corp get functions, UI (by @Mughur) + * FIX #3860 destroyW0r1dD43m0n now properly gives achievements and FIX #3890 favor now properly syncs across pages and the Donate achievement is now given correctly (by @Aerophia) + + CONTRIBUTIONS + * Modify PR template (by @Hoekstraa) + + CCT + * inconsistent probability for generation between online and offline (by @quacksouls) + + DOC + * Some typo fixes in Netscript functions (by @quacksouls) + * Fix #4033 Why use Coding Contract API (by @quacksouls) + * typo fix in description of Caesar cipher (by @quacksouls) + * FIX DOCS TYPO IN terminal.rst (by @BugiDev) + * Update bitburner.sleeve.settobladeburneraction.md (by @borisflagell) + + CORPORATION + * FIX #3880, #3876, #3322 and #3138 Bunch of corporation fixes (by @Mughur) + * Gave investors some economics classes (by @Mughur) + * Limit shareholder priority on newly issued shares (by @Undeemiss) + + UI + * FIX #2962 Add a setting to display middle time unit in Time Elapsed String (by @hydroflame) + * FIX #4106 Fix incorrect experience display in Crime UI. (by @SilverNexus) + * Bitnode stats now show if BB/Corporation are disabled (by @Kelenius) + * Removed three empty lines from BB status screen (by @Kelenius) + * Add missing space to BN7 description (by @hex7cd) + * Improvements to crime work UI (by @Kelenius) + * FIX #3975, #3882 Script Editor more responsive on resize, and fix dirty file indicator (by @Snarling) + + API FIX + * getCrimeStats use bitnode multipliers in the output of crime stats (by @phyzical) + + SLEEVES + * FIX #3819 Allow using the regeneration chamber with sleeves to heal them. (by @coderanger) + * FIX #4063 fix crash when player tries to assign more than 3 sleeves to Bladeburner contracts (by @Snarling) + * FIX #4051 Sleeves no longer crash when player quits company sleeve was working (by @Snarling) + + API BACKUP + * add singularity function for exporting game save back (by @phyzical) + + CORPORATION API + * FIX #3655 Expose exports from Material (by @Rasmoh) + + SCRIPTS + * FIX #4081 Rerunning a script from tail window recalculates ram usage (by @Snarling) + * FIX #3962 The correct script will be closed even if the player modifies args (v2.0) (by @Snarling) + + DOCUMENTATION + * Fixed Argument order for scp() (by @njalooo) + + CORP API + * Fix up param order for limitProductProduction to match docs (by @phyzical) + + NETSCRIPT + * FIX #2376 ns.exit now exits immediately (by @Snarling) + * FIX #4055 Fix dynamic ram check (by @Snarling) + * FIX #4037 ns1 wraps deeper layers correctly. (by @Snarling) + * FIX #3963 Prevent bladeburner.setActionLevel from setting invalid action levels (by @MPJ-K) + * Typo fixes in CodingContract, Hacknet, Singularity APIs (by @quacksouls) + * Fix a typo in doc of Singularity.travelToCity() (by @quacksouls) + * Update netscript definition file for scp, write, read, and flags (by @Snarling) + * Correct missing ! for boolean coercion in Corporation.createCorporation(). (by @Risenafis) + * Normalized Stock API logging (by @Snarling) + * fix #3992 allow null duration in toast ns function (by @RollerKnobster) + * Correct missing `!` for boolean coercion in `singularity.workForCompany()`. (by @MageKing17) + * ns.scp and ns.write are now synchronous + fix exec race condition (by @Snarling) + * FIX #2931 atExit now allows synchronous ns functions (by @Snarling) + * Improve real life CPU and memory performance of scripts. (by @Snarling) + + INFILTRATION + * Corrected ns formula for infiltration rewards (by @ezylot) + + RFA + * NetscriptDefinitions retains export strings (by @Hoekstraa) + * Fix type of RFAMessages with non-String results (by @Hoekstraa) + * New Remote File API addition for transmitting files to the game (by @Hoekstraa) + + SLEEVE + * FIX #4022, #4024, #4025, #3998 (by @Mughur) + + DOCS, UI + * update docs a bit more, amending some BN and SF texts (by @Mughur) + + GANG + * Added weight to GangMemberTask construction call (by @ezylot) + + Coding Contracts + * Don't stringify answer if already a string (by @alainbryden) + + TERMINAL + * Fix ansi display bugs (by @Snarling) + + SCRIPT EDITOR + * Debounce updateRAM calls. (by @Snarling) + + WORK + * Add singularity check for finishing company work (by @Snarling) + + DOCS + * Correct documentation for `run()` with 0 threads. (by @MageKing17) + * Some doc updates (by @Mughur) + + FILES + * FIX #3979 Allow characters & and ' in filenames (by @Snarling) + + CORP FIX + * dont take research points for something already researched via api (by @phyzical) + + FIX + * Prompt Add user friendly message to avoid throwing recovery screen for invalid choices (by @phyzical) + + TUTORIAL + * Fix #3965 Corrected tutorial text (by @mihilt) + + CONTRACTS + * FIX #3755 change input handling for contract attempts (by @Snarling) + + HOTFIX + * Fix infil definitions.d.ts (by @phyzical) + + MISC + * crime gains, sleeve gang augs and faq (by @Mughur) + * FIX #3649 Preventing server starting security level from going above 100 (by @Shiiyu) + * Adds Shadows of Anarchy (by @Lagicrus) + * Added intormation about hacking managers to hacking algorithms page (by @Kelenius) + * Fix Jest CI Error (by @geggleto) + * multiple hasAugmentation checks didn't check if the augment was installed (by @Mughur) + * Fix for #2442 and #2795. (by @G4mingJon4s) + * Adds info regarding augments and focus (by @Lagicrus) + * Removed console.log line (by @dhosborne) + * Update some doc (by @hydroflame) + * Sleeve crime gain bitnode multiplier fix (by @Mughur) + * trying to fix int problems (by @hydroflame) + * Fix broken ns filesnames (by @hydroflame) + * new formula functions (by @hydroflame) + * v2.0.0 (by @hydroflame) + * test fixes/md updates (by @phyzical) + * Remove "based" from positive adjectives in infil (by @faangbait) + * minor fix in instance calculation (by @hydroflame) + * fix dynamic ram miscalc not triggering (by @hydroflame) + * Refactor game options into separate components (by @hydroflame) + * fix documentation for remote api (by @hydroflame) + * fix settings unfocusing on every key stroke (by @hydroflame) + * fix some stuff with the timestamp settings (by @hydroflame) + * fix some stuff with the timestamp settings (by @hydroflame) + * Fix unique key problem with ascii elements (by @hydroflame) + * Improve wrong arg user message and add ui.windowSize (by @hydroflame) + * fix stack trace missing in some errors (by @hydroflame) + * Fix scp and write in ns1 (by @hydroflame) + * Did some changes of the remote api and added documentation (by @hydroflame) + * Add dummy function to generate a mock server or player for formulas stuff (by @hydroflame) + * fix compile error (by @hydroflame) + * regen doc (by @hydroflame) + * rm console log (by @hydroflame) + * regen doc (by @hydroflame) + * Added more info about blood program, change some aug descriptions (by @hydroflame) + * use triple equal (by @hydroflame) + * Minor improvements to Netscript Port loading and unloading (by @hydroflame) + * Fix hostname generation being weird about dash 0 added (by @hydroflame) + * upgrade version number. (by @hydroflame) + * Nerf Noodle bar + + v2.0.0 - 2022-07-19 Work rework ------------------------------- diff --git a/src/Augmentation/data/AugmentationCreator.tsx b/src/Augmentation/data/AugmentationCreator.tsx index 19a086fc5..b34f48eb5 100644 --- a/src/Augmentation/data/AugmentationCreator.tsx +++ b/src/Augmentation/data/AugmentationCreator.tsx @@ -1661,17 +1661,20 @@ export const initGeneralAugmentations = (): Augmentation[] => [ }), // Sleeve exclusive augmentations - // new Augmentation({ - // name: AugmentationNames.UnnamedAug1, - // isSpecial: true, - // repCost: Infinity, - // moneyCost: 1e12, - // info: "This augmentation is exclusive to sleeves.", - // stats: <>Allows sleeves to benefit from Stanek's Gift but it is less powerful if several are installed., - // factions: [ - // /*Technically in FactionNames.ChurchOfTheMachineGod but not really for display reasons */ - // ], - // }), + new Augmentation({ + name: AugmentationNames.ZOE, + isSpecial: true, + repCost: Infinity, + moneyCost: 1e12, + info: + "Zoë's Omnicerebrum Ënhancer for sleeves inserts an omnicerebrum into your sleeve. " + + "An omnicerebrum is a near perfect simulation of the human brain, allowing it to take advantage of a larger variety of augments. " + + "But you should know about this BitRunner, since you have one of these yourself!", + stats: <>Allows sleeves to benefit from Stanek's Gift but it is less powerful if several are installed., + factions: [ + /*Technically in FactionNames.ChurchOfTheMachineGod but not really for display reasons */ + ], + }), ]; export const initBladeburnerAugmentations = (): Augmentation[] => [ diff --git a/src/Augmentation/data/AugmentationNames.ts b/src/Augmentation/data/AugmentationNames.ts index 642a29128..37a6c1cee 100644 --- a/src/Augmentation/data/AugmentationNames.ts +++ b/src/Augmentation/data/AugmentationNames.ts @@ -93,7 +93,7 @@ export enum AugmentationNames { CongruityImplant = "nickofolas Congruity Implant", HydroflameLeftArm = "Hydroflame Left Arm", BigDsBigBrain = "BigD's Big ... Brain", - UnnamedAug1 = "UnnamedAug1", + ZOE = "Z.O.Ë.", UnnamedAug2 = "UnnamedAug2", // Bladeburner augs diff --git a/src/Constants.ts b/src/Constants.ts index a3403227d..329d838ca 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -232,11 +232,186 @@ export const CONSTANTS: { Donations: 30, LatestUpdate: ` -v2.1.0 - 2022-08-23 -------------------- - - * pending - * nerf noodle bar - + v2.1.0 - 2022-09-23 Remote File API + ----------------------------------- + + Dev notes + * The most important change about this update is the introduction of the remote file api. + With this we also deprecate the HTTP file api and the visual studio extension. Those things + were made during the rush of Steam and aren't well thought out. This new process works with + both the web and Steam version of the game and every text editor. Moving forward we also + won't be doing much, if any, upgrades to the in-game editor. We think it's good enough for + now and if you need more we recommend you hook up your favorite external editor. + * Added functions to resize, move, and close tail windows + * Added a new Augmentation, Z.O.Ë., which allows Sleeves to benefit from Stanek. + + API + * Remove incorrectly placed 's' in ns.tFormat() (by @LJNeon) + * More ports (previously max 20, now practically unlimited) (by @Hoekstraa) + * Corp functions now return copy of constant arrays instead of the original (by @Mughur) + * All the player sub-objects need to be copied for 'getPlayer'. (by @MageKing17) + * add corp get functions, UI (by @Mughur) + * FIX #3860 destroyW0r1dD43m0n now properly gives achievements and FIX #3890 favor now properly syncs across pages and the Donate achievement is now given correctly (by @Aerophia) + + CONTRIBUTIONS + * Modify PR template (by @Hoekstraa) + + CCT + * inconsistent probability for generation between online and offline (by @quacksouls) + + DOC + * Some typo fixes in Netscript functions (by @quacksouls) + * Fix #4033 Why use Coding Contract API (by @quacksouls) + * typo fix in description of Caesar cipher (by @quacksouls) + * FIX DOCS TYPO IN terminal.rst (by @BugiDev) + * Update bitburner.sleeve.settobladeburneraction.md (by @borisflagell) + + CORPORATION + * FIX #3880, #3876, #3322 and #3138 Bunch of corporation fixes (by @Mughur) + * Gave investors some economics classes (by @Mughur) + * Limit shareholder priority on newly issued shares (by @Undeemiss) + + UI + * FIX #2962 Add a setting to display middle time unit in Time Elapsed String (by @hydroflame) + * FIX #4106 Fix incorrect experience display in Crime UI. (by @SilverNexus) + * Bitnode stats now show if BB/Corporation are disabled (by @Kelenius) + * Removed three empty lines from BB status screen (by @Kelenius) + * Add missing space to BN7 description (by @hex7cd) + * Improvements to crime work UI (by @Kelenius) + * FIX #3975, #3882 Script Editor more responsive on resize, and fix dirty file indicator (by @Snarling) + + API FIX + * getCrimeStats use bitnode multipliers in the output of crime stats (by @phyzical) + + SLEEVES + * FIX #3819 Allow using the regeneration chamber with sleeves to heal them. (by @coderanger) + * FIX #4063 fix crash when player tries to assign more than 3 sleeves to Bladeburner contracts (by @Snarling) + * FIX #4051 Sleeves no longer crash when player quits company sleeve was working (by @Snarling) + + API BACKUP + * add singularity function for exporting game save back (by @phyzical) + + CORPORATION API + * FIX #3655 Expose exports from Material (by @Rasmoh) + + SCRIPTS + * FIX #4081 Rerunning a script from tail window recalculates ram usage (by @Snarling) + * FIX #3962 The correct script will be closed even if the player modifies args (v2.0) (by @Snarling) + + DOCUMENTATION + * Fixed Argument order for scp() (by @njalooo) + + CORP API + * Fix up param order for limitProductProduction to match docs (by @phyzical) + + NETSCRIPT + * FIX #2376 ns.exit now exits immediately (by @Snarling) + * FIX #4055 Fix dynamic ram check (by @Snarling) + * FIX #4037 ns1 wraps deeper layers correctly. (by @Snarling) + * FIX #3963 Prevent bladeburner.setActionLevel from setting invalid action levels (by @MPJ-K) + * Typo fixes in CodingContract, Hacknet, Singularity APIs (by @quacksouls) + * Fix a typo in doc of Singularity.travelToCity() (by @quacksouls) + * Update netscript definition file for scp, write, read, and flags (by @Snarling) + * Correct missing ! for boolean coercion in Corporation.createCorporation(). (by @Risenafis) + * Normalized Stock API logging (by @Snarling) + * fix #3992 allow null duration in toast ns function (by @RollerKnobster) + * Correct missing '!' for boolean coercion in 'singularity.workForCompany()'. (by @MageKing17) + * ns.scp and ns.write are now synchronous + fix exec race condition (by @Snarling) + * FIX #2931 atExit now allows synchronous ns functions (by @Snarling) + * Improve real life CPU and memory performance of scripts. (by @Snarling) + + INFILTRATION + * Corrected ns formula for infiltration rewards (by @ezylot) + + RFA + * NetscriptDefinitions retains export strings (by @Hoekstraa) + * Fix type of RFAMessages with non-String results (by @Hoekstraa) + * New Remote File API addition for transmitting files to the game (by @Hoekstraa) + + SLEEVE + * FIX #4022, #4024, #4025, #3998 (by @Mughur) + + DOCS, UI + * update docs a bit more, amending some BN and SF texts (by @Mughur) + + GANG + * Added weight to GangMemberTask construction call (by @ezylot) + + Coding Contracts + * Don't stringify answer if already a string (by @alainbryden) + + TERMINAL + * Fix ansi display bugs (by @Snarling) + + SCRIPT EDITOR + * Debounce updateRAM calls. (by @Snarling) + + WORK + * Add singularity check for finishing company work (by @Snarling) + + DOCS + * Correct documentation for 'run()' with 0 threads. (by @MageKing17) + * Some doc updates (by @Mughur) + + FILES + * FIX #3979 Allow characters & and ' in filenames (by @Snarling) + + CORP FIX + * dont take research points for something already researched via api (by @phyzical) + + FIX + * Prompt Add user friendly message to avoid throwing recovery screen for invalid choices (by @phyzical) + + TUTORIAL + * Fix #3965 Corrected tutorial text (by @mihilt) + + CONTRACTS + * FIX #3755 change input handling for contract attempts (by @Snarling) + + HOTFIX + * Fix infil definitions.d.ts (by @phyzical) + + MISC + * crime gains, sleeve gang augs and faq (by @Mughur) + * FIX #3649 Preventing server starting security level from going above 100 (by @Shiiyu) + * Adds Shadows of Anarchy (by @Lagicrus) + * Added intormation about hacking managers to hacking algorithms page (by @Kelenius) + * Fix Jest CI Error (by @geggleto) + * multiple hasAugmentation checks didn't check if the augment was installed (by @Mughur) + * Fix for #2442 and #2795. (by @G4mingJon4s) + * Adds info regarding augments and focus (by @Lagicrus) + * Removed console.log line (by @dhosborne) + * Update some doc (by @hydroflame) + * Sleeve crime gain bitnode multiplier fix (by @Mughur) + * trying to fix int problems (by @hydroflame) + * Fix broken ns filesnames (by @hydroflame) + * new formula functions (by @hydroflame) + * v2.0.0 (by @hydroflame) + * test fixes/md updates (by @phyzical) + * Remove "based" from positive adjectives in infil (by @faangbait) + * minor fix in instance calculation (by @hydroflame) + * fix dynamic ram miscalc not triggering (by @hydroflame) + * Refactor game options into separate components (by @hydroflame) + * fix documentation for remote api (by @hydroflame) + * fix settings unfocusing on every key stroke (by @hydroflame) + * fix some stuff with the timestamp settings (by @hydroflame) + * fix some stuff with the timestamp settings (by @hydroflame) + * Fix unique key problem with ascii elements (by @hydroflame) + * Improve wrong arg user message and add ui.windowSize (by @hydroflame) + * fix stack trace missing in some errors (by @hydroflame) + * Fix scp and write in ns1 (by @hydroflame) + * Did some changes of the remote api and added documentation (by @hydroflame) + * Add dummy function to generate a mock server or player for formulas stuff (by @hydroflame) + * fix compile error (by @hydroflame) + * regen doc (by @hydroflame) + * rm console log (by @hydroflame) + * regen doc (by @hydroflame) + * Added more info about blood program, change some aug descriptions (by @hydroflame) + * use triple equal (by @hydroflame) + * Minor improvements to Netscript Port loading and unloading (by @hydroflame) + * Fix hostname generation being weird about dash 0 added (by @hydroflame) + * upgrade version number. (by @hydroflame) + * Nerf Noodle bar + `, }; diff --git a/src/CotMG/StaneksGift.ts b/src/CotMG/StaneksGift.ts index 0d2917433..81425ed1f 100644 --- a/src/CotMG/StaneksGift.ts +++ b/src/CotMG/StaneksGift.ts @@ -217,16 +217,13 @@ export class StaneksGift implements IStaneksGift { const mults = this.calculateMults(); p.mults = mergeMultipliers(p.mults, mults); p.updateSkillLevels(); - const unnamedAug1Amt = p.sleeves.reduce( - (n, sleeve) => n + (sleeve.hasAugmentation(AugmentationNames.UnnamedAug1) ? 1 : 0), - 0, - ); - if (unnamedAug1Amt === 0) return; + const zoeAmt = p.sleeves.reduce((n, sleeve) => n + (sleeve.hasAugmentation(AugmentationNames.ZOE) ? 1 : 0), 0); + if (zoeAmt === 0) return; // Less powerful for each copy. - const scaling = 3 / (unnamedAug1Amt + 2); + const scaling = 3 / (zoeAmt + 2); const sleeveMults = scaleMultipliers(mults, scaling); for (const sleeve of p.sleeves) { - if (!sleeve.hasAugmentation(AugmentationNames.UnnamedAug1)) continue; + if (!sleeve.hasAugmentation(AugmentationNames.ZOE)) continue; sleeve.resetMultipliers(); sleeve.mults = mergeMultipliers(sleeve.mults, sleeveMults); sleeve.updateStatLevels(); diff --git a/src/PersonObjects/Sleeve/SleeveHelpers.ts b/src/PersonObjects/Sleeve/SleeveHelpers.ts index 8bdf95fcc..3aa4aefc8 100644 --- a/src/PersonObjects/Sleeve/SleeveHelpers.ts +++ b/src/PersonObjects/Sleeve/SleeveHelpers.ts @@ -86,11 +86,8 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat } // Add the stanek sleeve aug - if ( - !ownedAugNames.includes(AugmentationNames.UnnamedAug1) && - p.factions.includes(FactionNames.ChurchOfTheMachineGod) - ) { - const aug = StaticAugmentations[AugmentationNames.UnnamedAug1]; + if (!ownedAugNames.includes(AugmentationNames.ZOE) && p.factions.includes(FactionNames.ChurchOfTheMachineGod)) { + const aug = StaticAugmentations[AugmentationNames.ZOE]; availableAugs.push(aug); } diff --git a/tools/fetch-changelog/index.js b/tools/fetch-changelog/index.js index fb6c31353..8858cb372 100644 --- a/tools/fetch-changelog/index.js +++ b/tools/fetch-changelog/index.js @@ -4,12 +4,10 @@ import commandLineArgs from "command-line-args"; const owner = "danielyxie"; const repo = "bitburner"; -const basePath = `https://github.com/${owner}/${repo}`; const cliArgs = commandLineArgs([ { name: "from", alias: "f", type: String }, { name: "to", alias: "t", type: String }, - { name: "detailed", alias: "d", type: Boolean }, ]); class MergeChangelog { @@ -176,65 +174,57 @@ class MergeChangelog { return response.data.commit.sha; } - async getChangelog(from, to, detailedOutput) { + async getChangelog(from, to) { const changes = await this.getPullsMergedBetween(from, to); - const pullLines = changes.pulls.map((line) => this.getPullMarkdown(line, detailedOutput)); - const commitLines = changes.danglingCommits.map((line) => this.getCommitMarkdown(line, detailedOutput)); - commitLines.push(`* Nerf noodle bar.`); - const shortFrom = changes.from.date.toISOString().split("T")[0]; - const shortTo = changes.to.date.toISOString().split("T")[0]; - const shortFromSha = changes.from.commit.sha.slice(0, 7); - const shortToSha = changes.to.commit.sha.slice(0, 7); - const title = `## [draft] v1.x.x - ${shortFrom} to ${shortTo}`; - let log = ` -${title} + const pullLines = changes.pulls + .map((line) => this.getPullMarkdown(line)) + .concat(changes.danglingCommits.map((line) => this.getCommitMarkdown(line))); + pullLines.push({ category: "MISC", title: "Nerf Noodle bar" }); + const title = `v2.x.x - ${new Date().toISOString().slice(0, 10)} TITLE\n\n`; + const map = {}; + pullLines.forEach((c) => { + if (c.title.includes("allbuild commit")) return; + let array = map[c.category]; + if (!array) { + array = []; + map[c.category] = array; + } + array.push(c); + }); -#### Information + let log = title; + Object.entries(map).forEach(([key, value]) => { + log += ` ${key}\n`; + value.forEach((v) => (log += ` * ${v.title} ${v.by ? `(by @${v.by})` : ""}\n`)); + log += "\n"; + }); -Modifications included between **${shortFrom}** and **${shortTo}** (\`${shortFromSha}\` to \`${shortToSha}\`). - -*[See Pull Requests on GitHub](https://github.com/search?q=${encodeURIComponent(changes.pullQuery)})* - -#### Merged Pull Requests - -${pullLines.join("\n")} - -`; - - if (commitLines.length > 0) { - log += ` -#### Other Changes - -${commitLines.join("\n")} -`; - } return { - log: log.trim(), + log: log, changes: changes, }; } - getPullMarkdown(pr, detailedOutput) { - if (!detailedOutput) { - return `* ${pr.title} (by @${pr.user.login}) #[${pr.number}](${pr.url})`; - } else { - return ( - `* [${pr.merge_commit_sha.slice(0, 7)}](${basePath}/commit/${pr.merge_commit_sha}) | ` + - `${pr.title} ([@${pr.user.login}](${pr.user.url}))` + - ` PR #[${pr.number}](${pr.url})` - ); + getPullMarkdown(pr) { + let category = "MISC"; + let title = pr.title; + if (pr.title.includes(":")) { + category = pr.title.split(":")[0]; + title = pr.title.split(":")[1]; } + return { + category: category, + title: title, + by: pr.user.login, + }; } - getCommitMarkdown(commit, detailedOutput) { - if (!detailedOutput) { - return `* ${commit.message} (by @${commit.user.login}) - [${commit.sha.slice(0, 7)}](${commit.url})`; - } else { - return ( - `* [${commit.sha.slice(0, 7)}](${commit.url}) | ` + - `${commit.message} ([@${commit.user.login}](${commit.user.url}))` - ); - } + getCommitMarkdown(commit) { + return { + category: "MISC", + title: commit.message, + by: commit.user.login, + }; } } @@ -245,6 +235,10 @@ const sleep = async (wait) => { }; const api = new MergeChangelog({ auth: process.env.GITHUB_API_TOKEN }); -api.getChangelog(cliArgs.from, cliArgs.to, cliArgs.detailed).then((data) => { +if (!cliArgs.from || !cliArgs.to) { + console.error("USAGE: node index.js --from hash --to hash"); + process.exit(); +} +api.getChangelog(cliArgs.from, cliArgs.to).then((data) => { console.log(data.log); });