Compare commits
368 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96e2145931 | ||
|
|
5845135366 | ||
|
|
4b05fa9075 | ||
|
|
bd1f133ca5 | ||
|
|
944a8f9c72 | ||
|
|
441b57f3ca | ||
|
|
803b02be81 | ||
|
|
d76bba1458 | ||
|
|
9b40838ea3 | ||
|
|
6c98603979 | ||
|
|
0e2d1e515e | ||
|
|
bfb03d160e | ||
|
|
ff21a93e00 | ||
|
|
763080aea0 | ||
|
|
fb713e0762 | ||
|
|
a8d41a6717 | ||
|
|
34bc0efc1c | ||
|
|
23e4a30cd1 | ||
|
|
ba58b0f429 | ||
|
|
89e6e062ab | ||
|
|
33ff8ec5a3 | ||
|
|
9f4053d051 | ||
|
|
1bb9d142f1 | ||
|
|
b10bd70d67 | ||
|
|
dc2ff2295e | ||
|
|
f231d6945f | ||
|
|
8786caf630 | ||
|
|
5c520bc82e | ||
|
|
1ccf408654 | ||
|
|
76ebfe38a1 | ||
|
|
364206010b | ||
|
|
559c675164 | ||
|
|
1773dede25 | ||
|
|
fa52478ffa | ||
|
|
ae0603c041 | ||
|
|
a364af5c4c | ||
|
|
6b76611c93 | ||
|
|
d7df71c8ba | ||
|
|
ea464abaaf | ||
|
|
a026b682c4 | ||
|
|
8e3fa660fd | ||
|
|
c9257822ec | ||
|
|
783bb8bd92 | ||
|
|
bf19ab6ad9 | ||
|
|
c4e59027fc | ||
|
|
f9b7bc26c0 | ||
|
|
a197cd6158 | ||
|
|
ae5b506848 | ||
|
|
f8ab5fef78 | ||
|
|
0893ba33fc | ||
|
|
75ce8d6c20 | ||
|
|
6d56701b5b | ||
|
|
ea8aa92dd5 | ||
|
|
9fc634dfe0 | ||
|
|
4b1088edbc | ||
|
|
8e355a14e9 | ||
|
|
ef2b6f91f1 | ||
|
|
9cae7a0a49 | ||
|
|
9a55ca3021 | ||
|
|
e8b20c86c1 | ||
|
|
dc78a4af88 | ||
|
|
34273907f7 | ||
|
|
ca1c5899a1 | ||
|
|
0064f17ad4 | ||
|
|
f8ccafd2af | ||
|
|
d386311e54 | ||
|
|
0e2475aa72 | ||
|
|
b4cce9f147 | ||
|
|
3e8f25d864 | ||
|
|
4c68580e82 | ||
|
|
3bc82c10b1 | ||
|
|
c7d94055a4 | ||
|
|
34316b0ffd | ||
|
|
3d494dcd73 | ||
|
|
85b2c4de4a | ||
|
|
d0ce6bb066 | ||
|
|
38c6495fd8 | ||
|
|
bcc449b524 | ||
|
|
361ada4963 | ||
|
|
2e8d62d0ca | ||
|
|
fb97bf6041 | ||
|
|
6d9c95720d | ||
|
|
db5a0a892a | ||
|
|
7b01a6ca61 | ||
|
|
fbbf767700 | ||
|
|
776e2cf6e7 | ||
|
|
34ca0e8671 | ||
|
|
0d37047c37 | ||
|
|
25c8f60e6e | ||
|
|
aae1480e4f | ||
|
|
5e8a52bcc0 | ||
|
|
cf8f8907ee | ||
|
|
ca36f20c6b | ||
|
|
bdae02e51e | ||
|
|
2d7eb0dcb5 | ||
|
|
2e0756ad8d | ||
|
|
ef2bbce34b | ||
|
|
65e59dc57d | ||
|
|
2ca39b571a | ||
|
|
48a6157efb | ||
|
|
ab3a64604a | ||
|
|
e9ddf43c6c | ||
|
|
2549d91ddf | ||
|
|
81ae86ff79 | ||
|
|
7670104e4d | ||
|
|
3fc2ad5bc9 | ||
|
|
c84367e2ee | ||
|
|
77413ad25c | ||
|
|
c1f73255b5 | ||
|
|
fe7ec76cd5 | ||
|
|
0bc9849ad8 | ||
|
|
c9a4f8f664 | ||
|
|
1315b8e42a | ||
|
|
7a03da42ec | ||
|
|
8b9bb2a8fc | ||
|
|
162dfbaab0 | ||
|
|
71b6e35231 | ||
|
|
9268513128 | ||
|
|
5d44b6a6a7 | ||
|
|
586fe10525 | ||
|
|
a59d1d3c05 | ||
|
|
1fce604a11 | ||
|
|
8ea831c845 | ||
|
|
94061fa634 | ||
|
|
fe17955fa1 | ||
|
|
3158e9f63a | ||
|
|
fcb2b53bf8 | ||
|
|
5470702c16 | ||
|
|
8c05c6e122 | ||
|
|
cc397a012f | ||
|
|
e12827de3f | ||
|
|
02a646c7ea | ||
|
|
86986efb15 | ||
|
|
a718fb3cae | ||
|
|
48ba9ce175 | ||
|
|
be60ad6766 | ||
|
|
b1b58f2550 | ||
|
|
99d00e2057 | ||
|
|
7da0dddaa9 | ||
|
|
3ea45e4ef5 | ||
|
|
dbac187b44 | ||
|
|
43293b98c0 | ||
|
|
34eef8e97d | ||
|
|
5a48fd80cd | ||
|
|
5260afc15d | ||
|
|
66b4e08026 | ||
|
|
2b8e0cc6c4 | ||
|
|
a501214bfa | ||
|
|
2b9a8b9136 | ||
|
|
1cc3cb5408 | ||
|
|
7df793f208 | ||
|
|
ca2b7cc4bc | ||
|
|
9e0a74da3d | ||
|
|
da5076a4dc | ||
|
|
005808f003 | ||
|
|
1dd1919200 | ||
|
|
0a9db55dc4 | ||
|
|
4551ba5b7c | ||
|
|
0f25ad5676 | ||
|
|
c6564c0d84 | ||
|
|
a7e94d433f | ||
|
|
64480a35ac | ||
|
|
4f96d5caf2 | ||
|
|
7cca1b9f48 | ||
|
|
56ebbedbfd | ||
|
|
4e5b8ce875 | ||
|
|
5c5ee50983 | ||
|
|
0a67488447 | ||
|
|
022761aa4b | ||
|
|
b9d985b663 | ||
|
|
08ed9d285e | ||
|
|
ab0cd71d10 | ||
|
|
df7645e4e5 | ||
|
|
39f9c72390 | ||
|
|
0023714884 | ||
|
|
ec9fdc517f | ||
|
|
db387eb770 | ||
|
|
354ed22706 | ||
|
|
a69f194d8b | ||
|
|
f5d13319a2 | ||
|
|
9a0e691635 | ||
|
|
6c7cb185a1 | ||
|
|
ab22b93ce0 | ||
|
|
c7f5278430 | ||
|
|
56ad0dbaf2 | ||
|
|
74c92cd460 | ||
|
|
16ebb4322a | ||
|
|
fccd026812 | ||
|
|
b6e49f2bc0 | ||
|
|
188ccf849d | ||
|
|
1bfdce9642 | ||
|
|
495254b0be | ||
|
|
d209ff7b9a | ||
|
|
98eeb50060 | ||
|
|
8a68f0aaf9 | ||
|
|
039859213c | ||
|
|
a3c022aebf | ||
|
|
3a9b32b6e8 | ||
|
|
c1cb9000a9 | ||
|
|
104b99ffa0 | ||
|
|
a89d7f327a | ||
|
|
91bc4bde3c | ||
|
|
80da7ad496 | ||
|
|
64bf211a45 | ||
|
|
2558a66a48 | ||
|
|
df22eab4ec | ||
|
|
c2678cf818 | ||
|
|
f9af34b103 | ||
|
|
97cab22e00 | ||
|
|
64416e05c1 | ||
|
|
b21125ff2d | ||
|
|
e72d0d03ed | ||
|
|
0f12d15020 | ||
|
|
44a2d009c0 | ||
|
|
48682bacde | ||
|
|
f70369c2a6 | ||
|
|
f7fc94520a | ||
|
|
77c6f5c9a2 | ||
|
|
dffa47301b | ||
|
|
08f47e7e14 | ||
|
|
56342af140 | ||
|
|
aacc0eca67 | ||
|
|
02916aeffa | ||
|
|
e42bfada9d | ||
|
|
72fb114dec | ||
|
|
9ba1561386 | ||
|
|
39772c2dbe | ||
|
|
cbf3ca726f | ||
|
|
f1e21ebe9d | ||
|
|
49c36cc040 | ||
|
|
9b90400abd | ||
|
|
8cda364210 | ||
|
|
ca98ef879d | ||
|
|
bb9c85cd8f | ||
|
|
91b946bf3d | ||
|
|
64377000c6 | ||
|
|
23f4931a1d | ||
|
|
3625834028 | ||
|
|
705e7b30bc | ||
|
|
6528c0817d | ||
|
|
f3d7392af3 | ||
|
|
5d5f44ba11 | ||
|
|
34457880c7 | ||
|
|
d63f07d29a | ||
|
|
5c2cbc9d29 | ||
|
|
8dbfa10646 | ||
|
|
9e804089e0 | ||
|
|
51145903aa | ||
|
|
036c49f398 | ||
|
|
46b85ebc6b | ||
|
|
07bc5e2de9 | ||
|
|
e822091907 | ||
|
|
7d46e77922 | ||
|
|
ad528ad3d5 | ||
|
|
e8b4c03770 | ||
|
|
33aacc1798 | ||
|
|
58959ef35e | ||
|
|
c66b349cec | ||
|
|
5c90df092b | ||
|
|
32374f264f | ||
|
|
5e62229f25 | ||
|
|
1b24dff738 | ||
|
|
161135cd90 | ||
|
|
5fb583da06 | ||
|
|
8b40d20eab | ||
|
|
432034d2cb | ||
|
|
0e168e36fc | ||
|
|
f248260584 | ||
|
|
880e3e10da | ||
|
|
f33b95ee82 | ||
|
|
4a71eb9b90 | ||
|
|
3372a5ad4b | ||
|
|
8326f05f66 | ||
|
|
7ce921d449 | ||
|
|
31f7364f08 | ||
|
|
5119d28b9d | ||
|
|
a2a5fe3bee | ||
|
|
6222d8c977 | ||
|
|
d3699a261a | ||
|
|
9c0e56d640 | ||
|
|
ddd89fc52a | ||
|
|
b852f032d3 | ||
|
|
1fec26c6b3 | ||
|
|
d3483afaed | ||
|
|
910e4815fa | ||
|
|
ef118e3351 | ||
|
|
2beedb10d4 | ||
|
|
41bf10d989 | ||
|
|
ac3b6aef27 | ||
|
|
8956b591f7 | ||
|
|
2f8519cb6b | ||
|
|
15a19c044d | ||
|
|
ec47ff7479 | ||
|
|
82f707ee89 | ||
|
|
dfcab8db6a | ||
|
|
5c10127758 | ||
|
|
b376f36733 | ||
|
|
96c0f62cf5 | ||
|
|
a96f996b59 | ||
|
|
b75d0b6cb5 | ||
|
|
a5bc65fbfb | ||
|
|
dcdbc95ae7 | ||
|
|
72e7e5e025 | ||
|
|
57242a2e13 | ||
|
|
6dbf757385 | ||
|
|
c5a32d8373 | ||
|
|
34288435ec | ||
|
|
177b48c3f2 | ||
|
|
642f5d4405 | ||
|
|
92b1c59e48 | ||
|
|
cb1682542b | ||
|
|
9e56187c16 | ||
|
|
51851efda5 | ||
|
|
11e4b743e0 | ||
|
|
3349151d4c | ||
|
|
c8f6937166 | ||
|
|
ad36c1df3d | ||
|
|
a5b8924e2d | ||
|
|
bc898cc2c2 | ||
|
|
1247b6e8eb | ||
|
|
2111c3de1a | ||
|
|
bcea1b66be | ||
|
|
4f8d14ed3e | ||
|
|
442adfbbc3 | ||
|
|
fe12233954 | ||
|
|
c725f6f572 | ||
|
|
1870d83081 | ||
|
|
8315dacda4 | ||
|
|
18c54f41bd | ||
|
|
293f9c22c4 | ||
|
|
a74510544f | ||
|
|
9b053c50c2 | ||
|
|
88712f46bf | ||
|
|
d6df20b0e8 | ||
|
|
5dc37f7557 | ||
|
|
445d306586 | ||
|
|
d332ae1132 | ||
|
|
37f45b10a3 | ||
|
|
d9b6ec0654 | ||
|
|
f98428aea5 | ||
|
|
b3be1d79cd | ||
|
|
ea8f885f05 | ||
|
|
2de47c2a50 | ||
|
|
30b8e105f9 | ||
|
|
2a44fab8ba | ||
|
|
6a06a99e46 | ||
|
|
3670dfbebd | ||
|
|
daf929ecc7 | ||
|
|
f96a17c930 | ||
|
|
2fb06e7f4f | ||
|
|
4ece9b0085 | ||
|
|
a4bd31e96a | ||
|
|
8bdcc3267a | ||
|
|
9e9164c4ee | ||
|
|
5dc6a39652 | ||
|
|
ada0966832 | ||
|
|
e6faef27ab | ||
|
|
acc27d0829 | ||
|
|
ab54f7bb45 | ||
|
|
88161cc37d | ||
|
|
0975e6834e | ||
|
|
22ec1d5f0a | ||
|
|
01784dd186 | ||
|
|
02cf91c158 | ||
|
|
0532346f4f | ||
|
|
657adafb7d | ||
|
|
818c0789ea | ||
|
|
cb5bcf2248 |
6
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
.cache
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
node_modules/
|
node_modules/
|
||||||
@@ -14,7 +15,10 @@ out-editor-min/
|
|||||||
out-monaco-editor-core/
|
out-monaco-editor-core/
|
||||||
out-vscode/
|
out-vscode/
|
||||||
out-vscode-min/
|
out-vscode-min/
|
||||||
build/node_modules
|
out-vscode-reh/
|
||||||
|
out-vscode-reh-min/
|
||||||
|
out-vscode-reh-pkg/
|
||||||
|
**/node_modules
|
||||||
coverage/
|
coverage/
|
||||||
test_data/
|
test_data/
|
||||||
test-results/
|
test-results/
|
||||||
|
|||||||
6
.vscode/launch.json
vendored
@@ -70,10 +70,12 @@
|
|||||||
"timeout": 20000
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"osx": {
|
"osx": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
|
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
|
||||||
|
|||||||
14
.vscode/tasks.json
vendored
@@ -28,6 +28,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "strict-initialization-watch",
|
||||||
|
"label": "TS - Strict Initialization",
|
||||||
|
"isBackground": true,
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "never"
|
||||||
|
},
|
||||||
|
"problemMatcher": {
|
||||||
|
"base": "$tsc-watch",
|
||||||
|
"owner": "typescript-strict-initialization",
|
||||||
|
"applyTo": "allDocuments"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "gulp",
|
"type": "gulp",
|
||||||
"task": "tslint",
|
"task": "tslint",
|
||||||
|
|||||||
2
.yarnrc
@@ -1,3 +1,3 @@
|
|||||||
disturl "https://atom.io/download/electron"
|
disturl "https://atom.io/download/electron"
|
||||||
target "3.1.6"
|
target "3.1.8"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
|
|||||||
26
CHANGELOG.md
@@ -1,5 +1,31 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## Version 1.7.0
|
||||||
|
* Release date: May 8, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Announcing Schema Compare *Preview* extension
|
||||||
|
* Tasks Panel UX improvement
|
||||||
|
* Announcing new Welcome page
|
||||||
|
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/milestone/31?closed=1).
|
||||||
|
|
||||||
|
## Contributions and "thank you"
|
||||||
|
We would like to thank all our users who raised issues.
|
||||||
|
|
||||||
|
## Version 1.6.0
|
||||||
|
* Release date: April 18, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Align with latest VS Code editor platform (currently 1.33.1)
|
||||||
|
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/26?closed=1).
|
||||||
|
|
||||||
|
## Contributions and "thank you"
|
||||||
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* yamatoya for `fix the format (#4899)`
|
||||||
|
|
||||||
## Version 1.5.1
|
## Version 1.5.1
|
||||||
* Release date: March 18, 2019
|
* Release date: March 18, 2019
|
||||||
* Release status: General Availability
|
* Release status: General Availability
|
||||||
|
|||||||
15
README.md
@@ -9,13 +9,13 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
|
|||||||
|
|
||||||
Platform | Link
|
Platform | Link
|
||||||
-- | --
|
-- | --
|
||||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2083322
|
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2091882
|
||||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2083323
|
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2091491
|
||||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2083324
|
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2091490
|
||||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2083325
|
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2091489
|
||||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2083424
|
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2091488
|
||||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2083326
|
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2091487
|
||||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2083327
|
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2092022
|
||||||
|
|
||||||
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
||||||
|
|
||||||
@@ -68,6 +68,7 @@ The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.micro
|
|||||||
## Contributions and "Thank You"
|
## Contributions and "Thank You"
|
||||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* yamatoya for `fix the format (#4899)`
|
||||||
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||||
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
||||||
* sadedil for `Missing feature request: Save as XML #3729`
|
* sadedil for `Missing feature request: Save as XML #3729`
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '8.x'
|
versionSpec: '10.15.1'
|
||||||
displayName: 'Install Node.js'
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
git submodule update --init --recursive
|
|
||||||
nvm install 10.15.1
|
|
||||||
nvm use 10.15.1
|
|
||||||
npm i -g yarn
|
npm i -g yarn
|
||||||
displayName: 'preinstall'
|
displayName: 'preinstall'
|
||||||
|
|
||||||
@@ -27,18 +24,12 @@ steps:
|
|||||||
displayName: 'Install'
|
displayName: 'Install'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
node_modules/.bin/gulp electron
|
yarn gulp electron-x64
|
||||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
displayName: Download Electron
|
||||||
displayName: 'Scripts'
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
yarn gulp hygiene
|
||||||
displayName: 'Tests'
|
displayName: Run Hygiene Checks
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
inputs:
|
|
||||||
testResultsFiles: '**/test-results.xml'
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn tslint
|
yarn tslint
|
||||||
@@ -47,3 +38,29 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn strict-null-check
|
yarn strict-null-check
|
||||||
displayName: 'Run Strict Null Check'
|
displayName: 'Run Strict Null Check'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn compile
|
||||||
|
displayName: 'Compile'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
||||||
|
displayName: 'Tests'
|
||||||
|
condition: eq(variables['Agent.OS'], 'Linux')
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter --coverage
|
||||||
|
displayName: 'Tests'
|
||||||
|
condition: ne(variables['Agent.OS'], 'Linux')
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: '**/test-results.xml'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
|
- task: PublishCodeCoverageResults@1
|
||||||
|
inputs:
|
||||||
|
codeCoverageTool: 'cobertura'
|
||||||
|
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
|
||||||
|
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-reports
|
||||||
|
condition: ne(variables['Agent.OS'], 'Linux')
|
||||||
|
|||||||
@@ -9,21 +9,12 @@ steps:
|
|||||||
displayName: 'Yarn Install'
|
displayName: 'Yarn Install'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
.\node_modules\.bin\gulp electron
|
yarn gulp electron-x64
|
||||||
displayName: 'Electron'
|
displayName: 'Electron'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
npm run compile
|
yarn gulp hygiene
|
||||||
displayName: 'Compile'
|
displayName: Run Hygiene Checks
|
||||||
|
|
||||||
- script: |
|
|
||||||
.\scripts\test.bat --reporter mocha-junit-reporter
|
|
||||||
displayName: 'Test'
|
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
inputs:
|
|
||||||
testResultsFiles: 'test-results.xml'
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn tslint
|
yarn tslint
|
||||||
@@ -32,3 +23,22 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn strict-null-check
|
yarn strict-null-check
|
||||||
displayName: 'Run Strict Null Check'
|
displayName: 'Run Strict Null Check'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn compile
|
||||||
|
displayName: 'Compile'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
.\scripts\test.bat --reporter mocha-junit-reporter --coverage
|
||||||
|
displayName: 'Test'
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: 'test-results.xml'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
|
- task: PublishCodeCoverageResults@1
|
||||||
|
inputs:
|
||||||
|
codeCoverageTool: 'cobertura'
|
||||||
|
summaryFileLocation: $(System.DefaultWorkingDirectory)\.build\coverage\cobertura-coverage.xml
|
||||||
|
reportDirectory: $(System.DefaultWorkingDirectory)\.build\coverage\lcov-report
|
||||||
|
|||||||
126
build/.nativeignore
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
# cleanup rules for native node modules, .gitignore style
|
||||||
|
|
||||||
|
fsevents/binding.gyp
|
||||||
|
fsevents/fsevents.cc
|
||||||
|
fsevents/build/**
|
||||||
|
fsevents/src/**
|
||||||
|
fsevents/test/**
|
||||||
|
!fsevents/**/*.node
|
||||||
|
|
||||||
|
vscode-sqlite3/binding.gyp
|
||||||
|
vscode-sqlite3/benchmark/**
|
||||||
|
vscode-sqlite3/cloudformation/**
|
||||||
|
vscode-sqlite3/deps/**
|
||||||
|
vscode-sqlite3/test/**
|
||||||
|
vscode-sqlite3/build/**
|
||||||
|
vscode-sqlite3/src/**
|
||||||
|
!vscode-sqlite3/build/Release/*.node
|
||||||
|
|
||||||
|
oniguruma/binding.gyp
|
||||||
|
oniguruma/build/**
|
||||||
|
oniguruma/src/**
|
||||||
|
oniguruma/deps/**
|
||||||
|
!oniguruma/build/Release/*.node
|
||||||
|
!oniguruma/src/*.js
|
||||||
|
|
||||||
|
windows-mutex/binding.gyp
|
||||||
|
windows-mutex/build/**
|
||||||
|
windows-mutex/src/**
|
||||||
|
!windows-mutex/**/*.node
|
||||||
|
|
||||||
|
native-keymap/binding.gyp
|
||||||
|
native-keymap/build/**
|
||||||
|
native-keymap/src/**
|
||||||
|
native-keymap/deps/**
|
||||||
|
!native-keymap/build/Release/*.node
|
||||||
|
|
||||||
|
native-is-elevated/binding.gyp
|
||||||
|
native-is-elevated/build/**
|
||||||
|
native-is-elevated/src/**
|
||||||
|
native-is-elevated/deps/**
|
||||||
|
!native-is-elevated/build/Release/*.node
|
||||||
|
|
||||||
|
native-watchdog/binding.gyp
|
||||||
|
native-watchdog/build/**
|
||||||
|
native-watchdog/src/**
|
||||||
|
!native-watchdog/build/Release/*.node
|
||||||
|
|
||||||
|
spdlog/binding.gyp
|
||||||
|
spdlog/build/**
|
||||||
|
spdlog/deps/**
|
||||||
|
spdlog/src/**
|
||||||
|
spdlog/test/**
|
||||||
|
!spdlog/build/Release/*.node
|
||||||
|
|
||||||
|
jschardet/dist/**
|
||||||
|
|
||||||
|
windows-foreground-love/binding.gyp
|
||||||
|
windows-foreground-love/build/**
|
||||||
|
windows-foreground-love/src/**
|
||||||
|
!windows-foreground-love/**/*.node
|
||||||
|
|
||||||
|
windows-process-tree/binding.gyp
|
||||||
|
windows-process-tree/build/**
|
||||||
|
windows-process-tree/src/**
|
||||||
|
!windows-process-tree/**/*.node
|
||||||
|
|
||||||
|
gc-signals/binding.gyp
|
||||||
|
gc-signals/build/**
|
||||||
|
gc-signals/src/**
|
||||||
|
gc-signals/deps/**
|
||||||
|
|
||||||
|
!gc-signals/build/Release/*.node
|
||||||
|
!gc-signals/src/index.js
|
||||||
|
|
||||||
|
keytar/binding.gyp
|
||||||
|
keytar/build/**
|
||||||
|
keytar/src/**
|
||||||
|
keytar/script/**
|
||||||
|
keytar/node_modules/**
|
||||||
|
!keytar/**/*.node
|
||||||
|
|
||||||
|
node-pty/binding.gyp
|
||||||
|
node-pty/build/**
|
||||||
|
node-pty/src/**
|
||||||
|
node-pty/tools/**
|
||||||
|
!node-pty/build/Release/*.exe
|
||||||
|
!node-pty/build/Release/*.dll
|
||||||
|
!node-pty/build/Release/*.node
|
||||||
|
|
||||||
|
chart.js/node_modules/**
|
||||||
|
|
||||||
|
emmet/node_modules/**
|
||||||
|
|
||||||
|
pty.js/build/**
|
||||||
|
!pty.js/build/Release/**
|
||||||
|
|
||||||
|
jquery-ui/external/**
|
||||||
|
jquery-ui/demos/**
|
||||||
|
|
||||||
|
core-js/**/**
|
||||||
|
|
||||||
|
slickgrid/node_modules/**
|
||||||
|
slickgrid/examples/**
|
||||||
|
|
||||||
|
vscode-nsfw/binding.gyp
|
||||||
|
vscode-nsfw/build/**
|
||||||
|
vscode-nsfw/src/**
|
||||||
|
vscode-nsfw/openpa/**
|
||||||
|
vscode-nsfw/includes/**
|
||||||
|
!vscode-nsfw/build/Release/*.node
|
||||||
|
!vscode-nsfw/**/*.a
|
||||||
|
|
||||||
|
vsda/binding.gyp
|
||||||
|
vsda/README.md
|
||||||
|
vsda/build/**
|
||||||
|
vsda/*.bat
|
||||||
|
vsda/*.sh
|
||||||
|
vsda/*.cpp
|
||||||
|
vsda/*.h
|
||||||
|
!vsda/build/Release/vsda.node
|
||||||
|
|
||||||
|
vscode-windows-ca-certs/**/*
|
||||||
|
!vscode-windows-ca-certs/package.json
|
||||||
|
!vscode-windows-ca-certs/**/*.node
|
||||||
|
|
||||||
|
node-addon-api/**/*
|
||||||
@@ -4,9 +4,11 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as cp from 'child_process';
|
import * as cp from 'child_process';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
function yarnInstall(packageName: string): void {
|
function yarnInstall(packageName: string): void {
|
||||||
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
||||||
|
cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd: path.join( process.cwd(), 'remote') });
|
||||||
}
|
}
|
||||||
|
|
||||||
const product = require('../../../product.json');
|
const product = require('../../../product.json');
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ interface Asset {
|
|||||||
platform: string;
|
platform: string;
|
||||||
type: string;
|
type: string;
|
||||||
url: string;
|
url: string;
|
||||||
// {{SQL CARBON EDIT}}
|
mooncakeUrl?: string;
|
||||||
mooncakeUrl: string | undefined;
|
|
||||||
hash: string;
|
hash: string;
|
||||||
sha256hash: string;
|
sha256hash: string;
|
||||||
size: number;
|
size: number;
|
||||||
@@ -189,56 +188,18 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
await assertContainer(blobService, quality);
|
await assertContainer(blobService, quality);
|
||||||
|
|
||||||
const blobExists = await doesAssetExist(blobService, quality, blobName);
|
const blobExists = await doesAssetExist(blobService, quality, blobName);
|
||||||
|
|
||||||
const promises = [];
|
if (blobExists) {
|
||||||
|
|
||||||
if (!blobExists) {
|
|
||||||
promises.push(uploadBlob(blobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
if (process.env['MOONCAKE_STORAGE_ACCESS_KEY']) {
|
|
||||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
|
||||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
|
||||||
|
|
||||||
// mooncake is fussy and far away, this is needed!
|
|
||||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
assertContainer(blobService, quality),
|
|
||||||
assertContainer(mooncakeBlobService, quality)
|
|
||||||
]);
|
|
||||||
|
|
||||||
const [blobExists, moooncakeBlobExists] = await Promise.all([
|
|
||||||
doesAssetExist(blobService, quality, blobName),
|
|
||||||
doesAssetExist(mooncakeBlobService, quality, blobName)
|
|
||||||
]);
|
|
||||||
|
|
||||||
const promises: Array<Promise<void>> = [];
|
|
||||||
|
|
||||||
if (!blobExists) {
|
|
||||||
promises.push(uploadBlob(blobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!moooncakeBlobExists) {
|
|
||||||
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log('Skipping Mooncake publishing.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (promises.length === 0) {
|
|
||||||
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Uploading blobs to Azure storage...');
|
console.log('Uploading blobs to Azure storage...');
|
||||||
|
|
||||||
await Promise.all(promises);
|
await uploadBlob(blobService, quality, blobName, file);
|
||||||
|
|
||||||
console.log('Blobs successfully uploaded.');
|
console.log('Blobs successfully uploaded.');
|
||||||
|
|
||||||
@@ -250,8 +211,6 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
platform: platform,
|
platform: platform,
|
||||||
type: type,
|
type: type,
|
||||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
mooncakeUrl: process.env['MOONCAKE_CDN_URL'] ? `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}` : undefined,
|
|
||||||
hash: sha1hash,
|
hash: sha1hash,
|
||||||
sha256hash,
|
sha256hash,
|
||||||
size
|
size
|
||||||
|
|||||||
176
build/azure-pipelines/common/sync-mooncake.ts
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as url from 'url';
|
||||||
|
import * as azure from 'azure-storage';
|
||||||
|
import * as mime from 'mime';
|
||||||
|
import { DocumentClient, RetrievedDocument } from 'documentdb';
|
||||||
|
|
||||||
|
function log(...args: any[]) {
|
||||||
|
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function error(...args: any[]) {
|
||||||
|
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.length < 3) {
|
||||||
|
error('Usage: node sync-mooncake.js <quality>');
|
||||||
|
process.exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Build extends RetrievedDocument {
|
||||||
|
assets: Asset[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Asset {
|
||||||
|
platform: string;
|
||||||
|
type: string;
|
||||||
|
url: string;
|
||||||
|
mooncakeUrl: string;
|
||||||
|
hash: string;
|
||||||
|
sha256hash: string;
|
||||||
|
size: number;
|
||||||
|
supportsFastUpdate?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateBuild(commit: string, quality: string, platform: string, type: string, asset: Asset): Promise<void> {
|
||||||
|
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||||
|
const collection = 'dbs/builds/colls/' + quality;
|
||||||
|
const updateQuery = {
|
||||||
|
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
|
||||||
|
parameters: [{ name: '@id', value: commit }]
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateTries = 0;
|
||||||
|
|
||||||
|
function _update(): Promise<void> {
|
||||||
|
updateTries++;
|
||||||
|
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
client.queryDocuments(collection, updateQuery).toArray((err, results) => {
|
||||||
|
if (err) { return e(err); }
|
||||||
|
if (results.length !== 1) { return e(new Error('No documents')); }
|
||||||
|
|
||||||
|
const release = results[0];
|
||||||
|
|
||||||
|
release.assets = [
|
||||||
|
...release.assets.filter((a: any) => !(a.platform === platform && a.type === type)),
|
||||||
|
asset
|
||||||
|
];
|
||||||
|
|
||||||
|
client.replaceDocument(release._self, release, err => {
|
||||||
|
if (err && err.code === 409 && updateTries < 5) { return c(_update()); }
|
||||||
|
if (err) { return e(err); }
|
||||||
|
|
||||||
|
log('Build successfully updated.');
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return _update();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function sync(commit: string, quality: string): Promise<void> {
|
||||||
|
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||||
|
|
||||||
|
const cosmosdb = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||||
|
const collection = `dbs/builds/colls/${quality}`;
|
||||||
|
const query = {
|
||||||
|
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
|
||||||
|
parameters: [{ name: '@id', value: commit }]
|
||||||
|
};
|
||||||
|
|
||||||
|
const build = await new Promise<Build>((c, e) => {
|
||||||
|
cosmosdb.queryDocuments(collection, query).toArray((err, results) => {
|
||||||
|
if (err) { return e(err); }
|
||||||
|
if (results.length !== 1) { return e(new Error('No documents')); }
|
||||||
|
c(results[0] as Build);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||||
|
|
||||||
|
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||||
|
|
||||||
|
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||||
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
|
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||||
|
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||||
|
|
||||||
|
// mooncake is fussy and far away, this is needed!
|
||||||
|
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||||
|
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||||
|
|
||||||
|
for (const asset of build.assets) {
|
||||||
|
try {
|
||||||
|
const blobPath = url.parse(asset.url).path;
|
||||||
|
|
||||||
|
if (!blobPath) {
|
||||||
|
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||||
|
|
||||||
|
log(`Found ${blobName}`);
|
||||||
|
|
||||||
|
if (asset.mooncakeUrl) {
|
||||||
|
log(` Already in Mooncake ✔️`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const readStream = blobService.createReadStream(quality, blobName, undefined!);
|
||||||
|
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
|
||||||
|
contentSettings: {
|
||||||
|
contentType: mime.lookup(blobPath),
|
||||||
|
cacheControl: 'max-age=31536000, public'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||||
|
|
||||||
|
log(` Uploading to Mooncake...`);
|
||||||
|
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||||
|
|
||||||
|
log(` Updating build in DB...`);
|
||||||
|
asset.mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||||
|
await updateBuild(commit, quality, asset.platform, asset.type, asset);
|
||||||
|
|
||||||
|
log(` Done ✔️`);
|
||||||
|
} catch (err) {
|
||||||
|
error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log(`All done ✔️`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(): void {
|
||||||
|
if (process.env['VSCODE_BUILD_SKIP_PUBLISH']) {
|
||||||
|
error('Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||||
|
|
||||||
|
if (!commit) {
|
||||||
|
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const quality = process.argv[2];
|
||||||
|
|
||||||
|
sync(commit, quality).catch(err => {
|
||||||
|
error(err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
5
build/azure-pipelines/darwin/build.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
yarn gulp vscode-darwin-min
|
||||||
|
yarn gulp vscode-reh-darwin-min
|
||||||
|
yarn gulp upload-vscode-sourcemaps
|
||||||
@@ -7,20 +7,32 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cat << EOF > ~/.netrc
|
cat << EOF > ~/.netrc
|
||||||
machine monacotools.visualstudio.com
|
machine monacotools.visualstudio.com
|
||||||
password $(VSO_PAT)
|
password $(devops-pat)
|
||||||
machine github.com
|
machine github.com
|
||||||
login vscode
|
login vscode
|
||||||
password $(VSCODE_MIXIN_PASSWORD)
|
password $(github-distro-mixin-password)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
||||||
|
git fetch distro
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
yarn
|
yarn
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
|
yarn gulp mixin
|
||||||
yarn gulp -- hygiene
|
yarn gulp hygiene
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
node build/azure-pipelines/common/installDistro.js
|
node build/azure-pipelines/common/installDistro.js
|
||||||
node build/lib/builtInExtensions.js
|
node build/lib/builtInExtensions.js
|
||||||
@@ -28,12 +40,9 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||||
yarn gulp -- vscode-darwin-min
|
./build/azure-pipelines/darwin/build.sh
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
|
||||||
yarn gulp -- upload-vscode-sourcemaps
|
|
||||||
displayName: Build
|
displayName: Build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
@@ -43,6 +52,11 @@ steps:
|
|||||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
||||||
displayName: Run unit tests
|
displayName: Run unit tests
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
./scripts/test-integration.sh --build --tfs "Integration Tests"
|
||||||
|
displayName: Run integration tests
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
||||||
@@ -69,31 +83,12 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
# remove pkg from archive
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
zip -d ../VSCode-darwin.zip "*.pkg"
|
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
# publish the build
|
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||||
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
./build/azure-pipelines/darwin/publish.sh
|
||||||
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js \
|
|
||||||
"$(VSCODE_QUALITY)" \
|
|
||||||
darwin \
|
|
||||||
archive \
|
|
||||||
"VSCode-darwin-$(VSCODE_QUALITY).zip" \
|
|
||||||
$VERSION \
|
|
||||||
true \
|
|
||||||
../VSCode-darwin.zip
|
|
||||||
|
|
||||||
# publish hockeyapp symbols
|
|
||||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
|
|
||||||
|
|
||||||
# upload configuration
|
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
|
||||||
yarn gulp -- upload-vscode-configuration
|
|
||||||
displayName: Publish
|
displayName: Publish
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
|
|||||||
36
build/azure-pipelines/darwin/publish.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# remove pkg from archive
|
||||||
|
zip -d ../VSCode-darwin.zip "*.pkg"
|
||||||
|
|
||||||
|
# publish the build
|
||||||
|
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
||||||
|
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
||||||
|
node build/azure-pipelines/common/publish.js \
|
||||||
|
"$VSCODE_QUALITY" \
|
||||||
|
darwin \
|
||||||
|
archive \
|
||||||
|
"VSCode-darwin-$VSCODE_QUALITY.zip" \
|
||||||
|
$VERSION \
|
||||||
|
true \
|
||||||
|
../VSCode-darwin.zip
|
||||||
|
|
||||||
|
# package Remote Extension Host
|
||||||
|
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||||
|
|
||||||
|
# publish Remote Extension Host
|
||||||
|
node build/azure-pipelines/common/publish.js \
|
||||||
|
"$VSCODE_QUALITY" \
|
||||||
|
server-darwin \
|
||||||
|
archive-unsigned \
|
||||||
|
"vscode-server-darwin.zip" \
|
||||||
|
$VERSION \
|
||||||
|
true \
|
||||||
|
../vscode-server-darwin.zip
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_MACOS"
|
||||||
|
|
||||||
|
# upload configuration
|
||||||
|
yarn gulp upload-vscode-configuration
|
||||||
36
build/azure-pipelines/distro-build.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include: ['master', 'release/*']
|
||||||
|
pr:
|
||||||
|
branches:
|
||||||
|
include: ['master', 'release/*']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cat << EOF > ~/.netrc
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(github-distro-mixin-password)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
|
||||||
|
git remote add distro "https://github.com/$VSCODE_MIXIN_REPO.git"
|
||||||
|
git fetch distro
|
||||||
|
git push distro origin/master:refs/heads/master
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
|
displayName: Sync & Merge Distro
|
||||||
7
build/azure-pipelines/linux/build.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-min"
|
||||||
|
|
||||||
|
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
|
||||||
|
yarn gulp vscode-reh-linux-$VSCODE_ARCH-min
|
||||||
|
fi
|
||||||
@@ -7,6 +7,12 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
export npm_config_arch="$(VSCODE_ARCH)"
|
export npm_config_arch="$(VSCODE_ARCH)"
|
||||||
@@ -16,96 +22,51 @@ steps:
|
|||||||
|
|
||||||
cat << EOF > ~/.netrc
|
cat << EOF > ~/.netrc
|
||||||
machine monacotools.visualstudio.com
|
machine monacotools.visualstudio.com
|
||||||
password $(VSO_PAT)
|
password $(devops-pat)
|
||||||
machine github.com
|
machine github.com
|
||||||
login vscode
|
login vscode
|
||||||
password $(VSCODE_MIXIN_PASSWORD)
|
password $(github-distro-mixin-password)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
git config user.email "vscode@microsoft.com"
|
||||||
|
git config user.name "VSCode"
|
||||||
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
||||||
|
git fetch distro
|
||||||
|
git merge $(node -p "require('./package.json').distro")
|
||||||
|
|
||||||
CHILD_CONCURRENCY=1 yarn
|
CHILD_CONCURRENCY=1 yarn
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
yarn gulp mixin
|
||||||
npm run gulp -- hygiene
|
yarn gulp hygiene
|
||||||
npm run monaco-compile-check
|
yarn monaco-compile-check
|
||||||
node build/azure-pipelines/common/installDistro.js
|
node build/azure-pipelines/common/installDistro.js
|
||||||
node build/lib/builtInExtensions.js
|
node build/lib/builtInExtensions.js
|
||||||
|
displayName: Prepare build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
name: build
|
./build/azure-pipelines/linux/build.sh
|
||||||
|
displayName: Build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
yarn gulp "electron-$(VSCODE_ARCH)"
|
||||||
|
|
||||||
# xvfb seems to be crashing often, let's make sure it's always up
|
# xvfb seems to be crashing often, let's make sure it's always up
|
||||||
service xvfb start
|
service xvfb start
|
||||||
|
|
||||||
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
||||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
||||||
name: test
|
displayName: Run unit tests
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
REPO="$(pwd)"
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
ROOT="$REPO/.."
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
ARCH="$(VSCODE_ARCH)"
|
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||||
|
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||||
# Publish tarball
|
./build/azure-pipelines/linux/publish.sh
|
||||||
PLATFORM_LINUX="linux-$(VSCODE_ARCH)"
|
displayName: Publish
|
||||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
|
||||||
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
|
||||||
BUILD="$ROOT/$BUILDNAME"
|
|
||||||
BUILD_VERSION="$(date +%s)"
|
|
||||||
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
|
||||||
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
|
||||||
PACKAGEJSON="$BUILD/resources/app/package.json"
|
|
||||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
|
||||||
|
|
||||||
rm -rf $ROOT/code-*.tar.*
|
|
||||||
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
|
|
||||||
|
|
||||||
# Publish hockeyapp symbols
|
|
||||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX64)"
|
|
||||||
|
|
||||||
# Publish DEB
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
|
||||||
PLATFORM_DEB="linux-deb-$ARCH"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
|
||||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
|
||||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
|
|
||||||
|
|
||||||
# Publish RPM
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
|
||||||
PLATFORM_RPM="linux-rpm-$ARCH"
|
|
||||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
|
||||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
|
||||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
|
||||||
|
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
|
|
||||||
|
|
||||||
# Publish Snap
|
|
||||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-prepare-snap"
|
|
||||||
|
|
||||||
# Pack snap tarball artifact, in order to preserve file perms
|
|
||||||
mkdir -p $REPO/.build/linux/snap-tarball
|
|
||||||
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$(VSCODE_ARCH).tar.gz"
|
|
||||||
rm -rf $SNAP_TARBALL_PATH
|
|
||||||
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
|
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
|
|||||||
64
build/azure-pipelines/linux/publish.sh
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
REPO="$(pwd)"
|
||||||
|
ROOT="$REPO/.."
|
||||||
|
|
||||||
|
# Publish tarball
|
||||||
|
PLATFORM_LINUX="linux-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||||
|
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
||||||
|
BUILD="$ROOT/$BUILDNAME"
|
||||||
|
BUILD_VERSION="$(date +%s)"
|
||||||
|
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
||||||
|
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||||
|
PACKAGEJSON="$BUILD/resources/app/package.json"
|
||||||
|
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||||
|
|
||||||
|
rm -rf $ROOT/code-*.tar.*
|
||||||
|
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
|
||||||
|
|
||||||
|
# Publish Remote Extension Host
|
||||||
|
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
|
||||||
|
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||||
|
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||||
|
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||||
|
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||||
|
|
||||||
|
rm -rf $ROOT/vscode-server-*.tar.*
|
||||||
|
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$VERSION" true "$SERVER_TARBALL_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Publish hockeyapp symbols
|
||||||
|
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_LINUX64"
|
||||||
|
|
||||||
|
# Publish DEB
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-build-deb"
|
||||||
|
PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||||
|
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||||
|
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
|
||||||
|
|
||||||
|
# Publish RPM
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-build-rpm"
|
||||||
|
PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
|
||||||
|
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||||
|
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||||
|
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||||
|
|
||||||
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
|
||||||
|
|
||||||
|
# Publish Snap
|
||||||
|
yarn gulp "vscode-linux-$VSCODE_ARCH-prepare-snap"
|
||||||
|
|
||||||
|
# Pack snap tarball artifact, in order to preserve file perms
|
||||||
|
mkdir -p $REPO/.build/linux/snap-tarball
|
||||||
|
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$VSCODE_ARCH.tar.gz"
|
||||||
|
rm -rf $SNAP_TARBALL_PATH
|
||||||
|
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
|
||||||
@@ -7,6 +7,12 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- task: DownloadPipelineArtifact@0
|
- task: DownloadPipelineArtifact@0
|
||||||
displayName: 'Download Pipeline Artifact'
|
displayName: 'Download Pipeline Artifact'
|
||||||
inputs:
|
inputs:
|
||||||
@@ -44,7 +50,6 @@ steps:
|
|||||||
(cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
|
(cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
|
||||||
|
|
||||||
# Publish snap package
|
# Publish snap package
|
||||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
|
||||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
- container: vscode-x64
|
- container: vscode-x64
|
||||||
image: joaomoreno/vscode-linux-build-agent:x64
|
endpoint: VSCodeHub
|
||||||
|
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
||||||
- container: vscode-ia32
|
- container: vscode-ia32
|
||||||
image: joaomoreno/vscode-linux-build-agent:ia32
|
endpoint: VSCodeHub
|
||||||
|
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
|
||||||
- container: snapcraft
|
- container: snapcraft
|
||||||
image: snapcore/snapcraft
|
image: snapcore/snapcraft
|
||||||
|
|
||||||
@@ -63,3 +65,17 @@ jobs:
|
|||||||
vmImage: macOS 10.13
|
vmImage: macOS 10.13
|
||||||
steps:
|
steps:
|
||||||
- template: darwin/product-build-darwin.yml
|
- template: darwin/product-build-darwin.yml
|
||||||
|
|
||||||
|
- job: Mooncake
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
condition: true
|
||||||
|
dependsOn:
|
||||||
|
- Windows
|
||||||
|
- Windows32
|
||||||
|
- Linux
|
||||||
|
- LinuxSnap
|
||||||
|
- Linux32
|
||||||
|
- macOS
|
||||||
|
steps:
|
||||||
|
- template: sync-mooncake.yml
|
||||||
2
build/azure-pipelines/publish-types/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
*.js
|
||||||
36
build/azure-pipelines/publish-types/check-version.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const cp = require("child_process");
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
if (!isValidTag(tag)) {
|
||||||
|
throw Error(`Invalid tag ${tag}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
function isValidTag(t) {
|
||||||
|
if (t.split('.').length !== 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const [major, minor, bug] = t.split('.');
|
||||||
|
// Only release for tags like 1.34.0
|
||||||
|
if (bug !== '0') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
43
build/azure-pipelines/publish-types/check-version.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
if (!isValidTag(tag)) {
|
||||||
|
throw Error(`Invalid tag ${tag}`);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidTag(t: string) {
|
||||||
|
if (t.split('.').length !== 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [major, minor, bug] = t.split('.');
|
||||||
|
|
||||||
|
// Only release for tags like 1.34.0
|
||||||
|
if (bug !== '0') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
67
build/azure-pipelines/publish-types/publish-types.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# Publish @types/vscode for each release
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include: ['refs/tags/*']
|
||||||
|
|
||||||
|
pr: none
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
# Install build dependencies
|
||||||
|
(cd build && yarn)
|
||||||
|
node build/azure-pipelines/publish-types/check-version.js
|
||||||
|
displayName: Check version
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
git config --global user.email "vscode@microsoft.com"
|
||||||
|
git config --global user.name "VSCode"
|
||||||
|
|
||||||
|
git clone https://$(GITHUB_TOKEN)@github.com/DefinitelyTyped/DefinitelyTyped.git --depth=1
|
||||||
|
node build/azure-pipelines/publish-types/update-types.js
|
||||||
|
|
||||||
|
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
|
|
||||||
|
cd DefinitelyTyped
|
||||||
|
|
||||||
|
git diff --color | cat
|
||||||
|
git add -A
|
||||||
|
git status
|
||||||
|
git checkout -b "vscode-types-$TAG_VERSION"
|
||||||
|
git commit -m "VS Code $TAG_VERSION Extension API"
|
||||||
|
git push origin "vscode-types-$TAG_VERSION"
|
||||||
|
|
||||||
|
displayName: Push update to DefinitelyTyped
|
||||||
|
|
||||||
|
- bash: |
|
||||||
|
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
|
CHANNEL="G1C14HJ2F"
|
||||||
|
|
||||||
|
MESSAGE="DefinitelyTyped/DefinitelyTyped#vscode-types-$TAG_VERSION created. Endgame master, please open this link, examine changes and create a PR:"
|
||||||
|
LINK="https://github.com/DefinitelyTyped/DefinitelyTyped/compare/vscode-types-$TAG_VERSION?quick_pull=1&body=Updating%20VS%20Code%20Extension%20API.%20See%20https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F70175%20for%20details."
|
||||||
|
MESSAGE2="[@octref, @jrieken, @kmaetzel, @egamma]. Please review and merge PR to publish @types/vscode."
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$LINK"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
|
||||||
|
-H 'Content-type: application/json; charset=utf-8' \
|
||||||
|
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE2"'"}' \
|
||||||
|
https://slack.com/api/chat.postMessage
|
||||||
|
|
||||||
|
displayName: Send message on Slack
|
||||||
62
build/azure-pipelines/publish-types/update-types.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs = require("fs");
|
||||||
|
const cp = require("child_process");
|
||||||
|
const path = require("path");
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
|
||||||
|
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
|
||||||
|
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
|
||||||
|
updateDTSFile(outPath, tag);
|
||||||
|
console.log(`Done updating vscode.d.ts at ${outPath}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
function updateDTSFile(outPath, tag) {
|
||||||
|
const oldContent = fs.readFileSync(outPath, 'utf-8');
|
||||||
|
const newContent = getNewFileContent(oldContent, tag);
|
||||||
|
fs.writeFileSync(outPath, newContent);
|
||||||
|
}
|
||||||
|
function getNewFileContent(content, tag) {
|
||||||
|
const oldheader = [
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`
|
||||||
|
].join('\n');
|
||||||
|
return getNewFileHeader(tag) + content.slice(oldheader.length);
|
||||||
|
}
|
||||||
|
function getNewFileHeader(tag) {
|
||||||
|
const [major, minor] = tag.split('.');
|
||||||
|
const shorttag = `${major}.${minor}`;
|
||||||
|
const header = [
|
||||||
|
`// Type definitions for Visual Studio Code ${shorttag}`,
|
||||||
|
`// Project: https://github.com/microsoft/vscode`,
|
||||||
|
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
|
||||||
|
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
|
||||||
|
``,
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA.`,
|
||||||
|
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`,
|
||||||
|
``,
|
||||||
|
`/**`,
|
||||||
|
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
|
||||||
|
` * See https://code.visualstudio.com/api for more information`,
|
||||||
|
` */`
|
||||||
|
].join('\n');
|
||||||
|
return header;
|
||||||
|
}
|
||||||
73
build/azure-pipelines/publish-types/update-types.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
let tag = '';
|
||||||
|
try {
|
||||||
|
tag = cp
|
||||||
|
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
|
||||||
|
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
|
||||||
|
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
|
||||||
|
|
||||||
|
updateDTSFile(outPath, tag);
|
||||||
|
|
||||||
|
console.log(`Done updating vscode.d.ts at ${outPath}`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
console.error('Failed to update types');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateDTSFile(outPath: string, tag: string) {
|
||||||
|
const oldContent = fs.readFileSync(outPath, 'utf-8');
|
||||||
|
const newContent = getNewFileContent(oldContent, tag);
|
||||||
|
|
||||||
|
fs.writeFileSync(outPath, newContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNewFileContent(content: string, tag: string) {
|
||||||
|
const oldheader = [
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
return getNewFileHeader(tag) + content.slice(oldheader.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNewFileHeader(tag: string) {
|
||||||
|
const [major, minor] = tag.split('.');
|
||||||
|
const shorttag = `${major}.${minor}`;
|
||||||
|
|
||||||
|
const header = [
|
||||||
|
`// Type definitions for Visual Studio Code ${shorttag}`,
|
||||||
|
`// Project: https://github.com/microsoft/vscode`,
|
||||||
|
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
|
||||||
|
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
|
||||||
|
``,
|
||||||
|
`/*---------------------------------------------------------------------------------------------`,
|
||||||
|
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||||
|
` * Licensed under the Source EULA.`,
|
||||||
|
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
|
||||||
|
` *--------------------------------------------------------------------------------------------*/`,
|
||||||
|
``,
|
||||||
|
`/**`,
|
||||||
|
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
|
||||||
|
` * See https://code.visualstudio.com/api for more information`,
|
||||||
|
` */`
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
return header;
|
||||||
|
}
|
||||||
24
build/azure-pipelines/sync-mooncake.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.10.1"
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
(cd build ; yarn)
|
||||||
|
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
|
||||||
|
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"
|
||||||
5
build/azure-pipelines/win32/build.ps1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-min" }
|
||||||
|
exec { yarn gulp "vscode-reh-win32-$env:VSCODE_ARCH-min" }
|
||||||
|
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-inno-updater" }
|
||||||
@@ -12,40 +12,59 @@ steps:
|
|||||||
versionSpec: '2.x'
|
versionSpec: '2.x'
|
||||||
addToPath: true
|
addToPath: true
|
||||||
|
|
||||||
|
- task: AzureKeyVault@1
|
||||||
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
inputs:
|
||||||
|
azureSubscription: 'vscode-builds-subscription'
|
||||||
|
KeyVaultName: vscode
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
"machine monacotools.visualstudio.com`npassword $(VSO_PAT)`nmachine github.com`nlogin vscode`npassword $(VSCODE_MIXIN_PASSWORD)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
"machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||||
$env:npm_config_arch="$(VSCODE_ARCH)"
|
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||||
$env:CHILD_CONCURRENCY="1"
|
$env:CHILD_CONCURRENCY="1"
|
||||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
|
||||||
|
exec { git config user.email "vscode@microsoft.com" }
|
||||||
|
exec { git config user.name "VSCode" }
|
||||||
|
exec { git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git" }
|
||||||
|
exec { git fetch distro }
|
||||||
|
exec { git merge $(node -p "require('./package.json').distro") }
|
||||||
|
|
||||||
exec { yarn }
|
exec { yarn }
|
||||||
exec { npm run gulp -- mixin }
|
exec { yarn gulp mixin }
|
||||||
exec { npm run gulp -- hygiene }
|
exec { yarn gulp hygiene }
|
||||||
exec { npm run monaco-compile-check }
|
exec { yarn monaco-compile-check }
|
||||||
exec { node build/azure-pipelines/common/installDistro.js }
|
exec { node build/azure-pipelines/common/installDistro.js }
|
||||||
exec { node build/lib/builtInExtensions.js }
|
exec { node build/lib/builtInExtensions.js }
|
||||||
|
displayName: Prepare build
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
$env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" }
|
.\build\azure-pipelines\win32\build.ps1
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
|
displayName: Build
|
||||||
name: build
|
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { npm run gulp -- "electron-$(VSCODE_ARCH)" }
|
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
|
||||||
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
||||||
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||||
name: test
|
displayName: Run unit tests
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
|
||||||
|
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
|
||||||
|
displayName: Run integration tests
|
||||||
|
|
||||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
inputs:
|
inputs:
|
||||||
ConnectedServiceName: 'ESRP CodeSign'
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
|
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
|
||||||
Pattern: '*.dll,*.exe,*.node'
|
Pattern: '*.dll,*.exe,*.node'
|
||||||
signConfigType: inlineSignParams
|
signConfigType: inlineSignParams
|
||||||
inlineOperation: |
|
inlineOperation: |
|
||||||
@@ -113,38 +132,17 @@ steps:
|
|||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
|
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
|
||||||
displayName: Import ESRP Auth Certificate
|
displayName: Import ESRP Auth Certificate
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign }
|
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||||
|
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||||
$Repo = "$(pwd)"
|
$env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
|
||||||
$Root = "$Repo\.."
|
.\build\azure-pipelines\win32\publish.ps1
|
||||||
$SystemExe = "$Repo\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe"
|
displayName: Publish
|
||||||
$UserExe = "$Repo\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe"
|
|
||||||
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
|
|
||||||
$Build = "$Root\VSCode-win32-$(VSCODE_ARCH)"
|
|
||||||
|
|
||||||
# get version
|
|
||||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
|
||||||
$Version = $PackageJson.version
|
|
||||||
$Quality = "$env:VSCODE_QUALITY"
|
|
||||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
|
||||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
|
|
||||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
|
||||||
|
|
||||||
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
|
|
||||||
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
|
|
||||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
|
|
||||||
|
|
||||||
# publish hockeyapp symbols
|
|
||||||
$hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
|
|
||||||
exec { node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId }
|
|
||||||
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||||
displayName: 'Component Detection'
|
displayName: 'Component Detection'
|
||||||
|
|||||||
37
build/azure-pipelines/win32/publish.ps1
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$Arch = "$env:VSCODE_ARCH"
|
||||||
|
|
||||||
|
exec { yarn gulp "vscode-win32-$Arch-archive" "vscode-win32-$Arch-system-setup" "vscode-win32-$Arch-user-setup" --sign }
|
||||||
|
|
||||||
|
$Repo = "$(pwd)"
|
||||||
|
$Root = "$Repo\.."
|
||||||
|
$SystemExe = "$Repo\.build\win32-$Arch\system-setup\VSCodeSetup.exe"
|
||||||
|
$UserExe = "$Repo\.build\win32-$Arch\user-setup\VSCodeSetup.exe"
|
||||||
|
$Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
|
||||||
|
$LegacyServer = "$Root\vscode-reh-win32-$Arch"
|
||||||
|
$ServerName = "vscode-server-win32-$Arch"
|
||||||
|
$Server = "$Root\$ServerName"
|
||||||
|
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
|
||||||
|
$Build = "$Root\VSCode-win32-$Arch"
|
||||||
|
|
||||||
|
# Create server archive
|
||||||
|
exec { Rename-Item -Path $LegacyServer -NewName $ServerName }
|
||||||
|
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
|
||||||
|
|
||||||
|
# get version
|
||||||
|
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||||
|
$Version = $PackageJson.version
|
||||||
|
$Quality = "$env:VSCODE_QUALITY"
|
||||||
|
|
||||||
|
$AssetPlatform = if ("$Arch" -eq "ia32") { "win32" } else { "win32-x64" }
|
||||||
|
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-archive" archive "VSCode-win32-$Arch-$Version.zip" $Version true $Zip }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform" setup "VSCodeSetup-$Arch-$Version.exe" $Version true $SystemExe }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $Version true $UserExe }
|
||||||
|
exec { node build/azure-pipelines/common/publish.js $Quality "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $Version true $ServerZip }
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
$hockeyAppId = if ("$Arch" -eq "ia32") { "$env:VSCODE_HOCKEYAPP_ID_WIN32" } else { "$env:VSCODE_HOCKEYAPP_ID_WIN64" }
|
||||||
|
exec { node build/azure-pipelines/common/symbols.js "$env:VSCODE_MIXIN_PASSWORD" "$env:VSCODE_HOCKEYAPP_TOKEN" "$Arch" $hockeyAppId }
|
||||||
@@ -87,9 +87,16 @@ const indentationFilter = [
|
|||||||
'!build/azure-pipelines/**/*.js',
|
'!build/azure-pipelines/**/*.js',
|
||||||
'!build/azure-pipelines/**/*.config',
|
'!build/azure-pipelines/**/*.config',
|
||||||
'!**/Dockerfile',
|
'!**/Dockerfile',
|
||||||
|
'!**/Dockerfile.*',
|
||||||
'!**/*.Dockerfile',
|
'!**/*.Dockerfile',
|
||||||
'!**/*.dockerfile',
|
'!**/*.dockerfile',
|
||||||
'!extensions/markdown-language-features/media/*.js'
|
'!extensions/markdown-language-features/media/*.js',
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
'!**/*.{xlf,docx,sql,vsix}',
|
||||||
|
'!extensions/mssql/sqltoolsservice/**',
|
||||||
|
'!extensions/import/flatfileimportservice/**',
|
||||||
|
'!extensions/admin-tool-ext-win/ssmsmin/**',
|
||||||
|
'!extensions/resource-deployment/notebooks/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
const copyrightFilter = [
|
const copyrightFilter = [
|
||||||
@@ -118,7 +125,38 @@ const copyrightFilter = [
|
|||||||
'!resources/completions/**',
|
'!resources/completions/**',
|
||||||
'!extensions/markdown-language-features/media/highlight.css',
|
'!extensions/markdown-language-features/media/highlight.css',
|
||||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||||
'!extensions/*/server/bin/*'
|
'!extensions/*/server/bin/*',
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
'!extensions/notebook/src/intellisense/text.ts',
|
||||||
|
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/tableRenderers.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/url.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/renderMimeInterfaces.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/outputProcessor.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/cellViews/media/*.css',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts',
|
||||||
|
'!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/sanitizer.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/renderers.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/registry.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/outputs/factories.ts',
|
||||||
|
'!src/sql/workbench/parts/notebook/models/nbformat.ts',
|
||||||
|
'!extensions/markdown-language-features/media/tomorrow.css',
|
||||||
|
'!src/sql/workbench/electron-browser/modelComponents/media/highlight.css',
|
||||||
|
'!src/sql/parts/modelComponents/highlight.css',
|
||||||
|
'!extensions/mssql/sqltoolsservice/**',
|
||||||
|
'!extensions/import/flatfileimportservice/**',
|
||||||
|
'!extensions/notebook/src/prompts/**',
|
||||||
|
'!extensions/mssql/src/prompts/**',
|
||||||
|
'!extensions/notebook/resources/jupyter_config/**',
|
||||||
|
'!**/*.gif',
|
||||||
|
'!**/*.xlf',
|
||||||
|
'!**/*.dacpac'
|
||||||
];
|
];
|
||||||
|
|
||||||
const eslintFilter = [
|
const eslintFilter = [
|
||||||
@@ -147,6 +185,11 @@ const tslintFilter = [
|
|||||||
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
const useStrictFilter = [
|
||||||
|
'src/**'
|
||||||
|
];
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const copyrightHeaderLines = [
|
const copyrightHeaderLines = [
|
||||||
'/*---------------------------------------------------------------------------------------------',
|
'/*---------------------------------------------------------------------------------------------',
|
||||||
@@ -164,8 +207,7 @@ gulp.task('eslint', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('tslint', () => {
|
gulp.task('tslint', () => {
|
||||||
// {{SQL CARBON EDIT}}
|
const options = { emitError: true };
|
||||||
const options = { emitError: false };
|
|
||||||
|
|
||||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||||
.pipe(filter(tslintFilter))
|
.pipe(filter(tslintFilter))
|
||||||
@@ -198,8 +240,8 @@ function hygiene(some) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const copyrights = es.through(function (file) {
|
const copyrights = es.through(function (file) {
|
||||||
const lines = file.__lines;
|
|
||||||
|
|
||||||
|
const lines = file.__lines;
|
||||||
for (let i = 0; i < copyrightHeaderLines.length; i++) {
|
for (let i = 0; i < copyrightHeaderLines.length; i++) {
|
||||||
if (lines[i] !== copyrightHeaderLines[i]) {
|
if (lines[i] !== copyrightHeaderLines[i]) {
|
||||||
console.error(file.relative + ': Missing or bad copyright statement');
|
console.error(file.relative + ': Missing or bad copyright statement');
|
||||||
@@ -211,6 +253,23 @@ function hygiene(some) {
|
|||||||
this.emit('data', file);
|
this.emit('data', file);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
// Check for unnecessary 'use strict' lines. These are automatically added by the alwaysStrict compiler option so don't need to be added manually
|
||||||
|
const useStrict = es.through(function (file) {
|
||||||
|
const lines = file.__lines;
|
||||||
|
// Only take the first 10 lines to reduce false positives- the compiler will throw an error if it's not the first non-comment line in a file
|
||||||
|
// (10 is used to account for copyright and extraneous newlines)
|
||||||
|
lines.slice(0, 10).forEach((line, i) => {
|
||||||
|
if (/\s*'use\s*strict\s*'/.test(line)) {
|
||||||
|
console.error(file.relative + '(' + (i + 1) + ',1): Unnecessary \'use strict\' - this is already added by the compiler');
|
||||||
|
errorCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.emit('data', file);
|
||||||
|
});
|
||||||
|
// {{SQL CARBON EDIT}} END
|
||||||
|
|
||||||
const formatting = es.map(function (file, cb) {
|
const formatting = es.map(function (file, cb) {
|
||||||
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
||||||
verify: false,
|
verify: false,
|
||||||
@@ -263,27 +322,52 @@ function hygiene(some) {
|
|||||||
.pipe(filter(f => !f.stat.isDirectory()))
|
.pipe(filter(f => !f.stat.isDirectory()))
|
||||||
.pipe(filter(indentationFilter))
|
.pipe(filter(indentationFilter))
|
||||||
.pipe(indentation)
|
.pipe(indentation)
|
||||||
.pipe(filter(copyrightFilter));
|
.pipe(filter(copyrightFilter))
|
||||||
// {{SQL CARBON EDIT}}
|
.pipe(copyrights);
|
||||||
// .pipe(copyrights);
|
|
||||||
|
|
||||||
const typescript = result
|
const typescript = result
|
||||||
.pipe(filter(tslintFilter))
|
.pipe(filter(tslintFilter))
|
||||||
.pipe(formatting)
|
.pipe(formatting)
|
||||||
.pipe(tsl);
|
.pipe(tsl)
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
|
.pipe(filter(useStrictFilter))
|
||||||
|
.pipe(useStrict);
|
||||||
|
|
||||||
const javascript = result
|
const javascript = result
|
||||||
.pipe(filter(eslintFilter))
|
.pipe(filter(eslintFilter))
|
||||||
.pipe(gulpeslint('src/.eslintrc'))
|
.pipe(gulpeslint('src/.eslintrc'))
|
||||||
.pipe(gulpeslint.formatEach('compact'));
|
.pipe(gulpeslint.formatEach('compact'))
|
||||||
// {{SQL CARBON EDIT}}
|
.pipe(gulpeslint.failAfterError());
|
||||||
// .pipe(gulpeslint.failAfterError());
|
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
return es.merge(typescript, javascript)
|
return es.merge(typescript, javascript)
|
||||||
.pipe(es.through(function (data) {
|
.pipe(es.through(function (data) {
|
||||||
// {{SQL CARBON EDIT}}
|
count++;
|
||||||
|
if (process.env['TRAVIS'] && count % 10 === 0) {
|
||||||
|
process.stdout.write('.');
|
||||||
|
}
|
||||||
|
this.emit('data', data);
|
||||||
|
}, function () {
|
||||||
|
process.stdout.write('\n');
|
||||||
|
|
||||||
|
const tslintResult = tsLinter.getResult();
|
||||||
|
if (tslintResult.failures.length > 0) {
|
||||||
|
for (const failure of tslintResult.failures) {
|
||||||
|
const name = failure.getFileName();
|
||||||
|
const position = failure.getStartPosition();
|
||||||
|
const line = position.getLineAndCharacter().line;
|
||||||
|
const character = position.getLineAndCharacter().character;
|
||||||
|
|
||||||
|
console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`);
|
||||||
|
}
|
||||||
|
errorCount += tslintResult.failures.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errorCount > 0) {
|
||||||
|
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
|
||||||
|
} else {
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,7 +385,7 @@ function createGitIndexVinyls(paths) {
|
|||||||
return e(err);
|
return e(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
|
cp.exec(`git show ":${relativePath}"`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return e(err);
|
return e(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,18 +6,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const json = require('gulp-json-editor');
|
|
||||||
const buffer = require('gulp-buffer');
|
|
||||||
const filter = require('gulp-filter');
|
|
||||||
const es = require('event-stream');
|
|
||||||
const vfs = require('vinyl-fs');
|
|
||||||
const pkg = require('../package.json');
|
|
||||||
const cp = require('child_process');
|
|
||||||
const fancyLog = require('fancy-log');
|
|
||||||
const ansiColors = require('ansi-colors');
|
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const jeditor = require('gulp-json-editor');
|
const jeditor = require('gulp-json-editor');
|
||||||
|
const product = require('../product.json');
|
||||||
|
|
||||||
gulp.task('mixin', function () {
|
gulp.task('mixin', function () {
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -34,19 +26,53 @@ gulp.task('mixin', function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}} - apply ADS insiders values if needed
|
||||||
let serviceUrl = 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json';
|
|
||||||
if (quality === 'insider') {
|
|
||||||
serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
|
|
||||||
}
|
|
||||||
let newValues = {
|
let newValues = {
|
||||||
|
"nameShort": product.nameShort,
|
||||||
|
"nameLong": product.nameLong,
|
||||||
|
"applicationName": product.applicationName,
|
||||||
|
"dataFolderName": product.dataFolderName,
|
||||||
|
"win32MutexName": product.win32MutexName,
|
||||||
|
"win32DirName": product.win32DirName,
|
||||||
|
"win32NameVersion": product.win32NameVersion,
|
||||||
|
"win32RegValueName": product.win32RegValueName,
|
||||||
|
"win32AppId": product.win32AppId,
|
||||||
|
"win32x64AppId": product.win32x64AppId,
|
||||||
|
"win32UserAppId": product.win32UserAppId,
|
||||||
|
"win32x64UserAppId": product.win32x64UserAppId,
|
||||||
|
"win32AppUserModelId": product.win32AppUserModelId,
|
||||||
|
"win32ShellNameShort": product.win32ShellNameShort,
|
||||||
|
"darwinBundleIdentifier": product.darwinBundleIdentifier,
|
||||||
"updateUrl": updateUrl,
|
"updateUrl": updateUrl,
|
||||||
"quality": quality,
|
"quality": quality,
|
||||||
"extensionsGallery": {
|
"extensionsGallery": {
|
||||||
"serviceUrl": serviceUrl
|
"serviceUrl": 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (quality === 'insider') {
|
||||||
|
let dashSuffix = '-insiders';
|
||||||
|
let dotSuffix = '.insiders';
|
||||||
|
let displaySuffix = ' - Insiders';
|
||||||
|
|
||||||
|
newValues.extensionsGallery.serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
|
||||||
|
newValues.nameShort += dashSuffix;
|
||||||
|
newValues.nameLong += displaySuffix;
|
||||||
|
newValues.applicationName += dashSuffix;
|
||||||
|
newValues.dataFolderName += dashSuffix;
|
||||||
|
newValues.win32MutexName += dashSuffix;
|
||||||
|
newValues.win32DirName += displaySuffix;
|
||||||
|
newValues.win32NameVersion += displaySuffix;
|
||||||
|
newValues.win32RegValueName += dashSuffix;
|
||||||
|
newValues.win32AppId = "{{9F0801B2-DEE3-4272-A2C6-FBDF25BAAF0F}";
|
||||||
|
newValues.win32x64AppId = "{{6748A5FD-29EB-4BA6-B3C6-E7B981B8D6B0}";
|
||||||
|
newValues.win32UserAppId = "{{0F8CD1ED-483C-40EB-8AD2-8ED784651AA1}";
|
||||||
|
newValues.win32x64UserAppId += dashSuffix;
|
||||||
|
newValues.win32AppUserModelId += dotSuffix;
|
||||||
|
newValues.win32ShellNameShort += displaySuffix;
|
||||||
|
newValues.darwinBundleIdentifier += dotSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
return gulp.src('./product.json')
|
return gulp.src('./product.json')
|
||||||
.pipe(jeditor(newValues))
|
.pipe(jeditor(newValues))
|
||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.'));
|
||||||
|
|||||||
@@ -3,18 +3,14 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { IFileStat } from 'vs/platform/files/common/files';
|
'use strict';
|
||||||
|
|
||||||
export function getByName(root: IFileStat, name: string): IFileStat | null {
|
const gulp = require('gulp');
|
||||||
if (root.children === undefined) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const child of root.children) {
|
const noop = () => { return Promise.resolve(); };
|
||||||
if (child.name === name) {
|
|
||||||
return child;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
gulp.task('vscode-reh-win32-ia32-min', noop);
|
||||||
}
|
gulp.task('vscode-reh-win32-x64-min', noop);
|
||||||
|
gulp.task('vscode-reh-darwin-min', noop);
|
||||||
|
gulp.task('vscode-reh-linux-x64-min', noop);
|
||||||
|
gulp.task('vscode-reh-linux-arm-min', noop);
|
||||||
@@ -28,7 +28,6 @@ const formatFiles = (some) => {
|
|||||||
console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
|
console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
console.error(result.message);
|
console.error(result.message);
|
||||||
errorCount++;
|
|
||||||
}
|
}
|
||||||
cb(null, file);
|
cb(null, file);
|
||||||
|
|
||||||
@@ -40,7 +39,7 @@ const formatFiles = (some) => {
|
|||||||
.pipe(filter(f => !f.stat.isDirectory()))
|
.pipe(filter(f => !f.stat.isDirectory()))
|
||||||
.pipe(formatting);
|
.pipe(formatting);
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
const formatStagedFiles = () => {
|
const formatStagedFiles = () => {
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
@@ -81,4 +80,4 @@ const formatStagedFiles = () => {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
@@ -33,12 +33,10 @@ const i18n = require('./lib/i18n');
|
|||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
||||||
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
||||||
const glob = require('glob');
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
const deps = require('./dependencies');
|
const deps = require('./dependencies');
|
||||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||||
const createAsar = require('./lib/asar').createAsar;
|
const createAsar = require('./lib/asar').createAsar;
|
||||||
const minimist = require('minimist');
|
|
||||||
const { compileBuildTask } = require('./gulpfile.compile');
|
const { compileBuildTask } = require('./gulpfile.compile');
|
||||||
|
|
||||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||||
@@ -54,7 +52,7 @@ const nodeModules = [
|
|||||||
'rxjs/Observable',
|
'rxjs/Observable',
|
||||||
'rxjs/Subject',
|
'rxjs/Subject',
|
||||||
'rxjs/Observer',
|
'rxjs/Observer',
|
||||||
'ng2-charts/ng2-charts']
|
'ng2-charts']
|
||||||
.concat(Object.keys(product.dependencies || {}))
|
.concat(Object.keys(product.dependencies || {}))
|
||||||
.concat(_.uniq(productionDependencies.map(d => d.name)))
|
.concat(_.uniq(productionDependencies.map(d => d.name)))
|
||||||
.concat(baseModules);
|
.concat(baseModules);
|
||||||
@@ -77,14 +75,16 @@ const vscodeResources = [
|
|||||||
'out-build/bootstrap-window.js',
|
'out-build/bootstrap-window.js',
|
||||||
'out-build/paths.js',
|
'out-build/paths.js',
|
||||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||||
|
'!out-build/vs/code/browser/**/*.html',
|
||||||
'out-build/vs/base/common/performance.js',
|
'out-build/vs/base/common/performance.js',
|
||||||
'out-build/vs/base/node/languagePacks.js',
|
'out-build/vs/base/node/languagePacks.js',
|
||||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
|
||||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||||
'out-build/vs/workbench/contrib/debug/**/*.json',
|
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||||
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||||
'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js',
|
'out-build/vs/workbench/contrib/webview/browser/pre/*.js',
|
||||||
|
'out-build/vs/workbench/contrib/webview/electron-browser/pre/*.js',
|
||||||
'out-build/vs/**/markdown.css',
|
'out-build/vs/**/markdown.css',
|
||||||
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||||
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
||||||
@@ -102,19 +102,17 @@ const vscodeResources = [
|
|||||||
'out-build/sql/parts/admin/**/*.html',
|
'out-build/sql/parts/admin/**/*.html',
|
||||||
'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}',
|
'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}',
|
||||||
'out-build/sql/parts/common/dblist/**/*.html',
|
'out-build/sql/parts/common/dblist/**/*.html',
|
||||||
'out-build/sql/parts/dashboard/**/*.html',
|
'out-build/sql/workbench/parts/dashboard/**/*.html',
|
||||||
'out-build/sql/parts/disasterRecovery/**/*.html',
|
'out-build/sql/parts/disasterRecovery/**/*.html',
|
||||||
'out-build/sql/parts/common/modal/media/**',
|
'out-build/sql/parts/common/modal/media/**',
|
||||||
'out-build/sql/parts/grid/load/lib/**',
|
'out-build/sql/workbench/parts/grid/media/**',
|
||||||
'out-build/sql/parts/grid/load/loadJquery.js',
|
'out-build/sql/workbench/parts/grid/views/**/*.html',
|
||||||
'out-build/sql/parts/grid/media/**',
|
|
||||||
'out-build/sql/parts/grid/views/**/*.html',
|
|
||||||
'out-build/sql/parts/tasks/**/*.html',
|
'out-build/sql/parts/tasks/**/*.html',
|
||||||
'out-build/sql/parts/taskHistory/viewlet/media/**',
|
'out-build/sql/parts/taskHistory/viewlet/media/**',
|
||||||
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
||||||
'out-build/sql/media/objectTypes/*.svg',
|
'out-build/sql/media/objectTypes/*.svg',
|
||||||
'out-build/sql/media/icons/*.svg',
|
'out-build/sql/media/icons/*.svg',
|
||||||
'out-build/sql/parts/notebook/media/**/*.svg',
|
'out-build/sql/workbench/parts/notebook/media/**/*.svg',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -337,33 +335,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
|||||||
|
|
||||||
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']))
|
||||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
|
.pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore')))
|
||||||
.pipe(util.cleanNodeModule('vscode-sqlite3', ['binding.gyp', 'benchmark/**', 'cloudformation/**', 'deps/**', 'test/**', 'build/**', 'src/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/*.js']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['build/Release/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/index.js']))
|
|
||||||
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
|
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
.pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**']))
|
|
||||||
.pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
|
||||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
|
||||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
|
||||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
|
||||||
.pipe(util.cleanNodeModule('vscode-windows-ca-certs', ['**/*'], ['package.json', '**/*.node']))
|
|
||||||
.pipe(util.cleanNodeModule('node-addon-api', ['**/*']))
|
|
||||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -426,14 +398,18 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
|||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
|
||||||
.pipe(replace('@@NAME@@', product.nameShort))
|
.pipe(replace('@@NAME@@', product.nameShort))
|
||||||
|
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
||||||
|
.pipe(replace('@@VERSION@@', version))
|
||||||
.pipe(replace('@@COMMIT@@', commit))
|
.pipe(replace('@@COMMIT@@', commit))
|
||||||
.pipe(replace('@@APPNAME@@', product.applicationName))
|
.pipe(replace('@@APPNAME@@', product.applicationName))
|
||||||
|
.pipe(replace('@@QUALITY@@', quality))
|
||||||
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
|
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
|
||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
|
||||||
.pipe(rename(product.nameShort + '.VisualElementsManifest.xml')));
|
.pipe(rename(product.nameShort + '.VisualElementsManifest.xml')));
|
||||||
} else if (platform === 'linux') {
|
} else if (platform === 'linux') {
|
||||||
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
|
||||||
|
.pipe(replace('@@PRODNAME@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(rename('bin/' + product.applicationName)));
|
.pipe(rename('bin/' + product.applicationName)));
|
||||||
}
|
}
|
||||||
@@ -477,8 +453,6 @@ BUILD_TARGETS.forEach(buildTarget => {
|
|||||||
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||||
util.rimraf(path.join(buildRoot, destinationFolderName))
|
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||||
),
|
),
|
||||||
ext.packageExtensionTask('mssql', platform, arch),
|
|
||||||
ext.packageExtensionTask('azurecore', platform, arch),
|
|
||||||
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||||
));
|
));
|
||||||
gulp.task(vscodeTask);
|
gulp.task(vscodeTask);
|
||||||
@@ -703,3 +677,26 @@ function installService() {
|
|||||||
gulp.task('install-sqltoolsservice', () => {
|
gulp.task('install-sqltoolsservice', () => {
|
||||||
return installService();
|
return installService();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function installSsmsMin() {
|
||||||
|
const config = require('../extensions/admin-tool-ext-win/src/config.json');
|
||||||
|
return platformInfo.getCurrent().then(p => {
|
||||||
|
const runtime = p.runtimeId;
|
||||||
|
// fix path since it won't be correct
|
||||||
|
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
|
||||||
|
var installer = new serviceDownloader(config);
|
||||||
|
const serviceInstallFolder = installer.getInstallDirectory(runtime);
|
||||||
|
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
|
||||||
|
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
|
||||||
|
return del(serviceCleanupFolder + '/*').then(() => {
|
||||||
|
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
|
||||||
|
return installer.installService(runtime);
|
||||||
|
}, delError => {
|
||||||
|
console.log('failed to delete the install folder error: ' + delError);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
gulp.task('install-ssmsmin', () => {
|
||||||
|
return installSsmsMin();
|
||||||
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
|
|||||||
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||||
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
||||||
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
||||||
const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
// const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
||||||
|
|
||||||
function packageInnoSetup(iss, options, cb) {
|
function packageInnoSetup(iss, options, cb) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|||||||
@@ -40,8 +40,19 @@ function packageBuiltInExtensions() {
|
|||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||||
|
const visxDirectory = path.join(path.dirname(root), 'vsix');
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(visxDirectory)) {
|
||||||
|
fs.mkdirSync(visxDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// don't fail the build if the output directory already exists
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
|
||||||
|
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
|
||||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||||
vsce.createVSIX({
|
vsce.createVSIX({
|
||||||
cwd: element.path,
|
cwd: element.path,
|
||||||
@@ -237,6 +248,7 @@ exports.fromMarketplace = fromMarketplace;
|
|||||||
const excludedExtensions = [
|
const excludedExtensions = [
|
||||||
'vscode-api-tests',
|
'vscode-api-tests',
|
||||||
'vscode-colorize-tests',
|
'vscode-colorize-tests',
|
||||||
|
'vscode-test-resolver',
|
||||||
'ms-vscode.node-debug',
|
'ms-vscode.node-debug',
|
||||||
'ms-vscode.node-debug2',
|
'ms-vscode.node-debug2',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -252,9 +264,11 @@ const sqlBuiltInExtensions = [
|
|||||||
'profiler',
|
'profiler',
|
||||||
'admin-pack',
|
'admin-pack',
|
||||||
'big-data-cluster',
|
'big-data-cluster',
|
||||||
'dacpac'
|
'dacpac',
|
||||||
|
'schema-compare',
|
||||||
|
'resource-deployment',
|
||||||
|
'cms'
|
||||||
];
|
];
|
||||||
var azureExtensions = ['azurecore', 'mssql'];
|
|
||||||
const builtInExtensions = require('../builtInExtensions.json');
|
const builtInExtensions = require('../builtInExtensions.json');
|
||||||
/**
|
/**
|
||||||
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
||||||
@@ -290,8 +304,7 @@ function packageExtensionsStream(optsIn) {
|
|||||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
|
||||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||||
@@ -301,9 +314,7 @@ function packageExtensionsStream(optsIn) {
|
|||||||
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||||
];
|
];
|
||||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']));
|
||||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
|
||||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
|
||||||
// Original code commented out here
|
// Original code commented out here
|
||||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||||
// const marketplaceExtensions = () => es.merge(
|
// const marketplaceExtensions = () => es.merge(
|
||||||
|
|||||||
@@ -43,8 +43,18 @@ export function packageBuiltInExtensions() {
|
|||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||||
|
const visxDirectory = path.join(path.dirname(root), 'vsix');
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(visxDirectory)) {
|
||||||
|
fs.mkdirSync(visxDirectory);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// don't fail the build if the output directory already exists
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
|
||||||
|
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
|
||||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||||
vsce.createVSIX({
|
vsce.createVSIX({
|
||||||
cwd: element.path,
|
cwd: element.path,
|
||||||
@@ -283,6 +293,7 @@ interface IPackageExtensionsOptions {
|
|||||||
const excludedExtensions = [
|
const excludedExtensions = [
|
||||||
'vscode-api-tests',
|
'vscode-api-tests',
|
||||||
'vscode-colorize-tests',
|
'vscode-colorize-tests',
|
||||||
|
'vscode-test-resolver',
|
||||||
'ms-vscode.node-debug',
|
'ms-vscode.node-debug',
|
||||||
'ms-vscode.node-debug2',
|
'ms-vscode.node-debug2',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -299,9 +310,11 @@ const sqlBuiltInExtensions = [
|
|||||||
'profiler',
|
'profiler',
|
||||||
'admin-pack',
|
'admin-pack',
|
||||||
'big-data-cluster',
|
'big-data-cluster',
|
||||||
'dacpac'
|
'dacpac',
|
||||||
|
'schema-compare',
|
||||||
|
'resource-deployment',
|
||||||
|
'cms'
|
||||||
];
|
];
|
||||||
var azureExtensions = ['azurecore', 'mssql'];
|
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
|
|
||||||
interface IBuiltInExtension {
|
interface IBuiltInExtension {
|
||||||
@@ -350,8 +363,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
|
|||||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
|
||||||
|
|
||||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||||
@@ -365,8 +377,6 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
|
|||||||
|
|
||||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||||
.pipe(filter(['**', '!**/package-lock.json']))
|
.pipe(filter(['**', '!**/package-lock.json']))
|
||||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
|
||||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
|
||||||
|
|
||||||
// Original code commented out here
|
// Original code commented out here
|
||||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||||
|
|||||||
@@ -110,6 +110,10 @@
|
|||||||
"name": "vs/workbench/contrib/quickopen",
|
"name": "vs/workbench/contrib/quickopen",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/remote",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/contrib/relauncher",
|
"name": "vs/workbench/contrib/relauncher",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
@@ -222,10 +226,6 @@
|
|||||||
"name": "vs/workbench/services/files",
|
"name": "vs/workbench/services/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "vs/workbench/services/files2",
|
|
||||||
"project": "vscode-workbench"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/integrity",
|
"name": "vs/workbench/services/integrity",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function log(message: any, ...rest: any[]): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Language {
|
export interface Language {
|
||||||
id: string; // laguage id, e.g. zh-tw, de
|
id: string; // language id, e.g. zh-tw, de
|
||||||
translationId?: string; // language id used in translation tools, e.g zh-hant, de (optional, if not set, the id is used)
|
translationId?: string; // language id used in translation tools, e.g zh-hant, de (optional, if not set, the id is used)
|
||||||
folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used)
|
folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ function extractEditor(options) {
|
|||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
|
compilerOptions.noImplicitAny = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
let result = tss.shake(options);
|
let result = tss.shake(options);
|
||||||
@@ -90,6 +91,8 @@ function extractEditor(options) {
|
|||||||
}
|
}
|
||||||
delete tsConfig.compilerOptions.moduleResolution;
|
delete tsConfig.compilerOptions.moduleResolution;
|
||||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||||
|
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
|
||||||
|
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
|
||||||
[
|
[
|
||||||
'vs/css.build.js',
|
'vs/css.build.js',
|
||||||
'vs/css.d.ts',
|
'vs/css.d.ts',
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
|
compilerOptions.noImplicitAny = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
|
|
||||||
|
|
||||||
@@ -99,6 +100,8 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
|
|
||||||
delete tsConfig.compilerOptions.moduleResolution;
|
delete tsConfig.compilerOptions.moduleResolution;
|
||||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||||
|
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
|
||||||
|
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
|
||||||
|
|
||||||
[
|
[
|
||||||
'vs/css.build.js',
|
'vs/css.build.js',
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ async function _doExecute(task) {
|
|||||||
// Always invoke as if it were a callback task
|
// Always invoke as if it were a callback task
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (task.length === 1) {
|
if (task.length === 1) {
|
||||||
// this is a calback task
|
// this is a callback task
|
||||||
task((err) => {
|
task((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ async function _doExecute(task: Task): Promise<void> {
|
|||||||
// Always invoke as if it were a callback task
|
// Always invoke as if it were a callback task
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (task.length === 1) {
|
if (task.length === 1) {
|
||||||
// this is a calback task
|
// this is a callback task
|
||||||
task((err) => {
|
task((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const ts = require("typescript");
|
const ts = require("typescript");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ const es = require("event-stream");
|
|||||||
const debounce = require("debounce");
|
const debounce = require("debounce");
|
||||||
const _filter = require("gulp-filter");
|
const _filter = require("gulp-filter");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const _ = require("underscore");
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const _rimraf = require("rimraf");
|
const _rimraf = require("rimraf");
|
||||||
@@ -100,22 +99,18 @@ function skipDirectories() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.skipDirectories = skipDirectories;
|
exports.skipDirectories = skipDirectories;
|
||||||
function cleanNodeModule(name, excludes, includes) {
|
function cleanNodeModules(rulePath) {
|
||||||
const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : '');
|
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||||
const negate = (str) => '!' + str;
|
.split(/\r?\n/g)
|
||||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
.map(line => line.trim())
|
||||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob)));
|
.filter(line => line && !/^#/.test(line));
|
||||||
|
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||||
|
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const nodeModuleInput = input.pipe(allFilter);
|
const output = es.merge(input.pipe(_filter(['**', ...excludes])), input.pipe(_filter(includes)));
|
||||||
let output = nodeModuleInput.pipe(_filter(globs));
|
|
||||||
if (includes) {
|
|
||||||
const includeGlobs = includes.map(toGlob);
|
|
||||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
|
||||||
}
|
|
||||||
output = output.pipe(allFilter.restore);
|
|
||||||
return es.duplex(input, output);
|
return es.duplex(input, output);
|
||||||
}
|
}
|
||||||
exports.cleanNodeModule = cleanNodeModule;
|
exports.cleanNodeModules = cleanNodeModules;
|
||||||
function loadSourcemaps() {
|
function loadSourcemaps() {
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const output = input
|
const output = input
|
||||||
|
|||||||
@@ -132,23 +132,21 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
|
export function cleanNodeModules(rulePath: string): NodeJS.ReadWriteStream {
|
||||||
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
|
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||||
const negate = (str: string) => '!' + str;
|
.split(/\r?\n/g)
|
||||||
|
.map(line => line.trim())
|
||||||
|
.filter(line => line && !/^#/.test(line));
|
||||||
|
|
||||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob) as (x: string) => string));
|
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||||
|
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const nodeModuleInput = input.pipe(allFilter);
|
const output = es.merge(
|
||||||
let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs));
|
input.pipe(_filter(['**', ...excludes])),
|
||||||
|
input.pipe(_filter(includes))
|
||||||
|
);
|
||||||
|
|
||||||
if (includes) {
|
|
||||||
const includeGlobs = includes.map(toGlob);
|
|
||||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
|
||||||
}
|
|
||||||
|
|
||||||
output = output.pipe(allFilter.restore);
|
|
||||||
return es.duplex(input, output);
|
return es.duplex(input, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ function yarnInstall(location, opts) {
|
|||||||
|
|
||||||
yarnInstall('extensions'); // node modules shared by all extensions
|
yarnInstall('extensions'); // node modules shared by all extensions
|
||||||
|
|
||||||
|
yarnInstall('remote'); // node modules used by vscode server
|
||||||
|
|
||||||
const allExtensionFolders = fs.readdirSync('extensions');
|
const allExtensionFolders = fs.readdirSync('extensions');
|
||||||
const extensions = allExtensionFolders.filter(e => {
|
const extensions = allExtensionFolders.filter(e => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ function update(options) {
|
|||||||
let translationPaths = [];
|
let translationPaths = [];
|
||||||
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId }, translationPaths)
|
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId }, translationPaths)
|
||||||
.on('error', (error) => {
|
.on('error', (error) => {
|
||||||
console.log(`Error occured while importing translations:`);
|
console.log(`Error occurred while importing translations:`);
|
||||||
translationPaths = undefined;
|
translationPaths = undefined;
|
||||||
if (Array.isArray(error)) {
|
if (Array.isArray(error)) {
|
||||||
error.forEach(console.log);
|
error.forEach(console.log);
|
||||||
@@ -100,7 +100,7 @@ function update(options) {
|
|||||||
gulp.src(path.join(location, languageId, '**', '*.xlf'))
|
gulp.src(path.join(location, languageId, '**', '*.xlf'))
|
||||||
.pipe(i18n.prepareI18nPackFiles(i18n.externalExtensionsWithTranslations, translationPaths, languageId === 'ps'))
|
.pipe(i18n.prepareI18nPackFiles(i18n.externalExtensionsWithTranslations, translationPaths, languageId === 'ps'))
|
||||||
.on('error', (error) => {
|
.on('error', (error) => {
|
||||||
console.log(`Error occured while importing translations:`);
|
console.log(`Error occurred while importing translations:`);
|
||||||
translationPaths = undefined;
|
translationPaths = undefined;
|
||||||
if (Array.isArray(error)) {
|
if (Array.isArray(error)) {
|
||||||
error.forEach(console.log);
|
error.forEach(console.log);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
"request": "^2.85.0",
|
"request": "^2.85.0",
|
||||||
"tslint": "^5.9.1",
|
"tslint": "^5.9.1",
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||||
"typescript": "3.3.1",
|
"typescript": "3.4.5",
|
||||||
"vsce": "1.48.0",
|
"vsce": "1.48.0",
|
||||||
"xml2js": "^0.4.17"
|
"xml2js": "^0.4.17"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
// enable JavaScript type checking for the language service
|
// enable JavaScript type checking for the language service
|
||||||
// use the tsconfig.build.json for compiling wich disable JavaScript
|
// use the tsconfig.build.json for compiling which disable JavaScript
|
||||||
// type checking so that JavaScript file are not transpiled
|
// type checking so that JavaScript file are not transpiled
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNot
|
|||||||
Type: filesandordirs; Name: "{app}\_"
|
Type: filesandordirs; Name: "{app}\_"
|
||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce; Check: IsNotUpdate
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked;
|
||||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
|
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
|
||||||
Name: "associatewithfiles"; Description: "{cm:AssociateWithFiles,{#NameLong}}"; GroupDescription: "{cm:Other}"; Flags: unchecked
|
Name: "associatewithfiles"; Description: "{cm:AssociateWithFiles,{#NameLong}}"; GroupDescription: "{cm:Other}"; Flags: unchecked
|
||||||
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
|
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
|
||||||
@@ -133,7 +133,7 @@ begin
|
|||||||
|
|
||||||
#if "user" == InstallTarget
|
#if "user" == InstallTarget
|
||||||
if not WizardSilent() and IsAdminLoggedOn() then begin
|
if not WizardSilent() and IsAdminLoggedOn() then begin
|
||||||
if MsgBox('This User Installer is not meant to be run as an Administrator. If you would like to install VS Code for all users in this system, download the System Installer instead from https://code.visualstudio.com. Are you sure you want to continue?', mbError, MB_OKCANCEL) = IDCANCEL then begin
|
if MsgBox('This User Installer is not meant to be run as an Administrator. If you would like to install Azure Data Studio for all users in this system, download the System Installer instead from https://docs.microsoft.com/sql/azure-data-studio/download. Are you sure you want to continue?', mbError, MB_OKCANCEL) = IDCANCEL then begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -3201,10 +3201,10 @@ typed-rest-client@^0.9.0:
|
|||||||
tunnel "0.0.4"
|
tunnel "0.0.4"
|
||||||
underscore "1.8.3"
|
underscore "1.8.3"
|
||||||
|
|
||||||
typescript@3.3.1:
|
typescript@3.4.5:
|
||||||
version "3.3.1"
|
version "3.4.5"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
|
||||||
integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA==
|
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
|
||||||
|
|
||||||
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
|
|||||||
@@ -73,12 +73,12 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"repositoryUrl": "https://github.com/electron/electron",
|
"repositoryUrl": "https://github.com/electron/electron",
|
||||||
"commitHash": "73158a6419a3e2da9e4d523e1131052abd28fbbb"
|
"commitHash": "e84a6860e35e14b4031b88bb9b49841cdb89a305"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "3.1.6"
|
"version": "3.1.8"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -111,11 +111,11 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "vscode-octicons-font",
|
"name": "vscode-octicons-font",
|
||||||
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
|
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
|
||||||
"commitHash": "5095860bb929919670646e2dfa0ee47d9b93bcb9"
|
"commitHash": "4f69de3a233ed501c2098e33047e116ac2fbbf42"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "1.0.0"
|
"version": "1.1.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
out/test/**
|
out/test/**
|
||||||
src/**
|
src/**
|
||||||
ssmsmin/**
|
|
||||||
.gitignore
|
.gitignore
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
|
InstallSsmsMin.bat
|
||||||
4
extensions/admin-tool-ext-win/InstallSsmsMin.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
REM Run this command to install SsmsMin for local development testing
|
||||||
|
gulp install-ssmsmin
|
||||||
@@ -1,9 +1,26 @@
|
|||||||
# Database Admin Tool Extensions for Windows
|
# Database Admin Tool Extensions for Windows *(preview)*
|
||||||
|
|
||||||
This adds Windows-specific functionality into Azure Data Studio.
|
The Database Admin Tool Extensions for Windows adds Windows-specific functionality into Azure Data Studio. Currently this
|
||||||
|
functionality includes the ability to launch a set of SQL Server Management Studio experiences directly from Azure Data Studio.
|
||||||
|
|
||||||
|
These experiences include:
|
||||||
|
|
||||||
|
* SSMS Property dialogs for select object types, such as Databases, Views, Stored Procedures and more
|
||||||
|
* The [Generate Scripts Wizard](https://docs.microsoft.com/en-us/sql/ssms/scripting/generate-and-publish-scripts-wizard)
|
||||||
|
|
||||||
|
### How do I launch these experiences?
|
||||||
|
|
||||||
|
Both of these are available as menu items on the context menu for nodes in the Object Explorer tree. Right click on a node that supports one of the experiences and select the appropriate item.
|
||||||
|
|
||||||
|
**Properties** for the property dialogs of supported object types
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Generate Scripts...** for the Generate Scripts Wizard (only available on Database nodes)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||||
|
|
||||||
## Privacy Statement
|
## Privacy Statement
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
MICROSOFT SOFTWARE LICENSE TERMS
|
||||||
|
MICROSOFT AZURE DATA STUDIO EXTENSION
|
||||||
|
________________________________________
|
||||||
|
These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
|
||||||
|
|
||||||
|
1. INSTALLATION AND USE RIGHTS.
|
||||||
|
|
||||||
|
a) General. You may install and use one copy of the software on your device.
|
||||||
|
|
||||||
|
b) Third Party Software. The software may include third party applications that are licensed to you under this agreement or under their own terms. License terms, notices, and acknowledgements, if any, for the third party applications may be accessible online at http://aka.ms/thirdpartynotices or in an accompanying notices file. Even if such applications are governed by other agreements, the disclaimer, limitations on, and exclusions of damages below also apply to the extent allowed by applicable law.
|
||||||
|
|
||||||
|
2. DISTRIBUTABLE CODE. The software may contain code you are permitted to distribute (i.e. make available for third parties) in applications you develop, as described in this Section.
|
||||||
|
|
||||||
|
a) Distribution Rights. The code and files described below are distributable if included with the software.
|
||||||
|
|
||||||
|
i. Sample Code, Templates, and Styles. You may copy, modify, and distribute the source and object code form of code marked as “sample”, “template”, “simple styles”, and “sketch styles”.
|
||||||
|
|
||||||
|
ii. Third Party Distribution. You may permit distributors of your applications to copy and distribute any of this distributable code you elect to distribute with your applications.
|
||||||
|
|
||||||
|
b) Distribution Requirements. For any code you distribute, you must:
|
||||||
|
|
||||||
|
i. add significant primary functionality to it in your applications;
|
||||||
|
|
||||||
|
ii. require distributors and external end users to agree to terms that protect it and Microsoft at least as much as this agreement; and
|
||||||
|
|
||||||
|
iii. indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your applications, except to the extent that any claim is based solely on the unmodified distributable code.
|
||||||
|
|
||||||
|
c) Distribution Restrictions. You may not:
|
||||||
|
|
||||||
|
i. use Microsoft’s trademarks or trade dress in your application in any way that suggests your application comes from or is endorsed by Microsoft; or
|
||||||
|
|
||||||
|
ii. modify or distribute the source code of any distributable code so that any part of it becomes subject to any license that requires that the distributable code, any other part of the software, or any of Microsoft’s other intellectual property be disclosed or distributed in source code form, or that others have the right to modify it.
|
||||||
|
|
||||||
|
3. DATA COLLECTION. The software may collect information about you and your use of the software and send that to Microsoft. Microsoft may use this information to provide services and improve Microsoft’s products and services. Your opt-out rights, if any, are described in the product documentation. Some features in the software may enable collection of data from users of your applications that access or use the software. If you use these features to enable data collection in your applications, you must comply with applicable law, including getting any required user consent, and maintain a prominent privacy policy that accurately informs users about how you use, collect, and share their data. You can learn more about Microsoft’s data collection and use in the product documentation and the Microsoft Privacy Statement at https://go.microsoft.com/fwlink/?LinkId=512132. You agree to comply with all applicable provisions of the Microsoft Privacy Statement.
|
||||||
|
|
||||||
|
4. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to):
|
||||||
|
|
||||||
|
a) work around any technical limitations in the software that only allow you to use it in certain ways;
|
||||||
|
|
||||||
|
b) reverse engineer, decompile or disassemble the software;
|
||||||
|
|
||||||
|
c) remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software;
|
||||||
|
|
||||||
|
d) use the software in any way that is against the law or to create or propagate malware; or
|
||||||
|
|
||||||
|
e) share, publish, distribute, or lend the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone hosted solution for others to use, or transfer the software or this agreement to any third party.
|
||||||
|
|
||||||
|
5. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit http://aka.ms/exporting.
|
||||||
|
|
||||||
|
6. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
|
||||||
|
|
||||||
|
7. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software.
|
||||||
|
|
||||||
|
8. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles. If you acquired the software in any other country, its laws apply. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court. If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court.
|
||||||
|
|
||||||
|
9. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you:
|
||||||
|
|
||||||
|
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights.
|
||||||
|
|
||||||
|
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software.
|
||||||
|
|
||||||
|
c) Germany and Austria.
|
||||||
|
|
||||||
|
i. Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software.
|
||||||
|
|
||||||
|
ii. Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law.
|
||||||
|
|
||||||
|
Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence.
|
||||||
|
|
||||||
|
10. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
|
||||||
|
11. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT, OR INCIDENTAL DAMAGES.
|
||||||
|
|
||||||
|
This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law.
|
||||||
|
|
||||||
|
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages.
|
||||||
|
|
||||||
|
Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French.
|
||||||
|
|
||||||
|
Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
|
||||||
|
|
||||||
|
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
|
||||||
|
|
||||||
|
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
|
||||||
|
|
||||||
|
Cette limitation concerne:
|
||||||
|
|
||||||
|
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et
|
||||||
|
|
||||||
|
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
|
||||||
|
|
||||||
|
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
|
||||||
|
|
||||||
|
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
|
||||||
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "admin-tool-ext-win",
|
"name": "admin-tool-ext-win",
|
||||||
"displayName": "Database Admin Tool Extensions for Windows",
|
"displayName": "%adminToolExtWin.displayName%",
|
||||||
"description": "Adds additional Windows-specific functionality to Azure Data Studio",
|
"description": "%adminToolExtWin.description%",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/extensions/admin-tool-ext-win/license/Azure%20Data%20Studio%20Extension%20-%20Standalone%20(free)%20Use%20Terms.txt",
|
||||||
"icon": "images/sqlserver.png",
|
"icon": "images/sqlserver.png",
|
||||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.30.1",
|
"vscode": "^1.30.1",
|
||||||
"sqlops": "*"
|
"azdata": ">=1.8.0"
|
||||||
},
|
},
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"*"
|
"*"
|
||||||
@@ -26,23 +26,42 @@
|
|||||||
"contributes": {
|
"contributes": {
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
"command": "adminToolExtWin.launchSsmsMinPropertiesDialog",
|
||||||
"title": "%adminToolExtWin.launchSsmsServerPropertiesDialog%",
|
"title": "%adminToolExtWin.propertiesMenuItem%",
|
||||||
|
"category": "AdminToolExtWin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsMinGswDialog",
|
||||||
|
"title": "%adminToolExtWin.launchGswMenuItem%",
|
||||||
"category": "AdminToolExtWin"
|
"category": "AdminToolExtWin"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"menus": {
|
"menus": {
|
||||||
"commandPalette": [
|
"commandPalette": [
|
||||||
{
|
{
|
||||||
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
"command": "adminToolExtWin.launchSsmsMinPropertiesDialog",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsMinGswDialog",
|
||||||
"when": "false"
|
"when": "false"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"objectExplorer/item/context": [
|
"objectExplorer/item/context": [
|
||||||
{
|
{
|
||||||
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
"command": "adminToolExtWin.launchSsmsMinGswDialog",
|
||||||
"when": "isWindows && connectionProvider == MSSQL && nodeType && nodeType == Server",
|
"when": "isWindows && connectionProvider == MSSQL && nodeType && nodeType == Database",
|
||||||
"group": "AdminToolExtWin"
|
"group": "z-AdminToolExt@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsMinPropertiesDialog",
|
||||||
|
"when": "isWindows && connectionProvider == MSSQL && serverInfo && !isCloud && nodeType && nodeType == Server",
|
||||||
|
"group": "z-AdminToolExt@2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsMinPropertiesDialog",
|
||||||
|
"when": "isWindows && connectionProvider == MSSQL && serverInfo && nodeType && nodeType =~ /^(Database|Table|Column|Index|Statistic|View|ServerLevelLogin|ServerLevelServerRole|ServerLevelCredential|ServerLevelServerAudit|ServerLevelServerAuditSpecification|StoredProcedure|ScalarValuedFunction|TableValuedFunction|AggregateFunction|Synonym|Assembly|UserDefinedDataType|UserDefinedType|UserDefinedTableType|Sequence|User|DatabaseRole|ApplicationRole|Schema|SecurityPolicy|ServerLevelLinkedServer)$/",
|
||||||
|
"group": "z-AdminToolExt@2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -51,7 +70,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
|
||||||
"vscode-extension-telemetry": "^0.0.15",
|
"vscode-extension-telemetry": "^0.0.15",
|
||||||
"vscode-nls": "^3.2.1"
|
"vscode-nls": "^3.2.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"adminToolExtWin.launchSsmsServerPropertiesDialog": "Properties"
|
"adminToolExtWin.displayName": "Database Administration Tool Extensions for Windows",
|
||||||
|
"adminToolExtWin.description": "Adds additional Windows-specific functionality to Azure Data Studio",
|
||||||
|
"adminToolExtWin.propertiesMenuItem": "Properties",
|
||||||
|
"adminToolExtWin.launchGswMenuItem": "Generate Scripts..."
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}",
|
"downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}",
|
||||||
"version": "15.0.18092.0",
|
"version": "15.0.18124.0",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_64": "SsmsMin-15.0.18092.0-win-x64.zip",
|
"Windows_64": "SsmsMin-15.0.18124.0-win-x64.zip",
|
||||||
"Windows_86": "SsmsMin-15.0.18092.0-win-x86.zip"
|
"Windows_86": "SsmsMin-15.0.18124.0-win-x86.zip"
|
||||||
},
|
},
|
||||||
"installDirectory": "ssmsmin/{#platform#}/{#version#}",
|
"installDirectory": "ssmsmin/{#platform#}/{#version#}",
|
||||||
"executableFiles": [
|
"executableFiles": [
|
||||||
|
|||||||
@@ -2,23 +2,55 @@
|
|||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
///
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { IConfig, ServerProvider } from 'service-downloader';
|
|
||||||
import { Telemetry } from './telemetry';
|
import { Telemetry } from './telemetry';
|
||||||
import * as utils from './utils';
|
import { doubleEscapeSingleQuotes, backEscapeDoubleQuotes, getTelemetryErrorType } from './utils';
|
||||||
import { ChildProcess, exec, ExecException } from 'child_process';
|
import { ChildProcess, exec } from 'child_process';
|
||||||
import { stringify } from 'querystring';
|
|
||||||
|
|
||||||
const baseConfig = require('./config.json');
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
const ssmsMinVer = JSON.parse(JSON.stringify(require('./config.json'))).version;
|
||||||
|
|
||||||
let exePath: string;
|
let exePath: string;
|
||||||
let runningProcesses: Map<number, ChildProcess> = new Map<number, ChildProcess>();
|
const runningProcesses: Map<number, ChildProcess> = new Map<number, ChildProcess>();
|
||||||
|
|
||||||
|
interface SmoMapping {
|
||||||
|
action: string;
|
||||||
|
urnName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nodeTypeToUrnNameMapping: { [oeNodeType: string]: SmoMapping } = {
|
||||||
|
'Database': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Database', urnName: 'Database' },
|
||||||
|
'Server': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Server', urnName: 'Server' },
|
||||||
|
'ServerLevelServerAudit': { action: 'sqla:AuditProperties', urnName: 'Audit' },
|
||||||
|
'ServerLevelCredential': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Credential', urnName: 'Credential' },
|
||||||
|
'ServerLevelServerRole': { action: 'sqla:ManageServerRole', urnName: 'Role' },
|
||||||
|
'ServerLevelServerAuditSpecification': { action: 'sqla:ServerAuditSpecificationProperties', urnName: 'ServerAuditSpecification' },
|
||||||
|
'ServerLevelLinkedServer': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.LinkedServer', urnName: 'LinkedServer' },
|
||||||
|
'Table': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Table', urnName: 'Table' },
|
||||||
|
'View': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.View', urnName: 'View' },
|
||||||
|
'Column': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Column', urnName: 'Column' },
|
||||||
|
'Index': { action: 'sqla:IndexProperties', urnName: 'Index' },
|
||||||
|
'Statistic': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Statistic', urnName: 'Statistic' },
|
||||||
|
'StoredProcedure': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.StoredProcedure', urnName: 'StoredProcedure' },
|
||||||
|
'ScalarValuedFunction': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedFunction', urnName: 'UserDefinedFunction' },
|
||||||
|
'TableValuedFunction': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedFunction', urnName: 'UserDefinedFunction' },
|
||||||
|
'AggregateFunction': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedFunction', urnName: 'UserDefinedFunction' },
|
||||||
|
'Synonym': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Synonym', urnName: 'Synonym' },
|
||||||
|
'Assembly': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.SqlAssembly', urnName: 'SqlAssembly' },
|
||||||
|
'UserDefinedDataType': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedDataType', urnName: 'UserDefinedDataType' },
|
||||||
|
'UserDefinedType': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedType', urnName: 'UserDefinedType' },
|
||||||
|
'UserDefinedTableType': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.UserDefinedTableType', urnName: 'UserDefinedTableType' },
|
||||||
|
'Sequence': { action: 'sqla:SequenceProperties', urnName: 'Sequence' },
|
||||||
|
'User': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.User', urnName: 'User' },
|
||||||
|
'DatabaseRole': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.DatabaseRole', urnName: 'Role' },
|
||||||
|
'ApplicationRole': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.ApplicationRole', urnName: 'ApplicationRole' },
|
||||||
|
'Schema': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Schema', urnName: 'Schema' },
|
||||||
|
'SecurityPolicy': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.SecurityPolicy', urnName: 'SecurityPolicy' },
|
||||||
|
'ServerLevelLogin': { action: 'sqla:Properties@Microsoft.SqlServer.Management.Smo.Login', urnName: 'Login' },
|
||||||
|
};
|
||||||
|
|
||||||
// Params to pass to SsmsMin.exe, only an action and server are required - the rest are optional based on the
|
// Params to pass to SsmsMin.exe, only an action and server are required - the rest are optional based on the
|
||||||
// action used. Exported for use in testing.
|
// action used. Exported for use in testing.
|
||||||
@@ -27,7 +59,6 @@ export interface LaunchSsmsDialogParams {
|
|||||||
server: string;
|
server: string;
|
||||||
database?: string;
|
database?: string;
|
||||||
user?: string;
|
user?: string;
|
||||||
password?: string;
|
|
||||||
useAad?: boolean;
|
useAad?: boolean;
|
||||||
urn?: string;
|
urn?: string;
|
||||||
}
|
}
|
||||||
@@ -35,39 +66,8 @@ export interface LaunchSsmsDialogParams {
|
|||||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||||
// This is for Windows-specific support so do nothing on other platforms
|
// This is for Windows-specific support so do nothing on other platforms
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
Telemetry.sendTelemetryEvent('startup/ExtensionActivated');
|
exePath = path.join(context.extensionPath, 'ssmsmin', 'Windows', ssmsMinVer, 'ssmsmin.exe');
|
||||||
|
registerCommands(context);
|
||||||
let config: IConfig = JSON.parse(JSON.stringify(baseConfig));
|
|
||||||
config.installDirectory = path.join(context.extensionPath, config.installDirectory);
|
|
||||||
config.proxy = utils.getConfiguration('http').get('proxy');
|
|
||||||
config.strictSSL = utils.getConfiguration('http').get('proxyStrictSSL') || true;
|
|
||||||
|
|
||||||
const serverdownloader = new ServerProvider(config);
|
|
||||||
const installationStart = Date.now();
|
|
||||||
|
|
||||||
try {
|
|
||||||
let downloadedExePath = await serverdownloader.getOrDownloadServer();
|
|
||||||
const installationComplete = Date.now();
|
|
||||||
|
|
||||||
// Don't register the command if we couldn't find the EXE since it won't be able to do anything
|
|
||||||
if (downloadedExePath) {
|
|
||||||
exePath = downloadedExePath;
|
|
||||||
} else {
|
|
||||||
throw new Error('Could not find SsmsMin.exe after downloading');
|
|
||||||
}
|
|
||||||
// Add the command now that we have the exePath to run the tool with
|
|
||||||
context.subscriptions.push(
|
|
||||||
vscode.commands.registerCommand('adminToolExtWin.launchSsmsServerPropertiesDialog', handleLaunchSsmsServerPropertiesDialogCommand));
|
|
||||||
|
|
||||||
Telemetry.sendTelemetryEvent('startup/ExtensionStarted', {
|
|
||||||
installationTime: String(installationComplete - installationStart),
|
|
||||||
beginningTimestamp: String(installationStart)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
Telemetry.sendTelemetryEvent('startup/ExtensionInitializationFailed');
|
|
||||||
console.error(`Error Initializing Admin Tool Extension for Windows - ${err}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,19 +75,62 @@ export async function deactivate(): Promise<void> {
|
|||||||
// If the extension is being deactivated we want to kill all processes that are still currently
|
// If the extension is being deactivated we want to kill all processes that are still currently
|
||||||
// running otherwise they will continue to run as orphan processes. We use taskkill here in case
|
// running otherwise they will continue to run as orphan processes. We use taskkill here in case
|
||||||
// they started off child processes of their own
|
// they started off child processes of their own
|
||||||
runningProcesses.forEach(p => exec('taskkill /pid ' + p.pid + ' /T /F'));
|
runningProcesses.forEach(p => exec(`taskkill /pid ${p.pid} /T /F`));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers extension commands with command subsystem
|
||||||
|
* @param context The context used to register the commands
|
||||||
|
*/
|
||||||
|
function registerCommands(context: vscode.ExtensionContext): void {
|
||||||
|
context.subscriptions.push(
|
||||||
|
vscode.commands.registerCommand('adminToolExtWin.launchSsmsMinPropertiesDialog', handleLaunchSsmsMinPropertiesDialogCommand));
|
||||||
|
context.subscriptions.push(
|
||||||
|
vscode.commands.registerCommand('adminToolExtWin.launchSsmsMinGswDialog', handleLaunchSsmsMinGswDialogCommand));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for command to launch SSMS Server Properties dialog
|
* Handler for command to launch SSMS Server Properties dialog
|
||||||
* @param connectionId The connection context from the command
|
* @param connectionId The connection context from the command
|
||||||
*/
|
*/
|
||||||
function handleLaunchSsmsServerPropertiesDialogCommand(connectionContext?: azdata.ObjectExplorerContext) {
|
async function handleLaunchSsmsMinPropertiesDialogCommand(connectionContext?: azdata.ObjectExplorerContext): Promise<void> {
|
||||||
if (connectionContext && connectionContext.connectionProfile) {
|
if (!connectionContext) {
|
||||||
launchSsmsDialog(
|
Telemetry.sendTelemetryEventForError('NoConnectionContext', { action: 'Properties' });
|
||||||
/*action*/'sqla:Properties@Microsoft.SqlServer.Management.Smo.Server',
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForProp', 'No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand'));
|
||||||
/*connectionProfile*/connectionContext.connectionProfile);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let nodeType: string;
|
||||||
|
if (connectionContext.isConnectionNode) {
|
||||||
|
nodeType = 'Server';
|
||||||
|
}
|
||||||
|
else if (connectionContext.nodeInfo) {
|
||||||
|
nodeType = connectionContext.nodeInfo.nodeType;
|
||||||
|
} else {
|
||||||
|
Telemetry.sendTelemetryEventForError('NoOENode', { action: 'Properties' });
|
||||||
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', 'Could not determine Object Explorer node from connectionContext : {0}', JSON.stringify(connectionContext)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
launchSsmsDialog(
|
||||||
|
nodeTypeToUrnNameMapping[nodeType].action,
|
||||||
|
connectionContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for command to launch SSMS "Generate Script Wizard" dialog
|
||||||
|
* @param connectionId The connection context from the command
|
||||||
|
*/
|
||||||
|
async function handleLaunchSsmsMinGswDialogCommand(connectionContext?: azdata.ObjectExplorerContext): Promise<void> {
|
||||||
|
const action = 'GenerateScripts';
|
||||||
|
if (!connectionContext) {
|
||||||
|
Telemetry.sendTelemetryEventForError('NoConnectionContext', { action: action });
|
||||||
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionContextForGsw', 'No ConnectionContext provided for handleLaunchSsmsMinPropertiesDialogCommand'));
|
||||||
|
}
|
||||||
|
|
||||||
|
launchSsmsDialog(
|
||||||
|
action,
|
||||||
|
connectionContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,45 +139,78 @@ function handleLaunchSsmsServerPropertiesDialogCommand(connectionContext?: azdat
|
|||||||
* @param params The params used to construct the command
|
* @param params The params used to construct the command
|
||||||
* @param urn The URN to pass to SsmsMin
|
* @param urn The URN to pass to SsmsMin
|
||||||
*/
|
*/
|
||||||
function launchSsmsDialog(action: string, connectionProfile: azdata.IConnectionProfile, urn?: string) {
|
async function launchSsmsDialog(action: string, connectionContext: azdata.ObjectExplorerContext): Promise<void> {
|
||||||
if (!exePath) {
|
if (!connectionContext.connectionProfile) {
|
||||||
vscode.window.showErrorMessage(localize('adminToolExtWin.noExeError', 'Unable to find SsmsMin.exe.'));
|
Telemetry.sendTelemetryEventForError('NoConnectionProfile', { action: action });
|
||||||
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noConnectionProfile', 'No connectionProfile provided from connectionContext : {0}', JSON.stringify(connectionContext)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Telemetry.sendTelemetryEvent('LaunchSsmsDialog', { 'action': action });
|
let oeNode: azdata.objectexplorer.ObjectExplorerNode;
|
||||||
|
// Server node is a Connection node and so doesn't have the NodeInfo
|
||||||
|
if (connectionContext.isConnectionNode) {
|
||||||
|
oeNode = undefined;
|
||||||
|
}
|
||||||
|
else if (connectionContext.nodeInfo && connectionContext.nodeInfo.nodeType && connectionContext.connectionProfile) {
|
||||||
|
oeNode = await azdata.objectexplorer.getNode(connectionContext.connectionProfile.id, connectionContext.nodeInfo.nodePath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Telemetry.sendTelemetryEventForError('NoOENode', { action: action });
|
||||||
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noOENode', 'Could not determine Object Explorer node from connectionContext : {0}', JSON.stringify(connectionContext)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let params: LaunchSsmsDialogParams = {
|
const urn: string = await buildUrn(oeNode);
|
||||||
|
let password: string = connectionContext.connectionProfile.password;
|
||||||
|
|
||||||
|
if (!password || password === '') {
|
||||||
|
const creds = await azdata.connection.getCredentials(connectionContext.connectionProfile.id);
|
||||||
|
password = creds[azdata.ConnectionOptionSpecialType.password];
|
||||||
|
}
|
||||||
|
|
||||||
|
const params: LaunchSsmsDialogParams = {
|
||||||
action: action,
|
action: action,
|
||||||
server: connectionProfile.serverName,
|
server: connectionContext.connectionProfile.serverName,
|
||||||
database: connectionProfile.databaseName,
|
database: connectionContext.connectionProfile.databaseName,
|
||||||
password: connectionProfile.password,
|
user: connectionContext.connectionProfile.userName,
|
||||||
user: connectionProfile.userName,
|
useAad: connectionContext.connectionProfile.authenticationType === 'AzureMFA',
|
||||||
useAad: connectionProfile.authenticationType === 'AzureMFA',
|
|
||||||
urn: urn
|
urn: urn
|
||||||
};
|
};
|
||||||
let args = buildSsmsMinCommandArgs(params);
|
|
||||||
|
const args = buildSsmsMinCommandArgs(params);
|
||||||
|
|
||||||
|
Telemetry.sendTelemetryEvent('LaunchSsmsDialog',
|
||||||
|
{
|
||||||
|
action: action,
|
||||||
|
nodeType: oeNode ? oeNode.nodeType : 'Server',
|
||||||
|
authType: connectionContext.connectionProfile.authenticationType
|
||||||
|
});
|
||||||
|
|
||||||
|
vscode.window.setStatusBarMessage(localize('adminToolExtWin.launchingDialogStatus', 'Launching dialog...'), 3000);
|
||||||
|
|
||||||
// This will be an async call since we pass in the callback
|
// This will be an async call since we pass in the callback
|
||||||
var proc: ChildProcess = exec(
|
const proc: ChildProcess = exec(
|
||||||
/*command*/ `"${exePath}" ${args}`,
|
/*command*/ `"${exePath}" ${args}`,
|
||||||
/*options*/ undefined,
|
/*options*/ undefined,
|
||||||
(execException, stdout, stderr) => {
|
(execException, stdout, stderr) => {
|
||||||
// Process has exited so remove from map of running processes
|
// Process has exited so remove from map of running processes
|
||||||
runningProcesses.delete(proc.pid);
|
runningProcesses.delete(proc.pid);
|
||||||
|
const err = stderr.toString();
|
||||||
Telemetry.sendTelemetryEvent('LaunchSsmsDialogResult', {
|
Telemetry.sendTelemetryEvent('LaunchSsmsDialogResult', {
|
||||||
'action': params.action,
|
action: params.action,
|
||||||
'returnCode': execException && execException.code ? execException.code.toString() : '0'
|
returnCode: execException && execException.code ? execException.code.toString() : '0',
|
||||||
|
errorType: getTelemetryErrorType(err)
|
||||||
});
|
});
|
||||||
let err = stderr.toString();
|
|
||||||
if (err !== '') {
|
if (err !== '') {
|
||||||
console.warn(`Error calling SsmsMin with args '${args}' - ${err}`);
|
vscode.window.showErrorMessage(localize(
|
||||||
|
'adminToolExtWin.ssmsMinError',
|
||||||
|
'Error calling SsmsMin with args \'{0}\' - {1}', args, err));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// If we're not using AAD the tool prompts for a password on stdin
|
// If we're not using AAD the tool prompts for a password on stdin
|
||||||
if (params.useAad !== true) {
|
if (params.useAad !== true) {
|
||||||
proc.stdin.end(params.password ? params.password : '');
|
proc.stdin.end(password ? password : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the process into our map so we can make sure to stop them if we exit before shutting down
|
// Save the process into our map so we can make sure to stop them if we exit before shutting down
|
||||||
@@ -148,10 +224,34 @@ function launchSsmsDialog(action: string, connectionProfile: azdata.IConnectionP
|
|||||||
* @param params The params used to build up the command parameter string
|
* @param params The params used to build up the command parameter string
|
||||||
*/
|
*/
|
||||||
export function buildSsmsMinCommandArgs(params: LaunchSsmsDialogParams): string {
|
export function buildSsmsMinCommandArgs(params: LaunchSsmsDialogParams): string {
|
||||||
return `${params.action ? '-a "' + params.action.replace(/"/g, '\\"') + '"' : ''}\
|
return `${params.action ? '-a "' + backEscapeDoubleQuotes(params.action) + '"' : ''}\
|
||||||
${params.server ? ' -S "' + params.server.replace(/"/g, '\\"') + '"' : ''}\
|
${params.server ? ' -S "' + backEscapeDoubleQuotes(params.server) + '"' : ''}\
|
||||||
${params.database ? ' -D "' + params.database.replace(/"/g, '\\"') + '"' : ''}\
|
${params.database ? ' -D "' + backEscapeDoubleQuotes(params.database) + '"' : ''}\
|
||||||
${params.useAad !== true && params.user ? ' -U "' + params.user.replace(/"/g, '\\"') + '"' : ''}\
|
${params.user ? ' -U "' + backEscapeDoubleQuotes(params.user) + '"' : ''}\
|
||||||
${params.useAad === true ? ' -G' : ''}\
|
${params.useAad === true ? ' -G' : ''}\
|
||||||
${params.urn ? ' -u "' + params.urn.replace(/"/g, '\\"') + '"' : ''}`;
|
${params.urn ? ' -u "' + backEscapeDoubleQuotes(params.urn) + '"' : ''}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the URN string for a given ObjectExplorerNode in the form understood by SsmsMin
|
||||||
|
* @param node The node to get the URN of
|
||||||
|
*/
|
||||||
|
export async function buildUrn(node: azdata.objectexplorer.ObjectExplorerNode): Promise<string> {
|
||||||
|
let urnNodes: string[] = [];
|
||||||
|
while (node) {
|
||||||
|
// Server is special since it's a connection node - always add it as the root
|
||||||
|
if (node.nodeType === 'Server') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (node.metadata && node.nodeType !== 'Folder') {
|
||||||
|
// SFC URN expects Name and Schema to be separate properties
|
||||||
|
const urnSegment = node.metadata.schema && node.metadata.schema !== '' ?
|
||||||
|
`${nodeTypeToUrnNameMapping[node.nodeType].urnName}[@Name='${doubleEscapeSingleQuotes(node.metadata.name)}' and @Schema='${doubleEscapeSingleQuotes(node.metadata.schema)}']` :
|
||||||
|
`${nodeTypeToUrnNameMapping[node.nodeType].urnName}[@Name='${doubleEscapeSingleQuotes(node.metadata.name)}']`;
|
||||||
|
urnNodes = [urnSegment].concat(urnNodes);
|
||||||
|
}
|
||||||
|
node = await node.getParent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['Server'].concat(urnNodes).join('/');
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||||
import { PlatformInformation } from 'service-downloader/out/platform';
|
|
||||||
|
|
||||||
import * as Utils from './utils';
|
import * as Utils from './utils';
|
||||||
|
|
||||||
@@ -37,23 +36,8 @@ export function filterErrorPath(line: string): string {
|
|||||||
|
|
||||||
export class Telemetry {
|
export class Telemetry {
|
||||||
private static reporter: TelemetryReporter;
|
private static reporter: TelemetryReporter;
|
||||||
private static userId: string;
|
|
||||||
private static platformInformation: PlatformInformation;
|
|
||||||
private static disabled: boolean;
|
private static disabled: boolean;
|
||||||
|
|
||||||
public static getPlatformInformation(): Promise<PlatformInformation> {
|
|
||||||
if (this.platformInformation) {
|
|
||||||
return Promise.resolve(this.platformInformation);
|
|
||||||
} else {
|
|
||||||
return new Promise<PlatformInformation>(resolve => {
|
|
||||||
PlatformInformation.getCurrent().then(info => {
|
|
||||||
this.platformInformation = info;
|
|
||||||
resolve(this.platformInformation);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable telemetry reporting
|
* Disable telemetry reporting
|
||||||
*/
|
*/
|
||||||
@@ -78,27 +62,11 @@ export class Telemetry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a telemetry event for an exception
|
* Send a telemetry event for a general error
|
||||||
|
* @param err The error to log
|
||||||
*/
|
*/
|
||||||
public static sendTelemetryEventForException(
|
public static sendTelemetryEventForError(err: string, properties?: ITelemetryEventProperties): void {
|
||||||
err: any, methodName: string, extensionConfigName: string): void {
|
this.sendTelemetryEvent('Error', { error: err, ...properties });
|
||||||
try {
|
|
||||||
let stackArray: string[];
|
|
||||||
let firstLine: string = '';
|
|
||||||
if (err !== undefined && err.stack !== undefined) {
|
|
||||||
stackArray = err.stack.split('\n');
|
|
||||||
if (stackArray !== undefined && stackArray.length >= 2) {
|
|
||||||
firstLine = stackArray[1]; // The first line is the error message and we don't want to send that telemetry event
|
|
||||||
firstLine = filterErrorPath(firstLine);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only adding the method name and the fist line of the stack trace. We don't add the error message because it might have PII
|
|
||||||
this.sendTelemetryEvent('Exception', { methodName: methodName, errorLine: firstLine });
|
|
||||||
} catch (telemetryErr) {
|
|
||||||
// If sending telemetry event fails ignore it so it won't break the extension
|
|
||||||
console.error('Failed to send telemetry event. error: ' + telemetryErr, extensionConfigName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,13 +90,12 @@ export class Telemetry {
|
|||||||
properties = {};
|
properties = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Augment the properties structure with additional common properties before sending
|
try {
|
||||||
Promise.all([this.getPlatformInformation()]).then(() => {
|
|
||||||
properties['distribution'] = (this.platformInformation && this.platformInformation.distribution) ?
|
|
||||||
`${this.platformInformation.distribution.name}, ${this.platformInformation.distribution.version}` : '';
|
|
||||||
|
|
||||||
this.reporter.sendTelemetryEvent(eventName, properties, measures);
|
this.reporter.sendTelemetryEvent(eventName, properties, measures);
|
||||||
});
|
} catch (telemetryErr) {
|
||||||
|
// If sending telemetry event fails ignore it so it won't break the extension
|
||||||
|
console.error('Failed to send telemetry event. error: ' + telemetryErr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
68
extensions/admin-tool-ext-win/src/test/stubs.ts
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as azdata from 'azdata';
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper stub class for mocking ExtHostObjectExplorerNode
|
||||||
|
*/
|
||||||
|
export class ExtHostObjectExplorerNodeStub implements azdata.objectexplorer.ObjectExplorerNode {
|
||||||
|
// Stub properties
|
||||||
|
private parent: azdata.objectexplorer.ObjectExplorerNode;
|
||||||
|
|
||||||
|
// Base properties
|
||||||
|
public connectionId: string;
|
||||||
|
public nodePath: string;
|
||||||
|
public nodeType: string;
|
||||||
|
public nodeSubType: string;
|
||||||
|
public nodeStatus: string;
|
||||||
|
public label: string;
|
||||||
|
public isLeaf: boolean;
|
||||||
|
public metadata: azdata.ObjectMetadata;
|
||||||
|
public errorMessage: string;
|
||||||
|
|
||||||
|
constructor(nodeName: string, nodeSchema: string, nodeType, parent: azdata.objectexplorer.ObjectExplorerNode) {
|
||||||
|
this.parent = parent;
|
||||||
|
this.nodeType = nodeType;
|
||||||
|
this.metadata = { metadataType: undefined, metadataTypeName: undefined, name: nodeName, schema: nodeSchema, urn: undefined };
|
||||||
|
}
|
||||||
|
|
||||||
|
isExpanded(): Thenable<boolean> {
|
||||||
|
throw new Error('Method not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
setExpandedState(expandedState: vscode.TreeItemCollapsibleState): Thenable<void> {
|
||||||
|
throw new Error('Method not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelected(selected: boolean, clearOtherSelections: boolean = undefined): Thenable<void> {
|
||||||
|
throw new Error('Method not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
getChildren(): Thenable<azdata.objectexplorer.ObjectExplorerNode[]> {
|
||||||
|
throw new Error('Method not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
getParent(): Thenable<azdata.objectexplorer.ObjectExplorerNode> {
|
||||||
|
return Promise.resolve(this.parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
refresh(): Thenable<void> {
|
||||||
|
throw new Error('Method not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param nodeName Helperfunction to create a node that is a child of this one
|
||||||
|
* @param nodeSchema The schema to give the child node
|
||||||
|
* @param nodeType The type of node this should be
|
||||||
|
*/
|
||||||
|
createChild(nodeName: string, nodeSchema: string, nodeType: string): ExtHostObjectExplorerNodeStub {
|
||||||
|
return new ExtHostObjectExplorerNodeStub(nodeName, nodeSchema, nodeType, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,60 +8,126 @@
|
|||||||
import * as should from 'should';
|
import * as should from 'should';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
|
|
||||||
import * as extensionMain from '../main';
|
import { buildSsmsMinCommandArgs, buildUrn, LaunchSsmsDialogParams } from '../main';
|
||||||
|
import { doubleEscapeSingleQuotes, backEscapeDoubleQuotes } from '../utils';
|
||||||
|
import { ExtHostObjectExplorerNodeStub } from './stubs';
|
||||||
|
|
||||||
describe('buildSsmsMinCommandArgs Method Tests', () => {
|
describe('buildSsmsMinCommandArgs Method Tests', () => {
|
||||||
it('Should be built correctly with all params and UseAAD as false', function (): void {
|
it('Should be built correctly with all params and UseAAD as false', function (): void {
|
||||||
let params: extensionMain.LaunchSsmsDialogParams = {
|
const params: LaunchSsmsDialogParams = {
|
||||||
action: 'myAction',
|
action: 'myAction',
|
||||||
server: 'myServer',
|
server: 'myServer',
|
||||||
database: 'myDatabase',
|
database: 'myDatabase',
|
||||||
user: 'user',
|
user: 'user',
|
||||||
password: 'password',
|
|
||||||
useAad: false,
|
useAad: false,
|
||||||
urn: 'Server\\Database\\Table'
|
urn: 'Server\\Database\\Table'
|
||||||
};
|
};
|
||||||
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
const args = buildSsmsMinCommandArgs(params);
|
||||||
should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -U "user" -u "Server\\Database\\Table"');
|
should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -U "user" -u "Server\\Database\\Table"');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should be built correctly with all params and UseAAD as true', function (): void {
|
it('Should be built correctly with all params and UseAAD as true', function (): void {
|
||||||
let params: extensionMain.LaunchSsmsDialogParams = {
|
const params: LaunchSsmsDialogParams = {
|
||||||
action: 'myAction',
|
action: 'myAction',
|
||||||
server: 'myServer',
|
server: 'myServer',
|
||||||
database: 'myDatabase',
|
database: 'myDatabase',
|
||||||
user: 'user',
|
user: 'user',
|
||||||
password: 'password',
|
|
||||||
useAad: true,
|
useAad: true,
|
||||||
urn: 'Server\\Database\\Table'
|
urn: 'Server\\Database\\Table'
|
||||||
};
|
};
|
||||||
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
const args = buildSsmsMinCommandArgs(params);
|
||||||
// User is omitted since UseAAD is true
|
|
||||||
should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -G -u "Server\\Database\\Table"');
|
should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -U "user" -G -u "Server\\Database\\Table"');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should be built correctly and names escaped correctly', function (): void {
|
it('Should be built correctly and names escaped correctly', function (): void {
|
||||||
let params: extensionMain.LaunchSsmsDialogParams = {
|
const params: LaunchSsmsDialogParams = {
|
||||||
action: 'myAction\'"/\\[]tricky',
|
action: 'myAction\'"/\\[]tricky',
|
||||||
server: 'myServer\'"/\\[]tricky',
|
server: 'myServer\'"/\\[]tricky',
|
||||||
database: 'myDatabase\'"/\\[]tricky',
|
database: 'myDatabase\'"/\\[]tricky',
|
||||||
user: 'user\'"/\\[]tricky',
|
user: 'user\'"/\\[]tricky',
|
||||||
password: 'password',
|
|
||||||
useAad: true,
|
useAad: true,
|
||||||
urn: 'Server\\Database[\'myDatabase\'\'"/\\[]tricky\']\\Table["myTable\'""/\\[]tricky"]'
|
urn: 'Server\\Database[\'myDatabase\'\'"/\\[]tricky\']\\Table["myTable\'""/\\[]tricky"]'
|
||||||
};
|
};
|
||||||
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
const args = buildSsmsMinCommandArgs(params);
|
||||||
// User is omitted since UseAAD is true
|
|
||||||
should(args).equal('-a "myAction\'\\"/\\[]tricky" -S "myServer\'\\"/\\[]tricky" -D "myDatabase\'\\"/\\[]tricky" -G -u "Server\\Database[\'myDatabase\'\'\\"/\\[]tricky\']\\Table[\\"myTable\'\\"\\"/\\[]tricky\\"]"');
|
should(args).equal('-a "myAction\'\\"/\\[]tricky" -S "myServer\'\\"/\\[]tricky" -D "myDatabase\'\\"/\\[]tricky" -U "user\'\\"/\\[]tricky" -G -u "Server\\Database[\'myDatabase\'\'\\"/\\[]tricky\']\\Table[\\"myTable\'\\"\\"/\\[]tricky\\"]"');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should be built correctly with only action and server', function (): void {
|
it('Should be built correctly with only action and server', function (): void {
|
||||||
|
|
||||||
let params: extensionMain.LaunchSsmsDialogParams = {
|
const params: LaunchSsmsDialogParams = {
|
||||||
action: 'myAction',
|
action: 'myAction',
|
||||||
server: 'myServer'
|
server: 'myServer'
|
||||||
};
|
};
|
||||||
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
const args = buildSsmsMinCommandArgs(params);
|
||||||
should(args).equal('-a "myAction" -S "myServer"');
|
should(args).equal('-a "myAction" -S "myServer"');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const dbName = 'My\'Db';
|
||||||
|
const escapedDbName = doubleEscapeSingleQuotes(dbName);
|
||||||
|
const dbSchema = 'db\'sch';
|
||||||
|
const escapedDbSchema = doubleEscapeSingleQuotes(dbSchema);
|
||||||
|
const tableName = 'My\'Table';
|
||||||
|
const escapedTableName = doubleEscapeSingleQuotes(tableName);
|
||||||
|
const tableSchema = 'tbl\'sch';
|
||||||
|
const escapedTableSchema = doubleEscapeSingleQuotes(tableSchema);
|
||||||
|
|
||||||
|
describe('buildUrn Method Tests', () => {
|
||||||
|
it('Urn should be correct with just server', async function (): Promise<void> {
|
||||||
|
should(await buildUrn(undefined)).equal('Server');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Urn should be correct with Server and only Databases folder', async function (): Promise<void> {
|
||||||
|
const leafNode: ExtHostObjectExplorerNodeStub =
|
||||||
|
new ExtHostObjectExplorerNodeStub('Databases', undefined, 'Folder', undefined);
|
||||||
|
should(await buildUrn(leafNode)).equal('Server');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Urn should be correct with Server and Database node', async function (): Promise<void> {
|
||||||
|
const leafNode: ExtHostObjectExplorerNodeStub =
|
||||||
|
new ExtHostObjectExplorerNodeStub('Databases', undefined, 'Folder', undefined)
|
||||||
|
.createChild(dbName, dbSchema, 'Database');
|
||||||
|
should(await buildUrn(leafNode)).equal(
|
||||||
|
`Server/Database[@Name='${escapedDbName}' and @Schema='${escapedDbSchema}']`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Urn should be correct with Multiple levels of Nodes', async function (): Promise<void> {
|
||||||
|
const rootNode: ExtHostObjectExplorerNodeStub =
|
||||||
|
new ExtHostObjectExplorerNodeStub('Databases', undefined, 'Folder', undefined)
|
||||||
|
.createChild(dbName, dbSchema, 'Database')
|
||||||
|
.createChild('Tables', undefined, 'Folder')
|
||||||
|
.createChild(tableName, tableSchema, 'Table');
|
||||||
|
should(await buildUrn(rootNode)).equal(
|
||||||
|
`Server/Database[@Name='${escapedDbName}' and @Schema='${escapedDbSchema}']/Table[@Name='${escapedTableName}' and @Schema='${escapedTableSchema}']`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('doubleEscapeSingleQuotes Method Tests', () => {
|
||||||
|
it('Should return original string if no single quotes', function (): void {
|
||||||
|
const testString: string = 'MyTestString';
|
||||||
|
const ret = doubleEscapeSingleQuotes(testString);
|
||||||
|
should(ret).equal(testString);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should return escaped original string if it contains single quotes', function (): void {
|
||||||
|
const testString: string = 'MyTestString\'\'WithQuotes';
|
||||||
|
const ret = doubleEscapeSingleQuotes(testString);
|
||||||
|
should(ret).equal('MyTestString\'\'\'\'WithQuotes');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('backEscapeDoubleQuotes Method Tests', () => {
|
||||||
|
it('Should return original string if no double quotes', function (): void {
|
||||||
|
const testString: string = 'MyTestString';
|
||||||
|
const ret = backEscapeDoubleQuotes(testString);
|
||||||
|
should(ret).equal(testString);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should return escaped original string if it contains double quotes', function (): void {
|
||||||
|
const testString: string = 'MyTestString\"\"WithQuotes';
|
||||||
|
const ret = backEscapeDoubleQuotes(testString);
|
||||||
|
should(ret).equal('MyTestString\\"\\"WithQuotes');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
|
||||||
|
|
||||||
export interface IPackageInfo {
|
export interface IPackageInfo {
|
||||||
name: string;
|
name: string;
|
||||||
version: string;
|
version: string;
|
||||||
@@ -23,20 +21,41 @@ export function getPackageInfo(packageJson: any): IPackageInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the configuration for a extensionName
|
* Escapes all single-quotes (') by prefixing them with another single quote ('')
|
||||||
* @param extensionName The string name of the extension to get the configuration for
|
* ' => ''
|
||||||
* @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations
|
* @param value The string to escape
|
||||||
*/
|
*/
|
||||||
export function getConfiguration(extensionName?: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration {
|
export function doubleEscapeSingleQuotes(value: string): string {
|
||||||
if (typeof resource === 'string') {
|
return value.replace(/'/g, '\'\'');
|
||||||
try {
|
|
||||||
resource = this.parseUri(resource);
|
|
||||||
} catch (e) {
|
|
||||||
resource = undefined;
|
|
||||||
}
|
}
|
||||||
} else if (!resource) {
|
|
||||||
// Fix to avoid adding lots of errors to debug console. Expects a valid resource or null, not undefined
|
/**
|
||||||
resource = null;
|
* Escape all double-quotes (") by prefixing them with a \
|
||||||
|
* " => \"
|
||||||
|
* @param value The string to escape
|
||||||
|
*/
|
||||||
|
export function backEscapeDoubleQuotes(value: string): string {
|
||||||
|
return value.replace(/"/g, '\\"');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map an error message into a friendly short name for the type of error.
|
||||||
|
* @param msg The error message to map
|
||||||
|
*/
|
||||||
|
export function getTelemetryErrorType(msg: string): string {
|
||||||
|
if (msg.indexOf('is not recognized as an internal or external command') !== -1) {
|
||||||
|
return 'ExeNotFound';
|
||||||
|
}
|
||||||
|
else if (msg.indexOf('Unknown Action') !== -1) {
|
||||||
|
return 'UnknownAction';
|
||||||
|
}
|
||||||
|
else if (msg.indexOf('No Action Provided') !== -1) {
|
||||||
|
return 'NoActionProvided';
|
||||||
|
}
|
||||||
|
else if (msg.indexOf('Run exception') !== -1) {
|
||||||
|
return 'RunException';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 'Other';
|
||||||
}
|
}
|
||||||
return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri);
|
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
agent-base@4, agent-base@^4.1.0:
|
|
||||||
version "4.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
|
||||||
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
|
|
||||||
dependencies:
|
|
||||||
es6-promisify "^5.0.0"
|
|
||||||
|
|
||||||
ajv@^6.5.5:
|
ajv@^6.5.5:
|
||||||
version "6.9.2"
|
version "6.9.2"
|
||||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b"
|
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b"
|
||||||
@@ -141,11 +134,6 @@ balanced-match@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||||
|
|
||||||
base64-js@^1.0.2:
|
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
|
|
||||||
integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
|
|
||||||
|
|
||||||
bcrypt-pbkdf@^1.0.0:
|
bcrypt-pbkdf@^1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||||
@@ -158,14 +146,6 @@ beeper@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809"
|
resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809"
|
||||||
integrity sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=
|
integrity sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=
|
||||||
|
|
||||||
bl@^1.0.0:
|
|
||||||
version "1.2.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c"
|
|
||||||
integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==
|
|
||||||
dependencies:
|
|
||||||
readable-stream "^2.3.5"
|
|
||||||
safe-buffer "^5.1.1"
|
|
||||||
|
|
||||||
block-stream@*:
|
block-stream@*:
|
||||||
version "0.0.9"
|
version "0.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
|
resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
|
||||||
@@ -190,37 +170,11 @@ braces@^1.8.2:
|
|||||||
preserve "^0.2.0"
|
preserve "^0.2.0"
|
||||||
repeat-element "^1.1.2"
|
repeat-element "^1.1.2"
|
||||||
|
|
||||||
buffer-alloc-unsafe@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
|
|
||||||
integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==
|
|
||||||
|
|
||||||
buffer-alloc@^1.2.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec"
|
|
||||||
integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==
|
|
||||||
dependencies:
|
|
||||||
buffer-alloc-unsafe "^1.1.0"
|
|
||||||
buffer-fill "^1.0.0"
|
|
||||||
|
|
||||||
buffer-crc32@~0.2.3:
|
buffer-crc32@~0.2.3:
|
||||||
version "0.2.13"
|
version "0.2.13"
|
||||||
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
|
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
|
||||||
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
|
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
|
||||||
|
|
||||||
buffer-fill@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c"
|
|
||||||
integrity sha1-+PeLdniYiO858gXNY39o5wISKyw=
|
|
||||||
|
|
||||||
buffer@^5.2.1:
|
|
||||||
version "5.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6"
|
|
||||||
integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==
|
|
||||||
dependencies:
|
|
||||||
base64-js "^1.0.2"
|
|
||||||
ieee754 "^1.1.4"
|
|
||||||
|
|
||||||
camelcase-keys@^2.0.0:
|
camelcase-keys@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
|
resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
|
||||||
@@ -317,13 +271,6 @@ commander@2.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873"
|
||||||
integrity sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=
|
integrity sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=
|
||||||
|
|
||||||
commander@~2.8.1:
|
|
||||||
version "2.8.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
|
|
||||||
integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=
|
|
||||||
dependencies:
|
|
||||||
graceful-readlink ">= 1.0.0"
|
|
||||||
|
|
||||||
concat-map@0.0.1:
|
concat-map@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
@@ -375,78 +322,11 @@ debug@2.2.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ms "0.7.1"
|
ms "0.7.1"
|
||||||
|
|
||||||
debug@3.1.0:
|
|
||||||
version "3.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
|
||||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
|
||||||
dependencies:
|
|
||||||
ms "2.0.0"
|
|
||||||
|
|
||||||
debug@^3.1.0:
|
|
||||||
version "3.2.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
|
||||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
|
||||||
dependencies:
|
|
||||||
ms "^2.1.1"
|
|
||||||
|
|
||||||
decamelize@^1.1.2:
|
decamelize@^1.1.2:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||||
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||||
|
|
||||||
decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1:
|
|
||||||
version "4.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1"
|
|
||||||
integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==
|
|
||||||
dependencies:
|
|
||||||
file-type "^5.2.0"
|
|
||||||
is-stream "^1.1.0"
|
|
||||||
tar-stream "^1.5.2"
|
|
||||||
|
|
||||||
decompress-tarbz2@^4.0.0:
|
|
||||||
version "4.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b"
|
|
||||||
integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==
|
|
||||||
dependencies:
|
|
||||||
decompress-tar "^4.1.0"
|
|
||||||
file-type "^6.1.0"
|
|
||||||
is-stream "^1.1.0"
|
|
||||||
seek-bzip "^1.0.5"
|
|
||||||
unbzip2-stream "^1.0.9"
|
|
||||||
|
|
||||||
decompress-targz@^4.0.0:
|
|
||||||
version "4.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee"
|
|
||||||
integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==
|
|
||||||
dependencies:
|
|
||||||
decompress-tar "^4.1.1"
|
|
||||||
file-type "^5.2.0"
|
|
||||||
is-stream "^1.1.0"
|
|
||||||
|
|
||||||
decompress-unzip@^4.0.1:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69"
|
|
||||||
integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k=
|
|
||||||
dependencies:
|
|
||||||
file-type "^3.8.0"
|
|
||||||
get-stream "^2.2.0"
|
|
||||||
pify "^2.3.0"
|
|
||||||
yauzl "^2.4.2"
|
|
||||||
|
|
||||||
decompress@^4.2.0:
|
|
||||||
version "4.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d"
|
|
||||||
integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=
|
|
||||||
dependencies:
|
|
||||||
decompress-tar "^4.0.0"
|
|
||||||
decompress-tarbz2 "^4.0.0"
|
|
||||||
decompress-targz "^4.0.0"
|
|
||||||
decompress-unzip "^4.0.1"
|
|
||||||
graceful-fs "^4.1.10"
|
|
||||||
make-dir "^1.0.0"
|
|
||||||
pify "^2.3.0"
|
|
||||||
strip-dirs "^2.0.0"
|
|
||||||
|
|
||||||
deep-assign@^1.0.0:
|
deep-assign@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b"
|
resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b"
|
||||||
@@ -520,18 +400,6 @@ error-ex@^1.2.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-arrayish "^0.2.1"
|
is-arrayish "^0.2.1"
|
||||||
|
|
||||||
es6-promise@^4.0.3:
|
|
||||||
version "4.2.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
|
||||||
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
|
|
||||||
|
|
||||||
es6-promisify@^5.0.0:
|
|
||||||
version "5.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
|
||||||
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
|
|
||||||
dependencies:
|
|
||||||
es6-promise "^4.0.3"
|
|
||||||
|
|
||||||
escape-string-regexp@1.0.2:
|
escape-string-regexp@1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
||||||
@@ -581,11 +449,6 @@ event-stream@~3.1.5:
|
|||||||
stream-combiner "~0.0.4"
|
stream-combiner "~0.0.4"
|
||||||
through "~2.3.1"
|
through "~2.3.1"
|
||||||
|
|
||||||
eventemitter2@^5.0.1:
|
|
||||||
version "5.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-5.0.1.tgz#6197a095d5fb6b57e8942f6fd7eaad63a09c9452"
|
|
||||||
integrity sha1-YZegldX7a1folC9v1+qtY6CclFI=
|
|
||||||
|
|
||||||
expand-brackets@^0.1.4:
|
expand-brackets@^0.1.4:
|
||||||
version "0.1.5"
|
version "0.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
|
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
|
||||||
@@ -656,21 +519,6 @@ fd-slicer@~1.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
pend "~1.2.0"
|
pend "~1.2.0"
|
||||||
|
|
||||||
file-type@^3.8.0:
|
|
||||||
version "3.9.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
|
|
||||||
integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek=
|
|
||||||
|
|
||||||
file-type@^5.2.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
|
|
||||||
integrity sha1-LdvqfHP/42No365J3DOMBYwritY=
|
|
||||||
|
|
||||||
file-type@^6.1.0:
|
|
||||||
version "6.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
|
|
||||||
integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==
|
|
||||||
|
|
||||||
filename-regex@^2.0.0:
|
filename-regex@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
|
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
|
||||||
@@ -731,11 +579,6 @@ from@^0.1.7, from@~0:
|
|||||||
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
|
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
|
||||||
integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=
|
integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=
|
||||||
|
|
||||||
fs-constants@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
|
|
||||||
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
|
|
||||||
|
|
||||||
fs.realpath@^1.0.0:
|
fs.realpath@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||||
@@ -761,14 +604,6 @@ get-stdin@^4.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
||||||
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=
|
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=
|
||||||
|
|
||||||
get-stream@^2.2.0:
|
|
||||||
version "2.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
|
|
||||||
integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=
|
|
||||||
dependencies:
|
|
||||||
object-assign "^4.0.1"
|
|
||||||
pinkie-promise "^2.0.0"
|
|
||||||
|
|
||||||
getpass@^0.1.1:
|
getpass@^0.1.1:
|
||||||
version "0.1.7"
|
version "0.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||||
@@ -851,7 +686,7 @@ glogg@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
sparkles "^1.0.0"
|
sparkles "^1.0.0"
|
||||||
|
|
||||||
graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.2:
|
graceful-fs@^4.0.0, graceful-fs@^4.1.2:
|
||||||
version "4.1.15"
|
version "4.1.15"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
|
||||||
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
|
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
|
||||||
@@ -863,11 +698,6 @@ graceful-fs@~3.0.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
natives "^1.1.0"
|
natives "^1.1.0"
|
||||||
|
|
||||||
"graceful-readlink@>= 1.0.0":
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
|
||||||
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
|
|
||||||
|
|
||||||
growl@1.9.2:
|
growl@1.9.2:
|
||||||
version "1.9.2"
|
version "1.9.2"
|
||||||
resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
|
resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
|
||||||
@@ -1046,14 +876,6 @@ hosted-git-info@^2.1.4:
|
|||||||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
|
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
|
||||||
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
|
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
|
||||||
|
|
||||||
http-proxy-agent@^2.1.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
|
|
||||||
integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==
|
|
||||||
dependencies:
|
|
||||||
agent-base "4"
|
|
||||||
debug "3.1.0"
|
|
||||||
|
|
||||||
http-signature@~1.2.0:
|
http-signature@~1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||||
@@ -1063,19 +885,6 @@ http-signature@~1.2.0:
|
|||||||
jsprim "^1.2.2"
|
jsprim "^1.2.2"
|
||||||
sshpk "^1.7.0"
|
sshpk "^1.7.0"
|
||||||
|
|
||||||
https-proxy-agent@^2.2.1:
|
|
||||||
version "2.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
|
||||||
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
|
|
||||||
dependencies:
|
|
||||||
agent-base "^4.1.0"
|
|
||||||
debug "^3.1.0"
|
|
||||||
|
|
||||||
ieee754@^1.1.4:
|
|
||||||
version "1.1.12"
|
|
||||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
|
|
||||||
integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==
|
|
||||||
|
|
||||||
indent-string@^2.1.0:
|
indent-string@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
|
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
|
||||||
@@ -1154,11 +963,6 @@ is-glob@^3.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-extglob "^2.1.0"
|
is-extglob "^2.1.0"
|
||||||
|
|
||||||
is-natural-number@^4.0.1:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
|
|
||||||
integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=
|
|
||||||
|
|
||||||
is-number@^2.1.0:
|
is-number@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
|
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
|
||||||
@@ -1531,13 +1335,6 @@ lru-cache@2:
|
|||||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
||||||
integrity sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=
|
integrity sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=
|
||||||
|
|
||||||
make-dir@^1.0.0:
|
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
|
|
||||||
integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==
|
|
||||||
dependencies:
|
|
||||||
pify "^3.0.0"
|
|
||||||
|
|
||||||
map-obj@^1.0.0, map-obj@^1.0.1:
|
map-obj@^1.0.0, map-obj@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
|
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
|
||||||
@@ -1675,16 +1472,6 @@ ms@0.7.1:
|
|||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
|
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
|
||||||
integrity sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=
|
integrity sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=
|
||||||
|
|
||||||
ms@2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
|
||||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
|
||||||
|
|
||||||
ms@^2.1.1:
|
|
||||||
version "2.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
|
||||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
|
||||||
|
|
||||||
multimatch@^2.0.0:
|
multimatch@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b"
|
resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b"
|
||||||
@@ -1780,11 +1567,6 @@ ordered-read-streams@^0.3.0:
|
|||||||
is-stream "^1.0.1"
|
is-stream "^1.0.1"
|
||||||
readable-stream "^2.0.1"
|
readable-stream "^2.0.1"
|
||||||
|
|
||||||
os-tmpdir@~1.0.2:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
|
||||||
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
|
|
||||||
|
|
||||||
parse-glob@^3.0.4:
|
parse-glob@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
|
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
|
||||||
@@ -1855,16 +1637,11 @@ performance-now@^2.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||||
|
|
||||||
pify@^2.0.0, pify@^2.3.0:
|
pify@^2.0.0:
|
||||||
version "2.3.0"
|
version "2.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||||
integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
|
integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
|
||||||
|
|
||||||
pify@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
|
|
||||||
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
|
|
||||||
|
|
||||||
pinkie-promise@^2.0.0:
|
pinkie-promise@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||||
@@ -1950,7 +1727,7 @@ read-pkg@^1.0.0:
|
|||||||
isarray "0.0.1"
|
isarray "0.0.1"
|
||||||
string_decoder "~0.10.x"
|
string_decoder "~0.10.x"
|
||||||
|
|
||||||
readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@~2.3.6:
|
readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.3.5, readable-stream@~2.3.6:
|
||||||
version "2.3.6"
|
version "2.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
||||||
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
|
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
|
||||||
@@ -2060,7 +1837,7 @@ rimraf@2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "^7.1.3"
|
glob "^7.1.3"
|
||||||
|
|
||||||
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||||
version "5.1.2"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||||
@@ -2070,29 +1847,11 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||||
|
|
||||||
seek-bzip@^1.0.5:
|
|
||||||
version "1.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
|
|
||||||
integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=
|
|
||||||
dependencies:
|
|
||||||
commander "~2.8.1"
|
|
||||||
|
|
||||||
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0:
|
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0:
|
||||||
version "5.6.0"
|
version "5.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
||||||
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
|
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
|
||||||
|
|
||||||
"service-downloader@github:anthonydresser/service-downloader#0.1.5":
|
|
||||||
version "0.1.5"
|
|
||||||
resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/6ebb0465573cc140e461a22f334260f55ef45546"
|
|
||||||
dependencies:
|
|
||||||
decompress "^4.2.0"
|
|
||||||
eventemitter2 "^5.0.1"
|
|
||||||
http-proxy-agent "^2.1.0"
|
|
||||||
https-proxy-agent "^2.2.1"
|
|
||||||
mkdirp "^0.5.1"
|
|
||||||
tmp "^0.0.33"
|
|
||||||
|
|
||||||
sigmund@~1.0.0:
|
sigmund@~1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
||||||
@@ -2262,13 +2021,6 @@ strip-bom@^2.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-utf8 "^0.2.0"
|
is-utf8 "^0.2.0"
|
||||||
|
|
||||||
strip-dirs@^2.0.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5"
|
|
||||||
integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==
|
|
||||||
dependencies:
|
|
||||||
is-natural-number "^4.0.1"
|
|
||||||
|
|
||||||
strip-indent@^1.0.1:
|
strip-indent@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
|
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
|
||||||
@@ -2291,19 +2043,6 @@ supports-color@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||||
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
|
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
|
||||||
|
|
||||||
tar-stream@^1.5.2:
|
|
||||||
version "1.6.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
|
|
||||||
integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==
|
|
||||||
dependencies:
|
|
||||||
bl "^1.0.0"
|
|
||||||
buffer-alloc "^1.2.0"
|
|
||||||
end-of-stream "^1.0.0"
|
|
||||||
fs-constants "^1.0.0"
|
|
||||||
readable-stream "^2.3.0"
|
|
||||||
to-buffer "^1.1.1"
|
|
||||||
xtend "^4.0.0"
|
|
||||||
|
|
||||||
tar@~0.1.19:
|
tar@~0.1.19:
|
||||||
version "0.1.20"
|
version "0.1.20"
|
||||||
resolved "https://registry.yarnpkg.com/tar/-/tar-0.1.20.tgz#42940bae5b5f22c74483699126f9f3f27449cb13"
|
resolved "https://registry.yarnpkg.com/tar/-/tar-0.1.20.tgz#42940bae5b5f22c74483699126f9f3f27449cb13"
|
||||||
@@ -2371,13 +2110,6 @@ time-stamp@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3"
|
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3"
|
||||||
integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=
|
integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=
|
||||||
|
|
||||||
tmp@^0.0.33:
|
|
||||||
version "0.0.33"
|
|
||||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
|
|
||||||
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
|
|
||||||
dependencies:
|
|
||||||
os-tmpdir "~1.0.2"
|
|
||||||
|
|
||||||
to-absolute-glob@^0.1.1:
|
to-absolute-glob@^0.1.1:
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f"
|
resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f"
|
||||||
@@ -2385,11 +2117,6 @@ to-absolute-glob@^0.1.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
extend-shallow "^2.0.1"
|
extend-shallow "^2.0.1"
|
||||||
|
|
||||||
to-buffer@^1.1.1:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80"
|
|
||||||
integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==
|
|
||||||
|
|
||||||
to-iso-string@0.0.2:
|
to-iso-string@0.0.2:
|
||||||
version "0.0.2"
|
version "0.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1"
|
resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1"
|
||||||
@@ -2420,14 +2147,6 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
|||||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||||
|
|
||||||
unbzip2-stream@^1.0.9:
|
|
||||||
version "1.3.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz#d156d205e670d8d8c393e1c02ebd506422873f6a"
|
|
||||||
integrity sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==
|
|
||||||
dependencies:
|
|
||||||
buffer "^5.2.1"
|
|
||||||
through "^2.3.8"
|
|
||||||
|
|
||||||
unique-stream@^2.0.2:
|
unique-stream@^2.0.2:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac"
|
resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac"
|
||||||
@@ -2588,7 +2307,7 @@ wrappy@1:
|
|||||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||||
|
|
||||||
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:
|
"xtend@>=4.0.0 <4.1.0-0", xtend@~4.0.0, xtend@~4.0.1:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
||||||
integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=
|
integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=
|
||||||
@@ -2605,7 +2324,7 @@ xtend@~3.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
|
||||||
integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=
|
integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=
|
||||||
|
|
||||||
yauzl@^2.2.1, yauzl@^2.4.2:
|
yauzl@^2.2.1:
|
||||||
version "2.10.0"
|
version "2.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
|
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
|
||||||
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
|
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
|
||||||
|
|||||||
1
extensions/agent/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.vsix
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
client/src/**
|
src/**
|
||||||
client/tsconfig.json
|
out/test/**
|
||||||
|
tsconfig.json
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
"name": "agent",
|
"name": "agent",
|
||||||
"displayName": "SQL Server Agent",
|
"displayName": "SQL Server Agent",
|
||||||
"description": "Manage and troubleshoot SQL Server Agent jobs",
|
"description": "Manage and troubleshoot SQL Server Agent jobs",
|
||||||
"version": "0.37.0",
|
"version": "0.40.0",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||||
"icon": "images/sqlserver.png",
|
"icon": "images/sqlserver.png",
|
||||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "0.10.x"
|
"vscode": "^1.25.0"
|
||||||
},
|
},
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"*"
|
"*"
|
||||||
@@ -46,7 +46,13 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha-junit-reporter": "^1.17.0",
|
"mocha-junit-reporter": "^1.17.0",
|
||||||
"mocha-multi-reporters": "^1.1.7"
|
"mocha-multi-reporters": "^1.1.7",
|
||||||
|
"@types/mocha": "^5.2.5",
|
||||||
|
"@types/node": "^8.10.25",
|
||||||
|
"mocha": "^5.2.0",
|
||||||
|
"should": "^13.2.1",
|
||||||
|
"typemoq": "^2.1.0",
|
||||||
|
"vscode": "1.1.5"
|
||||||
},
|
},
|
||||||
"__metadata": {
|
"__metadata": {
|
||||||
"id": "10",
|
"id": "10",
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as data from 'azdata';
|
import * as data from 'azdata';
|
||||||
|
|
||||||
@@ -12,7 +11,6 @@ import * as data from 'azdata';
|
|||||||
* this API from our code
|
* this API from our code
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
* @class ApiWrapper
|
|
||||||
*/
|
*/
|
||||||
export class ApiWrapper {
|
export class ApiWrapper {
|
||||||
// Data APIs
|
// Data APIs
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
|||||||
private static readonly CancelButtonText: string = localize('agentDialog.Cancel', 'Cancel');
|
private static readonly CancelButtonText: string = localize('agentDialog.Cancel', 'Cancel');
|
||||||
|
|
||||||
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
|
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
|
||||||
|
protected _isOpen: boolean = false;
|
||||||
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
|
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
|
||||||
public dialog: azdata.window.Dialog;
|
public dialog: azdata.window.Dialog;
|
||||||
|
|
||||||
@@ -35,6 +36,8 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
|||||||
protected abstract async initializeDialog(dialog: azdata.window.Dialog);
|
protected abstract async initializeDialog(dialog: azdata.window.Dialog);
|
||||||
|
|
||||||
public async openDialog(dialogName?: string) {
|
public async openDialog(dialogName?: string) {
|
||||||
|
if (!this._isOpen) {
|
||||||
|
this._isOpen = true;
|
||||||
let event = dialogName ? dialogName : null;
|
let event = dialogName ? dialogName : null;
|
||||||
this.dialog = azdata.window.createModelViewDialog(this.title, event);
|
this.dialog = azdata.window.createModelViewDialog(this.title, event);
|
||||||
|
|
||||||
@@ -50,14 +53,17 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
|||||||
|
|
||||||
azdata.window.openDialog(this.dialog);
|
azdata.window.openDialog(this.dialog);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected async execute() {
|
protected async execute() {
|
||||||
this.updateModel();
|
this.updateModel();
|
||||||
await this.model.save();
|
await this.model.save();
|
||||||
|
this._isOpen = false;
|
||||||
this._onSuccess.fire(this.model);
|
this._onSuccess.fire(this.model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async cancel() {
|
protected async cancel() {
|
||||||
|
this._isOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getActualConditionValue(checkbox: azdata.CheckBoxComponent, dropdown: azdata.DropDownComponent): azdata.JobCompletionActionCondition {
|
protected getActualConditionValue(checkbox: azdata.CheckBoxComponent, dropdown: azdata.DropDownComponent): azdata.JobCompletionActionCondition {
|
||||||
@@ -77,4 +83,8 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get isOpen(): boolean {
|
||||||
|
return this._isOpen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -229,7 +229,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
this.StepsTable_FailureColumnString
|
this.StepsTable_FailureColumnString
|
||||||
],
|
],
|
||||||
data: data,
|
data: data,
|
||||||
height: 650
|
height: 500
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.startStepDropdown = view.modelBuilder.dropDown().withProperties({ width: 180 }).component();
|
this.startStepDropdown = view.modelBuilder.dropDown().withProperties({ width: 180 }).component();
|
||||||
@@ -610,7 +610,8 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
{
|
{
|
||||||
component: deleteJobContainer,
|
component: deleteJobContainer,
|
||||||
title: ''
|
title: ''
|
||||||
}], title: this.NotificationsTabTopLabelString}]).withLayout({ width: '100%' }).component();
|
}], title: this.NotificationsTabTopLabelString
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
await view.initializeModel(formModel);
|
await view.initializeModel(formModel);
|
||||||
this.emailConditionDropdown.values = this.model.JobCompletionActionConditions;
|
this.emailConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as assert from 'assert';
|
|
||||||
import 'mocha';
|
|
||||||
import * as vscode from 'vscode';
|
|
||||||
import * as azdata from 'azdata';
|
|
||||||
import { JobData } from '../data/jobData';
|
|
||||||
import { TestAgentService } from './testAgentService';
|
|
||||||
|
|
||||||
const testOwnerUri = 'agent://testuri';
|
|
||||||
|
|
||||||
suite('Agent extension', () => {
|
|
||||||
test('Create Job Data', async () => {
|
|
||||||
let testAgentService = new TestAgentService();
|
|
||||||
let data = new JobData(testOwnerUri, undefined, testAgentService);
|
|
||||||
data.save();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
82
extensions/agent/src/test/agentServiceTests/agent.test.ts
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as should from 'should';
|
||||||
|
import * as TypeMoq from 'typemoq';
|
||||||
|
import 'mocha';
|
||||||
|
import * as azdata from 'azdata';
|
||||||
|
import { JobData } from '../../data/jobData';
|
||||||
|
|
||||||
|
const testOwnerUri = 'agent://testuri';
|
||||||
|
let mockJobData: TypeMoq.IMock<JobData>;
|
||||||
|
let mockAgentService: TypeMoq.IMock<azdata.AgentServicesProvider>;
|
||||||
|
|
||||||
|
describe('Agent extension create job objects', function (): void {
|
||||||
|
beforeEach(() => {
|
||||||
|
mockAgentService = TypeMoq.Mock.ofType<azdata.AgentServicesProvider>();
|
||||||
|
mockAgentService.setup(s => s.createJob(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createJob(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockAgentService.setup(s => s.createAlert(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createAlert(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockAgentService.setup(s => s.createJobSchedule(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createJobSchedule(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockAgentService.setup(s => s.createJobStep(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createJobStep(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockAgentService.setup(s => s.createOperator(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createOperator(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockAgentService.setup(s => s.createProxy(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => TypeMoq.It.isAny());
|
||||||
|
mockAgentService.setup(s => s.createProxy(undefined, TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Job Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createJobResult = mockAgentService.object.createJob(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createJobResult, undefined);
|
||||||
|
createJobResult = mockAgentService.object.createJob(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createJobResult, undefined);
|
||||||
|
mockJobData = TypeMoq.Mock.ofType<JobData>(JobData, TypeMoq.MockBehavior.Loose, false, [TypeMoq.It.isAnyString(), undefined, mockAgentService]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Alert Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createAlertResult = mockAgentService.object.createAlert(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createAlertResult, undefined);
|
||||||
|
createAlertResult = mockAgentService.object.createAlert(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createAlertResult, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Job Schedule Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createJobScheduleResult = mockAgentService.object.createJobSchedule(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createJobScheduleResult, undefined);
|
||||||
|
createJobScheduleResult = mockAgentService.object.createJobSchedule(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createJobScheduleResult, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Job Step Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createJobStepResult = mockAgentService.object.createJobStep(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createJobStepResult, undefined);
|
||||||
|
createJobStepResult = mockAgentService.object.createJobStep(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createJobStepResult, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Operator Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createOperatorResult = mockAgentService.object.createOperator(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createOperatorResult, undefined);
|
||||||
|
createOperatorResult = mockAgentService.object.createOperator(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createOperatorResult, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create Proxy Data', async () => {
|
||||||
|
// should fail when ownerUri is null
|
||||||
|
let createProxyResult = mockAgentService.object.createProxy(null, TypeMoq.It.isAny());
|
||||||
|
should.strictEqual(createProxyResult, undefined);
|
||||||
|
createProxyResult = mockAgentService.object.createProxy(testOwnerUri, TypeMoq.It.isAny());
|
||||||
|
should.notEqual(createProxyResult, undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
30
extensions/agent/src/test/index.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const testRunner = require('vscode/lib/testrunner');
|
||||||
|
|
||||||
|
const suite = 'Agent Tests';
|
||||||
|
|
||||||
|
const options: any = {
|
||||||
|
ui: 'bdd',
|
||||||
|
useColors: true,
|
||||||
|
timeout: 600000
|
||||||
|
};
|
||||||
|
|
||||||
|
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||||
|
options.reporter = 'mocha-multi-reporters';
|
||||||
|
options.reporterOptions = {
|
||||||
|
reporterEnabled: 'spec, mocha-junit-reporter',
|
||||||
|
mochaJunitReporterReporterOptions: {
|
||||||
|
testsuitesTitle: `${suite} ${process.platform}`,
|
||||||
|
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
testRunner.configure(options);
|
||||||
|
|
||||||
|
export = testRunner;
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
|
||||||
|
|
||||||
export class TestAgentService implements azdata.AgentServicesProvider {
|
|
||||||
handle?: number;
|
|
||||||
readonly providerId: string = 'Test Provider';
|
|
||||||
|
|
||||||
// Job management methods
|
|
||||||
getJobs(ownerUri: string): Thenable<azdata.AgentJobsResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
getJobHistory(ownerUri: string, jobId: string, jobName: string): Thenable<azdata.AgentJobHistoryResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
jobAction(ownerUri: string, jobName: string, action: string): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
createJob(ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.CreateAgentJobResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateJob(ownerUri: string, originalJobName: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.UpdateAgentJobResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteJob(ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
getJobDefaults(ownerUri: string): Thenable<azdata.AgentJobDefaultsResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Job Step management methods
|
|
||||||
createJobStep(ownerUri: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.CreateAgentJobStepResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateJobStep(ownerUri: string, originalJobStepName: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.UpdateAgentJobStepResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteJobStep(ownerUri: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Alert management methods
|
|
||||||
getAlerts(ownerUri: string): Thenable<azdata.AgentAlertsResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
createAlert(ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.CreateAgentAlertResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateAlert(ownerUri: string, originalAlertName: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.UpdateAgentAlertResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteAlert(ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Operator management methods
|
|
||||||
getOperators(ownerUri: string): Thenable<azdata.AgentOperatorsResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
createOperator(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.CreateAgentOperatorResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateOperator(ownerUri: string, originalOperatorName: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.UpdateAgentOperatorResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteOperator(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Proxy management methods
|
|
||||||
getProxies(ownerUri: string): Thenable<azdata.AgentProxiesResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
createProxy(ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.CreateAgentOperatorResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateProxy(ownerUri: string, originalProxyName: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.UpdateAgentOperatorResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteProxy(ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Agent Credential method
|
|
||||||
getCredentials(ownerUri: string): Thenable<azdata.GetCredentialsResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Job Schedule management methods
|
|
||||||
getJobSchedules(ownerUri: string): Thenable<azdata.AgentJobSchedulesResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
createJobSchedule(ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.CreateAgentJobScheduleResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
updateJobSchedule(ownerUri: string, originalScheduleName: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.UpdateAgentJobScheduleResult> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
deleteJobSchedule(ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.ResultStatus> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
registerOnUpdated(handler: () => any): void {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node"
|
||||||
"declaration": true
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
src/**
|
||||||
|
out/**
|
||||||
|
tsconfig.json
|
||||||
|
extension.webpack.config.js
|
||||||
|
yarn.lock
|
||||||
|
|||||||
@@ -3,16 +3,19 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// localizable strings
|
//@ts-check
|
||||||
|
|
||||||
export const InvalidProvider = 'Provider is invalid';
|
'use strict';
|
||||||
|
|
||||||
/**
|
const withDefaults = require('../shared.webpack.config');
|
||||||
* Feature names
|
|
||||||
*/
|
|
||||||
export const RestoreFeatureName = 'restore';
|
|
||||||
export const BackupFeatureName = 'backup';
|
|
||||||
|
|
||||||
export const MssqlProviderId = 'MSSQL';
|
|
||||||
export const notebookModeId = 'notebook';
|
|
||||||
|
|
||||||
|
module.exports = withDefaults({
|
||||||
|
context: __dirname,
|
||||||
|
entry: {
|
||||||
|
extension: './src/extension.ts'
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
'ms-rest': 'commonjs ms-rest',
|
||||||
|
'request': 'commonjs request'
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.25.0",
|
"vscode": "^1.30.1",
|
||||||
"azdata": "*"
|
"azdata": "*"
|
||||||
},
|
},
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
@@ -42,15 +42,15 @@
|
|||||||
{
|
{
|
||||||
"id": "microsoft",
|
"id": "microsoft",
|
||||||
"icon": {
|
"icon": {
|
||||||
"light": "./out/account-provider/media/microsoft_account_light.svg",
|
"light": "./resources/light/microsoft_account_light.svg",
|
||||||
"dark": "./out/account-provider/media/microsoft_account_dark.svg"
|
"dark": "./resources/dark/microsoft_account_dark.svg"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "work_school",
|
"id": "work_school",
|
||||||
"icon": {
|
"icon": {
|
||||||
"light": "./out/account-provider/media/work_school_account_light.svg",
|
"light": "./resources/light/work_school_account_light.svg",
|
||||||
"dark": "./out/account-provider/media/work_school_account_dark.svg"
|
"dark": "./resources/dark/work_school_account_dark.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -104,8 +104,8 @@
|
|||||||
"command": "azure.resource.connectsqldb",
|
"command": "azure.resource.connectsqldb",
|
||||||
"title": "%azure.resource.connectsqldb.title%",
|
"title": "%azure.resource.connectsqldb.title%",
|
||||||
"icon": {
|
"icon": {
|
||||||
"dark": "resources/dark/connect_to_inverse.svg",
|
"dark": "resources/dark/add_to_server_list_inverse.svg",
|
||||||
"light": "resources/light/connect_to.svg"
|
"light": "resources/light/add_to_server_list.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -118,6 +118,33 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"menus": {
|
"menus": {
|
||||||
|
"commandPalette": [
|
||||||
|
{
|
||||||
|
"command": "azure.resource.signin",
|
||||||
|
"when": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "azure.resource.refreshall",
|
||||||
|
"when": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "azure.resource.selectsubscriptions",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "azure.resource.refresh",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "azure.resource.connectsqlserver",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "azure.resource.connectsqldb",
|
||||||
|
"when": "false"
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
"view/title": [
|
"view/title": [
|
||||||
{
|
{
|
||||||
"command": "azure.resource.signin",
|
"command": "azure.resource.signin",
|
||||||
@@ -156,17 +183,20 @@
|
|||||||
"hasAzureResourceProviders": true
|
"hasAzureResourceProviders": true
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"adal-node": "^0.1.28",
|
||||||
"azure-arm-resource": "^7.0.0",
|
"azure-arm-resource": "^7.0.0",
|
||||||
"azure-arm-sql": "^5.0.1",
|
"azure-arm-sql": "^5.0.1",
|
||||||
|
"ms-rest": "^2.5.0",
|
||||||
"request": "2.88.0",
|
"request": "2.88.0",
|
||||||
"vscode-nls": "^4.0.0"
|
"vscode-nls": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mocha": "^5.2.5",
|
"@types/mocha": "^5.2.5",
|
||||||
"@types/node": "^8.0.24",
|
"@types/node": "^10.12.12",
|
||||||
|
"@types/request": "^2.48.1",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
"should": "^13.2.1",
|
"should": "^13.2.1",
|
||||||
"typemoq": "^2.1.0",
|
"typemoq": "^2.1.0",
|
||||||
"vscode": "^1.1.26"
|
"vscode": "1.1.26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
"azure.resource.config.title": "Azure Resource Configuration",
|
"azure.resource.config.title": "Azure Resource Configuration",
|
||||||
"azure.resource.config.filter.description": "The resource filter, each element is an account id, a subscription id and name separated by a slash",
|
"azure.resource.config.filter.description": "The resource filter, each element is an account id, a subscription id and name separated by a slash",
|
||||||
"azure.resource.explorer.title": "Azure",
|
"azure.resource.explorer.title": "Azure",
|
||||||
"azure.resource.refreshall.title": "Refresh All",
|
"azure.resource.refreshall.title": "Azure: Refresh All Accounts",
|
||||||
"azure.resource.refresh.title": "Refresh",
|
"azure.resource.refresh.title": "Refresh",
|
||||||
"azure.resource.signin.title": "Sign In",
|
"azure.resource.signin.title": "Azure: Sign In",
|
||||||
"azure.resource.selectsubscriptions.title": "Select Subscriptions",
|
"azure.resource.selectsubscriptions.title": "Select Subscriptions",
|
||||||
"azure.resource.connectsqlserver.title": "Add to Servers",
|
"azure.resource.connectsqlserver.title": "Connect",
|
||||||
"azure.resource.connectsqldb.title": "Connect",
|
"azure.resource.connectsqldb.title": "Add to Servers",
|
||||||
|
|
||||||
"accounts.clearTokenCache": "Clear Azure Account Token Cache",
|
"accounts.clearTokenCache": "Clear Azure Account Token Cache",
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M13 12H16V13H13V16H12V13H9V12H12V9H13V12ZM1 6V5H2V6H1ZM15 5V6H4V5H15ZM1 3V2H2V3H1ZM15 2V3H4V2H15Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 226 B |
@@ -1 +0,0 @@
|
|||||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><style>.cls-1,.cls-2{clip-rule:evenodd;}.cls-2,.cls-5,.cls-7{fill:#fff;}.cls-3,.cls-5{fill-rule:evenodd;}.cls-4{clip-path:url(#clip-path);}.cls-6{clip-path:url(#clip-path-2);}</style><clipPath id="clip-path"><path class="cls-1" d="M11.5-15.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5-9v6h-1V-9a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1,2.53,2.53,0,0,0,.53.8,2.53,2.53,0,0,0,.8.53,2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath><clipPath id="clip-path-2"><path class="cls-2" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath></defs><title>connect_to_inverse</title><path class="cls-3" d="M11.5-15.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5-9v6h-1V-9a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1,2.53,2.53,0,0,0,.53.8,2.53,2.53,0,0,0,.8.53,2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-4"><rect x="-0.5" y="-23.92" width="17" height="26"/></g><path class="cls-5" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-6"><rect class="cls-7" x="-0.5" y="-5" width="17" height="26"/></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M13 12H16V13H13V16H12V13H9V12H12V9H13V12ZM1 6V5H2V6H1ZM15 5V6H4V5H15ZM1 3V2H2V3H1ZM15 2V3H4V2H15Z" fill="#333333"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 228 B |
@@ -1 +0,0 @@
|
|||||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><style>.cls-1,.cls-2{clip-rule:evenodd;}.cls-2,.cls-5,.cls-7{fill:#fff;}.cls-3,.cls-5{fill-rule:evenodd;}.cls-4{clip-path:url(#clip-path);}.cls-6{clip-path:url(#clip-path-2);}</style><clipPath id="clip-path"><path class="cls-1" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath><clipPath id="clip-path-2"><path class="cls-2" d="M11.5,21.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77,3.43,3.43,0,0,1-1.19.4v6h-1v-6a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,27.72a2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/></clipPath></defs><title>connect_to</title><path class="cls-3" d="M11.5,3V6.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77A3.43,3.43,0,0,1,8.5,10v6h-1V10a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05A3.4,3.4,0,0,1,4.5,6.5V3h1V0h1V3h3V0h1V3Zm-1,1h-5V6.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,8.8,2.45,2.45,0,0,0,8,9a2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-4"><rect x="-0.5" y="-5" width="17" height="26"/></g><path class="cls-5" d="M11.5,21.92v3.5a3.4,3.4,0,0,1-.23,1.24,3.48,3.48,0,0,1-.63,1.05,3.57,3.57,0,0,1-1,.77,3.43,3.43,0,0,1-1.19.4v6h-1v-6a3.39,3.39,0,0,1-1.2-.4,3.59,3.59,0,0,1-.95-.77,3.48,3.48,0,0,1-.63-1.05,3.4,3.4,0,0,1-.23-1.24v-3.5h1v-3h1v3h3v-3h1v3Zm-1,1h-5v2.5a2.45,2.45,0,0,0,.2,1A2.49,2.49,0,0,0,7,27.72a2.45,2.45,0,0,0,1,.2,2.42,2.42,0,0,0,1-.2,2.53,2.53,0,0,0,.79-.53,2.59,2.59,0,0,0,.54-.8,2.41,2.41,0,0,0,.2-1Z"/><g class="cls-6"><rect class="cls-7" x="-0.5" y="13.92" width="17" height="26"/></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -3,8 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as adal from 'adal-node';
|
import * as adal from 'adal-node';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as request from 'request';
|
import * as request from 'request';
|
||||||
@@ -12,7 +10,6 @@ import * as nls from 'vscode-nls';
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
import {
|
import {
|
||||||
Arguments,
|
|
||||||
AzureAccount,
|
AzureAccount,
|
||||||
AzureAccountProviderMetadata,
|
AzureAccountProviderMetadata,
|
||||||
AzureAccountSecurityTokenCollection,
|
AzureAccountSecurityTokenCollection,
|
||||||
@@ -29,17 +26,12 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
private static AadCommonTenant: string = 'common';
|
private static AadCommonTenant: string = 'common';
|
||||||
|
|
||||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||||
private _args: Arguments;
|
|
||||||
private _autoOAuthCancelled: boolean;
|
private _autoOAuthCancelled: boolean;
|
||||||
private _commonAuthorityUrl: string;
|
private _commonAuthorityUrl: string;
|
||||||
private _inProgressAutoOAuth: InProgressAutoOAuth;
|
private _inProgressAutoOAuth: InProgressAutoOAuth;
|
||||||
private _isInitialized: boolean;
|
private _isInitialized: boolean;
|
||||||
|
|
||||||
constructor(private _metadata: AzureAccountProviderMetadata, private _tokenCache: TokenCache) {
|
constructor(private _metadata: AzureAccountProviderMetadata, private _tokenCache: TokenCache) {
|
||||||
this._args = {
|
|
||||||
host: this._metadata.settings.host,
|
|
||||||
clientId: this._metadata.settings.clientId
|
|
||||||
};
|
|
||||||
this._autoOAuthCancelled = false;
|
this._autoOAuthCancelled = false;
|
||||||
this._inProgressAutoOAuth = null;
|
this._inProgressAutoOAuth = null;
|
||||||
this._isInitialized = false;
|
this._isInitialized = false;
|
||||||
@@ -54,8 +46,8 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all tokens that belong to the given account from the token cache
|
* Clears all tokens that belong to the given account from the token cache
|
||||||
* @param {"data".AccountKey} accountKey Key identifying the account to delete tokens for
|
* @param accountKey Key identifying the account to delete tokens for
|
||||||
* @returns {Thenable<void>} Promise to clear requested tokens from the token cache
|
* @returns Promise to clear requested tokens from the token cache
|
||||||
*/
|
*/
|
||||||
public clear(accountKey: azdata.AccountKey): Thenable<void> {
|
public clear(accountKey: azdata.AccountKey): Thenable<void> {
|
||||||
return this.doIfInitialized(() => this.clearAccountTokens(accountKey));
|
return this.doIfInitialized(() => this.clearAccountTokens(accountKey));
|
||||||
@@ -63,7 +55,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the entire token cache. Invoked by command palette action.
|
* Clears the entire token cache. Invoked by command palette action.
|
||||||
* @returns {Thenable<void>} Promise to clear the token cache
|
* @returns Promise to clear the token cache
|
||||||
*/
|
*/
|
||||||
public clearTokenCache(): Thenable<void> {
|
public clearTokenCache(): Thenable<void> {
|
||||||
return this._tokenCache.clear();
|
return this._tokenCache.clear();
|
||||||
@@ -111,16 +103,16 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public prompt(): Thenable<AzureAccount> {
|
public prompt(): Thenable<AzureAccount | azdata.PromptFailedResult> {
|
||||||
return this.doIfInitialized(() => this.signIn(true));
|
return this.doIfInitialized(() => this.signIn(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public refresh(account: AzureAccount): Thenable<AzureAccount> {
|
public refresh(account: AzureAccount): Thenable<AzureAccount | azdata.PromptFailedResult> {
|
||||||
return this.doIfInitialized(() => this.signIn(false));
|
return this.doIfInitialized(() => this.signIn(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// PRIVATE METHODS /////////////////////////////////////////////////////
|
// PRIVATE METHODS /////////////////////////////////////////////////////
|
||||||
private cancelAutoOAuth(): Thenable<void> {
|
private cancelAutoOAuth(): Promise<void> {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
if (!this._inProgressAutoOAuth) {
|
if (!this._inProgressAutoOAuth) {
|
||||||
@@ -145,23 +137,23 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
private clearAccountTokens(accountKey: azdata.AccountKey): Thenable<void> {
|
private async clearAccountTokens(accountKey: azdata.AccountKey): Promise<void> {
|
||||||
// Put together a query to look up any tokens associated with the account key
|
// Put together a query to look up any tokens associated with the account key
|
||||||
let query = <adal.TokenResponse>{ userId: accountKey.accountId };
|
let query = <adal.TokenResponse>{ userId: accountKey.accountId };
|
||||||
|
|
||||||
// 1) Look up the tokens associated with the query
|
// 1) Look up the tokens associated with the query
|
||||||
// 2) Remove them
|
// 2) Remove them
|
||||||
return this._tokenCache.findThenable(query)
|
let results = await this._tokenCache.findThenable(query);
|
||||||
.then(results => this._tokenCache.removeThenable(results));
|
this._tokenCache.removeThenable(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
private doIfInitialized<T>(op: () => Thenable<T>): Thenable<T> {
|
private doIfInitialized<T>(op: () => Promise<T>): Promise<T> {
|
||||||
return this._isInitialized
|
return this._isInitialized
|
||||||
? op()
|
? op()
|
||||||
: Promise.reject(localize('accountProviderNotInitialized', 'Account provider not initialized, cannot perform action'));
|
: Promise.reject(localize('accountProviderNotInitialized', 'Account provider not initialized, cannot perform action'));
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAccessTokens(account: AzureAccount, resource: azdata.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
private getAccessTokens(account: AzureAccount, resource: azdata.AzureResource): Promise<AzureAccountSecurityTokenCollection> {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
const resourceIdMap = new Map<azdata.AzureResource, string>([
|
const resourceIdMap = new Map<azdata.AzureResource, string>([
|
||||||
@@ -236,7 +228,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDeviceLoginToken(oAuth: InProgressAutoOAuth, isAddAccount: boolean): Thenable<adal.TokenResponse> {
|
private getDeviceLoginToken(oAuth: InProgressAutoOAuth, isAddAccount: boolean): Thenable<adal.TokenResponse | azdata.PromptFailedResult> {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
// 1) Open the auto OAuth dialog
|
// 1) Open the auto OAuth dialog
|
||||||
@@ -247,14 +239,15 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
localize('refreshAccount', 'Refresh {0} account', self._metadata.displayName);
|
localize('refreshAccount', 'Refresh {0} account', self._metadata.displayName);
|
||||||
return azdata.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
|
return azdata.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return new Promise<adal.TokenResponse>((resolve, reject) => {
|
return new Promise<adal.TokenResponse | azdata.PromptFailedResult>((resolve, reject) => {
|
||||||
let context = oAuth.context;
|
let context = oAuth.context;
|
||||||
context.acquireTokenWithDeviceCode(self._metadata.settings.signInResourceId, self._metadata.settings.clientId, oAuth.userCodeInfo,
|
context.acquireTokenWithDeviceCode(self._metadata.settings.signInResourceId, self._metadata.settings.clientId, oAuth.userCodeInfo,
|
||||||
(err, response) => {
|
(err, response) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (self._autoOAuthCancelled) {
|
if (self._autoOAuthCancelled) {
|
||||||
|
let result: azdata.PromptFailedResult = { canceled: true };
|
||||||
// Auto OAuth was cancelled by the user, indicate this with the error we return
|
// Auto OAuth was cancelled by the user, indicate this with the error we return
|
||||||
reject(<azdata.UserCancelledSignInError>{ userCancelledSignIn: true });
|
resolve(result);
|
||||||
} else {
|
} else {
|
||||||
// Auto OAuth failed for some other reason
|
// Auto OAuth failed for some other reason
|
||||||
azdata.accounts.endAutoOAuthDeviceCode();
|
azdata.accounts.endAutoOAuthDeviceCode();
|
||||||
@@ -321,10 +314,10 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
* Retrieves a token for the given user ID for the specific tenant ID. If the token can, it
|
* Retrieves a token for the given user ID for the specific tenant ID. If the token can, it
|
||||||
* will be retrieved from the cache as per the ADAL API. AFAIK, the ADAL API will also utilize
|
* will be retrieved from the cache as per the ADAL API. AFAIK, the ADAL API will also utilize
|
||||||
* the refresh token if there aren't any unexpired tokens to use.
|
* the refresh token if there aren't any unexpired tokens to use.
|
||||||
* @param {string} userId ID of the user to get a token for
|
* @param userId ID of the user to get a token for
|
||||||
* @param {string} tenantId Tenant to get the token for
|
* @param tenantId Tenant to get the token for
|
||||||
* @param {string} resourceId ID of the resource the token will be good for
|
* @param resourceId ID of the resource the token will be good for
|
||||||
* @returns {Thenable<TokenResponse>} Promise to return a token. Rejected if retrieving the token fails.
|
* @returns Promise to return a token. Rejected if retrieving the token fails.
|
||||||
*/
|
*/
|
||||||
private getToken(userId: string, tenantId: string, resourceId: string): Thenable<adal.TokenResponse> {
|
private getToken(userId: string, tenantId: string, resourceId: string): Thenable<adal.TokenResponse> {
|
||||||
let self = this;
|
let self = this;
|
||||||
@@ -346,9 +339,9 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a web request using the provided bearer token
|
* Performs a web request using the provided bearer token
|
||||||
* @param {TokenResponse} accessToken Bearer token for accessing the provided URI
|
* @param accessToken Bearer token for accessing the provided URI
|
||||||
* @param {string} uri URI to access
|
* @param uri URI to access
|
||||||
* @returns {Thenable<any>} Promise to return the deserialized body of the request. Rejected if error occurred.
|
* @returns Promise to return the deserialized body of the request. Rejected if error occurred.
|
||||||
*/
|
*/
|
||||||
private makeWebRequest(accessToken: adal.TokenResponse, uri: string): Thenable<any> {
|
private makeWebRequest(accessToken: adal.TokenResponse, uri: string): Thenable<any> {
|
||||||
return new Promise<any>((resolve, reject) => {
|
return new Promise<any>((resolve, reject) => {
|
||||||
@@ -363,7 +356,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Setup the callback to resolve/reject this promise
|
// Setup the callback to resolve/reject this promise
|
||||||
let callback = (error, response, body: { error: any; value: any; }) => {
|
const callback: request.RequestCallback = (error, response, body: { error: any; value: any; }) => {
|
||||||
if (error || body.error) {
|
if (error || body.error) {
|
||||||
reject(error || JSON.stringify(body.error));
|
reject(error || JSON.stringify(body.error));
|
||||||
} else {
|
} else {
|
||||||
@@ -376,27 +369,27 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private signIn(isAddAccount: boolean): Thenable<AzureAccount> {
|
private isPromptFailed(value: adal.TokenResponse | azdata.PromptFailedResult): value is azdata.PromptFailedResult {
|
||||||
let self = this;
|
return value && (<azdata.PromptFailedResult>value).canceled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async signIn(isAddAccount: boolean): Promise<AzureAccount | azdata.PromptFailedResult> {
|
||||||
// 1) Get the user code for this login
|
// 1) Get the user code for this login
|
||||||
// 2) Get an access token from the device code
|
// 2) Get an access token from the device code
|
||||||
// 3) Get the list of tenants
|
// 3) Get the list of tenants
|
||||||
// 4) Generate the AzureAccount object and return it
|
// 4) Generate the AzureAccount object and return it
|
||||||
let tokenResponse: adal.TokenResponse = null;
|
let tokenResponse: adal.TokenResponse = null;
|
||||||
return this.getDeviceLoginUserCode()
|
let result: InProgressAutoOAuth = await this.getDeviceLoginUserCode();
|
||||||
.then((result: InProgressAutoOAuth) => {
|
this._autoOAuthCancelled = false;
|
||||||
self._autoOAuthCancelled = false;
|
this._inProgressAutoOAuth = result;
|
||||||
self._inProgressAutoOAuth = result;
|
let response: adal.TokenResponse | azdata.PromptFailedResult = await this.getDeviceLoginToken(this._inProgressAutoOAuth, isAddAccount);
|
||||||
return self.getDeviceLoginToken(self._inProgressAutoOAuth, isAddAccount);
|
if (this.isPromptFailed(response)) {
|
||||||
})
|
return response;
|
||||||
.then((response: adal.TokenResponse) => {
|
}
|
||||||
tokenResponse = response;
|
tokenResponse = response;
|
||||||
self._autoOAuthCancelled = false;
|
this._autoOAuthCancelled = false;
|
||||||
self._inProgressAutoOAuth = null;
|
this._inProgressAutoOAuth = null;
|
||||||
return self.getTenants(tokenResponse.userId, tokenResponse.userId);
|
let tenants: Tenant[] = await this.getTenants(tokenResponse.userId, tokenResponse.userId);
|
||||||
})
|
|
||||||
.then((tenants: Tenant[]) => {
|
|
||||||
// Figure out where we're getting the identity from
|
// Figure out where we're getting the identity from
|
||||||
let identityProvider = tokenResponse.identityProvider;
|
let identityProvider = tokenResponse.identityProvider;
|
||||||
if (identityProvider) {
|
if (identityProvider) {
|
||||||
@@ -427,12 +420,13 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
|
|
||||||
return <AzureAccount>{
|
return <AzureAccount>{
|
||||||
key: {
|
key: {
|
||||||
providerId: self._metadata.id,
|
providerId: this._metadata.id,
|
||||||
accountId: tokenResponse.userId
|
accountId: tokenResponse.userId
|
||||||
},
|
},
|
||||||
name: tokenResponse.userId,
|
name: tokenResponse.userId,
|
||||||
displayInfo: {
|
displayInfo: {
|
||||||
accountType: accountType,
|
accountType: accountType,
|
||||||
|
userId: tokenResponse.userId,
|
||||||
contextualDisplayName: contextualDisplayName,
|
contextualDisplayName: contextualDisplayName,
|
||||||
displayName: displayName
|
displayName: displayName
|
||||||
},
|
},
|
||||||
@@ -442,7 +436,6 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
|||||||
},
|
},
|
||||||
isStale: false
|
isStale: false
|
||||||
};
|
};
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as adal from 'adal-node';
|
import * as adal from 'adal-node';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
@@ -79,7 +77,7 @@ export default class TokenCache implements adal.TokenCache {
|
|||||||
/**
|
/**
|
||||||
* Wrapper to make callback-based find method into a thenable method
|
* Wrapper to make callback-based find method into a thenable method
|
||||||
* @param query Partial object to use to look up tokens. Ideally should be partial of adal.TokenResponse
|
* @param query Partial object to use to look up tokens. Ideally should be partial of adal.TokenResponse
|
||||||
* @returns {Thenable<any[]>} Promise to return the matching adal.TokenResponse objects.
|
* @returns Promise to return the matching adal.TokenResponse objects.
|
||||||
* Rejected if an error was sent in the callback
|
* Rejected if an error was sent in the callback
|
||||||
*/
|
*/
|
||||||
public findThenable(query: any): Thenable<any[]> {
|
public findThenable(query: any): Thenable<any[]> {
|
||||||
@@ -112,8 +110,8 @@ export default class TokenCache implements adal.TokenCache {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper to make callback-based remove method into a thenable method
|
* Wrapper to make callback-based remove method into a thenable method
|
||||||
* @param {TokenResponse[]} entries Array of entries to remove from the token cache
|
* @param entries Array of entries to remove from the token cache
|
||||||
* @returns {Thenable<void>} Promise to remove the given tokens from the token cache
|
* @returns Promise to remove the given tokens from the token cache
|
||||||
* Rejected if an error was sent in the callback
|
* Rejected if an error was sent in the callback
|
||||||
*/
|
*/
|
||||||
public removeThenable(entries: adal.TokenResponse[]): Thenable<void> {
|
public removeThenable(entries: adal.TokenResponse[]): Thenable<void> {
|
||||||
@@ -138,7 +136,7 @@ export default class TokenCache implements adal.TokenCache {
|
|||||||
&& entry1.resource === entry2.resource;
|
&& entry1.resource === entry2.resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static findByPartial(entry: adal.TokenResponse, query: object): boolean {
|
private static findByPartial(entry: adal.TokenResponse, query: { [key: string]: any }): boolean {
|
||||||
for (let key in query) {
|
for (let key in query) {
|
||||||
if (entry[key] === undefined || entry[key] !== query[key]) {
|
if (entry[key] === undefined || entry[key] !== query[key]) {
|
||||||
return false;
|
return false;
|
||||||
@@ -186,8 +184,8 @@ export default class TokenCache implements adal.TokenCache {
|
|||||||
if (splitValues.length === 2 && splitValues[0] && splitValues[1]) {
|
if (splitValues.length === 2 && splitValues[0] && splitValues[1]) {
|
||||||
try {
|
try {
|
||||||
return <EncryptionParams>{
|
return <EncryptionParams>{
|
||||||
key: new Buffer(splitValues[0], 'hex'),
|
key: Buffer.from(splitValues[0], 'hex'),
|
||||||
initializationVector: new Buffer(splitValues[1], 'hex')
|
initializationVector: Buffer.from(splitValues[1], 'hex')
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Swallow the error and fall through to generate new params
|
// Swallow the error and fall through to generate new params
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
|
||||||
@@ -15,7 +13,6 @@ import * as constants from './constants';
|
|||||||
* this API from our code
|
* this API from our code
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
* @class ApiWrapper
|
|
||||||
*/
|
*/
|
||||||
export class ApiWrapper {
|
export class ApiWrapper {
|
||||||
// Data APIs
|
// Data APIs
|
||||||
@@ -156,12 +153,6 @@ export class ApiWrapper {
|
|||||||
return vscode.window.showSaveDialog(options);
|
return vscode.window.showSaveDialog(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openTextDocument(uri: vscode.Uri): Thenable<vscode.TextDocument>;
|
|
||||||
public openTextDocument(options: { language?: string; content?: string; }): Thenable<vscode.TextDocument>;
|
|
||||||
public openTextDocument(uriOrOptions): Thenable<vscode.TextDocument> {
|
|
||||||
return vscode.workspace.openTextDocument(uriOrOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
public showTextDocument(document: vscode.TextDocument, column?: vscode.ViewColumn, preserveFocus?: boolean, preview?: boolean): Thenable<vscode.TextEditor> {
|
public showTextDocument(document: vscode.TextDocument, column?: vscode.ViewColumn, preserveFocus?: boolean, preview?: boolean): Thenable<vscode.TextEditor> {
|
||||||
let options: vscode.TextDocumentShowOptions = {
|
let options: vscode.TextDocumentShowOptions = {
|
||||||
viewColumn: column,
|
viewColumn: column,
|
||||||
@@ -212,7 +203,7 @@ export class ApiWrapper {
|
|||||||
return azdata.accounts.getAllAccounts();
|
return azdata.accounts.getAllAccounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> {
|
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{ [key: string]: any }> {
|
||||||
return azdata.accounts.getSecurityToken(account, resource);
|
return azdata.accounts.getSecurityToken(account, resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { ApiWrapper } from './apiWrapper';
|
import { ApiWrapper } from './apiWrapper';
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export enum AzureResourceItemType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum AzureResourceServiceNames {
|
export enum AzureResourceServiceNames {
|
||||||
|
resourceService = 'AzureResourceService',
|
||||||
cacheService = 'AzureResourceCacheService',
|
cacheService = 'AzureResourceCacheService',
|
||||||
accountService = 'AzureResourceAccountService',
|
accountService = 'AzureResourceAccountService',
|
||||||
subscriptionService = 'AzureResourceSubscriptionService',
|
subscriptionService = 'AzureResourceSubscriptionService',
|
||||||
|
|||||||