Skip to content

Commit

Permalink
[TypeSpec Validation] Move compile from "postinstall" to "build" (Azu…
Browse files Browse the repository at this point in the history
…re#24745)

- Compiling in "postinstall" breaks existing tools that copy "package.json" from repo root to spec folder
  • Loading branch information
mikeharder authored Jul 10, 2023
1 parent ef477cb commit 26e208d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 4 additions & 0 deletions eng/pipelines/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
displayName: npm ls -a
condition: succeededOrFailed()

- script: npm run build
displayName: npm run build
condition: succeededOrFailed()

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/contosowidgetmanager/Contoso.WidgetManager
Expand Down
13 changes: 6 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@azure-tools/typespec-azure-resource-manager": "0.31.0",
"@azure-tools/typespec-client-generator-core": "0.31.0",
"@azure-tools/typespec-providerhub": "0.31.0",
"@azure-tools/typespec-validation": "file:eng/tools/TypeSpecValidation",
"@typespec/compiler": "0.45.2",
"@typespec/http": "0.45.0",
"@typespec/openapi": "0.45.0",
Expand All @@ -20,11 +21,10 @@
"@azure/avocado": "^0.8.4",
"@types/prettier": "^2.7.2",
"prettier": "^2.8.8",
"typescript": "~5.0.4",
"typespec-validation": "file:eng/tools/TypeSpecValidation"
"typescript": "~5.0.4"
},
"scripts": {
"postinstall": "npx --no tsc -- -p eng/tools/TypeSpecValidation"
"build": "npx --no tsc -- -p eng/tools/TypeSpecValidation"
},
"private": true
}

0 comments on commit 26e208d

Please sign in to comment.