@semcore/illustration 2.43.1-prerelease.8 → 2.44.0-prerelease.0
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 +6 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es6/index.js +1 -1
- package/package.json +273 -4
- package/transform.ts +35 -2
package/CHANGELOG.md
CHANGED
package/lib/cjs/index.js
CHANGED
package/lib/es6/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/illustration",
|
|
3
3
|
"description": "Semrush Illustration Component",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.44.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/runtime": "^7.17.9",
|
|
13
|
-
"@semcore/flex-box": "5.41.1
|
|
13
|
+
"@semcore/flex-box": "5.41.1",
|
|
14
14
|
"colorjs.io": "0.4.3"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@semcore/core": "^2.
|
|
17
|
+
"@semcore/core": "^2.17.5",
|
|
18
18
|
"react": "16.8 - 18",
|
|
19
19
|
"react-dom": "16.8 - 18"
|
|
20
20
|
},
|
|
@@ -26,9 +26,278 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"esbuild": "0.14.29",
|
|
28
28
|
"happy-dom": "9.20.3",
|
|
29
|
+
"fs-extra": "8.1.0",
|
|
29
30
|
"svg-to-jsx": "^1.0.4",
|
|
30
31
|
"@semcore/testing-utils": "1.0.0",
|
|
31
|
-
"@types/react": "18.0.21"
|
|
32
|
+
"@types/react": "18.0.21",
|
|
33
|
+
"@types/fs-extra": "8.1.0"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"require": "./lib/cjs/index.js",
|
|
38
|
+
"import": "./lib/es6/index.js",
|
|
39
|
+
"types": "./lib/types/index.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"./AccessDenied": {
|
|
42
|
+
"require": "./AccessDenied/index.js",
|
|
43
|
+
"import": "./AccessDenied/index.mjs",
|
|
44
|
+
"types": "./AccessDenied/index.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./AccessLogIn": {
|
|
47
|
+
"require": "./AccessLogIn/index.js",
|
|
48
|
+
"import": "./AccessLogIn/index.mjs",
|
|
49
|
+
"types": "./AccessLogIn/index.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./AreaChart": {
|
|
52
|
+
"require": "./AreaChart/index.js",
|
|
53
|
+
"import": "./AreaChart/index.mjs",
|
|
54
|
+
"types": "./AreaChart/index.d.ts"
|
|
55
|
+
},
|
|
56
|
+
"./Blocked": {
|
|
57
|
+
"require": "./Blocked/index.js",
|
|
58
|
+
"import": "./Blocked/index.mjs",
|
|
59
|
+
"types": "./Blocked/index.d.ts"
|
|
60
|
+
},
|
|
61
|
+
"./ChoroplethMapChart": {
|
|
62
|
+
"require": "./ChoroplethMapChart/index.js",
|
|
63
|
+
"import": "./ChoroplethMapChart/index.mjs",
|
|
64
|
+
"types": "./ChoroplethMapChart/index.d.ts"
|
|
65
|
+
},
|
|
66
|
+
"./Coffee": {
|
|
67
|
+
"require": "./Coffee/index.js",
|
|
68
|
+
"import": "./Coffee/index.mjs",
|
|
69
|
+
"types": "./Coffee/index.d.ts"
|
|
70
|
+
},
|
|
71
|
+
"./Collection": {
|
|
72
|
+
"require": "./Collection/index.js",
|
|
73
|
+
"import": "./Collection/index.mjs",
|
|
74
|
+
"types": "./Collection/index.d.ts"
|
|
75
|
+
},
|
|
76
|
+
"./CombinedChart": {
|
|
77
|
+
"require": "./CombinedChart/index.js",
|
|
78
|
+
"import": "./CombinedChart/index.mjs",
|
|
79
|
+
"types": "./CombinedChart/index.d.ts"
|
|
80
|
+
},
|
|
81
|
+
"./Configuration": {
|
|
82
|
+
"require": "./Configuration/index.js",
|
|
83
|
+
"import": "./Configuration/index.mjs",
|
|
84
|
+
"types": "./Configuration/index.d.ts"
|
|
85
|
+
},
|
|
86
|
+
"./Confirmation": {
|
|
87
|
+
"require": "./Confirmation/index.js",
|
|
88
|
+
"import": "./Confirmation/index.mjs",
|
|
89
|
+
"types": "./Confirmation/index.d.ts"
|
|
90
|
+
},
|
|
91
|
+
"./Congrats": {
|
|
92
|
+
"require": "./Congrats/index.js",
|
|
93
|
+
"import": "./Congrats/index.mjs",
|
|
94
|
+
"types": "./Congrats/index.d.ts"
|
|
95
|
+
},
|
|
96
|
+
"./ConnectionLost": {
|
|
97
|
+
"require": "./ConnectionLost/index.js",
|
|
98
|
+
"import": "./ConnectionLost/index.mjs",
|
|
99
|
+
"types": "./ConnectionLost/index.d.ts"
|
|
100
|
+
},
|
|
101
|
+
"./DeletedAccount": {
|
|
102
|
+
"require": "./DeletedAccount/index.js",
|
|
103
|
+
"import": "./DeletedAccount/index.mjs",
|
|
104
|
+
"types": "./DeletedAccount/index.d.ts"
|
|
105
|
+
},
|
|
106
|
+
"./DeletedPage": {
|
|
107
|
+
"require": "./DeletedPage/index.js",
|
|
108
|
+
"import": "./DeletedPage/index.mjs",
|
|
109
|
+
"types": "./DeletedPage/index.d.ts"
|
|
110
|
+
},
|
|
111
|
+
"./Dns": {
|
|
112
|
+
"require": "./Dns/index.js",
|
|
113
|
+
"import": "./Dns/index.mjs",
|
|
114
|
+
"types": "./Dns/index.d.ts"
|
|
115
|
+
},
|
|
116
|
+
"./DonutChart": {
|
|
117
|
+
"require": "./DonutChart/index.js",
|
|
118
|
+
"import": "./DonutChart/index.mjs",
|
|
119
|
+
"types": "./DonutChart/index.d.ts"
|
|
120
|
+
},
|
|
121
|
+
"./Duplicates": {
|
|
122
|
+
"require": "./Duplicates/index.js",
|
|
123
|
+
"import": "./Duplicates/index.mjs",
|
|
124
|
+
"types": "./Duplicates/index.d.ts"
|
|
125
|
+
},
|
|
126
|
+
"./Feedback": {
|
|
127
|
+
"require": "./Feedback/index.js",
|
|
128
|
+
"import": "./Feedback/index.mjs",
|
|
129
|
+
"types": "./Feedback/index.d.ts"
|
|
130
|
+
},
|
|
131
|
+
"./FunnelChart": {
|
|
132
|
+
"require": "./FunnelChart/index.js",
|
|
133
|
+
"import": "./FunnelChart/index.mjs",
|
|
134
|
+
"types": "./FunnelChart/index.d.ts"
|
|
135
|
+
},
|
|
136
|
+
"./Good": {
|
|
137
|
+
"require": "./Good/index.js",
|
|
138
|
+
"import": "./Good/index.mjs",
|
|
139
|
+
"types": "./Good/index.d.ts"
|
|
140
|
+
},
|
|
141
|
+
"./HeatMapChart": {
|
|
142
|
+
"require": "./HeatMapChart/index.js",
|
|
143
|
+
"import": "./HeatMapChart/index.mjs",
|
|
144
|
+
"types": "./HeatMapChart/index.d.ts"
|
|
145
|
+
},
|
|
146
|
+
"./HorizontalBarChart": {
|
|
147
|
+
"require": "./HorizontalBarChart/index.js",
|
|
148
|
+
"import": "./HorizontalBarChart/index.mjs",
|
|
149
|
+
"types": "./HorizontalBarChart/index.d.ts"
|
|
150
|
+
},
|
|
151
|
+
"./KagiChart": {
|
|
152
|
+
"require": "./KagiChart/index.js",
|
|
153
|
+
"import": "./KagiChart/index.mjs",
|
|
154
|
+
"types": "./KagiChart/index.d.ts"
|
|
155
|
+
},
|
|
156
|
+
"./LineChart": {
|
|
157
|
+
"require": "./LineChart/index.js",
|
|
158
|
+
"import": "./LineChart/index.mjs",
|
|
159
|
+
"types": "./LineChart/index.d.ts"
|
|
160
|
+
},
|
|
161
|
+
"./LollipopChart": {
|
|
162
|
+
"require": "./LollipopChart/index.js",
|
|
163
|
+
"import": "./LollipopChart/index.mjs",
|
|
164
|
+
"types": "./LollipopChart/index.d.ts"
|
|
165
|
+
},
|
|
166
|
+
"./MailSent": {
|
|
167
|
+
"require": "./MailSent/index.js",
|
|
168
|
+
"import": "./MailSent/index.mjs",
|
|
169
|
+
"types": "./MailSent/index.d.ts"
|
|
170
|
+
},
|
|
171
|
+
"./Maintenance": {
|
|
172
|
+
"require": "./Maintenance/index.js",
|
|
173
|
+
"import": "./Maintenance/index.mjs",
|
|
174
|
+
"types": "./Maintenance/index.d.ts"
|
|
175
|
+
},
|
|
176
|
+
"./Nexttime": {
|
|
177
|
+
"require": "./Nexttime/index.js",
|
|
178
|
+
"import": "./Nexttime/index.mjs",
|
|
179
|
+
"types": "./Nexttime/index.d.ts"
|
|
180
|
+
},
|
|
181
|
+
"./NoPayment": {
|
|
182
|
+
"require": "./NoPayment/index.js",
|
|
183
|
+
"import": "./NoPayment/index.mjs",
|
|
184
|
+
"types": "./NoPayment/index.d.ts"
|
|
185
|
+
},
|
|
186
|
+
"./NothingFound": {
|
|
187
|
+
"require": "./NothingFound/index.js",
|
|
188
|
+
"import": "./NothingFound/index.mjs",
|
|
189
|
+
"types": "./NothingFound/index.d.ts"
|
|
190
|
+
},
|
|
191
|
+
"./OtherData": {
|
|
192
|
+
"require": "./OtherData/index.js",
|
|
193
|
+
"import": "./OtherData/index.mjs",
|
|
194
|
+
"types": "./OtherData/index.d.ts"
|
|
195
|
+
},
|
|
196
|
+
"./PageError": {
|
|
197
|
+
"require": "./PageError/index.js",
|
|
198
|
+
"import": "./PageError/index.mjs",
|
|
199
|
+
"types": "./PageError/index.d.ts"
|
|
200
|
+
},
|
|
201
|
+
"./PageNotFound": {
|
|
202
|
+
"require": "./PageNotFound/index.js",
|
|
203
|
+
"import": "./PageNotFound/index.mjs",
|
|
204
|
+
"types": "./PageNotFound/index.d.ts"
|
|
205
|
+
},
|
|
206
|
+
"./PieChart": {
|
|
207
|
+
"require": "./PieChart/index.js",
|
|
208
|
+
"import": "./PieChart/index.mjs",
|
|
209
|
+
"types": "./PieChart/index.d.ts"
|
|
210
|
+
},
|
|
211
|
+
"./Processing": {
|
|
212
|
+
"require": "./Processing/index.js",
|
|
213
|
+
"import": "./Processing/index.mjs",
|
|
214
|
+
"types": "./Processing/index.d.ts"
|
|
215
|
+
},
|
|
216
|
+
"./ProjectNotFound": {
|
|
217
|
+
"require": "./ProjectNotFound/index.js",
|
|
218
|
+
"import": "./ProjectNotFound/index.mjs",
|
|
219
|
+
"types": "./ProjectNotFound/index.d.ts"
|
|
220
|
+
},
|
|
221
|
+
"./RadarChart": {
|
|
222
|
+
"require": "./RadarChart/index.js",
|
|
223
|
+
"import": "./RadarChart/index.mjs",
|
|
224
|
+
"types": "./RadarChart/index.d.ts"
|
|
225
|
+
},
|
|
226
|
+
"./RadialTreeChart": {
|
|
227
|
+
"require": "./RadialTreeChart/index.js",
|
|
228
|
+
"import": "./RadialTreeChart/index.mjs",
|
|
229
|
+
"types": "./RadialTreeChart/index.d.ts"
|
|
230
|
+
},
|
|
231
|
+
"./SankeyChart": {
|
|
232
|
+
"require": "./SankeyChart/index.js",
|
|
233
|
+
"import": "./SankeyChart/index.mjs",
|
|
234
|
+
"types": "./SankeyChart/index.d.ts"
|
|
235
|
+
},
|
|
236
|
+
"./ScatterPlotChart": {
|
|
237
|
+
"require": "./ScatterPlotChart/index.js",
|
|
238
|
+
"import": "./ScatterPlotChart/index.mjs",
|
|
239
|
+
"types": "./ScatterPlotChart/index.d.ts"
|
|
240
|
+
},
|
|
241
|
+
"./StackedAreaChart": {
|
|
242
|
+
"require": "./StackedAreaChart/index.js",
|
|
243
|
+
"import": "./StackedAreaChart/index.mjs",
|
|
244
|
+
"types": "./StackedAreaChart/index.d.ts"
|
|
245
|
+
},
|
|
246
|
+
"./Suggestion": {
|
|
247
|
+
"require": "./Suggestion/index.js",
|
|
248
|
+
"import": "./Suggestion/index.mjs",
|
|
249
|
+
"types": "./Suggestion/index.d.ts"
|
|
250
|
+
},
|
|
251
|
+
"./Suggestions": {
|
|
252
|
+
"require": "./Suggestions/index.js",
|
|
253
|
+
"import": "./Suggestions/index.mjs",
|
|
254
|
+
"types": "./Suggestions/index.d.ts"
|
|
255
|
+
},
|
|
256
|
+
"./Table": {
|
|
257
|
+
"require": "./Table/index.js",
|
|
258
|
+
"import": "./Table/index.mjs",
|
|
259
|
+
"types": "./Table/index.d.ts"
|
|
260
|
+
},
|
|
261
|
+
"./TagCloud": {
|
|
262
|
+
"require": "./TagCloud/index.js",
|
|
263
|
+
"import": "./TagCloud/index.mjs",
|
|
264
|
+
"types": "./TagCloud/index.d.ts"
|
|
265
|
+
},
|
|
266
|
+
"./TextLinksEtc": {
|
|
267
|
+
"require": "./TextLinksEtc/index.js",
|
|
268
|
+
"import": "./TextLinksEtc/index.mjs",
|
|
269
|
+
"types": "./TextLinksEtc/index.d.ts"
|
|
270
|
+
},
|
|
271
|
+
"./Timeout": {
|
|
272
|
+
"require": "./Timeout/index.js",
|
|
273
|
+
"import": "./Timeout/index.mjs",
|
|
274
|
+
"types": "./Timeout/index.d.ts"
|
|
275
|
+
},
|
|
276
|
+
"./UnderConstruction": {
|
|
277
|
+
"require": "./UnderConstruction/index.js",
|
|
278
|
+
"import": "./UnderConstruction/index.mjs",
|
|
279
|
+
"types": "./UnderConstruction/index.d.ts"
|
|
280
|
+
},
|
|
281
|
+
"./VennChart": {
|
|
282
|
+
"require": "./VennChart/index.js",
|
|
283
|
+
"import": "./VennChart/index.mjs",
|
|
284
|
+
"types": "./VennChart/index.d.ts"
|
|
285
|
+
},
|
|
286
|
+
"./VerticalBarChart": {
|
|
287
|
+
"require": "./VerticalBarChart/index.js",
|
|
288
|
+
"import": "./VerticalBarChart/index.mjs",
|
|
289
|
+
"types": "./VerticalBarChart/index.d.ts"
|
|
290
|
+
},
|
|
291
|
+
"./Waiting": {
|
|
292
|
+
"require": "./Waiting/index.js",
|
|
293
|
+
"import": "./Waiting/index.mjs",
|
|
294
|
+
"types": "./Waiting/index.d.ts"
|
|
295
|
+
},
|
|
296
|
+
"./Warning": {
|
|
297
|
+
"require": "./Warning/index.js",
|
|
298
|
+
"import": "./Warning/index.mjs",
|
|
299
|
+
"types": "./Warning/index.d.ts"
|
|
300
|
+
}
|
|
32
301
|
},
|
|
33
302
|
"scripts": {
|
|
34
303
|
"build": "pnpm clear && pnpm semcore-builder --source=js && pnpm run transform",
|
package/transform.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import fs from 'fs
|
|
2
|
-
import { resolve as resolvePath } from 'path';
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path, { resolve as resolvePath } from 'path';
|
|
3
3
|
import svgToJsx from 'svg-to-jsx';
|
|
4
4
|
import { Window } from 'happy-dom';
|
|
5
5
|
import esbuild from 'esbuild';
|
|
@@ -181,3 +181,36 @@ export default Illustration;
|
|
|
181
181
|
await fs.writeFile(resolvePath(illustration, 'index.d.ts'), typesDeclaration);
|
|
182
182
|
}),
|
|
183
183
|
);
|
|
184
|
+
|
|
185
|
+
async function patchExports(illustrations: string[]) {
|
|
186
|
+
const rootDir = process.cwd();
|
|
187
|
+
const packageJsonPath = path.resolve(rootDir, 'package.json');
|
|
188
|
+
const packageJson = await fs.readJson(packageJsonPath);
|
|
189
|
+
|
|
190
|
+
const exports: Record<string, any> = {
|
|
191
|
+
'.': {
|
|
192
|
+
require: './lib/cjs/index.js',
|
|
193
|
+
import: './lib/es6/index.js',
|
|
194
|
+
types: './lib/types/index.d.ts',
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
illustrations.forEach((item) => {
|
|
199
|
+
const name = item.replace('.svg', '');
|
|
200
|
+
|
|
201
|
+
exports[`./${name}`] = {
|
|
202
|
+
require: `./${name}/index.js`,
|
|
203
|
+
import: `./${name}/index.mjs`,
|
|
204
|
+
types: `./${name}/index.d.ts`,
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
packageJson.exports = exports;
|
|
209
|
+
|
|
210
|
+
await fs.writeJSON(packageJsonPath, packageJson, { spaces: 2 });
|
|
211
|
+
|
|
212
|
+
// biome-ignore lint/suspicious/noConsoleLog:
|
|
213
|
+
console.log('Patched exports in package.json.');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
await patchExports(illustrations);
|