@bpmnkit/astro-shared 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <a href="https://bpmnkit.com"><img src="https://bpmnkit.com/favicon.svg" width="72" height="72" alt="BPMN Kit logo"></a>
3
3
  <h1>@bpmnkit/astro-shared</h1>
4
- <p>Shared CSS design tokens, aurora background, and site metadata for BPMN Kit Astro apps</p>
4
+ <p>Shared CSS design tokens, aurora background, site metadata, and SEO helpers for BPMN Kit Astro apps</p>
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/@bpmnkit/astro-shared?style=flat-square&color=6244d7)](https://www.npmjs.com/package/@bpmnkit/astro-shared)
7
7
  [![license](https://img.shields.io/npm/l/@bpmnkit/astro-shared?style=flat-square)](https://github.com/bpmnkit/monorepo/blob/main/LICENSE)
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## Overview
18
18
 
19
- `@bpmnkit/astro-shared` provides shared CSS imports and site metadata used across BPMN Kit's Astro-based apps (landing page, docs, learn). It re-exports the design tokens from `@bpmnkit/ui` and adds a global aurora background animation.
19
+ `@bpmnkit/astro-shared` provides shared CSS imports, site metadata, and SEO building blocks used across BPMN Kit's Astro-based apps (landing page, docs, learn, blog). It re-exports the design tokens from `@bpmnkit/ui`, adds a global aurora background animation, and ships a `<Seo>` head component plus schema.org JSON-LD helpers so every site emits consistent titles, canonicals, Open Graph tags, and structured data.
20
20
 
21
21
  This package is primarily intended for internal use by BPMN Kit's own Astro applications.
22
22
 
@@ -46,13 +46,39 @@ console.log(SITE.name) // "BPMN Kit"
46
46
  console.log(SITE.docsUrl) // "https://docs.bpmnkit.com"
47
47
  ```
48
48
 
49
+ ### Add SEO tags and structured data to a page
50
+
51
+ ```astro
52
+ ---
53
+ import Seo from "@bpmnkit/astro-shared/Seo.astro"
54
+ import { articleJsonLd } from "@bpmnkit/astro-shared/seo.js"
55
+ ---
56
+ <html>
57
+ <head>
58
+ <Seo
59
+ title="Generate BPMN diagrams with code"
60
+ description="A TypeScript SDK for BPMN 2.0 diagrams."
61
+ jsonLd={articleJsonLd({
62
+ title: "...",
63
+ description: "...",
64
+ url: "https://bpmnkit.com/blog/example",
65
+ datePublished: "2026-01-01",
66
+ authorName: "BPMN Kit",
67
+ })}
68
+ />
69
+ </head>
70
+ </html>
71
+ ```
72
+
49
73
  ## Exports
50
74
 
51
75
  | Export | Description |
52
76
  |--------|-------------|
53
77
  | `/tokens.css` | All `--bpmnkit-*` CSS custom properties (re-exports `@bpmnkit/ui/tokens.css`) |
54
78
  | `/background.css` | Global aurora background animation styles |
55
- | `.` | `SITE` metadata object (name, url, github, docsUrl, learnUrl, npm) |
79
+ | `/Seo.astro` | Shared `<Seo>` component — title, meta description, canonical URL, Open Graph, Twitter card, and JSON-LD |
80
+ | `/seo.js` | JSON-LD builders: `organizationJsonLd`, `softwareApplicationJsonLd`, `articleJsonLd`, `breadcrumbJsonLd`, `faqJsonLd` |
81
+ | `.` | `SITE` metadata object (name, url, github, docsUrl, learnUrl, blogUrl, npm) |
56
82
 
57
83
  ---
58
84
 
@@ -68,10 +94,12 @@ console.log(SITE.docsUrl) // "https://docs.bpmnkit.com"
68
94
  | [`@bpmnkit/plugins`](https://www.npmjs.com/package/@bpmnkit/plugins) | 22 composable canvas plugins |
69
95
  | [`@bpmnkit/api`](https://www.npmjs.com/package/@bpmnkit/api) | Camunda 8 REST API TypeScript client |
70
96
  | [`@bpmnkit/ascii`](https://www.npmjs.com/package/@bpmnkit/ascii) | Render BPMN diagrams as Unicode ASCII art |
97
+ | [`@bpmnkit/docspack`](https://www.npmjs.com/package/@bpmnkit/docspack) | BPMN Kit docs as an offline docspack package for AI agents |
71
98
  | [`@bpmnkit/ui`](https://www.npmjs.com/package/@bpmnkit/ui) | Shared design tokens and UI components |
72
99
  | [`@bpmnkit/profiles`](https://www.npmjs.com/package/@bpmnkit/profiles) | Shared auth, profile storage, and client factories for CLI & proxy |
73
100
  | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring & operations frontend for Camunda clusters |
74
101
  | [`@bpmnkit/connector-gen`](https://www.npmjs.com/package/@bpmnkit/connector-gen) | Generate connector templates from OpenAPI specs |
102
+ | [`@bpmnkit/connectors`](https://www.npmjs.com/package/@bpmnkit/connectors) | Camunda 8 OOTB connector catalog and deterministic template application |
75
103
  | [`@bpmnkit/cli`](https://www.npmjs.com/package/@bpmnkit/cli) | Camunda 8 command-line interface (casen) |
76
104
  | [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy) | Local AI bridge and Camunda API proxy server |
77
105
  | [`@bpmnkit/patterns`](https://www.npmjs.com/package/@bpmnkit/patterns) | Domain process patterns for BPMNKit AIKit |
package/package.json CHANGED
@@ -1,29 +1,34 @@
1
1
  {
2
2
  "name": "@bpmnkit/astro-shared",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./tokens.css": "./src/tokens.css",
8
8
  "./background.css": "./src/background.css",
9
+ "./seo.js": "./src/seo.ts",
10
+ "./Seo.astro": "./src/Seo.astro",
9
11
  ".": "./src/site.ts"
10
12
  },
11
13
  "files": [
12
14
  "LICENSE",
13
15
  "README.md",
14
16
  "src/*.css",
15
- "src/site.ts"
17
+ "src/site.ts",
18
+ "src/seo.ts",
19
+ "src/Seo.astro"
16
20
  ],
17
21
  "keywords": [
18
22
  "bpmn",
19
23
  "astro",
20
24
  "design-tokens",
21
25
  "shared",
26
+ "seo",
22
27
  "css",
23
28
  "typescript"
24
29
  ],
25
30
  "dependencies": {
26
- "@bpmnkit/ui": "0.0.15"
31
+ "@bpmnkit/ui": "0.0.16"
27
32
  },
28
33
  "license": "MIT",
29
34
  "publishConfig": {
package/src/Seo.astro ADDED
@@ -0,0 +1,61 @@
1
+ ---
2
+ import { SITE } from "./site.js"
3
+
4
+ interface Props {
5
+ title: string
6
+ description: string
7
+ /** Defaults to "website"; pages should pass "article" for blog posts. */
8
+ type?: "website" | "article"
9
+ /** Absolute image URL. Defaults to `${Astro.site}og.png`. */
10
+ image?: string
11
+ /** Set true on pages that should not be indexed (drafts, internal utility pages). */
12
+ noindex?: boolean
13
+ /** One or more schema.org JSON-LD objects (see seo.ts helpers) to embed. */
14
+ jsonLd?: object | object[]
15
+ }
16
+
17
+ const {
18
+ title,
19
+ description,
20
+ type = "website",
21
+ image = `${new URL("og.png", Astro.site)}`,
22
+ noindex = false,
23
+ jsonLd,
24
+ } = Astro.props
25
+
26
+ // `build.format: "file"` apps emit `<page>.html` files served as clean URLs by the
27
+ // static host, but `Astro.url.pathname` reflects the on-disk filename (and is literally
28
+ // ".html" for the homepage) — normalize back to the clean, extensionless path.
29
+ let canonicalPath = Astro.url.pathname
30
+ if (canonicalPath.endsWith(".html")) canonicalPath = canonicalPath.slice(0, -".html".length)
31
+ if (canonicalPath.endsWith("/index")) canonicalPath = canonicalPath.slice(0, -"index".length)
32
+ if (canonicalPath === "") canonicalPath = "/"
33
+ if (!canonicalPath.startsWith("/")) canonicalPath = `/${canonicalPath}`
34
+
35
+ const canonicalUrl = new URL(canonicalPath, Astro.site)
36
+ const jsonLdItems = jsonLd === undefined ? [] : Array.isArray(jsonLd) ? jsonLd : [jsonLd]
37
+ ---
38
+
39
+ <title>{title}</title>
40
+ <meta name="description" content={description} />
41
+ <link rel="canonical" href={canonicalUrl} />
42
+ {noindex && <meta name="robots" content="noindex, nofollow" />}
43
+
44
+ <meta property="og:type" content={type} />
45
+ <meta property="og:site_name" content={SITE.name} />
46
+ <meta property="og:title" content={title} />
47
+ <meta property="og:description" content={description} />
48
+ <meta property="og:url" content={canonicalUrl} />
49
+ <meta property="og:image" content={image} />
50
+ <meta property="og:image:width" content="1200" />
51
+ <meta property="og:image:height" content="630" />
52
+ <meta property="og:image:alt" content={title} />
53
+
54
+ <meta name="twitter:card" content="summary_large_image" />
55
+ <meta name="twitter:title" content={title} />
56
+ <meta name="twitter:description" content={description} />
57
+ <meta name="twitter:image" content={image} />
58
+
59
+ {jsonLdItems.map((item) => (
60
+ <script type="application/ld+json" set:html={JSON.stringify(item)} />
61
+ ))}
package/src/seo.ts ADDED
@@ -0,0 +1,98 @@
1
+ import { SITE } from "./site.js"
2
+
3
+ /** schema.org Organization — brand identity, safe to include on every page. */
4
+ export function organizationJsonLd() {
5
+ return {
6
+ "@context": "https://schema.org",
7
+ "@type": "Organization",
8
+ name: SITE.name,
9
+ url: SITE.url,
10
+ // A raster (not SVG) image — Google's logo guidelines expect this.
11
+ logo: `${SITE.url}/og.png`,
12
+ sameAs: [SITE.github, SITE.npm],
13
+ }
14
+ }
15
+
16
+ /** schema.org SoftwareApplication — for package/product pages (landing, package docs). */
17
+ export function softwareApplicationJsonLd(input: {
18
+ name: string
19
+ description: string
20
+ url: string
21
+ applicationCategory?: string
22
+ /** e.g. the current @bpmnkit/core version, to reinforce the version shown on the page. */
23
+ softwareVersion?: string
24
+ /** SPDX identifier or license URL. */
25
+ license?: string
26
+ }) {
27
+ return {
28
+ "@context": "https://schema.org",
29
+ "@type": "SoftwareApplication",
30
+ name: input.name,
31
+ description: input.description,
32
+ url: input.url,
33
+ applicationCategory: input.applicationCategory ?? "DeveloperApplication",
34
+ operatingSystem: "Cross-platform",
35
+ offers: {
36
+ "@type": "Offer",
37
+ price: "0",
38
+ priceCurrency: "USD",
39
+ },
40
+ ...(input.softwareVersion ? { softwareVersion: input.softwareVersion } : {}),
41
+ ...(input.license ? { license: input.license } : {}),
42
+ }
43
+ }
44
+
45
+ /** schema.org Article — for blog posts. */
46
+ export function articleJsonLd(input: {
47
+ title: string
48
+ description: string
49
+ url: string
50
+ datePublished: string
51
+ dateModified?: string
52
+ authorName: string
53
+ image?: string
54
+ }) {
55
+ return {
56
+ "@context": "https://schema.org",
57
+ "@type": "Article",
58
+ headline: input.title,
59
+ description: input.description,
60
+ url: input.url,
61
+ datePublished: input.datePublished,
62
+ dateModified: input.dateModified ?? input.datePublished,
63
+ author: { "@type": "Person", name: input.authorName },
64
+ publisher: {
65
+ "@type": "Organization",
66
+ name: SITE.name,
67
+ logo: { "@type": "ImageObject", url: `${SITE.url}/og.png` },
68
+ },
69
+ ...(input.image ? { image: input.image } : {}),
70
+ }
71
+ }
72
+
73
+ /** schema.org BreadcrumbList — for docs/learn/blog nested pages. */
74
+ export function breadcrumbJsonLd(items: Array<{ name: string; url: string }>) {
75
+ return {
76
+ "@context": "https://schema.org",
77
+ "@type": "BreadcrumbList",
78
+ itemListElement: items.map((item, index) => ({
79
+ "@type": "ListItem",
80
+ position: index + 1,
81
+ name: item.name,
82
+ item: item.url,
83
+ })),
84
+ }
85
+ }
86
+
87
+ /** schema.org FAQPage — for glossary/comparison pages with Q&A content. */
88
+ export function faqJsonLd(items: Array<{ question: string; answer: string }>) {
89
+ return {
90
+ "@context": "https://schema.org",
91
+ "@type": "FAQPage",
92
+ mainEntity: items.map((item) => ({
93
+ "@type": "Question",
94
+ name: item.question,
95
+ acceptedAnswer: { "@type": "Answer", text: item.answer },
96
+ })),
97
+ }
98
+ }
package/src/site.ts CHANGED
@@ -3,9 +3,10 @@ export const SITE = {
3
3
  tagline: "Build, model, and deploy BPMN processes with TypeScript",
4
4
  description:
5
5
  "A TypeScript SDK for building, modeling, simulating, and deploying BPMN processes on Camunda 8.",
6
- url: "https://bpmn-sdk.github.io/monorepo",
6
+ url: "https://bpmnkit.com",
7
7
  github: "https://github.com/bpmnkit/monorepo",
8
- npm: "https://www.npmjs.com/package/@bpmnkit/core",
8
+ npm: "https://www.npmjs.com/org/bpmnkit",
9
9
  docsUrl: "https://docs.bpmnkit.com",
10
10
  learnUrl: "https://learn.bpmnkit.com",
11
+ blogUrl: "https://bpmnkit.com/blog",
11
12
  }