Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
fix(monorepo-scripts): Format date as UTC not local time.
Browse files Browse the repository at this point in the history
Down under is in the future and causes many conflicts when formatting the timestamp in the local context. All previous releases jumped a day ahead. By setting this to UTC we will have consistent formatted dates in the changelogs no matter where one publishes from.

npm-cli-login fails on node 10 as a deprecation in node 9 has finished. This package appears to be unmaintained so we now have a fork with a fix
  • Loading branch information
dekz committed Oct 17, 2018
1 parent 72f5719 commit 0013baf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"coveralls": "^3.0.0",
"ganache-cli": "6.1.8",
"lcov-result-merger": "^3.0.0",
"npm-cli-login": "^0.0.10",
"@0xproject/npm-cli-login": "^0.0.11",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"source-map-support": "^0.5.6",
Expand Down
9 changes: 9 additions & 0 deletions packages/monorepo-scripts/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "1.0.6",
"changes": [
{
"note": "Render date formats in UTC to prevent conflicts when publishing in different timezones.",
"pr": 1143
}
]
},
{
"timestamp": 1534210131,
"version": "1.0.5",
Expand Down
3 changes: 2 additions & 1 deletion packages/monorepo-scripts/src/utils/changelog_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ CHANGELOG

export const changelogUtils = {
getChangelogMdTitle(versionChangelog: VersionChangelog): string {
const date = moment(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
// Use UTC rather than the local machines time (formatted date time is +0:00)
const date = moment.utc(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
const title = `\n## v${versionChangelog.version} - _${date}_\n\n`;
return title;
},
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@
jsonschema "1.2.2"
lodash.values "4.3.0"

"@0xproject/npm-cli-login@^0.0.11":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@0xproject/npm-cli-login/-/npm-cli-login-0.0.11.tgz#3f1ec06112ce62aad300ff0575358f68aeecde2e"
dependencies:
npm-registry-client "7.0.9"

"@0xproject/order-utils@^0.0.9":
version "0.0.9"
resolved "https://registry.yarnpkg.com/@0xproject/order-utils/-/order-utils-0.0.9.tgz#75225dfbd87335d18810abf995d8e077b9a84868"
Expand Down Expand Up @@ -6375,7 +6381,7 @@ ganache-core@0xProject/ganache-core#monorepo-dep:
ethereumjs-tx "0xProject/ethereumjs-tx#fake-tx-include-signature-by-default"
ethereumjs-util "^5.2.0"
ethereumjs-vm "2.3.5"
ethereumjs-wallet "0.6.0"
ethereumjs-wallet "~0.6.0"
fake-merkle-patricia-tree "~1.0.1"
heap "~0.2.6"
js-scrypt "^0.2.0"
Expand Down Expand Up @@ -10337,12 +10343,6 @@ npm-bundled@^1.0.1:
version "1.0.3"
resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308"

npm-cli-login@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/npm-cli-login/-/npm-cli-login-0.0.10.tgz#b1e8b5b7405008e0a26ccc170443434a59c5364c"
dependencies:
npm-registry-client "7.0.9"

npm-lifecycle@^2.0.0:
version "2.0.3"
resolved "http://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.0.3.tgz#696bedf1143371163e9cc16fe872357e25d8d90e"
Expand Down

0 comments on commit 0013baf

Please sign in to comment.