Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .chronus/changes/upgrade-deps-2026-june-2026-5-1-17-22-13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/html-program-viewer"
- "@typespec/openapi3"
- "@typespec/playground"
- tmlanguage-generator
- typespec-vscode
---

Upgrade dependencies
12 changes: 9 additions & 3 deletions packages/astro-utils/src/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ export async function processSidebar(
collapsed: !item.expanded,
});
} else {
items.forEach((x) =>
result.push(typeof x === "string" ? x : { ...x, collapsed: !item.expanded }),
);
items.forEach((x) => {
if (typeof x === "string") {
result.push(x);
} else if ("items" in x) {
result.push({ ...x, collapsed: !item.expanded });
} else {
result.push(x);
}
});
}
} else if ("slug" in item) {
result.push({ ...item, slug: prefix(item.slug) });
Expand Down
1 change: 0 additions & 1 deletion packages/html-program-viewer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default defineConfig({
plugins: [
react(),
dts({
logLevel: "silent", // checker reports the errors
tsconfigPath: "./tsconfig.build.json",
}),
checker({
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi3/src/cli/actions/convert/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function convertOpenAPI3Document(
},
}
: {};
const { specification } = await dereference(document, dereferenceOptions);
const { specification } = await dereference(document as unknown as AnyObject, dereferenceOptions);
if (!specification) {
throw new Error("Failed to dereference OpenAPI document");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe("tsp-openapi: generate-type", () => {
if (!specification) {
throw new Error("Failed to dereference OpenAPI document");
}
context = createContext(specification as OpenAPI3Document);
context = createContext(specification as unknown as OpenAPI3Document);
});
testScenarios.forEach((t) =>
it(`${generateScenarioName(t)}`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("tsp-openapi: HTTP part generation methods", () => {
info: { title: "Test", version: "1.0.0" },
paths: {},
});
context = createContext(specification as OpenAPI3Document);
context = createContext(specification as unknown as OpenAPI3Document);
});

describe("basic HTTP part wrapping", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ on reasoning in a response.`,
});

it("generates proper TypeSpec code with description and null", () => {
const context = createContext(doc as OpenAPI3Document);
const context = createContext(doc as unknown as OpenAPI3Document);
const types: TypeSpecUnion[] = [];
transformComponentSchemas(context, types);

Expand All @@ -100,7 +100,7 @@ on reasoning in a response.`,
});

it("preserves description from oneOf members with constraints when one is null", () => {
const context = createContext(doc as OpenAPI3Document);
const context = createContext(doc as unknown as OpenAPI3Document);
const types: TypeSpecUnion[] = [];
transformComponentSchemas(context, types);

Expand All @@ -119,7 +119,7 @@ on reasoning in a response.`,
});

it("handles reference + null anyOf correctly", () => {
const context = createContext(doc as OpenAPI3Document);
const context = createContext(doc as unknown as OpenAPI3Document);
const types: TypeSpecUnion[] = [];
transformComponentSchemas(context, types);

Expand Down Expand Up @@ -162,7 +162,7 @@ on reasoning in a response.`,
}
const docWithTypeArray = specification;

const context = createContext(docWithTypeArray as OpenAPI3Document);
const context = createContext(docWithTypeArray as unknown as OpenAPI3Document);
const types: TypeSpecUnion[] = [];
transformComponentSchemas(context, types);

Expand Down
34 changes: 28 additions & 6 deletions packages/playground/src/react/playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,23 +201,42 @@ export const Playground: FunctionComponent<PlaygroundProps> = (props) => {
setIsOutputStale(false);
}, [selectedEmitter]);

// Sync Monaco model with state content
// Track whether content changes originated from the model (user typing)
// to avoid the sync effect resetting the model during typing
const isModelDrivenChangeRef = useRef(false);

// Sync Monaco model with state content (only for external/programmatic changes)
useEffect(() => {
if (isModelDrivenChangeRef.current) {
isModelDrivenChangeRef.current = false;
return;
}
if (typespecModel.getValue() !== (content ?? "")) {
typespecModel.setValue(content ?? "");
}
}, [content, typespecModel]);

// Use refs to avoid re-subscribing to onDidChangeContent on every keystroke
const contentRef = useRef(content);
const onContentChangeRef = useRef(onContentChange);
useEffect(() => {
contentRef.current = content;
}, [content]);
useEffect(() => {
onContentChangeRef.current = onContentChange;
}, [onContentChange]);

// Update state when Monaco model changes
useEffect(() => {
const disposable = typespecModel.onDidChangeContent(() => {
const newContent = typespecModel.getValue();
if (newContent !== content) {
onContentChange(newContent);
if (newContent !== contentRef.current) {
isModelDrivenChangeRef.current = true;
onContentChangeRef.current(newContent);
}
});
return () => disposable.dispose();
}, [typespecModel, content, onContentChange]);
}, [typespecModel]);

const isSampleUntouched = useMemo(() => {
return Boolean(selectedSampleName && content === props.samples?.[selectedSampleName]?.content);
Expand Down Expand Up @@ -336,8 +355,11 @@ export const Playground: FunctionComponent<PlaygroundProps> = (props) => {

const saveCode = useCallback(() => {
if (onSave) {
// Read directly from the model to ensure we save the latest content,
// not a potentially stale React state value
const currentContent = typespecModel.getValue();
onSave({
content: content ?? "",
content: currentContent,
emitter: selectedEmitter,
compilerOptions,
sampleName: isSampleUntouched ? selectedSampleName : undefined,
Expand All @@ -346,7 +368,7 @@ export const Playground: FunctionComponent<PlaygroundProps> = (props) => {
});
}
}, [
content,
typespecModel,
onSave,
selectedEmitter,
compilerOptions,
Expand Down
4 changes: 1 addition & 3 deletions packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export default defineConfig({
optimizeDeps: {},
plugins: [
react({}),
dts({
logLevel: "silent", // checker reports the errors
}),
dts({}),
checker({
// e.g. use TypeScript check
typescript: true,
Expand Down
4 changes: 1 addition & 3 deletions packages/react-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export default defineConfig({
},
plugins: [
react({}),
dts({
logLevel: "silent", // checker reports the errors
}),
dts({}),
checker({
// e.g. use TypeScript check
typescript: true,
Expand Down
4 changes: 1 addition & 3 deletions packages/spec-dashboard/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export default defineConfig({
},
plugins: [
react({}),
dts({
logLevel: "silent", // checker reports the errors
}),
dts({}),
checker({
// e.g. use TypeScript check
typescript: true,
Expand Down
7 changes: 6 additions & 1 deletion packages/tmlanguage-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
"textmate",
"tmlanguage"
],
"type": "module",
"main": "dist/tmlanguage-generator.js",
"exports": {
".": {
"import": "./dist/tmlanguage-generator.js"
}
},
"engines": {
"node": ">=22.0.0"
},
Expand All @@ -38,7 +44,6 @@
},
"devDependencies": {
"@types/node": "catalog:",
"@types/plist": "catalog:",
"rimraf": "catalog:",
"typescript": "catalog:"
}
Expand Down
7 changes: 5 additions & 2 deletions packages/tmlanguage-generator/src/tmlanguage-generator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { readFile } from "fs/promises";
import { createRequire } from "module";
import { dirname, resolve } from "path";
import plist from "plist";
import * as vscodeOniguruma from "vscode-oniguruma";
import * as plist from "plist";
import vscodeOniguruma from "vscode-oniguruma";

const require = createRequire(import.meta.url);

const { loadWASM, createOnigScanner } = vscodeOniguruma;

Expand Down
20 changes: 9 additions & 11 deletions packages/typespec-vscode/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ original copyright notices and the licenses under which Microsoft received such
components are set forth below. Microsoft reserves all rights not expressly
granted herein, whether by implication, estoppel or otherwise.

1. @babel/code-frame version 7.29.0 (https://github.com/babel/babel)
2. @babel/helper-validator-identifier version 7.28.5 (https://github.com/babel/babel)
3. ajv version 8.18.0 (ajv-validator/ajv)
1. @babel/code-frame version 7.29.7 (https://github.com/babel/babel)
2. @babel/helper-validator-identifier version 7.29.7 (https://github.com/babel/babel)
3. ajv version 8.20.0 (ajv-validator/ajv)
4. balanced-match version 1.0.2 (https://github.com/juliangruber/balanced-match)
5. brace-expansion version 2.0.2 (https://github.com/juliangruber/brace-expansion)
5. brace-expansion version 2.1.1 (https://github.com/juliangruber/brace-expansion)
6. change-case version 5.4.4 (https://github.com/blakeembrey/change-case)
7. cross-spawn version 7.0.6 (git@github.com:moxystudio/node-cross-spawn)
8. fast-deep-equal version 3.1.3 (https://github.com/epoberezkin/fast-deep-equal)
9. fast-uri version 3.1.0 (https://github.com/fastify/fast-uri)
9. fast-uri version 3.1.2 (https://github.com/fastify/fast-uri)
10. is-unicode-supported version 2.1.0 (sindresorhus/is-unicode-supported)
11. isexe version 2.0.0 (https://github.com/isaacs/isexe)
12. isexe version 4.0.0 (https://github.com/isaacs/isexe)
Expand All @@ -26,12 +26,12 @@ granted herein, whether by implication, estoppel or otherwise.
16. mustache version 4.2.0 (https://github.com/janl/mustache.js)
17. path-key version 3.1.1 (sindresorhus/path-key)
18. picocolors version 1.1.1 (alexeyraspopov/picocolors)
19. semver version 7.7.4 (https://github.com/npm/node-semver)
19. semver version 7.8.1 (https://github.com/npm/node-semver)
20. shebang-command version 2.0.0 (kevva/shebang-command)
21. shebang-regex version 3.0.0 (sindresorhus/shebang-regex)
22. which version 2.0.2 (https://github.com/isaacs/node-which)
23. which version 6.0.1 (https://github.com/npm/node-which)
24. yaml version 2.8.3 (github:eemeli/yaml)
23. which version 7.0.0 (https://github.com/npm/node-which)
24. yaml version 2.9.0 (github:eemeli/yaml)


%% @babel/code-frame NOTICES AND INFORMATION BEGIN HERE
Expand Down Expand Up @@ -264,11 +264,9 @@ END OF fast-deep-equal NOTICES AND INFORMATION
%% fast-uri NOTICES AND INFORMATION BEGIN HERE
=====================================================
Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
Copyright (c) 2021-present The Fastify team
Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
All rights reserved.

The Fastify team members are listed at https://github.com/fastify/fastify#team.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"main": "./dist/src/extension.cjs",
"browser": "./dist/src/web/extension.js",
"engines": {
"vscode": "^1.115.0"
"vscode": "^1.120.0"
},
"exports": {
".": {
Expand Down Expand Up @@ -285,7 +285,7 @@
"@types/cross-spawn": "catalog:",
"@types/node": "catalog:",
"@types/semver": "catalog:",
"@types/vscode": "~1.115.0",
"@types/vscode": "~1.120.0",
"@types/which": "catalog:",
"@typespec/compiler": "workspace:^",
"@typespec/internal-build-utils": "workspace:^",
Expand Down
Loading
Loading