-
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: metadata, custom template with icon data (#50)
* feat: metadata, custom template with icon data, preview json icon data in plugin * changeset
- Loading branch information
1 parent
55cbf31
commit fc5f4ae
Showing
45 changed files
with
5,160 additions
and
5,820 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 | ||
--- | ||
|
||
- Add `metadata` system | ||
- Add custom template with `IconaIconData` in React Config |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+34.6 KB
.yarn/cache/@babel-helper-compilation-targets-npm-7.25.7-912ef98d47-5b57e7d4b9.zip
Binary file not shown.
Binary file added
BIN
+37.3 KB
.yarn/cache/@babel-helper-module-imports-npm-7.25.7-f7b3a083a0-a7255755e9.zip
Binary file not shown.
Binary file added
BIN
+70 KB
.yarn/cache/@babel-helper-module-transforms-npm-7.25.7-01310522f0-b1daeded78.zip
Binary file not shown.
Binary file added
BIN
+24.8 KB
.yarn/cache/@babel-helper-simple-access-npm-7.25.7-3a9e5cd6e8-684d0b0330.zip
Binary file not shown.
Binary file added
BIN
+23.5 KB
.yarn/cache/@babel-helper-string-parser-npm-7.25.7-352069de58-0835fda5ef.zip
Binary file not shown.
Binary file added
BIN
+31.5 KB
.yarn/cache/@babel-helper-validator-identifier-npm-7.25.7-1c758f0472-062f55208d.zip
Binary file not shown.
Binary file added
BIN
+20.9 KB
.yarn/cache/@babel-helper-validator-option-npm-7.25.7-8c969bf588-87b801fe7d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+22.9 KB
.yarn/cache/@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-ff7a1764eb.zip
Binary file not shown.
Binary file added
BIN
+8.72 KB
.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip
Binary file not shown.
Binary file added
BIN
+27.2 KB
.yarn/cache/@jridgewell-sourcemap-codec-npm-1.5.0-dfd9126d71-05df4f2538.zip
Binary file not shown.
Binary file added
BIN
+45.5 KB
.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-9d3c40d225.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26.2 KB
.yarn/cache/electron-to-chromium-npm-1.5.41-169e35b0ae-942cc53bea.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.86 KB
.yarn/cache/update-browserslist-db-npm-1.1.1-16e34017b1-2ea11bd256.zip
Binary file not shown.
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
Large diffs are not rendered by default.
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
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,51 @@ | ||
import type { types as t } from "@babel/core"; | ||
import type { TemplateBuilder } from "@babel/template"; | ||
|
||
export interface TemplateVariables { | ||
componentName: string; | ||
interfaces: t.TSInterfaceDeclaration[]; | ||
props: (t.ObjectPattern | t.Identifier)[]; | ||
imports: t.ImportDeclaration[]; | ||
exports: (t.VariableDeclaration | t.ExportDeclaration | t.Statement)[]; | ||
jsx: t.JSXElement; | ||
} | ||
|
||
export interface TemplateContext { | ||
options: TemplateContextOptions; | ||
tpl: TemplateBuilder<TemplateReturn>["ast"]; | ||
} | ||
|
||
export type TemplateReturn = t.Statement | t.Statement[]; | ||
|
||
export interface Template { | ||
(variables: TemplateVariables, context: TemplateContext): TemplateReturn; | ||
} | ||
|
||
interface State { | ||
componentName: string; | ||
caller?: { previousExport?: string | null }; | ||
} | ||
|
||
interface JSXRuntimeImport { | ||
source: string; | ||
namespace?: string; | ||
defaultSpecifier?: string; | ||
specifiers?: string[]; | ||
} | ||
|
||
export interface TemplateContextOptions { | ||
typescript?: boolean; | ||
titleProp?: boolean; | ||
descProp?: boolean; | ||
expandProps?: boolean | "start" | "end"; | ||
ref?: boolean; | ||
template?: Template; | ||
state: State; | ||
native?: boolean; | ||
memo?: boolean; | ||
exportType?: "named" | "default"; | ||
namedExport?: string; | ||
jsxRuntime?: "automatic" | "classic"; | ||
jsxRuntimeImport?: JSXRuntimeImport; | ||
importSource?: string; | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./babel"; | ||
export * from "./data"; | ||
export * from "./lib"; |
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
Oops, something went wrong.