From cf635c1920a4129ddcfdb648159c2fc2f49141d0 Mon Sep 17 00:00:00 2001 From: Steve Rice Date: Thu, 9 Oct 2025 15:11:14 -0700 Subject: [PATCH 1/2] All the emitter framework changes I made to get the COI demo working --- .../emitter-framework/src/python/builtins.ts | 12 +- .../class-declaration.test.tsx | 2 +- .../class-declaration/class-declaration.tsx | 88 +++- .../class-declaration/class-member.tsx | 19 +- .../class-declaration/class-method.test.tsx | 2 +- .../src/python/components/index.ts | 1 + .../type-expression/type-expression.tsx | 25 +- .../emitter-framework/src/python/index.ts | 1 + .../src/python/test-utils.tsx | 6 - .../typespec-vscode/ThirdPartyNotices.txt | 8 +- pnpm-lock.yaml | 462 ++++++++++++++++-- 11 files changed, 546 insertions(+), 80 deletions(-) diff --git a/packages/emitter-framework/src/python/builtins.ts b/packages/emitter-framework/src/python/builtins.ts index 87ea1063a0b..c7b88c95427 100644 --- a/packages/emitter-framework/src/python/builtins.ts +++ b/packages/emitter-framework/src/python/builtins.ts @@ -35,6 +35,16 @@ export const decimalModule = createModule({ export const typingModule = createModule({ name: "typing", descriptor: { - ".": ["Any", "Literal", "Never", "NoReturn", "Protocol", "Tuple"], + ".": [ + "Any", + "Literal", + "Never", + "NoReturn", + "Protocol", + "Tuple", + "Generic", + "TypeVar", + "Optional", + ], }, }); diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-declaration.test.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-declaration.test.tsx index 4b1c645a939..cbb1bf14893 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-declaration.test.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-declaration.test.tsx @@ -1,4 +1,3 @@ -import { getOutput } from "#python/test-utils.jsx"; import { Tester } from "#test/test-host.js"; import { List } from "@alloy-js/core"; import * as py from "@alloy-js/python"; @@ -7,6 +6,7 @@ import { describe, expect, it } from "vitest"; import { ClassDeclaration } from "../../../../src/python/components/class-declaration/class-declaration.js"; import { Method } from "../../../../src/python/components/class-declaration/class-method.js"; import { EnumDeclaration } from "../../../../src/python/components/enum-declaration/enum-declaration.js"; +import { getOutput } from "../../test-utils.jsx"; describe("Python Class from model", () => { it("creates a class", async () => { diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-declaration.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-declaration.tsx index 4833d9541c3..5499c6f09bf 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-declaration.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-declaration.tsx @@ -1,7 +1,8 @@ -import { abcModule, dataclassesModule } from "#python/builtins.js"; +import { abcModule, dataclassesModule, typingModule } from "#python/builtins.js"; import { type Children, For, List, mapJoin, Show } from "@alloy-js/core"; import * as py from "@alloy-js/python"; import { type Interface, type Model, type ModelProperty, type Operation } from "@typespec/compiler"; +import type { TemplateDeclarationNode } from "@typespec/compiler/ast"; import type { Typekit } from "@typespec/compiler/typekit"; import { createRekeyableMap } from "@typespec/compiler/utils"; import { useTsp } from "../../../core/context/tsp-context.js"; @@ -152,16 +153,25 @@ function getExtendsType($: Typekit, type: Model | Interface): Children | undefin * @param abstract - Whether the class is abstract. * @returns The bases type for the class declaration. */ -function createBasesType($: Typekit, props: ClassDeclarationProps, abstract: boolean) { - const globalBasesType = isTypedClassDeclarationProps(props) - ? getExtendsType($, props.type) - : undefined; - let basesType = props.bases ? props.bases : (globalBasesType ?? undefined); +function createBasesType( + $: Typekit, + props: ClassDeclarationProps, + abstract: boolean, + extraBases: Children[] = [], +) { + if (isTypedClassDeclarationProps(props)) { + const extend = getExtendsType($, props.type); + if (extend) { + extraBases.push(extend); + } + } + const allBases = (props.bases ? props.bases : []).concat(extraBases); + const basesType = allBases.length > 0 ? allBases : undefined; if (!abstract) return basesType; const abcBase = abcModule["."]["ABC"]; - if (Array.isArray(basesType)) return [abcBase, ...basesType]; - if (basesType != null) return [abcBase, basesType]; + if (Array.isArray(basesType)) return [...basesType, abcBase]; + if (basesType != null) return [basesType, abcBase]; return [abcBase]; } @@ -174,10 +184,48 @@ export function ClassDeclaration(props: ClassDeclarationProps) { const { $ } = useTsp(); // If we are explicitly overriding the class as abstract or the type is not a model, we need to create an abstract class - let abstract = + const abstract = ("abstract" in props && props.abstract) || ("type" in props && !$.model.is(props.type)); - let docElement = createDocElement($, props); - let basesType = createBasesType($, props, abstract); + const docElement = createDocElement($, props); + + const extraBases = []; + let typeVars = null; + const typeArgs = []; + if (isTypedClassDeclarationProps(props)) { + if ( + !props.type.isFinished && + (props.type.node as TemplateDeclarationNode)?.templateParameters + ) { + const templateParameters = (props.type.node as TemplateDeclarationNode)?.templateParameters; + typeVars = ( + <> + + {(node) => { + const typeVar = ( + ]} + /> + ); + return ; + + // ("${node.id.sv}")`; + // return ; + }} + + + ); + for (const templateParamter of templateParameters) { + typeArgs.push(templateParamter.id.sv); + } + } + + if (typeArgs.length > 0) { + extraBases.push(); + } + } + + const basesType = createBasesType($, props, abstract, extraBases); if (!isTypedClassDeclarationProps(props)) { return ( @@ -199,12 +247,10 @@ export function ClassDeclaration(props: ClassDeclarationProps) { const refkeys = declarationRefkeys(props.refkey, props.type); let dataclass: any = null; - if (!abstract) { - // Array-based models should be rendered as normal classes, not dataclasses (e.g., model Foo is Array) - const isArrayModel = $.model.is(props.type) && $.array.is(props.type); - if (!isArrayModel) { - dataclass = dataclassesModule["."]["dataclass"]; - } + // Array-based models should be rendered as normal classes, not dataclasses (e.g., model Foo is Array) + const isArrayModel = $.model.is(props.type) && $.array.is(props.type); + if (!isArrayModel) { + dataclass = dataclassesModule["."]["dataclass"]; } const classBody = createClassBody($, props, abstract); @@ -218,11 +264,13 @@ export function ClassDeclaration(props: ClassDeclarationProps) { return ( <> - - @{dataclass} + + {typeVars} + - + + @{dataclass}(kw_only=True) diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-member.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-member.tsx index 909a232b435..d1ab297bca8 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-member.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-member.tsx @@ -1,7 +1,7 @@ import { typingModule } from "#python/builtins.js"; import { type Children } from "@alloy-js/core"; import * as py from "@alloy-js/python"; -import { isNeverType, type ModelProperty, type Operation } from "@typespec/compiler"; +import { type ModelProperty, type Operation } from "@typespec/compiler"; import { useTsp } from "../../../core/context/tsp-context.js"; import { efRefkey } from "../../utils/refkey.js"; import { Atom } from "../atom/atom.jsx"; @@ -125,16 +125,21 @@ export function ClassMember(props: ClassMemberProps) { if ($.modelProperty.is(props.type)) { // Map never-typed properties to typing.Never - const isNever = isNeverType(props.type.type); - const unpackedType = isNever ? (typingModule["."]["Never"] as any) : (props.type.type as any); + const unpackedType = props.type.type; const isOptional = props.optional ?? props.type.optional ?? false; - const defaultValue: any = (props.type as any).defaultValue; + const defaultValue = props.type.defaultValue; const literalTypeNode = buildTypeNodeForProperty(unpackedType); const initializer = buildPrimitiveInitializerFromDefault(defaultValue, unpackedType, $); - const typeNode: Children = isNever - ? (typingModule["."]["Never"] as any) - : (literalTypeNode ?? ); + const unpackedTypeNode: Children = literalTypeNode ?? ; + const typeNode = isOptional ? ( + + ) : ( + unpackedTypeNode + ); const interfaceMemberProps = { doc, diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-method.test.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-method.test.tsx index 5eb7f4f9691..199cb034563 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-method.test.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-method.test.tsx @@ -1,10 +1,10 @@ -import { getOutput } from "#python/test-utils.jsx"; import { Tester } from "#test/test-host.js"; import { getProgram } from "#test/utils.js"; import { t } from "@typespec/compiler/testing"; import { describe, expect, it } from "vitest"; import { ClassDeclaration } from "../../../../src/python/components/class-declaration/class-declaration.js"; import { Method } from "../../../../src/python/components/class-declaration/class-method.js"; +import { getOutput } from "../../test-utils.jsx"; describe("interface methods with a `type` prop", () => { it("creates a class method from an interface method", async () => { diff --git a/packages/emitter-framework/src/python/components/index.ts b/packages/emitter-framework/src/python/components/index.ts index 8a91b6e3d26..e641cd3a541 100644 --- a/packages/emitter-framework/src/python/components/index.ts +++ b/packages/emitter-framework/src/python/components/index.ts @@ -1,3 +1,4 @@ export * from "./atom/atom.jsx"; export * from "./class-declaration/class-declaration.jsx"; +export * from "./enum-declaration/enum-declaration.jsx"; export * from "./function-declaration/function-declaration.jsx"; diff --git a/packages/emitter-framework/src/python/components/type-expression/type-expression.tsx b/packages/emitter-framework/src/python/components/type-expression/type-expression.tsx index 6b9d27cef92..ecc225a28f9 100644 --- a/packages/emitter-framework/src/python/components/type-expression/type-expression.tsx +++ b/packages/emitter-framework/src/python/components/type-expression/type-expression.tsx @@ -1,9 +1,17 @@ import { Experimental_OverridableComponent } from "#core/components/index.js"; import { useTsp } from "#core/context/index.js"; import { reportPythonDiagnostic } from "#python/lib.js"; -import { For } from "@alloy-js/core"; +import { code, For } from "@alloy-js/core"; import * as py from "@alloy-js/python"; -import type { IntrinsicType, Model, Scalar, Type } from "@typespec/compiler"; +import { + isNeverType, + type IntrinsicType, + type Model, + type Scalar, + type TemplatedTypeBase, + type Type, +} from "@typespec/compiler"; +import type { TemplateParameterDeclarationNode } from "@typespec/compiler/ast"; import type { Typekit } from "@typespec/compiler/typekit"; import { datetimeModule, decimalModule, typingModule } from "../../builtins.js"; import { efRefkey } from "../../utils/refkey.js"; @@ -36,6 +44,9 @@ export function TypeExpression(props: TypeExpressionProps) { switch (type.kind) { case "Scalar": // Custom types based on primitives (Intrinsics) case "Intrinsic": // Language primitives like `string`, `number`, etc. + if (isNeverType(type)) { + return typingModule["."]["Never"]; + } return <>{getScalarIntrinsicExpression($, type)}; case "Boolean": case "Number": @@ -64,8 +75,13 @@ export function TypeExpression(props: TypeExpressionProps) { return ; } + if (isTemplateVar(type)) { + return ; + } reportPythonDiagnostic($.program, { code: "python-unsupported-type", target: type }); break; + case "TemplateParameter": + return code`${String((type.node as TemplateParameterDeclarationNode).id.sv)}`; // TODO: Models will be implemented separately // return ; @@ -157,7 +173,12 @@ function getScalarIntrinsicExpression($: Typekit, type: Scalar | IntrinsicType): return pythonType; } +function isTemplateVar(type: Type): boolean { + return (type as TemplatedTypeBase).templateMapper !== undefined; +} + function isDeclaration($: Typekit, type: Type): boolean { + if (isTemplateVar(type)) return false; switch (type.kind) { case "Namespace": case "Interface": diff --git a/packages/emitter-framework/src/python/index.ts b/packages/emitter-framework/src/python/index.ts index abfe9e01158..5308987703b 100644 --- a/packages/emitter-framework/src/python/index.ts +++ b/packages/emitter-framework/src/python/index.ts @@ -1 +1,2 @@ +export * from "./builtins.js"; export * from "./components/index.js"; diff --git a/packages/emitter-framework/src/python/test-utils.tsx b/packages/emitter-framework/src/python/test-utils.tsx index 65709974f65..16163171173 100644 --- a/packages/emitter-framework/src/python/test-utils.tsx +++ b/packages/emitter-framework/src/python/test-utils.tsx @@ -12,11 +12,6 @@ import { export function getOutput(program: Program, children: Children[]): Children { const policy = py.createPythonNamePolicy(); - const printOptions = { - printWidth: 80, - tabWidth: 4, - insertFinalNewLine: false, - }; return ( {children} diff --git a/packages/typespec-vscode/ThirdPartyNotices.txt b/packages/typespec-vscode/ThirdPartyNotices.txt index b1b6f67c9fd..053a6f16dc1 100644 --- a/packages/typespec-vscode/ThirdPartyNotices.txt +++ b/packages/typespec-vscode/ThirdPartyNotices.txt @@ -16,7 +16,7 @@ granted herein, whether by implication, estoppel or otherwise. 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.0.6 (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 3.1.1 (https://github.com/isaacs/isexe) @@ -31,7 +31,7 @@ granted herein, whether by implication, estoppel or otherwise. 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 5.0.0 (https://github.com/npm/node-which) -24. yaml version 2.8.1 (github:eemeli/yaml) +24. yaml version 2.8.0 (github:eemeli/yaml) %% @babel/code-frame NOTICES AND INFORMATION BEGIN HERE @@ -263,12 +263,10 @@ END OF fast-deep-equal NOTICES AND INFORMATION %% fast-uri NOTICES AND INFORMATION BEGIN HERE ===================================================== +Copyright (c) 2021 The Fastify Team Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae -Copyright (c) 2021-present The 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 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34da114652f..e6326061bc0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,7 +150,7 @@ importers: version: 0.9.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3) '@astrojs/starlight': specifier: ^0.35.1 - version: 0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + version: 0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) '@expressive-code/core': specifier: ^0.41.2 version: 0.41.3 @@ -159,7 +159,7 @@ importers: version: link:../playground astro-expressive-code: specifier: ^0.41.2 - version: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + version: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) pathe: specifier: ^2.0.3 version: 2.0.3 @@ -175,7 +175,7 @@ importers: version: 18.3.23 astro: specifier: ^5.5.6 - version: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + version: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) packages/best-practices: devDependencies: @@ -464,7 +464,7 @@ importers: version: 5.9.3 vitest: specifier: ^3.1.2 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.3)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.7.0)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) web-tree-sitter: specifier: ^0.25.4 version: 0.25.8 @@ -779,7 +779,7 @@ importers: version: 14.1.0 inquirer: specifier: ^12.5.0 - version: 12.9.0(@types/node@24.3.3) + version: 12.9.0(@types/node@24.7.0) ora: specifier: ^8.1.1 version: 8.2.0 @@ -797,7 +797,7 @@ importers: version: 2.0.0 vitest: specifier: ^3.1.2 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.3)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.7.0)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) yargs: specifier: ~18.0.0 version: 18.0.0 @@ -1621,7 +1621,7 @@ importers: version: 0.25.8 vitest: specifier: ^3.1.2 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.3)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.7.0)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) packages/protobuf: devDependencies: @@ -1659,6 +1659,43 @@ importers: specifier: ^3.1.2 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.3)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0) + packages/python: + dependencies: + '@alloy-js/core': + specifier: ^0.21.0-dev.13 + version: 0.21.0-dev.13 + '@alloy-js/python': + specifier: ^0.2.0-dev.5 + version: 0.2.0-dev.5 + '@typespec/emitter-framework': + specifier: workspace:^ + version: link:../emitter-framework + prettier: + specifier: ~3.6.2 + version: 3.6.2 + devDependencies: + '@alloy-js/cli': + specifier: ^0.20.0 + version: 0.20.0 + '@types/node': + specifier: latest + version: 24.7.0 + '@typescript-eslint/eslint-plugin': + specifier: ^8.15.0 + version: 8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.3))(eslint@9.32.0)(typescript@5.9.3) + '@typescript-eslint/parser': + specifier: ^8.15.0 + version: 8.38.0(eslint@9.32.0)(typescript@5.9.3) + '@typespec/compiler': + specifier: workspace:^ + version: link:../compiler + eslint: + specifier: ^9.15.0 + version: 9.32.0 + typescript: + specifier: ^5.3.3 + version: 5.9.3 + packages/react-components: dependencies: '@fluentui/react-components': @@ -1941,7 +1978,7 @@ importers: version: 18.3.7(@types/react@18.3.23) '@vitejs/plugin-react': specifier: ~5.0.2 - version: 5.0.4(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + version: 5.0.4(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) rimraf: specifier: ~6.0.1 version: 6.0.1 @@ -1953,13 +1990,13 @@ importers: version: 5.9.3 vite: specifier: ^7.0.5 - version: 7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) + version: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) vite-plugin-checker: specifier: ^0.10.1 - version: 0.10.2(eslint@9.32.0)(optionator@0.9.4)(typescript@5.9.3)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + version: 0.10.2(eslint@9.32.0)(optionator@0.9.4)(typescript@5.9.3)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) vite-plugin-dts: specifier: 4.5.4 - version: 4.5.4(@types/node@24.3.3)(rollup@4.49.0)(typescript@5.9.3)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + version: 4.5.4(@types/node@24.7.0)(rollup@4.49.0)(typescript@5.9.3)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) packages/spector: dependencies: @@ -2467,10 +2504,10 @@ importers: version: 0.9.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3) '@astrojs/react': specifier: ^4.2.1 - version: 4.3.0(@types/node@24.3.3)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsx@4.20.3)(yaml@2.8.0) + version: 4.3.0(@types/node@24.7.0)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsx@4.20.3)(yaml@2.8.0) '@astrojs/starlight': specifier: ^0.35.1 - version: 0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + version: 0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) '@docsearch/css': specifier: ^4.1.0 version: 4.1.0 @@ -2494,10 +2531,10 @@ importers: version: link:../packages/playground astro: specifier: ^5.5.6 - version: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + version: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) astro-rehype-relative-markdown-links: specifier: ^0.18.1 - version: 0.18.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + version: 0.18.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -2594,7 +2631,7 @@ importers: version: link:../packages/xml astro-expressive-code: specifier: ^0.41.2 - version: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + version: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) rehype-mermaid: specifier: ^3.0.0 version: 3.0.0(playwright@1.55.1) @@ -2606,7 +2643,7 @@ importers: version: 6.0.1 vite-plugin-node-polyfills: specifier: ^0.24.0 - version: 0.24.0(rollup@4.49.0)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + version: 0.24.0(rollup@4.49.0)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) packages: @@ -6190,6 +6227,9 @@ packages: '@types/node@24.3.3': resolution: {integrity: sha512-GKBNHjoNw3Kra1Qg5UXttsY5kiWMEfoHq2TmXb+b1rcm6N7B3wTrFYIf/oSZ1xNQ+hVVijgLkiDZh7jRRsh+Gw==} + '@types/node@24.7.0': + resolution: {integrity: sha512-IbKooQVqUBrlzWTi79E8Fw78l8k1RNtlDDNWsFZs7XonuQSJ8oNYfEeclhprUldXISRMLzBpILuKgPlIxm+/Yw==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -12598,6 +12638,9 @@ packages: undici-types@7.10.0: resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + undici-types@7.14.0: + resolution: {integrity: sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==} + undici@7.12.0: resolution: {integrity: sha512-GrKEsc3ughskmGA9jevVlIOPMiiAHJ4OFUtaAH+NhfTUSiZ1wMPIQqQvAJUrJspFXJt3EBWgpAeoHEDVT1IBug==} engines: {node: '>=20.18.1'} @@ -13717,12 +13760,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@4.3.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0))': + '@astrojs/mdx@4.3.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0))': dependencies: '@astrojs/markdown-remark': 6.3.3 '@mdx-js/mdx': 3.1.0(acorn@8.15.0) acorn: 8.15.0 - astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) es-module-lexer: 1.7.0 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.5 @@ -13740,15 +13783,15 @@ snapshots: dependencies: prismjs: 1.30.0 - '@astrojs/react@4.3.0(@types/node@24.3.3)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsx@4.20.3)(yaml@2.8.0)': + '@astrojs/react@4.3.0(@types/node@24.7.0)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsx@4.20.3)(yaml@2.8.0)': dependencies: '@types/react': 18.3.23 '@types/react-dom': 18.3.7(@types/react@18.3.23) - '@vitejs/plugin-react': 4.7.0(vite@6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + '@vitejs/plugin-react': 4.7.0(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) ultrahtml: 1.6.0 - vite: 6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -13769,17 +13812,17 @@ snapshots: stream-replace-string: 2.0.0 zod: 3.25.76 - '@astrojs/starlight@0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0))': + '@astrojs/starlight@0.35.2(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0))': dependencies: '@astrojs/markdown-remark': 6.3.3 - '@astrojs/mdx': 4.3.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + '@astrojs/mdx': 4.3.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) '@astrojs/sitemap': 3.4.1 '@pagefind/default-ui': 1.3.0 '@types/hast': 3.0.4 '@types/js-yaml': 4.0.9 '@types/mdast': 4.0.4 - astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) - astro-expressive-code: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) + astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + astro-expressive-code: 0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)) bcp-47: 2.1.0 hast-util-from-html: 2.0.3 hast-util-select: 6.0.4 @@ -16469,6 +16512,16 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/checkbox@4.2.0(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/figures': 1.0.13 + '@inquirer/type': 3.0.8(@types/node@24.7.0) + ansi-escapes: 4.3.2 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/confirm@5.1.14(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16476,6 +16529,13 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/confirm@5.1.14(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/core@10.1.15(@types/node@24.3.3)': dependencies: '@inquirer/figures': 1.0.13 @@ -16489,6 +16549,19 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/core@10.1.15(@types/node@24.7.0)': + dependencies: + '@inquirer/figures': 1.0.13 + '@inquirer/type': 3.0.8(@types/node@24.7.0) + ansi-escapes: 4.3.2 + cli-width: 4.1.0 + mute-stream: 2.0.0 + signal-exit: 4.1.0 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/editor@4.2.15(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16497,6 +16570,14 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/editor@4.2.15(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + external-editor: 3.1.0 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/expand@4.0.17(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16505,6 +16586,14 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/expand@4.0.17(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/figures@1.0.13': {} '@inquirer/input@4.2.1(@types/node@24.3.3)': @@ -16514,6 +16603,13 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/input@4.2.1(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/number@3.0.17(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16521,6 +16617,13 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/number@3.0.17(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/password@4.0.17(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16529,6 +16632,14 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/password@4.0.17(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + ansi-escapes: 4.3.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/prompts@7.8.0(@types/node@24.3.3)': dependencies: '@inquirer/checkbox': 4.2.0(@types/node@24.3.3) @@ -16544,6 +16655,21 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/prompts@7.8.0(@types/node@24.7.0)': + dependencies: + '@inquirer/checkbox': 4.2.0(@types/node@24.7.0) + '@inquirer/confirm': 5.1.14(@types/node@24.7.0) + '@inquirer/editor': 4.2.15(@types/node@24.7.0) + '@inquirer/expand': 4.0.17(@types/node@24.7.0) + '@inquirer/input': 4.2.1(@types/node@24.7.0) + '@inquirer/number': 3.0.17(@types/node@24.7.0) + '@inquirer/password': 4.0.17(@types/node@24.7.0) + '@inquirer/rawlist': 4.1.5(@types/node@24.7.0) + '@inquirer/search': 3.1.0(@types/node@24.7.0) + '@inquirer/select': 4.3.1(@types/node@24.7.0) + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/rawlist@4.1.5(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16552,6 +16678,14 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/rawlist@4.1.5(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/search@3.1.0(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16561,6 +16695,15 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/search@3.1.0(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/figures': 1.0.13 + '@inquirer/type': 3.0.8(@types/node@24.7.0) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/select@4.3.1(@types/node@24.3.3)': dependencies: '@inquirer/core': 10.1.15(@types/node@24.3.3) @@ -16571,10 +16714,24 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@inquirer/select@4.3.1(@types/node@24.7.0)': + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/figures': 1.0.13 + '@inquirer/type': 3.0.8(@types/node@24.7.0) + ansi-escapes: 4.3.2 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 24.7.0 + '@inquirer/type@3.0.8(@types/node@24.3.3)': optionalDependencies: '@types/node': 24.3.3 + '@inquirer/type@3.0.8(@types/node@24.7.0)': + optionalDependencies: + '@types/node': 24.7.0 + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.0': @@ -16701,6 +16858,14 @@ snapshots: transitivePeerDependencies: - '@types/node' + '@microsoft/api-extractor-model@7.30.7(@types/node@24.7.0)': + dependencies: + '@microsoft/tsdoc': 0.15.1 + '@microsoft/tsdoc-config': 0.17.1 + '@rushstack/node-core-library': 5.14.0(@types/node@24.7.0) + transitivePeerDependencies: + - '@types/node' + '@microsoft/api-extractor@7.52.9(@types/node@24.3.3)': dependencies: '@microsoft/api-extractor-model': 7.30.7(@types/node@24.3.3) @@ -16719,6 +16884,24 @@ snapshots: transitivePeerDependencies: - '@types/node' + '@microsoft/api-extractor@7.52.9(@types/node@24.7.0)': + dependencies: + '@microsoft/api-extractor-model': 7.30.7(@types/node@24.7.0) + '@microsoft/tsdoc': 0.15.1 + '@microsoft/tsdoc-config': 0.17.1 + '@rushstack/node-core-library': 5.14.0(@types/node@24.7.0) + '@rushstack/rig-package': 0.5.3 + '@rushstack/terminal': 0.15.4(@types/node@24.7.0) + '@rushstack/ts-command-line': 5.0.2(@types/node@24.7.0) + lodash: 4.17.21 + minimatch: 3.0.8 + resolve: 1.22.10 + semver: 7.5.4 + source-map: 0.6.1 + typescript: 5.8.2 + transitivePeerDependencies: + - '@types/node' + '@microsoft/applicationinsights-channel-js@3.3.9(tslib@2.8.1)': dependencies: '@microsoft/applicationinsights-common': 3.3.9(tslib@2.8.1) @@ -18114,6 +18297,19 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@rushstack/node-core-library@5.14.0(@types/node@24.7.0)': + dependencies: + ajv: 8.13.0 + ajv-draft-04: 1.0.0(ajv@8.13.0) + ajv-formats: 3.0.1(ajv@8.13.0) + fs-extra: 11.3.0 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.10 + semver: 7.5.4 + optionalDependencies: + '@types/node': 24.7.0 + '@rushstack/rig-package@0.5.3': dependencies: resolve: 1.22.10 @@ -18126,6 +18322,13 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + '@rushstack/terminal@0.15.4(@types/node@24.7.0)': + dependencies: + '@rushstack/node-core-library': 5.14.0(@types/node@24.7.0) + supports-color: 8.1.1 + optionalDependencies: + '@types/node': 24.7.0 + '@rushstack/ts-command-line@5.0.2(@types/node@24.3.3)': dependencies: '@rushstack/terminal': 0.15.4(@types/node@24.3.3) @@ -18135,6 +18338,15 @@ snapshots: transitivePeerDependencies: - '@types/node' + '@rushstack/ts-command-line@5.0.2(@types/node@24.7.0)': + dependencies: + '@rushstack/terminal': 0.15.4(@types/node@24.7.0) + '@types/argparse': 1.0.38 + argparse: 1.0.10 + string-argv: 0.3.2 + transitivePeerDependencies: + - '@types/node' + '@rushstack/worker-pool@0.4.9(@types/node@24.3.3)': optionalDependencies: '@types/node': 24.3.3 @@ -18729,6 +18941,10 @@ snapshots: dependencies: undici-types: 7.10.0 + '@types/node@24.7.0': + dependencies: + undici-types: 7.14.0 + '@types/normalize-package-data@2.4.4': {} '@types/parse-json@4.0.2': {} @@ -18943,7 +19159,7 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@4.7.0(vite@6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0))': + '@vitejs/plugin-react@4.7.0(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0))': dependencies: '@babel/core': 7.28.0 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.0) @@ -18951,7 +19167,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) transitivePeerDependencies: - supports-color @@ -18967,6 +19183,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@vitejs/plugin-react@5.0.4(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0))': + dependencies: + '@babel/core': 7.28.4 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.4) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.4) + '@rolldown/pluginutils': 1.0.0-beta.38 + '@types/babel__core': 7.20.5 + react-refresh: 0.17.0 + vite: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + transitivePeerDependencies: + - supports-color + '@vitest/coverage-v8@3.2.4(vitest@3.2.4)': dependencies: '@ampproject/remapping': 2.3.0 @@ -19012,6 +19240,14 @@ snapshots: optionalDependencies: vite: 6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) + '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + '@vitest/pretty-format@3.2.4': dependencies: tinyrainbow: 2.0.0 @@ -19957,14 +20193,14 @@ snapshots: astring@1.9.0: {} - astro-expressive-code@0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)): + astro-expressive-code@0.41.3(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)): dependencies: - astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) rehype-expressive-code: 0.41.3 - astro-rehype-relative-markdown-links@0.18.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)): + astro-rehype-relative-markdown-links@0.18.1(astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0)): dependencies: - astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + astro: 5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) catch-unknown: 2.0.0 debug: 4.4.1(supports-color@8.1.1) github-slugger: 2.0.0 @@ -19976,7 +20212,7 @@ snapshots: transitivePeerDependencies: - supports-color - astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.3.3)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0): + astro@5.12.5(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0)(@types/node@24.7.0)(encoding@0.1.13)(rollup@4.49.0)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0): dependencies: '@astrojs/compiler': 2.12.2 '@astrojs/internal-helpers': 0.6.1 @@ -20032,8 +20268,8 @@ snapshots: unist-util-visit: 5.0.0 unstorage: 1.16.1(@azure/identity@4.12.0)(@azure/storage-blob@12.28.0) vfile: 6.0.3 - vite: 6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) - vitefu: 1.1.1(vite@6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)) + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + vitefu: 1.1.1(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) xxhash-wasm: 1.1.0 yargs-parser: 21.1.1 yocto-spinner: 0.2.3 @@ -22922,6 +23158,18 @@ snapshots: optionalDependencies: '@types/node': 24.3.3 + inquirer@12.9.0(@types/node@24.7.0): + dependencies: + '@inquirer/core': 10.1.15(@types/node@24.7.0) + '@inquirer/prompts': 7.8.0(@types/node@24.7.0) + '@inquirer/type': 3.0.8(@types/node@24.7.0) + ansi-escapes: 4.3.2 + mute-stream: 2.0.0 + run-async: 4.0.5 + rxjs: 7.8.2 + optionalDependencies: + '@types/node': 24.7.0 + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -26898,6 +27146,8 @@ snapshots: undici-types@7.10.0: {} + undici-types@7.14.0: {} + undici@7.12.0: {} unicode-properties@1.4.1: @@ -27131,6 +27381,27 @@ snapshots: - tsx - yaml + vite-node@3.2.4(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1(supports-color@8.1.1) + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vite-plugin-checker@0.10.2(eslint@9.32.0)(optionator@0.9.4)(typescript@5.9.3)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)): dependencies: '@babel/code-frame': 7.27.1 @@ -27148,6 +27419,23 @@ snapshots: optionator: 0.9.4 typescript: 5.9.3 + vite-plugin-checker@0.10.2(eslint@9.32.0)(optionator@0.9.4)(typescript@5.9.3)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)): + dependencies: + '@babel/code-frame': 7.27.1 + chokidar: 4.0.3 + npm-run-path: 6.0.0 + picocolors: 1.1.1 + picomatch: 4.0.3 + strip-ansi: 7.1.0 + tiny-invariant: 1.3.3 + tinyglobby: 0.2.14 + vite: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + vscode-uri: 3.1.0 + optionalDependencies: + eslint: 9.32.0 + optionator: 0.9.4 + typescript: 5.9.3 + vite-plugin-dts@4.5.4(@types/node@24.3.3)(rollup@4.49.0)(typescript@5.9.3)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)): dependencies: '@microsoft/api-extractor': 7.52.9(@types/node@24.3.3) @@ -27167,6 +27455,25 @@ snapshots: - rollup - supports-color + vite-plugin-dts@4.5.4(@types/node@24.7.0)(rollup@4.49.0)(typescript@5.9.3)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)): + dependencies: + '@microsoft/api-extractor': 7.52.9(@types/node@24.7.0) + '@rollup/pluginutils': 5.2.0(rollup@4.49.0) + '@volar/typescript': 2.4.20 + '@vue/language-core': 2.2.0(typescript@5.9.3) + compare-versions: 6.1.1 + debug: 4.4.1(supports-color@8.1.1) + kolorist: 1.8.0 + local-pkg: 1.1.1 + magic-string: 0.30.17 + typescript: 5.9.3 + optionalDependencies: + vite: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + transitivePeerDependencies: + - '@types/node' + - rollup + - supports-color + vite-plugin-node-polyfills@0.24.0(rollup@4.49.0)(vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)): dependencies: '@rollup/plugin-inject': 5.0.5(rollup@4.49.0) @@ -27175,6 +27482,14 @@ snapshots: transitivePeerDependencies: - rollup + vite-plugin-node-polyfills@0.24.0(rollup@4.49.0)(vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)): + dependencies: + '@rollup/plugin-inject': 5.0.5(rollup@4.49.0) + node-stdlib-browser: 1.3.1 + vite: 7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + transitivePeerDependencies: + - rollup + vite@6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0): dependencies: esbuild: 0.25.8 @@ -27189,6 +27504,20 @@ snapshots: tsx: 4.20.3 yaml: 2.8.0 + vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0): + dependencies: + esbuild: 0.25.8 + fdir: 6.4.6(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.49.0 + tinyglobby: 0.2.14 + optionalDependencies: + '@types/node': 24.7.0 + fsevents: 2.3.3 + tsx: 4.20.3 + yaml: 2.8.0 + vite@7.0.6(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0): dependencies: esbuild: 0.25.8 @@ -27203,9 +27532,23 @@ snapshots: tsx: 4.20.3 yaml: 2.8.0 - vitefu@1.1.1(vite@6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0)): + vite@7.0.6(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0): + dependencies: + esbuild: 0.25.8 + fdir: 6.4.6(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.49.0 + tinyglobby: 0.2.14 optionalDependencies: - vite: 6.3.5(@types/node@24.3.3)(tsx@4.20.3)(yaml@2.8.0) + '@types/node': 24.7.0 + fsevents: 2.3.3 + tsx: 4.20.3 + yaml: 2.8.0 + + vitefu@1.1.1(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)): + optionalDependencies: + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.3.3)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0): dependencies: @@ -27252,6 +27595,51 @@ snapshots: - tsx - yaml + vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.7.0)(@vitest/ui@3.2.4)(happy-dom@18.0.1)(jsdom@25.0.1)(tsx@4.20.3)(yaml@2.8.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.1 + debug: 4.4.1(supports-color@8.1.1) + expect-type: 1.2.2 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 6.3.5(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@24.7.0)(tsx@4.20.3)(yaml@2.8.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/debug': 4.1.12 + '@types/node': 24.7.0 + '@vitest/ui': 3.2.4(vitest@3.2.4) + happy-dom: 18.0.1 + jsdom: 25.0.1 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vm-browserify@1.1.2: {} volar-service-css@0.0.62(@volar/language-service@2.4.20): From 30491696d16162dfe838a8e7668773edf61b33aa Mon Sep 17 00:00:00 2001 From: Steve Rice Date: Thu, 9 Oct 2025 15:16:12 -0700 Subject: [PATCH 2/2] hacky python emitter --- packages/python/.gitignore | 9 +++++++ packages/python/eslint.config.js | 11 ++++++++ packages/python/package.json | 44 +++++++++++++++++++++++++++++++ packages/python/prettierrc.yaml | 8 ++++++ packages/python/src/emitter.tsx | 45 ++++++++++++++++++++++++++++++++ packages/python/src/index.ts | 2 ++ packages/python/src/lib.ts | 8 ++++++ packages/python/tsconfig.json | 16 ++++++++++++ 8 files changed, 143 insertions(+) create mode 100644 packages/python/.gitignore create mode 100644 packages/python/eslint.config.js create mode 100644 packages/python/package.json create mode 100644 packages/python/prettierrc.yaml create mode 100644 packages/python/src/emitter.tsx create mode 100644 packages/python/src/index.ts create mode 100644 packages/python/src/lib.ts create mode 100644 packages/python/tsconfig.json diff --git a/packages/python/.gitignore b/packages/python/.gitignore new file mode 100644 index 00000000000..0fe4f7a0b28 --- /dev/null +++ b/packages/python/.gitignore @@ -0,0 +1,9 @@ +# MacOS +.DS_Store + +# Default TypeSpec output +tsp-output/ +dist/ + +# Dependency directories +node_modules/ \ No newline at end of file diff --git a/packages/python/eslint.config.js b/packages/python/eslint.config.js new file mode 100644 index 00000000000..75cb4f7ce3e --- /dev/null +++ b/packages/python/eslint.config.js @@ -0,0 +1,11 @@ +// @ts-check +import eslint from "@eslint/js"; +import tsEslint from "typescript-eslint"; + +export default tsEslint.config( + { + ignores: ["**/dist/**/*", "**/.temp/**/*"], + }, + eslint.configs.recommended, + ...tsEslint.configs.recommended, +); diff --git a/packages/python/package.json b/packages/python/package.json new file mode 100644 index 00000000000..1e0b8f9049f --- /dev/null +++ b/packages/python/package.json @@ -0,0 +1,44 @@ +{ + "name": "python", + "version": "0.1.0", + "type": "module", + "main": "dist/src/index.js", + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "default": "./dist/src/index.js" + }, + "./testing": { + "types": "./dist/src/testing/index.d.ts", + "default": "./dist/src/testing/index.js" + } + }, + "peerDependencies": { + "@typespec/compiler": "workspace:^" + }, + "dependencies": { + "@alloy-js/core": "^0.20.0", + "@alloy-js/python": "link:/Users/srice/code/alloy/packages/python", + "@typespec/emitter-framework": "workspace:^", + "prettier": "~3.6.2" + }, + "devDependencies": { + "@alloy-js/cli": "^0.20.0", + "@types/node": "latest", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", + "@typespec/compiler": "workspace:^", + "eslint": "^9.15.0", + "prettier": "^3.3.3", + "typescript": "^5.3.3" + }, + "scripts": { + "build": "alloy build", + "test": "node --test 'dist/test**/*.test.js'", + "lint": "eslint src/ test/ --report-unused-disable-directives --max-warnings=0", + "lint:fix": "eslint . --report-unused-disable-directives --fix", + "format": "prettier . --write", + "format:check": "prettier --check ." + }, + "private": true +} diff --git a/packages/python/prettierrc.yaml b/packages/python/prettierrc.yaml new file mode 100644 index 00000000000..dadb300075d --- /dev/null +++ b/packages/python/prettierrc.yaml @@ -0,0 +1,8 @@ +trailingComma: "all" +printWidth: 120 +quoteProps: "consistent" +endOfLine: lf +arrowParens: always +plugins: + - "./node_modules/@typespec/prettier-plugin-typespec/dist/index.js" +overrides: [{ "files": "*.tsp", "options": { "parser": "typespec" } }] diff --git a/packages/python/src/emitter.tsx b/packages/python/src/emitter.tsx new file mode 100644 index 00000000000..c9dd4281a08 --- /dev/null +++ b/packages/python/src/emitter.tsx @@ -0,0 +1,45 @@ +import { For, SourceDirectory } from "@alloy-js/core"; +import * as py from "@alloy-js/python"; +import { EmitContext } from "@typespec/compiler"; +import { $ } from "@typespec/compiler/typekit"; +import { Output, writeOutput } from "@typespec/emitter-framework"; +import * as ef from "@typespec/emitter-framework/python"; + +/** + * Main function to handle the emission process. + * @param context - The context for the emission process. + */ +export async function $onEmit(context: EmitContext) { + const tk = $(context.program); + const globalNs = tk.program.getGlobalNamespaceType(); + + const output = ( + + + + {(name, type) => { + return ( + + + {(name, type) => { + return ; + }} + + + {(name, type) => { + return ; + }} + + + ); + }} + + + + ); + + await writeOutput(context.program, output, context.emitterOutputDir); +} diff --git a/packages/python/src/index.ts b/packages/python/src/index.ts new file mode 100644 index 00000000000..d274d306f8a --- /dev/null +++ b/packages/python/src/index.ts @@ -0,0 +1,2 @@ +export { $onEmit } from "./emitter.js"; +export { $lib } from "./lib.js"; diff --git a/packages/python/src/lib.ts b/packages/python/src/lib.ts new file mode 100644 index 00000000000..33d85260480 --- /dev/null +++ b/packages/python/src/lib.ts @@ -0,0 +1,8 @@ +import { createTypeSpecLibrary } from "@typespec/compiler"; + +export const $lib = createTypeSpecLibrary({ + name: "python", + diagnostics: {}, +}); + +export const { reportDiagnostic, createDiagnostic } = $lib; diff --git a/packages/python/tsconfig.json b/packages/python/tsconfig.json new file mode 100644 index 00000000000..41ee4cca1cf --- /dev/null +++ b/packages/python/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "es2022", + "skipLibCheck": true, + "isolatedModules": true, + "jsx": "preserve", + "jsxImportSource": "@alloy-js/core", + "emitDeclarationOnly": true, + "outDir": "dist" + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules", "dist", "test/e2e/generated/**/*.ts"] +}