Skip to content

Commit 0ca64a1

Browse files
renovate[bot]danbarrclaude
authored
Update dependency typescript to v6 (#796)
* Update dependency typescript to v6 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Re-baseline tsconfig from fresh Docusaurus scaffold Silences the baseUrl deprecation warning via ignoreDeprecations and enables strict mode, matching what a fresh Docusaurus 3.10 scaffold produces. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix sidebars.ts type error from JSON-imported CRD sidebar TypeScript infers JSON import fields as widened strings, so crdSidebar.type was "string" instead of "category". That made the whole sidebar array fail to match SidebarItemConfig[] and cascaded into bogus errors on every bare doc-ID string. Cast the imported JSON to the extracted item type to break the cascade. The type is derived from SidebarsConfig so it stays accurate without importing from internal paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix type errors in custom components for TS 6 - mcp-metadata-plugin: narrow caught error with instanceof Error before reading .message (TS 6 defaults catches to unknown). - CRDReference: cast JSON-imported schemas to the minimal Schema interface; the upstream JSON carries extra x-kubernetes-* fields that don't structurally match. - HubSpotForm: declare window.hbspt via a global interface and switch to property access. - Admonition/Types: pass the now-required type prop to AdmonitionLayout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d35a9ad commit 0ca64a1

9 files changed

Lines changed: 42 additions & 13 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"husky": "^9.1.7",
5252
"lint-staged": "^16.4.0",
5353
"prettier": "^3.8.3",
54-
"typescript": "~5.9.3",
54+
"typescript": "~6.0.3",
5555
"typescript-eslint": "^8.58.2",
5656
"yaml": "^2.8.3"
5757
},

plugins/mcp-metadata-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
},
1111
"devDependencies": {
1212
"@types/js-yaml": "^4.0.9",
13-
"typescript": "~5.9.3"
13+
"typescript": "~6.0.3"
1414
}
1515
}

plugins/mcp-metadata-plugin/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ export default function mcpMetadataPlugin(
5959
}
6060

6161
// Store error message as fallback
62+
const message =
63+
error instanceof Error ? error.message : String(error);
6264
serverData[serverName] = `# Error fetching data for ${serverName}
63-
# ${error.message}
65+
# ${message}
6466
# Please check that the server exists in the registry and thv command is available`;
6567
}
6668
}

sidebars.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
22
import { buildCliReferenceSidebar } from './src/utils/buildHierarchicalSidebar';
3-
import crdSidebar from './static/api-specs/crds/sidebar.json';
3+
import crdSidebarJson from './static/api-specs/crds/sidebar.json';
4+
5+
type SidebarItemConfig = SidebarsConfig[string] extends (infer T)[] ? T : never;
6+
7+
const crdSidebar = crdSidebarJson as SidebarItemConfig;
48

59
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
610

src/components/CRDReference/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export function CRDFields({
264264
include,
265265
exclude,
266266
}: CRDFieldsProps): React.ReactNode {
267-
const schema = schemas[kind as CRDKind];
267+
const schema = schemas[kind as CRDKind] as unknown as Schema;
268268
if (!schema) {
269269
return (
270270
<div className={styles.error}>

src/components/HubSpotForm/index.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ interface HubSpotFormProps {
2727
anchorId?: string;
2828
}
2929

30+
interface HubSpotFormCreateOptions {
31+
portalId: string;
32+
formId: string;
33+
region: string;
34+
target: string;
35+
onFormSubmitted?: () => void;
36+
}
37+
38+
declare global {
39+
interface Window {
40+
hbspt?: {
41+
forms: {
42+
create: (options: HubSpotFormCreateOptions) => void;
43+
};
44+
};
45+
}
46+
}
47+
3048
const SCRIPT_SRC = '//js-na2.hsforms.net/forms/embed/v2.js';
3149

3250
export default function HubSpotForm({
@@ -46,7 +64,7 @@ export default function HubSpotForm({
4664
if (!containerRef.current) return;
4765

4866
const init = () => {
49-
window['hbspt'].forms.create({
67+
window.hbspt?.forms.create({
5068
portalId,
5169
formId,
5270
region,
@@ -55,7 +73,7 @@ export default function HubSpotForm({
5573
});
5674
};
5775

58-
if (window['hbspt']) {
76+
if (window.hbspt) {
5977
init();
6078
return;
6179
}

src/theme/Admonition/Types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface EnterpriseAdmonitionProps {
2929
function EnterpriseAdmonition(props: EnterpriseAdmonitionProps): ReactNode {
3030
return (
3131
<AdmonitionLayout
32+
type='enterprise'
3233
icon={<StacklokIcon />}
3334
title={props.title ?? 'Stacklok Enterprise'}
3435
className={`alert alert--enterprise ${props.className ?? ''}`}

tsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
// This file is not used by "docusaurus start/build" commands.
2+
// It is here to improve your IDE experience (type-checking, autocompletion...),
3+
// and can also run the package.json "typecheck" script manually.
14
{
2-
// This file is not used in compilation. It is here just for a nice editor experience.
35
"extends": "@docusaurus/tsconfig",
46
"compilerOptions": {
57
"baseUrl": ".",
6-
"resolveJsonModule": true
8+
"ignoreDeprecations": "6.0",
9+
"resolveJsonModule": true,
10+
"strict": true
711
},
812
"exclude": [".docusaurus", "build"]
913
}

0 commit comments

Comments
 (0)