@iconify/tools 2.0.14 → 2.0.15
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.
- package/lib/colors/attribs.cjs +30 -0
- package/lib/colors/attribs.d.ts +13 -10
- package/lib/colors/attribs.mjs +7 -13
- package/lib/colors/parse.cjs +269 -0
- package/lib/colors/parse.d.ts +15 -11
- package/lib/colors/parse.mjs +27 -31
- package/lib/colors/validate.cjs +52 -0
- package/lib/colors/validate.d.ts +11 -4
- package/lib/colors/validate.mjs +19 -6
- package/lib/css/parse.cjs +26 -0
- package/lib/css/parse.d.ts +3 -1
- package/lib/css/parse.mjs +8 -6
- package/lib/css/parser/error.cjs +25 -0
- package/lib/css/parser/error.d.ts +4 -2
- package/lib/css/parser/error.mjs +2 -4
- package/lib/css/parser/export.cjs +48 -0
- package/lib/css/parser/export.d.ts +5 -2
- package/lib/css/parser/export.mjs +4 -6
- package/lib/css/parser/strings.cjs +77 -0
- package/lib/css/parser/strings.d.ts +6 -3
- package/lib/css/parser/strings.mjs +4 -6
- package/lib/css/parser/text.cjs +135 -0
- package/lib/css/parser/text.d.ts +8 -5
- package/lib/css/parser/text.mjs +3 -8
- package/lib/css/parser/tokens.cjs +184 -0
- package/lib/css/parser/tokens.d.ts +6 -3
- package/lib/css/parser/tokens.mjs +7 -13
- package/lib/css/parser/tree.cjs +42 -0
- package/lib/css/parser/tree.d.ts +5 -2
- package/lib/css/parser/tree.mjs +2 -4
- package/lib/css/parser/types.cjs +2 -0
- package/lib/css/parser/types.d.ts +13 -11
- package/lib/css/parser/types.mjs +1 -0
- package/lib/download/api/cache.cjs +86 -0
- package/lib/download/api/cache.d.ts +8 -5
- package/lib/download/api/cache.mjs +14 -19
- package/lib/download/api/download.cjs +28 -0
- package/lib/download/api/download.d.ts +5 -2
- package/lib/download/api/download.mjs +8 -9
- package/lib/download/api/index.cjs +51 -0
- package/lib/download/api/index.d.ts +5 -2
- package/lib/download/api/index.mjs +8 -6
- package/lib/download/api/types.cjs +2 -0
- package/lib/download/api/types.d.ts +4 -2
- package/lib/download/api/types.mjs +1 -0
- package/lib/download/git/branch.cjs +22 -0
- package/lib/download/git/branch.d.ts +5 -2
- package/lib/download/git/branch.mjs +5 -5
- package/lib/download/git/hash.cjs +15 -0
- package/lib/download/git/hash.d.ts +5 -2
- package/lib/download/git/hash.mjs +5 -5
- package/lib/download/git/index.cjs +76 -0
- package/lib/download/git/index.d.ts +10 -8
- package/lib/download/git/index.mjs +41 -26
- package/lib/download/git/reset.cjs +41 -0
- package/lib/download/git/reset.d.ts +3 -1
- package/lib/download/git/reset.mjs +29 -5
- package/lib/download/github/hash.cjs +32 -0
- package/lib/download/github/hash.d.ts +5 -2
- package/lib/download/github/hash.mjs +10 -7
- package/lib/download/github/index.cjs +98 -0
- package/lib/download/github/index.d.ts +11 -9
- package/lib/download/github/index.mjs +23 -17
- package/lib/download/github/types.cjs +2 -0
- package/lib/download/github/types.d.ts +3 -1
- package/lib/download/github/types.mjs +1 -0
- package/lib/download/gitlab/hash.cjs +32 -0
- package/lib/download/gitlab/hash.d.ts +5 -2
- package/lib/download/gitlab/hash.mjs +10 -6
- package/lib/download/gitlab/index.cjs +98 -0
- package/lib/download/gitlab/index.d.ts +11 -9
- package/lib/download/gitlab/index.mjs +24 -18
- package/lib/download/gitlab/types.cjs +7 -0
- package/lib/download/gitlab/types.d.ts +4 -2
- package/lib/download/gitlab/types.mjs +3 -5
- package/lib/download/helpers/untar.cjs +14 -0
- package/lib/download/helpers/untar.d.ts +3 -1
- package/lib/download/helpers/untar.mjs +4 -5
- package/lib/download/helpers/unzip.cjs +19 -0
- package/lib/download/helpers/unzip.d.ts +3 -1
- package/lib/download/helpers/unzip.mjs +6 -7
- package/lib/download/index.cjs +64 -0
- package/lib/download/index.d.ts +18 -13
- package/lib/download/index.mjs +46 -19
- package/lib/download/npm/index.cjs +82 -0
- package/lib/download/npm/index.d.ts +10 -8
- package/lib/download/npm/index.mjs +16 -13
- package/lib/download/npm/types.cjs +2 -0
- package/lib/download/npm/types.d.ts +3 -1
- package/lib/download/npm/types.mjs +1 -0
- package/lib/download/npm/version.cjs +23 -0
- package/lib/download/npm/version.d.ts +7 -4
- package/lib/download/npm/version.mjs +8 -10
- package/lib/download/types/modified.cjs +2 -0
- package/lib/download/types/modified.d.ts +3 -1
- package/lib/download/types/modified.mjs +1 -0
- package/lib/download/types/sources.cjs +2 -0
- package/lib/download/types/sources.d.ts +4 -2
- package/lib/download/types/sources.mjs +1 -0
- package/lib/export/directory.cjs +45 -0
- package/lib/export/directory.d.ts +11 -4
- package/lib/export/directory.mjs +8 -8
- package/lib/export/helpers/custom-files.cjs +28 -0
- package/lib/export/helpers/custom-files.d.ts +4 -2
- package/lib/export/helpers/custom-files.mjs +8 -9
- package/lib/export/helpers/prepare.cjs +36 -0
- package/lib/export/helpers/prepare.d.ts +5 -3
- package/lib/export/helpers/prepare.mjs +7 -9
- package/lib/export/helpers/types-version.cjs +22 -0
- package/lib/export/helpers/types-version.d.ts +3 -1
- package/lib/export/helpers/types-version.mjs +15 -37
- package/lib/export/icon-package.cjs +59 -0
- package/lib/export/icon-package.d.ts +12 -5
- package/lib/export/icon-package.mjs +15 -16
- package/lib/export/json-package.cjs +133 -0
- package/lib/export/json-package.d.ts +12 -5
- package/lib/export/json-package.mjs +20 -21
- package/lib/icon-set/index.cjs +589 -0
- package/lib/icon-set/index.d.ts +9 -6
- package/lib/icon-set/index.mjs +40 -53
- package/lib/icon-set/match.cjs +58 -0
- package/lib/icon-set/match.d.ts +10 -3
- package/lib/icon-set/match.mjs +5 -6
- package/lib/icon-set/merge.cjs +83 -0
- package/lib/icon-set/merge.d.ts +9 -2
- package/lib/icon-set/merge.mjs +15 -10
- package/lib/icon-set/props.cjs +28 -0
- package/lib/icon-set/props.d.ts +8 -4
- package/lib/icon-set/props.mjs +7 -10
- package/lib/icon-set/types.cjs +2 -0
- package/lib/icon-set/types.d.ts +19 -17
- package/lib/icon-set/types.mjs +1 -0
- package/lib/import/directory.cjs +76 -0
- package/lib/import/directory.d.ts +11 -5
- package/lib/import/directory.mjs +36 -11
- package/lib/import/figma/index.cjs +105 -0
- package/lib/import/figma/index.d.ts +15 -5
- package/lib/import/figma/index.mjs +40 -13
- package/lib/import/figma/nodes.cjs +86 -0
- package/lib/import/figma/nodes.d.ts +13 -4
- package/lib/import/figma/nodes.mjs +3 -11
- package/lib/import/figma/query.cjs +218 -0
- package/lib/import/figma/query.d.ts +18 -9
- package/lib/import/figma/query.mjs +9 -12
- package/lib/import/figma/types/api.cjs +2 -0
- package/lib/import/figma/types/api.d.ts +8 -7
- package/lib/import/figma/types/api.mjs +1 -0
- package/lib/import/figma/types/nodes.cjs +2 -0
- package/lib/import/figma/types/nodes.d.ts +16 -9
- package/lib/import/figma/types/nodes.mjs +1 -0
- package/lib/import/figma/types/options.cjs +2 -0
- package/lib/import/figma/types/options.d.ts +17 -10
- package/lib/import/figma/types/options.mjs +1 -0
- package/lib/import/figma/types/result.cjs +2 -0
- package/lib/import/figma/types/result.d.ts +12 -5
- package/lib/import/figma/types/result.mjs +1 -0
- package/lib/index.cjs +137 -0
- package/lib/index.d.ts +65 -44
- package/lib/index.mjs +83 -94
- package/lib/misc/bump-version.cjs +17 -0
- package/lib/misc/bump-version.d.ts +3 -1
- package/lib/misc/bump-version.mjs +2 -4
- package/lib/misc/compare-dirs.cjs +75 -0
- package/lib/misc/compare-dirs.d.ts +4 -2
- package/lib/misc/compare-dirs.mjs +12 -12
- package/lib/misc/exec.cjs +25 -0
- package/lib/misc/exec.d.ts +6 -4
- package/lib/misc/exec.mjs +4 -5
- package/lib/misc/keyword.cjs +19 -0
- package/lib/misc/keyword.d.ts +3 -1
- package/lib/misc/keyword.mjs +2 -4
- package/lib/misc/scan.cjs +51 -0
- package/lib/misc/scan.d.ts +7 -6
- package/lib/misc/scan.mjs +6 -7
- package/lib/misc/write-json.cjs +11 -0
- package/lib/misc/write-json.d.ts +3 -1
- package/lib/misc/write-json.mjs +5 -6
- package/lib/optimise/flags.cjs +252 -0
- package/lib/optimise/flags.d.ts +7 -2
- package/lib/optimise/flags.mjs +18 -19
- package/lib/optimise/global-style.cjs +154 -0
- package/lib/optimise/global-style.d.ts +7 -2
- package/lib/optimise/global-style.mjs +18 -15
- package/lib/optimise/scale.cjs +26 -0
- package/lib/optimise/scale.d.ts +7 -2
- package/lib/optimise/scale.mjs +5 -5
- package/lib/optimise/svgo.cjs +83 -0
- package/lib/optimise/svgo.d.ts +10 -6
- package/lib/optimise/svgo.mjs +6 -9
- package/lib/svg/analyse/error.cjs +18 -0
- package/lib/svg/analyse/error.d.ts +5 -2
- package/lib/svg/analyse/error.mjs +2 -4
- package/lib/svg/analyse/types.cjs +2 -0
- package/lib/svg/analyse/types.d.ts +11 -11
- package/lib/svg/analyse/types.mjs +1 -0
- package/lib/svg/analyse.cjs +291 -0
- package/lib/svg/analyse.d.ts +8 -3
- package/lib/svg/analyse.mjs +15 -30
- package/lib/svg/cleanup/attribs.cjs +41 -0
- package/lib/svg/cleanup/attribs.d.ts +7 -2
- package/lib/svg/cleanup/attribs.mjs +6 -12
- package/lib/svg/cleanup/bad-tags.cjs +51 -0
- package/lib/svg/cleanup/bad-tags.d.ts +7 -2
- package/lib/svg/cleanup/bad-tags.mjs +10 -25
- package/lib/svg/cleanup/inline-style.cjs +64 -0
- package/lib/svg/cleanup/inline-style.d.ts +7 -2
- package/lib/svg/cleanup/inline-style.mjs +14 -19
- package/lib/svg/cleanup/root-svg.cjs +81 -0
- package/lib/svg/cleanup/root-svg.d.ts +7 -2
- package/lib/svg/cleanup/root-svg.mjs +7 -18
- package/lib/svg/cleanup/svgo-style.cjs +38 -0
- package/lib/svg/cleanup/svgo-style.d.ts +7 -2
- package/lib/svg/cleanup/svgo-style.mjs +16 -11
- package/lib/svg/cleanup.cjs +32 -0
- package/lib/svg/cleanup.d.ts +7 -2
- package/lib/svg/cleanup.mjs +21 -9
- package/lib/svg/data/attributes.cjs +355 -0
- package/lib/svg/data/attributes.d.ts +27 -25
- package/lib/svg/data/attributes.mjs +90 -115
- package/lib/svg/data/tags.cjs +137 -0
- package/lib/svg/data/tags.d.ts +25 -23
- package/lib/svg/data/tags.mjs +25 -49
- package/lib/svg/index.cjs +130 -0
- package/lib/svg/index.d.ts +16 -5
- package/lib/svg/index.mjs +48 -14
- package/lib/svg/parse-style.cjs +134 -0
- package/lib/svg/parse-style.d.ts +12 -8
- package/lib/svg/parse-style.mjs +11 -9
- package/lib/svg/parse.cjs +42 -0
- package/lib/svg/parse.d.ts +11 -7
- package/lib/svg/parse.mjs +2 -4
- package/package.json +99 -94
- package/lib/colors/attribs.js +0 -26
- package/lib/colors/parse.js +0 -341
- package/lib/colors/validate.js +0 -48
- package/lib/css/parse.js +0 -23
- package/lib/css/parser/error.js +0 -27
- package/lib/css/parser/export.js +0 -69
- package/lib/css/parser/strings.js +0 -93
- package/lib/css/parser/text.js +0 -171
- package/lib/css/parser/tokens.js +0 -200
- package/lib/css/parser/tree.js +0 -44
- package/lib/css/parser/types.js +0 -2
- package/lib/download/api/cache.js +0 -108
- package/lib/download/api/download.js +0 -27
- package/lib/download/api/index.js +0 -52
- package/lib/download/api/types.js +0 -2
- package/lib/download/git/branch.js +0 -22
- package/lib/download/git/hash.js +0 -14
- package/lib/download/git/index.js +0 -75
- package/lib/download/git/reset.js +0 -16
- package/lib/download/github/hash.js +0 -28
- package/lib/download/github/index.js +0 -116
- package/lib/download/github/types.js +0 -2
- package/lib/download/gitlab/hash.js +0 -27
- package/lib/download/gitlab/index.js +0 -115
- package/lib/download/gitlab/types.js +0 -7
- package/lib/download/helpers/untar.js +0 -14
- package/lib/download/helpers/unzip.js +0 -18
- package/lib/download/index.js +0 -27
- package/lib/download/npm/index.js +0 -91
- package/lib/download/npm/types.js +0 -2
- package/lib/download/npm/version.js +0 -27
- package/lib/download/types/modified.js +0 -2
- package/lib/download/types/sources.js +0 -2
- package/lib/export/directory.js +0 -52
- package/lib/export/helpers/custom-files.js +0 -32
- package/lib/export/helpers/prepare.js +0 -49
- package/lib/export/helpers/types-version.js +0 -12
- package/lib/export/icon-package.js +0 -77
- package/lib/export/json-package.js +0 -156
- package/lib/icon-set/index.js +0 -749
- package/lib/icon-set/match.js +0 -66
- package/lib/icon-set/merge.js +0 -90
- package/lib/icon-set/props.js +0 -34
- package/lib/icon-set/types.js +0 -2
- package/lib/import/directory.js +0 -59
- package/lib/import/figma/index.js +0 -90
- package/lib/import/figma/nodes.js +0 -106
- package/lib/import/figma/query.js +0 -244
- package/lib/import/figma/types/api.js +0 -12
- package/lib/import/figma/types/nodes.js +0 -2
- package/lib/import/figma/types/options.js +0 -2
- package/lib/import/figma/types/result.js +0 -2
- package/lib/index.js +0 -103
- package/lib/misc/bump-version.js +0 -19
- package/lib/misc/compare-dirs.js +0 -84
- package/lib/misc/exec.js +0 -26
- package/lib/misc/keyword.js +0 -31
- package/lib/misc/scan.js +0 -55
- package/lib/misc/write-json.js +0 -11
- package/lib/optimise/flags.js +0 -312
- package/lib/optimise/global-style.js +0 -185
- package/lib/optimise/scale.js +0 -42
- package/lib/optimise/svgo.js +0 -99
- package/lib/svg/analyse/error.js +0 -22
- package/lib/svg/analyse/types.js +0 -2
- package/lib/svg/analyse.js +0 -352
- package/lib/svg/cleanup/attribs.js +0 -51
- package/lib/svg/cleanup/bad-tags.js +0 -65
- package/lib/svg/cleanup/inline-style.js +0 -77
- package/lib/svg/cleanup/root-svg.js +0 -107
- package/lib/svg/cleanup/svgo-style.js +0 -35
- package/lib/svg/cleanup.js +0 -24
- package/lib/svg/data/attributes.js +0 -403
- package/lib/svg/data/tags.js +0 -188
- package/lib/svg/index.js +0 -134
- package/lib/svg/parse-style.js +0 -151
- package/lib/svg/parse.js +0 -49
package/lib/index.d.ts
CHANGED
|
@@ -1,44 +1,65 @@
|
|
|
1
|
-
export { SVG } from './svg/index';
|
|
2
|
-
export { parseSVG } from './svg/parse';
|
|
3
|
-
export { parseSVGStyle } from './svg/parse-style';
|
|
4
|
-
export { analyseSVGStructure } from './svg/analyse';
|
|
5
|
-
export { cleanupSVG } from './svg/cleanup';
|
|
6
|
-
export { removeBadAttributes } from './svg/cleanup/attribs';
|
|
7
|
-
export { checkBadTags } from './svg/cleanup/bad-tags';
|
|
8
|
-
export { cleanupInlineStyle } from './svg/cleanup/inline-style';
|
|
9
|
-
export { cleanupSVGRoot } from './svg/cleanup/root-svg';
|
|
10
|
-
export { convertStyleToAttrs } from './svg/cleanup/svgo-style';
|
|
11
|
-
export { IconSet, blankIconSet } from './icon-set/index';
|
|
12
|
-
export { mergeIconSets } from './icon-set/merge';
|
|
13
|
-
export { importFromFigma } from './import/figma/index';
|
|
14
|
-
export { importDirectory } from './import/directory';
|
|
15
|
-
export { downloadGitRepo } from './download/git/index';
|
|
16
|
-
export { getGitRepoHash } from './download/git/hash';
|
|
17
|
-
export { getGitRepoBranch } from './download/git/branch';
|
|
18
|
-
export { resetGitRepoContents } from './download/git/reset';
|
|
19
|
-
export { downloadGitHubRepo } from './download/github/index';
|
|
20
|
-
export { getGitHubRepoHash } from './download/github/hash';
|
|
21
|
-
export { downloadGitLabRepo } from './download/gitlab/index';
|
|
22
|
-
export { getGitLabRepoHash } from './download/gitlab/hash';
|
|
23
|
-
export { downloadNPMPackage } from './download/npm/index';
|
|
24
|
-
export { getNPMVersion, getPackageVersion } from './download/npm/version';
|
|
25
|
-
export { downloadPackage } from './download/index';
|
|
26
|
-
export {
|
|
27
|
-
export { validateColors } from './colors/validate';
|
|
28
|
-
export { runSVGO } from './optimise/svgo';
|
|
29
|
-
export { deOptimisePaths } from './optimise/flags';
|
|
30
|
-
export { scaleSVG } from './optimise/scale';
|
|
31
|
-
export { cleanupGlobalStyle } from './optimise/global-style';
|
|
32
|
-
export { exportToDirectory } from './export/directory';
|
|
33
|
-
export { exportIconPackage } from './export/icon-package';
|
|
34
|
-
export { exportJSONPackage } from './export/json-package';
|
|
35
|
-
export { writeJSONFile } from './misc/write-json';
|
|
36
|
-
export { prepareDirectoryForExport } from './export/helpers/prepare';
|
|
37
|
-
export { scanDirectory } from './misc/scan';
|
|
38
|
-
export { compareDirectories } from './misc/compare-dirs';
|
|
39
|
-
export { unzip } from './download/helpers/unzip';
|
|
40
|
-
export { untar } from './download/helpers/untar';
|
|
41
|
-
export { execAsync } from './misc/exec';
|
|
42
|
-
export { cleanupIconKeyword } from './misc/keyword';
|
|
43
|
-
export { bumpVersion } from './misc/bump-version';
|
|
44
|
-
export { sendAPIQuery } from './download/api/index';
|
|
1
|
+
export { SVG } from './svg/index.js';
|
|
2
|
+
export { parseSVG } from './svg/parse.js';
|
|
3
|
+
export { parseSVGStyle } from './svg/parse-style.js';
|
|
4
|
+
export { analyseSVGStructure } from './svg/analyse.js';
|
|
5
|
+
export { cleanupSVG } from './svg/cleanup.js';
|
|
6
|
+
export { removeBadAttributes } from './svg/cleanup/attribs.js';
|
|
7
|
+
export { checkBadTags } from './svg/cleanup/bad-tags.js';
|
|
8
|
+
export { cleanupInlineStyle } from './svg/cleanup/inline-style.js';
|
|
9
|
+
export { cleanupSVGRoot } from './svg/cleanup/root-svg.js';
|
|
10
|
+
export { convertStyleToAttrs } from './svg/cleanup/svgo-style.js';
|
|
11
|
+
export { IconSet, blankIconSet } from './icon-set/index.js';
|
|
12
|
+
export { mergeIconSets } from './icon-set/merge.js';
|
|
13
|
+
export { importFromFigma } from './import/figma/index.js';
|
|
14
|
+
export { importDirectory } from './import/directory.js';
|
|
15
|
+
export { downloadGitRepo } from './download/git/index.js';
|
|
16
|
+
export { getGitRepoHash } from './download/git/hash.js';
|
|
17
|
+
export { getGitRepoBranch } from './download/git/branch.js';
|
|
18
|
+
export { resetGitRepoContents } from './download/git/reset.js';
|
|
19
|
+
export { downloadGitHubRepo } from './download/github/index.js';
|
|
20
|
+
export { getGitHubRepoHash } from './download/github/hash.js';
|
|
21
|
+
export { downloadGitLabRepo } from './download/gitlab/index.js';
|
|
22
|
+
export { getGitLabRepoHash } from './download/gitlab/hash.js';
|
|
23
|
+
export { downloadNPMPackage } from './download/npm/index.js';
|
|
24
|
+
export { getNPMVersion, getPackageVersion } from './download/npm/version.js';
|
|
25
|
+
export { downloadPackage } from './download/index.js';
|
|
26
|
+
export { isEmptyColor, parseColors } from './colors/parse.js';
|
|
27
|
+
export { validateColors } from './colors/validate.js';
|
|
28
|
+
export { runSVGO } from './optimise/svgo.js';
|
|
29
|
+
export { deOptimisePaths } from './optimise/flags.js';
|
|
30
|
+
export { scaleSVG } from './optimise/scale.js';
|
|
31
|
+
export { cleanupGlobalStyle } from './optimise/global-style.js';
|
|
32
|
+
export { exportToDirectory } from './export/directory.js';
|
|
33
|
+
export { exportIconPackage } from './export/icon-package.js';
|
|
34
|
+
export { exportJSONPackage } from './export/json-package.js';
|
|
35
|
+
export { writeJSONFile } from './misc/write-json.js';
|
|
36
|
+
export { prepareDirectoryForExport } from './export/helpers/prepare.js';
|
|
37
|
+
export { scanDirectory } from './misc/scan.js';
|
|
38
|
+
export { compareDirectories } from './misc/compare-dirs.js';
|
|
39
|
+
export { unzip } from './download/helpers/unzip.js';
|
|
40
|
+
export { untar } from './download/helpers/untar.js';
|
|
41
|
+
export { execAsync } from './misc/exec.js';
|
|
42
|
+
export { cleanupIconKeyword } from './misc/keyword.js';
|
|
43
|
+
export { bumpVersion } from './misc/bump-version.js';
|
|
44
|
+
export { sendAPIQuery } from './download/api/index.js';
|
|
45
|
+
import '@iconify/types';
|
|
46
|
+
import '@iconify/utils/lib/customisations';
|
|
47
|
+
import './css/parser/types.js';
|
|
48
|
+
import './svg/analyse/types.js';
|
|
49
|
+
import './icon-set/types.js';
|
|
50
|
+
import './download/types/modified.js';
|
|
51
|
+
import './import/figma/types/options.js';
|
|
52
|
+
import './import/figma/types/nodes.js';
|
|
53
|
+
import './import/figma/types/api.js';
|
|
54
|
+
import './import/figma/types/result.js';
|
|
55
|
+
import './download/types/sources.js';
|
|
56
|
+
import './download/github/types.js';
|
|
57
|
+
import './download/gitlab/types.js';
|
|
58
|
+
import './download/npm/types.js';
|
|
59
|
+
import '@iconify/utils/lib/colors/types';
|
|
60
|
+
import './colors/attribs.js';
|
|
61
|
+
import 'svgo';
|
|
62
|
+
import './export/helpers/custom-files.js';
|
|
63
|
+
import 'fs';
|
|
64
|
+
import 'child_process';
|
|
65
|
+
import './download/api/types.js';
|
package/lib/index.mjs
CHANGED
|
@@ -1,94 +1,83 @@
|
|
|
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
|
-
import
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
removeBadAttributes,
|
|
85
|
-
resetGitRepoContents,
|
|
86
|
-
runSVGO,
|
|
87
|
-
scaleSVG,
|
|
88
|
-
scanDirectory,
|
|
89
|
-
sendAPIQuery,
|
|
90
|
-
untar,
|
|
91
|
-
unzip,
|
|
92
|
-
validateColors,
|
|
93
|
-
writeJSONFile
|
|
94
|
-
};
|
|
1
|
+
export { SVG } from './svg/index.mjs';
|
|
2
|
+
export { parseSVG } from './svg/parse.mjs';
|
|
3
|
+
export { parseSVGStyle } from './svg/parse-style.mjs';
|
|
4
|
+
export { analyseSVGStructure } from './svg/analyse.mjs';
|
|
5
|
+
export { cleanupSVG } from './svg/cleanup.mjs';
|
|
6
|
+
export { removeBadAttributes } from './svg/cleanup/attribs.mjs';
|
|
7
|
+
export { checkBadTags } from './svg/cleanup/bad-tags.mjs';
|
|
8
|
+
export { cleanupInlineStyle } from './svg/cleanup/inline-style.mjs';
|
|
9
|
+
export { cleanupSVGRoot } from './svg/cleanup/root-svg.mjs';
|
|
10
|
+
export { convertStyleToAttrs } from './svg/cleanup/svgo-style.mjs';
|
|
11
|
+
export { IconSet, blankIconSet } from './icon-set/index.mjs';
|
|
12
|
+
export { mergeIconSets } from './icon-set/merge.mjs';
|
|
13
|
+
export { importFromFigma } from './import/figma/index.mjs';
|
|
14
|
+
export { importDirectory } from './import/directory.mjs';
|
|
15
|
+
export { downloadGitRepo } from './download/git/index.mjs';
|
|
16
|
+
export { getGitRepoHash } from './download/git/hash.mjs';
|
|
17
|
+
export { getGitRepoBranch } from './download/git/branch.mjs';
|
|
18
|
+
export { resetGitRepoContents } from './download/git/reset.mjs';
|
|
19
|
+
export { downloadGitHubRepo } from './download/github/index.mjs';
|
|
20
|
+
export { getGitHubRepoHash } from './download/github/hash.mjs';
|
|
21
|
+
export { downloadGitLabRepo } from './download/gitlab/index.mjs';
|
|
22
|
+
export { getGitLabRepoHash } from './download/gitlab/hash.mjs';
|
|
23
|
+
export { downloadNPMPackage } from './download/npm/index.mjs';
|
|
24
|
+
export { getNPMVersion, getPackageVersion } from './download/npm/version.mjs';
|
|
25
|
+
export { downloadPackage } from './download/index.mjs';
|
|
26
|
+
export { isEmptyColor, parseColors } from './colors/parse.mjs';
|
|
27
|
+
export { validateColors } from './colors/validate.mjs';
|
|
28
|
+
export { runSVGO } from './optimise/svgo.mjs';
|
|
29
|
+
export { deOptimisePaths } from './optimise/flags.mjs';
|
|
30
|
+
export { scaleSVG } from './optimise/scale.mjs';
|
|
31
|
+
export { cleanupGlobalStyle } from './optimise/global-style.mjs';
|
|
32
|
+
export { exportToDirectory } from './export/directory.mjs';
|
|
33
|
+
export { exportIconPackage } from './export/icon-package.mjs';
|
|
34
|
+
export { exportJSONPackage } from './export/json-package.mjs';
|
|
35
|
+
export { writeJSONFile } from './misc/write-json.mjs';
|
|
36
|
+
export { prepareDirectoryForExport } from './export/helpers/prepare.mjs';
|
|
37
|
+
export { scanDirectory } from './misc/scan.mjs';
|
|
38
|
+
export { compareDirectories } from './misc/compare-dirs.mjs';
|
|
39
|
+
export { unzip } from './download/helpers/unzip.mjs';
|
|
40
|
+
export { untar } from './download/helpers/untar.mjs';
|
|
41
|
+
export { execAsync } from './misc/exec.mjs';
|
|
42
|
+
export { cleanupIconKeyword } from './misc/keyword.mjs';
|
|
43
|
+
export { bumpVersion } from './misc/bump-version.mjs';
|
|
44
|
+
export { sendAPIQuery } from './download/api/index.mjs';
|
|
45
|
+
import 'cheerio';
|
|
46
|
+
import '@iconify/utils';
|
|
47
|
+
import '@iconify/utils/lib/icon';
|
|
48
|
+
import './css/parse.mjs';
|
|
49
|
+
import './css/parser/tokens.mjs';
|
|
50
|
+
import './css/parser/error.mjs';
|
|
51
|
+
import './css/parser/strings.mjs';
|
|
52
|
+
import './css/parser/text.mjs';
|
|
53
|
+
import './css/parser/export.mjs';
|
|
54
|
+
import './css/parser/tree.mjs';
|
|
55
|
+
import './svg/data/attributes.mjs';
|
|
56
|
+
import './svg/data/tags.mjs';
|
|
57
|
+
import './svg/analyse/error.mjs';
|
|
58
|
+
import 'svgo';
|
|
59
|
+
import '@iconify/utils/lib/svg/build';
|
|
60
|
+
import '@iconify/utils/lib/customisations';
|
|
61
|
+
import '@iconify/utils/lib/icon-set/minify';
|
|
62
|
+
import '@iconify/utils/lib/icon-set/convert-info';
|
|
63
|
+
import './icon-set/props.mjs';
|
|
64
|
+
import './icon-set/match.mjs';
|
|
65
|
+
import './import/figma/nodes.mjs';
|
|
66
|
+
import './import/figma/query.mjs';
|
|
67
|
+
import './download/api/cache.mjs';
|
|
68
|
+
import 'fs';
|
|
69
|
+
import 'crypto';
|
|
70
|
+
import 'node-fetch';
|
|
71
|
+
import 'pathe';
|
|
72
|
+
import 'child_process';
|
|
73
|
+
import './download/api/download.mjs';
|
|
74
|
+
import 'util';
|
|
75
|
+
import 'stream';
|
|
76
|
+
import 'extract-zip';
|
|
77
|
+
import 'tar';
|
|
78
|
+
import '@iconify/utils/lib/colors';
|
|
79
|
+
import 'local-pkg';
|
|
80
|
+
import './download/gitlab/types.mjs';
|
|
81
|
+
import './colors/attribs.mjs';
|
|
82
|
+
import './export/helpers/types-version.mjs';
|
|
83
|
+
import './export/helpers/custom-files.mjs';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function bumpVersion(version) {
|
|
6
|
+
const versionParts = version.split(".");
|
|
7
|
+
const lastPart = versionParts.pop();
|
|
8
|
+
const num = parseInt(lastPart);
|
|
9
|
+
if (isNaN(num) || num + "" !== lastPart) {
|
|
10
|
+
versionParts.push(lastPart + ".1");
|
|
11
|
+
} else {
|
|
12
|
+
versionParts.push(num + 1 + "");
|
|
13
|
+
}
|
|
14
|
+
return versionParts.join(".");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.bumpVersion = bumpVersion;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/misc/bump-version.ts
|
|
2
1
|
function bumpVersion(version) {
|
|
3
2
|
const versionParts = version.split(".");
|
|
4
3
|
const lastPart = versionParts.pop();
|
|
@@ -10,6 +9,5 @@ function bumpVersion(version) {
|
|
|
10
9
|
}
|
|
11
10
|
return versionParts.join(".");
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
12
|
+
|
|
13
|
+
export { bumpVersion };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const export_helpers_prepare = require('../export/helpers/prepare.cjs');
|
|
7
|
+
const misc_scan = require('./scan.cjs');
|
|
8
|
+
require('pathe');
|
|
9
|
+
|
|
10
|
+
const textFileExtensions = [
|
|
11
|
+
"json",
|
|
12
|
+
"ts",
|
|
13
|
+
"js",
|
|
14
|
+
"mjs",
|
|
15
|
+
"cjs",
|
|
16
|
+
"jsx",
|
|
17
|
+
"tsx",
|
|
18
|
+
"vue",
|
|
19
|
+
"svelte",
|
|
20
|
+
"svg",
|
|
21
|
+
"txt",
|
|
22
|
+
"md"
|
|
23
|
+
];
|
|
24
|
+
async function compareDirectories(dir1, dir2, options) {
|
|
25
|
+
dir1 = export_helpers_prepare.normalizeDir(dir1);
|
|
26
|
+
dir2 = export_helpers_prepare.normalizeDir(dir2);
|
|
27
|
+
const files1 = await misc_scan.scanDirectory(dir1);
|
|
28
|
+
const files2 = await misc_scan.scanDirectory(dir2);
|
|
29
|
+
if (files1.length !== files2.length) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
options = options || {};
|
|
33
|
+
const ignoreNewLine = options.ignoreNewLine !== false;
|
|
34
|
+
const ignoreVersions = options.ignoreVersions !== false;
|
|
35
|
+
const textExtensions = new Set((options.textExtensions || []).concat(textFileExtensions));
|
|
36
|
+
for (let i = 0; i < files1.length; i++) {
|
|
37
|
+
const file = files1[i];
|
|
38
|
+
if (files2.indexOf(file) === -1) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const ext = file.split(".").pop().toLowerCase();
|
|
42
|
+
const isText = textExtensions.has(ext);
|
|
43
|
+
if (!isText) {
|
|
44
|
+
const content12 = await fs.promises.readFile(dir1 + "/" + file);
|
|
45
|
+
const content22 = await fs.promises.readFile(dir2 + "/" + file);
|
|
46
|
+
if (Buffer.compare(content12, content22) !== 0) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
let content1 = await fs.promises.readFile(dir1 + "/" + file, "utf8");
|
|
52
|
+
let content2 = await fs.promises.readFile(dir2 + "/" + file, "utf8");
|
|
53
|
+
if (content1 === content2) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (ignoreNewLine) {
|
|
57
|
+
content1 = content1.replace(/\s+\n/g, "\n").trimRight();
|
|
58
|
+
content2 = content2.replace(/\s+\n/g, "\n").trimRight();
|
|
59
|
+
}
|
|
60
|
+
if (ignoreVersions && file.split("/").pop() === "package.json") {
|
|
61
|
+
const data1 = JSON.parse(content1);
|
|
62
|
+
const data2 = JSON.parse(content2);
|
|
63
|
+
delete data1.version;
|
|
64
|
+
delete data2.version;
|
|
65
|
+
content1 = JSON.stringify(data1);
|
|
66
|
+
content2 = JSON.stringify(data2);
|
|
67
|
+
}
|
|
68
|
+
if (content1 !== content2) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
exports.compareDirectories = compareDirectories;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface CompareDirectoriesOptions {
|
|
2
2
|
ignoreNewLine?: boolean;
|
|
3
3
|
ignoreVersions?: boolean;
|
|
4
4
|
textExtensions?: string[];
|
|
@@ -6,4 +6,6 @@ export interface CompareDirectoriesOptions {
|
|
|
6
6
|
/**
|
|
7
7
|
* Compare directories. Returns true if files are identical, false if different
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
|
|
10
|
+
|
|
11
|
+
export { CompareDirectoriesOptions, compareDirectories };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { promises } from 'fs';
|
|
2
|
+
import { normalizeDir } from '../export/helpers/prepare.mjs';
|
|
3
|
+
import { scanDirectory } from './scan.mjs';
|
|
4
|
+
import 'pathe';
|
|
5
|
+
|
|
6
|
+
const textFileExtensions = [
|
|
6
7
|
"json",
|
|
7
8
|
"ts",
|
|
8
9
|
"js",
|
|
@@ -36,15 +37,15 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
36
37
|
const ext = file.split(".").pop().toLowerCase();
|
|
37
38
|
const isText = textExtensions.has(ext);
|
|
38
39
|
if (!isText) {
|
|
39
|
-
const content12 = await
|
|
40
|
-
const content22 = await
|
|
40
|
+
const content12 = await promises.readFile(dir1 + "/" + file);
|
|
41
|
+
const content22 = await promises.readFile(dir2 + "/" + file);
|
|
41
42
|
if (Buffer.compare(content12, content22) !== 0) {
|
|
42
43
|
return false;
|
|
43
44
|
}
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
|
-
let content1 = await
|
|
47
|
-
let content2 = await
|
|
47
|
+
let content1 = await promises.readFile(dir1 + "/" + file, "utf8");
|
|
48
|
+
let content2 = await promises.readFile(dir2 + "/" + file, "utf8");
|
|
48
49
|
if (content1 === content2) {
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
@@ -66,6 +67,5 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
66
67
|
}
|
|
67
68
|
return true;
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
70
|
+
|
|
71
|
+
export { compareDirectories };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const child_process = require('child_process');
|
|
6
|
+
|
|
7
|
+
function execAsync(cmd, options) {
|
|
8
|
+
return new Promise((fulfill, reject) => {
|
|
9
|
+
child_process.exec(cmd, {
|
|
10
|
+
...options,
|
|
11
|
+
encoding: "utf8"
|
|
12
|
+
}, (error, stdout, stderr) => {
|
|
13
|
+
if (error) {
|
|
14
|
+
reject(error);
|
|
15
|
+
} else {
|
|
16
|
+
fulfill({
|
|
17
|
+
stdout,
|
|
18
|
+
stderr
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.execAsync = execAsync;
|
package/lib/misc/exec.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ExecOptions } from 'child_process';
|
|
2
|
+
|
|
3
|
+
interface ExecResult {
|
|
4
4
|
stdout: string;
|
|
5
5
|
stderr: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Exec as Promise
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
|
|
11
|
+
|
|
12
|
+
export { ExecResult, execAsync };
|
package/lib/misc/exec.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
|
|
3
3
|
function execAsync(cmd, options) {
|
|
4
4
|
return new Promise((fulfill, reject) => {
|
|
5
5
|
exec(cmd, {
|
|
@@ -17,6 +17,5 @@ function execAsync(cmd, options) {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
20
|
+
|
|
21
|
+
export { execAsync };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function cleanupIconKeyword(keyword, convertCamelCase = false) {
|
|
6
|
+
if (convertCamelCase) {
|
|
7
|
+
keyword = keyword.replace(/[A-Z]+/g, (chars) => "_" + chars.toLowerCase());
|
|
8
|
+
}
|
|
9
|
+
keyword = keyword.toLowerCase().trim().replace(/[_.:]/g, "-").replace(/[^a-z0-9-]/g, "").replace(/[-]+/g, "-");
|
|
10
|
+
if (keyword.slice(0, 1) === "-") {
|
|
11
|
+
keyword = keyword.slice(1);
|
|
12
|
+
}
|
|
13
|
+
if (keyword.slice(-1) === "-") {
|
|
14
|
+
keyword = keyword.slice(0, -1);
|
|
15
|
+
}
|
|
16
|
+
return keyword;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.cleanupIconKeyword = cleanupIconKeyword;
|
package/lib/misc/keyword.d.ts
CHANGED
package/lib/misc/keyword.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/misc/keyword.ts
|
|
2
1
|
function cleanupIconKeyword(keyword, convertCamelCase = false) {
|
|
3
2
|
if (convertCamelCase) {
|
|
4
3
|
keyword = keyword.replace(/[A-Z]+/g, (chars) => "_" + chars.toLowerCase());
|
|
@@ -12,6 +11,5 @@ function cleanupIconKeyword(keyword, convertCamelCase = false) {
|
|
|
12
11
|
}
|
|
13
12
|
return keyword;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
14
|
+
|
|
15
|
+
export { cleanupIconKeyword };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
async function scanDirectory(path, callback, subdirs = true) {
|
|
8
|
+
const results = [];
|
|
9
|
+
if (path.length && path.slice(-1) !== "/") {
|
|
10
|
+
path += "/";
|
|
11
|
+
}
|
|
12
|
+
async function scan(subdir) {
|
|
13
|
+
const files = await fs.promises.readdir(path + subdir);
|
|
14
|
+
for (let i = 0; i < files.length; i++) {
|
|
15
|
+
const filename = files[i];
|
|
16
|
+
if (filename.slice(0, 1) === ".") {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const stat = await fs.promises.stat(path + subdir + filename);
|
|
20
|
+
if (stat.isDirectory()) {
|
|
21
|
+
if (subdirs) {
|
|
22
|
+
await scan(subdir + filename + "/");
|
|
23
|
+
}
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (!stat.isFile()) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const parts = filename.split(".");
|
|
30
|
+
const ext = parts.length > 1 ? "." + parts.pop() : "";
|
|
31
|
+
const file = parts.join(".");
|
|
32
|
+
let callbackResult;
|
|
33
|
+
if (callback) {
|
|
34
|
+
callbackResult = callback(ext, file, subdir, path, stat);
|
|
35
|
+
if (callbackResult instanceof Promise) {
|
|
36
|
+
callbackResult = await callbackResult;
|
|
37
|
+
}
|
|
38
|
+
if (callbackResult === void 0 || callbackResult === false || callbackResult === null) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
callbackResult = true;
|
|
43
|
+
}
|
|
44
|
+
results.push(callbackResult === true ? subdir + filename : callbackResult);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await scan("");
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exports.scanDirectory = scanDirectory;
|