@duetds/icons 4.2.14 → 4.3.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/lib/_data/duet-icons.json +144 -79
- package/lib/assets/e-invoice.js +1 -0
- package/lib/assets/e-invoice.svg +1 -0
- package/lib/assets/messaging-facebook.js +1 -1
- package/lib/assets/messaging-flag-heart.js +1 -0
- package/lib/icons.d.ts +1 -1
- package/lib/icons.js +1 -1
- package/lib/scripts/tag-icons.js +10 -11
- package/package.json +2 -2
package/lib/scripts/tag-icons.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const iconMetadata = require("../_data/duet-icons.json")
|
|
1
|
+
import fs from "fs"
|
|
2
|
+
import prettier from "prettier"
|
|
3
|
+
import inquirer from "inquirer"
|
|
4
|
+
import path from "path"
|
|
5
|
+
import chalk from "chalk"
|
|
6
|
+
const iconMetadata = (await import("../_data/duet-icons.json", { with: { type: "json" } })).default
|
|
8
7
|
|
|
9
8
|
function difference(setA, setB) {
|
|
10
9
|
const diff = new Set(setA)
|
|
@@ -18,7 +17,7 @@ function difference(setA, setB) {
|
|
|
18
17
|
|
|
19
18
|
async function writeJSONFile(path, obj) {
|
|
20
19
|
const prettierConfig = await prettier.resolveConfig(path, {})
|
|
21
|
-
const formatted = prettier.format(JSON.stringify(obj), { ...prettierConfig, parser: "json" })
|
|
20
|
+
const formatted = await prettier.format(JSON.stringify(obj), { ...prettierConfig, parser: "json" })
|
|
22
21
|
fs.writeFileSync(path, formatted)
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -28,8 +27,8 @@ function pluralize(n, singular, plural = `${singular}s`) {
|
|
|
28
27
|
|
|
29
28
|
// get list of all svg assets
|
|
30
29
|
const svgFiles = fs
|
|
31
|
-
.readdirSync(path.join(
|
|
32
|
-
.filter(file => fs.statSync(path.join(
|
|
30
|
+
.readdirSync(path.join(import.meta.dirname, "..", "assets"))
|
|
31
|
+
.filter(file => fs.statSync(path.join(import.meta.dirname, "..", "assets", file)).isFile())
|
|
33
32
|
.map(file => path.parse(file).name)
|
|
34
33
|
|
|
35
34
|
// list of icons documented in json
|
|
@@ -62,7 +61,7 @@ if (questions.length === 0) {
|
|
|
62
61
|
|
|
63
62
|
iconMetadata.icons.sort((a, b) => (a.title > b.title ? 1 : -1))
|
|
64
63
|
|
|
65
|
-
await writeJSONFile(path.join(
|
|
64
|
+
await writeJSONFile(path.join(import.meta.dirname, "../_data/duet-icons.json"), iconMetadata)
|
|
66
65
|
|
|
67
66
|
console.log(chalk.green("\nTags added successfully!"))
|
|
68
67
|
})()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duetds/icons",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "This package includes Duet Design System Icons and related utilities.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "duetdesignsystem@lahitapiola.fi"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "3ff7c6ac885945c6b10776afbe32616dcb1d2cb0"
|
|
55
55
|
}
|