Skip to content

Commit

Permalink
fix: add ts-nocheck to compiled contracts (#38)
Browse files Browse the repository at this point in the history
* fix: add ts-nocheck to compiled contracts

* chore: update scripts/addTsNoCheck.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update scripts/addTsNoCheck.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update scripts/addTsNoCheck.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update scripts/addTsNoCheck.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: fix linting

* chore: fix linting

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
nghaninn and github-actions[bot] authored Nov 28, 2024
1 parent edea8f1 commit 18dfb8f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tradetrust-tt/token-registry",
"version": "5.0.0-alpha",
"version": "5.0.0",
"release": {
"branches": [
"master",
Expand All @@ -22,7 +22,7 @@
"author": "GovTech",
"license": "Apache-2.0",
"scripts": {
"build:sol": "TS_NODE_TRANSPILE_ONLY=1 hardhat compile",
"build:sol": "TS_NODE_TRANSPILE_ONLY=1 hardhat compile && node scripts/addTsNoCheck.js",
"build:js:copy-src": "babel src -d dist --ignore src/**/*.spec.ts,src/**/*.test.ts -x .js,.ts,.tsx --copy-files",
"build:js": "tsc && npm run build:js:copy-src",
"build:js:copy-types": "mkdir -p ./dist/contracts && cp -a ./src/contracts/* ./dist/contracts",
Expand Down
32 changes: 32 additions & 0 deletions scripts/addTsNoCheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const fs = require("fs");
const { glob } = require("glob");

const addTsNoCheck = async () => {
const files = glob.sync(`${__dirname}/..` + `/src/contracts/**/*.{ts,d.ts}`, { ignore: "node_modules/**" });
files.forEach((file) => {
fs.readFile(file, "utf8", (err, data) => {
if (err) {
console.error("err", err);
return;
}

data = data.replace(
`/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */`,
`/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck: skippping typechecking for this file`
);

fs.writeFile(file, data, "utf8", (err2) => {
if (err2) {
console.error("err", err2);
}
});
});
});
};

addTsNoCheck();

0 comments on commit 18dfb8f

Please sign in to comment.