@knitli/docs-components 1.1.12 → 1.2.1

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.
@@ -1,324 +0,0 @@
1
- // SPDX-FileCopyrightText: 2026 Knitli Inc.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
-
5
- // @ts-check
6
-
7
- // import cloudflare from "@astrojs/cloudflare";
8
- // import mdx from "@astrojs/mdx";
9
- // import sitemap from "@astrojs/sitemap";
10
- import starlight from "@astrojs/starlight";
11
- // import favicons from "astro-favicons";
12
- import { DocsAssets } from "@knitli/docs-components";
13
- import { defineConfig, fontProviders } from "astro/config";
14
- import { searchForWorkspaceRoot } from "vite";
15
-
16
- // import starlightHeadingBadges from "starlight-heading-badges";
17
- // import starlightContextualMenu from "starlight-contextual-menu";
18
- // import starlightTags from "starlight-tags";
19
- // import starlightLlmsText from "starlight-llms-txt";
20
-
21
- const {
22
- headlineLogoDark,
23
- headlineLogoLight,
24
- variables,
25
- docsStyle,
26
- faviconIco,
27
- faviconSvg,
28
- } = DocsAssets;
29
-
30
- const appName = "APP_NAME";
31
- const description = "DESCRIPTION";
32
-
33
- const shikiCfg = {
34
- themes: ["catppuccin-latte", "catppuccin-mocha"],
35
- bundledLangs: [
36
- "ansi",
37
- "rust",
38
- "astro",
39
- "yaml",
40
- "bash",
41
- "python",
42
- "json",
43
- "toml",
44
- "typescript",
45
- "markdown",
46
- ],
47
- langAlias: {
48
- sh: "bash",
49
- js: "typescript",
50
- py: "python",
51
- rs: "rust",
52
- md: "markdown",
53
- yml: "yaml",
54
- },
55
- };
56
-
57
- // https://astro.build/config
58
- export default defineConfig({
59
- site: "https://docs.knitli.com",
60
- base: `/${appName.toLowerCase()}/`,
61
- /*
62
- adapter: cloudflare({
63
- experimental: {
64
- headersAndRedirectsDevModeSupport: true,
65
- },
66
- configPath: "./wrangler.jsonc",
67
- imageService: "compile",
68
- }),
69
- */
70
- favicon: faviconIco,
71
- // Image optimization
72
- image: {
73
- service: {
74
- entrypoint: "astro/assets/services/sharp",
75
- },
76
- responsiveStyles: true,
77
- layout: "constrained",
78
- domains: [
79
- "github.com",
80
- "raw.githubusercontent.com",
81
- "docs.knitli.com",
82
- "knitli.com",
83
- "avatars.githubusercontent.com",
84
- "ui-avatars.com",
85
- `${appName.toLowerCase()}.knitli.com`,
86
- ],
87
- },
88
- fonts: [
89
- {
90
- provider: fontProviders.google,
91
- name: "DM Mono",
92
- cssVariable: "--font-sans",
93
- weights: [400, 500, 700],
94
- styles: ["normal", "italic"],
95
- subsets: ["latin"],
96
- formats: ["woff2"],
97
- fallbacks: [
98
- "Roboto Mono",
99
- "Menlo",
100
- "Consolas",
101
- "DejaVu Sans Mono",
102
- "monospace",
103
- ],
104
- },
105
- {
106
- provider: fontProviders.google,
107
- name: "JetBrains Mono",
108
- cssVariable: "--font-mono",
109
- weights: [400, 500, 700],
110
- styles: ["normal", "italic"],
111
- subsets: ["latin"],
112
- formats: ["woff2"],
113
- fallbacks: [
114
- "DM Mono",
115
- "Roboto Mono",
116
- "Menlo",
117
- "Consolas",
118
- "DejaVu Sans Mono",
119
- "monospace",
120
- ],
121
- },
122
- ],
123
- // Build optimizations
124
- build: {
125
- inlineStylesheets: "auto",
126
- assets: "_astro",
127
- },
128
- markdown: {
129
- shikiConfig: {
130
- ...Object.fromEntries(
131
- Object.entries(shikiCfg).map(([key, value]) =>
132
- key === "themes"
133
- ? [
134
- key,
135
- {
136
- light: "catppuccin-latte",
137
- dark: "catppuccin-mocha",
138
- },
139
- ]
140
- : [key, value],
141
- ),
142
- ),
143
- },
144
- },
145
- trailingSlash: "always",
146
- // Vite configuration for better bundling
147
- vite: {
148
- server: {
149
- fs: {
150
- allow: [searchForWorkspaceRoot(process.cwd())],
151
- },
152
- },
153
- assetsInclude: [
154
- "src/*.webp",
155
- "src/*.png",
156
- "src/*.jpg",
157
- "src/*.jpeg",
158
- "src/*.svg",
159
- "src/*.avif",
160
- ],
161
- build: {
162
- cssCodeSplit: true,
163
- cssMinify: "lightningcss",
164
- rollupOptions: {
165
- output: {
166
- experimental: {
167
- nativeMagicString: true,
168
- },
169
- },
170
- treeshake: "smallest",
171
- optimization: {
172
- inlineConst: "smart",
173
- },
174
- ssr: false,
175
- },
176
- },
177
- css: {
178
- lightningcss: {},
179
- },
180
- },
181
- prefetch: {
182
- defaultStrategy: "viewport",
183
- },
184
- experimental: {
185
- chromeDevtoolsWorkspace: true,
186
- clientPrerender: true,
187
- contentIntellisense: true,
188
- svgo: {
189
- plugins: [
190
- {
191
- name: "preset-default",
192
- params: {
193
- overrides: {
194
- removeMetadata: false,
195
- },
196
- },
197
- },
198
- ],
199
- },
200
- rustCompiler: true,
201
- },
202
-
203
- // Static site generation for Cloudflare
204
- output: "static",
205
- integrations: [
206
- starlight({
207
- title: `${appName} Docs`,
208
- description: description,
209
- logo: {
210
- dark: headlineLogoDark,
211
- light: headlineLogoLight,
212
- alt: "knitli logo",
213
- replacesTitle: true,
214
- },
215
- editLink: {
216
- baseUrl: `https://github.com/knitli/${appName.toLowerCase()}/edit/main/docs-site/src`,
217
- },
218
- expressiveCode: {
219
- useStarlightDarkModeSwitch: true,
220
- themes: ["catppuccin-latte", "catppuccin-mocha"],
221
- removeUnusedThemes: true,
222
- shiki: {
223
- ...Object.fromEntries(
224
- Object.entries(shikiCfg).filter(([key]) => key !== "themes"),
225
- ),
226
- },
227
- },
228
- plugins: [
229
- /*
230
- astroD2({ skipGeneration: true }),
231
- starlightLinksValidator(),
232
-
233
- starlightScrollToTop(),
234
- starlightChangelogs(),
235
- starlightIconsPlugin(),
236
- starlightPageActions({ baseUrl: `https://docs.knitli.com/${appName.toLowerCase()}` }),
237
- starlightIconsIntegration(),
238
- starlightIconsPlugin(),
239
- starlightHeadingBadges(), starlightContextualMenu({
240
- actions: ["copy", "view", "claude", "chatgpt"], share: true,
241
- }),
242
- // We need to configure starlight-tags with a tags.yml.
243
- //starlightTags(),
244
- starlightLlmsText({
245
- projectName: appName,
246
- description: `${appName} is a pure-Rust fork of the popular data processing and ETL framework, [CocoIndex](https://cocoindex.io). ${appName} features a highly modular architecture, with all sources, targets, and functions (i.e. transforms) implemented as feature-gated plugins. This allows users to easily customize and extend the framework to fit their specific data processing needs, while keeping the core lightweight and efficient.
247
- Like CocoIndex, ${appName} is fast, efficient, and works on data incrementally. Both libraries are built using a *dataflow architecture*, allowing you to easily define complex data processing pipelines with multiple sources, targets, and transforms in only a few lines of code. CocoIndex is built in Rust, but its entire API is only in Python, and does not allow for choosing integrations. ${appName} exposes a robust Rust API that allows you to choose exactly which sources, targets, and transforms you want to use.
248
- `,
249
- promote: ["getting-started*", "architecture*", "file-processing*", "transient-flow*"],
250
- demote: ["contributing*", "changelog*"],
251
- minify: {
252
- whitespace: true,
253
- note: true,
254
- details: true,
255
- }
256
- })
257
- */
258
- ],
259
- social: [
260
- {
261
- icon: "github",
262
- label: "GitHub",
263
- href: `https://github.com/knitli/${appName.toLowerCase()}`,
264
- },
265
- ],
266
- components: {
267
- Footer: "@knitli/docs-components/Footer.astro",
268
- PageFrame: "@knitli/docs-components/PageFrame.astro",
269
- },
270
- customCss: [variables, docsStyle, "./src/styles/custom.css"],
271
- head: [
272
- {
273
- tag: "meta",
274
- attrs: {
275
- property: "og:image",
276
- content: `https://docs.knitli.com/${appName.toLowerCase()}/og-image.png`,
277
- },
278
- },
279
- {
280
- tag: "meta",
281
- attrs: {
282
- property: "twitter:card",
283
- content: "summary_large_image",
284
- },
285
- },
286
- ],
287
- sidebar: [
288
- {
289
- label: "Guides",
290
- autogenerate: { directory: "guides" },
291
- },
292
- {
293
- label: "Examples",
294
- autogenerate: { directory: "examples" },
295
- },
296
- {
297
- label: "Reference",
298
- autogenerate: { directory: "reference" },
299
- },
300
- ],
301
- }),
302
- /*
303
- mdx(),
304
- favicons({
305
- name: `${appName} Docs by Knitli`,
306
- short_name: `${appName} Docs`,
307
- input: {
308
- favicons: [faviconSvg],
309
- },
310
- }),
311
- sitemap({
312
- filter: (page) => !/\^\/(?!cdn-cgi\/)/.test(page),
313
- changefreq: "weekly",
314
- priority: 0.4,
315
- lastmod: new Date(),
316
- namespaces: {
317
- image: false,
318
- video: false,
319
- },
320
- }),
321
-
322
- */
323
- ],
324
- });