-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[keyvault-secrets] Migrate to TypeSpec (#31848)
### Packages impacted by this PR @azure/keyvault-secrets ### Issues associated with this PR #31512 ### Describe the problem that is addressed by this PR Migrates keyvault-secrets to TypeSpec
- Loading branch information
Showing
32 changed files
with
1,769 additions
and
1,997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env node | ||
|
||
const { execSync } = require("child_process"); | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
// Helper to execute shell commands and log output | ||
function execCommand(command) { | ||
try { | ||
execSync(command, { stdio: "inherit" }); | ||
} catch (error) { | ||
console.error(`Command failed: ${command}`); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
console.log("Setting up the environment..."); | ||
|
||
// Workaround for src-folder support in emitter: | ||
// End state: src/generated/* contains generated code (instead of src/generated/src/*) | ||
|
||
// Step 1: Remove all files in src/generated/* | ||
execCommand("rm -rf src/generated/*"); | ||
|
||
// Step 2: Copy tsp-location.yaml to src/generated | ||
execCommand("cp tsp-location.yaml src/generated"); | ||
|
||
// Step 3: Run tsp-client command | ||
// emitter-option as a workaround for https://github.com/Azure/azure-rest-api-specs/issues/31610 | ||
execCommand(`tsp-client update -d -o src/generated --emitter-options generateMetadata=false`); | ||
// execCommand( | ||
// "tsp-client update -d -o src/generated --tsp-config ~/workspace/azure-rest-api-specs/specification/keyvault/Security.KeyVault.Keys/tspconfig.yaml --local-spec-repo ~/workspace/azure-rest-api-specs/specification/keyvault/Security.KeyVault.Keys --repo ~/workspace/azure-rest-api-specs --commit 9561bad7d2eed94cc91aa6164d3721b8aa8699fe --emitter-options generateMetadata=false" | ||
// ); | ||
|
||
// Step 4: Move generated/src/* files to generated until src-folder is supported | ||
execCommand("mv src/generated/src/* src/generated/"); | ||
|
||
// Step 5: Remove generated/src | ||
execCommand("rm -rf src/generated/src"); | ||
|
||
// Step 6: Remove tsp-location.yaml from generated folder | ||
execCommand("rm src/generated/tsp-location.yaml"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
sdk/keyvault/keyvault-secrets/src/generated/api/keyVaultContext.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.