specra 0.2.8 → 0.2.51

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.
@@ -0,0 +1,52 @@
1
+ {
2
+ "$ref": "#/definitions/CategoryConfig",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "CategoryConfig": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "collapsed": {
9
+ "type": "boolean"
10
+ },
11
+ "collapsible": {
12
+ "type": "boolean"
13
+ },
14
+ "icon": {
15
+ "type": "string"
16
+ },
17
+ "label": {
18
+ "type": "string"
19
+ },
20
+ "link": {
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "slug": {
24
+ "type": "string"
25
+ },
26
+ "type": {
27
+ "enum": [
28
+ "generated-index",
29
+ "doc"
30
+ ],
31
+ "type": "string"
32
+ }
33
+ },
34
+ "required": [
35
+ "type"
36
+ ],
37
+ "type": "object"
38
+ },
39
+ "position": {
40
+ "type": "number"
41
+ },
42
+ "sidebar_position": {
43
+ "type": "number"
44
+ },
45
+ "tab_group": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "type": "object"
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$ref": "#/definitions/ProductConfig",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "ProductConfig": {
6
+ "additionalProperties": false,
7
+ "description": "Per-product configuration loaded from docs/{product}/_product_.json Products sit above versions in the config hierarchy.",
8
+ "properties": {
9
+ "activeVersion": {
10
+ "description": "Default version for this product (overrides global site.activeVersion)",
11
+ "type": "string"
12
+ },
13
+ "badge": {
14
+ "description": "Badge text shown next to the product (e.g., \"New\", \"Beta\")",
15
+ "type": "string"
16
+ },
17
+ "description": {
18
+ "description": "Short description of the product",
19
+ "type": "string"
20
+ },
21
+ "icon": {
22
+ "description": "Icon identifier for the product dropdown (lucide icon name)",
23
+ "type": "string"
24
+ },
25
+ "label": {
26
+ "description": "Display name in the product switcher",
27
+ "type": "string"
28
+ },
29
+ "position": {
30
+ "description": "Order in the product dropdown (lower = first)",
31
+ "type": "number"
32
+ },
33
+ "tabGroups": {
34
+ "description": "Product-level tab group overrides",
35
+ "items": {
36
+ "$ref": "#/definitions/TabGroup"
37
+ },
38
+ "type": "array"
39
+ }
40
+ },
41
+ "required": [
42
+ "label"
43
+ ],
44
+ "type": "object"
45
+ },
46
+ "TabGroup": {
47
+ "additionalProperties": false,
48
+ "description": "Tab group for organizing documentation",
49
+ "properties": {
50
+ "icon": {
51
+ "description": "Optional icon name (lucide-react icon)",
52
+ "type": "string"
53
+ },
54
+ "id": {
55
+ "description": "Unique identifier for the tab group",
56
+ "type": "string"
57
+ },
58
+ "label": {
59
+ "description": "Display label for the tab",
60
+ "type": "string"
61
+ }
62
+ },
63
+ "required": [
64
+ "id",
65
+ "label"
66
+ ],
67
+ "type": "object"
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$ref": "#/definitions/VersionConfig",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "BannerConfig": {
6
+ "additionalProperties": false,
7
+ "description": "Banner configuration for version-level or site-level banners. Site-wide banner configuration",
8
+ "properties": {
9
+ "text": {
10
+ "description": "Banner message text. Supports markdown links like [text](/url).",
11
+ "type": "string"
12
+ },
13
+ "type": {
14
+ "description": "Banner style: info, warning, error, success Banner type",
15
+ "enum": [
16
+ "info",
17
+ "warning",
18
+ "error",
19
+ "success"
20
+ ],
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": [
25
+ "text"
26
+ ],
27
+ "type": "object"
28
+ },
29
+ "TabGroup": {
30
+ "additionalProperties": false,
31
+ "description": "Tab group for organizing documentation",
32
+ "properties": {
33
+ "icon": {
34
+ "description": "Optional icon name (lucide-react icon)",
35
+ "type": "string"
36
+ },
37
+ "id": {
38
+ "description": "Unique identifier for the tab group",
39
+ "type": "string"
40
+ },
41
+ "label": {
42
+ "description": "Display label for the tab",
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": [
47
+ "id",
48
+ "label"
49
+ ],
50
+ "type": "object"
51
+ },
52
+ "VersionConfig": {
53
+ "additionalProperties": false,
54
+ "description": "Per-version configuration that can override global config settings. Loaded from docs/{version}/_version_.json",
55
+ "properties": {
56
+ "badge": {
57
+ "description": "Short badge text shown next to the version (e.g., \"Beta\", \"LTS\", \"Deprecated\").",
58
+ "type": "string"
59
+ },
60
+ "banner": {
61
+ "$ref": "#/definitions/BannerConfig",
62
+ "description": "Banner shown at the top of every page in this version. Overrides global banner."
63
+ },
64
+ "hidden": {
65
+ "description": "Hide this version from the version switcher. Useful for unreleased versions.",
66
+ "type": "boolean"
67
+ },
68
+ "label": {
69
+ "description": "Display label for this version (e.g., \"v1.0 (Stable)\"). Defaults to directory name.",
70
+ "type": "string"
71
+ },
72
+ "tabGroups": {
73
+ "description": "Override tab groups for this version. Empty array = no tabs.",
74
+ "items": {
75
+ "$ref": "#/definitions/TabGroup"
76
+ },
77
+ "type": "array"
78
+ }
79
+ },
80
+ "type": "object"
81
+ }
82
+ }
83
+ }
package/dist/category.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Note: This file uses server-only APIs (fs, path) and should only be imported in Server Components
2
2
  import fs from "fs";
3
3
  import path from "path";
4
- const DOCS_DIR = path.join(process.cwd(), "docs");
4
+ const DOCS_DIR = typeof process !== 'undefined' ? path.join(process.cwd(), "docs") : "docs";
5
5
  /**
6
6
  * Read category.json from a folder
7
7
  */
@@ -150,7 +150,7 @@ export function reloadConfig(userConfig) {
150
150
  * Returns null if the file doesn't exist or is invalid.
151
151
  */
152
152
  const versionConfigCache = new Map();
153
- const VCFG_TTL = process.env.NODE_ENV === 'development' ? 5000 : 60000;
153
+ const VCFG_TTL = (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') ? 5000 : 60000;
154
154
  export function loadVersionConfig(version, product) {
155
155
  const cacheKey = product && product !== "_default_" ? `${product}:${version}` : version;
156
156
  const cached = versionConfigCache.get(cacheKey);
@@ -240,7 +240,7 @@ const productsCache = {
240
240
  data: null,
241
241
  timestamp: 0,
242
242
  };
243
- const PCFG_TTL = process.env.NODE_ENV === 'development' ? 5000 : 60000;
243
+ const PCFG_TTL = (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') ? 5000 : 60000;
244
244
  /** Cache for individual product configs */
245
245
  const productConfigCache = new Map();
246
246
  /**
package/dist/dev-utils.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Development utilities for debugging and performance monitoring
3
3
  * Only active in development mode
4
4
  */
5
- const isDevelopment = process.env.NODE_ENV === 'development';
5
+ const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';
6
6
  /**
7
7
  * Performance timer for measuring operation duration
8
8
  */
package/dist/mdx-cache.js CHANGED
@@ -10,7 +10,7 @@ import { clearProductCaches } from './config.server';
10
10
  import { watch } from 'fs';
11
11
  import { join } from 'path';
12
12
  import { PerfTimer, logCacheOperation } from './dev-utils';
13
- const isDevelopment = process.env.NODE_ENV === 'development';
13
+ const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';
14
14
  // Cache stores
15
15
  const versionsCache = {
16
16
  data: null,
package/dist/mdx.js CHANGED
@@ -15,7 +15,7 @@ import { getAllCategoryConfigs } from "./category";
15
15
  import { sortSidebarItems, sortSidebarGroups, buildSidebarStructure } from "./sidebar-utils";
16
16
  import { sanitizePath, validatePathWithinDirectory, validateMDXSecurity } from "./mdx-security";
17
17
  import { getConfig } from "./config";
18
- const DOCS_DIR = path.join(process.cwd(), "docs");
18
+ const DOCS_DIR = typeof process !== 'undefined' ? path.join(process.cwd(), "docs") : "docs";
19
19
  /**
20
20
  * Resolve the docs directory for a given version and optional product.
21
21
  * - Default product or omitted: docs/{version}/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specra",
3
- "version": "0.2.8",
3
+ "version": "0.2.51",
4
4
  "description": "A modern documentation library for SvelteKit with built-in versioning, API reference generation, full-text search, and MDX support",
5
5
  "svelte": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -34,7 +34,10 @@
34
34
  },
35
35
  "./styles": "./dist/styles/globals.css",
36
36
  "./styles.css": "./dist/styles/globals.css",
37
- "./config.schema.json": "./config/specra.config.schema.json"
37
+ "./config.schema.json": "./config/specra.config.schema.json",
38
+ "./version.schema.json": "./config/version.schema.json",
39
+ "./product.schema.json": "./config/product.schema.json",
40
+ "./category.schema.json": "./config/category.schema.json"
38
41
  },
39
42
  "files": [
40
43
  "dist",
@@ -45,7 +48,7 @@
45
48
  "dev": "svelte-package --watch",
46
49
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
47
50
  "typecheck": "svelte-check --tsconfig ./tsconfig.json",
48
- "generate:schema": "ts-json-schema-generator --path src/lib/config.types.ts --type SpecraConfig --out config/specra.config.schema.json"
51
+ "generate:schema": "ts-json-schema-generator --path src/lib/config.types.ts --type SpecraConfig --out config/specra.config.schema.json && ts-json-schema-generator --path src/lib/config.types.ts --type VersionConfig --out config/version.schema.json && ts-json-schema-generator --path src/lib/config.types.ts --type ProductConfig --out config/product.schema.json && ts-json-schema-generator --path src/lib/category.ts --type CategoryConfig --out config/category.schema.json"
49
52
  },
50
53
  "keywords": [
51
54
  "documentation",