Skip to content

Commit

Permalink
fix: version (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui authored Apr 16, 2024
1 parent 406733d commit 9bb6379
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 97 deletions.
125 changes: 30 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mask-token-lists",
"version": "0.0.74",
"version": "0.0.75",
"repository": "https://github.com/DimensionDev/Mask-Token-Lists.git",
"license": "MIT",
"author": "guanbinrui <[email protected]>",
Expand All @@ -12,6 +12,7 @@
"cross-fetch": "^4.0.0",
"lodash": "^4.17.21",
"node-fetch-cache": "^4.1.0",
"semver": "^7.6.0",
"urlcat": "^2.0.4"
},
"devDependencies": {
Expand Down
14 changes: 13 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { mkdirSync, writeFileSync } from 'fs';
import { mkdirSync, readFileSync, writeFileSync } from 'fs';
import { parse } from 'semver'

import { CHAINS } from '@/constants/chain';
import { MaskTokenList } from '@/providers/mask/TokenList';
Expand All @@ -11,6 +12,17 @@ async function main() {
const funibleTokenList = await MaskTokenList.getFungibleTokenList(chain);
const nonFungibleTokenList = await MaskTokenList.getNonFungibleTokenList(chain);

const PackageJSON = JSON.parse(readFileSync('./package.json', 'utf8'))
const parsedVersion = parse(PackageJSON.version);

funibleTokenList.version.major = parsedVersion?.major ?? 0;
funibleTokenList.version.minor = parsedVersion?.minor ?? 0;
funibleTokenList.version.patch = parsedVersion?.patch ?? 0;

nonFungibleTokenList.version.major = parsedVersion?.major ?? 0;
nonFungibleTokenList.version.minor = parsedVersion?.minor ?? 0;
nonFungibleTokenList.version.patch = parsedVersion?.patch ?? 0;

console.log(`[INFO] Saving: ${chain.name} (${chain.chainId})\n`);

mkdirSync(`./dist/latest/${chain.chainId}`, { recursive: true });
Expand Down

0 comments on commit 9bb6379

Please sign in to comment.