Skip to content

Commit 413af0d

Browse files
staghousedependabot[bot]
andauthoredSep 12, 2023
Release/v5.2.2: See changelog (#602)
* Pre-Release v5.2.2 * Fix typos. * Bump Vitepress dep. * build(deps-dev): bump word-wrap from 1.2.3 to 1.2.5 (#605) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](jonschlinkert/word-wrap@1.2.3...1.2.5) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * More prep for release v5.2.2. * Minor changes. * Bump Vitepress. Styling changes. * Minor styling adjustment. * Fix open graph image. * chore(docs): update contributing. * fix(docs): change float to number. * update(changelog): mtggraphql changelog updates for release * task(docs): new data models (may change). changelog notes. doc clarity * update(docs): merge data models in documentation and clarify * fix(typo): fixes doc type on deck set * update(docs): define Abstract Models types more clearly * feat(DocBadge): custom component that extends Badge for title tips. * chore(docs): clarity for badges * chore(docs): update docs for clarity. some styling changes * misc(docs+styling): update docs for clarity. updates some styling. adds new features to sorting sets * style(fix): misc styling updates * update(docs): add more data models. * update(docs): no more abstract models. more exported types * fix(types): fix types for some files * update(docs): bumps vitepress and clarifies getting started * update(docs): fix a small issue with the TOC on getting started * feat(docs): nest directories for data models * fix(sidebar): fixes sidebar nested sidebars not showing active state * remove(log): removing logging * update(docs + styles): updates for some clarity and fixes some styling for the sorter and badges * docs(update): new organization for price Data Models and some other clarities * update(types): simplify type for sealed product variable config * update(docs): clarify docs * update(meta): defer google tag * fix(styles): adjust styles for a11y * fix(styles): adjust styles for a11y * fix(scripts): minor adjustments * fix(scripts): minor adjustments * fix(scripts): minor adjustments --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 36c7c25 commit 413af0d

File tree

77 files changed

+3933
-2074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3933
-2074
lines changed
 

‎CONTRIBUTING.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Some files and directories are omitted that do not help understand this current
4141
│   └── generate-types.js # Utility to generate TypeScript notations for documentation
4242
└── docs/ # Home directory, outputs to `/dist`
4343
   ├── **/**/index.md # Directories and their route entry point
44+
├── types.ts # An abstract of TypeScript types for MTGJSON files
4445
├── public/ # Public facing files
4546
│   ├── favicons/ # All favicon images
4647
│   ├── images/ # All application images
@@ -52,8 +53,9 @@ Some files and directories are omitted that do not help understand this current
5253
│   ├── static/ # Legacy path for MTGJSON documentation TypeScript Types
5354
│ │ └── mtgjson-types.ts # All TypeScript Types for MTGJSON Data Models
5455
│   │
55-
│   ├── types/ # Path to all MTGJSON documentation TypeScript Types
56-
│   └── *.* # Any public facing file, like robots.txt
56+
│   └── types/ # Path to all MTGJSON documentation TypeScript Types
57+
│   └── *.ts # All individual TseScript Types for MTGJSON Data Models
58+
5759
└── .vitepress/ # Main config and theme files for Vitepress
5860
├── config.js # Main VitePress configuration
5961
├── generatePages.js # Polyfill script to generate pages data for search
@@ -105,23 +107,29 @@ You can also change configuration of VitePress by overwriting variables within t
105107
An example of a property field for a data object field in Markdown:
106108

107109
```
108-
> ### artist <Badge type="danger" text="deprecated" /><Badge type="warning" text="optional" />
110+
> ### artist <DocBadge type="danger" text="deprecated" /><DocBadge type="warning" text="optional" />
109111
>
110-
> The name of the artist that illustrated the card art.
112+
> The name of the artist that illustrated the card art.
111113
>
112114
> **Type:** `string`
113115
> **Introduced:** `v4.0.0`
114116
```
115117

116-
The `<Badge type="warning" text="optional" />` markup will render a UI change in the property that denotes the property is optional. The same applies for `<Badge type="danger" text="deprecated" />` that can be used to denote a property is deprecated. Be sure to order them with deprecated first, and then optional. Using the optional Badge is required for properties that we know are optional in order to generate the TypeScript types properly.
118+
The `<DocBadge type="warning" text="optional" />` markup will render a UI change in the property that denotes the property is optional. The same applies for `<DocBadge type="danger" text="deprecated" />` that can be used to denote a property is deprecated. Be sure to order them with deprecated first, and then optional. Using the optional Badge is required for properties that we know are optional in order to generate the TypeScript types properly.
117119

118120
You can also use the `<ExampleField type='<Enum Name>'` component to render examples provided the enum values exist in the EnumValues.json file. This requires some frontmatter updates where the `enum` Frontmatter property has a value that equates to an EnumValues.json property and the `<Enum Name>` is the property within that enumeration. For example:
119121

120122
If you set `enum` is Frontmatter to `card`, and `<Enum Name>` to `availability`, the example field will populate from `EnumValues.json` -> `data` -> `card` -> `availability`.
121123

124+
#### TypeScript Models
125+
126+
These are generated at build-time of the application and then import inline to the documentation page. THis works by using the above syntax for a property field for a documentation page. The utility will parse out all those blockquotes with properties and transform them in to a TypeScript file.
127+
128+
File Data Models work a bit differently. They are declared in the `/docs/types.ts` file. And need to be updated manually as new files are created.
129+
122130
## Pinia Store
123131

124-
We use Pinia to fetch data from MTGJSON API's in order to fill our application data. However, we only do this during the first render so the application and store remains as performant as possible.
132+
We use Pinia to fetch data from MTGJSON API's in order to fill our application data. However, we only do this during the first render so the application and store the data so the app remains as performant as possible without hitting the API's too much.
125133

126134
## Testing
127135

‎docs/.vitepress/config.js

+11-19
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import generateSidebar from './generateSidebar';
22
import generatePages from './generatePages';
33

44
// Sidebar link generation
5-
const [
6-
abstractModels,
7-
dataModels
8-
] = generateSidebar(['/abstract-models/', '/data-models/']);
5+
const [dataModels] = generateSidebar(['/data-models/']);
96

107
// Page metadata generation
118
export const pages = generatePages({
@@ -33,7 +30,7 @@ export default {
3330
// Google SEO
3431
['meta', { property: 'og:title', content: title }],
3532
['meta', { property: 'og:description', content: description }],
36-
['meta', { property: 'og:image', src: '/images/assets/thumbnail-mtgjson.jpg' }],
33+
['meta', { property: 'og:image', src: 'https://mtgjson.com/images/assets/og-image-mtgjson.jpg' }],
3734
// Favicon and OS Tiles
3835
['link', { rel: 'shortcut icon', href: '/favicons/favicon.ico', type: 'image/x-icon' }],
3936
['link', { rel: 'icon', href: '/favicons/favicon-16x16.png', sizes: '16x16', type: 'image/png' }],
@@ -47,7 +44,7 @@ export default {
4744
['meta', { name: 'theme-color', content: '#0f263c' }],
4845
// Analytics
4946
['meta', { name: 'google-site-verification', content: 'M0vhY1d0DytNcuhlzErPmN1UUXkPEZM_jkj8q_S21JY' }],
50-
['script', { src: 'https://www.googletagmanager.com/gtag/js?id=G-ZPPM5J5ET2', async: 'true' }],
47+
['script', { src: 'https://www.googletagmanager.com/gtag/js?id=G-ZPPM5J5ET2', async: 'true', defer: 'true' }],
5148
[
5249
'script',
5350
{},
@@ -61,16 +58,16 @@ export default {
6158
],
6259
markdown: {
6360
toc: {
64-
level: [ 3 ],
61+
level: [3],
6562
shouldAllowNested: true,
66-
format: (str) => str.split('<')[0]
63+
format: (str) => str.split('<')[0],
6764
},
68-
theme: 'material-theme-darker'
65+
theme: 'material-theme',
6966
},
7067
// VitePress themeing
7168
themeConfig: {
7269
pages,
73-
outline: 3,
70+
outline: [2, 3],
7471
smoothScroll: true,
7572
outlineBadges: false,
7673
outlineTitle: 'On This Page',
@@ -89,7 +86,7 @@ export default {
8986
},
9087
{
9188
icon: {
92-
svg: '<svg alt="Patreon icon" fill="#f96753" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M512 194.8c0 101.3-82.4 183.8-183.8 183.8-101.7 0-184.4-82.4-184.4-183.8 0-101.6 82.7-184.3 184.4-184.3C429.6 10.5 512 93.2 512 194.8zM0 501.5h90v-491H0v491z" class="st0"/></svg>'
89+
svg: '<svg alt="Patreon icon" fill="#f96753" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M512 194.8c0 101.3-82.4 183.8-183.8 183.8-101.7 0-184.4-82.4-184.4-183.8 0-101.6 82.7-184.3 184.4-184.3C429.6 10.5 512 93.2 512 194.8zM0 501.5h90v-491H0v491z" class="st0"/></svg>',
9390
},
9491
link: 'https://www.patreon.com/MTGJSON',
9592
},
@@ -111,7 +108,7 @@ export default {
111108
text: 'F.A.Q.',
112109
link: '/faq/',
113110
},
114-
]
111+
],
115112
},
116113
{
117114
text: 'GraphQL API',
@@ -120,8 +117,8 @@ export default {
120117
{
121118
text: 'MTGGraphQL',
122119
link: '/mtggraphql/',
123-
}
124-
]
120+
},
121+
],
125122
},
126123
{
127124
text: 'Downloads',
@@ -146,11 +143,6 @@ export default {
146143
link: '/data-models/',
147144
items: dataModels,
148145
},
149-
{
150-
text: 'Abstract Models',
151-
link: '/abstract-models/',
152-
items: abstractModels,
153-
},
154146
{
155147
text: 'Changelogs',
156148
link: '/changelogs/',

0 commit comments

Comments
 (0)
Please sign in to comment.