feat: migrate questions

feat/collection
Arik Chakma 2 months ago
parent cd453e5ad0
commit ab759671d8
  1. 1486
      .astro/astro/content.d.ts
  2. 1
      .gitignore
  3. 12
      src/components/Guide/GuideContent.astro
  4. 12
      src/components/GuideListItem.astro
  5. 2
      src/content/question-group.ts
  6. 0
      src/content/question-groups/backend.md
  7. 0
      src/content/question-groups/devops.md
  8. 0
      src/content/question-groups/frontend.md
  9. 0
      src/content/question-groups/javascript.md
  10. 0
      src/content/question-groups/nodejs.md
  11. 0
      src/content/question-groups/react.md
  12. 0
      src/data/question-groups/backend/content/anomaly-detection.md
  13. 0
      src/data/question-groups/backend/content/api-dependencies.md
  14. 0
      src/data/question-groups/backend/content/api-endpoint.md
  15. 0
      src/data/question-groups/backend/content/api-tests.md
  16. 0
      src/data/question-groups/backend/content/api-versioning.md
  17. 0
      src/data/question-groups/backend/content/batch-processing.md
  18. 0
      src/data/question-groups/backend/content/benefits-drawbacks-microservices.md
  19. 0
      src/data/question-groups/backend/content/bg-tasks.md
  20. 0
      src/data/question-groups/backend/content/blue-green-deployment.md
  21. 0
      src/data/question-groups/backend/content/cache-eviction.md
  22. 0
      src/data/question-groups/backend/content/cap-theorem.md
  23. 0
      src/data/question-groups/backend/content/ci-cd.md
  24. 0
      src/data/question-groups/backend/content/containerization.md
  25. 0
      src/data/question-groups/backend/content/correlation-ids.md
  26. 0
      src/data/question-groups/backend/content/data-encryption.md
  27. 0
      src/data/question-groups/backend/content/db-connections.md
  28. 0
      src/data/question-groups/backend/content/deadlock-db-transaction.md
  29. 0
      src/data/question-groups/backend/content/debugging-backend.md
  30. 0
      src/data/question-groups/backend/content/decompose-microservices.md
  31. 0
      src/data/question-groups/backend/content/distributed-caching.md
  32. 0
      src/data/question-groups/backend/content/eventual-consistency.md
  33. 0
      src/data/question-groups/backend/content/fault-tolerance.md
  34. 0
      src/data/question-groups/backend/content/file-uploads.md
  35. 0
      src/data/question-groups/backend/content/fulltext-search.md
  36. 0
      src/data/question-groups/backend/content/gdpr-compliance.md
  37. 0
      src/data/question-groups/backend/content/high-available-storage.md
  38. 0
      src/data/question-groups/backend/content/http-request-response-cycle.md
  39. 0
      src/data/question-groups/backend/content/idempotency.md
  40. 0
      src/data/question-groups/backend/content/instrument-monitor.md
  41. 0
      src/data/question-groups/backend/content/iot-streams.md
  42. 0
      src/data/question-groups/backend/content/load-balanced-session.md
  43. 0
      src/data/question-groups/backend/content/load-testing-api.md
  44. 0
      src/data/question-groups/backend/content/long-running.md
  45. 0
      src/data/question-groups/backend/content/maintainable-code.md
  46. 0
      src/data/question-groups/backend/content/message-queue.md
  47. 0
      src/data/question-groups/backend/content/optimistic-vs-pessimistic.md
  48. 0
      src/data/question-groups/backend/content/protect-sql-injection.md
  49. 0
      src/data/question-groups/backend/content/rate-limiting.md
  50. 0
      src/data/question-groups/backend/content/realtime-data-sync.md
  51. 0
      src/data/question-groups/backend/content/rest-core-principles.md
  52. 0
      src/data/question-groups/backend/content/reverse-proxy.md
  53. 0
      src/data/question-groups/backend/content/scale-backend.md
  54. 0
      src/data/question-groups/backend/content/schema-migrations.md
  55. 0
      src/data/question-groups/backend/content/secure-api.md
  56. 0
      src/data/question-groups/backend/content/secure-interservice.md
  57. 0
      src/data/question-groups/backend/content/session-management.md
  58. 0
      src/data/question-groups/backend/content/sql-vs-nosql.md
  59. 0
      src/data/question-groups/backend/content/sso.md
  60. 0
      src/data/question-groups/backend/content/statelessness-http.md
  61. 0
      src/data/question-groups/backend/content/webhooks.md
  62. 0
      src/data/question-groups/devops/content/ansible-benefits.md
  63. 0
      src/data/question-groups/devops/content/auto-scaling.md
  64. 0
      src/data/question-groups/devops/content/blue-green-deployment.md
  65. 0
      src/data/question-groups/devops/content/build-pipelines.md
  66. 0
      src/data/question-groups/devops/content/canary-release.md
  67. 0
      src/data/question-groups/devops/content/cicd-setup.md
  68. 0
      src/data/question-groups/devops/content/cluster-health.md
  69. 0
      src/data/question-groups/devops/content/common-iac-tools.md
  70. 0
      src/data/question-groups/devops/content/container-consistency.md
  71. 0
      src/data/question-groups/devops/content/container-vs-vm.md
  72. 0
      src/data/question-groups/devops/content/continuous-monitoring.md
  73. 0
      src/data/question-groups/devops/content/data-migration.md
  74. 0
      src/data/question-groups/devops/content/devsecops.md
  75. 0
      src/data/question-groups/devops/content/docker-compose.md
  76. 0
      src/data/question-groups/devops/content/explain-ci-vs-cd.md
  77. 0
      src/data/question-groups/devops/content/health-monitor.md
  78. 0
      src/data/question-groups/devops/content/high-availability.md
  79. 0
      src/data/question-groups/devops/content/iac-concept.md
  80. 0
      src/data/question-groups/devops/content/implement-logging.md
  81. 0
      src/data/question-groups/devops/content/kubernetes-components.md
  82. 0
      src/data/question-groups/devops/content/kubernetes-operators.md
  83. 0
      src/data/question-groups/devops/content/load-balancer.md
  84. 0
      src/data/question-groups/devops/content/microservice-challenges.md
  85. 0
      src/data/question-groups/devops/content/microservice-vs-monolithic.md
  86. 0
      src/data/question-groups/devops/content/migrate-environment.md
  87. 0
      src/data/question-groups/devops/content/multi-cloud-kubernetes.md
  88. 0
      src/data/question-groups/devops/content/multi-cloud.md
  89. 0
      src/data/question-groups/devops/content/network-configuration.md
  90. 0
      src/data/question-groups/devops/content/optimize-cicd.md
  91. 0
      src/data/question-groups/devops/content/orchestration.md
  92. 0
      src/data/question-groups/devops/content/popular-cicd-tools.md
  93. 0
      src/data/question-groups/devops/content/purpose-of-cm.md
  94. 0
      src/data/question-groups/devops/content/reverse-proxy.md
  95. 0
      src/data/question-groups/devops/content/role-of-devops.md
  96. 0
      src/data/question-groups/devops/content/scaling-differences.md
  97. 0
      src/data/question-groups/devops/content/secret-management.md
  98. 0
      src/data/question-groups/devops/content/serverless-computing.md
  99. 0
      src/data/question-groups/devops/content/stateful-applications.md
  100. 0
      src/data/question-groups/devops/content/what-is-devops.md
  101. Some files were not shown because too many files have changed in this diff Show More

File diff suppressed because it is too large Load Diff

1
.gitignore vendored

@ -33,3 +33,4 @@ tests-examples
!/editor/readonly-editor.tsx !/editor/readonly-editor.tsx
!/editor/renderer/renderer.ts !/editor/renderer/renderer.ts
!/editor/renderer/index.tsx !/editor/renderer/index.tsx
/.astro

@ -10,11 +10,11 @@ interface Props {
const { guide } = Astro.props; const { guide } = Astro.props;
const allHeadings = guide.getHeadings(); const { headings: allHeadings, Content } = await guide.render();
const tableOfContent = getGuideTableOfContent(allHeadings); const tableOfContent = getGuideTableOfContent(allHeadings);
const showTableOfContent = tableOfContent.length > 0; const showTableOfContent = tableOfContent.length > 0;
const { frontmatter: guideFrontmatter, author } = guide; const { data: guideFrontmatter, author } = guide;
--- ---
<article class='lg:grid lg:max-w-full lg:grid-cols-[1fr_minmax(0,700px)_1fr]'> <article class='lg:grid lg:max-w-full lg:grid-cols-[1fr_minmax(0,700px)_1fr]'>
@ -44,11 +44,11 @@ const { frontmatter: guideFrontmatter, author } = guide;
class='inline-flex items-center font-medium underline-offset-2 hover:text-gray-600 hover:underline' class='inline-flex items-center font-medium underline-offset-2 hover:text-gray-600 hover:underline'
> >
<img <img
alt={author.frontmatter.name} alt={author.data.name}
src={author.frontmatter.imageUrl} src={author.data.imageUrl}
class='mb-0 mr-2 inline h-5 w-5 rounded-full' class='mb-0 mr-2 inline h-5 w-5 rounded-full'
/> />
{author.frontmatter.name} {author.data.name}
</a> </a>
<span class='mx-2 hidden sm:inline'>&middot;</span> <span class='mx-2 hidden sm:inline'>&middot;</span>
<a <a
@ -59,7 +59,7 @@ const { frontmatter: guideFrontmatter, author } = guide;
Improve this Guide Improve this Guide
</a> </a>
</p> </p>
<guide.Content /> <Content />
</MarkdownFile> </MarkdownFile>
</div> </div>
</article> </article>

@ -1,7 +1,7 @@
--- ---
import type { GuideFileType, GuideFrontmatter } from '../lib/guide'; import type { GuideFileType } from '../lib/guide';
import { replaceVariables } from '../lib/markdown'; import { replaceVariables } from '../lib/markdown';
import { QuestionGroupType } from '../lib/question-group'; import type { QuestionGroupType } from '../lib/question-group';
export interface Props { export interface Props {
guide: GuideFileType | QuestionGroupType; guide: GuideFileType | QuestionGroupType;
@ -14,7 +14,7 @@ function isQuestionGroupType(
} }
const { guide } = Astro.props; const { guide } = Astro.props;
const { data, id } = guide; const { data: frontmatter, slug: id } = guide;
let pageUrl = ''; let pageUrl = '';
let guideType = ''; let guideType = '';
@ -23,9 +23,9 @@ if (isQuestionGroupType(guide)) {
pageUrl = `/questions/${id}`; pageUrl = `/questions/${id}`;
guideType = 'Questions'; guideType = 'Questions';
} else { } else {
const excludedBySlug = (frontmatter as GuideFrontmatter).excludedBySlug; const excludedBySlug = (frontmatter as GuideFileType['data']).excludedBySlug;
pageUrl = excludedBySlug ? excludedBySlug : `/guides/${id}`; pageUrl = excludedBySlug ? excludedBySlug : `/guides/${id}`;
guideType = (frontmatter as GuideFrontmatter).type; guideType = (frontmatter as GuideFileType['data']).type;
} }
--- ---
@ -46,7 +46,7 @@ if (isQuestionGroupType(guide)) {
New New
<span class='hidden sm:inline'> <span class='hidden sm:inline'>
&middot; &middot;
{new Date(frontmatter.date).toLocaleString('default', { {new Date(frontmatter.date!).toLocaleString('default', {
month: 'long', month: 'long',
})} })}
</span> </span>

@ -10,7 +10,7 @@ export const questionGroupCollection = defineCollection({
description: z.string(), description: z.string(),
isNew: z.boolean(), isNew: z.boolean(),
authorId: z.string().optional(), authorId: z.string().optional(),
date: z.string().optional(), date: z.date().optional(),
seo: z.object({ seo: z.object({
title: z.string(), title: z.string(),
description: z.string(), description: z.string(),

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save