@stainless-api/docs-search 0.1.0-beta.36 → 0.1.0-beta.38
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/dist/context.js +2 -2
- package/dist/indexer.js +3 -1
- package/package.json +3 -3
package/dist/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { search } from "./providers/algolia.js";
|
|
2
|
-
import { createContext,
|
|
2
|
+
import { createContext, use, useCallback } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/context.tsx
|
|
@@ -7,7 +7,7 @@ function createStrictContext(displayName) {
|
|
|
7
7
|
const Context = createContext(null);
|
|
8
8
|
Context.displayName = displayName;
|
|
9
9
|
function useStrictContext() {
|
|
10
|
-
const context =
|
|
10
|
+
const context = use(Context);
|
|
11
11
|
if (context === null) throw new Error(`use${displayName} must be used within a ${displayName}Provider`);
|
|
12
12
|
return context;
|
|
13
13
|
}
|
package/dist/indexer.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Languages, generateRoute, parseStainlessPath, walkTree } from "@stainless-api/docs-ui/routing";
|
|
2
2
|
import { printer, renderMarkdown } from "@stainless-api/docs-ui/markdown";
|
|
3
|
+
import { isResourceEmpty } from "@stainless-api/docs-ui/utils";
|
|
3
4
|
|
|
4
5
|
//#region src/indexer.ts
|
|
5
6
|
function getResourceNames(resourceIds, topResources) {
|
|
6
|
-
let element
|
|
7
|
+
let element;
|
|
7
8
|
let resources = topResources;
|
|
8
9
|
const resourceName = [];
|
|
9
10
|
for (const resource of resourceIds) {
|
|
@@ -85,6 +86,7 @@ function* generateIndex(spec, renderMarkdownFn, includeTypes, languages) {
|
|
|
85
86
|
const crumbs = getResourceNames(parseStainlessPath(stainlessPath).resource, spec.resources);
|
|
86
87
|
switch (kind) {
|
|
87
88
|
case "resource":
|
|
89
|
+
if (isResourceEmpty(data)) break;
|
|
88
90
|
for (const language of targetLangs) {
|
|
89
91
|
if (!data[language]) continue;
|
|
90
92
|
parentCrumbs[stainlessPath] = crumbs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-search",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.38",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"fuse.js": "^7.1.0",
|
|
20
20
|
"htmlparser2": "^10.1.0",
|
|
21
21
|
"lucide-react": "^0.574.0",
|
|
22
|
-
"@stainless-api/docs-ui": "0.1.0-beta.
|
|
22
|
+
"@stainless-api/docs-ui": "0.1.0-beta.85",
|
|
23
23
|
"@stainless-api/ui-primitives": "0.1.0-beta.49"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|
|
59
59
|
"clean": "rm -rf dist",
|
|
60
|
-
"lint": "eslint .",
|
|
60
|
+
"lint": "eslint --flag unstable_native_nodejs_ts_config .",
|
|
61
61
|
"check:types": "tsc --noEmit"
|
|
62
62
|
}
|
|
63
63
|
}
|