Skip to content

Commit eb5656a

Browse files
authored
Merge pull request #119 from isitvegan/patch-items
Add a system for patching imported items
2 parents f6ce116 + 0790fd7 commit eb5656a

File tree

9 files changed

+155
-77
lines changed

9 files changed

+155
-77
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ jobs:
1717
node-version: '20'
1818
- uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.12'
20+
python-version: '3.12'
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
2123
- name: Install Dependencies
2224
run: npm ci
2325
- name: Build
2426
run: npm run build
2527
- run: mkdir _site
2628
- run: ./scripts/install.py --target _site
2729
- name: Upload GitHub Pages Artifact
28-
uses: actions/upload-pages-artifact@v1
30+
uses: actions/upload-pages-artifact@v3
2931

3032
deploy_pages:
3133
name: Deploy to GitHub Pages
@@ -44,4 +46,4 @@ jobs:
4446
steps:
4547
- name: Deploy to GitHub Pages
4648
id: deployment
47-
uses: actions/deploy-pages@v1
49+
uses: actions/deploy-pages@v4

item-patches/e_numbers.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[patch_item]]
2+
if = '.e_number | IN("E920", "E921")'
3+
patch.description = """
4+
Both L-cystine and L-cysteine are traditionally derived from animal hair or feathers.
5+
Newer methods relying on fermentation are fully vegan."""
6+
patch.sources = [
7+
{ type = "url", value = "https://www.wacker.com/h/medias/6882-EN.pdf" },
8+
{ type = "url", value = "https://github.com/isitvegan/isitvegan-web/pull/116" },
9+
]
10+
11+
[[patch_item]]
12+
if = '.e_number == "E621"'
13+
patch.alternative_names = ["MSG"]

items/imported/e_numbers.toml

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ vegan_alternatives = []
282282
[[items]]
283283
name = "Ethyl ester of beta-apo-8'-carotenic acid"
284284
alternative_names = [
285-
"Ethyl ester of beta-apo-8'-carotenic acid",
286285
"Ethyl 8'-apo-beta,psi-carotenoate"
287286
]
288287
e_number = "E160f"
@@ -916,7 +915,6 @@ alternative_names = [
916915
"o-Phenylphenol",
917916
"Biphenylol",
918917
"2-Hydroxybiphenyl",
919-
"Orthophenyl phenol",
920918
"o-Xenol",
921919
"Orthoxenol"
922920
]
@@ -1038,7 +1036,6 @@ vegan_alternatives = []
10381036
[[items]]
10391037
name = "Hexamine"
10401038
alternative_names = [
1041-
"Hexamine",
10421039
"Methenamine",
10431040
"Urotropine",
10441041
"Formin",
@@ -1223,7 +1220,6 @@ vegan_alternatives = []
12231220
[[items]]
12241221
name = "Sodium propionate"
12251222
alternative_names = [
1226-
"Sodium propionate",
12271223
"Napropion"
12281224
]
12291225
e_number = "E281"
@@ -1238,7 +1234,6 @@ vegan_alternatives = []
12381234
[[items]]
12391235
name = "Calcium propionate"
12401236
alternative_names = [
1241-
"Calcium propionate",
12421237
"Calcium dipropionate",
12431238
"Mycoban"
12441239
]
@@ -1253,9 +1248,7 @@ vegan_alternatives = []
12531248

12541249
[[items]]
12551250
name = "Potassium propionate"
1256-
alternative_names = [
1257-
"Potassium propionate"
1258-
]
1251+
alternative_names = []
12591252
e_number = "E283"
12601253
state = "vegan"
12611254
description = ""
@@ -1346,7 +1339,6 @@ vegan_alternatives = []
13461339
[[items]]
13471340
name = "Fumaric acid"
13481341
alternative_names = [
1349-
"Fumaric acid",
13501342
"trans-1,2-Ethylenedicarboxylic acid",
13511343
"2-Butenedioic acid",
13521344
"trans-Butenedioic acid",
@@ -1367,7 +1359,8 @@ vegan_alternatives = []
13671359
[[items]]
13681360
name = "Ascorbic acid"
13691361
alternative_names = [
1370-
"Vitamin C"
1362+
"Vitamin C",
1363+
"l-threo-Hex-2-enono-1,4-lactone"
13711364
]
13721365
e_number = "E300"
13731366
state = "vegan"
@@ -1540,7 +1533,8 @@ name = "Erythorbic acid"
15401533
alternative_names = [
15411534
"-Araboascorbic acid",
15421535
"Erythorbate",
1543-
"Isoascorbic acid."
1536+
"Isoascorbic acid",
1537+
"D-isoascorbic acid"
15441538
]
15451539
e_number = "E315"
15461540
state = "vegan"
@@ -1576,7 +1570,8 @@ name = "Erythorbin acid[citation needed]"
15761570
alternative_names = [
15771571
"-Araboascorbic acid",
15781572
"Erythorbate",
1579-
"Isoascorbic acid."
1573+
"Isoascorbic acid",
1574+
"D-isoascorbic acid"
15801575
]
15811576
e_number = "E317"
15821577
state = "vegan"
@@ -1639,6 +1634,7 @@ alternative_names = [
16391634
"2,6-Di-tert-butyl-p-cresol",
16401635
"2,6-DI-tert-butyl-4-methylphenol",
16411636
"3,5-Di-tert-butyl-4-hydroxytoluene",
1637+
"2,6 ditertiary-butyl-4-methyl phenol",
16421638
"DBPC",
16431639
"BHT",
16441640
"AO-29",
@@ -1723,7 +1719,6 @@ vegan_alternatives = []
17231719
[[items]]
17241720
name = "Tartaric acid"
17251721
alternative_names = [
1726-
"Tartaric acid",
17271722
"Threaric acid",
17281723
"Racemic acid",
17291724
"Uvic acid",
@@ -1789,7 +1784,8 @@ vegan_alternatives = []
17891784
[[items]]
17901785
name = "Phosphoric acid"
17911786
alternative_names = [
1792-
"Orthophosphoric acid"
1787+
"Orthophosphoric acid",
1788+
"hydrogen phosphate"
17931789
]
17941790
e_number = "E338"
17951791
state = "vegan"
@@ -1915,7 +1911,6 @@ vegan_alternatives = []
19151911
[[items]]
19161912
name = "Adipic acid"
19171913
alternative_names = [
1918-
"Adipic acid",
19191914
"Hexane-1,6-dioic acid"
19201915
]
19211916
e_number = "E355"
@@ -1958,7 +1953,6 @@ vegan_alternatives = []
19581953
[[items]]
19591954
name = "Succinic acid"
19601955
alternative_names = [
1961-
"Succinic acid",
19621956
"1,4-Butanedioic acid"
19631957
]
19641958
e_number = "E363"
@@ -2039,7 +2033,7 @@ vegan_alternatives = []
20392033
[[items]]
20402034
name = "Niacin"
20412035
alternative_names = [
2042-
"Nicotinic acid (INN)",
2036+
"Niacin (USAN US)",
20432037
"Bionic",
20442038
"Vitamin B3",
20452039
"Vitamin PP"
@@ -2102,9 +2096,7 @@ vegan_alternatives = []
21022096

21032097
[[items]]
21042098
name = "Alginic acid"
2105-
alternative_names = [
2106-
"Alginic acid"
2107-
]
2099+
alternative_names = []
21082100
e_number = "E400"
21092101
state = "vegan"
21102102
description = ""
@@ -2730,7 +2722,6 @@ vegan_alternatives = []
27302722
[[items]]
27312723
name = "Stannous chloride"
27322724
alternative_names = [
2733-
"Stannous chloride",
27342725
"Tin salt",
27352726
"Tin protochloride"
27362727
]
@@ -2747,7 +2738,8 @@ vegan_alternatives = []
27472738
name = "Sulfuric acid"
27482739
alternative_names = [
27492740
"Oil of vitriol",
2750-
"Hydrogen sulfate"
2741+
"Hydrogen sulfate",
2742+
"Dihydrogen sulfate"
27512743
]
27522744
e_number = "E513"
27532745
state = "vegan"
@@ -3653,8 +3645,7 @@ vegan_alternatives = []
36533645
name = "Crystalline wax"
36543646
alternative_names = [
36553647
"Hydrogenated poly-1-decenes",
3656-
"Hydrogenated poly-alpha-olefin",
3657-
"Crystalline wax"
3648+
"Hydrogenated poly-alpha-olefin"
36583649
]
36593650
e_number = "E907"
36603651
state = "vegan"
@@ -3804,7 +3795,6 @@ vegan_alternatives = []
38043795
[[items]]
38053796
name = "Carbamide"
38063797
alternative_names = [
3807-
"Carbamide",
38083798
"Carbonyldiamide",
38093799
"Carbonyldiamine",
38103800
"Diaminomethanal",
@@ -3872,7 +3862,6 @@ vegan_alternatives = []
38723862
[[items]]
38733863
name = "Dichlorodifluoromethane"
38743864
alternative_names = [
3875-
"Dichlorodifluoromethane",
38763865
"Carbon dichloride difluoride",
38773866
"Dichloro-difluoro-methane",
38783867
"Difluorodichloromethane",
@@ -3952,7 +3941,6 @@ vegan_alternatives = []
39523941
[[items]]
39533942
name = "Isobutane"
39543943
alternative_names = [
3955-
"Isobutane",
39563944
"R600a"
39573945
]
39583946
e_number = "E943b"
@@ -4018,7 +4006,8 @@ vegan_alternatives = []
40184006
[[items]]
40194007
name = "Aspartame"
40204008
alternative_names = [
4021-
"N-(L-α-Aspartyl)-L-phenylalanine,1-methyl ester"
4009+
"N-(L-α-Aspartyl)-L-phenylalanine",
4010+
"1-methyl ester"
40224011
]
40234012
e_number = "E951"
40244013
state = "vegan"
@@ -4074,8 +4063,7 @@ alternative_names = [
40744063
"1′,4,6′-Trichlorogalactosucrose",
40754064
"Trichlorosucrose",
40764065
"4,1′,6′-Trichloro-4,1′,6′-trideoxygalactosucrose",
4077-
"TGS",
4078-
"Splenda"
4066+
"TGS"
40794067
]
40804068
e_number = "E955"
40814069
state = "vegan"
@@ -4125,8 +4113,8 @@ vegan_alternatives = []
41254113
[[items]]
41264114
name = "Xylitol"
41274115
alternative_names = [
4128-
"(2R,3R,4S)-Pentane-1,2,3,4,5-pentaol (not recommended)",
4129-
"(2R,3R,4S)-1,2,3,4,5-Pentahydroxypentane",
4116+
"(2R,3r,4S)-Pentane-1,2,3,4,5-pentaol (not recommended)",
4117+
"(2R,3r,4S)-1,2,3,4,5-Pentahydroxypentane",
41304118
"Xylite"
41314119
]
41324120
e_number = "E967"
@@ -4444,8 +4432,7 @@ vegan_alternatives = []
44444432
name = "Triethyl citrate"
44454433
alternative_names = [
44464434
"Ethyl citrate",
4447-
"Citric acid ethyl ester",
4448-
"Triethyl citrate"
4435+
"Citric acid ethyl ester"
44494436
]
44504437
e_number = "E1505"
44514438
state = "vegan"
@@ -4502,7 +4489,6 @@ vegan_alternatives = []
45024489
[[items]]
45034490
name = "Propylene glycol"
45044491
alternative_names = [
4505-
"Propylene glycol",
45064492
"α-Propylene glycol",
45074493
"1,2-Propanediol",
45084494
"1,2-Dihydroxypropane",
@@ -4569,7 +4555,8 @@ vegan_alternatives = []
45694555
[[items]]
45704556
name = "Wax esters"
45714557
alternative_names = [
4572-
"2-Amino-3-sulfhydrylpropanoic acid"
4558+
"2-Amino-3-sulfhydrylpropanoic acid",
4559+
"2-Amino-3-mercaptopropanoic acid"
45734560
]
45744561
e_number = "E910"
45754562
state = "carnist"
@@ -4595,7 +4582,8 @@ vegan_alternatives = []
45954582
[[items]]
45964583
name = "L-cysteine"
45974584
alternative_names = [
4598-
"2-Amino-3-sulfhydrylpropanoic acid"
4585+
"2-Amino-3-sulfhydrylpropanoic acid",
4586+
"2-Amino-3-mercaptopropanoic acid"
45994587
]
46004588
e_number = "E920"
46014589
state = "carnist"
@@ -4721,7 +4709,8 @@ name = "Potassium nitrate"
47214709
alternative_names = [
47224710
"Saltpeter",
47234711
"Saltpetre",
4724-
"Nitrate of potash"
4712+
"Nitrate of potash",
4713+
"Nitre"
47254714
]
47264715
e_number = "E252"
47274716
state = "itDepends"
@@ -4735,7 +4724,6 @@ vegan_alternatives = []
47354724
[[items]]
47364725
name = "Lactic acid"
47374726
alternative_names = [
4738-
"Lactic acid",
47394727
"Milk acid"
47404728
]
47414729
e_number = "E270"
@@ -5168,7 +5156,6 @@ vegan_alternatives = []
51685156
[[items]]
51695157
name = "Stearyl tartrate"
51705158
alternative_names = [
5171-
"Stearyl tartrate",
51725159
"E 483"
51735160
]
51745161
e_number = "E483"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"dev-build-watch": "rollup -c rollup.config.js --watch",
2727
"dev-build-less": "./scripts/build-css.py",
2828
"build": "BUILD_ENV=production rollup -c rollup.config.js && ./scripts/build-css.py --release && npm run build-items",
29-
"build-items": "./scripts/build-items-json.py",
29+
"build-items": "cd scripts/build_items && uv run build-items-json.py",
3030
"serve": "python3 -m http.server"
3131
}
3232
}

scripts/build-items-json.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)