Skip to content

Commit

Permalink
[TypeSpecValidation] Refactor package.json (#24756)
Browse files Browse the repository at this point in the history
- Improves upon #24745
- Creates eng/tools/package.json for all EngSys tools
- Moves "postinstall" to eng/tools/TypeSpecValidation/package.json
  - Technically incorrect if the package were ever to be published to a registry
  - In practice, the best way I have found so far to use source-based tools in a TypeScript repo
  • Loading branch information
mikeharder authored Jul 11, 2023
1 parent f6bf655 commit db852c3
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 19 deletions.
4 changes: 0 additions & 4 deletions eng/pipelines/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ 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
6 changes: 5 additions & 1 deletion eng/tools/TypeSpecValidation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
},
"devDependencies": {
"@types/debug": "^4.1.8",
"@types/node": "^18.16.18"
"@types/node": "^18.16.18",
"typescript": "~5.0.4"
},
"scripts": {
"postinstall": "tsc"
}
}
5 changes: 4 additions & 1 deletion eng/tools/TypeSpecValidation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"compilerOptions": {
"target": "ES6",
"module": "Node16",
"outDir": "./dist"
"outDir": "./dist",

// override "importHelpers:true" in root tsconfig.json
"importHelpers": false
}
}
7 changes: 7 additions & 0 deletions eng/tools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "azure-rest-api-specs-eng-tools",
"devDependencies": {
"@azure-tools/typespec-validation": "file:TypeSpecValidation"
},
"private": true
}
29 changes: 20 additions & 9 deletions package-lock.json

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

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
"@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",
"@typespec/rest": "0.45.0",
"@typespec/versioning": "0.45.0",
"@azure/avocado": "^0.8.4",
"@types/prettier": "^2.7.2",
"azure-rest-api-specs-eng-tools": "file:eng/tools",
"prettier": "^2.8.8",
"typescript": "~5.0.4"
},
"scripts": {
"build": "npx --no tsc -- -p eng/tools/TypeSpecValidation"
},
"private": true
}

0 comments on commit db852c3

Please sign in to comment.