Skip to content

Commit

Permalink
Merge pull request #16 from tnga/contrib
Browse files Browse the repository at this point in the history
πŸ› fix: Fix to use correct paths for assets build and favicons test
  • Loading branch information
canisminor1990 authored Jan 17, 2024
2 parents 1b91d88 + bc41de2 commit 549220d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ es
lib
logs
test-output
packages/assets-favicons/assets/faviconData.json
webfonts

# umi
.umi
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"packages/*"
],
"scripts": {
"build:favicons": "real-favicon generate src/favicons/faviconDescription.json favicons/faviconData.json favicons",
"build:favicons": "real-favicon generate src/favicons/faviconDescription.json packages/assets-favicons/assets/faviconData.json packages/assets-favicons/assets",
"build:logo": "node src/logo/index.js",
"build:webfonts": "node src/webfonts/index.js",
"clean": "lerna run clean && rm -rf es lib dist build coverage .umi .eslintcache apis",
Expand All @@ -35,7 +35,7 @@
"reinstall": "npm run clean && lerna clean && rm -rf node_modules && npm run",
"release": "multi-semantic-release",
"release:local": "multi-semantic-release --no-ci",
"test": "real-favicon check-for-update --fail-on-upmdate faviconData.json"
"test": "real-favicon check-for-update --fail-on-update packages/assets-favicons/assets/faviconData.json"
},
"lint-staged": {
"*.md": [
Expand Down
5 changes: 4 additions & 1 deletion src/logo/optimizeSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ const optimizeSvg = (icons) => {
for (const icon of icons) {
const iconSvg = fs.readFileSync(path.resolve(__dirname, '../assets', icon));
const result = optimize(iconSvg, config);
fs.writeFileSync(path.resolve(__dirname, '../../packages/logo/assets', icon), result.data);
fs.writeFileSync(
path.resolve(__dirname, '../../packages/assets-logo/assets', icon),
result.data,
);
console.log(`βœ… ${icon}`);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/logo/optimizeWebp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const optimizeWebp = (icons, size = 480) => {
image
.resize(size, size)
.webp()
.toFile(path.resolve(__dirname, '../../packages/logo/assets', newIconName));
.toFile(path.resolve(__dirname, '../../packages/assets-logo/assets', newIconName));
console.log(`βœ… ${icon}`);
}
};
Expand Down

0 comments on commit 549220d

Please sign in to comment.