Skip to content

Commit

Permalink
Refactor to use svgr + tsc instead, bump remixicon
Browse files Browse the repository at this point in the history
  • Loading branch information
SvanT committed Sep 15, 2024
1 parent d77a6be commit 7b8b797
Show file tree
Hide file tree
Showing 16 changed files with 1,116 additions and 615 deletions.
55 changes: 0 additions & 55 deletions .github/dependabot.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/publish-remixicon-update.yml

This file was deleted.

10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
build
publish-*/*
!publish-*/package.json
.DS_Store
dist
!dist/package.json
node_modules
9 changes: 0 additions & 9 deletions CHANGELOG.md

This file was deleted.

7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# remixicon-react [![npm package](https://img.shields.io/npm/v/remixicon-react.svg?style=flat-square)](https://npmjs.org/package/remixicon-react) [![Remix Icons version](https://img.shields.io/badge/remixicon-v2.4.0-blue.svg?style=flat-square)](https://remixicon.com/) [![build status](https://img.shields.io/travis/bayesimpact/remixicon-react/master.svg?style=flat-square)](https://travis-ci.org/bayesimpact/remixicon-react)
[Remix Icons](https://remixicon.com/) for React packaged as single components

This repo is based on the very good [mdi-react](https://github.com/levrik/mdi-react) package.

## Installation

```bash
npm install dathost-remixicon-react
# or if you use Yarn
yarn add dathost-remixicon-react
```

## Usage
Expand Down
29 changes: 29 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const childProcess = require("node:child_process");
const fs = require("node:fs");
const path = require("node:path");

childProcess.execFileSync(
"pnpm",
[
"svgr",
"--typescript",
"--no-index",
"--memo",
"--out-dir=build",
"node_modules/remixicon/icons",
],
{ stdio: "inherit" }
);

for (const category of fs.readdirSync("build")) {
const categoryDir = path.join("build", category);
for (const filename of fs.readdirSync(categoryDir)) {
fs.renameSync(
path.join("build", category, filename),
path.join("build", `Svg${filename}`)
);
}
fs.rmdirSync(categoryDir);
}

childProcess.execFileSync("pnpm", ["tsc"], { stdio: "inherit" });
9 changes: 6 additions & 3 deletions publish-react/package.json → dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dathost-remixicon-react",
"version": "1.0.3",
"version": "1.0.4",
"description": "Remix Icon for React",
"keywords": [
"remixicon",
Expand All @@ -13,7 +13,7 @@
"url": "git+ssh://[email protected]/dathost/remixicon-react.git"
},
"scripts": {
"prepublishOnly": "cd .. && npm run build-react"
"prepublishOnly": "cd .. && pnpm build"
},
"author": "Svante Boberg <[email protected]>",
"license": "(MIT AND OFL-1.1)",
Expand All @@ -25,5 +25,8 @@
"react": ">=0.14.0"
},
"typings": "./dist/typings.d.ts",
"sideEffects": false
"sideEffects": false,
"dependencies": {
"typescript": "^5.6.2"
}
}
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@
},
"homepage": "https://github.com/dathost/remixicon-react",
"scripts": {
"clean-react": "rm -rf publish-react/*.js publish-react/*.d.ts publish-react/**/*.js publish-react/**/*.d.ts",
"clean": "npm clean-react",
"build-react": "npm run clean-react && node scripts/generate-react.js && cp README.md publish-react/README.md && cp CHANGELOG.md publish-react/CHANGELOG.md && cp LICENSE publish-react/LICENSE"
"build": "rm -rf build dist/*.js dist/*.d.ts && node build.js && cp README.md dist/README.md && cp LICENSE dist/LICENSE"
},
"dependencies": {
"remixicon": "3.2.0"
"@svgr/cli": "8.1.0",
"@types/react": "18.3.5",
"remixicon": "4.3.0",
"typescript": "5.6.2"
},
"devDependencies": {
"@swc/core": "^1.3.56",
"@types/node": "^18.16.3",
"@types/react": "^18.2.4",
"react": "^18.2.0",
"semver": "^7.3.5"
}
"packageManager": "[email protected]"
}
Loading

0 comments on commit 7b8b797

Please sign in to comment.