@iconify/tools 4.0.0-dev.1 → 4.0.1
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.d.cts +27 -0
- package/lib/colors/attribs.d.mts +27 -0
- package/lib/colors/attribs.d.ts +1 -1
- package/lib/colors/detect.cjs +2 -2
- package/lib/colors/detect.d.cts +16 -0
- package/lib/colors/detect.d.mts +16 -0
- package/lib/colors/detect.mjs +3 -3
- package/lib/colors/parse.cjs +132 -276
- package/lib/colors/parse.d.cts +60 -0
- package/lib/colors/parse.d.mts +60 -0
- package/lib/colors/parse.d.ts +7 -15
- package/lib/colors/parse.mjs +136 -279
- package/lib/colors/validate.cjs +2 -11
- package/lib/colors/validate.d.cts +20 -0
- package/lib/colors/validate.d.mts +20 -0
- package/lib/colors/validate.d.ts +4 -11
- package/lib/colors/validate.mjs +4 -12
- package/lib/css/parse.d.cts +6 -0
- package/lib/css/parse.d.mts +6 -0
- package/lib/css/parser/error.d.cts +13 -0
- package/lib/css/parser/error.d.mts +13 -0
- package/lib/css/parser/error.d.ts +1 -1
- package/lib/css/parser/export.d.cts +8 -0
- package/lib/css/parser/export.d.mts +8 -0
- package/lib/css/parser/strings.d.cts +16 -0
- package/lib/css/parser/strings.d.mts +16 -0
- package/lib/css/parser/text.d.cts +20 -0
- package/lib/css/parser/text.d.mts +20 -0
- package/lib/css/parser/tokens.d.cts +9 -0
- package/lib/css/parser/tokens.d.mts +9 -0
- package/lib/css/parser/tree.d.cts +8 -0
- package/lib/css/parser/tree.d.mts +8 -0
- package/lib/css/parser/types.d.cts +52 -0
- package/lib/css/parser/types.d.mts +52 -0
- package/lib/css/parser/types.d.ts +1 -1
- package/lib/download/api/cache.d.cts +20 -0
- package/lib/download/api/cache.d.mts +20 -0
- package/lib/download/api/config.cjs +11 -0
- package/lib/download/api/config.d.cts +18 -0
- package/lib/download/api/config.d.mts +18 -0
- package/lib/download/api/config.d.ts +18 -0
- package/lib/download/api/config.mjs +8 -0
- package/lib/download/api/download.cjs +15 -7
- package/lib/download/api/download.d.cts +8 -0
- package/lib/download/api/download.d.mts +8 -0
- package/lib/download/api/download.mjs +11 -7
- package/lib/download/api/index.cjs +23 -7
- package/lib/download/api/index.d.cts +8 -0
- package/lib/download/api/index.d.mts +8 -0
- package/lib/download/api/index.mjs +19 -7
- package/lib/download/api/queue.cjs +104 -0
- package/lib/download/api/queue.d.cts +32 -0
- package/lib/download/api/queue.d.mts +32 -0
- package/lib/download/api/queue.d.ts +32 -0
- package/lib/download/api/queue.mjs +101 -0
- package/lib/download/api/types.d.cts +17 -0
- package/lib/download/api/types.d.mts +17 -0
- package/lib/download/api/types.d.ts +1 -1
- package/lib/download/git/branch.d.cts +8 -0
- package/lib/download/git/branch.d.mts +8 -0
- package/lib/download/git/hash.d.cts +8 -0
- package/lib/download/git/hash.d.mts +8 -0
- package/lib/download/git/index.cjs +2 -4
- package/lib/download/git/index.d.cts +29 -0
- package/lib/download/git/index.d.mts +29 -0
- package/lib/download/git/index.d.ts +1 -1
- package/lib/download/git/index.mjs +2 -4
- package/lib/download/git/reset.cjs +2 -4
- package/lib/download/git/reset.d.cts +6 -0
- package/lib/download/git/reset.d.mts +6 -0
- package/lib/download/git/reset.mjs +2 -4
- package/lib/download/github/hash.cjs +2 -0
- package/lib/download/github/hash.d.cts +8 -0
- package/lib/download/github/hash.d.mts +8 -0
- package/lib/download/github/hash.mjs +2 -0
- package/lib/download/github/index.cjs +2 -2
- package/lib/download/github/index.d.cts +31 -0
- package/lib/download/github/index.d.mts +31 -0
- package/lib/download/github/index.d.ts +1 -1
- package/lib/download/github/index.mjs +2 -2
- package/lib/download/github/types.d.cts +11 -0
- package/lib/download/github/types.d.mts +11 -0
- package/lib/download/github/types.d.ts +1 -1
- package/lib/download/gitlab/hash.cjs +2 -0
- package/lib/download/gitlab/hash.d.cts +8 -0
- package/lib/download/gitlab/hash.d.mts +8 -0
- package/lib/download/gitlab/hash.mjs +2 -0
- package/lib/download/gitlab/index.cjs +2 -2
- package/lib/download/gitlab/index.d.cts +31 -0
- package/lib/download/gitlab/index.d.mts +31 -0
- package/lib/download/gitlab/index.d.ts +1 -1
- package/lib/download/gitlab/index.mjs +2 -2
- package/lib/download/gitlab/types.d.cts +15 -0
- package/lib/download/gitlab/types.d.mts +15 -0
- package/lib/download/gitlab/types.d.ts +1 -1
- package/lib/download/helpers/untar.d.cts +6 -0
- package/lib/download/helpers/untar.d.mts +6 -0
- package/lib/download/helpers/unzip.d.cts +6 -0
- package/lib/download/helpers/unzip.d.mts +6 -0
- package/lib/download/index.cjs +2 -2
- package/lib/download/index.d.cts +48 -0
- package/lib/download/index.d.mts +48 -0
- package/lib/download/index.d.ts +1 -1
- package/lib/download/index.mjs +2 -2
- package/lib/download/npm/index.cjs +2 -2
- package/lib/download/npm/index.d.cts +30 -0
- package/lib/download/npm/index.d.mts +30 -0
- package/lib/download/npm/index.d.ts +1 -1
- package/lib/download/npm/index.mjs +2 -2
- package/lib/download/npm/types.d.cts +9 -0
- package/lib/download/npm/types.d.mts +9 -0
- package/lib/download/npm/types.d.ts +1 -1
- package/lib/download/npm/version.d.cts +16 -0
- package/lib/download/npm/version.d.mts +16 -0
- package/lib/download/npm/version.d.ts +1 -1
- package/lib/download/types/modified.d.cts +6 -0
- package/lib/download/types/modified.d.mts +6 -0
- package/lib/download/types/modified.d.ts +1 -1
- package/lib/download/types/sources.d.cts +12 -0
- package/lib/download/types/sources.d.mts +12 -0
- package/lib/download/types/sources.d.ts +1 -1
- package/lib/export/directory.d.cts +26 -0
- package/lib/export/directory.d.mts +26 -0
- package/lib/export/directory.d.ts +1 -1
- package/lib/export/helpers/custom-files.d.cts +12 -0
- package/lib/export/helpers/custom-files.d.mts +12 -0
- package/lib/export/helpers/custom-files.d.ts +1 -1
- package/lib/export/helpers/prepare.d.cts +19 -0
- package/lib/export/helpers/prepare.d.mts +19 -0
- package/lib/export/helpers/prepare.d.ts +1 -1
- package/lib/export/helpers/types-version.d.cts +6 -0
- package/lib/export/helpers/types-version.d.mts +6 -0
- package/lib/export/icon-package.d.cts +26 -0
- package/lib/export/icon-package.d.mts +26 -0
- package/lib/export/icon-package.d.ts +2 -2
- package/lib/export/json-package.cjs +1 -0
- package/lib/export/json-package.d.cts +25 -0
- package/lib/export/json-package.d.mts +25 -0
- package/lib/export/json-package.d.ts +2 -1
- package/lib/export/json-package.mjs +1 -0
- package/lib/icon-set/index.cjs +25 -4
- package/lib/icon-set/index.d.cts +162 -0
- package/lib/icon-set/index.d.mts +162 -0
- package/lib/icon-set/index.mjs +25 -4
- package/lib/icon-set/match.d.cts +15 -0
- package/lib/icon-set/match.d.mts +15 -0
- package/lib/icon-set/merge.d.cts +14 -0
- package/lib/icon-set/merge.d.mts +14 -0
- package/lib/icon-set/modified.d.cts +16 -0
- package/lib/icon-set/modified.d.mts +16 -0
- package/lib/icon-set/props.d.cts +13 -0
- package/lib/icon-set/props.d.mts +13 -0
- package/lib/icon-set/tags.d.cts +23 -0
- package/lib/icon-set/tags.d.mts +23 -0
- package/lib/icon-set/types.d.cts +75 -0
- package/lib/icon-set/types.d.mts +75 -0
- package/lib/icon-set/types.d.ts +1 -1
- package/lib/import/directory.d.cts +52 -0
- package/lib/import/directory.d.mts +52 -0
- package/lib/import/directory.d.ts +1 -1
- package/lib/import/figma/index.cjs +3 -0
- package/lib/import/figma/index.d.cts +20 -0
- package/lib/import/figma/index.d.mts +20 -0
- package/lib/import/figma/index.mjs +3 -0
- package/lib/import/figma/nodes.cjs +1 -1
- package/lib/import/figma/nodes.d.cts +18 -0
- package/lib/import/figma/nodes.d.mts +18 -0
- package/lib/import/figma/nodes.mjs +1 -1
- package/lib/import/figma/query.cjs +104 -76
- package/lib/import/figma/query.d.cts +42 -0
- package/lib/import/figma/query.d.mts +42 -0
- package/lib/import/figma/query.d.ts +15 -2
- package/lib/import/figma/query.mjs +106 -78
- package/lib/import/figma/types/api.d.cts +53 -0
- package/lib/import/figma/types/api.d.mts +53 -0
- package/lib/import/figma/types/api.d.ts +1 -1
- package/lib/import/figma/types/nodes.d.cts +44 -0
- package/lib/import/figma/types/nodes.d.mts +44 -0
- package/lib/import/figma/types/nodes.d.ts +1 -1
- package/lib/import/figma/types/options.d.cts +59 -0
- package/lib/import/figma/types/options.d.mts +59 -0
- package/lib/import/figma/types/options.d.ts +1 -1
- package/lib/import/figma/types/result.d.cts +44 -0
- package/lib/import/figma/types/result.d.mts +44 -0
- package/lib/import/figma/types/result.d.ts +1 -1
- package/lib/index.cjs +15 -13
- package/lib/index.d.cts +78 -0
- package/lib/index.d.mts +78 -0
- package/lib/index.d.ts +8 -5
- package/lib/index.mjs +14 -12
- package/lib/misc/bump-version.d.cts +6 -0
- package/lib/misc/bump-version.d.mts +6 -0
- package/lib/misc/cheerio.d.cts +9 -0
- package/lib/misc/cheerio.d.mts +9 -0
- package/lib/misc/cheerio.d.ts +1 -1
- package/lib/misc/compare-dirs.cjs +3 -3
- package/lib/misc/compare-dirs.d.cts +11 -0
- package/lib/misc/compare-dirs.d.mts +11 -0
- package/lib/misc/compare-dirs.d.ts +1 -1
- package/lib/misc/compare-dirs.mjs +3 -3
- package/lib/misc/exec.d.cts +12 -0
- package/lib/misc/exec.d.mts +12 -0
- package/lib/misc/exec.d.ts +1 -1
- package/lib/misc/keyword.d.cts +6 -0
- package/lib/misc/keyword.d.mts +6 -0
- package/lib/misc/scan.d.cts +33 -0
- package/lib/misc/scan.d.mts +33 -0
- package/lib/misc/scan.d.ts +3 -3
- package/lib/misc/write-json.d.cts +6 -0
- package/lib/misc/write-json.d.mts +6 -0
- package/lib/optimise/figma.cjs +55 -33
- package/lib/optimise/figma.d.cts +13 -0
- package/lib/optimise/figma.d.mts +13 -0
- package/lib/optimise/figma.d.ts +3 -1
- package/lib/optimise/figma.mjs +55 -33
- package/lib/optimise/flags.cjs +3 -3
- package/lib/optimise/flags.d.cts +11 -0
- package/lib/optimise/flags.d.mts +11 -0
- package/lib/optimise/flags.d.ts +1 -1
- package/lib/optimise/flags.mjs +3 -3
- package/lib/optimise/global-style.cjs +7 -7
- package/lib/optimise/global-style.d.cts +11 -0
- package/lib/optimise/global-style.d.mts +11 -0
- package/lib/optimise/global-style.d.ts +1 -1
- package/lib/optimise/global-style.mjs +7 -7
- package/lib/optimise/mask.cjs +1 -1
- package/lib/optimise/mask.d.cts +24 -0
- package/lib/optimise/mask.d.mts +24 -0
- package/lib/optimise/mask.mjs +2 -2
- package/lib/optimise/origin.d.cts +11 -0
- package/lib/optimise/origin.d.mts +11 -0
- package/lib/optimise/scale.d.cts +11 -0
- package/lib/optimise/scale.d.mts +11 -0
- package/lib/optimise/svgo.cjs +1 -1
- package/lib/optimise/svgo.d.cts +37 -0
- package/lib/optimise/svgo.d.mts +37 -0
- package/lib/optimise/svgo.mjs +1 -1
- package/lib/optimise/unwrap.cjs +31 -0
- package/lib/optimise/unwrap.d.cts +11 -0
- package/lib/optimise/unwrap.d.mts +11 -0
- package/lib/optimise/unwrap.d.ts +11 -0
- package/lib/optimise/unwrap.mjs +29 -0
- package/lib/svg/analyse/error.d.cts +10 -0
- package/lib/svg/analyse/error.d.mts +10 -0
- package/lib/svg/analyse/error.d.ts +1 -0
- package/lib/svg/analyse/types.d.cts +92 -0
- package/lib/svg/analyse/types.d.mts +92 -0
- package/lib/svg/analyse/types.d.ts +4 -3
- package/lib/svg/analyse.cjs +2 -2
- package/lib/svg/analyse.d.cts +15 -0
- package/lib/svg/analyse.d.mts +15 -0
- package/lib/svg/analyse.d.ts +1 -0
- package/lib/svg/analyse.mjs +4 -4
- package/lib/svg/cleanup/attribs.cjs +1 -1
- package/lib/svg/cleanup/attribs.d.cts +11 -0
- package/lib/svg/cleanup/attribs.d.mts +11 -0
- package/lib/svg/cleanup/attribs.mjs +2 -2
- package/lib/svg/cleanup/bad-tags.cjs +1 -1
- package/lib/svg/cleanup/bad-tags.d.cts +17 -0
- package/lib/svg/cleanup/bad-tags.d.mts +17 -0
- package/lib/svg/cleanup/bad-tags.d.ts +1 -1
- package/lib/svg/cleanup/bad-tags.mjs +2 -2
- package/lib/svg/cleanup/inline-style.cjs +1 -1
- package/lib/svg/cleanup/inline-style.d.cts +11 -0
- package/lib/svg/cleanup/inline-style.d.mts +11 -0
- package/lib/svg/cleanup/inline-style.mjs +2 -2
- package/lib/svg/cleanup/root-style.cjs +1 -1
- package/lib/svg/cleanup/root-style.d.cts +17 -0
- package/lib/svg/cleanup/root-style.d.mts +17 -0
- package/lib/svg/cleanup/root-style.mjs +2 -2
- package/lib/svg/cleanup/root-svg.cjs +3 -3
- package/lib/svg/cleanup/root-svg.d.cts +11 -0
- package/lib/svg/cleanup/root-svg.d.mts +11 -0
- package/lib/svg/cleanup/root-svg.mjs +3 -3
- package/lib/svg/cleanup/svgo-style.cjs +2 -2
- package/lib/svg/cleanup/svgo-style.d.cts +11 -0
- package/lib/svg/cleanup/svgo-style.d.mts +11 -0
- package/lib/svg/cleanup/svgo-style.mjs +3 -3
- package/lib/svg/cleanup.d.cts +16 -0
- package/lib/svg/cleanup.d.mts +16 -0
- package/lib/svg/cleanup.d.ts +1 -1
- package/lib/svg/data/attributes.d.cts +77 -0
- package/lib/svg/data/attributes.d.mts +77 -0
- package/lib/svg/data/tags.d.cts +95 -0
- package/lib/svg/data/tags.d.mts +95 -0
- package/lib/svg/index.cjs +18 -1
- package/lib/svg/index.d.cts +52 -0
- package/lib/svg/index.d.mts +52 -0
- package/lib/svg/index.d.ts +5 -1
- package/lib/svg/index.mjs +19 -2
- package/lib/svg/parse-style.cjs +178 -235
- package/lib/svg/parse-style.d.cts +58 -0
- package/lib/svg/parse-style.d.mts +58 -0
- package/lib/svg/parse-style.d.ts +3 -9
- package/lib/svg/parse-style.mjs +180 -236
- package/lib/svg/parse.cjs +27 -59
- package/lib/svg/parse.d.cts +30 -0
- package/lib/svg/parse.d.mts +30 -0
- package/lib/svg/parse.d.ts +3 -10
- package/lib/svg/parse.mjs +28 -59
- package/package.json +34 -24
package/lib/index.cjs
CHANGED
|
@@ -39,8 +39,8 @@ const optimise_mask = require('./optimise/mask.cjs');
|
|
|
39
39
|
const optimise_scale = require('./optimise/scale.cjs');
|
|
40
40
|
const optimise_globalStyle = require('./optimise/global-style.cjs');
|
|
41
41
|
const export_directory = require('./export/directory.cjs');
|
|
42
|
-
const export_iconPackage = require('./export/icon-package.cjs');
|
|
43
42
|
const export_jsonPackage = require('./export/json-package.cjs');
|
|
43
|
+
const export_iconPackage = require('./export/icon-package.cjs');
|
|
44
44
|
const misc_writeJson = require('./misc/write-json.cjs');
|
|
45
45
|
const export_helpers_prepare = require('./export/helpers/prepare.cjs');
|
|
46
46
|
const misc_scan = require('./misc/scan.cjs');
|
|
@@ -50,7 +50,9 @@ const download_helpers_untar = require('./download/helpers/untar.cjs');
|
|
|
50
50
|
const misc_exec = require('./misc/exec.cjs');
|
|
51
51
|
const misc_keyword = require('./misc/keyword.cjs');
|
|
52
52
|
const misc_bumpVersion = require('./misc/bump-version.cjs');
|
|
53
|
+
const download_api_config = require('./download/api/config.cjs');
|
|
53
54
|
const download_api_index = require('./download/api/index.cjs');
|
|
55
|
+
const download_api_queue = require('./download/api/queue.cjs');
|
|
54
56
|
require('cheerio');
|
|
55
57
|
require('@iconify/utils');
|
|
56
58
|
require('./css/parse.cjs');
|
|
@@ -63,8 +65,6 @@ require('./css/parser/tree.cjs');
|
|
|
63
65
|
require('./svg/data/attributes.cjs');
|
|
64
66
|
require('./svg/data/tags.cjs');
|
|
65
67
|
require('./svg/analyse/error.cjs');
|
|
66
|
-
require('svgo');
|
|
67
|
-
require('@iconify/utils/lib/svg/id');
|
|
68
68
|
require('@iconify/utils/lib/icon/defaults');
|
|
69
69
|
require('@iconify/utils/lib/svg/build');
|
|
70
70
|
require('@iconify/utils/lib/icon-set/minify');
|
|
@@ -73,30 +73,30 @@ require('./icon-set/props.cjs');
|
|
|
73
73
|
require('@iconify/utils/lib/misc/objects');
|
|
74
74
|
require('./icon-set/match.cjs');
|
|
75
75
|
require('./icon-set/modified.cjs');
|
|
76
|
-
require('@iconify/utils/lib/colors');
|
|
77
|
-
require('./colors/attribs.cjs');
|
|
78
76
|
require('./import/figma/nodes.cjs');
|
|
79
77
|
require('./import/figma/query.cjs');
|
|
80
78
|
require('./download/api/cache.cjs');
|
|
81
79
|
require('fs');
|
|
82
80
|
require('crypto');
|
|
81
|
+
require('svgo');
|
|
82
|
+
require('@iconify/utils/lib/svg/id');
|
|
83
|
+
require('@iconify/utils/lib/colors');
|
|
84
|
+
require('axios');
|
|
83
85
|
require('pathe');
|
|
84
|
-
require('child_process');
|
|
85
|
-
require('util');
|
|
86
|
-
require('stream');
|
|
87
86
|
require('fs/promises');
|
|
88
87
|
require('extract-zip');
|
|
89
88
|
require('tar');
|
|
90
89
|
require('./download/gitlab/types.cjs');
|
|
90
|
+
require('./colors/attribs.cjs');
|
|
91
|
+
require('./optimise/unwrap.cjs');
|
|
91
92
|
require('./export/helpers/custom-files.cjs');
|
|
93
|
+
require('child_process');
|
|
92
94
|
|
|
93
95
|
|
|
94
96
|
|
|
95
97
|
exports.SVG = svg_index.SVG;
|
|
96
98
|
exports.parseSVG = svg_parse.parseSVG;
|
|
97
|
-
exports.parseSVGSync = svg_parse.parseSVGSync;
|
|
98
99
|
exports.parseSVGStyle = svg_parseStyle.parseSVGStyle;
|
|
99
|
-
exports.parseSVGStyleSync = svg_parseStyle.parseSVGStyleSync;
|
|
100
100
|
exports.analyseSVGStructure = svg_analyse.analyseSVGStructure;
|
|
101
101
|
exports.cleanupSVG = svg_cleanup.cleanupSVG;
|
|
102
102
|
exports.removeBadAttributes = svg_cleanup_attribs.removeBadAttributes;
|
|
@@ -127,9 +127,7 @@ exports.downloadPackage = download_index.downloadPackage;
|
|
|
127
127
|
exports.downloadFile = download_api_download.downloadFile;
|
|
128
128
|
exports.isEmptyColor = colors_parse.isEmptyColor;
|
|
129
129
|
exports.parseColors = colors_parse.parseColors;
|
|
130
|
-
exports.parseColorsSync = colors_parse.parseColorsSync;
|
|
131
130
|
exports.validateColors = colors_validate.validateColors;
|
|
132
|
-
exports.validateColorsSync = colors_validate.validateColorsSync;
|
|
133
131
|
exports.detectIconSetPalette = colors_detect.detectIconSetPalette;
|
|
134
132
|
exports.runSVGO = optimise_svgo.runSVGO;
|
|
135
133
|
exports.removeFigmaClipPathFromSVG = optimise_figma.removeFigmaClipPathFromSVG;
|
|
@@ -139,8 +137,8 @@ exports.convertSVGToMask = optimise_mask.convertSVGToMask;
|
|
|
139
137
|
exports.scaleSVG = optimise_scale.scaleSVG;
|
|
140
138
|
exports.cleanupGlobalStyle = optimise_globalStyle.cleanupGlobalStyle;
|
|
141
139
|
exports.exportToDirectory = export_directory.exportToDirectory;
|
|
142
|
-
exports.exportIconPackage = export_iconPackage.exportIconPackage;
|
|
143
140
|
exports.exportJSONPackage = export_jsonPackage.exportJSONPackage;
|
|
141
|
+
exports.exportIconPackage = export_iconPackage.exportIconPackage;
|
|
144
142
|
exports.writeJSONFile = misc_writeJson.writeJSONFile;
|
|
145
143
|
exports.prepareDirectoryForExport = export_helpers_prepare.prepareDirectoryForExport;
|
|
146
144
|
exports.scanDirectory = misc_scan.scanDirectory;
|
|
@@ -151,4 +149,8 @@ exports.untar = download_helpers_untar.untar;
|
|
|
151
149
|
exports.execAsync = misc_exec.execAsync;
|
|
152
150
|
exports.cleanupIconKeyword = misc_keyword.cleanupIconKeyword;
|
|
153
151
|
exports.bumpVersion = misc_bumpVersion.bumpVersion;
|
|
152
|
+
exports.axiosConfig = download_api_config.axiosConfig;
|
|
153
|
+
exports.fetchCallbacks = download_api_config.fetchCallbacks;
|
|
154
154
|
exports.sendAPIQuery = download_api_index.sendAPIQuery;
|
|
155
|
+
exports.defaultQueueParams = download_api_queue.defaultQueueParams;
|
|
156
|
+
exports.runConcurrentQueries = download_api_queue.runConcurrentQueries;
|
package/lib/index.d.cts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export { SVG } from './svg/index.cjs';
|
|
2
|
+
export { parseSVG } from './svg/parse.cjs';
|
|
3
|
+
export { parseSVGStyle } from './svg/parse-style.cjs';
|
|
4
|
+
export { analyseSVGStructure } from './svg/analyse.cjs';
|
|
5
|
+
export { cleanupSVG } from './svg/cleanup.cjs';
|
|
6
|
+
export { removeBadAttributes } from './svg/cleanup/attribs.cjs';
|
|
7
|
+
export { checkBadTags } from './svg/cleanup/bad-tags.cjs';
|
|
8
|
+
export { cleanupRootStyle } from './svg/cleanup/root-style.cjs';
|
|
9
|
+
export { cleanupInlineStyle } from './svg/cleanup/inline-style.cjs';
|
|
10
|
+
export { cleanupSVGRoot } from './svg/cleanup/root-svg.cjs';
|
|
11
|
+
export { convertStyleToAttrs } from './svg/cleanup/svgo-style.cjs';
|
|
12
|
+
export { IconSet, blankIconSet } from './icon-set/index.cjs';
|
|
13
|
+
export { mergeIconSets } from './icon-set/merge.cjs';
|
|
14
|
+
export { addTagsToIconSet } from './icon-set/tags.cjs';
|
|
15
|
+
export { importFromFigma } from './import/figma/index.cjs';
|
|
16
|
+
export { importDirectory, importDirectorySync } from './import/directory.cjs';
|
|
17
|
+
export { downloadGitRepo } from './download/git/index.cjs';
|
|
18
|
+
export { getGitRepoHash } from './download/git/hash.cjs';
|
|
19
|
+
export { getGitRepoBranch } from './download/git/branch.cjs';
|
|
20
|
+
export { resetGitRepoContents } from './download/git/reset.cjs';
|
|
21
|
+
export { downloadGitHubRepo } from './download/github/index.cjs';
|
|
22
|
+
export { getGitHubRepoHash } from './download/github/hash.cjs';
|
|
23
|
+
export { downloadGitLabRepo } from './download/gitlab/index.cjs';
|
|
24
|
+
export { getGitLabRepoHash } from './download/gitlab/hash.cjs';
|
|
25
|
+
export { downloadNPMPackage } from './download/npm/index.cjs';
|
|
26
|
+
export { getNPMVersion, getPackageVersion } from './download/npm/version.cjs';
|
|
27
|
+
export { downloadPackage } from './download/index.cjs';
|
|
28
|
+
export { downloadFile } from './download/api/download.cjs';
|
|
29
|
+
export { isEmptyColor, parseColors } from './colors/parse.cjs';
|
|
30
|
+
export { validateColors } from './colors/validate.cjs';
|
|
31
|
+
export { detectIconSetPalette } from './colors/detect.cjs';
|
|
32
|
+
export { runSVGO } from './optimise/svgo.cjs';
|
|
33
|
+
export { removeFigmaClipPathFromSVG } from './optimise/figma.cjs';
|
|
34
|
+
export { deOptimisePaths } from './optimise/flags.cjs';
|
|
35
|
+
export { resetSVGOrigin } from './optimise/origin.cjs';
|
|
36
|
+
export { convertSVGToMask } from './optimise/mask.cjs';
|
|
37
|
+
export { scaleSVG } from './optimise/scale.cjs';
|
|
38
|
+
export { cleanupGlobalStyle } from './optimise/global-style.cjs';
|
|
39
|
+
export { exportToDirectory } from './export/directory.cjs';
|
|
40
|
+
export { exportJSONPackage } from './export/json-package.cjs';
|
|
41
|
+
export { exportIconPackage } from './export/icon-package.cjs';
|
|
42
|
+
export { writeJSONFile } from './misc/write-json.cjs';
|
|
43
|
+
export { prepareDirectoryForExport } from './export/helpers/prepare.cjs';
|
|
44
|
+
export { scanDirectory, scanDirectorySync } from './misc/scan.cjs';
|
|
45
|
+
export { compareDirectories } from './misc/compare-dirs.cjs';
|
|
46
|
+
export { unzip } from './download/helpers/unzip.cjs';
|
|
47
|
+
export { untar } from './download/helpers/untar.cjs';
|
|
48
|
+
export { execAsync } from './misc/exec.cjs';
|
|
49
|
+
export { cleanupIconKeyword } from './misc/keyword.cjs';
|
|
50
|
+
export { bumpVersion } from './misc/bump-version.cjs';
|
|
51
|
+
export { axiosConfig, fetchCallbacks } from './download/api/config.cjs';
|
|
52
|
+
export { sendAPIQuery } from './download/api/index.cjs';
|
|
53
|
+
export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.cjs';
|
|
54
|
+
import 'cheerio';
|
|
55
|
+
import '@iconify/types';
|
|
56
|
+
import '@iconify/utils/lib/customisations/defaults';
|
|
57
|
+
import './misc/cheerio.cjs';
|
|
58
|
+
import './css/parser/types.cjs';
|
|
59
|
+
import './svg/analyse/types.cjs';
|
|
60
|
+
import './icon-set/types.cjs';
|
|
61
|
+
import '@iconify/utils/lib/icon-set/tree';
|
|
62
|
+
import './download/types/modified.cjs';
|
|
63
|
+
import './import/figma/types/options.cjs';
|
|
64
|
+
import './import/figma/types/nodes.cjs';
|
|
65
|
+
import './import/figma/types/api.cjs';
|
|
66
|
+
import './import/figma/types/result.cjs';
|
|
67
|
+
import './download/types/sources.cjs';
|
|
68
|
+
import './download/github/types.cjs';
|
|
69
|
+
import './download/gitlab/types.cjs';
|
|
70
|
+
import './download/npm/types.cjs';
|
|
71
|
+
import './download/api/types.cjs';
|
|
72
|
+
import '@iconify/utils/lib/colors/types';
|
|
73
|
+
import './colors/attribs.cjs';
|
|
74
|
+
import 'svgo';
|
|
75
|
+
import './export/helpers/custom-files.cjs';
|
|
76
|
+
import 'fs';
|
|
77
|
+
import 'child_process';
|
|
78
|
+
import 'axios';
|
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
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 { cleanupRootStyle } from './svg/cleanup/root-style.mjs';
|
|
9
|
+
export { cleanupInlineStyle } from './svg/cleanup/inline-style.mjs';
|
|
10
|
+
export { cleanupSVGRoot } from './svg/cleanup/root-svg.mjs';
|
|
11
|
+
export { convertStyleToAttrs } from './svg/cleanup/svgo-style.mjs';
|
|
12
|
+
export { IconSet, blankIconSet } from './icon-set/index.mjs';
|
|
13
|
+
export { mergeIconSets } from './icon-set/merge.mjs';
|
|
14
|
+
export { addTagsToIconSet } from './icon-set/tags.mjs';
|
|
15
|
+
export { importFromFigma } from './import/figma/index.mjs';
|
|
16
|
+
export { importDirectory, importDirectorySync } from './import/directory.mjs';
|
|
17
|
+
export { downloadGitRepo } from './download/git/index.mjs';
|
|
18
|
+
export { getGitRepoHash } from './download/git/hash.mjs';
|
|
19
|
+
export { getGitRepoBranch } from './download/git/branch.mjs';
|
|
20
|
+
export { resetGitRepoContents } from './download/git/reset.mjs';
|
|
21
|
+
export { downloadGitHubRepo } from './download/github/index.mjs';
|
|
22
|
+
export { getGitHubRepoHash } from './download/github/hash.mjs';
|
|
23
|
+
export { downloadGitLabRepo } from './download/gitlab/index.mjs';
|
|
24
|
+
export { getGitLabRepoHash } from './download/gitlab/hash.mjs';
|
|
25
|
+
export { downloadNPMPackage } from './download/npm/index.mjs';
|
|
26
|
+
export { getNPMVersion, getPackageVersion } from './download/npm/version.mjs';
|
|
27
|
+
export { downloadPackage } from './download/index.mjs';
|
|
28
|
+
export { downloadFile } from './download/api/download.mjs';
|
|
29
|
+
export { isEmptyColor, parseColors } from './colors/parse.mjs';
|
|
30
|
+
export { validateColors } from './colors/validate.mjs';
|
|
31
|
+
export { detectIconSetPalette } from './colors/detect.mjs';
|
|
32
|
+
export { runSVGO } from './optimise/svgo.mjs';
|
|
33
|
+
export { removeFigmaClipPathFromSVG } from './optimise/figma.mjs';
|
|
34
|
+
export { deOptimisePaths } from './optimise/flags.mjs';
|
|
35
|
+
export { resetSVGOrigin } from './optimise/origin.mjs';
|
|
36
|
+
export { convertSVGToMask } from './optimise/mask.mjs';
|
|
37
|
+
export { scaleSVG } from './optimise/scale.mjs';
|
|
38
|
+
export { cleanupGlobalStyle } from './optimise/global-style.mjs';
|
|
39
|
+
export { exportToDirectory } from './export/directory.mjs';
|
|
40
|
+
export { exportJSONPackage } from './export/json-package.mjs';
|
|
41
|
+
export { exportIconPackage } from './export/icon-package.mjs';
|
|
42
|
+
export { writeJSONFile } from './misc/write-json.mjs';
|
|
43
|
+
export { prepareDirectoryForExport } from './export/helpers/prepare.mjs';
|
|
44
|
+
export { scanDirectory, scanDirectorySync } from './misc/scan.mjs';
|
|
45
|
+
export { compareDirectories } from './misc/compare-dirs.mjs';
|
|
46
|
+
export { unzip } from './download/helpers/unzip.mjs';
|
|
47
|
+
export { untar } from './download/helpers/untar.mjs';
|
|
48
|
+
export { execAsync } from './misc/exec.mjs';
|
|
49
|
+
export { cleanupIconKeyword } from './misc/keyword.mjs';
|
|
50
|
+
export { bumpVersion } from './misc/bump-version.mjs';
|
|
51
|
+
export { axiosConfig, fetchCallbacks } from './download/api/config.mjs';
|
|
52
|
+
export { sendAPIQuery } from './download/api/index.mjs';
|
|
53
|
+
export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.mjs';
|
|
54
|
+
import 'cheerio';
|
|
55
|
+
import '@iconify/types';
|
|
56
|
+
import '@iconify/utils/lib/customisations/defaults';
|
|
57
|
+
import './misc/cheerio.mjs';
|
|
58
|
+
import './css/parser/types.mjs';
|
|
59
|
+
import './svg/analyse/types.mjs';
|
|
60
|
+
import './icon-set/types.mjs';
|
|
61
|
+
import '@iconify/utils/lib/icon-set/tree';
|
|
62
|
+
import './download/types/modified.mjs';
|
|
63
|
+
import './import/figma/types/options.mjs';
|
|
64
|
+
import './import/figma/types/nodes.mjs';
|
|
65
|
+
import './import/figma/types/api.mjs';
|
|
66
|
+
import './import/figma/types/result.mjs';
|
|
67
|
+
import './download/types/sources.mjs';
|
|
68
|
+
import './download/github/types.mjs';
|
|
69
|
+
import './download/gitlab/types.mjs';
|
|
70
|
+
import './download/npm/types.mjs';
|
|
71
|
+
import './download/api/types.mjs';
|
|
72
|
+
import '@iconify/utils/lib/colors/types';
|
|
73
|
+
import './colors/attribs.mjs';
|
|
74
|
+
import 'svgo';
|
|
75
|
+
import './export/helpers/custom-files.mjs';
|
|
76
|
+
import 'fs';
|
|
77
|
+
import 'child_process';
|
|
78
|
+
import 'axios';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SVG } from './svg/index.js';
|
|
2
|
-
export { parseSVG
|
|
3
|
-
export { parseSVGStyle
|
|
2
|
+
export { parseSVG } from './svg/parse.js';
|
|
3
|
+
export { parseSVGStyle } from './svg/parse-style.js';
|
|
4
4
|
export { analyseSVGStructure } from './svg/analyse.js';
|
|
5
5
|
export { cleanupSVG } from './svg/cleanup.js';
|
|
6
6
|
export { removeBadAttributes } from './svg/cleanup/attribs.js';
|
|
@@ -26,8 +26,8 @@ export { downloadNPMPackage } from './download/npm/index.js';
|
|
|
26
26
|
export { getNPMVersion, getPackageVersion } from './download/npm/version.js';
|
|
27
27
|
export { downloadPackage } from './download/index.js';
|
|
28
28
|
export { downloadFile } from './download/api/download.js';
|
|
29
|
-
export { isEmptyColor, parseColors
|
|
30
|
-
export { validateColors
|
|
29
|
+
export { isEmptyColor, parseColors } from './colors/parse.js';
|
|
30
|
+
export { validateColors } from './colors/validate.js';
|
|
31
31
|
export { detectIconSetPalette } from './colors/detect.js';
|
|
32
32
|
export { runSVGO } from './optimise/svgo.js';
|
|
33
33
|
export { removeFigmaClipPathFromSVG } from './optimise/figma.js';
|
|
@@ -37,8 +37,8 @@ export { convertSVGToMask } from './optimise/mask.js';
|
|
|
37
37
|
export { scaleSVG } from './optimise/scale.js';
|
|
38
38
|
export { cleanupGlobalStyle } from './optimise/global-style.js';
|
|
39
39
|
export { exportToDirectory } from './export/directory.js';
|
|
40
|
-
export { exportIconPackage } from './export/icon-package.js';
|
|
41
40
|
export { exportJSONPackage } from './export/json-package.js';
|
|
41
|
+
export { exportIconPackage } from './export/icon-package.js';
|
|
42
42
|
export { writeJSONFile } from './misc/write-json.js';
|
|
43
43
|
export { prepareDirectoryForExport } from './export/helpers/prepare.js';
|
|
44
44
|
export { scanDirectory, scanDirectorySync } from './misc/scan.js';
|
|
@@ -48,7 +48,9 @@ export { untar } from './download/helpers/untar.js';
|
|
|
48
48
|
export { execAsync } from './misc/exec.js';
|
|
49
49
|
export { cleanupIconKeyword } from './misc/keyword.js';
|
|
50
50
|
export { bumpVersion } from './misc/bump-version.js';
|
|
51
|
+
export { axiosConfig, fetchCallbacks } from './download/api/config.js';
|
|
51
52
|
export { sendAPIQuery } from './download/api/index.js';
|
|
53
|
+
export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.js';
|
|
52
54
|
import 'cheerio';
|
|
53
55
|
import '@iconify/types';
|
|
54
56
|
import '@iconify/utils/lib/customisations/defaults';
|
|
@@ -73,3 +75,4 @@ import 'svgo';
|
|
|
73
75
|
import './export/helpers/custom-files.js';
|
|
74
76
|
import 'fs';
|
|
75
77
|
import 'child_process';
|
|
78
|
+
import 'axios';
|
package/lib/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SVG } from './svg/index.mjs';
|
|
2
|
-
export { parseSVG
|
|
3
|
-
export { parseSVGStyle
|
|
2
|
+
export { parseSVG } from './svg/parse.mjs';
|
|
3
|
+
export { parseSVGStyle } from './svg/parse-style.mjs';
|
|
4
4
|
export { analyseSVGStructure } from './svg/analyse.mjs';
|
|
5
5
|
export { cleanupSVG } from './svg/cleanup.mjs';
|
|
6
6
|
export { removeBadAttributes } from './svg/cleanup/attribs.mjs';
|
|
@@ -26,8 +26,8 @@ export { downloadNPMPackage } from './download/npm/index.mjs';
|
|
|
26
26
|
export { getNPMVersion, getPackageVersion } from './download/npm/version.mjs';
|
|
27
27
|
export { downloadPackage } from './download/index.mjs';
|
|
28
28
|
export { downloadFile } from './download/api/download.mjs';
|
|
29
|
-
export { isEmptyColor, parseColors
|
|
30
|
-
export { validateColors
|
|
29
|
+
export { isEmptyColor, parseColors } from './colors/parse.mjs';
|
|
30
|
+
export { validateColors } from './colors/validate.mjs';
|
|
31
31
|
export { detectIconSetPalette } from './colors/detect.mjs';
|
|
32
32
|
export { runSVGO } from './optimise/svgo.mjs';
|
|
33
33
|
export { removeFigmaClipPathFromSVG } from './optimise/figma.mjs';
|
|
@@ -37,8 +37,8 @@ export { convertSVGToMask } from './optimise/mask.mjs';
|
|
|
37
37
|
export { scaleSVG } from './optimise/scale.mjs';
|
|
38
38
|
export { cleanupGlobalStyle } from './optimise/global-style.mjs';
|
|
39
39
|
export { exportToDirectory } from './export/directory.mjs';
|
|
40
|
-
export { exportIconPackage } from './export/icon-package.mjs';
|
|
41
40
|
export { exportJSONPackage } from './export/json-package.mjs';
|
|
41
|
+
export { exportIconPackage } from './export/icon-package.mjs';
|
|
42
42
|
export { writeJSONFile } from './misc/write-json.mjs';
|
|
43
43
|
export { prepareDirectoryForExport } from './export/helpers/prepare.mjs';
|
|
44
44
|
export { scanDirectory, scanDirectorySync } from './misc/scan.mjs';
|
|
@@ -48,7 +48,9 @@ export { untar } from './download/helpers/untar.mjs';
|
|
|
48
48
|
export { execAsync } from './misc/exec.mjs';
|
|
49
49
|
export { cleanupIconKeyword } from './misc/keyword.mjs';
|
|
50
50
|
export { bumpVersion } from './misc/bump-version.mjs';
|
|
51
|
+
export { axiosConfig, fetchCallbacks } from './download/api/config.mjs';
|
|
51
52
|
export { sendAPIQuery } from './download/api/index.mjs';
|
|
53
|
+
export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.mjs';
|
|
52
54
|
import 'cheerio';
|
|
53
55
|
import '@iconify/utils';
|
|
54
56
|
import './css/parse.mjs';
|
|
@@ -61,8 +63,6 @@ import './css/parser/tree.mjs';
|
|
|
61
63
|
import './svg/data/attributes.mjs';
|
|
62
64
|
import './svg/data/tags.mjs';
|
|
63
65
|
import './svg/analyse/error.mjs';
|
|
64
|
-
import 'svgo';
|
|
65
|
-
import '@iconify/utils/lib/svg/id';
|
|
66
66
|
import '@iconify/utils/lib/icon/defaults';
|
|
67
67
|
import '@iconify/utils/lib/svg/build';
|
|
68
68
|
import '@iconify/utils/lib/icon-set/minify';
|
|
@@ -71,19 +71,21 @@ import './icon-set/props.mjs';
|
|
|
71
71
|
import '@iconify/utils/lib/misc/objects';
|
|
72
72
|
import './icon-set/match.mjs';
|
|
73
73
|
import './icon-set/modified.mjs';
|
|
74
|
-
import '@iconify/utils/lib/colors';
|
|
75
|
-
import './colors/attribs.mjs';
|
|
76
74
|
import './import/figma/nodes.mjs';
|
|
77
75
|
import './import/figma/query.mjs';
|
|
78
76
|
import './download/api/cache.mjs';
|
|
79
77
|
import 'fs';
|
|
80
78
|
import 'crypto';
|
|
79
|
+
import 'svgo';
|
|
80
|
+
import '@iconify/utils/lib/svg/id';
|
|
81
|
+
import '@iconify/utils/lib/colors';
|
|
82
|
+
import 'axios';
|
|
81
83
|
import 'pathe';
|
|
82
|
-
import 'child_process';
|
|
83
|
-
import 'util';
|
|
84
|
-
import 'stream';
|
|
85
84
|
import 'fs/promises';
|
|
86
85
|
import 'extract-zip';
|
|
87
86
|
import 'tar';
|
|
88
87
|
import './download/gitlab/types.mjs';
|
|
88
|
+
import './colors/attribs.mjs';
|
|
89
|
+
import './optimise/unwrap.mjs';
|
|
89
90
|
import './export/helpers/custom-files.mjs';
|
|
91
|
+
import 'child_process';
|
package/lib/misc/cheerio.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
35
35
|
);
|
|
36
36
|
for (let i = 0; i < files1.length; i++) {
|
|
37
37
|
const file = files1[i];
|
|
38
|
-
if (files2.
|
|
38
|
+
if (!files2.includes(file)) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
const ext = file.split(".").pop().toLowerCase();
|
|
@@ -54,8 +54,8 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
56
|
if (ignoreNewLine) {
|
|
57
|
-
content1 = content1.replace(/\s+\n/g, "\n").
|
|
58
|
-
content2 = content2.replace(/\s+\n/g, "\n").
|
|
57
|
+
content1 = content1.replace(/\s+\n/g, "\n").trimEnd();
|
|
58
|
+
content2 = content2.replace(/\s+\n/g, "\n").trimEnd();
|
|
59
59
|
}
|
|
60
60
|
if (ignoreVersions && file.split("/").pop() === "package.json") {
|
|
61
61
|
const data1 = JSON.parse(content1);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface CompareDirectoriesOptions {
|
|
2
|
+
ignoreNewLine?: boolean;
|
|
3
|
+
ignoreVersions?: boolean;
|
|
4
|
+
textExtensions?: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Compare directories. Returns true if files are identical, false if different
|
|
8
|
+
*/
|
|
9
|
+
declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
|
|
10
|
+
|
|
11
|
+
export { type CompareDirectoriesOptions, compareDirectories };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface CompareDirectoriesOptions {
|
|
2
|
+
ignoreNewLine?: boolean;
|
|
3
|
+
ignoreVersions?: boolean;
|
|
4
|
+
textExtensions?: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Compare directories. Returns true if files are identical, false if different
|
|
8
|
+
*/
|
|
9
|
+
declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
|
|
10
|
+
|
|
11
|
+
export { type CompareDirectoriesOptions, compareDirectories };
|
|
@@ -8,4 +8,4 @@ interface CompareDirectoriesOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
|
|
10
10
|
|
|
11
|
-
export { CompareDirectoriesOptions, compareDirectories };
|
|
11
|
+
export { type CompareDirectoriesOptions, compareDirectories };
|
|
@@ -33,7 +33,7 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
33
33
|
);
|
|
34
34
|
for (let i = 0; i < files1.length; i++) {
|
|
35
35
|
const file = files1[i];
|
|
36
|
-
if (files2.
|
|
36
|
+
if (!files2.includes(file)) {
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
39
|
const ext = file.split(".").pop().toLowerCase();
|
|
@@ -52,8 +52,8 @@ async function compareDirectories(dir1, dir2, options) {
|
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
if (ignoreNewLine) {
|
|
55
|
-
content1 = content1.replace(/\s+\n/g, "\n").
|
|
56
|
-
content2 = content2.replace(/\s+\n/g, "\n").
|
|
55
|
+
content1 = content1.replace(/\s+\n/g, "\n").trimEnd();
|
|
56
|
+
content2 = content2.replace(/\s+\n/g, "\n").trimEnd();
|
|
57
57
|
}
|
|
58
58
|
if (ignoreVersions && file.split("/").pop() === "package.json") {
|
|
59
59
|
const data1 = JSON.parse(content1);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExecOptions } from 'child_process';
|
|
2
|
+
|
|
3
|
+
interface ExecResult {
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Exec as Promise
|
|
9
|
+
*/
|
|
10
|
+
declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
|
|
11
|
+
|
|
12
|
+
export { type ExecResult, execAsync };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExecOptions } from 'child_process';
|
|
2
|
+
|
|
3
|
+
interface ExecResult {
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Exec as Promise
|
|
9
|
+
*/
|
|
10
|
+
declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
|
|
11
|
+
|
|
12
|
+
export { type ExecResult, execAsync };
|
package/lib/misc/exec.d.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Stats } from 'fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Callback
|
|
5
|
+
*
|
|
6
|
+
* Extension starts with '.' (can be empty)
|
|
7
|
+
* File does not include extension
|
|
8
|
+
* Subdir ends with '/' (can be empty)
|
|
9
|
+
*
|
|
10
|
+
* Should return:
|
|
11
|
+
* - false, null or undefined to skip file
|
|
12
|
+
* - true to include file (subdir + file + extension)
|
|
13
|
+
* - string to include custom string (such as file without extension)
|
|
14
|
+
* - custom object to return custom object
|
|
15
|
+
*/
|
|
16
|
+
type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
|
|
17
|
+
type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
|
|
18
|
+
type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
|
|
19
|
+
type AsyncCallback<T> = Callback<T | Promise<T>>;
|
|
20
|
+
type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | undefined>;
|
|
21
|
+
type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Find all files in directory
|
|
24
|
+
*/
|
|
25
|
+
declare function scanDirectory(path: string, callback?: AsyncCallback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): Promise<string[]>;
|
|
26
|
+
declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): Promise<T[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Find all files in directory, synchronously
|
|
29
|
+
*/
|
|
30
|
+
declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
|
|
31
|
+
declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
|
|
32
|
+
|
|
33
|
+
export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Stats } from 'fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Callback
|
|
5
|
+
*
|
|
6
|
+
* Extension starts with '.' (can be empty)
|
|
7
|
+
* File does not include extension
|
|
8
|
+
* Subdir ends with '/' (can be empty)
|
|
9
|
+
*
|
|
10
|
+
* Should return:
|
|
11
|
+
* - false, null or undefined to skip file
|
|
12
|
+
* - true to include file (subdir + file + extension)
|
|
13
|
+
* - string to include custom string (such as file without extension)
|
|
14
|
+
* - custom object to return custom object
|
|
15
|
+
*/
|
|
16
|
+
type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
|
|
17
|
+
type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
|
|
18
|
+
type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
|
|
19
|
+
type AsyncCallback<T> = Callback<T | Promise<T>>;
|
|
20
|
+
type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | undefined>;
|
|
21
|
+
type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Find all files in directory
|
|
24
|
+
*/
|
|
25
|
+
declare function scanDirectory(path: string, callback?: AsyncCallback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): Promise<string[]>;
|
|
26
|
+
declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): Promise<T[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Find all files in directory, synchronously
|
|
29
|
+
*/
|
|
30
|
+
declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
|
|
31
|
+
declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
|
|
32
|
+
|
|
33
|
+
export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
|
package/lib/misc/scan.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
|
|
|
17
17
|
type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
|
|
18
18
|
type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
|
|
19
19
|
type AsyncCallback<T> = Callback<T | Promise<T>>;
|
|
20
|
-
type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult |
|
|
21
|
-
type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult |
|
|
20
|
+
type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | undefined>;
|
|
21
|
+
type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | undefined>;
|
|
22
22
|
/**
|
|
23
23
|
* Find all files in directory
|
|
24
24
|
*/
|
|
@@ -30,4 +30,4 @@ declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | Scan
|
|
|
30
30
|
declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
|
|
31
31
|
declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
|
|
32
32
|
|
|
33
|
-
export { ScanDirectoryCallback, ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
|
|
33
|
+
export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
|