Update build scripts to use environment variables and improve icon build logging. The after:bump hook in package.json now utilizes pnpm exec turbo build for better performance, while console output for icon building has been commented out for cleaner logs during the build process.

This commit is contained in:
codecalm
2025-12-31 18:16:31 +01:00
parent 07d1e4a796
commit d98c78b6c1
3 changed files with 13 additions and 13 deletions

View File

@@ -31,9 +31,9 @@ export const buildJsIcons = ({
let index = [];
Object.entries(allIcons).forEach(([type, icons]) => {
icons.forEach((icon, i) => {
process.stdout.write(
`Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
);
// process.stdout.write(
// `Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
// );
const children = icon.obj.children
.map(({ name, attributes }, i) => {
@@ -107,9 +107,9 @@ export const buildIconsList = (name) => {
let index = [];
Object.entries(allIcons).forEach(([type, icons]) => {
icons.forEach((icon, i) => {
process.stdout.write(
`Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
);
// process.stdout.write(
// `Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
// );
const iconName = `${icon.name}${type !== 'outline' ? `-${type}` : ''}`;
@@ -131,9 +131,9 @@ export const buildIconsDynamicImport = (name) => {
let dynamicImportString = 'export default {';
Object.entries(allIcons).forEach(([type, icons]) => {
icons.forEach((icon, i) => {
process.stdout.write(
`Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
);
// process.stdout.write(
// `Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`,
// );
const iconName = `${icon.name}${type !== 'outline' ? `-${type}` : ''}`,
iconNamePascal = `${icon.namePascal}${type !== 'outline' ? toPascalCase(type) : ''}`;

View File

@@ -572,9 +572,9 @@ export const convertIconsToImages = async (dir, extension, size = 240) => {
await asyncForEach(svgFiles, async function (file, i) {
const distPath = path.join(dir, `./${type}/${file.name}.${extension}`);
process.stdout.write(
`Building \`icons/${extension}\` ${type} ${i}/${svgFiles.length}: ${file.name.padEnd(42)}\r`,
);
// process.stdout.write(
// `Building \`icons/${extension}\` ${type} ${i}/${svgFiles.length}: ${file.name.padEnd(42)}\r`,
// );
await new Promise((resolve, reject) => {
exec(`rsvg-convert -f ${extension} -h ${size} ${file.path} > ${distPath}`, (error) => {

View File

@@ -97,7 +97,7 @@
},
"npm": false,
"hooks": {
"after:bump": "LATEST_VERSION=${latestVersion} NEW_VERSION=${version} pnpm run build --verbose && pnpm install",
"after:bump": "export LATEST_VERSION=${latestVersion} && export NEW_VERSION=${version} && pnpm exec turbo build --concurrency=5 && pnpm install",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
"git": {