Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Visual Studio Extension #2854

Merged
merged 39 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e4eb591
TypeSpec vs extension
timotheeguerin Jan 29, 2024
1146a4a
Extension test
timotheeguerin Jan 29, 2024
e43a970
fix
timotheeguerin Jan 29, 2024
fb15d5c
Fix
timotheeguerin Jan 29, 2024
0e6f0ba
test
timotheeguerin Jan 29, 2024
407ba26
fix.
timotheeguerin Jan 29, 2024
fc723f4
.
timotheeguerin Jan 29, 2024
1c50fad
.
timotheeguerin Jan 29, 2024
bce0ddc
dont need install?
timotheeguerin Jan 29, 2024
72896b3
,.
timotheeguerin Jan 29, 2024
0e4771f
logo
timotheeguerin Jan 29, 2024
d3e3389
fix publisher
timotheeguerin Jan 30, 2024
ef59af3
.
timotheeguerin Jan 30, 2024
f7620fb
Test icon
timotheeguerin Jan 30, 2024
6510666
.
timotheeguerin Jan 30, 2024
2ec26c9
wrong
timotheeguerin Jan 30, 2024
9961f50
test
timotheeguerin Jan 30, 2024
b38349a
test with png
timotheeguerin Jan 30, 2024
4a81e61
test withthis
timotheeguerin Jan 30, 2024
5cc7bad
Fix
timotheeguerin Jan 30, 2024
f1ac431
readme
timotheeguerin Jan 30, 2024
acb11bf
fix
timotheeguerin Jan 30, 2024
39f4894
fix
timotheeguerin Jan 30, 2024
79eae5d
test with vsixID
timotheeguerin Jan 30, 2024
6ec6ed3
test
timotheeguerin Jan 30, 2024
386b968
test
timotheeguerin Jan 30, 2024
deafc76
.
timotheeguerin Jan 30, 2024
77f71ae
test
timotheeguerin Jan 30, 2024
24f5291
stderr to stdout
timotheeguerin Jan 30, 2024
b67d4e3
try with exit
timotheeguerin Jan 30, 2024
248ee16
test
timotheeguerin Jan 30, 2024
431fe2f
fix yaml
timotheeguerin Jan 30, 2024
0c35d5c
fix wrong link
timotheeguerin Jan 30, 2024
a779993
add template back
timotheeguerin Jan 30, 2024
9fede49
Make names consistent
timotheeguerin Jan 30, 2024
33f1e51
rename
timotheeguerin Jan 30, 2024
39db6c9
no changelog
timotheeguerin Jan 30, 2024
bc0785d
changelog
timotheeguerin Jan 30, 2024
bbf65dc
tweak
timotheeguerin Jan 30, 2024
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
149 changes: 94 additions & 55 deletions eng/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ jobs:
artifact: vscode-extension
displayName: Publish VSCode extension(.vsix) as pipeline artifacts

- task: CopyFiles@2
inputs:
SourceFolder: "$(Build.SourcesDirectory)/packages/typespec-vs"
Contents: "*.vsix"
TargetFolder: "$(Build.ArtifactStagingDirectory)/vs-extension"

- publish: $(Build.ArtifactStagingDirectory)/vs-extension
artifact: vs-extension
displayName: Publish VS extension(.vsix) as pipeline artifacts

- task: AzureCLI@1
displayName: "Publish bundled packages to package storage"
inputs:
Expand All @@ -71,8 +81,36 @@ jobs:
--source "./packages/playground-website/dist/" ^
--overwrite

- job: publish_vscode
displayName: Publish VSCode extension
# - job: publish_vscode
timotheeguerin marked this conversation as resolved.
Show resolved Hide resolved
# displayName: Publish VSCode extension
# dependsOn: npm_stable
# pool:
# name: azsdk-pool-mms-ubuntu-2004-general
# vmImage: ubuntu-20.04

# steps:
# - download: current
# artifact: vscode-extension
# displayName: Download VSCode extension(.vsix) from pipeline artifacts

# - script: |
# vsix="$(find $(Pipeline.Workspace)/vscode-extension -type f -iname "typespec-vscode-*.vsix" )"

# [ -z "$vsix" ] && echo "Error: Couldn't find vsix" && exit 1

# echo "Found core package $vsix"
# displayName: Find packages path

# - template: ./templates/install.yml

# - script: npm run deploy -- --skip-duplicate --packagePath $(Pipeline.Workspace)/vscode-extension/typespec-vscode-*.vsix
# displayName: Publish
# workingDirectory: packages/typespec-vscode
# env:
# VSCE_PAT: $(azuresdk-devdiv-openapi-extension-marketplace-devops-pat)

- job: publish_vs
displayName: Publish VS extension
dependsOn: npm_stable
pool:
name: azsdk-pool-mms-ubuntu-2004-general
Expand All @@ -89,64 +127,65 @@ jobs:
[ -z "$vsix" ] && echo "Error: Couldn't find vsix" && exit 1

echo "Found core package $vsix"
echo "Found modelerfour package $modelerfourPkg"
displayName: Find packages path

- template: ./templates/install.yml

- script: npm run deploy -- --skip-duplicate --packagePath $(Pipeline.Workspace)/vscode-extension/typespec-vscode-*.vsix
- script: |
VsixPublisher.exe login -personalAccessToken $(azuresdk-devdiv-openapi-extension-marketplace-devops-pat) -publisherName typespec
VsixPublisher.exe publish -publisher "typespec" -payload "$(Pipeline.Workspace)/vscode-extension/typespec-vscode-*.vsix" -publishManifest "publish-manifest.json"
displayName: Publish
workingDirectory: packages/typespec-vscode
workingDirectory: packages/typespec-vs
env:
VSCE_PAT: $(azuresdk-devdiv-openapi-extension-marketplace-devops-pat)

- job: npm_dev
dependsOn: npm_stable
displayName: Npm publish dev version
pool:
name: azsdk-pool-mms-win-2022-general
vmImage: windows-2022

variables:
TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build

steps:
- template: ./templates/install.yml
- template: ./templates/build.yml

- script: node ./packages/internal-build-utils/cmd/cli.js bump-version-preview .
displayName: Bump version to prerelease targets

- script: npm run gen-manifest
displayName: Regen manifest for compiler
workingDirectory: ./packages/compiler

- script: |
pnpm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
pnpm -r publish --access public --no-git-checks --tag next
displayName: Publish packages

- job: docker
displayName: Docker build and publish
variables:
imageName: "azsdkengsys.azurecr.io/typespec"
pool:
name: azsdk-pool-mms-ubuntu-2004-general
vmImage: ubuntu-20.04
steps:
- task: Docker@1
displayName: login
inputs:
azureSubscriptionEndpoint: "AzureSDKEngKeyVault Secrets"
azureContainerRegistry: azsdkengsys.azurecr.io
command: login

- script: |
docker build -f ./docker/Dockerfile \
-t $(imageName):latest \
-t $(imageName):alpine \
.
displayName: "Build"

- script: docker push $(imageName) --all-tags
displayName: "Push"
# - job: npm_dev
# dependsOn: npm_stable
# displayName: Npm publish dev version
# pool:
# name: azsdk-pool-mms-win-2022-general
# vmImage: windows-2022

# variables:
# TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build

# steps:
# - template: ./templates/install.yml
# - template: ./templates/build.yml

# - script: node ./packages/internal-build-utils/cmd/cli.js bump-version-preview .
# displayName: Bump version to prerelease targets

# - script: npm run gen-manifest
# displayName: Regen manifest for compiler
# workingDirectory: ./packages/compiler

# - script: |
# pnpm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
# pnpm -r publish --access public --no-git-checks --tag next
# displayName: Publish packages

# - job: docker
# displayName: Docker build and publish
# variables:
# imageName: "azsdkengsys.azurecr.io/typespec"
# pool:
# name: azsdk-pool-mms-ubuntu-2004-general
# vmImage: ubuntu-20.04
# steps:
# - task: Docker@1
# displayName: login
# inputs:
# azureSubscriptionEndpoint: "AzureSDKEngKeyVault Secrets"
# azureContainerRegistry: azsdkengsys.azurecr.io
# command: login

# - script: |
# docker build -f ./docker/Dockerfile \
# -t $(imageName):latest \
# -t $(imageName):alpine \
# .
# displayName: "Build"

# - script: docker push $(imageName) --all-tags
# displayName: "Push"
15 changes: 12 additions & 3 deletions packages/typespec-vs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# TypeSpec Language Support for Visual Studio

This package provides [TypeSpec](https://github.com/microsoft/typespec) language support for Visual Studio 2019 and 2022.
[Repository](https://github.com/microsoft/typespec) | [Documentation](https://typespec.io/docs) | [Issues](https://github.com/microsoft/typespec/issues) | [Samples](https://github.com/microsoft/typespec/tree/main/packages/samples/specs)

See https://github.com/microsoft/typespec#installing-visual-studio-extension for installation instructions.
This provides provides [TypeSpec](https://github.com/microsoft/typespec) language support for VS Code.

**NOTE**: The npm package is used as an implementation detail of the `tsp vs` command that installs the Visual Studio TypeSpec extension, and not intended to be used for other purposes.
## Features

- Live diagnostic reporting
- Syntax highlighting
- Code completion
- Code folding
- Formatting
- Hover info
- Rename refactoring
- Go to definition

## Configure TYPESPEC Visual Studio Extension

Expand Down
14 changes: 14 additions & 0 deletions packages/typespec-vs/publishManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json.schemastore.org/vsix-publish",
"categories": ["build", "coding"], // The categories of the extension. Between 1 and 3 categories are required.
"identity": {
"internalName": "TypeSpec" // If not specified, we try to generate the name from the display name of the extension in the vsixmanifest file.
// Required if the display name is not the actual name of the extension.
},
"overview": "README.md", // Path to the "readme" file that gets uploaded to the Marketplace. Required.
"priceCategory": "free", // Either "free", "trial", or "paid". Defaults to "free".
"publisher": "typespec", // The name of the publisher. Required.
"private": false, // Specifies whether or not the extension should be public when uploaded. Defaults to false.
"qna": true, // Specifies whether or not the extension should have a Q&A section. Defaults to true.
"repo": "https://github.com/microsoft/typespec" // Not required.
}
Binary file added packages/typespec-vs/src/Resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/typespec-vs/src/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>TypeSpec Language Support for Visual Studio</Description>
<MoreInfo>https://github.com/microsoft/typespec</MoreInfo>
<License>LICENSE</License>
<Icon>Resources/logo.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,)">
Expand Down
Loading