heroicons_helper 0.8.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/heroicons_helper.gemspec +1 -1
- data/lib/heroicons_helper/data.json +1 -1
- data/lib/heroicons_helper/version.rb +1 -1
- data/package-lock.json +307 -247
- data/package.json +7 -6
- data/script/update_heroicons +11 -11
- metadata +2 -2
data/package.json
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "heroicons_helper",
|
3
3
|
"private": true,
|
4
|
+
"type": "module",
|
4
5
|
"devDependencies": {
|
5
|
-
"cheerio": "1.0.0
|
6
|
-
"heroicons": "^2.
|
7
|
-
"fs-extra": "^
|
8
|
-
"globby": "
|
6
|
+
"cheerio": "1.0.0",
|
7
|
+
"heroicons": "^2.2.0",
|
8
|
+
"fs-extra": "^11.2.0",
|
9
|
+
"globby": "14.0.2",
|
9
10
|
"lodash.merge": "4.6.2",
|
10
|
-
"trim-newlines": "
|
11
|
-
"yargs": "
|
11
|
+
"trim-newlines": "5.0.0",
|
12
|
+
"yargs": "17.7.2"
|
12
13
|
}
|
13
14
|
}
|
data/script/update_heroicons
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
/* eslint-env node */
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
import fs from "fs-extra";
|
4
|
+
import path from "path";
|
5
|
+
import { globbySync } from "globby";
|
6
|
+
import { load as cheerioLoad } from "cheerio";
|
7
|
+
import { trimNewlines } from "trim-newlines";
|
8
|
+
import yargs from "yargs";
|
9
|
+
import merge from "lodash.merge";
|
10
|
+
import keywords from "./keywords.json" assert { type: "json" };
|
11
11
|
|
12
12
|
// This script generates a JSON file that contains
|
13
13
|
// information about input SVG files.
|
14
|
-
const { argv } = yargs
|
14
|
+
const { argv } = yargs()
|
15
15
|
.usage("Usage: $0 --output <output filepath>")
|
16
16
|
.example("$0 --input icons/**/*.svg --output build/data.json")
|
17
17
|
.option("input", {
|
@@ -33,7 +33,7 @@ const { argv } = yargs
|
|
33
33
|
default: "lib/heroicons_helper/data.json",
|
34
34
|
});
|
35
35
|
|
36
|
-
const filepaths =
|
36
|
+
const filepaths = globbySync(argv.input);
|
37
37
|
const svgFilepaths = filepaths.filter(
|
38
38
|
(filepath) => path.parse(filepath).ext === ".svg"
|
39
39
|
);
|
@@ -65,7 +65,7 @@ const icons = svgFilepaths.map((filepath) => {
|
|
65
65
|
const size = splitDir.pop();
|
66
66
|
|
67
67
|
const svg = fs.readFileSync(path.resolve(filepath), "utf8");
|
68
|
-
const svgElement =
|
68
|
+
const svgElement = cheerioLoad(svg)("svg");
|
69
69
|
let svgAttributes = omit(svgElement[0].attribs, "aria-hidden");
|
70
70
|
let svgWidth = parseInt(svgElement.attr("width")) || parseInt(size);
|
71
71
|
let svgHeight = parseInt(svgElement.attr("height")) || parseInt(size);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroicons_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|