Skip to content

Commit 6c178ea

Browse files
authored
Merge branch 'main' into addingTool
2 parents 9567a1f + 66d874e commit 6c178ea

File tree

20 files changed

+232
-25
lines changed

20 files changed

+232
-25
lines changed

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ Thanks for submitting a pull request! Please provide enough information so that
3232
**Does this PR introduce a breaking change?**
3333

3434
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->
35+
36+
# Checklist
37+
38+
Please ensure the following tasks are completed before submitting this pull request.
39+
40+
- [ ] Read, understood, and followed the [contributing guidelines](https://github.com/json-schema-org/website/blob/main/CONTRIBUTING.md).

.github/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This document outlines the guidelines for contributing to and maintaining GitHub
1313

1414
Our YAML files are organized based on specific roles and event triggers. When creating or modifying workflows, ensure that:
1515
- The file roles described below are strictly maintained.
16-
- Job sequences within workflows are preserved using [GitHub Action job dependencies](https://docs.github.com/en/actions/using-workflows/using-jobs-in-a-workflow#defining-prerequisite-jobs).
16+
- Job sequences within workflows are preserved using [GitHub Action job dependencies](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-jobs-in-a-workflow#defining-prerequisite-jobs).
1717

1818
### File Categorization
1919

@@ -42,7 +42,7 @@ Separate files may be created for workflows that:
4242

4343
- Only work correctly if they have a dedicated file.
4444
Examples:
45-
- [Preview Deployment](./preview-deployment.yml): Deploys preview environments for pull requests.
45+
- [Preview Deployment](./deploy-preview.yml): Deploys preview environments for pull requests.
4646
- [Production Deployment](./production-deployment.yml): Handles production deployments.
4747
- [CodeQL Code Scanning](./codeql.yml): Performs code security analysis.
4848
- [Check PR Dependencies](./pr-dependencies.yml): Enforces dependencies between PRs based on opening comments.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: PR Body Validation
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
jobs:
8+
check-pr-content:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Check PR content
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
const pr = context.payload.pull_request;
23+
const prBody = pr.body || '';
24+
25+
let missingItems = [];
26+
27+
// Helper function to extract content between section headers
28+
function extractSectionContent(content, sectionHeader) {
29+
const regex = new RegExp(`\\*\\*${sectionHeader}\\*\\*(.*?)(?=\\*\\*|$)`, 's');
30+
const match = content.match(regex);
31+
if (!match) return '';
32+
33+
// Remove HTML comments and trim whitespace
34+
return match[1].replace(/<!--[\s\S]*?-->/g, '').trim();
35+
}
36+
37+
// Helper function to check if content is meaningful
38+
function hasMeaningfulContent(content) {
39+
// Remove HTML comments, markdown symbols, and extra whitespace
40+
const cleanContent = content
41+
.replace(/<!--[\s\S]*?-->/g, '')
42+
.replace(/[#*\[\]()_]/g, '')
43+
.trim();
44+
return cleanContent.length >= 3; // Requiring at least 3 characters
45+
}
46+
47+
// Check for issue links
48+
const issueRegex = /(closes|related to)\s+#\d+/i;
49+
if (!issueRegex.test(prBody)) {
50+
missingItems.push('issue reference');
51+
}
52+
53+
// Check for kind of change
54+
const changeContent = extractSectionContent(prBody, 'What kind of change does this PR introduce\\?');
55+
if (!hasMeaningfulContent(changeContent)) {
56+
missingItems.push('kind of change description');
57+
}
58+
59+
// Check for unchecked items in checklist
60+
const checklistMatch = prBody.match(/# Checklist([\s\S]*?)(?=(?:#|$))/);
61+
if (checklistMatch && checklistMatch[1].includes('- [ ]')) {
62+
missingItems.push('completed checklist items');
63+
}
64+
65+
// Get current labels
66+
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
issue_number: context.issue.number
70+
});
71+
72+
const hasNeedsInfoLabel = currentLabels.some(label => label.name === 'needs-info');
73+
74+
if (missingItems.length > 0) {
75+
// If there are missing items, add comment and label
76+
const missingItemsList = missingItems.join(', ');
77+
const comment = `Hi @${pr.user.login}! Thanks a lot for your contribution!
78+
79+
I noticed that the following required information is missing or incomplete: ${missingItemsList}
80+
81+
Please update the PR description to include this information. You can find placeholders in the PR template for these items.
82+
83+
Thanks a lot!`;
84+
85+
await github.rest.issues.createComment({
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
issue_number: context.issue.number,
89+
body: comment
90+
});
91+
92+
// Add needs-info label if not already present
93+
if (!hasNeedsInfoLabel) {
94+
await github.rest.issues.addLabels({
95+
owner: context.repo.owner,
96+
repo: context.repo.repo,
97+
issue_number: context.issue.number,
98+
labels: ['needs-info']
99+
});
100+
}
101+
core.setFailed(`The following required information is missing or incomplete: ${missingItemsList}`);
102+
} else if (hasNeedsInfoLabel) {
103+
// If all requirements are met and the needs-info label exists, remove it
104+
await github.rest.issues.removeLabel({
105+
owner: context.repo.owner,
106+
repo: context.repo.repo,
107+
issue_number: context.issue.number,
108+
name: 'needs-info'
109+
});
110+
}

INSTALLATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This guide provides step-by-step instructions for installing the JSON Schema Web
2626
- [Formatting](#formatting)
2727
- [Linting](#linting)
2828
- [Husky for Git Hooks](#husky-for-git-hooks)
29-
6. [Run locally using Docker](#docker-deployment)
29+
6. [Run locally using Docker](#run-locally-using-docker)
3030
- [Prerequisites](#prerequisites)
3131
- [Steps](#steps)
3232

components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const DocLinkBlank = ({
6565
return (
6666
<Link
6767
href={uri}
68-
className={classnames('flex text-sm block py-1 pl-2', {
68+
className={classnames('flex text-sm py-1 pl-2', {
6969
'font-medium': !isActive,
7070
'text-primary text-bold border-l-2 border-l-primary font-semibold':
7171
isActive,

data/tooling-data.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,12 +3195,24 @@
31953195
license: 'MIT'
31963196
source: 'https://github.com/kenspirit/joi-to-json'
31973197
supportedDialects:
3198-
draft: ['4','5','6','7','2019-09','2020-12']
3198+
draft: ['4','6','7','2019-09','2020-12']
31993199
additional:
32003200
- name: 'OpenAPI 3.0'
32013201
source: 'https://spec.openapis.org/oas/v3.0.0'
32023202
- name: 'OpenAPI 3.1'
32033203
source: 'https://spec.openapis.org/oas/v3.1.0'
32043204

3205-
3205+
- name: 'json-schema'
3206+
description: 'A Ruby JSON Schema Validator ensures that JSON data adheres to a predefined structure, preventing errors and maintaining data integrity in applications.'
3207+
toolingTypes:
3208+
['validator']
3209+
languages: ['Ruby']
3210+
maintainers:
3211+
- name: 'Vox Pupuli'
3212+
platform: 'github'
3213+
license: 'MIT'
3214+
source: 'https://github.com/voxpupuli/json-schema/'
3215+
homepage: 'https://github.com/voxpupuli/json-schema/'
3216+
supportedDialects:
3217+
draft: ['1', '2', '3', '4', '6']
32063218

data/use-cases.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
{
2727
"title": "Data Serialization",
28-
"summary": "Compress JSON data for storage/transmission. For example: <a href='https://jsonbinpack.sourcemeta.com' style='text-decoration: underline; font-weight: bold;'>https://jsonbinpack.sourcemeta.com</a>"
28+
"summary": "Compress JSON data for storage/transmission. For example: <a href='https://jsonbinpack.sourcemeta.com' style='text-decoration: underline; font-weight: bold;'>JSON Bin Pack</a>"
2929
},
3030
{
3131
"title": "Fuzzing, enumeration, and generation",
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"title": "Automated Testing",
40-
"summary": "Good definitions of input/output that schemas provide enable contract and property based testing scenarios. For example: <a href='https://schemathesis.readthedocs.io/en/stable/' style='text-decoration: underline; font-weight: bold;'>https://schemathesis.readthedocs.io/en/stable/</a>"
40+
"summary": "Good definitions of input/output that schemas provide enable contract and property-based testing scenarios. For example: <a href='https://schemathesis.readthedocs.io/en/stable/' style='text-decoration: underline; font-weight: bold;'>Schemathesis</a>"
4141
},
4242
{
4343
"title": "Machine-readable profiles of Web resources",

pages/404.page.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React, { useEffect, useState } from 'react';
2+
import Link from 'next/link';
3+
import { useTheme } from 'next-themes';
4+
5+
const Logo = () => {
6+
const { resolvedTheme } = useTheme();
7+
const [imageSrc, setImageSrc] = useState('/img/logos/logo-blue.svg');
8+
9+
useEffect(() => {
10+
const src =
11+
resolvedTheme === 'dark'
12+
? '/img/logos/logo-white.svg'
13+
: '/img/logos/logo-blue.svg';
14+
setImageSrc(src);
15+
}, [resolvedTheme]);
16+
17+
return (
18+
<Link href='/' className=''>
19+
<img
20+
src={imageSrc}
21+
className='h-8 lg:h-12 top-12 absolute left-1/2 -translate-x-1/2'
22+
/>
23+
</Link>
24+
);
25+
};
26+
27+
export default function PageNotFound() {
28+
return (
29+
<div className='h-screen w-full flex flex-col gap-8 items-center justify-center font-semibold text-center'>
30+
<Logo />
31+
<h1 className='leading-header text-h1 hidden lg:block'>
32+
404 - Page Not Found!
33+
</h1>
34+
35+
<h1 className='lg:hidden text-h1 drop-shadow-[0px_0px_30px_rgba(148,163,184,0.9)]'>
36+
404
37+
</h1>
38+
<h1 className='lg:hidden text-h5mobile'>Page Not Found!</h1>
39+
40+
<div className='font-light text-sm lg:text-xl'>
41+
The page you were looking for doesn't exist.
42+
</div>
43+
<Link
44+
href='/'
45+
className='flex items-center justify-center rounded border-2 border-white dark:border-none hover:bg-blue-700 transition-all duration-300 ease-in-out text-white w-[194px] h-10 font-semibold bg-primary dark:shadow-2xl'
46+
>
47+
BACK TO HOME
48+
</Link>
49+
</div>
50+
);
51+
}

pages/blog/index.page.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,19 @@ export default function StaticMarkdownPage({
246246

247247
return (
248248
<section key={blogPost.slug}>
249-
<div className='sm:h-[498px] flex border rounded-lg shadow-sm hover:shadow-lg transition-all overflow-hidden dark:border-slate-500'>
249+
<div className='h-[510px] flex border rounded-lg shadow-sm hover:shadow-lg transition-all overflow-hidden dark:border-slate-500'>
250250
<Link
251251
href={`/blog/posts/${blogPost.slug}`}
252252
className='inline-flex flex-col flex-1 w-full'
253253
>
254-
<div
255-
className='bg-slate-50 h-[160px] w-full self-stretch mr-3 bg-cover bg-center'
256-
style={{ backgroundImage: `url(${frontmatter.cover})` }}
257-
/>
254+
<div className=' h-max-[200px] w-full object-cover'>
255+
<div
256+
className='bg-slate-50 h-[160px] w-full self-stretch mr-3 bg-cover bg-center'
257+
style={{
258+
backgroundImage: `url(${frontmatter.cover})`,
259+
}}
260+
/>
261+
</div>
258262
<div className=' p-4 flex flex-col flex-1 justify-between'>
259263
<div>
260264
<div>
@@ -277,7 +281,7 @@ export default function StaticMarkdownPage({
277281
{frontmatter.type || 'Unknown Type'}
278282
</div>
279283
</div>
280-
<div className='text-lg font-semibold'>
284+
<div className='text-lg h-[80px] font-semibold'>
281285
{frontmatter.title}
282286
</div>
283287

pages/blog/posts/[slug].page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default function StaticMarkdownPage({
112112
</div>
113113
<div className='flex-1 lg:w-3/4 w-full'>
114114
<div
115-
className='bg-slate-50 h-[500px] w-full rounded-lg bg-cover mb-10 bg-center'
115+
className='bg-slate-50 w-full rounded-lg bg-cover mb-10 bg-center min-h-[200px] sm:min-h-[300px] md:min-h-[400px] lg:min-h-[500px]'
116116
style={{ backgroundImage: `url(${frontmatter.cover})` }}
117117
/>
118118
<StyledMarkdown markdown={content} />

0 commit comments

Comments
 (0)