Skip to content

Commit 6b7a120

Browse files
nturinskiMRayermannMSFTMicroFish91
authored
Migration work for VS Code.dev (#288)
* Apply changes for vscode.dev * Changes for vscode.dev * Remove comment * Publish web bundle and package.json to a blob container for testing on vscode.dev (#253) * Fix edit target port (#258) Originally authored by: Alex Weininger Cherry-picked for use by: Matthew Fisher * Update the acr sdk * Fix some merge errors * Fix activityUtils * Re-add missing type * Re-add experimental service * Changes using the new azext-utils package * Fix some build/lint errors * Comment, remove eslint disable, suppressCleanWebpack * Ignore constants file used by fs-extra * Fix up some dependency stuff * Remove some unneeded devDependencies * Fix package-lock.json to fix `npm ci` --------- Co-authored-by: Matthew Rayermann <marayerm@microsoft.com> Co-authored-by: Matthew Fisher <40250218+MicroFish91@users.noreply.github.com>
1 parent e288285 commit 6b7a120

File tree

19 files changed

+1195
-985
lines changed

19 files changed

+1195
-985
lines changed

.azure-pipelines/common/package.yml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,72 @@ steps:
1515
displayName: 'Copy vsix to staging directory'
1616
inputs:
1717
Contents: '**/*.vsix'
18-
TargetFolder: '$(build.artifactstagingdirectory)'
18+
TargetFolder: '$(build.artifactstagingdirectory)/vsix'
19+
20+
- task: CopyFiles@2
21+
displayName: 'Copy web bundle to staging directory'
22+
inputs:
23+
Contents: |
24+
dist/web/*.js*
25+
package.json
26+
package.nls.json
27+
resources/**
28+
TargetFolder: '$(build.artifactstagingdirectory)/web/'
1929

2030
- task: PublishBuildArtifacts@1
2131
displayName: 'Publish artifacts: vsix'
2232
inputs:
23-
PathtoPublish: '$(build.artifactstagingdirectory)'
33+
PathtoPublish: '$(build.artifactstagingdirectory)/vsix'
2434
ArtifactName: vsix
2535
# Only publish vsix from linux build since we use this to release and want to stay consistent
2636
condition: and(eq(variables['Agent.OS'], 'Linux'), ne(variables['System.PullRequest.IsFork'], 'True'))
37+
38+
- task: AzureFileCopy@4
39+
# If AzureFileCopy ever supports not using account keys we should consider making use of it.
40+
# If we do, we should also consider moving to user delegatation SAS in the generate SAS step.
41+
# See: https://github.com/microsoft/azure-pipelines-tasks/issues/15610
42+
displayName: 'Upload web to blob storage'
43+
inputs:
44+
SourcePath: '$(build.artifactstagingdirectory)/web/*'
45+
# This is a service connection for the ADO project. Can be managed under ADO project settings.
46+
azureSubscription: ms-azuretools-vscode-dot-dev-connection
47+
Destination: AzureBlob
48+
storage: $(WEB_BUILDS_STG_ACCT)
49+
ContainerName: $(WEB_BUILDS_CONTAINER)
50+
BlobPrefix: '$(build.buildnumber)'
51+
# Only do steps for publishing web bits on Windows as AzureFileCopy is only supported on Windows
52+
# See: https://github.com/microsoft/azure-pipelines-tasks/issues/8920
53+
condition: and(eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['System.PullRequest.IsFork'], 'True'))
54+
55+
- task: AzureCLI@2
56+
displayName: 'Generate SAS to web'
57+
inputs:
58+
# This is a service connection for the ADO project. Can be managed under ADO project settings.
59+
azureSubscription: ms-azuretools-vscode-dot-dev-connection
60+
scriptType: 'ps'
61+
scriptLocation: 'inlineScript'
62+
inlineScript: |
63+
$sasToken = az storage container generate-sas `
64+
--account-name $(WEB_BUILDS_STG_ACCT) `
65+
--name $(WEB_BUILDS_CONTAINER) `
66+
--permissions r `
67+
--expiry ((Get-Date).AddDays(30)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK") `
68+
--auth-mode key `
69+
--out tsv
70+
# Replace all % with %25 so vscode.dev does not re-encode the URL thus breaking it.
71+
$sasToken = $sasToken -replace ("%", "%25")
72+
$extensionRootUrl = "https://$(WEB_BUILDS_STG_ACCT).blob.core.windows.net/$(WEB_BUILDS_CONTAINER)/" + "$(build.buildnumber)" + "/?" + $sasToken
73+
$extensionRootUrl | Out-File -FilePath '$(build.artifactstagingdirectory)/web-sas.txt'
74+
echo $extensionRootUrl
75+
# Only do steps for publishing web bits on Windows as AzureFileCopy is only supported on Windows
76+
# See: https://github.com/microsoft/azure-pipelines-tasks/issues/8920
77+
condition: and(eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['System.PullRequest.IsFork'], 'True'))
78+
79+
- task: PublishBuildArtifacts@1
80+
displayName: 'Publish artifacts: web-sas'
81+
inputs:
82+
PathtoPublish: '$(build.artifactstagingdirectory)/web-sas.txt'
83+
ArtifactName: web-sas
84+
# Only do steps for publishing web bits on Windows as AzureFileCopy is only supported on Windows
85+
# See: https://github.com/microsoft/azure-pipelines-tasks/issues/8920
86+
condition: and(eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['System.PullRequest.IsFork'], 'True'))

.azure-pipelines/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
variables:
2+
WEB_BUILDS_STG_ACCT: vscodedotdev
3+
WEB_BUILDS_CONTAINER: web-builds
24
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
35
ENABLE_LONG_RUNNING_TESTS: true
46
ENABLE_COMPLIANCE: true

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@
117117
"DEBUG_WEBPACK": "1",
118118
"ENABLE_LONG_RUNNING_TESTS": ""
119119
}
120+
},
121+
{
122+
"name": "Launch Extension Web (webpack)",
123+
"type": "extensionHost",
124+
"request": "launch",
125+
"debugWebWorkerHost": true,
126+
"runtimeExecutable": "${execPath}",
127+
"args": [
128+
"--extensionDevelopmentPath=${workspaceFolder}",
129+
"--extensionDevelopmentPath=${workspaceFolder}/../vscode-azureresourcegroups",
130+
"--extensionDevelopmentKind=web"
131+
],
132+
"outFiles": [
133+
"${workspaceFolder}/dist/web/**/*.js"
134+
],
135+
"env": {
136+
"DEBUGTELEMETRY": "v",
137+
"NODE_DEBUG": "",
138+
"DEBUG_WEBPACK": "1"
139+
}
120140
}
121141
]
122142
}

extension.bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// At runtime the tests live in dist/tests and will therefore pick up the main webpack bundle at dist/extension.bundle.js.
1717
export * from '@microsoft/vscode-azext-utils';
1818
// Export activate/deactivate for main.js
19-
export { activateInternal, deactivateInternal } from './src/extension';
19+
export { activate, deactivate } from './src/extension';
2020
export * from './src/extensionVariables';
2121

2222
// NOTE: The auto-fix action "source.organizeImports" does weird things with this file, but there doesn't seem to be a way to disable it on a per-file basis so we'll just let it happen

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
1919
const extension = require('./out/src/extension');
2020

2121
async function activate(ctx) {
22-
return await extension.activateInternal(ctx, perfStats, true /* ignoreBundle */);
22+
return await extension.activate(ctx, perfStats);
2323
}
2424

2525
async function deactivate(ctx) {
26-
return await extension.deactivateInternal(ctx, perfStats);
26+
return await extension.deactivate(ctx, perfStats);
2727
}
2828

2929
// Export as entrypoints for vscode

0 commit comments

Comments
 (0)