1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
1
+ /* eslint-disable header/header */
2
+
5
3
const path = require ( 'path' ) ;
6
4
const fs = require ( 'fs' ) ;
7
5
const https = require ( 'https' ) ;
8
6
9
7
const pickKeys = [
10
- 'extensionTips' , 'extensionImportantTips' , 'keymapExtensionTips' ,
11
- 'configBasedExtensionTips' , 'extensionKeywords' , 'extensionAllowedBadgeProviders' ,
12
- 'extensionAllowedBadgeProvidersRegex' , 'extensionAllowedProposedApi' ,
13
- 'extensionEnabledApiProposals' , 'extensionKind' , 'languageExtensionTips'
8
+ 'extensionTips' ,
9
+ 'extensionImportantTips' ,
10
+ 'keymapExtensionTips' ,
11
+ 'configBasedExtensionTips' ,
12
+ 'extensionKeywords' ,
13
+ 'extensionAllowedBadgeProviders' ,
14
+ 'extensionAllowedBadgeProvidersRegex' ,
15
+ 'extensionAllowedProposedApi' ,
16
+ 'extensionEnabledApiProposals' ,
17
+ 'extensionKind' ,
18
+ 'languageExtensionTips'
14
19
] ;
15
20
16
- async function start ( ) {
17
- const releasePath = path . join ( __dirname , '../product-release.json' ) ;
18
- if ( ! fs . existsSync ( releasePath ) ) {
19
- console . error ( 'product-release.json is not exists, please copy product.json from VSCode Desktop Stable' ) ;
20
- return ;
21
- }
22
- const branchProduct = JSON . parse ( fs . readFileSync ( path . join ( __dirname , '../product.json' ) ) . toString ( ) ) ;
23
- const releaseProduct = JSON . parse ( fs . readFileSync ( releasePath ) . toString ( ) ) ;
24
- const tmpProductPath = path . join ( __dirname , '../product-tmp.json' ) ;
25
- for ( let key of pickKeys ) {
26
- branchProduct [ key ] = releaseProduct [ key ] ;
27
- }
28
- fs . writeFileSync ( tmpProductPath , JSON . stringify ( branchProduct , null , 4 ) ) ;
29
-
30
- if ( keysDiff ( branchProduct , releaseProduct ) ) {
31
- // allow-any-unicode-next-line
32
- console . log ( '📦 check if you need these keys or not' ) ;
33
- }
34
- await checkProductExtensions ( branchProduct ) ;
35
- // allow-any-unicode-next-line
36
- console . log ( '📦 you can copy product-tmp.json file to product.json file and resolve logs above by yourself' ) ;
37
- // allow-any-unicode-next-line
38
- console . log ( '✅ done' ) ;
39
- }
40
-
41
21
const AllowMissKeys = [
42
22
'win32SetupExeBasename' ,
43
23
'darwinCredits' ,
@@ -88,6 +68,60 @@ const AllowMissKeys = [
88
68
'darwinUniversalAssetId' ,
89
69
] ;
90
70
71
+ const propiertaryExtension = [
72
+ 'ms-vscode-remote.remote-containers' ,
73
+ 'ms-dotnettools.csharp' ,
74
+ 'ms-vscode.cpptools-extension-pack' ,
75
+ 'ms-azure-devops.azure-pipelines' ,
76
+ 'msazurermtools.azurerm-vscode-tools' ,
77
+ 'ms-azuretools.vscode-bicep' ,
78
+ 'usqlextpublisher.usql-vscode-ext' ,
79
+ 'ms-azuretools.vscode-azureterraform' ,
80
+ 'VisualStudioExptTeam.vscodeintellicode-completions' ,
81
+ 'ms-vsliveshare.vsliveshare' ,
82
+ 'ms-toolsai.vscode-ai-remote' ,
83
+ 'GitHub.codespaces' ,
84
+ 'ms-vscode.azure-repos' ,
85
+ 'ms-vscode.remote-repositories' ,
86
+ 'ms-vscode-remote.remote-wsl' ,
87
+ 'ms-vscode-remote.remote-ssh' ,
88
+ 'GitHub.copilot' ,
89
+ 'GitHub.copilot-nightly' ,
90
+ 'GitHub.remotehub' ,
91
+ 'GitHub.remotehub-insiders' ,
92
+ 'ms-python.vscode-pylance' ,
93
+ 'ms-vscode.azure-sphere-tools-ui' ,
94
+ 'ms-azuretools.vscode-azureappservice' ,
95
+ ] ;
96
+
97
+ async function start ( ) {
98
+ const localPath = path . join ( __dirname , '../product.json' ) ;
99
+ const releasePath = path . join ( __dirname , '../product-release.json' ) ;
100
+ if ( ! fs . existsSync ( releasePath ) ) {
101
+ console . error ( 'product-release.json is not exists, please copy product.json from VSCode Desktop Stable' ) ;
102
+ return ;
103
+ }
104
+
105
+ const branchProduct = JSON . parse ( await fs . promises . readFile ( localPath , { encoding : 'utf8' } ) ) ;
106
+ const releaseProduct = JSON . parse ( await fs . promises . readFile ( releasePath , { encoding : 'utf8' } ) ) ;
107
+ const tmpProductPath = path . join ( __dirname , '../product-tmp.json' ) ;
108
+ for ( let key of pickKeys ) {
109
+ branchProduct [ key ] = releaseProduct [ key ] ;
110
+ }
111
+
112
+ await fs . promises . writeFile ( tmpProductPath , JSON . stringify ( branchProduct , null , '\t' ) ) ;
113
+
114
+ if ( keysDiff ( branchProduct , releaseProduct ) ) {
115
+ // allow-any-unicode-next-line
116
+ console . log ( '📦 check if you need these keys or not' ) ;
117
+ }
118
+ await checkProductExtensions ( branchProduct ) ;
119
+ // allow-any-unicode-next-line
120
+ console . log ( '📦 you can copy product-tmp.json file to product.json file and resolve logs above by yourself' ) ;
121
+ // allow-any-unicode-next-line
122
+ console . log ( '✅ done' ) ;
123
+ }
124
+
91
125
function keysDiff ( branch , release ) {
92
126
const toMap = ( ret , e ) => {
93
127
ret [ e ] = true ;
@@ -130,6 +164,10 @@ async function checkProductExtensions(product) {
130
164
131
165
// Check if extensions exists in openvsx
132
166
for ( let id of uniqueExtIds ) {
167
+ if ( propiertaryExtension . includes ( id ) ) {
168
+ continue ;
169
+ }
170
+
133
171
const openvsxUrl = `https://open-vsx.org/api/${ id . replace ( / \. / g, '/' ) } ` ;
134
172
const ok = await urlExists ( openvsxUrl ) ;
135
173
if ( ! ok ) {
@@ -149,4 +187,4 @@ async function urlExists(url) {
149
187
} ) ;
150
188
}
151
189
152
- start ( ) . then ( ) . catch ( console . error ) ;
190
+ start ( ) . catch ( console . error ) ;
0 commit comments