diff --git a/.helix/languages.toml b/.helix/languages.toml
deleted file mode 100644
index 51e2e3bef12923c82fcc163d034a21c14b1c350b..0000000000000000000000000000000000000000
--- a/.helix/languages.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[[language]]
-name = "typescript"
-roots = ["deno.json"]
-file-types = ["ts"]
-auto-format = true
-language-servers = ["deno-lsp"]
-
-[language-server.deno-lsp]
-command = "deno"
-args = ["lsp"]
-config.deno.enable = true
diff --git a/README.md b/README.md
index 4e430d3cae2a953b0dc689c2b54ed1f7f08d49ad..b9377dc621ef23d29e6c5a0a0698e754a122fab1 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
# simpleicons
-To generate icons, run `deno task build:all`.
+To generate icons, run `bun run build`.
-Requires [deno](https://deno.com/) and [gofumpt](https://github.com/mvdan/gofumpt).
+Requires [bun](https://bun.sh/) and [gofumpt](https://github.com/mvdan/gofumpt).
## License
-Same as the [original](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md), copied [here](LICENSE) for posterity.
+Same as the [original](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md), copied [here](LICENSE) for posterity.
\ No newline at end of file
diff --git a/deno.json b/deno.json
deleted file mode 100644
index 0eaeee48ad197cf0a863c851a63145a925819cb3..0000000000000000000000000000000000000000
--- a/deno.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "simpleicons",
- "version": "1.0.0",
- "exports": "./index.ts",
- "tasks": {
- "build": "deno run --allow-read --allow-write --allow-run index.ts",
- "format": "gofumpt -w .",
- "build:all": "deno task build && deno task format"
- },
- "imports": {
- "simple-icons": "npm:simple-icons@^15.19.0"
- },
- "compilerOptions": {
- "lib": [
- "deno.window"
- ]
- }
-}
\ No newline at end of file
diff --git a/deno.lock b/deno.lock
deleted file mode 100644
index dcde1201333f22580ed6f1af72b870f15606d3b7..0000000000000000000000000000000000000000
--- a/deno.lock
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "version": "5",
- "specifiers": {
- "npm:simple-icons@^15.19.0": "15.22.0"
- },
- "npm": {
- "simple-icons@15.22.0": {
- "integrity": "sha512-i/w5Ie4tENfGYbdCo2iJ+oies0vOFd8QXWHopKOUzudfLCvnmeheF2PpHp89Z2azpc+c2su3lMiWO/SpP+429A=="
- }
- },
- "workspace": {
- "dependencies": [
- "npm:simple-icons@^15.19.0"
- ]
- }
-}
diff --git a/index.ts b/index.ts
index 062f0ad82a08c00fbadf1fbac8c1fe006c016d10..e9ffa167273d727074954319a395e6dcd8fc4212 100644
--- a/index.ts
+++ b/index.ts
@@ -1,21 +1,21 @@
-import * as icons from "simple-icons";
+import * as icons from 'simple-icons';
let structs = "";
let map = "";
-for (const [_name, icon] of Object.entries(icons)) {
- const varName = "SI" + icon.slug.charAt(0).toUpperCase() + icon.slug.slice(1);
+for (const [name, icon] of Object.entries(icons)) {
+ const varName = "SI" + icon.slug.charAt(0).toUpperCase() + icon.slug.slice(1);
structs += varName + ` = Icon{
Title: "${icon.title}",
Slug: "${icon.slug}",
Hex: "${icon.hex}",
Path: "${icon.path}",
}
- `;
+ `
map += `"${icon.slug}": ${varName},
- `;
+ `
}
-const tmpl = `package simpleicons
+let tmpl = `package simpleicons
import "fmt"
@@ -29,9 +29,7 @@ }
// SVG returns a complete SVG for the Icon
func (i Icon) SVG() string {
- return fmt.Sprintf(` + "`" +
- `` +
- "`" + `, i.Title, i.Path)
+ return fmt.Sprintf(` + "`" + `` + "`" + `, i.Title, i.Path)
}
var (
@@ -40,6 +38,6 @@ Icons = map[string]Icon{
${map}
}
)
-`;
+`
const path = "./simpleicons.go";
-await Deno.writeTextFile(path, tmpl);
+await Bun.write(path, tmpl);
diff --git a/package.json b/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..36acd091728cc824963746f9aa79f313c88a3b04
--- /dev/null
+++ b/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "simpleicons",
+ "module": "index.ts",
+ "type": "module",
+ "devDependencies": {
+ "bun-types": "latest",
+ "simple-icons": "^15.19.0"
+ },
+ "peerDependencies": {
+ "typescript": "^5.8.3"
+ },
+ "scripts": {
+ "build": "bun run index.ts",
+ "postbuild": "gofumpt -w ."
+ }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..7556e1d4b08faa29d4c23d3938bde02733f152ec
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "lib": ["ESNext"],
+ "module": "esnext",
+ "target": "esnext",
+ "moduleResolution": "bundler",
+ "moduleDetection": "force",
+ "allowImportingTsExtensions": true,
+ "noEmit": true,
+ "composite": true,
+ "strict": true,
+ "downlevelIteration": true,
+ "skipLibCheck": true,
+ "jsx": "react-jsx",
+ "allowSyntheticDefaultImports": true,
+ "forceConsistentCasingInFileNames": true,
+ "allowJs": true,
+ "types": [
+ "bun-types" // add Bun global
+ ]
+ }
+}