@redocly/revel 0.129.1 → 0.129.2
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/CHANGELOG.md +6 -0
- package/dist/client/app/Sidebar/useSidebarItems.d.ts +2 -2
- package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
- package/dist/client/app/hooks/codeHighlight/useCodeHighlight.js +1 -1
- package/dist/server/fs/cache.js +1 -1
- package/dist/server/providers/database/database-initialization-strategy.js +1 -1
- package/package.json +7 -7
- package/dist/client/app/Sidebar/helpers/filter-out-versioned-items.d.ts +0 -23
- package/dist/client/app/Sidebar/helpers/filter-out-versioned-items.js +0 -1
- package/dist/server/providers/database/sqld-not-running-error.d.ts +0 -5
- package/dist/server/providers/database/sqld-not-running-error.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Version } from '@redocly/config';
|
|
1
|
+
import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
2
2
|
import type { ItemState, DrilldownMenuItemDetails } from '@redocly/theme/core/types';
|
|
3
|
-
export declare function useRawSidebarItems(activeVersion?: Version | null):
|
|
3
|
+
export declare function useRawSidebarItems(activeVersion?: Version | null): ResolvedNavItem[];
|
|
4
4
|
export declare function useSidebarItems(activeVersion?: Version | null): {
|
|
5
5
|
currentItems: ItemState[];
|
|
6
6
|
allSidebarItems: ItemState[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLocation as
|
|
1
|
+
import{useLocation as D}from"react-router-dom";import{useEffect as _,useMemo as f,useState as I}from"react";import{useActiveSectionId as k}from"@redocly/theme/core/hooks";import{getMenuItemType as C}from"@redocly/theme/core/utils";import{MenuItemType as y}from"@redocly/theme/core/constants";import{usePageSharedData as T,useSidebarItemsData as h,useSidebarConnectedCatalogConfig as G,useSidebarConnectedCatalogEntity as E}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as F}from"../../utils/catalog/inject-catalog-items";import{CATALOG_BASE_SLUG as O,CATALOG_SLUGS as B}from"../../../server/constants/plugins/catalog-entities";const K="catalog.backToAllLabel",M=`${O}/${B.ALL}`;function N(o){const t=h();return f(()=>p(t,o),[t,o])}function H(o){const t=D(),n=k(t,!0),e=E(),b=G(),a=N(o),c=e?F(a,e.key,b?.slug,t.search):a,[u,v]=I(null),s=f(()=>g(c,t,n),[n,t,c]),l=T("current-catalog-info"),A=f(()=>S(s),[c]),[r,d]=I(A),i=r.length>0?r[r.length-1]:void 0,L=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],t,n);_(()=>{if(!u||u!==n){const m=S(s);d(m),v(n)}},[a,t,n,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:e?{label:"Back to Catalog",labelTranslationKey:K,slug:M,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:L||s,allSidebarItems:s,popDrilldownState:()=>{r.length>0&&d(r.slice(0,r.length-1))},pushDrilldownState:m=>{d([...r,m])},backLink:w,versionLabel:e?.version??null}}function p(o,t){const n={};for(const e of o)e.versionFolderId&&e.version&&(n[e.versionFolderId]=n[e.versionFolderId]??[]).push(e.version);return o.filter(e=>e.version==null?e:t?e.version===t.version?!0:e.versionFolderId&&n[e.versionFolderId]?.includes(t.version)?!1:e.isDefault:e.isDefault).map(e=>Array.isArray(e.items)&&o.length?{...e,items:p(e.items,t)}:e)}function S(o,t=[]){for(const n of o){if(!n.active&&!n.hasActiveSubItem)continue;if(C(n)===y.DrillDown&&t.push({item:n}),n.active)return t;if(n.hasActiveSubItem)return S(n.items,t)}return t}export{N as useRawSidebarItems,H as useSidebarItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"shiki/langs/bash.mjs";import w from"shiki/langs/c.mjs";import N from"shiki/langs/coffee.mjs";import b from"shiki/langs/csharp.mjs";import y from"shiki/langs/css.mjs";import H from"shiki/langs/go.mjs";import v from"shiki/langs/graphql.mjs";import x from"shiki/langs/html.mjs";import L from"shiki/langs/http.mjs";import _ from"shiki/langs/java.mjs";import j from"shiki/langs/javascript.mjs";import T from"shiki/langs/kotlin.mjs";import E from"shiki/langs/lua.mjs";import r from"shiki/langs/markdown.mjs";import M from"shiki/langs/objective-c.mjs";import q from"shiki/langs/perl.mjs";import S from"shiki/langs/php.mjs";import A from"shiki/langs/python.mjs";import D from"shiki/langs/scala.mjs";import F from"shiki/langs/sql.mjs";import a from"shiki/langs/swift.mjs";import R from"shiki/langs/tsx.mjs";import W from"shiki/langs/typescript.mjs";import C from"shiki/langs/vim.mjs";import G from"shiki/langs/xml.mjs";import J from"shiki/langs/yaml.mjs";import U from"shiki/langs/jsx.mjs";import V from"shiki/langs/jsonl.mjs";import{transformerNotationDiff as $,transformerNotationHighlight as z,transformerNotationWordHighlight as B,transformerNotationFocus as I,transformerNotationErrorLevel as K,transformerMetaHighlight as O,transformerMetaWordHighlight as P,transformerRemoveNotationEscape as Q}from"@shikijs/transformers";import{createHighlighterCoreSync as s}from"shiki/core";import{createJavaScriptRegexEngine as n}from"shiki/engine/javascript";import X from"./ruby";import Y from"./multipart-mixed";import Z from"./json-seq";import f from"./theme";import rr from"./treeview-transformer";import or from"./node-transformer";import tr from"./line-numbers-transformer";import{mapLang as mr}from"./map-lang";const er=[{...r[0],displayName:"Markdoc",name:"markdoc",scopeName:"source.markdoc",aliases:[],repository:{...r[0].repository,fenced_code_block:{patterns:[...r[0].repository.fenced_code_block.patterns||[],{name:"markdoc",begin:".*{%",end:"%}",patterns:[{match:"(?<={%)\\s*(/\\w+(-\\w+)?|\\w+(-\\w+)?)",name:"markdoc.tag"},{match:"\\$\\w+",name:"markdoc.variable"},{match:'".*?"',name:"markdoc.string"},{match:"\\b\\w+(?=\\()",name:"markdoc.function"},{match:"\\s+\\w+(?==|\\s)",name:"markdoc.keyword"},{match:"(?<==)false|true(?=\\s)",name:"markdoc.boolean"}]}]}}}],p="text",c=s({themes:[f],langs:[u,w,N,b,y,H,v,x,L,_,j,T,E,r,M,q,S,A,X,D,F,a,R,W,G,C,J,er,U,V,Y,Z],engine:n()}),ir=[$(),z(),B(),I(),K(),O(),P(),Q(),or()],ar=(o,m,h)=>{const{withLineNumbers:l,startLineNumber:g,highlight:d,customTransformer:e}=h||{},i=mr(m?.toLowerCase()||p),t={lang:i,theme:"theme",meta:{__raw:d},transformers:[...i==="treeview"?[rr()]:[],...ir,...l?[tr(g)]:[],...e?[e]:[]]};try{return m==="swift"?s({themes:[f],langs:[a],engine:n({forgiving:!0})}).codeToHtml(o,t):c.codeToHtml(o,t)}catch{return c.codeToHtml(o,{...t,lang:p})}};function Ir(){return{highlight:ar}}export{ar as highlight,Ir as useCodeHighlight};
|
package/dist/server/fs/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sha1 as M}from"../utils/crypto/sha1.js";import{NestedMap as F}from"./utils/nested-map.js";import{trackAccessStore as
|
|
1
|
+
import{sha1 as M}from"../utils/crypto/sha1.js";import{NestedMap as F}from"./utils/nested-map.js";import{trackAccessStore as m}from"./utils/async-storage.js";import{isLoaderCacheEnabled as L}from"./utils/is-loader-cache-enabled.js";import{LoadError as w}from"./load-error.js";import{createLifecycleContext as S}from"../plugins/lifecycle.js";function f(y,t){return y+":"+t}class q{fs;errors=new Map;#t=new F;#i=new Map;#e=new Map;#s=new Map;#a=new F;#h;#o={};#n=new Map;constructor(t){this.fs=t,this.#h=S(t,this),this.#c()}async load(t,s,i){let e,r;typeof s=="string"?(e=s,r=this.#o[s]):(e=s.name,r=s.loader);const a=f(e,t);if(this.#n.has(a))return this.#n.get(a);const n=i?.join(""),h=n!==void 0?n.length>30?M(n):n:void 0,d=m.getStore()??[],I=!this.#r(t,e,h),p=this.#t.get(e,t);if(I&&p)return d.push({type:"load",loaderId:e,resource:t,hash:p.compoundHash}),p;const c=Promise.withResolvers();this.#n.set(a,c.promise),h!==void 0&&this.#e.set(a,h);const{status:P,value:l}=await this.#l(t,e,async()=>{let g;const C=m.getStore()||[],u=[],E=o=>u.push(o);try{g=await r(t,this.#h,E),u.length>0?this.errors.set(a,u):this.errors.delete(a)}catch(o){const R=this.#t.get(e,t)?.data,H=e==="redocly-config"||e==="nearest-redocly-config"?!1:(await this.load(t,"is-ignored")).data;if(!(o instanceof w)&&!H&&this.errors.set(a,[o]),!R)return{status:"error",value:o instanceof w?o:new w(o.message,{cause:o,loaderId:e})};g=R}const v=M(t+(h??"")+C.map(o=>o.hash).join(""));return d.push({type:"load",loaderId:e,resource:t,hash:v}),{status:"success",value:{data:g,compoundHash:v}}});return P==="error"?c.reject(l):(this.#d(t),L(e)&&this.#t.set(e,t,l),this.#i.set(a,l.compoundHash),c.resolve(l)),this.#n.delete(a),c.promise}setLoaders(t){this.#o={...this.#o,...t}}delete(t,s){if(s){const i=f(s,t);this.#t.delete(s,t),this.errors.delete(i),this.#i.delete(i),this.#e.delete(i);const e=this.#s.get(t);if(e){for(const r of e)this.delete(r,s);this.#s.delete(t)}this.#a.delete(s,t)}else for(const i of this.#t.keys())this.delete(t,i)}#d(t){const[s,i]=t.split("#");if(!i)return;const e=this.#s.get(s);e?e.add(t):this.#s.set(s,new Set([t]))}#c(){this.fs.watch(async t=>{for(const s of t)s.event==="unlink"&&this.delete(s.path)})}#r(t,s,i){const e=f(s,t);return i!==void 0&&this.#e.get(e)!==i?!0:(this.#a.get(s,t)??[]).some(n=>{switch(n.type){case"load":const h=f(n.loaderId,n.resource);return this.#i.get(h)!==n.hash||this.#r(n.resource,n.loaderId,this.#e.get(h));case"read":return n.hash!==this.fs.getFileInfo(n.path)?.hash;case"exists":const d=this.fs.getFileInfo(n.path);return n.hash!==(d&&!d.isVirtual?"t":"f");case"scan":return n.hash!==this.fs.getPatternScanHash(n.pattern)}})}#l(t,s,i){const e=[];return this.#a.set(s,t,e),m.run(e,i)}}export{q as Cache};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{logger as
|
|
1
|
+
import{logger as r}from"../../tools/notifiers/logger.js";import{DatabaseClient as g}from"./client.js";import{DatabasePathGenerator as p}from"./database-path-generator.js";import{retryAsyncOperation as h}from"./utils/retry-async-operation.js";class u{async initialize({removeExisting:a,baseDbDir:t,runWithPragmaWalWriteOptimization:s,databaseName:o,additionalFolder:l,migrationsFolder:c}){r.info("Initializing local database client...");const m=r.startTiming(),{databasePath:e}=await p.prepareDatabasePath({baseDir:t,databaseName:o,additionalFolder:l,removeExisting:a}),n={url:`file:${e}`},i=await g.init(n,{runWithPragmaWalWriteOptimization:s});return await i.migrate(t,c),r.infoTime(m,"Local database client initialized"),{client:i,path:e}}}class w{#t;#a;constructor(a){this.#t=a?.skipLogs??!1,this.#a=this.#t?void 0:r}async initialize({removeExisting:a,baseDbDir:t,syncUrl:s,authToken:o,databaseName:l,additionalFolder:c,migrationsFolder:m}){this.#a?.info("Initializing remote database client...");const e=this.#a?.startTiming();return await h(async()=>{const{databasePath:n}=await p.prepareDatabasePath({baseDir:t,databaseName:l,additionalFolder:c,removeExisting:a}),i=await g.init({url:`file:${n}`,syncUrl:s,authToken:o});return await i.migrate(t,m),this.#a?.infoTime(e??"","Remote database client initialized"),{client:i,path:n}},{maxRetries:3,retryStrategy:"exponential",delay:1e3,logger:this.#a,messages:{retry:"Retrying remote database client initialization",maxRetriesReached:"Max retries reached, remote database client initialization failed"}})}}export{u as LocalDatabaseInitializationStrategy,w as RemoteDatabaseInitializationStrategy};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/revel",
|
|
3
|
-
"version": "0.129.
|
|
3
|
+
"version": "0.129.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@opentelemetry/semantic-conventions": "1.34.0",
|
|
34
34
|
"@redocly/ajv": "8.17.1",
|
|
35
35
|
"@redocly/openapi-core": "2.14.3",
|
|
36
|
-
"@shikijs/transformers": "
|
|
36
|
+
"@shikijs/transformers": "^1.22.2",
|
|
37
37
|
"@tanstack/react-query": "5.62.3",
|
|
38
38
|
"@tanstack/react-table": "8.21.3",
|
|
39
39
|
"@tanstack/react-virtual": "3.13.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"react-select": "5.10.1",
|
|
80
80
|
"reactjs-popup": "2.0.6",
|
|
81
81
|
"semver": "7.7.3",
|
|
82
|
-
"shiki": "
|
|
82
|
+
"shiki": "1.24.4",
|
|
83
83
|
"simple-git": "3.20.0",
|
|
84
84
|
"sitemap": "7.1.1",
|
|
85
85
|
"stream-http": "3.2.0",
|
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
"xml-crypto": "6.0.1",
|
|
94
94
|
"xpath": "0.0.34",
|
|
95
95
|
"yaml-ast-parser": "0.0.43",
|
|
96
|
-
"@redocly/asyncapi-docs": "1.6.1",
|
|
97
|
-
"@redocly/config": "0.41.2",
|
|
98
|
-
"@redocly/graphql-docs": "1.6.0",
|
|
99
|
-
"@redocly/openapi-docs": "3.17.1",
|
|
100
96
|
"@redocly/portal-legacy-ui": "0.12.0",
|
|
97
|
+
"@redocly/openapi-docs": "3.17.1",
|
|
98
|
+
"@redocly/config": "0.41.2",
|
|
101
99
|
"@redocly/portal-plugin-mock-server": "0.14.1",
|
|
102
100
|
"@redocly/realm-asyncapi-sdk": "0.7.0",
|
|
101
|
+
"@redocly/asyncapi-docs": "1.6.1",
|
|
102
|
+
"@redocly/graphql-docs": "1.6.0",
|
|
103
103
|
"@redocly/theme": "0.61.1"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
2
|
-
/**
|
|
3
|
-
* Filters the sidebar items based on the active version.
|
|
4
|
-
*
|
|
5
|
-
* The input is a list of all items with versioned items mixed in.
|
|
6
|
-
*
|
|
7
|
-
* We can't just filter out all items that don't match the active version because there might be items from folders that have different versions.
|
|
8
|
-
*
|
|
9
|
-
* For example:
|
|
10
|
-
*
|
|
11
|
-
* /foo
|
|
12
|
-
* /@v1
|
|
13
|
-
* /@v2
|
|
14
|
-
* /bar
|
|
15
|
-
* /@v1
|
|
16
|
-
* /@latest
|
|
17
|
-
*
|
|
18
|
-
* So we foolow these rules:
|
|
19
|
-
* - we prefer the items with the same version name as the active version
|
|
20
|
-
* - if there are no items with the same version name, we pick the default version for folder
|
|
21
|
-
*/
|
|
22
|
-
export declare function filterOutVersionedItems(items: ResolvedNavItem[], activeVersion?: Version | null, versionNamesByFolderId?: Record<string, Set<string>>): ResolvedNavItem[];
|
|
23
|
-
//# sourceMappingURL=filter-out-versioned-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(s,e,n={}){for(const r of s)r.versionFolderId&&r.version&&(n[r.versionFolderId]=n[r.versionFolderId]??new Set).add(r.version);return s.filter(r=>r.version==null?r:e?r.version===e.version?!0:r.versionFolderId&&n[r.versionFolderId]?.has(e.version)?!1:r.isDefault:r.isDefault).map(r=>Array.isArray(r.items)&&r.items.length?{...r,items:o(r.items,e,n)}:r)}export{o as filterOutVersionedItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class e extends Error{constructor(r,n){super(r,n),this.name="SqldNotRunningError"}static isSqldNotRunningError(r){return r instanceof Error?r.message.includes('CREATE TABLE IF NOT EXISTS "__drizzle_migrations"')||r.message.includes("sync error: connection error:"):!1}}export{e as SqldNotRunningError};
|