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.
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-rc.11",
6
- "heroicons": "^2.0.0",
7
- "fs-extra": "^7.0.1",
8
- "globby": "11.0.0",
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": "3.0.1",
11
- "yargs": "15.1.0"
11
+ "trim-newlines": "5.0.0",
12
+ "yargs": "17.7.2"
12
13
  }
13
14
  }
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-env node */
3
- const fs = require("fs-extra");
4
- const path = require("path");
5
- const globby = require("globby");
6
- const cheerio = require("cheerio");
7
- const trimNewlines = require("trim-newlines");
8
- const yargs = require("yargs");
9
- const merge = require("lodash.merge");
10
- const keywords = require("./keywords.json");
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 = globby.sync(argv.input);
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 = cheerio.load(svg)("svg");
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.8.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-04-05 00:00:00.000000000 Z
11
+ date: 2024-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport