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: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This repository contains the Hoverkraft-branded Docusaurus theme and its documen
npm install # Install workspace dependencies
npm run build --workspaces # Build the theme and docs packages
npm run lint --workspaces # Run linting across all workspaces
npm run test --workspaces # Execute unit tests (ts-jest)
npm run test --workspaces # Execute unit tests (Vitest)
npm run start --workspace=@hoverkraft/hoverkraft-theme-docs # Launch docs for local QA
```

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ define run_linter
DEFAULT_WORKSPACE="$(CURDIR)"; \
LINTER_IMAGE="linter:latest"; \
VOLUME="$$DEFAULT_WORKSPACE:$$DEFAULT_WORKSPACE"; \
docker build --platform linux/amd64 --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag $$LINTER_IMAGE .; \
docker build --platform=linux/amd64 --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag $$LINTER_IMAGE .; \
docker run \
--platform linux/amd64 \
-v "$VOLUME" \
--platform=linux/amd64 \
-v $$VOLUME \
--rm \
-e DEFAULT_WORKSPACE="$$DEFAULT_WORKSPACE" \
-e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \
Expand Down
1,557 changes: 919 additions & 638 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"scripts": {
"build": "npm run build --workspace=@hoverkraft/docusaurus-theme && npm run build --workspace=@hoverkraft/hoverkraft-theme-docs",
"start": "npm run start --workspace=@hoverkraft/hoverkraft-theme-docs",
"typecheck": "npm run typecheck --workspaces --if-present",
"lint": "npm run lint --workspaces --if-present",
"lint:fix": "npm run lint:fix --workspaces --if-present",
"lint:ci": "npm run lint:ci --workspaces --if-present",
Expand All @@ -26,7 +27,7 @@
"prepare": "ts-dev-tools install"
},
"devDependencies": {
"@ts-dev-tools/react": "^1.10.4"
"@ts-dev-tools/react": "^1.11.1"
},
"commitlint": {
"extends": [
Expand Down
36 changes: 5 additions & 31 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start --host 0.0.0.0",
"build": "docusaurus build",
"build": "npm run typecheck && docusaurus build",
"typecheck": "tsc --noEmit",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down Expand Up @@ -40,33 +41,6 @@
"last 5 safari version"
]
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "jsdom",
"extensionsToTreatAsEsm": [
".ts",
".tsx"
],
"transform": {
"^.+\\.(t|j)sx?$": [
"ts-jest",
{
"useESM": true,
"tsconfig": "<rootDir>/tsconfig.jest.json"
}
]
},
"transformIgnorePatterns": [
"node_modules/(?!(prism-react-renderer)/)"
],
"testMatch": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test)?(.*).+(ts|tsx|js)"
],
"collectCoverageFrom": [
"**/src/**/*.[jt]s?(x)"
]
},
"devDependencies": {
"@docusaurus/core": "^3.10.2",
"@docusaurus/preset-classic": "^3.10.2",
Expand All @@ -76,12 +50,12 @@
"@docusaurus/types": "^3.10.1",
"@hoverkraft/docusaurus-theme": "*",
"@mdx-js/react": "^3.1.1",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
"clsx": "^2.1.1",
"prism-react-renderer": "^2.4.1",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"typescript": "^6.0.3"
"typescript": "^7.0.2"
}
}
8 changes: 6 additions & 2 deletions packages/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"compilerOptions": {
"allowJs": true,
"esModuleInterop": true,
"jsx": "preserve",
"target": "ES2022",
"lib": ["ES2022", "DOM"],
"moduleResolution": "bundler",
"module": "esnext",
"moduleDetection": "force",
"noEmit": true,
"strict": true,
"erasableSyntaxOnly": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"verbatimModuleSyntax": true,
"paths": {
"@site/*": ["./*"]
},
Expand Down
23 changes: 4 additions & 19 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prebuild": "rimraf lib",
"build": "tsc && node scripts/copy-static-assets.js",
"start": "tsc --watch",
"typecheck": "tsc --noEmit",
"format": "biome format --write .",
"check": "biome check --error-on-warnings --write .",
"lint": "biome lint --error-on-warnings .",
Expand Down Expand Up @@ -63,31 +64,15 @@
"@docusaurus/types": "^3.10.1",
"@docusaurus/utils": "^3.10.1",
"@docusaurus/utils-validation": "^3.10.1",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"identity-obj-proxy": "^3.0.0",
"rimraf": "^6.1.3",
"typescript": "^6.0.3"
"typescript": "^7.0.2"
},
"engines": {
"node": ">=18.0.0"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "jsdom",
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
"^@docusaurus/Link$": "<rootDir>/src/test-utils/docusaurusLinkMock.tsx",
"^@docusaurus/useBaseUrl$": "<rootDir>/src/test-utils/docusaurusUseBaseUrlMock.ts"
},
"testMatch": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test)?(.*).+(ts|tsx|js)"
],
"collectCoverageFrom": [
"**/src/**/*.[jt]s?(x)"
]
}
}
4 changes: 2 additions & 2 deletions packages/theme/src/test-utils/docusaurusLinkMock.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { PropsWithChildren } from "react";
import type { PropsWithChildren, ReactElement } from "react";

export default function DocusaurusLinkMock(
props: PropsWithChildren<
{ to?: string; href?: string } & Record<string, unknown>
>,
) {
): ReactElement {
const { to, href, children, ...rest } = props;
return (
<a href={(href ?? to ?? "#") as string} {...rest}>
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/theme/hoverscape/HoverkraftButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from "@docusaurus/Link";
import clsx from "clsx";
import type { ReactNode } from "react";
import type { ReactElement, ReactNode } from "react";
import type {
HoverkraftActionSize,
HoverkraftActionVariant,
Expand Down Expand Up @@ -67,7 +67,7 @@ export function HoverkraftButton({
target,
rel,
children,
}: HoverkraftButtonProps) {
}: HoverkraftButtonProps): ReactElement {
const content = children ?? label;
const buttonClassName = clsx(
styles.button,
Expand Down
6 changes: 3 additions & 3 deletions packages/theme/src/theme/hoverscape/HoverkraftFeatureList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import clsx from "clsx";
import type { CSSProperties } from "react";
import type { CSSProperties, ReactElement } from "react";
import type {
HoverkraftFeatureItem,
HoverkraftFeatureListProps,
Expand All @@ -21,7 +21,7 @@ function FeatureCard({
eyebrow,
title,
description,
}: HoverkraftFeatureItem) {
}: HoverkraftFeatureItem): ReactElement {
return (
<article id={id} className={styles.featureCard}>
{eyebrow ? <p className={styles.featureEyebrow}>{eyebrow}</p> : null}
Expand All @@ -40,7 +40,7 @@ export function HoverkraftFeatureList({
minColumnWidth = 260,
className,
style,
}: HoverkraftFeatureListProps) {
}: HoverkraftFeatureListProps): ReactElement {
const gridStyle: GridStyle = {
...style,
"--hk-feature-min-width": `${minColumnWidth}px`,
Expand Down
6 changes: 3 additions & 3 deletions packages/theme/src/theme/hoverscape/HoverkraftHero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useBaseUrl from "@docusaurus/useBaseUrl";
import clsx from "clsx";
import type { ReactNode } from "react";
import type { ReactElement, ReactNode } from "react";
import type { HoverkraftAction } from "../components.types";
import { HoverkraftBrandHighlight } from "./HoverkraftBrandHighlight";
import { HoverkraftButton } from "./HoverkraftButton";
Expand All @@ -20,7 +20,7 @@ export interface HoverkraftHeroProps {
className?: string;
}

function renderAction(action: HoverkraftAction, index: number) {
function renderAction(action: HoverkraftAction, index: number): ReactElement {
const { id, size, ...rest } = action;

return (
Expand All @@ -46,7 +46,7 @@ export function HoverkraftHero({
tone = "midnight",
id,
className,
}: HoverkraftHeroProps) {
}: HoverkraftHeroProps): ReactElement {
const hasSupportingVisual =
typeof supportingVisual === "string" && supportingVisual.trim().length > 0;
const supportingVisualUrl = useBaseUrl(
Expand Down
8 changes: 4 additions & 4 deletions packages/theme/src/theme/hoverscape/HoverkraftProjectCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from "@docusaurus/Link";
import clsx from "clsx";
import type { ReactNode } from "react";
import type { ReactElement, ReactNode } from "react";
import type {
HoverkraftAction,
HoverkraftProjectCardProps,
Expand All @@ -19,7 +19,7 @@ function renderTitle(
HoverkraftProjectCardProps,
"titleHref" | "titleTo" | "titleTarget" | "titleRel"
>,
) {
): ReactElement {
if (titleHref) {
return (
<a
Expand Down Expand Up @@ -47,7 +47,7 @@ function renderAction(
action: HoverkraftAction,
className: string,
index: number,
) {
): ReactElement {
const { id, size, variant, ...rest } = action;

return (
Expand Down Expand Up @@ -76,7 +76,7 @@ export function HoverkraftProjectCard({
actions,
accent = "primary",
className,
}: HoverkraftProjectCardProps) {
}: HoverkraftProjectCardProps): ReactElement {
const accentClass = accent === "neutral" ? styles.neutral : styles.primary;

return (
Expand Down
16 changes: 8 additions & 8 deletions packages/theme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"target": "es2019",
"lib": ["dom", "dom.iterable", "es6"],
"allowJs": true,
"lib": ["dom", "dom.iterable", "es2019"],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"moduleDetection": "force",
"noUncheckedSideEffectImports": true,
"erasableSyntaxOnly": true,
"isolatedModules": true,
"noEmit": false,
"isolatedDeclarations": true,
"noEmitOnError": true,
"declaration": true,
"rootDir": "./src",
"outDir": "./lib",
"jsx": "react-jsx"
"jsx": "react-jsx",
"types": []
},
"include": ["src"],
"exclude": [
Expand Down
File renamed without changes.
Loading