Home

simpleicons @main - refs - log -
-
https://git.jolheiser.com/simpleicons.git
Go library for simpleicons.org
tree log patch
migrate to deno Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQGQQ3aCQ3SVvVRQLBkESTU4I4KFRl+LWb6S+NfzLg4NvAbb49Ovp1Q3+KobbvSVuOx TUqDGum4vdOdSXrkWk2g8= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
1 day ago
7 changed files, 59 additions(+), 50 deletions(-)
.helix/languages.tomlREADME.mddeno.jsondeno.lockindex.tspackage.jsontsconfig.json
I .helix/languages.toml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
diff --git a/.helix/languages.toml b/.helix/languages.toml
new file mode 100644
index 0000000000000000000000000000000000000000..51e2e3bef12923c82fcc163d034a21c14b1c350b
--- /dev/null
+++ b/.helix/languages.toml
@@ -0,0 +1,11 @@
+[[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
M README.md -> README.md
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
diff --git a/README.md b/README.md
index b9377dc621ef23d29e6c5a0a0698e754a122fab1..4e430d3cae2a953b0dc689c2b54ed1f7f08d49ad 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
 # simpleicons
 
-To generate icons, run `bun run build`.
+To generate icons, run `deno task build:all`.
 
-Requires [bun](https://bun.sh/) and [gofumpt](https://github.com/mvdan/gofumpt).
+Requires [deno](https://deno.com/) 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.
\ No newline at end of file
+Same as the [original](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md), copied [here](LICENSE) for posterity.
I deno.json
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/deno.json b/deno.json
new file mode 100644
index 0000000000000000000000000000000000000000..0eaeee48ad197cf0a863c851a63145a925819cb3
--- /dev/null
+++ b/deno.json
@@ -0,0 +1,18 @@
+{
+  "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
I deno.lock
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/deno.lock b/deno.lock
new file mode 100644
index 0000000000000000000000000000000000000000..dcde1201333f22580ed6f1af72b870f15606d3b7
--- /dev/null
+++ b/deno.lock
@@ -0,0 +1,16 @@
+{
+  "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"
+    ]
+  }
+}
M index.ts -> index.ts
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/index.ts b/index.ts
index e9ffa167273d727074954319a395e6dcd8fc4212..062f0ad82a08c00fbadf1fbac8c1fe006c016d10 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},
-  `
+  `;
 }
 
-let tmpl = `package simpleicons
+const tmpl = `package simpleicons
 
 import "fmt"
 
@@ -29,7 +29,9 @@ }
 
 // SVG returns a complete SVG for the Icon
 func (i Icon) SVG() string {
-  return fmt.Sprintf(` + "`" + `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>%s</title><path d="%s"/></svg>` + "`" + `, i.Title, i.Path)
+  return fmt.Sprintf(` + "`" +
+  `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>%s</title><path d="%s"/></svg>` +
+  "`" + `, i.Title, i.Path)
 }
 
 var (
@@ -38,6 +40,6 @@   Icons = map[string]Icon{
   ${map}
 }
 )
-`
+`;
 const path = "./simpleicons.go";
-await Bun.write(path, tmpl);
+await Deno.writeTextFile(path, tmpl);
D package.json
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/package.json b/package.json
deleted file mode 100644
index 36acd091728cc824963746f9aa79f313c88a3b04..0000000000000000000000000000000000000000
--- a/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "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
D tsconfig.json
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/tsconfig.json b/tsconfig.json
deleted file mode 100644
index 7556e1d4b08faa29d4c23d3938bde02733f152ec..0000000000000000000000000000000000000000
--- a/tsconfig.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "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
-    ]
-  }
-}