-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve version sync * Fix linter warn on Node version * Remove linter warning on importing JSON files * Improve add-token params validation * Get remote token address on add-token * Add missing birth blocks * Sort the token list (next time a token is added) * Mark USDT and USDC.e as "stargate" * Improve test names * 1.7.0
- Loading branch information
Showing
8 changed files
with
149 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
npm run version | ||
lint-staged | ||
#! /bin/sh | ||
|
||
[ -n "$(node scripts/sync-version.js)" ] && git add src/hemi.tokenlist.json | ||
lint-staged |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
import fs from "node:fs"; | ||
|
||
// eslint fails to parse "with { type: "json" }" | ||
// See https://github.com/eslint/eslint/discussions/15305 | ||
const packageJson = JSON.parse(fs.readFileSync("./package.json")); | ||
const tokenList = JSON.parse(fs.readFileSync("./src/hemi.tokenlist.json")); | ||
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); | ||
const tokenList = JSON.parse( | ||
fs.readFileSync("./src/hemi.tokenlist.json", "utf-8"), | ||
); | ||
|
||
const [major, minor, patch] = packageJson.version.split("."); | ||
tokenList.version.major = parseInt(major); | ||
tokenList.version.minor = parseInt(minor); | ||
tokenList.version.patch = parseInt(patch); | ||
const currentVersion = [ | ||
tokenList.version.major, | ||
tokenList.version.minor, | ||
tokenList.version.patch, | ||
].join("."); | ||
|
||
tokenList.timestamp = new Date().toISOString(); | ||
if (currentVersion !== packageJson.version) { | ||
const [major, minor, patch] = packageJson.version.split("."); | ||
tokenList.version.major = parseInt(major); | ||
tokenList.version.minor = parseInt(minor); | ||
tokenList.version.patch = parseInt(patch); | ||
|
||
fs.writeFileSync("src/hemi.tokenlist.json", JSON.stringify(tokenList, null, 2)); | ||
tokenList.timestamp = new Date().toISOString(); | ||
|
||
fs.writeFileSync( | ||
"src/hemi.tokenlist.json", | ||
JSON.stringify(tokenList, null, 2), | ||
); | ||
|
||
console.log("Version updated"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters