@iconify/tools 2.0.0-dev.4 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +90 -0
  2. package/lib/colors/parse.d.ts +1 -1
  3. package/lib/colors/parse.js +3 -1
  4. package/lib/colors/parse.mjs +2 -1
  5. package/lib/colors/validate.d.ts +11 -0
  6. package/lib/colors/validate.js +45 -0
  7. package/lib/colors/validate.mjs +33 -0
  8. package/lib/download/git/index.d.ts +7 -3
  9. package/lib/download/git/index.js +0 -3
  10. package/lib/download/github/index.d.ts +7 -3
  11. package/lib/download/github/index.js +13 -10
  12. package/lib/download/github/index.mjs +12 -8
  13. package/lib/download/helpers/untar.d.ts +4 -0
  14. package/lib/download/helpers/untar.js +14 -0
  15. package/lib/download/helpers/untar.mjs +11 -0
  16. package/lib/download/npm/index.d.ts +7 -3
  17. package/lib/download/npm/index.js +43 -15
  18. package/lib/download/npm/index.mjs +35 -9
  19. package/lib/export/helpers/types-version.js +3 -5
  20. package/lib/export/helpers/types-version.mjs +33 -1
  21. package/lib/import/figma/index.d.ts +3 -2
  22. package/lib/import/figma/index.js +0 -3
  23. package/lib/import/figma/query.d.ts +3 -2
  24. package/lib/import/figma/query.js +0 -3
  25. package/lib/import/figma/types/options.d.ts +4 -2
  26. package/lib/index.d.ts +37 -0
  27. package/lib/index.js +89 -0
  28. package/lib/index.mjs +80 -0
  29. package/lib/misc/bump-version.d.ts +4 -0
  30. package/lib/misc/bump-version.js +19 -0
  31. package/lib/misc/bump-version.mjs +15 -0
  32. package/lib/misc/compare-dirs.d.ts +9 -0
  33. package/lib/misc/compare-dirs.js +84 -0
  34. package/lib/misc/compare-dirs.mjs +71 -0
  35. package/lib/optimise/svgo.js +14 -3
  36. package/lib/optimise/svgo.mjs +9 -3
  37. package/lib/svg/cleanup/bad-tags.js +0 -2
  38. package/lib/svg/cleanup/bad-tags.mjs +0 -3
  39. package/lib/svg/data/tags.d.ts +0 -4
  40. package/lib/svg/data/tags.js +1 -9
  41. package/lib/svg/data/tags.mjs +0 -6
  42. package/lib/svg/index.d.ts +3 -0
  43. package/lib/svg/index.js +3 -0
  44. package/license.txt +21 -0
  45. package/package.json +36 -7
@@ -4,7 +4,7 @@
4
4
  * Icons cannot have anything that requires external resources, anything that renders inconsistently.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.allValidTags = exports.tagsBeforeAnimation = exports.tagsInsideDefs = exports.feMergeChildTags = exports.feLightningChildTags = exports.feComponentTransferChildTag = exports.filterChildTags = exports.feLightningTags = exports.filterTag = exports.patternTag = exports.gradientChildTags = exports.gradientTags = exports.animateMotionChildTags = exports.animateTags = exports.markerTag = exports.groupTag = exports.useTag = exports.shapeTags = exports.maskAndSymbolTags = exports.defsTag = exports.styleTag = exports.unsupportedTags = exports.badTags = void 0;
7
+ exports.allValidTags = exports.tagsInsideDefs = exports.feMergeChildTags = exports.feLightningChildTags = exports.feComponentTransferChildTag = exports.filterChildTags = exports.feLightningTags = exports.filterTag = exports.patternTag = exports.gradientChildTags = exports.gradientTags = exports.animateMotionChildTags = exports.animateTags = exports.markerTag = exports.groupTag = exports.useTag = exports.shapeTags = exports.maskAndSymbolTags = exports.defsTag = exports.styleTag = exports.unsupportedTags = exports.badTags = void 0;
8
8
  /**
9
9
  * Bad tags
10
10
  *
@@ -153,14 +153,6 @@ exports.tagsInsideDefs = new Set([
153
153
  ...exports.patternTag,
154
154
  ...exports.markerTag,
155
155
  ]);
156
- /**
157
- * Parent tags for animations
158
- */
159
- exports.tagsBeforeAnimation = new Set([
160
- ...exports.shapeTags,
161
- ...exports.filterChildTags,
162
- ...exports.feComponentTransferChildTag,
163
- ]);
164
156
  /**
165
157
  * All supported tags
166
158
  */
@@ -85,11 +85,6 @@ var tagsInsideDefs = new Set([
85
85
  ...patternTag,
86
86
  ...markerTag
87
87
  ]);
88
- var tagsBeforeAnimation = new Set([
89
- ...shapeTags,
90
- ...filterChildTags,
91
- ...feComponentTransferChildTag
92
- ]);
93
88
  var allValidTags = new Set([
94
89
  ...styleTag,
95
90
  ...defsTag,
@@ -129,7 +124,6 @@ export {
129
124
  patternTag,
130
125
  shapeTags,
131
126
  styleTag,
132
- tagsBeforeAnimation,
133
127
  tagsInsideDefs,
134
128
  unsupportedTags,
135
129
  useTag
@@ -5,6 +5,9 @@ export interface ViewBox {
5
5
  width: number;
6
6
  height: number;
7
7
  }
8
+ /**
9
+ * SVG class, used to manipulate icon content.
10
+ */
8
11
  export declare class SVG {
9
12
  $svg: cheerio.Root;
10
13
  viewBox: ViewBox;
package/lib/svg/index.js CHANGED
@@ -5,6 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SVG = void 0;
7
7
  const cheerio_1 = __importDefault(require("cheerio"));
8
+ /**
9
+ * SVG class, used to manipulate icon content.
10
+ */
8
11
  class SVG {
9
12
  /**
10
13
  * Constructor
package/license.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Vjacheslav Trushkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -2,10 +2,7 @@
2
2
  "name": "@iconify/tools",
3
3
  "description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
4
4
  "author": "Vjacheslav Trushkin",
5
- "version": "2.0.0-dev.4",
6
- "publishConfig": {
7
- "tag": "dev"
8
- },
5
+ "version": "2.0.3",
9
6
  "license": "MIT",
10
7
  "bugs": "https://github.com/iconify/tools/issues",
11
8
  "homepage": "https://github.com/iconify/tools",
@@ -13,7 +10,8 @@
13
10
  "type": "git",
14
11
  "url": "git://github.com/iconify/tools.git"
15
12
  },
16
- "main": "dist/index.js",
13
+ "main": "./lib/index.js",
14
+ "module": "./lib/index.mjs",
17
15
  "scripts": {
18
16
  "clean": "rimraf lib tests-compiled tsconfig.tsbuildinfo",
19
17
  "lint": "eslint src/**/*.ts",
@@ -24,17 +22,24 @@
24
22
  "test": "npm run test:jest && npm run test:jasmine"
25
23
  },
26
24
  "dependencies": {
27
- "@iconify/utils": "^1.0.18",
25
+ "@iconify/utils": "^1.0.20",
28
26
  "@types/cheerio": "^0.22.30",
29
27
  "@types/node-fetch": "^2.5.12",
28
+ "@types/svgo": "^2.6.0",
29
+ "@types/tar": "^6.1.0",
30
30
  "cheerio": "^1.0.0-rc.10",
31
31
  "extract-zip": "^2.0.1",
32
32
  "node-fetch": "^2.6.6",
33
33
  "pathe": "^0.2.0",
34
- "svgo": "^2.7.0"
34
+ "svgo": "^2.8.0",
35
+ "tar": "^6.1.11"
35
36
  },
36
37
  "exports": {
37
38
  "./*": "./*",
39
+ ".": {
40
+ "require": "./lib/index.js",
41
+ "import": "./lib/index.mjs"
42
+ },
38
43
  "./lib/colors/attribs": {
39
44
  "require": "./lib/colors/attribs.js",
40
45
  "import": "./lib/colors/attribs.mjs"
@@ -43,6 +48,10 @@
43
48
  "require": "./lib/colors/parse.js",
44
49
  "import": "./lib/colors/parse.mjs"
45
50
  },
51
+ "./lib/colors/validate": {
52
+ "require": "./lib/colors/validate.js",
53
+ "import": "./lib/colors/validate.mjs"
54
+ },
46
55
  "./lib/css/parse": {
47
56
  "require": "./lib/css/parse.js",
48
57
  "import": "./lib/css/parse.mjs"
@@ -123,6 +132,10 @@
123
132
  "require": "./lib/download/github/types.js",
124
133
  "import": "./lib/download/github/types.mjs"
125
134
  },
135
+ "./lib/download/helpers/untar": {
136
+ "require": "./lib/download/helpers/untar.js",
137
+ "import": "./lib/download/helpers/untar.mjs"
138
+ },
126
139
  "./lib/download/helpers/unzip": {
127
140
  "require": "./lib/download/helpers/unzip.js",
128
141
  "import": "./lib/download/helpers/unzip.mjs"
@@ -231,6 +244,22 @@
231
244
  "require": "./lib/import/figma/types/result.js",
232
245
  "import": "./lib/import/figma/types/result.mjs"
233
246
  },
247
+ "./lib": {
248
+ "require": "./lib/index.js",
249
+ "import": "./lib/index.mjs"
250
+ },
251
+ "./lib/index": {
252
+ "require": "./lib/index.js",
253
+ "import": "./lib/index.mjs"
254
+ },
255
+ "./lib/misc/bump-version": {
256
+ "require": "./lib/misc/bump-version.js",
257
+ "import": "./lib/misc/bump-version.mjs"
258
+ },
259
+ "./lib/misc/compare-dirs": {
260
+ "require": "./lib/misc/compare-dirs.js",
261
+ "import": "./lib/misc/compare-dirs.mjs"
262
+ },
234
263
  "./lib/misc/exec": {
235
264
  "require": "./lib/misc/exec.js",
236
265
  "import": "./lib/misc/exec.mjs"