Skip to content

Commit 22dee96

Browse files
committed
Updated dist files.
1 parent 0c614b7 commit 22dee96

21 files changed

+316
-172
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Changelog
33

44
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
55

6+
ethers/v5.0.15 (2020-09-26 03:22)
7+
---------------------------------
8+
9+
- Add more accurate intrinsic gas cost to ABI calls with specified gas property. ([#1058](https://github.com/ethers-io/ethers.js/issues/1058); [f0a5869](https://github.com/ethers-io/ethers.js/commit/f0a5869c53475e55a5f47d8651f609fff45dc9a7))
10+
- Better errors for unconfigured ENS names. ([#1066](https://github.com/ethers-io/ethers.js/issues/1066); [5cd1668](https://github.com/ethers-io/ethers.js/commit/5cd1668e0d29099c5b7ce1fdc1d0e8a41af1a249))
11+
- Updated CLI solc to versin 0.7.1. ([4306b35](https://github.com/ethers-io/ethers.js/commit/4306b3563a171baa9d7bf4872475a13c3434f834))
12+
613
ethers/v5.0.14 (2020-09-16 02:39)
714
---------------------------------
815

@@ -122,4 +129,3 @@ ethers/v5.0.0 (2020-06-12 19:58)
122129

123130
- Preserve config canary string. ([7157816](https://github.com/ethers-io/ethers.js/commit/7157816fa53f660d750811b293e3b1d5a2f70bd4))
124131
- Updated docs. ([9e4c7e6](https://github.com/ethers-io/ethers.js/commit/9e4c7e609d9eeb5f2a11d6a90bfa9d32ee696431))
125-

misc/admin/lib/changelog.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare function generate(): Promise<void>;
1+
export declare function generate(): Promise<string>;

misc/admin/lib/changelog.js

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,83 @@ const local = __importStar(require("./local"));
2424
const log_1 = require("./log");
2525
const npm = __importStar(require("./npm"));
2626
const path_1 = require("./path");
27+
const run_1 = require("./run");
2728
const utils_1 = require("./utils");
2829
const changelogPath = path_1.resolve("CHANGELOG.md");
2930
function generate() {
3031
return __awaiter(this, void 0, void 0, function* () {
3132
const lines = fs_1.default.readFileSync(changelogPath).toString().trim().split("\n");
32-
const versions = Object.keys(lines.reduce((accum, line) => {
33+
let firstLine = null;
34+
const versions = Object.keys(lines.reduce((accum, line, index) => {
3335
const match = line.match(/^ethers\/v([^ ]*)/);
3436
if (match) {
37+
if (firstLine == null) {
38+
firstLine = index;
39+
}
3540
accum[match[1]] = true;
3641
}
3742
return accum;
3843
}, {}));
3944
const version = local.getPackage("ethers").version;
4045
;
41-
const publishedVersion = (yield npm.getPackage("ethers")).version;
42-
console.log(versions, version, publishedVersion);
46+
const published = yield npm.getPackage("ethers");
4347
if (versions.indexOf(version) >= 0) {
4448
const line = `Version ${version} already in CHANGELOG. Please edit before committing.`;
4549
console.log(log_1.colorify.red(utils_1.repeat("=", line.length)));
4650
console.log(log_1.colorify.red(line));
4751
console.log(log_1.colorify.red(utils_1.repeat("=", line.length)));
4852
}
53+
const gitResult = yield run_1.run("git", ["log", (published.gitHead + "..")]);
54+
if (!gitResult.ok) {
55+
console.log(gitResult);
56+
throw new Error("Error running git log");
57+
}
58+
let changes = [];
59+
gitResult.stdout.split("\n").forEach((line) => {
60+
if (line.toLowerCase().substring(0, 6) === "commit") {
61+
changes.push({
62+
commit: line.substring(6).trim(),
63+
date: null,
64+
body: ""
65+
});
66+
}
67+
else if (line.toLowerCase().substring(0, 5) === "date:") {
68+
changes[changes.length - 1].date = utils_1.getDateTime(new Date(line.substring(5).trim()));
69+
}
70+
else if (line.substring(0, 1) === " ") {
71+
line = line.trim();
72+
if (line === "") {
73+
return;
74+
}
75+
changes[changes.length - 1].body += line + " ";
76+
}
77+
});
78+
const output = [];
79+
for (let i = 0; i < firstLine; i++) {
80+
output.push(lines[i]);
81+
}
82+
const newTitle = `ethers/v${version} (${utils_1.getDateTime(new Date())})`;
83+
output.push(newTitle);
84+
output.push(utils_1.repeat("-", newTitle.length));
85+
output.push("");
86+
changes.forEach((change) => {
87+
let body = change.body.trim();
88+
let linkMatch = body.match(/(\((.*#.*)\))/);
89+
let commit = `[${change.commit.substring(0, 7)}](https://github.com/ethers-io/ethers.js/commit/${change.commit})`;
90+
let link = commit;
91+
if (linkMatch) {
92+
body = body.replace(/ *(\(.*#.*)\) */, "");
93+
link = linkMatch[2].replace(/#([0-9]+)/g, (all, issue) => {
94+
return `[#${issue}](https://github.com/ethers-io/ethers.js/issues/${issue})`;
95+
}) + "; " + commit;
96+
}
97+
output.push(` - ${body} (${link})`);
98+
});
99+
output.push("");
100+
for (let i = firstLine; i < lines.length; i++) {
101+
output.push(lines[i]);
102+
}
103+
return output.join("\n");
49104
});
50105
}
51106
exports.generate = generate;
52-
(function () {
53-
return __awaiter(this, void 0, void 0, function* () {
54-
yield generate();
55-
});
56-
})();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importDefault = (this && this.__importDefault) || function (mod) {
12+
return (mod && mod.__esModule) ? mod : { "default": mod };
13+
};
14+
Object.defineProperty(exports, "__esModule", { value: true });
15+
const fs_1 = __importDefault(require("fs"));
16+
const changelog_1 = require("../changelog");
17+
const log_1 = require("../log");
18+
const path_1 = require("../path");
19+
(function () {
20+
return __awaiter(this, void 0, void 0, function* () {
21+
console.log(log_1.colorify.bold("Updating CHANGELOG.md..."));
22+
fs_1.default.writeFileSync(path_1.resolve("CHANGELOG.md"), yield changelog_1.generate());
23+
});
24+
})();

misc/admin/lib/utils.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export declare function loadJson(path: string): any;
77
export declare function saveJson(filename: string, data: any, sort?: boolean): any;
88
export declare function resolveProperties(props: Record<string, Promise<any>>): Promise<Record<string, any>>;
99
export declare function mkdir(path: string): void;
10+
export declare function getDateTime(date: Date): string;

misc/admin/lib/utils.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,24 @@ function mkdir(path) {
102102
}
103103
}
104104
exports.mkdir = mkdir;
105+
function zpad(value, length) {
106+
if (length == null) {
107+
length = 2;
108+
}
109+
const str = String(value);
110+
return repeat("0", length - str.length) + str;
111+
}
112+
function getDate(date) {
113+
return [
114+
date.getFullYear(),
115+
zpad(date.getMonth() + 1),
116+
zpad(date.getDate())
117+
].join("-");
118+
}
119+
function getDateTime(date) {
120+
return getDate(date) + " " + [
121+
zpad(date.getHours()),
122+
zpad(date.getMinutes() + 1)
123+
].join(":");
124+
}
125+
exports.getDateTime = getDateTime;

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"build-dist": "node ./misc/admin/lib/cmds/npm-skip-node8.js || npm run _build-dist",
4040
"build-libs": "node ./misc/admin/lib/cmds/update-exports.js && npm run _build-cjs && npm run _build-esm && node ./misc/admin/lib/cmds/set-build-option cjs && node packages/asm/generate.js && chmod 755 packages/*/lib/bin/*.js",
4141
"build-all": "npm run build-libs && npm run build-dist",
42-
"update-versions": "npm run clean && npm install && npm run spell-check && npm run build-all && node ./misc/admin/lib/cmds/bump-versions && npm run build-all && node ./misc/admin/lib/cmds/update-hashes",
42+
"update-versions": "npm run clean && npm install && npm run spell-check && npm run build-all && node ./misc/admin/lib/cmds/bump-versions && npm run build-all && node ./misc/admin/lib/cmds/update-hashes && node ./misc/admin/lib/cmds/update-changelog",
4343
"TODO-publish-all": "node ./admin/cmds/publish",
4444
"TODO-sync-github": "node ./admin/cmds/cache-github"
4545
},

packages/contracts/lib.esm/index.js

Lines changed: 43 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)