Skip to content

Commit

Permalink
Merge pull request #395 from LIT-Protocol/feature/generated-stuff-out…
Browse files Browse the repository at this point in the history
…-of-git

Get generated stuff out of PRs to make them cleaner
  • Loading branch information
Ansonhkg authored Mar 12, 2024
2 parents d1439b1 + 3c17e53 commit ed78521
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"reset:dev": "yarn tools --remove-local-dev",
"reset": "rm -rf ./dist/packages && yarn reset:dev",
"build": "yarn build:packages",
"build:packages": "yarn tools --remove-local-dev && rm -rf ./dist && yarn gen:internal-dev && yarn tools check --no-empty-directories=true && yarn tools fixTsConfig && yarn tools --build --packages && yarn tools --setup-local-dev && yarn gen:readme && yarn build:verify",
"build:packages": "yarn tools --remove-local-dev && rm -rf ./dist && yarn gen:internal-dev && yarn tools check --no-empty-directories=true && yarn tools fixTsConfig && yarn tools --build --packages && yarn tools --setup-local-dev && yarn gen:readme && yarn build:verify && yarn nx format:write --all",
"build:target": "yarn node tools/scripts/build.mjs",
"build:setupLocalDev": "yarn tools --setup-local-dev",
"build:verify": "yarn tools --verify",
Expand Down
3 changes: 1 addition & 2 deletions tools/scripts/gen-internal-dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const date = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '');

await fs.writeFile(
internalPath,
`// Last Modified: ${date}
// This file is auto-generated by tools/scripts/gen-internal-dev.mjs
`// This file is auto-generated by tools/scripts/gen-internal-dev.mjs
export const INTERNAL_DEV = ${JSON.stringify(networks, null, 2)};
export const INTERNAL_MIN_NODE_COUNT = ${minNodeCount};
Expand Down
10 changes: 5 additions & 5 deletions tools/scripts/gen-readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const getSize = (lib) => {
};

const getNpm = (lib) => {
return `<a target="_blank" href="https://www.npmjs.com/package/${lib}">npm</a>`;
return `<a href="https://www.npmjs.com/package/${lib}"><img src="https://img.shields.io/npm/dw/${lib}?label=NPM"/></a>`;
// return `<a target="_blank" href="https://www.npmjs.com/package/${lib}">npm</a>`;
// return `<a href="https://www.npmjs.com/package/${lib}"><img src="https://img.shields.io/npm/dw/${lib}?label=NPM"/></a>`;
return `<a target="_blank" href="https://www.npmjs.com/package/${lib}"><img src="https://img.shields.io/npm/v/${lib}"/></a>`;
};

const libs = (await listDirsRecursive('packages', false)).map((lib) =>
Expand All @@ -63,11 +64,10 @@ libs.map((lib) => {
} catch (e) {
redLog(`${name}/package.json doesn't have "tags" property`);
}
const _version = version;
// const _size = getSize(name);
const _download = `${getNpm(name)}`;

const content = `| ${_package} | ${_tag} | ${_version} | ${_download}`;
const content = `| ${_package} | ${_tag} | ${_download}`;

if (tags[0] === 'universal') {
universals.push(content);
Expand Down Expand Up @@ -115,7 +115,7 @@ mainRows = mainRows.sort((a, b) => {
});

const tables = {
headers: ['Package', 'Category', 'Version', 'Download'],
headers: ['Package', 'Category', 'Download'],
mainRows: mainRows,
otherRows: otherRows,
};
Expand Down

0 comments on commit ed78521

Please sign in to comment.