Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get generated stuff out of PRs to make them cleaner #395

Merged
merged 8 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading