@breadstone-infrastructure/nx-tasks 0.0.172 → 0.0.174
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/CHANGELOG.md +10 -0
- package/executors/icon-collection-builder/executor.d.ts.map +1 -1
- package/executors/icon-collection-builder/executor.js +30 -11
- package/executors/icon-collection-builder/executor.js.map +1 -1
- package/executors/icon-collection-builder/executor.task.d.ts +19 -9
- package/executors/icon-collection-builder/executor.task.d.ts.map +1 -1
- package/executors/icon-collection-builder/executor.task.js +109 -32
- package/executors/icon-collection-builder/executor.task.js.map +1 -1
- package/executors/icon-collection-builder/svg.d.ts +15 -0
- package/executors/icon-collection-builder/svg.d.ts.map +1 -0
- package/executors/icon-collection-builder/svg.js +225 -0
- package/executors/icon-collection-builder/svg.js.map +1 -0
- package/executors/icon-collection-downloader/executor.d.ts.map +1 -1
- package/executors/icon-collection-downloader/executor.js +16 -0
- package/executors/icon-collection-downloader/executor.js.map +1 -1
- package/executors/icon-collection-downloader/executor.task.d.ts +13 -3
- package/executors/icon-collection-downloader/executor.task.d.ts.map +1 -1
- package/executors/icon-collection-downloader/executor.task.js +79 -35
- package/executors/icon-collection-downloader/executor.task.js.map +1 -1
- package/executors/icon-collection-downloader/schema.json +33 -1
- package/{Index.d.ts → index.d.ts} +1 -1
- package/{Index.d.ts.map → index.d.ts.map} +1 -1
- package/{Index.js → index.js} +1 -1
- package/{Index.js.map → index.js.map} +1 -1
- package/package.json +16 -15
- package/utils/{taskBase.d.ts → TaskBase.d.ts} +1 -1
- package/utils/{taskBase.d.ts.map → TaskBase.d.ts.map} +1 -1
- package/utils/{taskBase.js → TaskBase.js} +1 -1
- package/utils/{taskBase.js.map → TaskBase.js.map} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.0.173 (2025-11-26)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Enhance Color Palette Builder and Theme Generation ([7b7a885f6a](https://github.com/RueDeRennes/mosaik/commit/7b7a885f6a))
|
|
6
|
+
|
|
7
|
+
## 0.0.172 (2025-11-21)
|
|
8
|
+
|
|
9
|
+
This was a version bump only for nx-tasks to align it with other projects, there were no code changes.
|
|
10
|
+
|
|
1
11
|
## 0.0.171 (2025-11-21)
|
|
2
12
|
|
|
3
13
|
### 🚀 Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAI/E;;GAEG;AACH,wBAA8B,WAAW,CAAC,OAAO,EAAE,oCAAoC,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAI/E;;GAEG;AACH,wBAA8B,WAAW,CAAC,OAAO,EAAE,oCAAoC,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAqDhJ"}
|
|
@@ -50,22 +50,41 @@ async function runExecutor(options, context) {
|
|
|
50
50
|
name: 'fluent',
|
|
51
51
|
inDir: 'static/icons/fluent/',
|
|
52
52
|
outDir: 'static/icons/',
|
|
53
|
-
types: [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
types: [
|
|
54
|
+
{
|
|
55
|
+
key: 'filled',
|
|
56
|
+
pattern: '**/*_filled.svg',
|
|
57
|
+
outputFile: 'fluent-filled.json',
|
|
58
|
+
nameTransform: {
|
|
59
|
+
removePrefix: 'ic_fluent_',
|
|
60
|
+
removeSuffix: '_24_filled'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'regular',
|
|
65
|
+
pattern: '**/*_regular.svg',
|
|
66
|
+
outputFile: 'fluent-outlined.json',
|
|
67
|
+
nameTransform: {
|
|
68
|
+
removePrefix: 'ic_fluent_',
|
|
69
|
+
removeSuffix: '_24_regular'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
58
73
|
},
|
|
59
74
|
{
|
|
60
75
|
cwd: (0, getProjectRoot_1.getProjectRoot)(context),
|
|
61
|
-
name: '
|
|
62
|
-
inDir: 'static/icons/
|
|
76
|
+
name: 'lucide',
|
|
77
|
+
inDir: 'static/icons/lucide/',
|
|
63
78
|
outDir: 'static/icons/',
|
|
64
|
-
types: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
types: [
|
|
80
|
+
{
|
|
81
|
+
key: 'default',
|
|
82
|
+
pattern: '**/*.svg',
|
|
83
|
+
outputFile: 'lucide-outlined.json'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
68
86
|
}
|
|
87
|
+
// ...options.sets
|
|
69
88
|
]
|
|
70
89
|
});
|
|
71
90
|
return { success: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.ts"],"names":[],"mappings":";AACA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWlB,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.ts"],"names":[],"mappings":";AACA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWlB,8BAqDC;AA7DD,+DAA4D;AA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AACL,CAAC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
export declare namespace IconCollectionBuilderTask {
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
interface ISetConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
cwd: string;
|
|
5
|
+
inDir: string;
|
|
6
|
+
outDir: string;
|
|
7
|
+
types: Array<{
|
|
8
|
+
key: string;
|
|
9
|
+
pattern: string;
|
|
10
|
+
outputFile: string;
|
|
11
|
+
nameTransform?: {
|
|
12
|
+
removePrefix?: string;
|
|
13
|
+
removeSuffix?: string;
|
|
14
|
+
removePattern?: string;
|
|
15
|
+
};
|
|
10
16
|
}>;
|
|
11
17
|
}
|
|
12
|
-
|
|
18
|
+
export interface IIconCollectionBuilderTaskOptions {
|
|
19
|
+
sets: Array<ISetConfig>;
|
|
20
|
+
}
|
|
21
|
+
export function run(options: IIconCollectionBuilderTaskOptions): Promise<void>;
|
|
22
|
+
export {};
|
|
13
23
|
}
|
|
14
24
|
//# sourceMappingURL=executor.task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.task.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.task.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.task.ts"],"names":[],"mappings":"AASA,yBAAiB,yBAAyB,CAAC;IAmBvC,UAAU,UAAU;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,KAAK,CAAC;YACT,GAAG,EAAE,MAAM,CAAC;YACZ,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE,MAAM,CAAC;YACnB,aAAa,CAAC,EAAE;gBACZ,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,aAAa,CAAC,EAAE,MAAM,CAAC;aAC1B,CAAC;SACL,CAAC,CAAC;KACN;IAED,MAAM,WAAW,iCAAiC;QAC9C,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;KAC3B;IAED,gBAAsB,GAAG,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEnF;;CAmFJ"}
|
|
@@ -7,61 +7,138 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.IconCollectionBuilderTask = void 0;
|
|
8
8
|
const utilities_1 = require("@breadstone-infrastructure/utilities");
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const svg_1 = require("./svg");
|
|
10
12
|
// #endregion
|
|
11
13
|
var IconCollectionBuilderTask;
|
|
12
14
|
(function (IconCollectionBuilderTask) {
|
|
13
15
|
async function run(options) {
|
|
14
16
|
const logger = new utilities_1.ConsoleLogger();
|
|
15
17
|
(0, utilities_1.logSeparator)(logger, 'Build icons');
|
|
16
|
-
options.sets
|
|
17
|
-
logger.log(
|
|
18
|
+
for (const set of options.sets) {
|
|
19
|
+
logger.log(`📦 Processing icon set [${set.name}]`);
|
|
18
20
|
try {
|
|
19
|
-
const
|
|
20
|
-
set.types
|
|
21
|
+
const basePath = utilities_1.Path.combine(set.cwd, set.inDir);
|
|
22
|
+
for (const typeConfig of set.types) {
|
|
21
23
|
const svgDataPaths = new Array();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
logger.log(` 🔍 Type [${typeConfig.key}] with pattern [${typeConfig.pattern}]`);
|
|
25
|
+
const globPattern = utilities_1.Path.combine(basePath, typeConfig.pattern);
|
|
26
|
+
const files = utilities_1.File.glob(globPattern);
|
|
27
|
+
logger.log(` 📄 Found [${files.length}] files`);
|
|
28
|
+
for (const svgFilePath of files) {
|
|
29
|
+
// eslint-disable-next-line no-await-in-loop
|
|
30
|
+
const dataPath = await extractSVGDataPath(svgFilePath, logger);
|
|
31
|
+
// eslint-disable-next-line max-depth
|
|
32
|
+
if (!dataPath) {
|
|
33
|
+
logger.warn(` ⚠️ Skipping [${path_1.default.basename(svgFilePath)}] - no path data found`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Get raw filename without extension
|
|
37
|
+
const rawFileName = path_1.default.basename(svgFilePath, '.svg');
|
|
38
|
+
// Apply transformations
|
|
39
|
+
const transformedName = transformIconName(rawFileName, typeConfig.nameTransform);
|
|
40
|
+
// Convert to camelCase and PascalCase
|
|
41
|
+
const camelCaseName = toCamelCase(transformedName);
|
|
42
|
+
const pascalCaseName = toPascalCase(transformedName);
|
|
26
43
|
svgDataPaths.push({
|
|
27
|
-
name:
|
|
44
|
+
name: camelCaseName,
|
|
28
45
|
category: path_1.default.basename(path_1.default.dirname(svgFilePath)),
|
|
29
|
-
componentName:
|
|
30
|
-
data: dataPath
|
|
46
|
+
componentName: pascalCaseName,
|
|
47
|
+
data: dataPath
|
|
31
48
|
});
|
|
32
49
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
50
|
+
if (svgDataPaths.length === 0) {
|
|
51
|
+
logger.warn(` ⚠️ No valid SVG files found for [${typeConfig.key}]`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// Ensure output directory exists
|
|
55
|
+
const outPath = utilities_1.Path.combine(set.cwd, set.outDir);
|
|
56
|
+
if (!fs_1.default.existsSync(outPath)) {
|
|
57
|
+
fs_1.default.mkdirSync(outPath, { recursive: true });
|
|
58
|
+
}
|
|
59
|
+
// Write JSON file
|
|
60
|
+
const outFilePath = utilities_1.Path.combine(outPath, typeConfig.outputFile);
|
|
61
|
+
utilities_1.File.writeAllText(outFilePath, JSON.stringify(svgDataPaths, null, 4));
|
|
62
|
+
logger.log(` ✅ Processed [${svgDataPaths.length}] icons → [${typeConfig.outputFile}]`);
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
catch (error) {
|
|
46
|
-
logger.error(
|
|
66
|
+
logger.error(`❌ Error processing set [${set.name}]:`, error);
|
|
47
67
|
}
|
|
48
|
-
}
|
|
68
|
+
}
|
|
49
69
|
(0, utilities_1.logSeparator)(logger);
|
|
50
70
|
return Promise.resolve();
|
|
51
71
|
}
|
|
52
72
|
IconCollectionBuilderTask.run = run;
|
|
53
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Transform icon name based on configuration
|
|
75
|
+
* @param fileName - Raw filename without extension
|
|
76
|
+
* @param transform - Transformation rules
|
|
77
|
+
* @returns Transformed filename
|
|
78
|
+
*/
|
|
79
|
+
function transformIconName(fileName, transform) {
|
|
80
|
+
if (!transform) {
|
|
81
|
+
return fileName;
|
|
82
|
+
}
|
|
83
|
+
let name = fileName;
|
|
84
|
+
// Remove prefix
|
|
85
|
+
if (transform.removePrefix) {
|
|
86
|
+
const escapedPrefix = escapeRegex(transform.removePrefix);
|
|
87
|
+
name = name.replace(new RegExp(`^${escapedPrefix}`), '');
|
|
88
|
+
}
|
|
89
|
+
// Remove suffix
|
|
90
|
+
if (transform.removeSuffix) {
|
|
91
|
+
const escapedSuffix = escapeRegex(transform.removeSuffix);
|
|
92
|
+
name = name.replace(new RegExp(`${escapedSuffix}$`), '');
|
|
93
|
+
}
|
|
94
|
+
// Remove custom pattern (supports regex)
|
|
95
|
+
if (transform.removePattern) {
|
|
96
|
+
name = name.replace(new RegExp(transform.removePattern, 'g'), '');
|
|
97
|
+
}
|
|
98
|
+
return name;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Escape regex special characters for safe string matching
|
|
102
|
+
* @param str - String to escape
|
|
103
|
+
* @returns Escaped string
|
|
104
|
+
*/
|
|
105
|
+
function escapeRegex(str) {
|
|
106
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Convert kebab-case or snake_case to camelCase
|
|
110
|
+
* @param str - Input string
|
|
111
|
+
* @returns camelCase string
|
|
112
|
+
*/
|
|
113
|
+
function toCamelCase(str) {
|
|
114
|
+
return str
|
|
115
|
+
.split(/[-_]/)
|
|
116
|
+
.map((part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1))
|
|
117
|
+
.join('');
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Convert kebab-case or snake_case to PascalCase
|
|
121
|
+
* @param str - Input string
|
|
122
|
+
* @returns PascalCase string
|
|
123
|
+
*/
|
|
124
|
+
function toPascalCase(str) {
|
|
125
|
+
const camel = toCamelCase(str);
|
|
126
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Extract path data from SVG file
|
|
130
|
+
* @param svgFilePath - Path to SVG file
|
|
131
|
+
* @param logger - Logger instance
|
|
132
|
+
* @returns Combined path data or null if none found
|
|
133
|
+
*/
|
|
134
|
+
async function extractSVGDataPath(svgFilePath, logger) {
|
|
54
135
|
try {
|
|
55
136
|
const svgContent = utilities_1.File.readAllText(svgFilePath, 'utf-8');
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
if (matches.length === 0) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
return matches.map((match) => match[1]).join(' ');
|
|
137
|
+
const normalizeSvgPathData = await (0, svg_1.svgToSinglePath)(svgContent);
|
|
138
|
+
return normalizeSvgPathData;
|
|
62
139
|
}
|
|
63
140
|
catch (error) {
|
|
64
|
-
logger.error(`Error parsing SVG ${svgFilePath}:`, error);
|
|
141
|
+
logger.error(` ❌ Error parsing SVG [${path_1.default.basename(svgFilePath)}]:`, error);
|
|
65
142
|
return null;
|
|
66
143
|
}
|
|
67
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.task.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.task.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAElB,oEAA6G;AAC7G,gDAAwB;
|
|
1
|
+
{"version":3,"file":"executor.task.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/executor.task.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAElB,oEAA6G;AAC7G,gDAAwB;AACxB,4CAAoB;AACpB,+BAAwC;AAExC,aAAa;AAEb,IAAiB,yBAAyB,CAmMzC;AAnMD,WAAiB,yBAAyB;IAwC/B,KAAK,UAAU,GAAG,CAAC,OAA0C;QAChE,MAAM,MAAM,GAAG,IAAI,yBAAa,EAAE,CAAC;QAEnC,IAAA,wBAAY,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAEpC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,2BAA2B,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;YAEnD,IAAI,CAAC;gBACD,MAAM,QAAQ,GAAG,gBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;gBAElD,KAAK,MAAM,UAAU,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;oBACjC,MAAM,YAAY,GAAiB,IAAI,KAAK,EAAW,CAAC;oBACxD,MAAM,CAAC,GAAG,CAAC,cAAc,UAAU,CAAC,GAAG,mBAAmB,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;oBAEjF,MAAM,WAAW,GAAG,gBAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;oBAC/D,MAAM,KAAK,GAAG,gBAAI,CAAC,IAAI,CAAC,WAAW,CAAC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YACD,MAAM,UAAU,GAAG,gBAAI,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAC1D,MAAM,oBAAoB,GAAG,MAAM,IAAA,qBAAe,EAAC,UAAU,CAAC,CAAC;YAC/D,OAAO,oBAAoB,CAAC;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,0BAA0B,cAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;AAEL,CAAC,EAnMgB,yBAAyB,yCAAzB,yBAAyB,QAmMzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type INode } from 'svgson';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a parsed SVG node structure
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type SvgNode = INode;
|
|
7
|
+
/**
|
|
8
|
+
* Converts an SVG string to a single combined path data string
|
|
9
|
+
* Traverses the SVG AST and converts all shape elements to paths
|
|
10
|
+
* @param svgContent - The SVG content as a string
|
|
11
|
+
* @returns Combined path data string
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function svgToSinglePath(svgContent: string): Promise<string>;
|
|
15
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/svg.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAM3C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC;AAgO5B;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBzE"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.svgToSinglePath = svgToSinglePath;
|
|
5
|
+
const svgson_1 = require("svgson");
|
|
6
|
+
// #endregion
|
|
7
|
+
// #region Constants
|
|
8
|
+
/**
|
|
9
|
+
* Magic number for circle approximation with cubic Bezier curves
|
|
10
|
+
* Derived from 4/3 * tan(PI/8) ≈ 0.5522847498
|
|
11
|
+
* This constant provides the optimal control point offset for approximating
|
|
12
|
+
* a circular arc with a cubic Bezier curve
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
const KAPPA = 0.5522847498;
|
|
16
|
+
// #endregion
|
|
17
|
+
// #region Helper Functions
|
|
18
|
+
/**
|
|
19
|
+
* Safely parses a numeric attribute from an SVG node
|
|
20
|
+
* @param node - The SVG node
|
|
21
|
+
* @param attr - The attribute name to parse
|
|
22
|
+
* @param defaultValue - Default value if attribute is missing or invalid
|
|
23
|
+
* @returns The parsed numeric value or default
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
function parseAttr(node, attr, defaultValue = 0) {
|
|
27
|
+
const value = node.attributes?.[attr];
|
|
28
|
+
if (value === undefined || value === null) {
|
|
29
|
+
return defaultValue;
|
|
30
|
+
}
|
|
31
|
+
const parsed = parseFloat(value);
|
|
32
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Converts a circle element to a path data string
|
|
36
|
+
* Uses 4 cubic Bezier curves to approximate the circle
|
|
37
|
+
* @param cx - Center X coordinate
|
|
38
|
+
* @param cy - Center Y coordinate
|
|
39
|
+
* @param r - Radius
|
|
40
|
+
* @returns SVG path data string
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
function circleToPath(cx, cy, r) {
|
|
44
|
+
const offsetX = r * KAPPA;
|
|
45
|
+
const offsetY = r * KAPPA;
|
|
46
|
+
return [
|
|
47
|
+
`M ${cx - r} ${cy}`,
|
|
48
|
+
`C ${cx - r} ${cy - offsetY} ${cx - offsetX} ${cy - r} ${cx} ${cy - r}`,
|
|
49
|
+
`C ${cx + offsetX} ${cy - r} ${cx + r} ${cy - offsetY} ${cx + r} ${cy}`,
|
|
50
|
+
`C ${cx + r} ${cy + offsetY} ${cx + offsetX} ${cy + r} ${cx} ${cy + r}`,
|
|
51
|
+
`C ${cx - offsetX} ${cy + r} ${cx - r} ${cy + offsetY} ${cx - r} ${cy}`,
|
|
52
|
+
'Z'
|
|
53
|
+
].join(' ');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Converts an ellipse element to a path data string
|
|
57
|
+
* Uses 4 cubic Bezier curves to approximate the ellipse
|
|
58
|
+
* @param cx - Center X coordinate
|
|
59
|
+
* @param cy - Center Y coordinate
|
|
60
|
+
* @param rx - Horizontal radius
|
|
61
|
+
* @param ry - Vertical radius
|
|
62
|
+
* @returns SVG path data string
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
function ellipseToPath(cx, cy, rx, ry) {
|
|
66
|
+
const offsetX = rx * KAPPA;
|
|
67
|
+
const offsetY = ry * KAPPA;
|
|
68
|
+
return [
|
|
69
|
+
`M ${cx - rx} ${cy}`,
|
|
70
|
+
`C ${cx - rx} ${cy - offsetY} ${cx - offsetX} ${cy - ry} ${cx} ${cy - ry}`,
|
|
71
|
+
`C ${cx + offsetX} ${cy - ry} ${cx + rx} ${cy - offsetY} ${cx + rx} ${cy}`,
|
|
72
|
+
`C ${cx + rx} ${cy + offsetY} ${cx + offsetX} ${cy + ry} ${cx} ${cy + ry}`,
|
|
73
|
+
`C ${cx - offsetX} ${cy + ry} ${cx - rx} ${cy + offsetY} ${cx - rx} ${cy}`,
|
|
74
|
+
'Z'
|
|
75
|
+
].join(' ');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Converts a rect element to a path data string
|
|
79
|
+
* Handles rounded corners via rx/ry parameters
|
|
80
|
+
* @param x - Top-left X coordinate
|
|
81
|
+
* @param y - Top-left Y coordinate
|
|
82
|
+
* @param width - Rectangle width
|
|
83
|
+
* @param height - Rectangle height
|
|
84
|
+
* @param rx - Horizontal corner radius (optional)
|
|
85
|
+
* @param ry - Vertical corner radius (optional)
|
|
86
|
+
* @returns SVG path data string
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
function rectToPath(x, y, width, height, rx = 0, ry = 0) {
|
|
90
|
+
if (rx === 0 && ry === 0) {
|
|
91
|
+
return `M ${x} ${y} H ${x + width} V ${y + height} H ${x} Z`;
|
|
92
|
+
}
|
|
93
|
+
return [
|
|
94
|
+
`M ${x + rx} ${y}`,
|
|
95
|
+
`H ${x + width - rx}`,
|
|
96
|
+
`A ${rx} ${ry} 0 0 1 ${x + width} ${y + ry}`,
|
|
97
|
+
`V ${y + height - ry}`,
|
|
98
|
+
`A ${rx} ${ry} 0 0 1 ${x + width - rx} ${y + height}`,
|
|
99
|
+
`H ${x + rx}`,
|
|
100
|
+
`A ${rx} ${ry} 0 0 1 ${x} ${y + height - ry}`,
|
|
101
|
+
`V ${y + ry}`,
|
|
102
|
+
`A ${rx} ${ry} 0 0 1 ${x + rx} ${y}`,
|
|
103
|
+
'Z'
|
|
104
|
+
].join(' ');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Converts a line element to a path data string
|
|
108
|
+
* @param x1 - Start X coordinate
|
|
109
|
+
* @param y1 - Start Y coordinate
|
|
110
|
+
* @param x2 - End X coordinate
|
|
111
|
+
* @param y2 - End Y coordinate
|
|
112
|
+
* @returns SVG path data string
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
function lineToPath(x1, y1, x2, y2) {
|
|
116
|
+
return `M ${x1} ${y1} L ${x2} ${y2}`;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Converts a polyline element to a path data string
|
|
120
|
+
* @param points - Space or comma-separated list of point coordinates
|
|
121
|
+
* @returns SVG path data string
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
function polylineToPath(points) {
|
|
125
|
+
const coords = points.trim().split(/[\s,]+/).map(Number);
|
|
126
|
+
if (coords.length < 2) {
|
|
127
|
+
return '';
|
|
128
|
+
}
|
|
129
|
+
const pathParts = [`M ${coords[0]} ${coords[1]}`];
|
|
130
|
+
for (let i = 2; i < coords.length; i += 2) {
|
|
131
|
+
pathParts.push(`L ${coords[i]} ${coords[i + 1]}`);
|
|
132
|
+
}
|
|
133
|
+
return pathParts.join(' ');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Converts a polygon element to a path data string
|
|
137
|
+
* Same as polyline but closes the path with Z
|
|
138
|
+
* @param points - Space or comma-separated list of point coordinates
|
|
139
|
+
* @returns SVG path data string
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
function polygonToPath(points) {
|
|
143
|
+
const polylinePath = polylineToPath(points);
|
|
144
|
+
return polylinePath ? `${polylinePath} Z` : '';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Converts various SVG shape elements to path data
|
|
148
|
+
* @param node - The SVG node to convert
|
|
149
|
+
* @returns Path data string or empty string if conversion not possible
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
function elementToPath(node) {
|
|
153
|
+
const { name, attributes } = node;
|
|
154
|
+
switch (name) {
|
|
155
|
+
case 'path':
|
|
156
|
+
return attributes?.d || '';
|
|
157
|
+
case 'circle': {
|
|
158
|
+
const cx = parseAttr(node, 'cx');
|
|
159
|
+
const cy = parseAttr(node, 'cy');
|
|
160
|
+
const r = parseAttr(node, 'r');
|
|
161
|
+
return circleToPath(cx, cy, r);
|
|
162
|
+
}
|
|
163
|
+
case 'ellipse': {
|
|
164
|
+
const cx = parseAttr(node, 'cx');
|
|
165
|
+
const cy = parseAttr(node, 'cy');
|
|
166
|
+
const rx = parseAttr(node, 'rx');
|
|
167
|
+
const ry = parseAttr(node, 'ry');
|
|
168
|
+
return ellipseToPath(cx, cy, rx, ry);
|
|
169
|
+
}
|
|
170
|
+
case 'rect': {
|
|
171
|
+
const x = parseAttr(node, 'x');
|
|
172
|
+
const y = parseAttr(node, 'y');
|
|
173
|
+
const width = parseAttr(node, 'width');
|
|
174
|
+
const height = parseAttr(node, 'height');
|
|
175
|
+
const rx = parseAttr(node, 'rx');
|
|
176
|
+
const ry = parseAttr(node, 'ry');
|
|
177
|
+
return rectToPath(x, y, width, height, rx, ry);
|
|
178
|
+
}
|
|
179
|
+
case 'line': {
|
|
180
|
+
const x1 = parseAttr(node, 'x1');
|
|
181
|
+
const y1 = parseAttr(node, 'y1');
|
|
182
|
+
const x2 = parseAttr(node, 'x2');
|
|
183
|
+
const y2 = parseAttr(node, 'y2');
|
|
184
|
+
return lineToPath(x1, y1, x2, y2);
|
|
185
|
+
}
|
|
186
|
+
case 'polyline': {
|
|
187
|
+
const points = attributes?.points || '';
|
|
188
|
+
return polylineToPath(points);
|
|
189
|
+
}
|
|
190
|
+
case 'polygon': {
|
|
191
|
+
const points = attributes?.points || '';
|
|
192
|
+
return polygonToPath(points);
|
|
193
|
+
}
|
|
194
|
+
default:
|
|
195
|
+
return '';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// #endregion
|
|
199
|
+
// #region Public API
|
|
200
|
+
/**
|
|
201
|
+
* Converts an SVG string to a single combined path data string
|
|
202
|
+
* Traverses the SVG AST and converts all shape elements to paths
|
|
203
|
+
* @param svgContent - The SVG content as a string
|
|
204
|
+
* @returns Combined path data string
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
async function svgToSinglePath(svgContent) {
|
|
208
|
+
const svg = await (0, svgson_1.parse)(svgContent);
|
|
209
|
+
const paths = [];
|
|
210
|
+
function traverse(node) {
|
|
211
|
+
const pathData = elementToPath(node);
|
|
212
|
+
if (pathData) {
|
|
213
|
+
paths.push(pathData);
|
|
214
|
+
}
|
|
215
|
+
if (node.children && Array.isArray(node.children)) {
|
|
216
|
+
for (const child of node.children) {
|
|
217
|
+
traverse(child);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
traverse(svg);
|
|
222
|
+
return paths.join(' ');
|
|
223
|
+
}
|
|
224
|
+
// #endregion
|
|
225
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-builder/svg.ts"],"names":[],"mappings":";AAAA,kBAAkB;;AAmPlB,0CAmBC;AApQD,mCAA2C;AAY3C,aAAa;AAEb,oBAAoB;AAEpB;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,YAAY,CAAC;AAE3B,aAAa;AAEb,2BAA2B;AAE3B;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,IAAa,EAAE,IAAY,EAAE,YAAY,GAAG,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,YAAY,CAAC;IACxB,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAe,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,EAAU,EAAE,EAAU,EAAE,CAAS;IACnD,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC;IAC1B,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC;IAE1B,OAAO;QACH,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE;QACnB,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAA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C;IACL,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,oBAAoB,CAAC;AAIlF;;GAEG;AACH,wBAA8B,WAAW,CAAC,OAAO,EAAE,uCAAuC,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,oBAAoB,CAAC;AAIlF;;GAEG;AACH,wBAA8B,WAAW,CAAC,OAAO,EAAE,uCAAuC,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAiCnJ"}
|
|
@@ -47,6 +47,22 @@ async function runExecutor(options, context) {
|
|
|
47
47
|
await task.run({
|
|
48
48
|
cwd: (0, getProjectRoot_1.getProjectRoot)(context),
|
|
49
49
|
outDir: options.outDir,
|
|
50
|
+
providers: {
|
|
51
|
+
fluent: {
|
|
52
|
+
name: 'Fluent UI System Icons',
|
|
53
|
+
apiUrl: 'https://api.github.com/repos/microsoft/fluentui-system-icons/git/trees/main?recursive=1',
|
|
54
|
+
rawContentUrl: 'https://raw.githubusercontent.com/microsoft/fluentui-system-icons/main/',
|
|
55
|
+
pathPrefix: 'assets/',
|
|
56
|
+
filter: '_24_'
|
|
57
|
+
},
|
|
58
|
+
lucide: {
|
|
59
|
+
name: 'Lucide Icons',
|
|
60
|
+
apiUrl: 'https://api.github.com/repos/lucide-icons/lucide/git/trees/main?recursive=1',
|
|
61
|
+
rawContentUrl: 'https://raw.githubusercontent.com/lucide-icons/lucide/main/',
|
|
62
|
+
pathPrefix: 'icons/'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
parallel: options.parallel ?? false,
|
|
50
66
|
cache: {
|
|
51
67
|
enabled: options.cache?.enabled ?? context.target?.cache ?? false,
|
|
52
68
|
dirPath: utilities_1.Path.combine((0, getProjectRoot_1.getProjectRoot)(context), '.cache')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYlB,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYlB,8BAiCC;AA1CD,+DAA4D;AAC5D,oEAA4D;AAG5D,aAAa;AAEb;;GAEG;AACY,KAAK,UAAU,WAAW,CAAC,OAAgD,EAAE,OAAwB;IAChH,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,wDAAa,iBAAiB,GAAC,CAAC,CAAC,4BAA4B,CAAC;QAE5E,MAAM,IAAI,CAAC,GAAG,CAAC;YACX,GAAG,EAAE,IAAA,+BAAc,EAAC,OAAO,CAAC;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE;gBACP,MAAM,EAAE;oBACJ,IAAI,EAAE,wBAAwB;oBAC9B,MAAM,EAAE,yFAAyF;oBACjG,aAAa,EAAE,yEAAyE;oBACxF,UAAU,EAAE,SAAS;oBACrB,MAAM,EAAE,MAAM;iBACjB;gBACD,MAAM,EAAE;oBACJ,IAAI,EAAE,cAAc;oBACpB,MAAM,EAAE,6EAA6E;oBACrF,aAAa,EAAE,6DAA6D;oBAC5E,UAAU,EAAE,QAAQ;iBACvB;aACJ;YACD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;YACnC,KAAK,EAAE;gBACH,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,IAAI,KAAK;gBACjE,OAAO,EAAE,gBAAI,CAAC,OAAO,CAAC,IAAA,+BAAc,EAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;aAC3D;SACJ,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;AACL,CAAC"}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { type IFileCacheOptions } from '@breadstone-infrastructure/utilities';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Task for downloading icon collections from various providers.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
7
|
export declare namespace IconCollectionDownloaderTask {
|
|
8
|
-
interface
|
|
8
|
+
interface IProviderConfig {
|
|
9
|
+
name: string;
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
rawContentUrl: string;
|
|
12
|
+
pathPrefix: string;
|
|
13
|
+
filter?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IIconCollectionDownloaderTaskOptions {
|
|
9
16
|
cwd: string;
|
|
10
17
|
outDir: string;
|
|
18
|
+
providers: Record<string, IProviderConfig>;
|
|
19
|
+
parallel?: boolean;
|
|
11
20
|
cache?: IFileCacheOptions;
|
|
12
21
|
}
|
|
13
|
-
function run(options: IIconCollectionDownloaderTaskOptions): Promise<void>;
|
|
22
|
+
export function run(options: IIconCollectionDownloaderTaskOptions): Promise<void>;
|
|
23
|
+
export {};
|
|
14
24
|
}
|
|
15
25
|
//# sourceMappingURL=executor.task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.task.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.task.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+D,KAAK,iBAAiB,EAA0E,MAAM,sCAAsC,CAAC;AAMnN;;;;GAIG;AACH,yBAAiB,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.task.d.ts","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.task.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+D,KAAK,iBAAiB,EAA0E,MAAM,sCAAsC,CAAC;AAMnN;;;;GAIG;AACH,yBAAiB,4BAA4B,CAAC;IAS1C,UAAU,eAAe;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB;IAED,MAAM,WAAW,oCAAoC;QACjD,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;KAC7B;IAED,gBAAsB,GAAG,CAAC,OAAO,EAAE,oCAAoC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDtF;;CAmJJ"}
|
|
@@ -10,67 +10,111 @@ const https_1 = __importDefault(require("https"));
|
|
|
10
10
|
const withCaching_1 = require("../../utils/withCaching");
|
|
11
11
|
// #endregion
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Task for downloading icon collections from various providers.
|
|
14
14
|
*
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
17
|
var IconCollectionDownloaderTask;
|
|
18
18
|
(function (IconCollectionDownloaderTask) {
|
|
19
|
-
const GITHUB_API_URL = 'https://api.github.com/repos/microsoft/fluentui-system-icons/git/trees/main?recursive=1';
|
|
20
|
-
const RAW_CONTENT_URL = 'https://raw.githubusercontent.com/microsoft/fluentui-system-icons/main/';
|
|
21
|
-
const PATH_STARTS_WITH = 'assets/';
|
|
22
|
-
const FILTER = '_24_';
|
|
23
19
|
async function run(options) {
|
|
24
20
|
const logger = new utilities_1.ConsoleLogger();
|
|
25
21
|
(0, utilities_1.logSeparator)(logger, 'Download icons');
|
|
26
22
|
const fileCache = (0, withCaching_1.withCaching)(options.cache);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
const outputPath = utilities_1.Path.combine(options.cwd, options.outDir);
|
|
24
|
+
const isParallel = options.parallel ?? false;
|
|
25
|
+
if (!utilities_1.Directory.exists(outputPath)) {
|
|
26
|
+
utilities_1.Directory.create(outputPath);
|
|
27
|
+
}
|
|
28
|
+
logger.log(` Execution mode: ${isParallel ? 'Parallel' : 'Sequential'}`);
|
|
29
|
+
const providers = Object.entries(options.providers);
|
|
30
|
+
if (isParallel) {
|
|
31
|
+
const results = await Promise.allSettled(providers.map(([providerKey, providerConfig]) => processProvider(providerKey, providerConfig, outputPath, fileCache, logger)));
|
|
32
|
+
const successfulResults = results
|
|
33
|
+
.filter((result) => result.status === 'fulfilled')
|
|
34
|
+
.map((result) => result.value);
|
|
35
|
+
const totalDownloaded = successfulResults.reduce((sum, result) => sum + result.downloaded, 0);
|
|
36
|
+
const totalCached = successfulResults.reduce((sum, result) => sum + result.cached, 0);
|
|
37
|
+
logger.log(' All icon downloads completed.');
|
|
38
|
+
logger.log(' Total Summary:');
|
|
39
|
+
logger.log(` - ${totalDownloaded} icons downloaded.`);
|
|
40
|
+
logger.log(` - ${totalCached} icons cached.`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
let totalDownloaded = 0;
|
|
44
|
+
let totalCached = 0;
|
|
45
|
+
for (const [providerKey, providerConfig] of providers) {
|
|
46
|
+
// eslint-disable-next-line no-await-in-loop
|
|
47
|
+
const result = await processProvider(providerKey, providerConfig, outputPath, fileCache, logger);
|
|
48
|
+
totalDownloaded += result.downloaded;
|
|
49
|
+
totalCached += result.cached;
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
logger.log(' All icon downloads completed.');
|
|
52
|
+
logger.log(' Total Summary:');
|
|
53
|
+
logger.log(` - ${totalDownloaded} icons downloaded.`);
|
|
54
|
+
logger.log(` - ${totalCached} icons cached.`);
|
|
55
|
+
}
|
|
56
|
+
(0, utilities_1.logSeparator)(logger);
|
|
57
|
+
return Promise.resolve();
|
|
58
|
+
}
|
|
59
|
+
IconCollectionDownloaderTask.run = run;
|
|
60
|
+
async function processProvider(providerKey, providerConfig, outputPath, fileCache, logger) {
|
|
61
|
+
try {
|
|
62
|
+
logger.log((0, utilities_1.magenta)(` Fetching icon collection from ${providerConfig.name}...`));
|
|
63
|
+
const data = await fetchJson(providerConfig.apiUrl);
|
|
64
|
+
const svgFiles = data.tree.filter((item) => {
|
|
65
|
+
const matchesPrefix = item.path.startsWith(providerConfig.pathPrefix);
|
|
66
|
+
const isBlob = item.type === 'blob';
|
|
67
|
+
const isSvg = item.path.endsWith('.svg');
|
|
68
|
+
const matchesFilter = !providerConfig.filter || item.path.includes(providerConfig.filter);
|
|
69
|
+
return matchesPrefix && isBlob && isSvg && matchesFilter;
|
|
70
|
+
});
|
|
37
71
|
if (svgFiles.length === 0) {
|
|
38
|
-
logger.log((0, utilities_1.yellow)(
|
|
39
|
-
return
|
|
72
|
+
logger.log((0, utilities_1.yellow)(` No SVG files found for ${providerConfig.name}.`));
|
|
73
|
+
return {
|
|
74
|
+
downloaded: 0,
|
|
75
|
+
cached: 0
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
logger.log(` Found ${svgFiles.length} SVG files for ${providerConfig.name}.`);
|
|
79
|
+
const providerOutputPath = utilities_1.Path.combine(outputPath, providerKey);
|
|
80
|
+
if (!utilities_1.Directory.exists(providerOutputPath)) {
|
|
81
|
+
utilities_1.Directory.create(providerOutputPath);
|
|
40
82
|
}
|
|
41
|
-
logger.log(` Found ${svgFiles.length} SVG files.`);
|
|
42
83
|
let count = 0;
|
|
43
84
|
let downloadedCount = 0;
|
|
44
85
|
let cachedCount = 0;
|
|
45
86
|
const totalCount = svgFiles.length;
|
|
46
87
|
for (const file of svgFiles) {
|
|
47
|
-
const fileUrl = `${
|
|
48
|
-
const
|
|
88
|
+
const fileUrl = `${providerConfig.rawContentUrl}${file.path}`;
|
|
89
|
+
const fileName = file.path.split('/').pop() ?? file.path;
|
|
90
|
+
const destPath = utilities_1.Path.combine(providerOutputPath, fileName);
|
|
49
91
|
// eslint-disable-next-line no-await-in-loop
|
|
50
92
|
const cached = await downloadFile(fileUrl, destPath, fileCache, logger);
|
|
51
93
|
count++;
|
|
52
94
|
if (cached) {
|
|
53
95
|
cachedCount++;
|
|
54
|
-
logger.log(` ${(0, utilities_1.bold)((0, utilities_1.gray)(`[${count}/${totalCount}]`))} ${(0, utilities_1.bold)((0, utilities_1.gray)('[cached]'))} ${(0, utilities_1.
|
|
96
|
+
logger.log(` ${(0, utilities_1.bold)((0, utilities_1.gray)(`[${count}/${totalCount}]`))} ${(0, utilities_1.bold)((0, utilities_1.gray)('[cached]'))} ${(0, utilities_1.bold)(fileName)}`);
|
|
55
97
|
}
|
|
56
98
|
else {
|
|
57
99
|
downloadedCount++;
|
|
58
|
-
logger.log(` ${(0, utilities_1.bold)((0, utilities_1.magenta)(`[${count}/${totalCount}]`))} ${(0, utilities_1.
|
|
100
|
+
logger.log(` ${(0, utilities_1.bold)((0, utilities_1.magenta)(`[${count}/${totalCount}]`))} ${(0, utilities_1.bold)(fileName)}`);
|
|
59
101
|
}
|
|
60
102
|
}
|
|
61
|
-
logger.log(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
103
|
+
logger.log(` ${providerConfig.name} completed: ${downloadedCount} downloaded, ${cachedCount} cached.`);
|
|
104
|
+
return {
|
|
105
|
+
downloaded: downloadedCount,
|
|
106
|
+
cached: cachedCount
|
|
107
|
+
};
|
|
65
108
|
}
|
|
66
109
|
catch (error) {
|
|
67
|
-
logger.error(` ${(0, utilities_1.red)('[ERROR]')} Error downloading icons: ${error}`);
|
|
110
|
+
logger.error(` ${(0, utilities_1.red)('[ERROR]')} Error downloading icons from ${providerConfig.name}: ${error}`);
|
|
111
|
+
return {
|
|
112
|
+
downloaded: 0,
|
|
113
|
+
cached: 0
|
|
114
|
+
};
|
|
68
115
|
}
|
|
69
|
-
(0, utilities_1.logSeparator)(logger);
|
|
70
|
-
return Promise.resolve();
|
|
71
116
|
}
|
|
72
|
-
|
|
73
|
-
async function fetchJson(url) {
|
|
117
|
+
function fetchJson(url) {
|
|
74
118
|
return new Promise((resolve, reject) => {
|
|
75
119
|
https_1.default.get(url, {
|
|
76
120
|
headers: {
|
|
@@ -87,11 +131,11 @@ var IconCollectionDownloaderTask;
|
|
|
87
131
|
resolve(JSON.parse(data));
|
|
88
132
|
}
|
|
89
133
|
catch (error) {
|
|
90
|
-
reject(`Error parsing JSON from ${url}: ${error}`);
|
|
134
|
+
reject(new Error(`Error parsing JSON from ${url}: ${error}`));
|
|
91
135
|
}
|
|
92
136
|
}
|
|
93
137
|
else {
|
|
94
|
-
reject(`Request failed with status ${res.statusCode} for ${url}`);
|
|
138
|
+
reject(new Error(`Request failed with status ${res.statusCode} for ${url}`));
|
|
95
139
|
}
|
|
96
140
|
});
|
|
97
141
|
}).on('error', (error) => {
|
|
@@ -123,11 +167,11 @@ var IconCollectionDownloaderTask;
|
|
|
123
167
|
}
|
|
124
168
|
else {
|
|
125
169
|
writer.dispose();
|
|
126
|
-
utilities_1.File.delete(destPath);
|
|
127
|
-
reject(`Download failed with status ${res.statusCode} for ${url}`);
|
|
170
|
+
utilities_1.File.delete(destPath);
|
|
171
|
+
reject(new Error(`Download failed with status ${res.statusCode} for ${url}`));
|
|
128
172
|
}
|
|
129
173
|
}).on('error', (error) => {
|
|
130
|
-
utilities_1.File.delete(destPath);
|
|
174
|
+
utilities_1.File.delete(destPath);
|
|
131
175
|
reject(error);
|
|
132
176
|
});
|
|
133
177
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.task.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.task.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAElB,oEAAmN;AACnN,kDAA0B;AAC1B,yDAAsD;AAEtD,aAAa;AAEb;;;;GAIG;AACH,IAAiB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"executor.task.js","sourceRoot":"","sources":["../../../src/executors/icon-collection-downloader/executor.task.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAElB,oEAAmN;AACnN,kDAA0B;AAC1B,yDAAsD;AAEtD,aAAa;AAEb;;;;GAIG;AACH,IAAiB,4BAA4B,CA+N5C;AA/ND,WAAiB,4BAA4B;IAyBlC,KAAK,UAAU,GAAG,CAAC,OAA6C;QACnE,MAAM,MAAM,GAAG,IAAI,yBAAa,EAAE,CAAC;QAEnC,IAAA,wBAAY,EAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAEvC,MAAM,SAAS,GAAG,IAAA,yBAAW,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,gBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;QAE7C,IAAI,CAAC,qBAAS,CAAC,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EAAE;oBACrB,gBAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACtB,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;AACL,CAAC,EA/NgB,4BAA4B,4CAA5B,4BAA4B,QA+N5C"}
|
|
@@ -1 +1,33 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Icon Collection Downloader",
|
|
5
|
+
"description": "Downloads icon collections from all configured providers (Fluent UI, Lucide, etc.)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"outDir": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Output directory for downloaded icons (relative to project root). Each provider will create a subdirectory.",
|
|
11
|
+
"default": "src/icons"
|
|
12
|
+
},
|
|
13
|
+
"parallel": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"description": "Execute provider downloads in parallel. Significantly faster but may hit rate limits.",
|
|
16
|
+
"default": false
|
|
17
|
+
},
|
|
18
|
+
"cache": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Cache configuration",
|
|
21
|
+
"properties": {
|
|
22
|
+
"enabled": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Enable caching to avoid re-downloading icons",
|
|
25
|
+
"default": false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [
|
|
31
|
+
"outDir"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -25,4 +25,4 @@ export { getProjectTsConfigJson } from './utils/getProjectTsConfigJson';
|
|
|
25
25
|
export { withCaching } from './utils/withCaching';
|
|
26
26
|
export type { IEnvOptions } from './utils/loadAndExpandDotEnvFile';
|
|
27
27
|
export { loadAndExpandDotEnvFile, resolveOptionTree, tryGetEnvVariable } from './utils/loadAndExpandDotEnvFile';
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,iCAAiC,EAAE,MAAM,4DAA4D,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/{Index.js → index.js}
RENAMED
|
@@ -56,4 +56,4 @@ var loadAndExpandDotEnvFile_1 = require("./utils/loadAndExpandDotEnvFile");
|
|
|
56
56
|
Object.defineProperty(exports, "loadAndExpandDotEnvFile", { enumerable: true, get: function () { return loadAndExpandDotEnvFile_1.loadAndExpandDotEnvFile; } });
|
|
57
57
|
Object.defineProperty(exports, "resolveOptionTree", { enumerable: true, get: function () { return loadAndExpandDotEnvFile_1.resolveOptionTree; } });
|
|
58
58
|
Object.defineProperty(exports, "tryGetEnvVariable", { enumerable: true, get: function () { return loadAndExpandDotEnvFile_1.tryGetEnvVariable; } });
|
|
59
|
-
//# sourceMappingURL=
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yEAA2E;AAAlE,iHAAA,gBAAgB,OAAA;AACzB,iEAA4D;AAAnD,0GAAA,SAAS,OAAA;AAClB,gEAA0D;AAAjD,yGAAA,QAAQ,OAAA;AACjB,gEAA0D;AAAjD,yGAAA,QAAQ,OAAA;AACjB,+EAAsF;AAA7E,sHAAA,qBAAqB,OAAA;AAC9B,mFAA8F;AAArF,0HAAA,yBAAyB,OAAA;AAClC,sFAAoG;AAA3F,6HAAA,4BAA4B,OAAA;AACrC,oEAAiE;AAAxD,4GAAA,WAAW,OAAA;AACpB,+EAAsF;AAA7E,sHAAA,qBAAqB,OAAA;AAC9B,wEAAwE;AAA/D,iHAAA,eAAe,OAAA;AACxB,6FAA+G;AAAtG,mIAAA,iCAAiC,OAAA;AAC1C,6EAAgF;AAAvE,oHAAA,kBAAkB,OAAA;AAC3B,+EAAoF;AAA3E,sHAAA,oBAAoB,OAAA;AAC7B,8EAA+E;AAAtE,kHAAA,gBAAgB,OAAA;AACzB,kFAA0F;AAAjF,yHAAA,uBAAuB,OAAA;AAChC,iFAA8F;AAArF,8HAAA,4BAA4B,OAAA;AACrC,4EAA+E;AAAtE,oHAAA,kBAAkB,OAAA;AAC3B,8EAA+E;AAAtE,kHAAA,gBAAgB,OAAA;AACzB,8EAAmF;AAA1E,sHAAA,oBAAoB,OAAA;AAC7B,oFAA6F;AAApF,0HAAA,wBAAwB,OAAA;AACjC,gFAAsF;AAA7E,uHAAA,qBAAqB,OAAA;AAC9B,QAAQ;AACR,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA;AAC9B,yDAAwD;AAA/C,gHAAA,cAAc,OAAA;AACvB,yEAAwE;AAA/D,gIAAA,sBAAsB,OAAA;AAC/B,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAEpB,2EAAgH;AAAvG,kIAAA,uBAAuB,OAAA;AAAE,4HAAA,iBAAiB,OAAA;AAAE,4HAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone-infrastructure/nx-tasks",
|
|
3
3
|
"description": "Common nx tasks",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.174",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+ssh://git@github.com/RueDeRennes/mosaik.git"
|
|
9
9
|
},
|
|
10
10
|
"type": "commonjs",
|
|
11
|
-
"main": "./
|
|
12
|
-
"commonjs": "./
|
|
13
|
-
"module": "./
|
|
14
|
-
"types": "./
|
|
11
|
+
"main": "./index.js",
|
|
12
|
+
"commonjs": "./index.js",
|
|
13
|
+
"module": "./index.js",
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
15
|
"executors": "./executors.json",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@breadstone-infrastructure/utilities": "^0.0.
|
|
18
|
-
"@breadstone-tools/cem-app": "^0.0.
|
|
19
|
-
"@breadstone-tools/cem-plugins-custom-js-doc-tags": "^0.0.
|
|
20
|
-
"@breadstone-tools/cem-plugins-expand-types": "^0.0.
|
|
21
|
-
"@breadstone-tools/localizator-app": "^0.0.
|
|
22
|
-
"@breadstone-tools/localizator-core": "^0.0.
|
|
23
|
-
"@breadstone-tools/openapi-app": "^0.0.
|
|
24
|
-
"@breadstone-tools/openapi-core": "^0.0.
|
|
25
|
-
"@microsoft/api-extractor": "^7.55.
|
|
26
|
-
"@nx/devkit": "^22.1.
|
|
17
|
+
"@breadstone-infrastructure/utilities": "^0.0.174",
|
|
18
|
+
"@breadstone-tools/cem-app": "^0.0.174",
|
|
19
|
+
"@breadstone-tools/cem-plugins-custom-js-doc-tags": "^0.0.174",
|
|
20
|
+
"@breadstone-tools/cem-plugins-expand-types": "^0.0.174",
|
|
21
|
+
"@breadstone-tools/localizator-app": "^0.0.174",
|
|
22
|
+
"@breadstone-tools/localizator-core": "^0.0.174",
|
|
23
|
+
"@breadstone-tools/openapi-app": "^0.0.174",
|
|
24
|
+
"@breadstone-tools/openapi-core": "^0.0.174",
|
|
25
|
+
"@microsoft/api-extractor": "^7.55.1",
|
|
26
|
+
"@nx/devkit": "^22.1.2",
|
|
27
27
|
"autoprefixer": "^10.4.22",
|
|
28
28
|
"diff": "^8.0.2",
|
|
29
29
|
"dotenv": "^17.2.3",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"rimraf": "^6.1.2",
|
|
37
37
|
"sass": "^1.94.2",
|
|
38
38
|
"semver": "^7.7.3",
|
|
39
|
+
"svgson": "^5.3.1",
|
|
39
40
|
"type-fest": "^5.2.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"TaskBase.d.ts","sourceRoot":"","sources":["../../src/utils/TaskBase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAInF;;;;GAIG;AACH,8BAAsB,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIhE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAMlC,SAAS;IAQT,SAAS,KAAK,MAAM,IAAI,OAAO,CAE9B;aAMe,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"TaskBase.js","sourceRoot":"","sources":["../../src/utils/TaskBase.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,oEAAmF;AAEnF,aAAa;AAEb;;;;GAIG;AACH,MAAsB,QAAQ;IAE1B,iBAAiB;IAEA,OAAO,CAAU;IAElC,aAAa;IAEb,eAAe;IAEf;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAa,EAAE,CAAC;IACvC,CAAC;IAED,aAAa;IAEb,qBAAqB;IAErB,IAAc,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAUJ;AA9BD,4BA8BC"}
|