From 2e66993bfee0e677d6858063f05afb2f129db3be Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:28:42 +0800 Subject: [PATCH 1/3] chore: speed up build and test tasks --- .github/workflows/ci.yml | 20 ++++++++++++++++++- packages/plugins/plugin-auth/vitest.config.ts | 10 ++++++++++ packages/types/package.json | 6 ++++-- pnpm-lock.yaml | 3 +++ turbo.json | 10 ++++++++-- 5 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 packages/plugins/plugin-auth/vitest.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcbf71c296..beb5bfe200 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,15 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store-v3- + - name: Setup Turbo cache + uses: actions/cache@v5 + with: + path: .turbo/cache + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}- + ${{ runner.os }}-turbo-${{ github.job }}- + - name: Install dependencies run: pnpm install --frozen-lockfile @@ -127,11 +136,20 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store-v3- + - name: Setup Turbo cache + uses: actions/cache@v5 + with: + path: .turbo/cache + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}- + ${{ runner.os }}-turbo-${{ github.job }}- + - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build packages (excluding docs) - run: pnpm --filter !@objectstack/docs -r build + run: pnpm build - name: Verify build outputs run: | diff --git a/packages/plugins/plugin-auth/vitest.config.ts b/packages/plugins/plugin-auth/vitest.config.ts new file mode 100644 index 0000000000..9032042826 --- /dev/null +++ b/packages/plugins/plugin-auth/vitest.config.ts @@ -0,0 +1,10 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'node', + testTimeout: 10_000, + }, +}); diff --git a/packages/types/package.json b/packages/types/package.json index fd6e9dfa95..225eca580e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -13,13 +13,15 @@ } }, "scripts": { - "build": "tsup --config ../../tsup.config.ts" + "build": "tsup --config ../../tsup.config.ts", + "test": "vitest run" }, "dependencies": { "@objectstack/spec": "workspace:*" }, "devDependencies": { - "typescript": "^6.0.3" + "typescript": "^6.0.3", + "vitest": "^4.1.8" }, "keywords": [ "objectstack", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ca1a8e5d4..9894a3d8fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2126,6 +2126,9 @@ importers: typescript: specifier: ^6.0.3 version: 6.0.3 + vitest: + specifier: ^4.1.8 + version: 4.1.8(@opentelemetry/api@1.9.1)(@types/node@25.9.1)(@vitest/coverage-v8@4.1.8)(happy-dom@20.9.0)(msw@2.14.6(@types/node@25.9.1)(typescript@6.0.3))(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) packages/vscode-objectstack: devDependencies: diff --git a/turbo.json b/turbo.json index 9218ab66cf..52a82221ba 100644 --- a/turbo.json +++ b/turbo.json @@ -1,14 +1,20 @@ { "$schema": "https://turbo.build/schema.json", + "globalDependencies": ["tsconfig.json", "tsup.config.ts"], "tasks": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"] }, "test": { + "dependsOn": ["^build"], + "outputs": [], + "inputs": ["$TURBO_DEFAULT$", "!dist/**", "!coverage/**", "!.turbo/**"] + }, + "@objectstack/metadata#test": { "dependsOn": ["build"], - "outputs": ["coverage/**"], - "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"] + "outputs": [], + "inputs": ["$TURBO_DEFAULT$", "!dist/**", "!coverage/**", "!.turbo/**"] }, "test:e2e": { "dependsOn": ["build"], From bdc5c664ed970205cac7b0e142847fcaa18beef8 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:50:00 +0800 Subject: [PATCH 2/3] fix: cache generated schema outputs --- turbo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 52a82221ba..624a57bcfc 100644 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,7 @@ "tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", ".next/**", "!.next/cache/**"] + "outputs": ["dist/**", "json-schema/**", ".next/**", "!.next/cache/**"] }, "test": { "dependsOn": ["^build"], From 5abc1c5367d2f5fa70aae275093cf4844f60068c Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Thu, 4 Jun 2026 23:07:20 +0800 Subject: [PATCH 3/3] Refocus docs site on documentation --- apps/docs/app/[lang]/page.tsx | 142 +------------------------------- apps/docs/app/layout.tsx | 2 +- apps/docs/app/page.tsx | 5 +- apps/docs/lib/layout.shared.tsx | 4 + 4 files changed, 10 insertions(+), 143 deletions(-) diff --git a/apps/docs/app/[lang]/page.tsx b/apps/docs/app/[lang]/page.tsx index 46ac5d4fd6..8ded42d862 100644 --- a/apps/docs/app/[lang]/page.tsx +++ b/apps/docs/app/[lang]/page.tsx @@ -1,11 +1,5 @@ -import { Database, Monitor, HardDrive, ShieldCheck, Puzzle, Code2, Rocket, Users, Blocks, LucideIcon } from 'lucide-react'; -import { HomeLayout } from 'fumadocs-ui/layouts/home'; -import { baseOptions } from '@/lib/layout.shared'; -import { getHomepageTranslations } from '@/lib/homepage-i18n'; -import { HeroSection } from '@/components/hero-section'; -import { CodePreview } from '@/components/code-preview'; -import { FeatureCard } from '@/components/feature-card'; -import { PersonaCard } from '@/components/persona-card'; +import { redirect } from 'next/navigation'; +import { i18n } from '@/lib/i18n'; export default async function HomePage({ params, @@ -13,136 +7,6 @@ export default async function HomePage({ params: Promise<{ lang: string }>; }) { const { lang } = await params; - const t = getHomepageTranslations(lang); - const features = [ - { - key: 'restApi', - icon: Rocket, - href: '/docs/getting-started/quick-start', - title: t.features.restApi.title, - description: t.features.restApi.description, - }, - { - key: 'studio', - icon: Monitor, - href: '/docs/getting-started/cli', - title: t.features.studio.title, - description: t.features.studio.description, - }, - { - key: 'multiDb', - icon: HardDrive, - href: '/docs/guides/driver-configuration', - title: t.features.multiDb.title, - description: t.features.multiDb.description, - }, - { - key: 'typeSafety', - icon: ShieldCheck, - href: '/docs/references/data', - title: t.features.typeSafety.title, - description: t.features.typeSafety.description, - }, - { - key: 'namespace', - icon: Blocks, - href: '/docs/concepts/core', - title: t.features.namespace.title, - description: t.features.namespace.description, - }, - { - key: 'plugins', - icon: Puzzle, - href: '/docs/getting-started/examples', - title: t.features.plugins.title, - description: t.features.plugins.description, - }, - ]; - - const personas = [ - { - key: 'fullStack', - icon: Code2, - color: 'text-blue-500', - href: '/docs/getting-started/quick-start', - title: t.personas.fullStack.title, - description: t.personas.fullStack.description, - action: t.personas.fullStack.action, - }, - { - key: 'platformTeam', - icon: Users, - color: 'text-purple-500', - href: '/docs/concepts', - title: t.personas.platformTeam.title, - description: t.personas.platformTeam.description, - action: t.personas.platformTeam.action, - }, - { - key: 'lowCode', - icon: Blocks, - color: 'text-green-500', - href: '/docs/getting-started/examples', - title: t.personas.lowCode.title, - description: t.personas.lowCode.description, - action: t.personas.lowCode.action, - }, - ]; - - return ( - -
- - {/* Hero Section */} - - - {/* Code Preview */} - - - {/* Grid Pattern Background */} -
- - {/* Feature Grid */} -
- {features.map((feature) => ( - } - title={feature.title} - href={feature.href} - description={feature.description} - /> - ))} -
- - {/* Personas Section */} -
-

- {t.personas.heading} -

-
- {personas.map((persona) => ( - } - title={persona.title} - description={persona.description} - href={persona.href} - action={persona.action} - /> - ))} -
-
- -
-
- ); + redirect(lang === i18n.defaultLanguage ? '/docs' : `/${lang}/docs`); } - diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx index a1dd50f87f..b215131960 100644 --- a/apps/docs/app/layout.tsx +++ b/apps/docs/app/layout.tsx @@ -7,7 +7,7 @@ export const metadata: Metadata = { template: '%s | ObjectStack Protocol', default: 'ObjectStack Protocol', }, - description: 'The Metadata-Driven Documentation Engine for the Low-Code Era.', + description: 'Documentation for the ObjectStack Protocol and runtime.', icons: { icon: 'https://objectstack.ai/logo.png', }, diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx index a00faffed1..7710bcce69 100644 --- a/apps/docs/app/page.tsx +++ b/apps/docs/app/page.tsx @@ -1,7 +1,6 @@ import { redirect } from 'next/navigation'; -import { i18n } from '@/lib/i18n'; export default function RootPage() { - // Middleware should handle this, but as a fallback - redirect(`/${i18n.defaultLanguage}`); + // Middleware should handle locale routing, but keep the root focused on docs. + redirect('/docs'); } diff --git a/apps/docs/lib/layout.shared.tsx b/apps/docs/lib/layout.shared.tsx index 850191a7ae..9ac9830889 100644 --- a/apps/docs/lib/layout.shared.tsx +++ b/apps/docs/lib/layout.shared.tsx @@ -29,6 +29,10 @@ export function baseOptions(): BaseLayoutProps { url: '/docs/', active: 'nested-url', }, + { + text: 'Website', + url: 'https://www.objectstack.ai', + }, ], githubUrl: `https://github.com/${gitConfig.user}/${gitConfig.repo}`, };