specra 0.1.10 → 0.1.12

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,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { D as DocMeta, S as SpecraConfig, a as Doc } from '../config.types-Ccp3jN5U.mjs';
2
+ import { D as DocMeta, S as SpecraConfig, a as Doc } from '../mdx-ColN3Cyg.mjs';
3
3
 
4
4
  interface DocLayoutProps {
5
5
  meta: DocMeta;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { D as DocMeta, S as SpecraConfig, a as Doc } from '../config.types-Ccp3jN5U.js';
2
+ import { D as DocMeta, S as SpecraConfig, a as Doc } from '../mdx-ColN3Cyg.js';
3
3
 
4
4
  interface DocLayoutProps {
5
5
  meta: DocMeta;
@@ -1,5 +1,5 @@
1
- import { a as Doc, S as SpecraConfig } from '../config.types-Ccp3jN5U.mjs';
2
- export { A as AnalyticsConfig, B as BannerConfig, p as DeploymentConfig, D as DocMeta, E as EnvironmentVariables, o as FeaturesConfig, F as FooterBranding, n as FooterConfig, I as I18nConfig, N as NavigationConfig, m as SearchConfig, h as SiteConfig, l as SocialLinks, k as TabGroup, j as ThemeConfig, T as TocItem, f as defaultConfig, e as extractTableOfContents, d as getAdjacentDocs, c as getAllDocs, b as getDocBySlug, g as getVersions, i as isCategoryPage } from '../config.types-Ccp3jN5U.mjs';
1
+ import { a as Doc, S as SpecraConfig } from '../mdx-ColN3Cyg.mjs';
2
+ export { A as AnalyticsConfig, B as BannerConfig, q as DeploymentConfig, D as DocMeta, E as EnvironmentVariables, p as FeaturesConfig, F as FooterBranding, o as FooterConfig, I as I18nConfig, N as NavigationConfig, n as SearchConfig, j as SiteConfig, m as SocialLinks, l as TabGroup, k as ThemeConfig, T as TocItem, h as defaultConfig, f as extractTableOfContents, e as getAdjacentDocs, d as getAllDocs, c as getDocBySlug, b as getI18nConfig, g as getVersions, i as isCategoryPage } from '../mdx-ColN3Cyg.mjs';
3
3
  import { ClassValue } from 'clsx';
4
4
  import '../components/index.ts';
5
5
 
@@ -18,7 +18,7 @@ declare function getCachedVersions(): string[];
18
18
  /**
19
19
  * Cached version of getAllDocs()
20
20
  */
21
- declare function getCachedAllDocs(version?: string): Promise<Doc[]>;
21
+ declare function getCachedAllDocs(version?: string, locale?: string): Promise<Doc[]>;
22
22
  /**
23
23
  * Cached version of getDocBySlug()
24
24
  */
@@ -1,5 +1,5 @@
1
- import { a as Doc, S as SpecraConfig } from '../config.types-Ccp3jN5U.js';
2
- export { A as AnalyticsConfig, B as BannerConfig, p as DeploymentConfig, D as DocMeta, E as EnvironmentVariables, o as FeaturesConfig, F as FooterBranding, n as FooterConfig, I as I18nConfig, N as NavigationConfig, m as SearchConfig, h as SiteConfig, l as SocialLinks, k as TabGroup, j as ThemeConfig, T as TocItem, f as defaultConfig, e as extractTableOfContents, d as getAdjacentDocs, c as getAllDocs, b as getDocBySlug, g as getVersions, i as isCategoryPage } from '../config.types-Ccp3jN5U.js';
1
+ import { a as Doc, S as SpecraConfig } from '../mdx-ColN3Cyg.js';
2
+ export { A as AnalyticsConfig, B as BannerConfig, q as DeploymentConfig, D as DocMeta, E as EnvironmentVariables, p as FeaturesConfig, F as FooterBranding, o as FooterConfig, I as I18nConfig, N as NavigationConfig, n as SearchConfig, j as SiteConfig, m as SocialLinks, l as TabGroup, k as ThemeConfig, T as TocItem, h as defaultConfig, f as extractTableOfContents, e as getAdjacentDocs, d as getAllDocs, c as getDocBySlug, b as getI18nConfig, g as getVersions, i as isCategoryPage } from '../mdx-ColN3Cyg.js';
3
3
  import { ClassValue } from 'clsx';
4
4
  import '../components/index.ts';
5
5
 
@@ -18,7 +18,7 @@ declare function getCachedVersions(): string[];
18
18
  /**
19
19
  * Cached version of getAllDocs()
20
20
  */
21
- declare function getCachedAllDocs(version?: string): Promise<Doc[]>;
21
+ declare function getCachedAllDocs(version?: string, locale?: string): Promise<Doc[]>;
22
22
  /**
23
23
  * Cached version of getDocBySlug()
24
24
  */
package/dist/lib/index.js CHANGED
@@ -59,6 +59,7 @@ __export(lib_exports, {
59
59
  getConfig: () => getConfig,
60
60
  getConfigValue: () => getConfigValue,
61
61
  getDocBySlug: () => getDocBySlug,
62
+ getI18nConfig: () => getI18nConfig,
62
63
  getVersions: () => getVersions,
63
64
  initConfig: () => initConfig,
64
65
  isCategoryPage: () => isCategoryPage,
@@ -739,7 +740,7 @@ async function getAllDocs(version = "v1.0.0", locale) {
739
740
  originalFilePath = parts.slice(0, -1).join(".");
740
741
  }
741
742
  }
742
- const doc = await getDocBySlug(isLocalized ? `${originalFilePath}.${fileLocale}` : originalFilePath, version, isLocalized ? fileLocale : void 0);
743
+ const doc = await getDocBySlug(originalFilePath, version, isLocalized ? fileLocale : void 0);
743
744
  if (!doc) return null;
744
745
  doc.filePath = originalFilePath;
745
746
  const folderPath = import_path3.default.dirname(originalFilePath).replace(/\\/g, "/");
@@ -761,6 +762,10 @@ async function getAllDocs(version = "v1.0.0", locale) {
761
762
  const uniqueDocs = /* @__PURE__ */ new Map();
762
763
  const validDocs = docs.filter((doc) => doc !== null && (isDevelopment3 || !doc.meta.draft));
763
764
  validDocs.forEach((doc) => {
765
+ if (locale === "all") {
766
+ uniqueDocs.set(doc.slug, doc);
767
+ return;
768
+ }
764
769
  let logicalSlug = doc.slug;
765
770
  if (i18nConfig) {
766
771
  const parts = logicalSlug.split("/");
@@ -973,18 +978,19 @@ function getCachedVersions() {
973
978
  versionsCache.timestamp = Date.now();
974
979
  return versions;
975
980
  }
976
- async function getCachedAllDocs(version = "v1.0.0") {
981
+ async function getCachedAllDocs(version = "v1.0.0", locale) {
977
982
  initializeWatchers();
978
- const cached = allDocsCache.get(version);
983
+ const cacheKey = locale ? `${version}:${locale}` : version;
984
+ const cached = allDocsCache.get(cacheKey);
979
985
  if (cached && isCacheValid(cached.timestamp)) {
980
- logCacheOperation("hit", `getAllDocs:${version}`);
986
+ logCacheOperation("hit", `getAllDocs:${cacheKey}`);
981
987
  return cached.data;
982
988
  }
983
- logCacheOperation("miss", `getAllDocs:${version}`);
984
- const timer = new PerfTimer(`getAllDocs(${version})`);
985
- const docs = await getAllDocs(version);
989
+ logCacheOperation("miss", `getAllDocs:${cacheKey}`);
990
+ const timer = new PerfTimer(`getAllDocs(${cacheKey})`);
991
+ const docs = await getAllDocs(version, locale);
986
992
  timer.end();
987
- allDocsCache.set(version, {
993
+ allDocsCache.set(cacheKey, {
988
994
  data: docs,
989
995
  timestamp: Date.now()
990
996
  });
@@ -1564,6 +1570,7 @@ async function findRedirect(path4) {
1564
1570
  getConfig,
1565
1571
  getConfigValue,
1566
1572
  getDocBySlug,
1573
+ getI18nConfig,
1567
1574
  getVersions,
1568
1575
  initConfig,
1569
1576
  isCategoryPage,