Skip to content

Commit e1f0139

Browse files
authored
[DO-578] Declare default config correctly (#43)
* Declare default config in app.config.ts * Rewrite nuxt schema types definitions
1 parent 368ef5e commit e1f0139

File tree

2 files changed

+160
-113
lines changed

2 files changed

+160
-113
lines changed

app.config.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@
1515
*/
1616

1717
export default defineAppConfig({
18-
exactproDocs: {},
18+
exactproDocs: {
19+
title: 'Exactpro Documentation',
20+
github: {
21+
branch: 'master',
22+
docsDir: '/'
23+
},
24+
seo: {
25+
keywords: [],
26+
robots: [],
27+
verificationMetaTags: []
28+
},
29+
contacts: [],
30+
social: {
31+
github: {
32+
url: 'https://github.com/exactpro'
33+
},
34+
facebook: {
35+
url: 'https://www.facebook.com/exactpro/'
36+
},
37+
twitter: {
38+
url: 'https://twitter.com/exactpro'
39+
},
40+
linkedin: {
41+
url: 'https://www.linkedin.com/company/exactpro-systems-llc?trk=biz-companies-cym'
42+
},
43+
youtube: {
44+
url: 'https://www.youtube.com/c/exactprosystems'
45+
}
46+
}
47+
},
1948
nuxtIcon: {}
2049
})

nuxt.schema.ts

Lines changed: 130 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -44,138 +44,156 @@ export interface ExactproDocsContactConfigOptions {
4444
export default defineNuxtSchema({
4545
appConfig: {
4646
exactproDocs: {
47-
/**
48-
* Title of the documentation.
49-
* It will be displayed in the header and in the browser tab.
50-
*
51-
* @type {string}
52-
*/
53-
title: 'Exactpro Documentation',
54-
/**
55-
* Configuration for GitHub integration
56-
*/
47+
title: {
48+
$schema: {
49+
title: 'Title of the documentation.',
50+
description:
51+
'It will be displayed in the header and in the browser tab.',
52+
type: 'string',
53+
required: true
54+
}
55+
},
5756
github: {
58-
/**
59-
* Link to the repository on GitHub
60-
*
61-
* @default undefined
62-
* @type {?string}
63-
*/
64-
repoLink: undefined,
65-
/**
66-
* Name of the default branch on GitHub
67-
*
68-
*/
69-
branch: 'master',
70-
/**
71-
* Path to the directory with documentation files on GitHub
72-
* Specify if the documentation is stored in a subdirectory of the repository.
73-
*
74-
*/
75-
docsDir: '/'
57+
$schema: {
58+
title: 'Configuration for GitHub integration'
59+
},
60+
repoLink: {
61+
$schema: {
62+
title: 'Link to the repository on GitHub',
63+
type: 'string'
64+
}
65+
},
66+
branch: {
67+
$schema: {
68+
title: 'Name of the default branch on GitHub',
69+
type: 'string'
70+
}
71+
},
72+
docsDir: {
73+
$schema: {
74+
title: 'Path to the directory with documentation files on GitHub',
75+
description:
76+
'Specify if the documentation is stored in a subdirectory of the repository.',
77+
type: 'string'
78+
}
79+
}
7680
},
7781
seo: {
78-
/**
79-
* Description of the documentation. It will be displayed in search results.
80-
* If some page has a description, it will be used instead of this one.
81-
*
82-
* @type {?string}
83-
*/
84-
description: undefined,
85-
/**
86-
* Keywords for the documentation. They will be displayed in search results.
87-
*
88-
* @type {string[]}
89-
* @example ['exactpro', 'documentation', 'nuxt']
90-
*/
91-
keywords: [],
92-
/**
93-
* Configuration for robots.txt
94-
* @see {@link https://github.com/nuxt-modules/robots | Example of configuration}
95-
* @type {ExactproDocsRobotsTxtOptions[]}
96-
*/
97-
robots: [],
82+
$schema: {
83+
title: 'Configuration for SEO'
84+
},
85+
description: {
86+
$schema: {
87+
title: 'Description of the documentation',
88+
description:
89+
'It will be displayed in search results. If some page has a description, it will be used instead of this one.',
90+
type: 'string'
91+
}
92+
},
93+
keywords: {
94+
$schema: {
95+
title: 'Keywords for the documentation',
96+
description: [
97+
'They will be displayed in search results.',
98+
'@example ["keyword1", "keyword2"]'
99+
].join('\n'),
100+
type: 'array',
101+
tsType: 'string[]'
102+
},
103+
$default: []
104+
},
105+
robots: {
106+
$schema: {
107+
title: 'Configuration for robots.txt',
108+
description:
109+
'@see {@link https://github.com/nuxt-modules/robots | Example of configuration}',
110+
type: 'array',
111+
tsType: 'ExactproDocsRobotsTxtOptions[]'
112+
},
113+
$default: []
114+
},
98115
sitemap: {
99-
/**
100-
* Base URL for sitemap. All links in sitemap will be relative to this URL.
101-
*
102-
* @example 'https://exactpro.github.io'
103-
* @type {?string}
104-
*/
105-
baseUrl: undefined
116+
$schema: {
117+
title: 'Configuration for sitemap.xml'
118+
},
119+
baseUrl: {
120+
$schema: {
121+
title: 'Base URL for sitemap',
122+
description: [
123+
'All links in sitemap will be relative to this URL.',
124+
'@example "https://exactpro.github.io"'
125+
].join('\n'),
126+
type: 'string'
127+
}
128+
}
106129
},
107-
/**
108-
* Meta tags for verification of the site by search engines
109-
*
110-
* @see {@link https://support.google.com/webmasters/answer/9008080?hl=en#meta_tag_verification | Verify your site ownership }
111-
* @type {{ name: string, content: string }[]}
112-
*/
113-
verificationMetaTags: []
130+
verificationMetaTags: {
131+
$schema: {
132+
title: 'Meta tags for verification of the site by search engines',
133+
description:
134+
'@see {@link https://support.google.com/webmasters/answer/9008080?hl=en#meta_tag_verification | Verify your site ownership }',
135+
type: 'array',
136+
tsType: '{ name: string, content: string }[]'
137+
},
138+
$default: []
139+
}
114140
},
115141
gtag: {
116-
/**
117-
* Measurement ID for Google Analytics
118-
*
119-
* @type {?string}
120-
*/
121-
measurementId: undefined
142+
measurementId: {
143+
$schema: {
144+
title: 'Measurement ID for Google Analytics',
145+
type: 'string'
146+
}
147+
}
122148
},
123149
social: {
124-
/**
125-
* Link to the GitHub social media page
126-
*
127-
* @type {ExactproDocsSocialLinkConfigOptions}
128-
*/
150+
$schema: {
151+
title: 'Configuration for social media links'
152+
},
129153
github: {
130-
url: 'https://github.com/exactpro'
154+
$schema: {
155+
title: 'Link to the GitHub social media page',
156+
type: 'object',
157+
tsType: 'ExactproDocsSocialLinkConfigOptions'
158+
}
131159
},
132-
/**
133-
* Link to the Facebook social media page
134-
*
135-
* @type {ExactproDocsSocialLinkConfigOptions}
136-
*/
137160
facebook: {
138-
url: 'https://www.facebook.com/exactpro/',
139-
customIcon: undefined,
140-
disabled: false
161+
$schema: {
162+
title: 'Link to the Facebook social media page',
163+
type: 'object',
164+
tsType: 'ExactproDocsSocialLinkConfigOptions'
165+
}
141166
},
142-
/**
143-
* Link to the Twitter social media page
144-
*
145-
* @type {ExactproDocsSocialLinkConfigOptions}
146-
*/
147167
twitter: {
148-
url: 'https://twitter.com/exactpro',
149-
customIcon: undefined,
150-
disabled: false
168+
$schema: {
169+
title: 'Link to the Twitter social media page',
170+
type: 'object',
171+
tsType: 'ExactproDocsSocialLinkConfigOptions'
172+
}
151173
},
152-
/**
153-
* Link to the LinkedIn social media page
154-
*
155-
* @type {ExactproDocsSocialLinkConfigOptions}
156-
*/
157174
linkedin: {
158-
url: 'https://www.linkedin.com/company/exactpro-systems-llc?trk=biz-companies-cym',
159-
customIcon: undefined,
160-
disabled: false
175+
$schema: {
176+
title: 'Link to the LinkedIn social media page',
177+
type: 'object',
178+
tsType: 'ExactproDocsSocialLinkConfigOptions'
179+
}
161180
},
162-
/**
163-
* Link to the YouTube social media page
164-
*
165-
* @type {ExactproDocsSocialLinkConfigOptions}
166-
*/
167181
youtube: {
168-
url: 'https://www.youtube.com/c/exactprosystems',
169-
customIcon: undefined,
170-
disabled: false
182+
$schema: {
183+
title: 'Link to the YouTube social media page',
184+
type: 'object',
185+
tsType: 'ExactproDocsSocialLinkConfigOptions'
186+
}
171187
}
172188
},
173-
/**
174-
* Footer contacts list
175-
*
176-
* @type {ExactproDocsContactConfigOptions[]}
177-
*/
178-
contacts: []
189+
contacts: {
190+
$schema: {
191+
title: 'List of contacts in the footer',
192+
type: 'array',
193+
tsType: 'ExactproDocsContactConfigOptions[]'
194+
},
195+
$default: []
196+
}
179197
}
180198
}
181199
})

0 commit comments

Comments
 (0)