@adobe/spectrum-tokens 13.11.0 → 13.13.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 +73 -0
- package/dist/json/drover.json +4 -3
- package/dist/json/variables.json +18 -22
- package/moon.yml +1 -7
- package/package.json +2 -3
- package/src/layout-component.json +24 -28
- package/tasks/diff.js +0 -145
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @adobe/spectrum-tokens
|
|
2
2
|
|
|
3
|
+
## 13.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#559](https://github.com/adobe/spectrum-tokens/pull/559) [`1d4973e`](https://github.com/adobe/spectrum-tokens/commit/1d4973e78d814575da231c2c4080ead8a190d2fc) Thanks [@mrcjhicks](https://github.com/mrcjhicks)! - ## Token sync from Spectrum Tokens Studio
|
|
8
|
+
|
|
9
|
+
### Design motivation
|
|
10
|
+
|
|
11
|
+
A new visual treatment for select box.
|
|
12
|
+
|
|
13
|
+
### Token changes
|
|
14
|
+
|
|
15
|
+
## Tokens Changed (4)
|
|
16
|
+
|
|
17
|
+
**Original Branch:** `main`
|
|
18
|
+
**New Branch:** `tokens-sync/patch-spectrum2-from-main`
|
|
19
|
+
|
|
20
|
+
<details open><summary><strong>Added (1)</strong></summary>
|
|
21
|
+
- `select-box-horizontal-minimum-width`
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
### Updated (3)
|
|
25
|
+
|
|
26
|
+
<details open><summary><strong>Added Properties (1)</strong></summary>
|
|
27
|
+
- `select-box-edge-to-checkbox` - `value`: `8px` - `uuid`: `70a20970-ebd9-48a7-8324-44d352f79978`
|
|
28
|
+
</details>
|
|
29
|
+
<details open><summary><strong>Deleted Properties (1)</strong></summary>
|
|
30
|
+
|
|
31
|
+
- `select-box-edge-to-checkbox` - `desktop.schema`: -> `dimension.json` - `desktop.value`: -> `12px` - `desktop.uuid`: -> `70a20970-ebd9-48a7-8324-44d352f79978` - `mobile.schema`: -> `dimension.json` - `mobile.value`: -> `15px` - `mobile.uuid`: -> `f028974a-20d1-4e03-af77-921b1dfc2469`
|
|
32
|
+
</details>
|
|
33
|
+
<details open><summary><strong>Updated Properties (1)</strong></summary>
|
|
34
|
+
- `select-box-edge-to-checkbox` - `schema`: `scale-set.json` -> `dimension.json`
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
### References
|
|
38
|
+
- Tokens Studio PR: https://github.com/adobe/spectrum-tokens-studio-data/pull/275
|
|
39
|
+
- Spectrum Tokens PR: https://github.com/adobe/spectrum-tokens/pull/559
|
|
40
|
+
|
|
41
|
+
## 13.12.0
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- [#527](https://github.com/adobe/spectrum-tokens/pull/527) [`28cfacc`](https://github.com/adobe/spectrum-tokens/commit/28cfacce9072ebc7afe0434d6fec55d587ddd2ce) Thanks [@mrcjhicks](https://github.com/mrcjhicks)! - Fixed accordion token values due to changelog error
|
|
46
|
+
|
|
47
|
+
## Token Diff
|
|
48
|
+
|
|
49
|
+
Updated (4)
|
|
50
|
+
|
|
51
|
+
<details open><summary>Added Properties (1)</summary>
|
|
52
|
+
- `accordion-top-to-text-compact-medium`
|
|
53
|
+
value: 5px
|
|
54
|
+
uuid: 484c9603-07f1-4ba6-b1bf-7cfaec5d1594
|
|
55
|
+
|
|
56
|
+
</details>
|
|
57
|
+
<details open><summary>Deleted Properties (1)</summary>
|
|
58
|
+
- `accordion-top-to-text-compact-medium`
|
|
59
|
+
desktop.schema: dimension.json
|
|
60
|
+
desktop.value: 8px
|
|
61
|
+
desktop.uuid: 484c9603-07f1-4ba6-b1bf-7cfaec5d1594
|
|
62
|
+
mobile.schema: dimension.json
|
|
63
|
+
mobile.value: 14px
|
|
64
|
+
mobile.uuid: 4a7dda7f-a45a-496c-8d38-cb4e4807e544
|
|
65
|
+
|
|
66
|
+
</details>
|
|
67
|
+
<details open><summary>Updated Properties (2)</summary>
|
|
68
|
+
- `accordion-top-to-text-compact-medium`
|
|
69
|
+
schema: scale-set.json -> dimension.json
|
|
70
|
+
- `accordion-top-to-text-spacious-medium`
|
|
71
|
+
desktop.value: 16px -> 13px
|
|
72
|
+
mobile.value: 19px -> 15px
|
|
73
|
+
|
|
74
|
+
</details>
|
|
75
|
+
|
|
3
76
|
## 13.11.0
|
|
4
77
|
|
|
5
78
|
### Minor Changes
|
package/dist/json/drover.json
CHANGED
|
@@ -1565,7 +1565,7 @@
|
|
|
1565
1565
|
"accordion-small-top-to-text-spacious": "9px",
|
|
1566
1566
|
"accordion-top-to-text-compact-extra-large": "8px",
|
|
1567
1567
|
"accordion-top-to-text-compact-large": "8px",
|
|
1568
|
-
"accordion-top-to-text-compact-medium": "
|
|
1568
|
+
"accordion-top-to-text-compact-medium": "5px",
|
|
1569
1569
|
"accordion-top-to-text-compact-small": "3px",
|
|
1570
1570
|
"accordion-top-to-text-extra-large": "13px",
|
|
1571
1571
|
"accordion-top-to-text-large": "12px",
|
|
@@ -1577,7 +1577,7 @@
|
|
|
1577
1577
|
"accordion-top-to-text-small": "7px",
|
|
1578
1578
|
"accordion-top-to-text-spacious-extra-large": "17px",
|
|
1579
1579
|
"accordion-top-to-text-spacious-large": "16px",
|
|
1580
|
-
"accordion-top-to-text-spacious-medium": "
|
|
1580
|
+
"accordion-top-to-text-spacious-medium": "13px",
|
|
1581
1581
|
"accordion-top-to-text-spacious-small": "11px",
|
|
1582
1582
|
"action-bar-bottom-to-content-area": "12px",
|
|
1583
1583
|
"action-bar-close-button-to-counter": "4px",
|
|
@@ -2372,11 +2372,12 @@
|
|
|
2372
2372
|
"segmented-control-selection-border-width": "2px",
|
|
2373
2373
|
"segmented-text-field-gap": "0px",
|
|
2374
2374
|
"segmented-text-field-rounding": "2px",
|
|
2375
|
-
"select-box-edge-to-checkbox": "
|
|
2375
|
+
"select-box-edge-to-checkbox": "8px",
|
|
2376
2376
|
"select-box-horizontal-end-to-content": "32px",
|
|
2377
2377
|
"select-box-horizontal-illustration-to-label": "10px",
|
|
2378
2378
|
"select-box-horizontal-label-to-description": "2px",
|
|
2379
2379
|
"select-box-horizontal-minimum-height": "80px",
|
|
2380
|
+
"select-box-horizontal-minimum-width": "188px",
|
|
2380
2381
|
"select-box-horizontal-start-to-content": "24px",
|
|
2381
2382
|
"select-box-horizontal-top-to-content": "16px",
|
|
2382
2383
|
"select-box-horizontal-width": "368px",
|
package/dist/json/variables.json
CHANGED
|
@@ -19354,16 +19354,8 @@
|
|
|
19354
19354
|
}
|
|
19355
19355
|
},
|
|
19356
19356
|
"accordion-top-to-text-compact-medium": {
|
|
19357
|
-
"
|
|
19358
|
-
|
|
19359
|
-
"value": "8px",
|
|
19360
|
-
"uuid": "484c9603-07f1-4ba6-b1bf-7cfaec5d1594"
|
|
19361
|
-
},
|
|
19362
|
-
"mobile": {
|
|
19363
|
-
"value": "14px",
|
|
19364
|
-
"uuid": "4a7dda7f-a45a-496c-8d38-cb4e4807e544"
|
|
19365
|
-
}
|
|
19366
|
-
}
|
|
19357
|
+
"value": "5px",
|
|
19358
|
+
"uuid": "484c9603-07f1-4ba6-b1bf-7cfaec5d1594"
|
|
19367
19359
|
},
|
|
19368
19360
|
"accordion-top-to-text-regular-medium": {
|
|
19369
19361
|
"ref": "{accordion-top-to-text-medium}",
|
|
@@ -19382,11 +19374,11 @@
|
|
|
19382
19374
|
"accordion-top-to-text-spacious-medium": {
|
|
19383
19375
|
"sets": {
|
|
19384
19376
|
"desktop": {
|
|
19385
|
-
"value": "
|
|
19377
|
+
"value": "13px",
|
|
19386
19378
|
"uuid": "19c91104-bdf4-4969-8d92-c9cd47d39d13"
|
|
19387
19379
|
},
|
|
19388
19380
|
"mobile": {
|
|
19389
|
-
"value": "
|
|
19381
|
+
"value": "15px",
|
|
19390
19382
|
"uuid": "63602a66-5f96-4e6a-8bf0-2ac03321a577"
|
|
19391
19383
|
}
|
|
19392
19384
|
}
|
|
@@ -25028,16 +25020,8 @@
|
|
|
25028
25020
|
}
|
|
25029
25021
|
},
|
|
25030
25022
|
"select-box-edge-to-checkbox": {
|
|
25031
|
-
"
|
|
25032
|
-
|
|
25033
|
-
"value": "12px",
|
|
25034
|
-
"uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
|
|
25035
|
-
},
|
|
25036
|
-
"mobile": {
|
|
25037
|
-
"value": "15px",
|
|
25038
|
-
"uuid": "f028974a-20d1-4e03-af77-921b1dfc2469"
|
|
25039
|
-
}
|
|
25040
|
-
}
|
|
25023
|
+
"value": "8px",
|
|
25024
|
+
"uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
|
|
25041
25025
|
},
|
|
25042
25026
|
"select-box-horizontal-end-to-content": {
|
|
25043
25027
|
"sets": {
|
|
@@ -26680,6 +26664,18 @@
|
|
|
26680
26664
|
}
|
|
26681
26665
|
}
|
|
26682
26666
|
},
|
|
26667
|
+
"select-box-horizontal-minimum-width": {
|
|
26668
|
+
"sets": {
|
|
26669
|
+
"desktop": {
|
|
26670
|
+
"value": "188px",
|
|
26671
|
+
"uuid": "b2104b40-4b34-4d98-a564-1688900de75d"
|
|
26672
|
+
},
|
|
26673
|
+
"mobile": {
|
|
26674
|
+
"value": "220px",
|
|
26675
|
+
"uuid": "0a6c3623-dd05-40df-a3d8-b724e8a88178"
|
|
26676
|
+
}
|
|
26677
|
+
}
|
|
26678
|
+
},
|
|
26683
26679
|
"corner-radius-0": {
|
|
26684
26680
|
"value": "0px",
|
|
26685
26681
|
"uuid": "bb9d8350-b1fb-4496-9c22-6ec9647ff117"
|
package/moon.yml
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
# OF ANY KIND, either express or implied. See the License for the specific language
|
|
9
9
|
# governing permissions and limitations under the License.
|
|
10
10
|
$schema: "https://moonrepo.dev/schemas/project.json"
|
|
11
|
+
layer: library
|
|
11
12
|
fileGroups:
|
|
12
13
|
sources:
|
|
13
14
|
- "src/**/*"
|
|
@@ -45,13 +46,6 @@ tasks:
|
|
|
45
46
|
- dist
|
|
46
47
|
local: true
|
|
47
48
|
platform: system
|
|
48
|
-
generateDiffResult:
|
|
49
|
-
command:
|
|
50
|
-
- node
|
|
51
|
-
- tasks/diff.js
|
|
52
|
-
deps:
|
|
53
|
-
- ~:buildTokens
|
|
54
|
-
platform: node
|
|
55
49
|
test:
|
|
56
50
|
command:
|
|
57
51
|
- pnpm
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spectrum-tokens",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.13.0",
|
|
4
4
|
"description": "Design tokens for Spectrum, Adobe's design system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
"style-dictionary": "^3.9.2",
|
|
30
30
|
"style-dictionary-sets": "^2.3.0",
|
|
31
31
|
"tar": "^7.4.3",
|
|
32
|
-
"tmp-promise": "^3.0.3"
|
|
33
|
-
"@adobe/token-diff-generator": "2.0.0"
|
|
32
|
+
"tmp-promise": "^3.0.3"
|
|
34
33
|
},
|
|
35
34
|
"scripts": {}
|
|
36
35
|
}
|
|
@@ -3717,19 +3717,9 @@
|
|
|
3717
3717
|
},
|
|
3718
3718
|
"accordion-top-to-text-compact-medium": {
|
|
3719
3719
|
"component": "accordion",
|
|
3720
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/
|
|
3721
|
-
"
|
|
3722
|
-
|
|
3723
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
3724
|
-
"value": "8px",
|
|
3725
|
-
"uuid": "484c9603-07f1-4ba6-b1bf-7cfaec5d1594"
|
|
3726
|
-
},
|
|
3727
|
-
"mobile": {
|
|
3728
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
3729
|
-
"value": "14px",
|
|
3730
|
-
"uuid": "4a7dda7f-a45a-496c-8d38-cb4e4807e544"
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3720
|
+
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
3721
|
+
"value": "5px",
|
|
3722
|
+
"uuid": "484c9603-07f1-4ba6-b1bf-7cfaec5d1594"
|
|
3733
3723
|
},
|
|
3734
3724
|
"accordion-top-to-text-regular-medium": {
|
|
3735
3725
|
"component": "accordion",
|
|
@@ -3744,12 +3734,12 @@
|
|
|
3744
3734
|
"sets": {
|
|
3745
3735
|
"desktop": {
|
|
3746
3736
|
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
3747
|
-
"value": "
|
|
3737
|
+
"value": "13px",
|
|
3748
3738
|
"uuid": "19c91104-bdf4-4969-8d92-c9cd47d39d13"
|
|
3749
3739
|
},
|
|
3750
3740
|
"mobile": {
|
|
3751
3741
|
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
3752
|
-
"value": "
|
|
3742
|
+
"value": "15px",
|
|
3753
3743
|
"uuid": "63602a66-5f96-4e6a-8bf0-2ac03321a577"
|
|
3754
3744
|
}
|
|
3755
3745
|
}
|
|
@@ -9458,19 +9448,9 @@
|
|
|
9458
9448
|
},
|
|
9459
9449
|
"select-box-edge-to-checkbox": {
|
|
9460
9450
|
"component": "select-box",
|
|
9461
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/
|
|
9462
|
-
"
|
|
9463
|
-
|
|
9464
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
9465
|
-
"value": "12px",
|
|
9466
|
-
"uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
|
|
9467
|
-
},
|
|
9468
|
-
"mobile": {
|
|
9469
|
-
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
9470
|
-
"value": "15px",
|
|
9471
|
-
"uuid": "f028974a-20d1-4e03-af77-921b1dfc2469"
|
|
9472
|
-
}
|
|
9473
|
-
}
|
|
9451
|
+
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
9452
|
+
"value": "8px",
|
|
9453
|
+
"uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
|
|
9474
9454
|
},
|
|
9475
9455
|
"select-box-horizontal-end-to-content": {
|
|
9476
9456
|
"component": "select-box",
|
|
@@ -11724,5 +11704,21 @@
|
|
|
11724
11704
|
"uuid": "0dea279c-62ca-4670-a693-03eaa7ccecb5"
|
|
11725
11705
|
}
|
|
11726
11706
|
}
|
|
11707
|
+
},
|
|
11708
|
+
"select-box-horizontal-minimum-width": {
|
|
11709
|
+
"component": "select-box",
|
|
11710
|
+
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/scale-set.json",
|
|
11711
|
+
"sets": {
|
|
11712
|
+
"desktop": {
|
|
11713
|
+
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
11714
|
+
"value": "188px",
|
|
11715
|
+
"uuid": "b2104b40-4b34-4d98-a564-1688900de75d"
|
|
11716
|
+
},
|
|
11717
|
+
"mobile": {
|
|
11718
|
+
"$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
|
|
11719
|
+
"value": "220px",
|
|
11720
|
+
"uuid": "0a6c3623-dd05-40df-a3d8-b724e8a88178"
|
|
11721
|
+
}
|
|
11722
|
+
}
|
|
11727
11723
|
}
|
|
11728
11724
|
}
|
package/tasks/diff.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { access, readFile } from "fs/promises";
|
|
14
|
-
import { join, dirname } from "path";
|
|
15
|
-
import { fileURLToPath } from "url";
|
|
16
|
-
import { detailedDiff, diff } from "deep-object-diff";
|
|
17
|
-
import { exec } from "node:child_process";
|
|
18
|
-
import { promisify } from "util";
|
|
19
|
-
import { x } from "tar";
|
|
20
|
-
import tmp from "tmp-promise";
|
|
21
|
-
|
|
22
|
-
const execP = promisify(exec);
|
|
23
|
-
|
|
24
|
-
const tag = process.argv[2] || "latest";
|
|
25
|
-
const tokenPath = "dist/json/variables.json";
|
|
26
|
-
const localRootDir = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
27
|
-
const localTokenPath = join(localRootDir, tokenPath);
|
|
28
|
-
|
|
29
|
-
run()
|
|
30
|
-
.then(() => {
|
|
31
|
-
process.exit();
|
|
32
|
-
})
|
|
33
|
-
.catch((err) => {
|
|
34
|
-
console.error(err);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
async function run() {
|
|
39
|
-
const [newTokens, oldTokens] = await Promise.all([
|
|
40
|
-
getNewTokens(),
|
|
41
|
-
getOldTokens(),
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
const diffResult = detailedDiff(oldTokens, newTokens);
|
|
45
|
-
|
|
46
|
-
calculatePossibleRenames(diffResult, oldTokens, newTokens);
|
|
47
|
-
|
|
48
|
-
logResultCategory(diffResult, "added");
|
|
49
|
-
logResultCategory(diffResult, "deleted");
|
|
50
|
-
logResultCategory(diffResult, "updated", "Token values updated");
|
|
51
|
-
logResultCategory(diffResult, "possiblyRenamed", "Tokens possibly renamed");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function getNewTokens() {
|
|
55
|
-
try {
|
|
56
|
-
await access(localTokenPath);
|
|
57
|
-
return JSON.parse(
|
|
58
|
-
convertNumberStringsToNumbers(
|
|
59
|
-
await readFile(localTokenPath, { encoding: "utf8" }),
|
|
60
|
-
),
|
|
61
|
-
);
|
|
62
|
-
} catch {
|
|
63
|
-
console.error("cannot access");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function getOldTokens() {
|
|
68
|
-
const tmpDir = await tmp.dir();
|
|
69
|
-
const { stdout, stderr } = await execP(
|
|
70
|
-
`npm pack @adobe/spectrum-tokens@${tag} --pack-destination ${tmpDir.path}`,
|
|
71
|
-
);
|
|
72
|
-
await x({
|
|
73
|
-
cwd: tmpDir.path,
|
|
74
|
-
file: join(tmpDir.path, stdout.trim()),
|
|
75
|
-
});
|
|
76
|
-
const oldTokenPath = join(tmpDir.path, "package", tokenPath);
|
|
77
|
-
await access(oldTokenPath);
|
|
78
|
-
console.log(`Comparing against ${stdout.trim()}`);
|
|
79
|
-
return JSON.parse(
|
|
80
|
-
convertNumberStringsToNumbers(
|
|
81
|
-
await readFile(oldTokenPath, { encoding: "utf8" }),
|
|
82
|
-
),
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function calculatePossibleRenames(diffResult, oldTokens, newTokens) {
|
|
87
|
-
diffResult.possiblyRenamed = {};
|
|
88
|
-
Object.keys(diffResult.deleted).forEach((deletedTokenName) => {
|
|
89
|
-
const oldTokenValue = oldTokens[deletedTokenName];
|
|
90
|
-
const allValueMatches = [];
|
|
91
|
-
Object.keys(diffResult.added).forEach((addedTokenName, i) => {
|
|
92
|
-
const newTokenValue = newTokens[addedTokenName];
|
|
93
|
-
if (Object.keys(diff(oldTokenValue, newTokenValue)).length === 0) {
|
|
94
|
-
allValueMatches.push(addedTokenName);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
if (allValueMatches.length > 0) {
|
|
98
|
-
diffResult.possiblyRenamed[deletedTokenName] = allValueMatches;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function convertNumberStringsToNumbers(dataString) {
|
|
104
|
-
return dataString.replace(/"([\d]*\.?[\d]*)"/g, (match, p1) => {
|
|
105
|
-
return p1;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function logResultCategory(diffResult, categoryKey, msg) {
|
|
110
|
-
const results = diffResult[categoryKey];
|
|
111
|
-
const resultCount = Object.keys(results).length;
|
|
112
|
-
if (!msg) {
|
|
113
|
-
msg = `Tokens ${categoryKey}`;
|
|
114
|
-
}
|
|
115
|
-
if (resultCount > 0) {
|
|
116
|
-
console.log(`\n*${msg} (${resultCount}):*`);
|
|
117
|
-
switch (categoryKey) {
|
|
118
|
-
case "possiblyRenamed":
|
|
119
|
-
Object.keys(results)
|
|
120
|
-
.sort()
|
|
121
|
-
.forEach((oldTokenName, i) => {
|
|
122
|
-
if (
|
|
123
|
-
Array.isArray(results[oldTokenName]) &&
|
|
124
|
-
results[oldTokenName].length > 1
|
|
125
|
-
) {
|
|
126
|
-
console.log(
|
|
127
|
-
` - Old name: \`${oldTokenName}\`, new name options:`,
|
|
128
|
-
);
|
|
129
|
-
results[oldTokenName].forEach((newTokenName) =>
|
|
130
|
-
console.log(` - \`${newTokenName}\``),
|
|
131
|
-
);
|
|
132
|
-
} else {
|
|
133
|
-
console.log(
|
|
134
|
-
` - \`${oldTokenName}\` -> \`${results[oldTokenName][0]}\``,
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
break;
|
|
139
|
-
default:
|
|
140
|
-
Object.keys(results)
|
|
141
|
-
.sort()
|
|
142
|
-
.forEach((tokenName, i) => console.log(` - \`${tokenName}\``));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|