Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cache/pages.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Type declaration for generated pages.json file
* This file is generated during the build process
*/

type PageData =
| string
| { articles: string[] }
| { 'case-studies': string[] }
| { downloads: string[] }
| { services: string[] }
| { 'social-shares': string[] }
| { stories: string[] }
| { tags: string[] }
Comment on lines +6 to +14

Copilot AI Nov 4, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PageData type definition is too rigid with hardcoded property names. This forces type definition updates whenever new page categories are added. Consider using a more flexible type: type PageData = string | Record<string, string[]> to allow any category name.

Suggested change
type PageData =
| string
| { articles: string[] }
| { 'case-studies': string[] }
| { downloads: string[] }
| { services: string[] }
| { 'social-shares': string[] }
| { stories: string[] }
| { tags: string[] }
type PageData = string | Record<string, string[]>

Copilot uses AI. Check for mistakes.

declare const pagesData: PageData[]
export default pagesData
53 changes: 53 additions & 0 deletions .cache/pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[
"about",
{
"articles": [
"getting-started-with-astro",
"typescript-best-practices",
"useful-vs-code-extensions",
"writing-library-code"
]
},
{
"case-studies": [
"division-15",
"ecommerce-modernization",
"english-first",
"enterprise-api-platform",
"labcorp",
"us-logistics"
]
},
"contact",
"cookies",
{
"downloads": [
"api-tool-consolidation-whitepaper",
"identity-security-for-dummies",
"lakehouse-analytics-guide",
"observability-benefits-guide",
"ransomware-recovery-kit"
]
},
"offline",
"privacy",
{
"services": ["create-custom-font-sets", "overview"]
},
{
"social-shares": ["template"]
},
{
"tags": [
"apiDesign",
"cms",
"code",
"crm",
"graphql",
"online-learning",
"react",
"services",
"typescript"
]
}
]
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ npm-debug.log*
# Optional eslint cache
.eslintcache

# Cache
.cache
# Cache - ignore all contents except type declarations and placeholder data
.cache/*
!.cache/*.d.ts
!.cache/pages.json

# Runtime data
pids
Expand Down
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ fi
# Run TypeScript check (fast feedback on type errors)
npm run check

# Run linters (fail fast on each)
npm run lint:style
npm run lint:code
npm run lint:json

# Run unit tests (fast feedback)
npm run test:unit

Expand Down
1 change: 1 addition & 0 deletions @types/remark-abbr.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsdoc/no-multi-asterisks */
/**
* Type definitions for remark-abbr
*
Expand Down
2 changes: 1 addition & 1 deletion @types/vitest-axe.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="vitest" />

/* eslint-disable @typescript-eslint/no-empty-object-type, no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
import type { AxeMatchers } from 'vitest-axe/matchers'

declare module 'vitest' {
Expand Down
14 changes: 7 additions & 7 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import {
import { callToActionValidator } from './src/integrations/CtaValidator/call-to-action-validator'
import { serializeSitemapItem, writePagesJson } from './src/lib/config/sitemap-serialize'

// Type guard for required environment variables (only in CI)
const IS_CI = process.env['CI'] === 'true'
// Type guard for required environment variables (only in Vercel)
const IS_VERCEL = process.env['VERCEL']
const SENTRY_AUTH_TOKEN = process.env['SENTRY_AUTH_TOKEN']
if (IS_CI && !SENTRY_AUTH_TOKEN) {
throw new Error('SENTRY_AUTH_TOKEN environment variable is required in CI but not set')
if (IS_VERCEL && !SENTRY_AUTH_TOKEN) {
throw new Error('SENTRY_AUTH_TOKEN environment variable is required in Vercel but not set')
}

export default defineConfig({
Expand All @@ -38,11 +38,11 @@ export default defineConfig({
callToActionValidator({
debug: true // Enable debug logging to see validation details
}),
// Only include Sentry integration in CI environments
...(IS_CI && SENTRY_AUTH_TOKEN ? [sentry({
// Only include Sentry integration in Vercel environments
...(IS_VERCEL ? [sentry({
project: "webstack-builders-corporate-website",
org: "webstack-builders",
authToken: SENTRY_AUTH_TOKEN,
authToken: SENTRY_AUTH_TOKEN!, // Non-null assertion safe due to check above
})] : []),
sitemap({
lastmod: new Date(),
Expand Down
Loading
Loading