-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export png & width, height includes in icons.json & refactoring (…
…#26) * feat: 여러가지 - 폴더 리팩토링 - png 포맷 뽑기 - 피그마 노드의 width, height도 데이터에 넣기 * chore: changeset
- Loading branch information
1 parent
17fb395
commit 9e98a6d
Showing
57 changed files
with
230 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@icona/generator": minor | ||
"@icona/types": minor | ||
"@icona/utils": minor | ||
--- | ||
|
||
PNG 내보내기 & width, height 정보 받기 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { generate } from "./core/generate.js"; | ||
|
||
export { generate }; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
"author": "junghyeonsu <[email protected]>", | ||
"workspaces": [ | ||
"packages/types", | ||
"packages/icona-utils", | ||
"packages/icona-generator", | ||
"packages/utils", | ||
"packages/generator", | ||
"figma-plugin" | ||
], | ||
"scripts": { | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
packages/icona-generator/src/generator.ts → packages/generator/src/generator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { generateDrawable } from "./core/drawable.js"; | ||
import { generatePDF } from "./core/pdf.js"; | ||
import { generatePNG } from "./core/png.js"; | ||
import { generateReact } from "./core/react.js"; | ||
import { generateSVG } from "./core/svg.js"; | ||
import { generate, generator } from "./generator.js"; | ||
|
||
export { | ||
generate, | ||
generateDrawable, | ||
generatePDF, | ||
generatePNG, | ||
generateReact, | ||
generateSVG, | ||
}; | ||
|
||
export default generator; |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type Base64 = string; | ||
|
||
export interface Style { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
export interface IconaIconData { | ||
name: string; | ||
style: Style; | ||
svg: string; | ||
png?: Base64; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,164 +1,2 @@ | ||
import type { Config as SvgrConfig } from "@svgr/core"; | ||
import type { SVGtoPDFOptions } from "svg-to-pdfkit"; | ||
import type { Config as SvgoConfig } from "svgo"; | ||
|
||
type PDFKitConfig = PDFKit.PDFDocumentOptions & { | ||
/** | ||
* @readme | ||
* If you use `info` option, pdf output will be different every time. | ||
* So it occur git diff. So we use default info option. | ||
* If user want change info option, they can change it. | ||
* **But not recommend.** | ||
* | ||
* ```ts | ||
* const defaultPdfkitConfigInfo = { | ||
Author: "Icona", | ||
Creator: "Icona", | ||
Producer: "Icona", | ||
Title: IconName, | ||
Subject: IconName, | ||
Keywords: IconName, | ||
CreationDate: new Date(0), | ||
ModDate: new Date(0), | ||
}; | ||
* ``` | ||
*/ | ||
info?: PDFKit.PDFDocumentOptions["info"]; | ||
}; | ||
|
||
type Base64 = string; | ||
export type IconaIconData = { | ||
name: string; | ||
svg: string; | ||
png?: Base64; | ||
}; | ||
|
||
export interface SvgToPdfOptions extends SVGtoPDFOptions { | ||
x?: number; | ||
y?: number; | ||
} | ||
export interface GeneratePDFConfig { | ||
/** | ||
* generate drawable pdf files | ||
* @default false | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* pdf files path that will be generated | ||
* @default pdf | ||
*/ | ||
path?: string; | ||
|
||
/** | ||
* PDFKit.PDFDocumentOptions | ||
* @see https://pdfkit.org/docs/getting_started.html#document-structure | ||
* | ||
* @readme | ||
* If you use `info` option, pdf output will be different every time. | ||
* So it occur git diff. So we use default info option. | ||
* | ||
* If user want change info option, they can change it. | ||
* But not recommend. | ||
*/ | ||
pdfKitConfig?: PDFKitConfig; | ||
|
||
svgToPdfOptions?: SvgToPdfOptions; | ||
} | ||
|
||
export interface GenerateReactConfig { | ||
/** | ||
* generate drawable react files | ||
* @default false | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* react component files path that will be generated | ||
* @default react | ||
*/ | ||
path?: string; | ||
|
||
/** | ||
* Config (@svgr/core) | ||
* @see https://react-svgr.com/docs/options/ | ||
*/ | ||
svgrConfig?: SvgrConfig; | ||
} | ||
|
||
export interface GenerateSVGConfig { | ||
/** | ||
* generate drawable svg files | ||
* @default true | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* svg files path that will be generated | ||
* @default svg | ||
*/ | ||
path?: string; | ||
|
||
/** | ||
* Config (svgo) | ||
* @see https://github.com/svg/svgo#configuration | ||
*/ | ||
svgoConfig?: SvgoConfig; | ||
} | ||
|
||
interface Svg2vectordrawableOptions { | ||
floatPrecision?: number; // default 2 | ||
strict?: boolean; // defaults to false | ||
fillBlack?: boolean; // defaults to false | ||
xmlTag?: boolean; // defaults to false | ||
tint?: string; | ||
} | ||
|
||
export interface GenerateDrawableConfig { | ||
/** | ||
* generate drawable xml files | ||
* @default false | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* xml files path that will be generated | ||
* @default xml | ||
*/ | ||
path?: string; | ||
|
||
/** | ||
* Config (svg2vectordrawable) | ||
* @see https://github.com/Ashung/svg2vectordrawable | ||
*/ | ||
svg2vectordrawableConfig?: Svg2vectordrawableOptions; | ||
|
||
/** | ||
* drawable default color is #FF212124 | ||
* if you want to change default color, you can use this option | ||
* @default #FF212124 | ||
*/ | ||
defaultColor?: string; | ||
} | ||
|
||
export interface GeneratePNGConfig { | ||
/** | ||
* generate drawable xml files | ||
* @default false | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* xml files path that will be generated | ||
* @default xml | ||
*/ | ||
path?: string; | ||
} | ||
|
||
export interface IconaConfig { | ||
svg: GenerateSVGConfig; | ||
react: GenerateReactConfig; | ||
pdf: GeneratePDFConfig; | ||
drawable: GenerateDrawableConfig; | ||
png: GeneratePNGConfig; | ||
} | ||
export * from "./data"; | ||
export * from "./lib"; |
Oops, something went wrong.