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
2 changes: 2 additions & 0 deletions apps/frontend/src/components/Logos/SanityLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const SanityLogo: React.FC<{ height?: number; className?: string }> = ({
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
className={className}
role="img"
aria-label="Sanity"
>
<g clipPath="url(#clip0_2001_20)">
<path
Expand Down
10 changes: 9 additions & 1 deletion apps/frontend/src/components/Logos/TanStackLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ export const TanStackLogo: React.FC<{ height?: number; width?: number; className
}) => {
// Use CSS currentColor so parent can control color, then fallback to theme token.
return (
<svg height={height} viewBox="0 0 3178 660" width={width} xmlns="http://www.w3.org/2000/svg" className={className}>
<svg
height={height}
viewBox="0 0 3178 660"
width={width}
xmlns="http://www.w3.org/2000/svg"
className={className}
role="img"
aria-label="TanStack"
>
<g fill="currentColor" transform="translate(.9778)">
<g transform="translate(740.0222 38)">
<path d="m101.695801 467h101.445312v-264.858398h90.917969v-80.390625h-283.28125v80.390625h90.917969z" />
Expand Down
7 changes: 7 additions & 0 deletions apps/frontend/src/loaders/__tests__/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ vi.mock('@/lib/previewMode', () => ({
detectPreviewMode: vi.fn(),
}));

vi.mock('@/sanity/serverFunctions.ts', () => ({
fetchDocument: vi.fn(async () => ({
data: null,
sourceMap: undefined,
})),
}));

describe('documentLoader', () => {
it('should load document data correctly', async () => {
const mockQueryClient = new QueryClient();
Expand Down
6 changes: 6 additions & 0 deletions apps/frontend/src/loaders/__tests__/globalLayout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ vi.mock('@/lib/previewMode', () => ({
detectPreviewMode: vi.fn(), // Mocking detectPreviewMode function
}));

vi.mock('@/sanity/serverFunctions.ts', () => ({
fetchSiteSettings: vi.fn(async () => ({
data: null,
})),
}));

// Test suite for the globalLayout function
describe('globalLayout', () => {
it('should load global layout data correctly', async () => {
Expand Down
11 changes: 11 additions & 0 deletions apps/frontend/src/loaders/__tests__/home.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ vi.mock('@/lib/previewMode', () => ({
detectPreviewMode: vi.fn(),
}));

vi.mock('@/sanity/serverFunctions.ts', () => ({
fetchHomeData: vi.fn(async () => ({
data: {
homeData: null,
postsData: [],
categoriesData: [],
},
sourceMap: undefined,
})),
}));

describe('homeLoader', () => {
it('should load home data correctly', async () => {
const mockQueryClient = new QueryClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ArchitectureSection({ badges }: ArchitectureSectionProps) {
>
Data Flow
</div>
<pre className={codeBlock} aria-label="Data flow example">
<pre className={codeBlock}>
<code>{`Client Request
│
├─ Route Loader (decides preview vs published)
Expand Down
5 changes: 1 addition & 4 deletions apps/frontend/src/pages/Post/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ export const PostPage = ({
)}
</div>
{ingress ? <p className={ingressStyle}>{ingress}</p> : null}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<script type="application/ld+json">{JSON.stringify(jsonLd)}</script>
</div>
{body && body.length > 0 ? (
<div className={portableTextContainer}>
Expand Down
6 changes: 4 additions & 2 deletions apps/frontend/src/styles/globals.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ if (import.meta.env.DEV) {
const modulePaths = Object.keys(blockCssModules);

if (modulePaths.length === 0) {
console.warn('⚠️ No block CSS modules found in ../components/PortableText/**/*.css.ts');
console.warn('No block CSS modules found in ../components/PortableText/**/*.css.ts');
} else {
modulePaths.forEach((p) => console.log('✔️ Loaded:', p.replace(/\.{2}\//g, 'src/')));
for (const p of modulePaths) {
console.log('Loaded:', p.replace(/\.{2}\//g, 'src/'));
}
}

console.groupEnd();
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"noUncheckedSideEffectImports": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@santan/shared": ["../../packages/shared/src/index.ts"],
"@santan/shared/types": ["../../packages/shared/src/types/index.ts"]
}
}
}
7 changes: 4 additions & 3 deletions apps/studio/src/scripts/extractZodLiterals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env node */
import fs from 'fs';
import fs from 'node:fs';

const inputFile = '../types/sanity.types.ts';
const outputFile = '../types/sanityTypeLiterals.ts';
Expand All @@ -8,9 +8,10 @@ const file = fs.readFileSync(inputFile, 'utf8');
const typeRegex = /_type:\s*'([^']+)'/g;
const types = new Set();

let match;
while ((match = typeRegex.exec(file)) !== null) {
let match = typeRegex.exec(file);
while (match !== null) {
types.add(match[1]);
match = typeRegex.exec(file);
}

const output = `export const sanityTypeLiterals = ${JSON.stringify(Array.from(types), null, 2)};\n`;
Expand Down
11 changes: 6 additions & 5 deletions apps/studio/src/scripts/extractZodLiterals.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as path from 'path';
import { fileURLToPath } from 'url';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -13,9 +13,10 @@ const file = fs.readFileSync(inputFile, 'utf8');
const typeRegex = /_type:\s*["']([^"']+)["']/g;

const types = new Set<string>();
let match;
while ((match = typeRegex.exec(file)) !== null) {
let match: RegExpExecArray | null = typeRegex.exec(file);
while (match !== null) {
types.add(match[1]);
match = typeRegex.exec(file);
}

const enumMembers = Array.from(types)
Expand Down
8 changes: 7 additions & 1 deletion apps/studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "Preserve",
"moduleResolution": "bundler",
"moduleDetection": "force",
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"baseUrl": ".",
"paths": {
"@santan/shared": ["../../packages/shared/src/index.ts"],
"@santan/shared/types": ["../../packages/shared/src/types/index.ts"]
}
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down
7 changes: 5 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
"a11y": {
"useButtonType": "warn",
"useSemanticElements": "warn",
Expand Down Expand Up @@ -56,7 +56,10 @@
"!**/.turbo",
"!**/.vercel",
"!**/build",
"!**/playwright-report",
"!**/test-results",
"!**/public",
"!**/*.svg",
"!**/*.min.js",
"!**/*.min.css",
"!**/package-lock.json",
Expand Down
2 changes: 1 addition & 1 deletion e2e/contact.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe("Contact page", () => {
await expect(page.getByText("First name is required")).toBeVisible();

await page.getByLabel("First Name").fill("Jane");
await expect(page.getByText("First name is required")).not.toBeVisible();
await expect(page.getByText("First name is required")).toBeHidden();
});

test("shows success message after a successful submission", async ({
Expand Down
Loading