From 8033f60602d93b165907c5403e87091afda5b59d Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:31:25 +0800 Subject: [PATCH] Support sample.env generation in rlc-common for typespec-ts (#2845) * Support sample.env generation in rlc-common for typespec-ts * lint fix * update * update * update * update * Update index.ts * Update buildSampleEnvFile.ts * update --------- Co-authored-by: Mary Gao --- .../src/generators/samples/sampleEnv.hbs | 5 +---- .../generated/additionalProperties/sample.env | 5 +---- .../generated/datasearch/sample.env | 5 +---- .../generated/patterntest/sample.env | 5 +---- .../generated/bodyStringRest/sample.env | 5 +---- .../generated/dpgCustomization/sample.env | 5 +---- .../generated/headerRest/sample.env | 5 +---- .../generated/mediaTypesRest/sample.env | 5 +---- .../multipleInheritanceRest/sample.env | 5 +---- .../generated/agrifood-data-plane/sample.env | 5 +---- .../anomaly-detector-rest/sample.env | 5 +---- .../sample.env | 5 +---- .../compute-resource-manager/sample.env | 5 +---- .../keyvault-resource-manager/sample.env | 5 +---- .../generated/msi-resource-manager/sample.env | 5 +---- .../network-resource-manager/sample.env | 5 +---- .../generated/sql-resource-manager/sample.env | 5 +---- .../storage-resource-manager/sample.env | 5 +---- .../generated/web-resource-manager/sample.env | 5 +---- packages/rlc-common/src/index.ts | 1 + .../src/metadata/buildSampleEnvFile.ts | 21 +++++++++++++++++++ .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../faceai/generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../loadTest/generated/typespec-ts/sample.env | 1 + .../openai/generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../spread/generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + .../generated/typespec-ts/sample.env | 1 + packages/typespec-ts/src/index.ts | 6 ++++-- 39 files changed, 62 insertions(+), 78 deletions(-) create mode 100644 packages/rlc-common/src/metadata/buildSampleEnvFile.ts create mode 100644 packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/authoring/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/faceai/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/openai/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/spread/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/translator/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env diff --git a/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs b/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs +++ b/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env b/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env +++ b/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/datasearch/sample.env b/packages/autorest.typescript/test/integration/generated/datasearch/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/datasearch/sample.env +++ b/packages/autorest.typescript/test/integration/generated/datasearch/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/patterntest/sample.env b/packages/autorest.typescript/test/integration/generated/patterntest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/patterntest/sample.env +++ b/packages/autorest.typescript/test/integration/generated/patterntest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env b/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env b/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env b/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/rlc-common/src/index.ts b/packages/rlc-common/src/index.ts index 8d96316807..8deff693b2 100644 --- a/packages/rlc-common/src/index.ts +++ b/packages/rlc-common/src/index.ts @@ -29,6 +29,7 @@ export * from "./metadata/buildTsConfig.js"; export * from "./metadata/buildESLintConfig.js"; export * from "./metadata/buildLicenseFile.js"; export * from "./metadata/buildVitestConfig.js"; +export * from "./metadata/buildSampleEnvFile.js"; export * from "./buildSerializeHelper.js"; export * from "./helpers/apiVersionUtil.js"; export * from "./buildLogger.js"; diff --git a/packages/rlc-common/src/metadata/buildSampleEnvFile.ts b/packages/rlc-common/src/metadata/buildSampleEnvFile.ts new file mode 100644 index 0000000000..e55ac377ed --- /dev/null +++ b/packages/rlc-common/src/metadata/buildSampleEnvFile.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { RLCModel } from "../interfaces.js"; + +const sampleEnvText = ` +# Feel free to add your own environment variables. +`; + +export function buildSampleEnvFile(model: RLCModel) { + if ( + (model.options?.generateMetadata === true || + model.options?.generateSample === true) && + model.options?.flavor === "azure" + ) { + const filePath = "sample.env"; + return { + path: filePath, + content: sampleEnvText.trim() + }; + } +} diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env b/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env b/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env b/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env b/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/openai/generated/typespec-ts/sample.env b/packages/typespec-test/test/openai/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/openai/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env b/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env b/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/spread/generated/typespec-ts/sample.env b/packages/typespec-test/test/spread/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/spread/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/translator/generated/typespec-ts/sample.env b/packages/typespec-test/test/translator/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/translator/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-ts/src/index.ts b/packages/typespec-ts/src/index.ts index a5a3e7bc20..934bb3dd35 100644 --- a/packages/typespec-ts/src/index.ts +++ b/packages/typespec-ts/src/index.ts @@ -45,7 +45,8 @@ import { getClientName, hasUnexpectedHelper, isAzurePackage, - updatePackageFile + updatePackageFile, + buildSampleEnvFile } from "@azure-tools/rlc-common"; import { buildModels, buildModelsOptions } from "./modular/emitModels.js"; import { @@ -338,7 +339,8 @@ export async function $onEmit(context: EmitContext) { buildRollupConfig, buildApiExtractorConfig, buildReadmeFile, - buildLicenseFile + buildLicenseFile, + buildSampleEnvFile ]; if (option.moduleKind === "esm") { commonBuilders.push((model) => buildVitestConfig(model, "node"));