Skip to content

Commit 50e36e9

Browse files
committed
fix: update Jest configuration and enhance schema documentation generation
- Added support for test files in the scripts directory to the Jest configuration, improving test coverage. - Modified Jekyll configuration to enable Liquid rendering for JavaScript files, enhancing asset processing. - Refined the generate-schema-docs script by removing unnecessary comments and improving code clarity.
1 parent d3f6fda commit 50e36e9

4 files changed

Lines changed: 630 additions & 10 deletions

File tree

.github/scripts/docs/create-jekyll-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ relative_links:
112112
113113
# Default layouts and configurations
114114
defaults:
115-
# Process JS files as static assets - notice the path is simpler
115+
# Process JS files with Liquid but no layout
116116
- scope:
117117
path: "assets/js"
118118
values:
119119
layout: null
120120
sitemap: false
121-
render_with_liquid: false
121+
render_with_liquid: true
122122
# Then define all other defaults below
123123
- scope:
124124
path: "assets/css"

jest.config.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module.exports = {
1212
silent: true,
1313
testMatch: [
1414
'<rootDir>/src/**/*.test.{cjs,js,mjs,ts}',
15-
'<rootDir>/test/**/*.test.{cjs,js,mjs,ts}'
15+
'<rootDir>/test/**/*.test.{cjs,js,mjs,ts}',
16+
'<rootDir>/scripts/**/*.test.{js,ts}'
1617
],
1718
reporters: CI
1819
? [['github-actions', { silent: false }], 'summary']

scripts/generate-schema-docs.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ export function runJsonSchema2Md(tempDir) {
144144
* @param {string[]} schemaFiles - List of schema files
145145
*/
146146
export function createIndexFile(schemaFiles) {
147-
// Replace the current exactCoreSchemas array with this more comprehensive list
148147
const coreSchemas = [
149-
// Main schemas
150148
'component-schema-v2',
151149
'component-schema',
152150
'form-definition-schema',
@@ -158,9 +156,7 @@ export function createIndexFile(schemaFiles) {
158156
'list-schema-v2'
159157
]
160158

161-
// Add this array to define exactly which schemas should be considered "advanced"
162159
const advancedSchemas = [
163-
// Core supporting schemas
164160
'form-metadata-author-schema',
165161
'form-metadata-input-schema',
166162
'form-metadata-state-schema',
@@ -171,23 +167,20 @@ export function createIndexFile(schemaFiles) {
171167
'question-schema'
172168
]
173169

174-
// Separate schemas into core and advanced categories
175170
const core = /** @type {string[]} */ ([])
176171
const advanced = /** @type {string[]} */ ([])
177172

178173
schemaFiles.forEach((file) => {
179174
const baseName = path.basename(file, '.json')
180175
const link = `* [${baseName}](${baseName}.md)`
181176

182-
// Exact match for core schemas
183177
if (coreSchemas.includes(baseName)) {
184178
core.push(link)
185179
} else if (advancedSchemas.includes(baseName)) {
186180
advanced.push(link)
187181
}
188182
})
189183

190-
// Sort both arrays alphabetically
191184
core.sort()
192185
advanced.sort()
193186

0 commit comments

Comments
 (0)