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

Develop to Main [Mint Icons] #452

Merged
merged 4 commits into from
Jul 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
1 change: 1 addition & 0 deletions packages/icon-store/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
custom
mi
mint-icons
material-design-icons
!**/svgs/**
.DS_Store
6 changes: 5 additions & 1 deletion packages/icon-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"files": [
"mi",
"custom",
"mint-icons",
"types.d.ts"
],
"types": "types.d.ts",
Expand All @@ -17,17 +18,20 @@
"generate": "run-p generate:*",
"generate:mi": "rm -rf mi && mkdir mi && svgr ./svgs/mi/ --out-dir ./mi/",
"generate:custom": "rm -rf custom && mkdir custom && svgr ./svgs/custom/ --out-dir ./custom/",
"generate:mint-icons": "rm -rf mint-icons && mkdir mint-icons && svgr ./svgs/mint-icons/ --out-dir ./mint-icons/",
"transform": "node scripts/compileComponent.js && node scripts/generateIndexFile.js && node scripts/generateTypes.js && node scripts/createPackageJsonFiles.js",
"clean-mi-icons": "rm -rf svgs/mi && mkdir svgs/mi",
"clean-custom-icons": "rm -rf svgs/custom && mkdir svgs/custom",
"clean-mint-icons": "rm -rf svgs/mint-icons && mkdir svgs/mint-icons",
"build": "npm run generate && npm run transform",
"pushTags": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag -a icon-store-v$PACKAGE_VERSION -m \"@groww-tech/icon-store-v$PACKAGE_VERSION\" && git push --tags"
},
"keywords": [
"icon-store",
"groww",
"icons",
"material-icons"
"material-icons",
"mint-icons"
],
"author": "Vikas Singh <[email protected]> (https://twitter.com/VikasSi25579022)",
"contributors": [
Expand Down
5 changes: 3 additions & 2 deletions packages/icon-store/scripts/compileComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This function will transform the component files of mi and custom icons
* This function will transform the component files of mi, custom, mint icons
* using babel transfromSync and minify the result using terser's api.
*/

Expand All @@ -15,8 +15,9 @@ const timeoutId = setTimeout(() => {
function compileReactComponentsUsingBabel() {
const miComponentPath = path.join(__dirname, "../mi");
const customComponentPath = path.join(__dirname, "../custom");
const mintIconsComponentPath = path.join(__dirname, "../mint-icons");

[miComponentPath, customComponentPath].forEach(function (componentPath) {
[miComponentPath, customComponentPath, mintIconsComponentPath].forEach(function (componentPath) {
console.log(
chalk.green("Compiling resources from: ") + chalk.yellow(componentPath)
);
Expand Down
3 changes: 2 additions & 1 deletion packages/icon-store/scripts/createPackageJsonFiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This function generate package.json files for both mi and custom icons
* This function generate package.json files for mi, custom, mint icons
* package.json helps builders/bundlers to refer the correct file when building apps
*/

Expand All @@ -26,3 +26,4 @@ function createPackageJson(iconType = "mi") {

createPackageJson("mi");
createPackageJson("custom");
createPackageJson("mint-icons");
4 changes: 3 additions & 1 deletion packages/icon-store/scripts/generateIndexFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This function generate index files for both mi and custom icons
* This function generate index files for mi, custom, mint icons
* both esm and cjs format (reexports)
* Providing an index file helps with developer ease of use and less number of imports overall
*/
Expand Down Expand Up @@ -88,3 +88,5 @@ createIndexFile("mi", "cjs");
createIndexFile("mi", "esm");
createIndexFile("custom", "cjs");
createIndexFile("custom", "esm");
createIndexFile("mint-icons", "cjs");
createIndexFile("mint-icons", "esm");
4 changes: 2 additions & 2 deletions packages/icon-store/scripts/generateTypes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This function generate typescript files usinga template string.
* component folder paths: mi, custom (top level)
* component folder paths: mi, custom, mint-icons (top level)
*
* It will generate the .d.ts files for each component in the same folder.
*/
Expand All @@ -10,7 +10,7 @@ const { getDirContent, writeContentToFile } = require("./helpers/utils");
const chalk = require("chalk");

function generateTypesForIconComponent() {
const componentFolderPaths = ["mi/cjs", "custom/cjs"];
const componentFolderPaths = ["mi/cjs", "custom/cjs", "mint-icons/cjs"];

componentFolderPaths.forEach((componentFolderPath) => {
console.log(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading