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 .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0"
"packages/seox": "1.2.0"
}
2 changes: 1 addition & 1 deletion .github/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"pull-request-title-pattern": "chore: release v${version}",
"group-pull-request-title-pattern": "chore: release v${version}",
"packages": {
".": {
"packages/seox": {
"changelog-sections": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,45 @@ permissions:

jobs:
ci:
name: "CI Checks"
name: "CI Checks"
runs-on: ubuntu-latest

steps:
- name: "📥 Checkout Code"
- name: "Checkout Code"
uses: actions/checkout@v4

- name: "🔧 Setup Bun Runtime"
- name: "Setup Bun Runtime"
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: "📦 Install Dependencies"
- name: "Install Dependencies"
run: bun install --frozen-lockfile

- name: "🔍 Type Check"
- name: "Type Check (seox)"
run: bun run typecheck

- name: "💅 Format Check"
- name: "Format Check"
run: bun run format:check

- name: "🧪 Run Tests"
- name: "Run Tests (seox)"
run: bun run test

- name: "🏗️ Build Project"
- name: "Build Package (seox)"
run: bun run build

- name: "💾 Cache Build Artifacts"
uses: actions/cache/save@v3
- name: "Build Landing"
run: bun run --cwd apps/landing build

- name: "Build Docs"
run: bun run --cwd apps/docs build

- name: "Cache Build Artifacts"
uses: actions/cache/save@v4
with:
path: |
dist/
packages/seox/dist/
apps/landing/.next/
apps/docs/.next/
node_modules/
key: build-${{ github.sha }}-${{ hashFiles('**/bun.lock') }}
key: build-${{ github.sha }}-${{ hashFiles('**/bun.lock') }}
41 changes: 21 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,69 +13,70 @@ permissions:

jobs:
create-release:
name: "🚀 Create Release"
name: "Create Release"
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
release_created: ${{ steps.release.outputs.release_created }}
version: ${{ steps.release.outputs.version }}
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs['packages/seox--release_created'] }}
version: ${{ steps.release.outputs['packages/seox--version'] }}
tag_name: ${{ steps.release.outputs['packages/seox--tag_name'] }}
steps:
- name: "📥 Checkout Code"
- name: "Checkout Code"
uses: actions/checkout@v4

- name: "📋 Run Release Please"
- name: "Run Release Please"
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
token: ${{ secrets.GITHUB_TOKEN }}

publish:
name: "📦 Build & Publish"
name: "Build & Publish"
runs-on: ubuntu-latest
needs: create-release
if: ${{ needs.create-release.outputs.release_created == 'true' }}
steps:
- name: "📥 Checkout Released Code"
- name: "Checkout Released Code"
uses: actions/checkout@v4
with:
ref: ${{ needs.create-release.outputs.tag_name }}

- name: "🔧 Setup Bun Runtime"
- name: "Setup Bun Runtime"
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: "🔧 Setup Node.js for npm publish"
- name: "Setup Node.js for npm publish"
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: "📦 Install Dependencies"
- name: "Install Dependencies"
run: bun install --frozen-lockfile

- name: "🏗️ Build Project"
- name: "Build Package"
run: bun run build

- name: "🧪 Run Tests"
run: bun test
- name: "Run Tests"
run: bun run test

- name: "📤 Publish to npm"
- name: "Publish to npm"
working-directory: packages/seox
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: "📦 Create Distribution Archive"
- name: "Create Distribution Archive"
working-directory: packages/seox
run: npm pack

- name: "📤 Upload Release Asset"
- name: "Upload Release Asset"
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.create-release.outputs.tag_name }}
files: "*.tgz"
files: "packages/seox/*.tgz"
make_latest: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules
out
dist
*.tgz
.next
.turbo

# code coverage
coverage
Expand Down
26 changes: 26 additions & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# deps
/node_modules

# generated content
.source

# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo

# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# others
.env*.local
.vercel
next-env.d.ts
45 changes: 45 additions & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# docs

This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).

Run development server:

```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```

Open http://localhost:3000 with your browser to see the result.

## Explore

In the project, you can see:

- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep.

| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |

### Fumadocs MDX

A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.

Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.dev) - learn about Fumadocs
35 changes: 35 additions & 0 deletions apps/docs/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": false,
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!node_modules", "!.next", "!dist", "!build", "!.source"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
105 changes: 105 additions & 0 deletions apps/docs/content/docs/api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: API Reference
description: SEOX API documentation
---

# API Reference

SEOX provides a simple API for managing SEO in your Next.js applications.

## Package Exports

```mermaid
graph LR
subgraph seox["seox"]
A[SEOXConfig type]
end

subgraph next["seox/next"]
B[SEOX Class]
C[JsonLd Component]
end

A --> B
B --> D[Metadata Object]
C --> E[Structured Data]
```

## Main Package (`seox`)

Types and configuration interfaces.

```ts
import type { SEOXConfig } from 'seox';
```

### Exports

| Export | Type | Description |
|--------|------|-------------|
| `SEOXConfig` | Type | Configuration interface |
| `DEFAULT_CONFIG_FILENAME` | Constant | Default config filename |

## Next.js Package (`seox/next`)

React components and utilities for Next.js.

```ts
import { SEOX, JsonLd } from 'seox/next';
```

### Exports

| Export | Type | Description |
|--------|------|-------------|
| [`SEOX`](/docs/api/seox-class) | Class | Metadata generation class |
| [`JsonLd`](/docs/api/json-ld) | Component | Structured data component |

## Quick Reference

### Generate Metadata

```tsx
import { SEOX } from 'seox/next';
import { config } from '@/seox.config';

export async function generateMetadata() {
return new SEOX(config).metadata({
title: 'Page Title',
description: 'Page description',
});
}
```

### Add Structured Data

```tsx
import { JsonLd } from 'seox/next';

export default function Page() {
return (
<>
<JsonLd
data={{
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'Acme Inc',
url: 'https://acme.com',
}}
/>
<main>Content</main>
</>
);
}
```

## Detailed Documentation

<Cards>
<Card title="SEOX Class" href="/docs/api/seox-class">
Metadata generation with type safety
</Card>
<Card title="JsonLd Component" href="/docs/api/json-ld">
Structured data for search engines
</Card>
</Cards>
Loading