2023-07-28 15:11:38 +03:00
|
|
|
import fs from "fs";
|
|
|
|
import path from "path";
|
|
|
|
import CID from "cids";
|
|
|
|
|
|
|
|
import { DeclCalculator } from "./utils";
|
2023-08-30 22:05:46 +03:00
|
|
|
import { classicUiIpfsCid, novaUiIpfsCid, relayersUiIpfsCid, docsIpfsCid } from "./constants";
|
2023-07-28 15:11:38 +03:00
|
|
|
|
|
|
|
const convertCIDToV1 = (cidV0: string) => `"${new CID(cidV0).toV1().toString()}"`;
|
|
|
|
|
|
|
|
const { calculateDecl } = new DeclCalculator("const", "", convertCIDToV1);
|
|
|
|
const typescriptCode =
|
2023-08-30 22:05:46 +03:00
|
|
|
calculateDecl({ classicUiIpfsCid }) +
|
|
|
|
calculateDecl({ novaUiIpfsCid }) +
|
|
|
|
calculateDecl({ relayersUiIpfsCid }) +
|
|
|
|
calculateDecl({ docsIpfsCid });
|
2023-07-28 15:11:38 +03:00
|
|
|
|
|
|
|
fs.writeFileSync(path.join(".", "data", "ipfsV1CIDs.txt"), typescriptCode);
|