Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
f4f4c1c
Upload playground standalone emitters
timotheeguerin Mar 31, 2026
bddc4f5
use latest instead
timotheeguerin Mar 31, 2026
bb15e69
Apply suggestion from @timotheeguerin
timotheeguerin Apr 1, 2026
5883d12
fix: strip leading slash from PackagePath in upload-bundled-emitter
JoshLove-msft Apr 1, 2026
dd0c170
Merge branch 'main' of https://github.com/Microsoft/typespec into sta…
timotheeguerin Apr 2, 2026
2814ed0
fix: build emitter before playground bundle upload
JoshLove-msft Apr 2, 2026
0bbb3c7
fix: use npm run build instead of build:emitter
JoshLove-msft Apr 2, 2026
32bb4e7
feat(http-client-csharp): add playground support
JoshLove-msft Apr 2, 2026
6d29a07
fix: use build:emitter instead of build (no .NET SDK needed)
JoshLove-msft Apr 2, 2026
fb1e8ac
fix: parameterize build script for playground bundle
JoshLove-msft Apr 2, 2026
1936c27
fix(bundler): use empty shims for Node.js modules that break in browser
JoshLove-msft Apr 3, 2026
3d68882
Revert "fix(bundler): use empty shims for Node.js modules that break …
JoshLove-msft Apr 3, 2026
c39bd69
fix(http-client-csharp): use browser override for playground
JoshLove-msft Apr 3, 2026
7b533fb
fix: update test to import _validateDotNetSdk from emit-generate
JoshLove-msft Apr 3, 2026
1f72597
fix: update emitter tests for browser override refactor
JoshLove-msft Apr 3, 2026
2b652f0
fix: use serializeCodeModel for proper / tracking
JoshLove-msft Apr 3, 2026
09bc7f8
fix: remove _validateDotNetSdk re-export from emitter.ts
JoshLove-msft Apr 3, 2026
bb5060b
fix: split _validateDotNetSdk tests to separate file
JoshLove-msft Apr 3, 2026
034c1e0
fix: remove duplicate generate import
JoshLove-msft Apr 3, 2026
d1ce21e
fix: sync version from published package before bundle upload
JoshLove-msft Apr 3, 2026
3f8ddc5
feat: deploy playground server from publish pipeline
JoshLove-msft Apr 3, 2026
fecb3d8
fix: use shared infra constants for server deploy
JoshLove-msft Apr 3, 2026
c1012a0
fix: don't default to localhost in browser stub
JoshLove-msft Apr 4, 2026
7909ea4
feat: set playground server URL on the website
JoshLove-msft Apr 4, 2026
c9f0f9e
fix: use correct ACR name (azsdkengsys)
JoshLove-msft Apr 6, 2026
0b4a0d7
fix: use typespecacr registry in typespec resource group
JoshLove-msft Apr 6, 2026
0a2eb52
fix: auto-provision Azure resources in pipeline
JoshLove-msft Apr 6, 2026
981d325
fix: disable ACR admin account per org policy
JoshLove-msft Apr 6, 2026
3ca5190
trigger pipeline with latest changes
JoshLove-msft Apr 6, 2026
c38b629
fix: use absolute path for Dockerfile in az acr build
JoshLove-msft Apr 6, 2026
57c13fb
fix: add .dockerignore to exclude node_modules from ACR upload
JoshLove-msft Apr 6, 2026
7da1f8b
fix: include eng/ for signing key and ruleset in Docker build
JoshLove-msft Apr 6, 2026
026001b
fix: switch from Container Apps to App Service
JoshLove-msft Apr 7, 2026
35862be
fix: add CORS origins for playground websites
JoshLove-msft Apr 7, 2026
91c6849
fix: enable managed identity for ACR pull
JoshLove-msft Apr 7, 2026
591b78d
fix: rename loop variable to avoid scope conflict
JoshLove-msft Apr 7, 2026
b8f019d
fix: create webapp with placeholder image, then configure ACR
JoshLove-msft Apr 7, 2026
bdc1a08
fix: ensure identity and ACR pull on every deploy
JoshLove-msft Apr 7, 2026
3995e8c
fix: set WEBSITES_PORT on every deploy, not just create
JoshLove-msft Apr 7, 2026
cd1e7aa
fix: use PORT env var for App Service compatibility
JoshLove-msft Apr 7, 2026
10e4e20
fix: add logging for identity setup
JoshLove-msft Apr 9, 2026
cfcb5e8
Merge upstream/main and resolve conflicts
JoshLove-msft Apr 9, 2026
a4b83af
fix: add C# emitter back to playground packages
JoshLove-msft Apr 9, 2026
c496f54
fix: install Node 22 for playground bundle upload
JoshLove-msft Apr 9, 2026
a2ae6e9
fix: upgrade App Service plan to B2 (2 vCPU, 3.5 GB)
JoshLove-msft Apr 9, 2026
89b8d8a
fix: create writable temp dir for Roslyn persistent storage
JoshLove-msft Apr 10, 2026
9aecc06
fix: set no-cache on latest.json blobs
JoshLove-msft Apr 10, 2026
416255c
fix: run container as root to debug segfault
JoshLove-msft Apr 10, 2026
237549e
fix: use Ubuntu Noble base image explicitly
JoshLove-msft Apr 10, 2026
4595959
Revert "fix: use Ubuntu Noble base image explicitly"
JoshLove-msft Apr 10, 2026
d8e4726
fix: stream generator stdout/stderr to App Service logs
JoshLove-msft Apr 10, 2026
03dd65c
fix: disable .NET diagnostics to prevent container segfault
JoshLove-msft Apr 10, 2026
1727736
fix: disable server GC and increase stack size for generator
JoshLove-msft Apr 10, 2026
12815cc
fix: upgrade to P1v3 (8 GB RAM)
JoshLove-msft Apr 10, 2026
bc698ba
fix: add runtime info to health endpoint for debugging
JoshLove-msft Apr 10, 2026
cff843b
fix: switch from App Service to Azure Container Instances
JoshLove-msft Apr 10, 2026
94d33ee
fix: add ReadyToRun and TieredCompilation workarounds for Roslyn segf…
JoshLove-msft Apr 10, 2026
833291b
fix: use ACR admin credentials for ACI image pull instead of managed …
JoshLove-msft Apr 10, 2026
4332d9f
fix: revert pipeline to App Service to test ReadyToRun/TieredCompilat…
JoshLove-msft Apr 10, 2026
1afdac1
fix: stop copying global.json into Docker build to avoid SDK version …
JoshLove-msft Apr 10, 2026
e68f865
fix: switch to ACI deployment with ACR admin credentials
JoshLove-msft Apr 10, 2026
8527827
fix: add Azure Front Door for HTTPS termination in front of ACI
JoshLove-msft Apr 10, 2026
906295e
fix: use user-assigned managed identity for ACR pull (admin blocked b…
JoshLove-msft Apr 10, 2026
bcdf043
fix: use assignee-object-id for role assignment, increase propagation…
JoshLove-msft Apr 11, 2026
64e1e49
fix: remove role assignment from pipeline (requires manual one-time s…
JoshLove-msft Apr 11, 2026
d52f630
fix: add probe-interval-in-seconds to Front Door origin group
JoshLove-msft Apr 11, 2026
8f741d5
fix: update playground server URL to Front Door endpoint
JoshLove-msft Apr 11, 2026
263b3f7
fix: add load balancing settings to Front Door origin group
JoshLove-msft Apr 11, 2026
45ce88e
fix: complete Front Door config with all required properties from docs
JoshLove-msft Apr 11, 2026
3bc0338
fix: enable core dump collection and show dump files in /health endpoint
JoshLove-msft Apr 11, 2026
3e0160b
fix: revert to App Service deployment with core dump collection
JoshLove-msft Apr 11, 2026
cb1bf58
fix: return stderr in error response, improve core dump file search
JoshLove-msft Apr 11, 2026
97e0f38
fix: add /coredump/{filename} endpoint to download crash dumps
JoshLove-msft Apr 11, 2026
3f49098
fix: write core dumps to /home for Kudu access (Kudu can't see /tmp)
JoshLove-msft Apr 11, 2026
f848623
fix: add SSH and dotnet-dump to container for crash diagnostics
JoshLove-msft Apr 11, 2026
c0d76ca
fix: add lldb and switch to full dump for native crash analysis
JoshLove-msft Apr 11, 2026
8feeea2
fix: switch to .NET 9 (GA) to test if crash is .NET 10 preview bug
JoshLove-msft Apr 11, 2026
266acd0
fix: revert to .NET 10 (net9.0 can't build net10.0 dependencies)
JoshLove-msft Apr 11, 2026
614cdcf
fix: add test-generator.sh script to container for manual testing
JoshLove-msft Apr 11, 2026
e6438bb
fix: keep temp dir on generator failure for manual SSH debugging
JoshLove-msft Apr 11, 2026
1638fa5
fix: bundle Spector routes test data and test script in container
JoshLove-msft Apr 11, 2026
9ef3fbe
fix: move exitCode declaration before try block to fix scope error
JoshLove-msft Apr 11, 2026
b96c44a
fix: run generator in-process instead of subprocess to avoid SIGSEGV
JoshLove-msft Apr 11, 2026
48bdd12
fix: disable file locking for Roslyn mmap compatibility in App Service
JoshLove-msft Apr 11, 2026
8ea1049
fix: disable W^X enforcement and use /home for temp files
JoshLove-msft Apr 11, 2026
4eb58e8
fix: revert to subprocess approach (in-process breaks MEF plugin disc…
JoshLove-msft Apr 11, 2026
6b17cf9
fix: add --skip-post-processing flag to bypass Roslyn compilation
JoshLove-msft Apr 11, 2026
8ec3ec5
fix: add diagnostic log for SkipPostProcessing flag, fix log message
JoshLove-msft Apr 11, 2026
916bdab
fix: switch to Windows container to avoid Linux sandbox SIGSEGV
JoshLove-msft Apr 11, 2026
0d3d302
fix: revert to Linux, add granular diagnostic logging to CSharpGen
JoshLove-msft Apr 11, 2026
95bb043
fix: run AddGeneratedFile sequentially with per-file logging
JoshLove-msft Apr 11, 2026
4400390
fix: use stderr with flush for diagnostic logs to avoid buffering
JoshLove-msft Apr 11, 2026
c36b90a
fix: add per-step logging (ProcessTypeForBackCompat, Write, AddFile)
JoshLove-msft Apr 11, 2026
b6c01c6
fix: increase default stack size to 8MB for deep expression tree recu…
JoshLove-msft Apr 11, 2026
dcc11cf
fix: replace ArrayPool.Shared with private pool to avoid mmap in sandbox
JoshLove-msft Apr 11, 2026
3706ae5
fix: run Write() on dedicated thread with 64MB stack to diagnose crash
JoshLove-msft Apr 12, 2026
85ce8cb
fix: use ReadyToRun pre-compilation to minimize JIT at runtime
JoshLove-msft Apr 12, 2026
7ce99c2
fix: replace UnsafeBufferSequence with safe List-based implementation
JoshLove-msft Apr 12, 2026
f3c6960
fix: revert to dotnet build (publish misses ClientModel plugin DLL)
JoshLove-msft Apr 12, 2026
34ae6c5
fix: remove stack size and JIT workaround env vars from Dockerfile
JoshLove-msft Apr 12, 2026
41e62e5
fix: revert UnsafeBufferSequence, add per-method logging and dump col…
JoshLove-msft Apr 12, 2026
c092798
fix: add lldb-18 to Dockerfile
JoshLove-msft Apr 12, 2026
d6bd7ba
fix: remove dedicated thread so crash happens on threadpool (preserve…
JoshLove-msft Apr 12, 2026
464ed4c
fix: pre-warm ParameterProvider JIT compilation to avoid dispatch crash
JoshLove-msft Apr 12, 2026
b600c54
fix: log argument types in WriteArguments to identify crash target
JoshLove-msft Apr 12, 2026
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
165 changes: 134 additions & 31 deletions eng/emitters/pipelines/templates/stages/emitter-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ parameters:
type: boolean
default: false

# The npm script to run to build the emitter for playground bundling.
# Default is "build". C# uses "build:emitter" to skip the .NET generator build.
- name: PlaygroundBundleBuildScript
type: string
default: "build"

# Path to a Dockerfile (relative to PackagePath) for the playground server.
# When set alongside UploadPlaygroundBundle, the server container is built and
# deployed to Azure Container Apps after publishing.
- name: PlaygroundServerDockerfile
type: string
default: ""

# Azure Container Apps name for the playground server.
- name: PlaygroundServerAppName
type: string
default: ""

stages:
# Build stage
# Responsible for building the autorest generator and typespec emitter packages
Expand Down Expand Up @@ -294,37 +312,29 @@ stages:
npmrcPath: $(buildArtifactsPath)/packages/.npmrc
registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/

# publish to devops feed
- pwsh: |
$packageFiles = Get-ChildItem -Path . -Filter '*.tgz'
foreach ($file in $packageFiles.Name) {
Write-Host "npm publish $file --verbose --access public"
npm publish $file --verbose --access public
}
displayName: Publish to DevOps feed
workingDirectory: $(buildArtifactsPath)/packages
- ${{ each package in parameters.Packages }}:
- ${{ if eq(package.type, 'npm') }}:
- pwsh: |
$file = Resolve-Path "${{ package.file }}"
Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages"
npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages
displayName: Publish ${{ package.name }} to internal feed
workingDirectory: $(buildArtifactsPath)/packages

# If publishing publicly, also publish to npmjs.org
- ${{ if eq(parameters.Publish, 'public') }}:
# publish to npmjs.org using ESRP
- task: EsrpRelease@11
inputs:
displayName: Publish to npmjs.org
ConnectedServiceName: Azure SDK PME Managed Identity
ClientId: 5f81938c-2544-4f1f-9251-dd9de5b8a81b
DomainTenantId: 975f013f-7f24-47e8-a7d3-abc4752bf346
UseManagedIdentity: true
KeyVaultName: kv-azuresdk-codesign
SignCertName: azure-sdk-esrp-release-certificate
Intent: PackageDistribution
ContentType: npm
FolderLocation: $(buildArtifactsPath)/packages
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
Approvers: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
ServiceEndpointUrl: https://api.esrp.microsoft.com
# cspell:ignore ESRPRELPACMANTEST
MainPublisher: ESRPRELPACMANTEST

- pwsh: |
"//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" | Out-File '.npmrc'
displayName: Authenticate .npmrc for npmjs.org
workingDirectory: $(buildArtifactsPath)/packages
- ${{ each package in parameters.Packages }}:
- ${{ if eq(package.type, 'npm') }}:
- pwsh: |
$file = Resolve-Path "${{ package.file }}"
Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages"
npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages
displayName: Publish ${{ package.name }} to npmjs.org
workingDirectory: $(buildArtifactsPath)/packages
- ${{ if parameters.HasNugetPackages }}:
- task: 1ES.PublishNuget@1
displayName: Publish Nuget packages
Expand All @@ -347,14 +357,27 @@ stages:
LanguageShortName: ${{ parameters.LanguageShortName }}

- ${{ if parameters.UploadPlaygroundBundle }}:
- script: npm install -g pnpm
displayName: Install pnpm for playground bundle upload
- script: |
PUBLISHED_VERSION=$(ls $(buildArtifactsPath)/packages/*.tgz | head -1 | sed 's/.*-\([0-9].*\)\.tgz/\1/')
echo "Published version: $PUBLISHED_VERSION"
if [ -n "$PUBLISHED_VERSION" ]; then
node -e "const p=require('./package.json'); p.version='$PUBLISHED_VERSION'; require('fs').writeFileSync('./package.json', JSON.stringify(p, null, 2)+'\n')"
echo "Updated package.json version to $PUBLISHED_VERSION"
fi
displayName: Sync version from published package
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.PackagePath }}
- script: npm ci
displayName: Install emitter dependencies for playground bundle
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.PackagePath }}
- script: npm run build
- script: npm run ${{ parameters.PlaygroundBundleBuildScript }}
displayName: Build emitter for playground bundle
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.PackagePath }}
- script: npm install -g pnpm
displayName: Install pnpm for playground bundle upload
- task: NodeTool@0
displayName: Install Node.js for playground bundle
inputs:
versionSpec: "22.x"
- script: pnpm install --filter "@typespec/bundle-uploader..."
displayName: Install bundle-uploader dependencies
workingDirectory: $(Build.SourcesDirectory)
Expand All @@ -369,6 +392,86 @@ stages:
inlineScript: node ./eng/emitters/scripts/upload-bundled-emitter.js ${{ parameters.PackagePath }}
workingDirectory: $(Build.SourcesDirectory)

- ${{ if and(parameters.UploadPlaygroundBundle, ne(parameters.PlaygroundServerDockerfile, '')) }}:
- task: AzureCLI@1
displayName: Build and deploy playground server
inputs:
azureSubscription: "Azure SDK Engineering System"
scriptLocation: inlineScript
inlineScript: |
set -e
REGISTRY="typespecacr"
RESOURCE_GROUP="typespec"
APP_NAME="${{ parameters.PlaygroundServerAppName }}"
IMAGE="$REGISTRY.azurecr.io/$APP_NAME:$(Build.BuildId)"

# Create ACR if it doesn't exist
if ! az acr show --name "$REGISTRY" --resource-group "$RESOURCE_GROUP" &>/dev/null; then
echo "Creating container registry: $REGISTRY"
az acr create --name "$REGISTRY" --resource-group "$RESOURCE_GROUP" --sku Basic --admin-enabled false
fi

# Build and push Docker image
echo "Building Docker image: $IMAGE"
CONTEXT="$(Build.SourcesDirectory)/${{ parameters.PackagePath }}"
az acr build \
--registry "$REGISTRY" \
--image "$APP_NAME:$(Build.BuildId)" \
--file "$CONTEXT/${{ parameters.PlaygroundServerDockerfile }}" \
"$CONTEXT"

# Deploy to Azure App Service
PLAN_NAME="typespec-playground-plan"

# Create App Service plan if it doesn't exist
if ! az appservice plan show --name "$PLAN_NAME" --resource-group "$RESOURCE_GROUP" &>/dev/null; then
echo "Creating App Service plan: $PLAN_NAME"
az appservice plan create \
--name "$PLAN_NAME" \
--resource-group "$RESOURCE_GROUP" \
--is-linux \
--sku P1v3
fi

# Create or update Web App
if az webapp show --name "$APP_NAME" --resource-group "$RESOURCE_GROUP" &>/dev/null; then
echo "Updating Web App: $APP_NAME"
else
echo "Creating Web App: $APP_NAME"
az webapp create \
--name "$APP_NAME" \
--resource-group "$RESOURCE_GROUP" \
--plan "$PLAN_NAME" \
--container-image-name "$IMAGE" \
--container-registry-url "https://$REGISTRY.azurecr.io"
fi

# Ensure managed identity and ACR pull access
az webapp identity assign --name "$APP_NAME" --resource-group "$RESOURCE_GROUP" 2>/dev/null || true
PRINCIPAL_ID=$(az webapp identity show --name "$APP_NAME" --resource-group "$RESOURCE_GROUP" --query principalId -o tsv)
ACR_ID=$(az acr show --name "$REGISTRY" --resource-group "$RESOURCE_GROUP" --query id -o tsv)
az role assignment create --assignee-object-id "$PRINCIPAL_ID" --assignee-principal-type ServicePrincipal --role AcrPull --scope "$ACR_ID" 2>/dev/null || true
az webapp config set --name "$APP_NAME" --resource-group "$RESOURCE_GROUP" \
--generic-configurations '{"acrUseManagedIdentityCreds": true}'

# Update container image
az webapp config container set \
--name "$APP_NAME" \
--resource-group "$RESOURCE_GROUP" \
--container-image-name "$IMAGE" \
--container-registry-url "https://$REGISTRY.azurecr.io"

# Configure app settings
az webapp config appsettings set \
--name "$APP_NAME" \
--resource-group "$RESOURCE_GROUP" \
--settings \
WEBSITES_PORT=5174 \
PLAYGROUND_URLS="https://typespec.io,https://tspwebsitepr.z22.web.core.windows.net,https://cadlplayground.z22.web.core.windows.net"

echo "Deployed to https://$APP_NAME.azurewebsites.net"
workingDirectory: $(Build.SourcesDirectory)

templateContext:
outputs:
- output: pipelineArtifact
Expand Down
2 changes: 2 additions & 0 deletions packages/bundle-uploader/src/upload-browser-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class TypeSpecBundledPackageUploader {
await blob.upload(content, content.length, {
blobHTTPHeaders: {
blobContentType: "application/json; charset=utf-8",
blobCacheControl: "no-cache, max-age=0",
},
});
}
Expand All @@ -145,6 +146,7 @@ export class TypeSpecBundledPackageUploader {
await blob.upload(content, content.length, {
blobHTTPHeaders: {
blobContentType: "application/json; charset=utf-8",
blobCacheControl: "no-cache, max-age=0",
},
});
}
Expand Down
7 changes: 7 additions & 0 deletions packages/http-client-csharp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
emitter/
.tspd/
*.md
*.tsp
package-lock.json
12 changes: 11 additions & 1 deletion packages/http-client-csharp/emitter/src/code-model-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ import { CSharpEmitterContext } from "./sdk-context.js";
import { CodeModel } from "./type/code-model.js";
import { Configuration } from "./type/configuration.js";

/**
* Serializes the code model to a JSON string with reference tracking.
* @param context - The CSharp emitter context
* @param codeModel - The code model to serialize
* @beta
*/
export function serializeCodeModel(context: CSharpEmitterContext, codeModel: CodeModel): string {
return prettierOutput(JSON.stringify(buildJson(context, codeModel), transformJSONProperties, 2));
}

/**
* Writes the code model to the output folder. Should only be used by autorest.csharp.
* @param context - The CSharp emitter context
Expand All @@ -22,7 +32,7 @@ export async function writeCodeModel(
) {
await context.program.host.writeFile(
resolvePath(outputFolder, tspOutputFileName),
prettierOutput(JSON.stringify(buildJson(context, codeModel), transformJSONProperties, 2)),
serializeCodeModel(context, codeModel),
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

// Browser implementation: sends code model to a playground server via fetch.

import { resolvePath } from "@typespec/compiler";
import { CSharpEmitterContext } from "./sdk-context.js";
import type { GenerateOptions } from "./emit-generate.js";

export async function generate(
sdkContext: CSharpEmitterContext,
codeModelJson: string,
configJson: string,
options: GenerateOptions,
): Promise<void> {
const serverUrl = (globalThis as any).__TYPESPEC_PLAYGROUND_SERVER_URL__;

if (!serverUrl) {
throw new Error(
"C# code generation requires a playground server. " +
"No server URL is configured. Set globalThis.__TYPESPEC_PLAYGROUND_SERVER_URL__ " +
"to the URL of a running C# playground server.",
);
}

const response = await fetch(`${serverUrl}/generate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
codeModel: codeModelJson,
configuration: configJson,
generatorName: options.generatorName,
}),
});

if (!response.ok) {
const errorText = await response.text();
throw new Error(`Playground server error (${response.status}): ${errorText}`);
}

const result: { files: Array<{ path: string; content: string }> } = await response.json();

for (const file of result.files) {
await sdkContext.program.host.writeFile(
resolvePath(options.outputFolder, file.path),
file.content,
);
}
}
Loading
Loading