This repository has been archived by the owner on Dec 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
/
howto.txt
100 lines (71 loc) · 3.97 KB
/
howto.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Overview
--------
nodejs scripts in 'build' scrape data from gatherer.wizards.com and magiccards.info
The scraped web pages are cached in the local 'cache' directory, so repeat runs don't hammer the sites.
If you ever need to clear the cache, you can just delete the 'cache' directory, or you can be more selective using util/clearCacheForSet.js
The 'shared/C.js' file contains most constants.
Make sure that C.STANDARD_SETS is up-to-date.
Sets with "recalculateStandard" parameter, will have its Standard legalities recalculated by mtgjson (using buildSet). This is currently set to ALL sets.
The 'web/index.js' nodejs script generates the final static files that will later be deployed to mtgjson.com using deploy/deploy.sh and served with nginx
/-------------------------------\
| Gatherer New Set Instructions |
\-------------------------------/
# Add new set config as shared/set_configs/{set code}.json (in the appropriate subdirectory if a special type of set).
# Run buildSet.js TWICE (first pass gets data, second pass gets foreign langauge names and additional data)
node build/buildSet.js <expansion code>
node build/buildSet.js <expansion code>
# Now run
node util/updatePrintingsFromSet.js sincelastprintingreset
# If the set is not 'officially' out yet, then legalities are not correct yet.
# So set yourself a reminder for a day after the official release date of the set to do:
node util/clearCacheForSet.js legalities <set codes that rotated out AND the new set code>
node build/buildSet.js <set codes that rotated out AND the new set code>
node util/updateLegalitiesFromSet.js <set codes that rotated out AND the new set code>
# updateLegalitiesFromSet also fixes incorrect "Standard" definitions from Gatherer, independent of "recalculateStandard" setting.
# Goto: "Publish Final Instructions" below
/------------------------------\
| Updating Promos Instructions |
\------------------------------/
# Run
node util/clearCacheForSet.js mcilist mcisets
node build/importMCISet.js mcisets
node util/updateFromPromoPrinintgs.js
node util/updateNonGathererSets.js
# Goto: "Publish Final Instructions" below
/-----------------------------------\
| Non-Gatherer New Set Instructions |
\-----------------------------------/
# Add new set to C.js in all places needed (SETS_NOT_ON_GATHERER and NON_GATHERER_SET_CARD_LISTS, etc.)
node build/createNonGathererSet.js <expansion code>
# Update printings
node util/updatePrintingsFromSet.js <expansion code>
# Goto: "Publish Final Instructions" below
/----------------------------\
| Publish Final Instructions |
\----------------------------/
node build/importMCISet.js mcisets
node util/updateNonGathererSets.js
# Update changelog.json with new change log entry
# Now generate web
node web/index.js <set codes>
# ALERT: The web/index.js file may detect old cards that need to be updated with new descriptions
# These show up as 'tainted set codes'. The cache files are automatically cleared, but you then need to re-run
# node build/buildSet.js <tainted set codes> && node build/importMCISet.js mcisets && node util/updateNonGathererSets.json
# Then re-run web/index.js
# You may have to do this a lot of times.
# Now examine JSON changes (this shows you a diff between local JSON files and those currently live on mtgjson.com)
node util/compareRelease.js allsets not<new expansion code> | more
# Example, if you just added set XYZ, run: `node util/compareRelease.js allsets notXYZ`.
# You need notXYZ because compareRelease.js does not handle a missing previous json file to compare to.
# Update changelog.json entry's "updatedSetFiles" field with the files listed at the end of the compareRelease.js execution
# Re-build web with `node web/index.js`
# Test in browser
http://dev.mtgjson.com
# Deploy
cd deploy
./deploy.sh
# Check live site mtgjson.com
/-------------\
| Final Notes |
\-------------/
* Whenever you clear the entire cache, or the 'printings' type of cache for all sets, you should update 'C.LAST_PRINTINGS_RESET' to the latest set code.