mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-24 05:49:22 +01:00
New setup for new NPM package
This commit is contained in:
13
.babelrc
Normal file
13
.babelrc
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"browsers": ["last 2 versions"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stage-2"
|
||||||
|
]
|
||||||
|
}
|
||||||
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
quote_type = single
|
||||||
|
max_line_length = 100
|
||||||
38
package.json
38
package.json
@@ -1,9 +1,43 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"react:compile": "yarn workspace react compile"
|
"react:compile": "yarn workspace react compile",
|
||||||
|
"build": "npx babel-node ./scripts/buildIcons.js",
|
||||||
|
"start": "babel-watch ./src/buildIcons.js"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/react"
|
"packages/react"
|
||||||
]
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.10.5",
|
||||||
|
"@commitlint/cli": "^5.2.5",
|
||||||
|
"@commitlint/config-conventional": "^6.1.3",
|
||||||
|
"algoliasearch": "^3.27.1",
|
||||||
|
"babel-cli": "^6.24.1",
|
||||||
|
"babel-loader": "^7.1.1",
|
||||||
|
"babel-preset-env": "^1.7.0",
|
||||||
|
"babel-preset-stage-2": "^6.24.1",
|
||||||
|
"babel-watch": "^7.0.0",
|
||||||
|
"cheerio": "^1.0.0-rc.2",
|
||||||
|
"commitizen": "^2.9.6",
|
||||||
|
"cz-conventional-changelog": "^2.1.0",
|
||||||
|
"eslint": "^4.19.1",
|
||||||
|
"eslint-config-airbnb-base": "^12.1.0",
|
||||||
|
"eslint-config-prettier": "^2.9.0",
|
||||||
|
"eslint-plugin-import": "^2.5.0",
|
||||||
|
"eslint-plugin-prettier": "^2.5.0",
|
||||||
|
"html-minifier": "^3.5.8",
|
||||||
|
"husky": "^0.14.3",
|
||||||
|
"jest": "^22.4.4",
|
||||||
|
"lint-staged": "^6.0.0",
|
||||||
|
"npm-run-all": "^4.1.2",
|
||||||
|
"prettier": "^1.8.2",
|
||||||
|
"semantic-release": "^12.2.2",
|
||||||
|
"svgo": "^0.7.2",
|
||||||
|
"webpack": "^4.8.3",
|
||||||
|
"webpack-cli": "^2.1.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"htmlparser2": "^4.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10433
packages/js/yarn.lock
Normal file
10433
packages/js/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
311
react.js
vendored
Normal file
311
react.js
vendored
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
undefinedimport getReactComponent from './src/getReactComponent';
|
||||||
|
export { Activity,
|
||||||
|
Airplay,
|
||||||
|
AlertCircle,
|
||||||
|
AlertOctagon,
|
||||||
|
AlertTriangle,
|
||||||
|
AlignCenter,
|
||||||
|
AlignJustify,
|
||||||
|
AlignLeft,
|
||||||
|
AlignRight,
|
||||||
|
Anchor,
|
||||||
|
Aperture,
|
||||||
|
Archive,
|
||||||
|
ArrowDownCircle,
|
||||||
|
ArrowDownLeft,
|
||||||
|
ArrowDownRight,
|
||||||
|
ArrowDown,
|
||||||
|
ArrowLeftCircle,
|
||||||
|
ArrowLeft,
|
||||||
|
ArrowRightCircle,
|
||||||
|
ArrowRight,
|
||||||
|
ArrowUpCircle,
|
||||||
|
ArrowUpLeft,
|
||||||
|
ArrowUpRight,
|
||||||
|
ArrowUp,
|
||||||
|
AtSign,
|
||||||
|
Award,
|
||||||
|
BarChart2,
|
||||||
|
BarChart,
|
||||||
|
BatteryCharging,
|
||||||
|
BatteryFull,
|
||||||
|
BatteryLow,
|
||||||
|
BatteryMedium,
|
||||||
|
Battery,
|
||||||
|
BellOff,
|
||||||
|
Bell,
|
||||||
|
Bluetooth,
|
||||||
|
Bold,
|
||||||
|
BookOpen,
|
||||||
|
Book,
|
||||||
|
Bookmark,
|
||||||
|
Box,
|
||||||
|
Briefcase,
|
||||||
|
Calendar,
|
||||||
|
CameraOff,
|
||||||
|
Camera,
|
||||||
|
Cast,
|
||||||
|
CheckCircle,
|
||||||
|
CheckSquare,
|
||||||
|
Check,
|
||||||
|
ChevronDown,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
ChevronUp,
|
||||||
|
ChevronsDown,
|
||||||
|
ChevronsLeft,
|
||||||
|
ChevronsRight,
|
||||||
|
ChevronsUp,
|
||||||
|
Chrome,
|
||||||
|
Circle,
|
||||||
|
Clipboard,
|
||||||
|
Clock,
|
||||||
|
CloudDrizzle,
|
||||||
|
CloudLightning,
|
||||||
|
CloudOff,
|
||||||
|
CloudRain,
|
||||||
|
CloudSnow,
|
||||||
|
Cloud,
|
||||||
|
Code,
|
||||||
|
Codepen,
|
||||||
|
Codesandbox,
|
||||||
|
Coffee,
|
||||||
|
Columns,
|
||||||
|
Command,
|
||||||
|
Compass,
|
||||||
|
Contact,
|
||||||
|
Contrast,
|
||||||
|
Copy,
|
||||||
|
Copyleft,
|
||||||
|
Copyright,
|
||||||
|
CornerDownLeft,
|
||||||
|
CornerDownRight,
|
||||||
|
CornerLeftDown,
|
||||||
|
CornerLeftUp,
|
||||||
|
CornerRightDown,
|
||||||
|
CornerRightUp,
|
||||||
|
CornerUpLeft,
|
||||||
|
CornerUpRight,
|
||||||
|
Cpu,
|
||||||
|
CreditCard,
|
||||||
|
Crop,
|
||||||
|
Crosshair,
|
||||||
|
Database,
|
||||||
|
Delete,
|
||||||
|
Disc,
|
||||||
|
DivideCircle,
|
||||||
|
DivideSquare,
|
||||||
|
Divide,
|
||||||
|
DollarSign,
|
||||||
|
DownloadCloud,
|
||||||
|
Download,
|
||||||
|
Dribbble,
|
||||||
|
Droplet,
|
||||||
|
Edit2,
|
||||||
|
Edit3,
|
||||||
|
Edit,
|
||||||
|
ExternalLink,
|
||||||
|
EyeOff,
|
||||||
|
Eye,
|
||||||
|
Facebook,
|
||||||
|
FastForward,
|
||||||
|
Feather,
|
||||||
|
Figma,
|
||||||
|
FileMinus,
|
||||||
|
FilePlus,
|
||||||
|
FileText,
|
||||||
|
File,
|
||||||
|
Film,
|
||||||
|
Filter,
|
||||||
|
Flag,
|
||||||
|
FolderMinus,
|
||||||
|
FolderPlus,
|
||||||
|
Folder,
|
||||||
|
Framer,
|
||||||
|
Frown,
|
||||||
|
Gamepad2,
|
||||||
|
Gamepad,
|
||||||
|
Gift,
|
||||||
|
GitBranch,
|
||||||
|
GitCommit,
|
||||||
|
GitMerge,
|
||||||
|
GitPullRequest,
|
||||||
|
GitHub,
|
||||||
|
Gitlab,
|
||||||
|
Globe,
|
||||||
|
Grid,
|
||||||
|
GripHorizontal,
|
||||||
|
GripVertical,
|
||||||
|
HardDrive,
|
||||||
|
Hash,
|
||||||
|
Headphones,
|
||||||
|
Heart,
|
||||||
|
HelpCircle,
|
||||||
|
Hexagon,
|
||||||
|
Highlighter,
|
||||||
|
Home,
|
||||||
|
Image,
|
||||||
|
Inbox,
|
||||||
|
Info,
|
||||||
|
Instagram,
|
||||||
|
Italic,
|
||||||
|
Key,
|
||||||
|
Languages,
|
||||||
|
Layers,
|
||||||
|
Layout,
|
||||||
|
LifeBuoy,
|
||||||
|
Link2Off,
|
||||||
|
Link2,
|
||||||
|
Link,
|
||||||
|
Linkedin,
|
||||||
|
List,
|
||||||
|
Loader,
|
||||||
|
Lock,
|
||||||
|
LogIn,
|
||||||
|
LogOut,
|
||||||
|
Mail,
|
||||||
|
MapPin,
|
||||||
|
Map,
|
||||||
|
Maximize2,
|
||||||
|
Maximize,
|
||||||
|
Meh,
|
||||||
|
Menu,
|
||||||
|
MessageCircle,
|
||||||
|
MessageSquare,
|
||||||
|
MicOff,
|
||||||
|
Mic,
|
||||||
|
Minimize2,
|
||||||
|
Minimize,
|
||||||
|
MinusCircle,
|
||||||
|
MinusSquare,
|
||||||
|
Minus,
|
||||||
|
Monitor,
|
||||||
|
Moon,
|
||||||
|
MoreHorizontal,
|
||||||
|
MoreVertical,
|
||||||
|
MousePointer,
|
||||||
|
Move,
|
||||||
|
Music,
|
||||||
|
Navigation2,
|
||||||
|
Navigation,
|
||||||
|
Network,
|
||||||
|
Octagon,
|
||||||
|
Package,
|
||||||
|
Paperclip,
|
||||||
|
PauseCircle,
|
||||||
|
Pause,
|
||||||
|
PenTool,
|
||||||
|
Percent,
|
||||||
|
PhoneCall,
|
||||||
|
PhoneForwarded,
|
||||||
|
PhoneIncoming,
|
||||||
|
PhoneMissed,
|
||||||
|
PhoneOff,
|
||||||
|
PhoneOutgoing,
|
||||||
|
Phone,
|
||||||
|
PieChart,
|
||||||
|
PlayCircle,
|
||||||
|
Play,
|
||||||
|
PlusCircle,
|
||||||
|
PlusSquare,
|
||||||
|
Plus,
|
||||||
|
Pocket,
|
||||||
|
Power,
|
||||||
|
Printer,
|
||||||
|
Radio,
|
||||||
|
RefreshCcw,
|
||||||
|
RefreshCw,
|
||||||
|
Repeat,
|
||||||
|
Rewind,
|
||||||
|
RotateCcw,
|
||||||
|
RotateCw,
|
||||||
|
Rss,
|
||||||
|
Save,
|
||||||
|
Scissors,
|
||||||
|
ScreenShareOff,
|
||||||
|
ScreenShare,
|
||||||
|
Search,
|
||||||
|
Send,
|
||||||
|
Server,
|
||||||
|
Settings,
|
||||||
|
Share2,
|
||||||
|
Share,
|
||||||
|
ShieldOff,
|
||||||
|
Shield,
|
||||||
|
ShoppingBag,
|
||||||
|
ShoppingCart,
|
||||||
|
Shuffle,
|
||||||
|
Sidebar,
|
||||||
|
SkipBack,
|
||||||
|
SkipForward,
|
||||||
|
Slack,
|
||||||
|
Slash,
|
||||||
|
Sliders,
|
||||||
|
Smartphone,
|
||||||
|
Smile,
|
||||||
|
Snowflake,
|
||||||
|
SortAsc,
|
||||||
|
SortDesc,
|
||||||
|
Speaker,
|
||||||
|
Square,
|
||||||
|
Star,
|
||||||
|
StopCircle,
|
||||||
|
Strikethrough,
|
||||||
|
Sun,
|
||||||
|
Sunrise,
|
||||||
|
Sunset,
|
||||||
|
SwitchCamera,
|
||||||
|
Tablet,
|
||||||
|
Tag,
|
||||||
|
Target,
|
||||||
|
Terminal,
|
||||||
|
Thermometer,
|
||||||
|
ThumbsDown,
|
||||||
|
ThumbsUp,
|
||||||
|
ToggleLeft,
|
||||||
|
ToggleRight,
|
||||||
|
Tool,
|
||||||
|
Trash2,
|
||||||
|
Trash,
|
||||||
|
Trello,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
Triangle,
|
||||||
|
Truck,
|
||||||
|
Tv,
|
||||||
|
Twitch,
|
||||||
|
Twitter,
|
||||||
|
Type,
|
||||||
|
Umbrella,
|
||||||
|
Underline,
|
||||||
|
Unlink2,
|
||||||
|
Unlink,
|
||||||
|
Unlock,
|
||||||
|
UploadCloud,
|
||||||
|
Upload,
|
||||||
|
UserCheck,
|
||||||
|
UserMinus,
|
||||||
|
UserPlus,
|
||||||
|
UserX,
|
||||||
|
User,
|
||||||
|
Users,
|
||||||
|
VideoOff,
|
||||||
|
Video,
|
||||||
|
Voicemail,
|
||||||
|
Volume1,
|
||||||
|
Volume2,
|
||||||
|
VolumeX,
|
||||||
|
Volume,
|
||||||
|
Watch,
|
||||||
|
WifiOff,
|
||||||
|
Wifi,
|
||||||
|
Wind,
|
||||||
|
XCircle,
|
||||||
|
XOctagon,
|
||||||
|
XSquare,
|
||||||
|
X,
|
||||||
|
Youtube,
|
||||||
|
ZapOff,
|
||||||
|
Zap,
|
||||||
|
ZoomIn,
|
||||||
|
ZoomOut };
|
||||||
28
scripts/build/generateIconFiles.js
Normal file
28
scripts/build/generateIconFiles.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import prettier from 'prettier';
|
||||||
|
import { generateComponentName } from './helpers';
|
||||||
|
|
||||||
|
export default function(iconVNodesObject) {
|
||||||
|
|
||||||
|
const icons = Object.keys(iconVNodesObject);
|
||||||
|
|
||||||
|
icons.forEach(icon => {
|
||||||
|
const location = path.join(process.cwd(), "src/icons", `${icon}.js`);
|
||||||
|
const ComponentName = generateComponentName(icon);
|
||||||
|
|
||||||
|
const VNode = JSON.stringify(iconVNodesObject[icon]);
|
||||||
|
|
||||||
|
const element = `
|
||||||
|
export default [${VNode}]
|
||||||
|
`
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
location,
|
||||||
|
prettier.format(element, { parser: "babel" }),
|
||||||
|
"utf-8"
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log("Successfully built", ComponentName);
|
||||||
|
});
|
||||||
|
}
|
||||||
43
scripts/build/generateReactFile.js
Normal file
43
scripts/build/generateReactFile.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import prettier from 'prettier';
|
||||||
|
|
||||||
|
import { generateComponentName } from './helpers';
|
||||||
|
|
||||||
|
const FILE_NAME = "react.js";
|
||||||
|
|
||||||
|
const resetFile = fs.writeFileSync(path.join(process.cwd(), FILE_NAME), "", "utf-8");
|
||||||
|
const writeFile = (content) => fs.appendFileSync(
|
||||||
|
path.join(process.cwd(), FILE_NAME),
|
||||||
|
content,
|
||||||
|
"utf-8"
|
||||||
|
);
|
||||||
|
|
||||||
|
export default function(iconVNodesObject) {
|
||||||
|
|
||||||
|
writeFile();
|
||||||
|
writeFile(`import getReactComponent from './src/getReactComponent';\n`);
|
||||||
|
|
||||||
|
// const componentName = generateComponentName(icon);
|
||||||
|
const icons = Object.keys(iconVNodesObject);
|
||||||
|
|
||||||
|
// icons.forEach(iconName => {
|
||||||
|
// const constantString = `const ${componentName} = getReactComponent();\n`;
|
||||||
|
// const exportString = `export ${componentName};\n`;
|
||||||
|
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
// icons.forEach(iconName => {
|
||||||
|
// const constantString = `const ${componentName} = getReactComponent();\n`;
|
||||||
|
// const exportString = `export ${componentName};\n`;
|
||||||
|
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
|
const exportStringNames = icons.map(iconName => generateComponentName(iconName)).join(",\n");
|
||||||
|
const exportString = `export { ${exportStringNames} };\n`;
|
||||||
|
|
||||||
|
writeFile(exportString);
|
||||||
|
}
|
||||||
0
scripts/build/generateVueFile.js
Normal file
0
scripts/build/generateVueFile.js
Normal file
8
scripts/build/helpers.js
Normal file
8
scripts/build/helpers.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import upperCamelCase from 'upperCamelCase';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a componentName of a String.
|
||||||
|
*
|
||||||
|
* @param {string} iconName
|
||||||
|
*/
|
||||||
|
export const generateComponentName = (iconName) => iconName === "github" ? "GitHub" : upperCamelCase(iconName);
|
||||||
23
scripts/buildIcons.js
Normal file
23
scripts/buildIcons.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
import renderIconsObject from './render/renderIconsObject';
|
||||||
|
import renderIconVNodes from './render/renderIconVNodes';
|
||||||
|
import generateIconFiles from './build/generateIconFiles';
|
||||||
|
import generateReactFile from './build/generateReactFile';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const IN_DIR = path.resolve(__dirname, '../icons');
|
||||||
|
// const OUT_FILE = path.resolve(__dirname, '../dist/icons.json');
|
||||||
|
|
||||||
|
// console.log(`Building ${OUT_FILE}...`);
|
||||||
|
|
||||||
|
const svgFiles = fs.readdirSync(IN_DIR).filter(file => path.extname(file) === '.svg');
|
||||||
|
const getSvg = svgFile => fs.readFileSync(path.join(IN_DIR, svgFile));
|
||||||
|
|
||||||
|
const icons = renderIconsObject(svgFiles, getSvg);
|
||||||
|
const iconVnodes = renderIconVNodes(icons);
|
||||||
|
|
||||||
|
// generateIconFiles(iconVnodes);
|
||||||
|
generateReactFile(iconVnodes);
|
||||||
11
scripts/render/default-attrs.json
Normal file
11
scripts/render/default-attrs.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"xmlns": "http://www.w3.org/2000/svg",
|
||||||
|
"width": 24,
|
||||||
|
"height": 24,
|
||||||
|
"viewBox": "0 0 24 24",
|
||||||
|
"fill": "none",
|
||||||
|
"stroke": "currentColor",
|
||||||
|
"stroke-width": 2,
|
||||||
|
"stroke-linecap": "round",
|
||||||
|
"stroke-linejoin": "round"
|
||||||
|
}
|
||||||
32
scripts/render/renderIconVNodes.js
Normal file
32
scripts/render/renderIconVNodes.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import DEFAULT_ATTRS from './default-attrs.json';
|
||||||
|
import { parseDOM } from 'htmlparser2';
|
||||||
|
|
||||||
|
export default (iconsObject) => {
|
||||||
|
const iconVnodes = {}
|
||||||
|
|
||||||
|
for(const icon in iconsObject) {
|
||||||
|
|
||||||
|
const svgString = iconsObject[icon];
|
||||||
|
const dom = parseDOM(svgString);
|
||||||
|
|
||||||
|
const children = [
|
||||||
|
...dom.map(element => ([
|
||||||
|
element.name,
|
||||||
|
{
|
||||||
|
...element.attribs,
|
||||||
|
}
|
||||||
|
])),
|
||||||
|
];
|
||||||
|
|
||||||
|
iconVnodes[icon] = [
|
||||||
|
'svg',
|
||||||
|
{
|
||||||
|
...DEFAULT_ATTRS,
|
||||||
|
},
|
||||||
|
children
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return iconVnodes;
|
||||||
|
}
|
||||||
|
|
||||||
35
scripts/render/renderIconsObject.js
Normal file
35
scripts/render/renderIconsObject.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import path from 'path';
|
||||||
|
import cheerio from 'cheerio';
|
||||||
|
import { minify } from 'html-minifier';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get contents between opening and closing `<svg>` tags.
|
||||||
|
* @param {string} svg
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
function getSvgContents(svg) {
|
||||||
|
const $ = cheerio.load(svg);
|
||||||
|
|
||||||
|
return minify($('svg').html(), { collapseWhitespace: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build an object in the format: `{ <name>: <contents> }`.
|
||||||
|
* @param {string[]} svgFiles - A list of filenames.
|
||||||
|
* @param {Function} getSvg - A function that returns the contents of an SVG file given a filename.
|
||||||
|
* @returns {Object}
|
||||||
|
*/
|
||||||
|
export default (svgFiles, getSvg) => {
|
||||||
|
return svgFiles
|
||||||
|
.map(svgFile => {
|
||||||
|
const name = path.basename(svgFile, '.svg');
|
||||||
|
const svg = getSvg(svgFile);
|
||||||
|
const contents = getSvgContents(svg);
|
||||||
|
return { name, contents };
|
||||||
|
})
|
||||||
|
.reduce((icons, icon) => {
|
||||||
|
icons[icon.name] = icon.contents;
|
||||||
|
return icons;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
17
src/getElement.js
Normal file
17
src/getElement.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const createElement = (tag, attrs, children = []) => {
|
||||||
|
const element = document.createElement(tag);
|
||||||
|
|
||||||
|
Object.keys(attrs).forEach(name => {
|
||||||
|
element.setAttribute(name, attrs[name]);
|
||||||
|
})
|
||||||
|
|
||||||
|
if (children.length) {
|
||||||
|
children = children.forEach(child => {
|
||||||
|
const childElement = createElement(child);
|
||||||
|
|
||||||
|
element.appendChild(childElement);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default (iconVnode) => createElement(iconVnode);
|
||||||
33
src/getReactComponent.js
Normal file
33
src/getReactComponent.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { forwardRef, createElement } from "react";
|
||||||
|
|
||||||
|
export default (iconName, [tag, attrs, children]) => {
|
||||||
|
const Component = forwardRef(
|
||||||
|
(
|
||||||
|
{ color = "currentColor", size = 24, width = 2, ...rest },
|
||||||
|
ref
|
||||||
|
) =>
|
||||||
|
createElement(
|
||||||
|
tag,
|
||||||
|
{
|
||||||
|
ref,
|
||||||
|
...attrs,
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
color,
|
||||||
|
strokeWidth: width,
|
||||||
|
...rest
|
||||||
|
},
|
||||||
|
children.map(([childTag, childAttrs]) =>
|
||||||
|
createElement(childTag, childAttrs)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Component.propTypes = {
|
||||||
|
color: PropTypes.string,
|
||||||
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
|
};
|
||||||
|
|
||||||
|
Component.displayName = `${iconName}`;
|
||||||
|
}
|
||||||
31
src/getVueComponent.js
Normal file
31
src/getVueComponent.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
export default (iconName, [tag, attrs, children]) => ({
|
||||||
|
name: iconName,
|
||||||
|
functional: true,
|
||||||
|
render(
|
||||||
|
createElement,
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
color = "currentColor",
|
||||||
|
size = 48,
|
||||||
|
width = 2,
|
||||||
|
strokeWidth = 2,
|
||||||
|
...rest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
return createElement(
|
||||||
|
tag,
|
||||||
|
{
|
||||||
|
attrs: {
|
||||||
|
...attrs,
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
color,
|
||||||
|
strokeWidth,
|
||||||
|
...rest
|
||||||
|
}
|
||||||
|
},
|
||||||
|
children.map(([tag, attrs]) => createElement(tag, { attrs }))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
0
src/icons/.gitkeep
Normal file
0
src/icons/.gitkeep
Normal file
244
yarn-error.log
Normal file
244
yarn-error.log
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
Arguments:
|
||||||
|
/usr/local/bin/node /usr/local/Cellar/yarn/1.22.4/libexec/bin/yarn.js
|
||||||
|
|
||||||
|
PATH:
|
||||||
|
/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin
|
||||||
|
|
||||||
|
Yarn version:
|
||||||
|
1.22.4
|
||||||
|
|
||||||
|
Node version:
|
||||||
|
12.18.2
|
||||||
|
|
||||||
|
Platform:
|
||||||
|
darwin x64
|
||||||
|
|
||||||
|
Trace:
|
||||||
|
SyntaxError: /Users/ericfennis/Development/featherity/package.json: Unexpected token } in JSON at position 997
|
||||||
|
at JSON.parse (<anonymous>)
|
||||||
|
at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:1625:59
|
||||||
|
at Generator.next (<anonymous>)
|
||||||
|
at step (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:310:30)
|
||||||
|
at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:321:13
|
||||||
|
|
||||||
|
npm manifest:
|
||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"react:compile": "yarn workspace react compile",
|
||||||
|
"build": "./build.sh"
|
||||||
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"packages/react"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "^5.2.5",
|
||||||
|
"@commitlint/config-conventional": "^6.1.3",
|
||||||
|
"algoliasearch": "^3.27.1",
|
||||||
|
"babel-cli": "^6.24.1",
|
||||||
|
"babel-loader": "^7.1.1",
|
||||||
|
"babel-preset-env": "^1.7.0",
|
||||||
|
"babel-preset-stage-2": "^6.24.1",
|
||||||
|
"cheerio": "^1.0.0-rc.2",
|
||||||
|
"commitizen": "^2.9.6",
|
||||||
|
"cz-conventional-changelog": "^2.1.0",
|
||||||
|
"eslint": "^4.19.1",
|
||||||
|
"eslint-config-airbnb-base": "^12.1.0",
|
||||||
|
"eslint-config-prettier": "^2.9.0",
|
||||||
|
"eslint-plugin-import": "^2.5.0",
|
||||||
|
"eslint-plugin-prettier": "^2.5.0",
|
||||||
|
"html-minifier": "^3.5.8",
|
||||||
|
"husky": "^0.14.3",
|
||||||
|
"jest": "^22.4.4",
|
||||||
|
"lint-staged": "^6.0.0",
|
||||||
|
"npm-run-all": "^4.1.2",
|
||||||
|
"prettier": "^1.8.2",
|
||||||
|
"semantic-release": "^12.2.2",
|
||||||
|
"svgo": "^0.7.2",
|
||||||
|
"webpack": "^4.8.3",
|
||||||
|
"webpack-cli": "^2.1.3"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
yarn manifest:
|
||||||
|
No manifest
|
||||||
|
|
||||||
|
Lockfile:
|
||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
"@types/node@*":
|
||||||
|
version "14.0.13"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.13.tgz#ee1128e881b874c371374c1f72201893616417c9"
|
||||||
|
integrity sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==
|
||||||
|
|
||||||
|
boolbase@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
|
||||||
|
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
|
||||||
|
|
||||||
|
camelcase@^4.1.0:
|
||||||
|
version "4.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
|
||||||
|
integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=
|
||||||
|
|
||||||
|
cheerio@^1.0.0-rc.3:
|
||||||
|
version "1.0.0-rc.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6"
|
||||||
|
integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==
|
||||||
|
dependencies:
|
||||||
|
css-select "~1.2.0"
|
||||||
|
dom-serializer "~0.1.1"
|
||||||
|
entities "~1.1.1"
|
||||||
|
htmlparser2 "^3.9.1"
|
||||||
|
lodash "^4.15.0"
|
||||||
|
parse5 "^3.0.1"
|
||||||
|
|
||||||
|
css-select@~1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
|
||||||
|
integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
|
||||||
|
dependencies:
|
||||||
|
boolbase "~1.0.0"
|
||||||
|
css-what "2.1"
|
||||||
|
domutils "1.5.1"
|
||||||
|
nth-check "~1.0.1"
|
||||||
|
|
||||||
|
css-what@2.1:
|
||||||
|
version "2.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
|
||||||
|
integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
|
||||||
|
|
||||||
|
dom-serializer@0:
|
||||||
|
version "0.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
|
||||||
|
integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
|
||||||
|
dependencies:
|
||||||
|
domelementtype "^2.0.1"
|
||||||
|
entities "^2.0.0"
|
||||||
|
|
||||||
|
dom-serializer@~0.1.1:
|
||||||
|
version "0.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
|
||||||
|
integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
|
||||||
|
dependencies:
|
||||||
|
domelementtype "^1.3.0"
|
||||||
|
entities "^1.1.1"
|
||||||
|
|
||||||
|
domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
|
||||||
|
version "1.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
|
||||||
|
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
|
||||||
|
|
||||||
|
domelementtype@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d"
|
||||||
|
integrity sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==
|
||||||
|
|
||||||
|
domhandler@^2.3.0:
|
||||||
|
version "2.4.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
|
||||||
|
integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
|
||||||
|
dependencies:
|
||||||
|
domelementtype "1"
|
||||||
|
|
||||||
|
domutils@1.5.1:
|
||||||
|
version "1.5.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
|
||||||
|
integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
|
||||||
|
dependencies:
|
||||||
|
dom-serializer "0"
|
||||||
|
domelementtype "1"
|
||||||
|
|
||||||
|
domutils@^1.5.1:
|
||||||
|
version "1.7.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
|
||||||
|
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
|
||||||
|
dependencies:
|
||||||
|
dom-serializer "0"
|
||||||
|
domelementtype "1"
|
||||||
|
|
||||||
|
entities@^1.1.1, entities@~1.1.1:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
|
||||||
|
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
|
||||||
|
|
||||||
|
entities@^2.0.0:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f"
|
||||||
|
integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==
|
||||||
|
|
||||||
|
htmlparser2@^3.9.1:
|
||||||
|
version "3.10.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
|
||||||
|
integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
|
||||||
|
dependencies:
|
||||||
|
domelementtype "^1.3.1"
|
||||||
|
domhandler "^2.3.0"
|
||||||
|
domutils "^1.5.1"
|
||||||
|
entities "^1.1.1"
|
||||||
|
inherits "^2.0.1"
|
||||||
|
readable-stream "^3.1.1"
|
||||||
|
|
||||||
|
inherits@^2.0.1, inherits@^2.0.3:
|
||||||
|
version "2.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||||
|
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||||
|
|
||||||
|
lodash@^4.15.0:
|
||||||
|
version "4.17.15"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||||
|
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||||
|
|
||||||
|
nth-check@~1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
|
||||||
|
integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
|
||||||
|
dependencies:
|
||||||
|
boolbase "~1.0.0"
|
||||||
|
|
||||||
|
parse5@^3.0.1:
|
||||||
|
version "3.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c"
|
||||||
|
integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
prettier@^2.0.5:
|
||||||
|
version "2.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
|
||||||
|
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
|
||||||
|
|
||||||
|
readable-stream@^3.1.1:
|
||||||
|
version "3.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
|
||||||
|
integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
|
||||||
|
dependencies:
|
||||||
|
inherits "^2.0.3"
|
||||||
|
string_decoder "^1.1.1"
|
||||||
|
util-deprecate "^1.0.1"
|
||||||
|
|
||||||
|
safe-buffer@~5.2.0:
|
||||||
|
version "5.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
|
||||||
|
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||||
|
|
||||||
|
string_decoder@^1.1.1:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
|
||||||
|
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
|
||||||
|
dependencies:
|
||||||
|
safe-buffer "~5.2.0"
|
||||||
|
|
||||||
|
uppercamelcase@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/uppercamelcase/-/uppercamelcase-3.0.0.tgz#380b321b8d73cba16fec4d752a575152d1ef7317"
|
||||||
|
integrity sha1-OAsyG41zy6Fv7E11KldRUtHvcxc=
|
||||||
|
dependencies:
|
||||||
|
camelcase "^4.1.0"
|
||||||
|
|
||||||
|
util-deprecate@^1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
|
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||||
Reference in New Issue
Block a user