-
Notifications
You must be signed in to change notification settings - Fork 613
fix(glossary): various workflow fixes & latest content #2664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chronark
merged 24 commits into
unkeyed:main
from
p6l-richard:richard/fix-glossary-setup
Nov 18, 2024
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ee02e5d
fix: move statelessness.mdx to glossary
p6l-richard 9368fbd
fix: frontmatter indentation & missing fields
p6l-richard 61b75d0
feat: add `categories` & `takeaways` workflows
p6l-richard fe61dab
feat: add `categories` & `takeaways` from frontmatter
p6l-richard 94a6661
takeaways is required
p6l-richard fac5c6e
feat: add seo optimized h1
p6l-richard 46b07c7
feat(glossary): Add API Security.mdx to glossary
p6l-richard b7498c6
fixing duplicate db row creation
p6l-richard 6ed0aff
Merge branch 'richard/add-api-security' into richard/fix-glossary-setup
p6l-richard 4674ff9
refactor(glossary): align takeaways schema across apps
p6l-richard cec8beb
updates to content workflow
p6l-richard d2ae81b
content
p6l-richard 91da2d5
content
p6l-richard c5d0780
sitemap
p6l-richard c3b9fe9
updated content
p6l-richard 8f7bacf
`pnpm fmt`
p6l-richard a2d0443
update trigger
p6l-richard 7f11448
- fix workflow to create new PRs if a previous one was closed
p6l-richard 4fc522f
update content for SSO
p6l-richard e0899a4
no diff?
p6l-richard 56bfd23
final updated content
p6l-richard 0fe6dcf
Merge remote-tracking branch 'upstream/main' into richard/fix-glossar…
p6l-richard 817ac4e
[autofix.ci] apply automated fixes
autofix-ci[bot] f7896e3
chore: sync lock file
chronark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apps/billing/src/lib/db-marketing/schemas/takeaways-schema.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { z } from "zod"; | ||
|
|
||
| /** | ||
| * @description Schema for glossary entry takeaways | ||
| * @sourceOfTruth This is the source of truth for the takeaways schema as it's used for database storage | ||
| * @todo Extract this schema into a shared package to avoid duplication with apps/www | ||
| */ | ||
| export const takeawaysSchema = z.object({ | ||
| tldr: z.string(), | ||
| definitionAndStructure: z.array( | ||
| z.object({ | ||
| key: z.string(), | ||
| value: z.string(), | ||
| }), | ||
| ), | ||
| historicalContext: z.array( | ||
| z.object({ | ||
| key: z.string(), | ||
| value: z.string(), | ||
| }), | ||
| ), | ||
| usageInAPIs: z.object({ | ||
| tags: z.array(z.string()), | ||
| description: z.string(), | ||
| }), | ||
| bestPractices: z.array(z.string()), | ||
| recommendedReading: z.array( | ||
| z.object({ | ||
| title: z.string(), | ||
| url: z.string(), | ||
| }), | ||
| ), | ||
| didYouKnow: z.string(), | ||
| }); | ||
|
|
||
| export type Takeaways = z.infer<typeof takeawaysSchema>; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance schema validation for better data integrity.
The schema could benefit from additional validation rules to ensure data quality and prevent potential issues:
Consider applying these improvements:
export const takeawaysSchema = z.object({ - tldr: z.string(), + tldr: z.string().min(1).max(500), definitionAndStructure: z.array( z.object({ - key: z.string(), - value: z.string(), + key: z.string().min(1).max(100), + value: z.string().min(1).max(1000), }), - ), + ).min(1).max(10), // ... similar changes for historicalContext usageInAPIs: z.object({ - tags: z.array(z.string()), + tags: z.array(z.string().min(1).max(50)).min(1).max(10), - description: z.string(), + description: z.string().min(1).max(1000), }), - bestPractices: z.array(z.string()), + bestPractices: z.array(z.string().min(1).max(500)).min(1).max(10), recommendedReading: z.array( z.object({ - title: z.string(), - url: z.string(), + title: z.string().min(1).max(200), + url: z.string().url(), }), - ), + ).max(5), - didYouKnow: z.string(), + didYouKnow: z.string().min(1).max(1000).optional(), });These changes:
didYouKnowoptional as it might not always be necessary📝 Committable suggestion