From ea39ab67ed52f072275b5efd05a277fa56c723c9 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sun, 18 Feb 2024 01:16:26 +0100 Subject: [PATCH] build fixes --- .build/update-icons.mjs | 3 +- package.json | 2 +- packages/icons-react-native/README.md | 88 +++++++++++++++++++++++++++ packages/icons-sprite/README.md | 70 +++++++++++++++++++++ packages/icons-sprite/build.mjs | 5 +- packages/icons-sprite/package.json | 5 +- packages/icons-webfont/package.json | 3 +- packages/icons/README.md | 10 --- 8 files changed, 166 insertions(+), 20 deletions(-) create mode 100644 packages/icons-react-native/README.md create mode 100644 packages/icons-sprite/README.md diff --git a/.build/update-icons.mjs b/.build/update-icons.mjs index c9d183936..c1a04504c 100644 --- a/.build/update-icons.mjs +++ b/.build/update-icons.mjs @@ -5,8 +5,7 @@ import { ICONS_SRC_DIR, getMaxUnicode, getArgvs, getPackageJson } from './helper const p = getPackageJson(), argv = getArgvs(), - lastVersion = argv['latest-version'] || `${p.version}`, - newVersion = argv['new-version'] + newVersion = argv['new-version'] || `${p.version}` console.log(argv); diff --git a/package.json b/package.json index 5b5d37b56..b41ea298d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "changelog-commit": "git add . && node ./.build/changelog-commit.mjs", "changelog-image": "node ./.build/changelog-image.mjs", "update": "pnpm run update:icons", - "update:icons": "node ./.build/update-icons.mjs --new-version ${npm_config_new-version}", + "update:icons": "node ./.build/update-icons.mjs", "optimize": "node ./.build/optimize.mjs", "import": "node ./.build/import.mjs && pnpm run optimize", "import-tags": "node ./.build/import-tags.mjs", diff --git a/packages/icons-react-native/README.md b/packages/icons-react-native/README.md new file mode 100644 index 000000000..781cfb2f8 --- /dev/null +++ b/packages/icons-react-native/README.md @@ -0,0 +1,88 @@ +# Tabler Icons for React + +

+ Tabler Icons +

+ +

+Implementation of the Tabler Icons library for React applications. +

+ +

+ Browse all icons at tabler-icons.io → +

+ +

+ Latest Release + License +

+ +## Sponsors + +**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate on PayPal](https://paypal.me/codecalm) :)** + + + + + +## Installation + +``` +yarn add @tabler/icons-react-native +``` + +or + +``` +npm install @tabler/icons-react-native +``` + +or + +``` +pnpm install @tabler/icons-react-native +``` + +or just [download from Github](https://github.com/tabler/tabler-icons/releases). + +## How to use + +It's build with ESmodules so it's completely tree-shakable. Each icon can be imported as a component. + +```js +import { IconArrowLeft } from '@tabler/icons-react-native'; + +const App = () => { + return ; +}; + +export default App; +``` + +You can pass additional props to adjust the icon. + +```js + +``` + +### Props + +| name | type | default | +| ------------- | -------- | ------------ | +| `size` | _Number_ | 24 | +| `color` | _String_ | currentColor | +| `stroke` | _Number_ | 2 | + +## Contributing + +For more info on how to contribute please see the [contribution guidelines](https://github.com/tabler/tabler-icons/blob/main/CONTRIBUTING.md). + +Caught a mistake or want to contribute to the documentation? [Edit this page on Github](https://github.com/tabler/tabler-icons/blob/main/packages/icons-react-native/README.md) + +## License + +Tabler Icons is licensed under the [MIT License](https://github.com/tabler/tabler-icons/blob/master/LICENSE). + +## Sponsor Tabler + +Sponsor Tabler diff --git a/packages/icons-sprite/README.md b/packages/icons-sprite/README.md new file mode 100644 index 000000000..9fd428039 --- /dev/null +++ b/packages/icons-sprite/README.md @@ -0,0 +1,70 @@ +# Tabler Icons + +

+ Tabler Icons +

+ +

+ A set of 5115 free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a 2px stroke. +

+ +

+ Browse all icons at tabler-icons.io → +

+ +

+ Latest Release + License +

+ +## Sponsors + +**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate on PayPal](https://paypal.me/codecalm) :)** + + + + + +## Installation + +``` +yarn add @tabler/icons-sprite +``` + +or + +``` +npm install @tabler/icons-sprite +``` + +or + +``` +pnpm install @tabler/icons-sprite +``` + +or just [download from Github](https://github.com/tabler/tabler-icons/releases). + +## Usage + +Add an icon to be displayed on your page with the following markup (`activity` in the above example can be replaced with any valid icon name): + +```html + + + +``` + +## Contributing + +For more info on how to contribute please see the [contribution guidelines](https://github.com/tabler/tabler-icons/blob/main/CONTRIBUTING.md). + +Caught a mistake or want to contribute to the documentation? [Edit this page on Github](https://github.com/tabler/tabler-icons/blob/main/packages/icons/README.md) + +## License + +Tabler Icons is licensed under the [MIT License](https://github.com/tabler/tabler-icons/blob/master/LICENSE). + +## Sponsor Tabler + +Sponsor Tabler diff --git a/packages/icons-sprite/build.mjs b/packages/icons-sprite/build.mjs index 9de3df8a2..3ecc4093a 100644 --- a/packages/icons-sprite/build.mjs +++ b/packages/icons-sprite/build.mjs @@ -20,8 +20,9 @@ const buildSprite = () => { let svg = `${svgContent}` - fs.writeFileSync('tabler-sprite.svg', svg) - fs.writeFileSync('tabler-sprite-nostroke.svg', svg.replace(/stroke-width="2"\s/g, '')) + fs.mkdirSync('dist', { recursive: true }) + fs.writeFileSync('dist/tabler-sprite.svg', svg) + fs.writeFileSync('dist/tabler-sprite-nostroke.svg', svg.replace(/stroke-width="2"\s/g, '')) } buildSprite() diff --git a/packages/icons-sprite/package.json b/packages/icons-sprite/package.json index 89ae461f3..1897a303b 100644 --- a/packages/icons-sprite/package.json +++ b/packages/icons-sprite/package.json @@ -10,8 +10,7 @@ }, "sideEffects": false, "files": [ - "sprite.svg", - "sprite-nostroke.svg" + "dist/*" ], "homepage": "https://tabler-icons.io", "bugs": { @@ -26,7 +25,7 @@ "build:icons": "node build.mjs", "copy": "pnpm run copy:license", "copy:license": "cp ../../LICENSE ./LICENSE", - "clean": "rm -rf tabler-sprite-nostroke.svg tabler-sprite.svg" + "clean": "rm -rf dist/*" }, "dependencies": { "@tabler/icons": "3.0.0-alpha.1" diff --git a/packages/icons-webfont/package.json b/packages/icons-webfont/package.json index e8caaa6ed..a6dbfdabe 100644 --- a/packages/icons-webfont/package.json +++ b/packages/icons-webfont/package.json @@ -28,8 +28,7 @@ "copy:license": "cp ../../LICENSE ./LICENSE" }, "files": [ - "fonts/*", - "tabler-icons.*" + "dist/*" ], "sass": "./tabler-icons.scss", "style": "./tabler-icons.min.css", diff --git a/packages/icons/README.md b/packages/icons/README.md index 0e1367304..3bfde9250 100644 --- a/packages/icons/README.md +++ b/packages/icons/README.md @@ -92,16 +92,6 @@ Thanks to that, you can change the size, color and the `stroke-width` of the ico } ``` -### SVG sprite - -Add an icon to be displayed on your page with the following markup (`activity` in the above example can be replaced with any valid icon name): - -```html - - - -``` - ## Contributing For more info on how to contribute please see the [contribution guidelines](https://github.com/tabler/tabler-icons/blob/main/CONTRIBUTING.md).