mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-24 11:01:38 -05:00
Compare commits
157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb35dae1d1 | ||
|
|
cc0a144169 | ||
|
|
b973f9e0ec | ||
|
|
d62068025c | ||
|
|
b2952d2ddf | ||
|
|
a21244816d | ||
|
|
a9aeb57dc4 | ||
|
|
00537ed199 | ||
|
|
c2df3e0e0a | ||
|
|
e3afb1cffc | ||
|
|
b475311f85 | ||
|
|
45005d61e0 | ||
|
|
adfddeae27 | ||
|
|
a7429267bb | ||
|
|
ff415d6a03 | ||
|
|
b4dc35a4de | ||
|
|
29c7ccad39 | ||
|
|
1da3635d03 | ||
|
|
1f50015ed2 | ||
|
|
01892422cb | ||
|
|
afce60b06f | ||
|
|
a2b87f6158 | ||
|
|
76a2f92daf | ||
|
|
5b09d57196 | ||
|
|
95bf18f859 | ||
|
|
1fc648ff37 | ||
|
|
37ba956bad | ||
|
|
697f887539 | ||
|
|
7b42141958 | ||
|
|
158b00f9b4 | ||
|
|
43ac8dfd20 | ||
|
|
34d8d52e7a | ||
|
|
c738b26c04 | ||
|
|
6090e7173f | ||
|
|
7ebf746584 | ||
|
|
e9d04d75ac | ||
|
|
605160a1ba | ||
|
|
82b8750b63 | ||
|
|
61f7f19d12 | ||
|
|
9bd7e30d18 | ||
|
|
572010ded1 | ||
|
|
1f22326e78 | ||
|
|
504d5c91bc | ||
|
|
a34692b6f2 | ||
|
|
73b5d23210 | ||
|
|
e31de8b137 | ||
|
|
cef5bbb2be | ||
|
|
80a8e1a4da | ||
|
|
fcb8fe50fe | ||
|
|
5235c8aad6 | ||
|
|
5b67525211 | ||
|
|
fb697729c0 | ||
|
|
76fe0fef49 | ||
|
|
6295d03801 | ||
|
|
07166fb3cd | ||
|
|
219dfe66d0 | ||
|
|
22c62fb524 | ||
|
|
f8706abebe | ||
|
|
e83a6f9c2e | ||
|
|
63485c8c78 | ||
|
|
72ef024678 | ||
|
|
414c736655 | ||
|
|
fdbfbb9238 | ||
|
|
a766e5d334 | ||
|
|
2faf01eb9d | ||
|
|
a4c2463b2f | ||
|
|
ddbd8033f9 | ||
|
|
6da66cf367 | ||
|
|
c7bc37d010 | ||
|
|
e0ec3c5035 | ||
|
|
d4f287298f | ||
|
|
e70d5838a8 | ||
|
|
b04ca0fdbd | ||
|
|
a064da642d | ||
|
|
37ce37979a | ||
|
|
cb3cbd0d78 | ||
|
|
1415aa1c03 | ||
|
|
7eb17f6abc | ||
|
|
fdb471d506 | ||
|
|
e6785ffe95 | ||
|
|
cc2951265e | ||
|
|
ee413f3b24 | ||
|
|
fc664a850d | ||
|
|
55efe76b2e | ||
|
|
dd8922ce4d | ||
|
|
102b48c302 | ||
|
|
a360bebd9d | ||
|
|
37ab493b78 | ||
|
|
46b7afe558 | ||
|
|
eac3420583 | ||
|
|
e1e9c08242 | ||
|
|
5ac6cf3b74 | ||
|
|
d6a58136da | ||
|
|
819b7b93d1 | ||
|
|
bceeda1cfd | ||
|
|
0d8ef9583b | ||
|
|
b1393ae615 | ||
|
|
464109313b | ||
|
|
83c8baf8e3 | ||
|
|
1bac929ab3 | ||
|
|
b27417da41 | ||
|
|
ef1f72f69b | ||
|
|
784fd57410 | ||
|
|
1dd0afcf80 | ||
|
|
ddce7731b9 | ||
|
|
d00c3780a6 | ||
|
|
4a87a24235 | ||
|
|
f5c9174c2f | ||
|
|
8d5f676039 | ||
|
|
71db7e10b6 | ||
|
|
756f77063a | ||
|
|
5f637036bc | ||
|
|
24b5f41065 | ||
|
|
b00352570b | ||
|
|
0b44b7d384 | ||
|
|
82da64d66d | ||
|
|
ee5a76bb0c | ||
|
|
b65ee5b42e | ||
|
|
8298db7d13 | ||
|
|
5b0e86b179 | ||
|
|
ed2641ea02 | ||
|
|
66939636dc | ||
|
|
2c331d929a | ||
|
|
4472764f3a | ||
|
|
6cb7153bdd | ||
|
|
5142f69655 | ||
|
|
dfe23f7bfe | ||
|
|
6873353cd4 | ||
|
|
025c97673f | ||
|
|
c814b92557 | ||
|
|
87765e8673 | ||
|
|
833d197412 | ||
|
|
5e72cd12d1 | ||
|
|
330fb6dff5 | ||
|
|
6d7d485a38 | ||
|
|
0160901060 | ||
|
|
9313140c59 | ||
|
|
25b1d4b673 | ||
|
|
b9d0602f55 | ||
|
|
ec0a3bbc95 | ||
|
|
50f63a2f72 | ||
|
|
cb47cb7dbf | ||
|
|
c9ac49c758 | ||
|
|
c4e8aba1c9 | ||
|
|
ba6b8b1f69 | ||
|
|
09af2fc2cb | ||
|
|
5caf0b02f0 | ||
|
|
86bac90001 | ||
|
|
7d31575149 | ||
|
|
7223b28829 | ||
|
|
4014c1d0ab | ||
|
|
0bf0e795ca | ||
|
|
0bc3716f74 | ||
|
|
ca23ea0f69 | ||
|
|
efaa2c0e3f | ||
|
|
d91f4d5748 | ||
|
|
6f1a03587a |
@@ -1,4 +1,4 @@
|
|||||||
# EditorConfig is awesome: http://EditorConfig.org
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
# top-most EditorConfig file
|
# top-most EditorConfig file
|
||||||
root = true
|
root = true
|
||||||
@@ -6,7 +6,6 @@ root = true
|
|||||||
# Tab indentation
|
# Tab indentation
|
||||||
[*]
|
[*]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# The indent size used in the `package.json` file cannot be changed
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
|
|||||||
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -6,4 +6,5 @@ ThirdPartyNotices.txt eol=crlf
|
|||||||
*.bat eol=crlf
|
*.bat eol=crlf
|
||||||
*.cmd eol=crlf
|
*.cmd eol=crlf
|
||||||
*.ps1 eol=lf
|
*.ps1 eol=lf
|
||||||
*.sh eol=lf
|
*.sh eol=lf
|
||||||
|
*.rtf -text
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: Bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ''
|
||||||
labels: feature request
|
labels: Enhancement
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
2
.github/classifier.yml
vendored
2
.github/classifier.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
perform: true,
|
perform: false,
|
||||||
alwaysRequireAssignee: false,
|
alwaysRequireAssignee: false,
|
||||||
labelsRequiringAssignee: [],
|
labelsRequiringAssignee: [],
|
||||||
autoAssignees: {
|
autoAssignees: {
|
||||||
|
|||||||
6
.github/needs_more_info.yml
vendored
6
.github/needs_more_info.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
daysUntilClose: 7,
|
daysUntilClose: 7,
|
||||||
needsMoreInfoLabel: 'more info',
|
needsMoreInfoLabel: 'needs more info',
|
||||||
perform: false,
|
perform: true,
|
||||||
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
|
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity in the last 7 days. If you have more info to help resolve the issue, leave a comment"
|
||||||
}
|
}
|
||||||
|
|||||||
51
.vscode/launch.json
vendored
51
.vscode/launch.json
vendored
@@ -66,7 +66,8 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch azuredatastudio",
|
"name": "Launch azuredatastudio",
|
||||||
"windows": {
|
"windows": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat",
|
||||||
|
"timeout": 20000
|
||||||
},
|
},
|
||||||
"osx": {
|
"osx": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||||
@@ -74,15 +75,28 @@
|
|||||||
"linux": {
|
"linux": {
|
||||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||||
},
|
},
|
||||||
|
"env": {
|
||||||
|
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
|
||||||
|
},
|
||||||
|
"breakOnLoad": false,
|
||||||
"urlFilter": "*workbench.html*",
|
"urlFilter": "*workbench.html*",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": [
|
||||||
"--inspect=5875", "--no-cached-data"
|
"--inspect=5875",
|
||||||
|
"--no-cached-data"
|
||||||
],
|
],
|
||||||
"skipFiles": [
|
"webRoot": "${workspaceFolder}"
|
||||||
"**/winjs*.js"
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch ADS (Main Process)",
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"--no-cached-data"
|
||||||
],
|
],
|
||||||
"webRoot": "${workspaceFolder}",
|
"outFiles": [
|
||||||
"timeout": 45000
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
@@ -147,7 +161,23 @@
|
|||||||
"outFiles": [
|
"outFiles": [
|
||||||
"${workspaceFolder}/out/**/*.js"
|
"${workspaceFolder}/out/**/*.js"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Run Extension Unit Tests",
|
||||||
|
"windows": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.bat"
|
||||||
|
},
|
||||||
|
"osx": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||||
|
},
|
||||||
|
"linux": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||||
|
},
|
||||||
|
"webRoot": "${workspaceFolder}",
|
||||||
|
"timeout": 45000
|
||||||
|
},
|
||||||
],
|
],
|
||||||
"compounds": [
|
"compounds": [
|
||||||
{
|
{
|
||||||
@@ -157,6 +187,13 @@
|
|||||||
"Run Unit Tests"
|
"Run Unit Tests"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug Extension Unit Tests",
|
||||||
|
"configurations": [
|
||||||
|
"Attach to Extension Host",
|
||||||
|
"Run Extension Unit Tests"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug azuredatastudio Main and Renderer",
|
"name": "Debug azuredatastudio Main and Renderer",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|||||||
24
.vscode/settings.json
vendored
24
.vscode/settings.json
vendored
@@ -44,11 +44,19 @@
|
|||||||
"emmet.excludeLanguages": [],
|
"emmet.excludeLanguages": [],
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"typescript.preferences.quoteStyle": "single",
|
"typescript.preferences.quoteStyle": "single",
|
||||||
"json.schemas": [{
|
"json.schemas": [
|
||||||
"fileMatch": [ "cgmanifest.json" ],
|
{
|
||||||
"url": "./.vscode/cgmanifest.schema.json"
|
"fileMatch": [
|
||||||
}, {
|
"cgmanifest.json"
|
||||||
"fileMatch": [ "cglicenses.json" ],
|
],
|
||||||
"url": "./.vscode/cglicenses.schema.json"
|
"url": "./.vscode/cgmanifest.schema.json"
|
||||||
}]
|
},
|
||||||
}
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"cglicenses.json"
|
||||||
|
],
|
||||||
|
"url": "./.vscode/cglicenses.schema.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
|
}
|
||||||
2
.vscode/shared.code-snippets
vendored
2
.vscode/shared.code-snippets
vendored
@@ -23,11 +23,13 @@
|
|||||||
"description": "Insert Copyright Statement"
|
"description": "Insert Copyright Statement"
|
||||||
},
|
},
|
||||||
"TS -> Inject Service": {
|
"TS -> Inject Service": {
|
||||||
|
"scope": "typescript",
|
||||||
"description": "Constructor Injection Pattern",
|
"description": "Constructor Injection Pattern",
|
||||||
"prefix": "@inject",
|
"prefix": "@inject",
|
||||||
"body": "@$1 private readonly _$2: ${1},$0"
|
"body": "@$1 private readonly _$2: ${1},$0"
|
||||||
},
|
},
|
||||||
"TS -> Event & Emitter": {
|
"TS -> Event & Emitter": {
|
||||||
|
"scope": "typescript",
|
||||||
"prefix": "emitter",
|
"prefix": "emitter",
|
||||||
"description": "Add emitter and event properties",
|
"description": "Add emitter and event properties",
|
||||||
"body": [
|
"body": [
|
||||||
|
|||||||
19
.vscode/tasks.json
vendored
19
.vscode/tasks.json
vendored
@@ -28,23 +28,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "npm",
|
|
||||||
"script": "strict-null-check-watch",
|
|
||||||
"label": "TS - Strict Null Checks",
|
|
||||||
"isBackground": true,
|
|
||||||
"presentation": {
|
|
||||||
"reveal": "never"
|
|
||||||
},
|
|
||||||
"problemMatcher": {
|
|
||||||
"base": "$tsc-watch",
|
|
||||||
"owner": "typescript-strict-null",
|
|
||||||
"applyTo": "allDocuments"
|
|
||||||
},
|
|
||||||
"runOptions": {
|
|
||||||
"runOn": "folderOpen"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "gulp",
|
"type": "gulp",
|
||||||
"task": "tslint",
|
"task": "tslint",
|
||||||
@@ -86,4 +69,4 @@
|
|||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
|||||||
disturl "https://atom.io/download/electron"
|
disturl "https://atom.io/download/electron"
|
||||||
target "2.0.12"
|
target "3.1.6"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
|
|||||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,5 +1,20 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## Version 1.5.1
|
||||||
|
* Release date: March 18, 2019
|
||||||
|
* Release status: General Availability
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* Announcing T-SQL Notebooks
|
||||||
|
* Announcing PostgreSQL extension
|
||||||
|
* Announcing SQL Server Dacpac extension
|
||||||
|
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/25?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:
|
||||||
|
|
||||||
|
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||||
|
|
||||||
## Version 1.4.5
|
## Version 1.4.5
|
||||||
* Release date: February 13, 2019
|
* Release date: February 13, 2019
|
||||||
* Release status: General Availability
|
* Release status: General Availability
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ The built-in tool for reporting an issue, which you can access by using `Report
|
|||||||
|
|
||||||
Please include the following with each issue.
|
Please include the following with each issue.
|
||||||
|
|
||||||
* Version of Azure Data Studio (formerly SQL Operations Studio).
|
* Version of Azure Data Studio (formerly SQL Operations Studio)
|
||||||
|
|
||||||
|
* Your operating system
|
||||||
|
|
||||||
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
||||||
|
|
||||||
|
|||||||
15
README.md
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=2072725
|
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2083322
|
||||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2072728
|
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2083323
|
||||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2072354
|
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2083324
|
||||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2072737
|
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2083325
|
||||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2072360
|
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2083424
|
||||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2072741
|
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2083326
|
||||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2072744
|
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2083327
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
|
* 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`
|
||||||
* gbritton1 for `Removed reference to object explorer #3463`
|
* gbritton1 for `Removed reference to object explorer #3463`
|
||||||
|
|||||||
@@ -343,32 +343,6 @@ END OF emmet NOTICES AND INFORMATION
|
|||||||
=========================================
|
=========================================
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 JD Ballard
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
=========================================
|
|
||||||
END OF error-ex NOTICES AND INFORMATION
|
|
||||||
|
|
||||||
%% escape-string-regexp NOTICES AND INFORMATION BEGIN HERE
|
|
||||||
=========================================
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@@ -2440,7 +2414,6 @@ General Public License.
|
|||||||
|
|
||||||
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
||||||
|
|
||||||
===================================ExcelDataReader (BEGIN)
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 ExcelDataReader
|
Copyright (c) 2014 ExcelDataReader
|
||||||
@@ -2466,4 +2439,4 @@ SOFTWARE.
|
|||||||
|
|
||||||
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
||||||
=========================================
|
=========================================
|
||||||
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION
|
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
nvm install 8.9.1
|
nvm install 10.15.1
|
||||||
nvm use 8.9.1
|
nvm use 10.15.1
|
||||||
npm i -g yarn
|
npm i -g yarn
|
||||||
displayName: 'preinstall'
|
displayName: 'preinstall'
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
node_modules/.bin/gulp electron
|
node_modules/.bin/gulp electron
|
||||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
node_modules/.bin/gulp compile --max_old_space_size=4096
|
||||||
node_modules/.bin/gulp optimize-vscode --max_old_space_size=4096
|
|
||||||
displayName: 'Scripts'
|
displayName: 'Scripts'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
@@ -42,5 +41,9 @@ steps:
|
|||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn run tslint
|
yarn tslint
|
||||||
displayName: 'Run TSLint'
|
displayName: 'Run TSLint'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn strict-null-check
|
||||||
|
displayName: 'Run Strict Null Check'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '8.9'
|
versionSpec: '10.15.1'
|
||||||
displayName: 'Install Node.js'
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
@@ -26,5 +26,9 @@ steps:
|
|||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn run tslint
|
yarn tslint
|
||||||
displayName: 'Run TSLint'
|
displayName: 'Run TSLint'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
yarn strict-null-check
|
||||||
|
displayName: 'Run Strict Null Check'
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { execSync } from 'child_process';
|
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'stream';
|
||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
import * as azure from 'azure-storage';
|
import * as azure from 'azure-storage';
|
||||||
@@ -154,9 +153,13 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
|
|
||||||
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
||||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
||||||
const isReleased = quality === 'insider'
|
const isReleased = (
|
||||||
&& /^master$|^refs\/heads\/master$/.test(sourceBranch)
|
// Insiders: nightly build from master
|
||||||
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy);
|
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
|
||||||
|
|
||||||
|
// Exploration: any build from electron-4.0.x branch
|
||||||
|
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
|
||||||
|
);
|
||||||
|
|
||||||
console.log('Publishing...');
|
console.log('Publishing...');
|
||||||
console.log('Quality:', quality);
|
console.log('Quality:', quality);
|
||||||
@@ -289,15 +292,18 @@ function main(): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||||
|
|
||||||
|
if (!commit) {
|
||||||
|
console.warn('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const opts = minimist<PublishOptions>(process.argv.slice(2), {
|
const opts = minimist<PublishOptions>(process.argv.slice(2), {
|
||||||
boolean: ['upload-only']
|
boolean: ['upload-only']
|
||||||
});
|
});
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const [quality, platform, type, name, version, _isUpdate, file] = opts._;
|
||||||
let [quality, platform, type, name, version, _isUpdate, file, commit] = opts._;
|
|
||||||
if (!commit) {
|
|
||||||
commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
|
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
@@ -1,13 +1,26 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -17,9 +30,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
@@ -37,4 +47,4 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '*-results.xml'
|
testResultsFiles: '*-results.xml'
|
||||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -9,12 +9,19 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
|
||||||
|
cat << EOF > ~/.netrc
|
||||||
|
machine monacotools.visualstudio.com
|
||||||
|
password $(VSO_PAT)
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(VSCODE_MIXIN_PASSWORD)
|
||||||
|
EOF
|
||||||
|
|
||||||
yarn
|
yarn
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
|
||||||
yarn gulp -- hygiene
|
yarn gulp -- hygiene
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
yarn strict-null-check
|
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
|
|
||||||
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
|
displayName: Prepare build
|
||||||
@@ -23,7 +30,10 @@ steps:
|
|||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||||
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps
|
yarn gulp -- vscode-darwin-min
|
||||||
|
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: |
|
||||||
|
|||||||
@@ -2,20 +2,33 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 libgconf-2-4 dbus xvfb libgtk-3-0
|
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
|
||||||
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
||||||
sudo chmod +x /etc/init.d/xvfb
|
sudo chmod +x /etc/init.d/xvfb
|
||||||
sudo update-rc.d xvfb defaults
|
sudo update-rc.d xvfb defaults
|
||||||
sudo service xvfb start
|
sudo service xvfb start
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -25,9 +38,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- script: |
|
- script: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
@@ -42,4 +52,4 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '*-results.xml'
|
testResultsFiles: '*-results.xml'
|
||||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -14,12 +14,18 @@ steps:
|
|||||||
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
cat << EOF > ~/.netrc
|
||||||
|
machine monacotools.visualstudio.com
|
||||||
|
password $(VSO_PAT)
|
||||||
|
machine github.com
|
||||||
|
login vscode
|
||||||
|
password $(VSCODE_MIXIN_PASSWORD)
|
||||||
|
EOF
|
||||||
|
|
||||||
CHILD_CONCURRENCY=1 yarn
|
CHILD_CONCURRENCY=1 yarn
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||||
npm run gulp -- hygiene
|
npm run gulp -- hygiene
|
||||||
npm run monaco-compile-check
|
npm run monaco-compile-check
|
||||||
npm run strict-null-check
|
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
|
||||||
node build/azure-pipelines/common/installDistro.js
|
node build/azure-pipelines/common/installDistro.js
|
||||||
node build/lib/builtInExtensions.js
|
node build/lib/builtInExtensions.js
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -16,6 +16,14 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Get snapcraft version
|
||||||
|
snapcraft --version
|
||||||
|
|
||||||
|
# Make sure we get latest packages
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade -y
|
||||||
|
|
||||||
|
# Define variables
|
||||||
REPO="$(pwd)"
|
REPO="$(pwd)"
|
||||||
ARCH="$(VSCODE_ARCH)"
|
ARCH="$(VSCODE_ARCH)"
|
||||||
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
||||||
@@ -33,7 +41,7 @@ steps:
|
|||||||
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
|
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
|
||||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||||
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
|
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
|
||||||
(cd $SNAP_ROOT/code-* && 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="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
@@ -9,9 +9,22 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: '2.x'
|
versionSpec: '2.x'
|
||||||
addToPath: true
|
addToPath: true
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
|
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
# inputs:
|
||||||
|
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
# vstsFeed: '$(ArtifactFeed)'
|
||||||
|
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn gulp electron
|
yarn gulp electron
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
@@ -21,9 +34,6 @@ steps:
|
|||||||
- powershell: |
|
- powershell: |
|
||||||
yarn monaco-compile-check
|
yarn monaco-compile-check
|
||||||
displayName: Run Monaco Editor Checks
|
displayName: Run Monaco Editor Checks
|
||||||
- script: |
|
|
||||||
yarn strict-null-check
|
|
||||||
displayName: Run Strict Null Checks
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn compile
|
yarn compile
|
||||||
displayName: Compile Sources
|
displayName: Compile Sources
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -15,15 +15,14 @@ steps:
|
|||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
"machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
"machine monacotools.visualstudio.com`npassword $(VSO_PAT)`nmachine github.com`nlogin vscode`npassword $(VSCODE_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)"
|
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||||
exec { yarn }
|
exec { yarn }
|
||||||
|
exec { npm run gulp -- mixin }
|
||||||
exec { npm run gulp -- hygiene }
|
exec { npm run gulp -- hygiene }
|
||||||
exec { npm run monaco-compile-check }
|
exec { npm run monaco-compile-check }
|
||||||
exec { npm run strict-null-check }
|
|
||||||
exec { npm run gulp -- mixin }
|
|
||||||
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 }
|
||||||
|
|
||||||
|
|||||||
91
build/download/download.js
Normal file
91
build/download/download.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const https = require("https");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const cp = require("child_process");
|
||||||
|
function ensureDir(filepath) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function download(options, destination) {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
function base64encode(str) {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
function base64decode(str) {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
function downloadInExternalProcess(options) {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
});
|
||||||
|
let stderr = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadInExternalProcess = downloadInExternalProcess;
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
111
build/download/download.ts
Normal file
111
build/download/download.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as https from 'https';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
|
function ensureDir(filepath: string) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function download(options: https.RequestOptions, destination: string): Promise<void> {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
|
||||||
|
function base64encode(str: string): string {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64decode(str: string): string {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadRequestOptions {
|
||||||
|
host: string;
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadOptions {
|
||||||
|
requestOptions: IDownloadRequestOptions;
|
||||||
|
destinationPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const child = cp.fork(
|
||||||
|
__filename,
|
||||||
|
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
|
||||||
|
{
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let stderr: Buffer[] = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
} else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options: IDownloadOptions;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
18
build/gulpfile.compile.js
Normal file
18
build/gulpfile.compile.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
|
const compilation = require('./lib/compilation');
|
||||||
|
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||||
|
|
||||||
|
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||||
|
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||||
|
|
||||||
|
// All Build
|
||||||
|
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
|
||||||
|
exports.compileBuildTask = compileBuildTask;
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const File = require('vinyl');
|
const File = require('vinyl');
|
||||||
@@ -48,9 +49,6 @@ var editorResources = [
|
|||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
var editorOtherSources = [
|
|
||||||
];
|
|
||||||
|
|
||||||
var BUNDLED_FILE_HEADER = [
|
var BUNDLED_FILE_HEADER = [
|
||||||
'/*!-----------------------------------------------------------',
|
'/*!-----------------------------------------------------------',
|
||||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||||
@@ -63,8 +61,7 @@ var BUNDLED_FILE_HEADER = [
|
|||||||
|
|
||||||
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||||
|
|
||||||
gulp.task('clean-editor-src', util.rimraf('out-editor-src'));
|
const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
||||||
gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|
||||||
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
||||||
const apiusages = monacoapi.execute().usageContent;
|
const apiusages = monacoapi.execute().usageContent;
|
||||||
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
||||||
@@ -84,6 +81,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
'typings/thenable.d.ts',
|
'typings/thenable.d.ts',
|
||||||
'typings/es6-promise.d.ts',
|
'typings/es6-promise.d.ts',
|
||||||
'typings/require-monaco.d.ts',
|
'typings/require-monaco.d.ts',
|
||||||
|
"typings/lib.es2018.promise.d.ts",
|
||||||
'vs/monaco.d.ts'
|
'vs/monaco.d.ts'
|
||||||
],
|
],
|
||||||
libs: [
|
libs: [
|
||||||
@@ -95,20 +93,16 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
||||||
},
|
},
|
||||||
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
|
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
|
||||||
importIgnorePattern: /^vs\/css!/,
|
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
|
||||||
destRoot: path.join(root, 'out-editor-src')
|
destRoot: path.join(root, 'out-editor-src')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||||
gulp.task('clean-editor-build', util.rimraf('out-editor-build'));
|
|
||||||
gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
|
||||||
|
|
||||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
|
||||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({
|
|
||||||
src: 'out-editor-build',
|
src: 'out-editor-build',
|
||||||
entryPoints: editorEntryPoints,
|
entryPoints: editorEntryPoints,
|
||||||
otherSources: editorOtherSources,
|
|
||||||
resources: editorResources,
|
resources: editorResources,
|
||||||
loaderConfig: {
|
loaderConfig: {
|
||||||
paths: {
|
paths: {
|
||||||
@@ -125,11 +119,9 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'],
|
|||||||
languages: languages
|
languages: languages
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
|
||||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
|
||||||
|
|
||||||
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm'));
|
const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
|
||||||
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () {
|
|
||||||
standalone.createESMSourcesAndResources2({
|
standalone.createESMSourcesAndResources2({
|
||||||
srcFolder: './out-editor-src',
|
srcFolder: './out-editor-src',
|
||||||
outFolder: './out-editor-esm',
|
outFolder: './out-editor-esm',
|
||||||
@@ -151,7 +143,8 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
|
|
||||||
|
const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
||||||
cwd: path.join(__dirname, '../out-editor-esm')
|
cwd: path.join(__dirname, '../out-editor-esm')
|
||||||
@@ -202,8 +195,16 @@ function toExternalDTS(contents) {
|
|||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
function filterStream(testFunc) {
|
||||||
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () {
|
return es.through(function (data) {
|
||||||
|
if (!testFunc(data.relative)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.emit('data', data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
// other assets
|
// other assets
|
||||||
es.merge(
|
es.merge(
|
||||||
@@ -233,6 +234,14 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
|
// version.txt
|
||||||
|
gulp.src('build/monaco/version.txt')
|
||||||
|
.pipe(es.through(function (data) {
|
||||||
|
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||||
|
this.emit('data', data);
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
// README.md
|
// README.md
|
||||||
gulp.src('build/monaco/README-npm.md')
|
gulp.src('build/monaco/README-npm.md')
|
||||||
.pipe(es.through(function (data) {
|
.pipe(es.through(function (data) {
|
||||||
@@ -266,7 +275,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
|
|
||||||
var strContents = data.contents.toString();
|
var strContents = data.contents.toString();
|
||||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||||
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
|
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||||
|
|
||||||
data.contents = Buffer.from(strContents);
|
data.contents = Buffer.from(strContents);
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
@@ -282,59 +291,31 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('analyze-editor-distro', function () {
|
gulp.task('editor-distro',
|
||||||
// @ts-ignore
|
task.series(
|
||||||
var bundleInfo = require('../out-editor/bundleInfo.json');
|
task.parallel(
|
||||||
var graph = bundleInfo.graph;
|
util.rimraf('out-editor-src'),
|
||||||
var bundles = bundleInfo.bundles;
|
util.rimraf('out-editor-build'),
|
||||||
|
util.rimraf('out-editor-esm'),
|
||||||
var inverseGraph = {};
|
util.rimraf('out-monaco-editor-core'),
|
||||||
Object.keys(graph).forEach(function (module) {
|
util.rimraf('out-editor'),
|
||||||
var dependencies = graph[module];
|
util.rimraf('out-editor-min')
|
||||||
dependencies.forEach(function (dep) {
|
),
|
||||||
inverseGraph[dep] = inverseGraph[dep] || [];
|
extractEditorSrcTask,
|
||||||
inverseGraph[dep].push(module);
|
task.parallel(
|
||||||
});
|
task.series(
|
||||||
});
|
compileEditorAMDTask,
|
||||||
|
optimizeEditorAMDTask,
|
||||||
var detailed = {};
|
minifyEditorAMDTask
|
||||||
Object.keys(bundles).forEach(function (entryPoint) {
|
),
|
||||||
var included = bundles[entryPoint];
|
task.series(
|
||||||
var includedMap = {};
|
createESMSourcesAndResourcesTask,
|
||||||
included.forEach(function (included) {
|
compileEditorESMTask
|
||||||
includedMap[included] = true;
|
)
|
||||||
});
|
),
|
||||||
|
finalEditorResourcesTask
|
||||||
var explanation = [];
|
)
|
||||||
included.map(function (included) {
|
);
|
||||||
if (included.indexOf('!') >= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var reason = (inverseGraph[included] || []).filter(function (mod) {
|
|
||||||
return !!includedMap[mod];
|
|
||||||
});
|
|
||||||
explanation.push({
|
|
||||||
module: included,
|
|
||||||
reason: reason
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
detailed[entryPoint] = explanation;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(JSON.stringify(detailed, null, '\t'));
|
|
||||||
});
|
|
||||||
|
|
||||||
function filterStream(testFunc) {
|
|
||||||
return es.through(function (data) {
|
|
||||||
if (!testFunc(data.relative)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.emit('data', data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#region monaco type checking
|
//#region monaco type checking
|
||||||
|
|
||||||
@@ -354,6 +335,7 @@ function createTscCompileTask(watch) {
|
|||||||
let errors = [];
|
let errors = [];
|
||||||
let reporter = createReporter();
|
let reporter = createReporter();
|
||||||
let report;
|
let report;
|
||||||
|
// eslint-disable-next-line no-control-regex
|
||||||
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||||
|
|
||||||
child.stdout.on('data', data => {
|
child.stdout.on('data', data => {
|
||||||
@@ -387,7 +369,10 @@ function createTscCompileTask(watch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('monaco-typecheck-watch', createTscCompileTask(true));
|
const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
|
||||||
gulp.task('monaco-typecheck', createTscCompileTask(false));
|
exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
|
||||||
|
|
||||||
|
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||||
|
exports.monacoTypecheckTask = monacoTypecheckTask;
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ const path = require('path');
|
|||||||
const tsb = require('gulp-tsb');
|
const tsb = require('gulp-tsb');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const filter = require('gulp-filter');
|
const filter = require('gulp-filter');
|
||||||
const rimraf = require('rimraf');
|
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const watcher = require('./lib/watch');
|
const watcher = require('./lib/watch');
|
||||||
const createReporter = require('./lib/reporter').createReporter;
|
const createReporter = require('./lib/reporter').createReporter;
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
@@ -43,16 +43,6 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const name = relativeDirname.replace(/\//g, '-');
|
const name = relativeDirname.replace(/\//g, '-');
|
||||||
|
|
||||||
// Tasks
|
|
||||||
const clean = 'clean-extension:' + name;
|
|
||||||
const compile = 'compile-extension:' + name;
|
|
||||||
const watch = 'watch-extension:' + name;
|
|
||||||
|
|
||||||
// Build Tasks
|
|
||||||
const cleanBuild = 'clean-extension-build:' + name;
|
|
||||||
const compileBuild = 'compile-extension-build:' + name;
|
|
||||||
const watchBuild = 'watch-extension-build:' + name;
|
|
||||||
|
|
||||||
const root = path.join('extensions', relativeDirname);
|
const root = path.join('extensions', relativeDirname);
|
||||||
const srcBase = path.join(root, 'src');
|
const srcBase = path.join(root, 'src');
|
||||||
const src = path.join(srcBase, '**');
|
const src = path.join(srcBase, '**');
|
||||||
@@ -111,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
||||||
|
|
||||||
gulp.task(clean, cb => rimraf(out, cb));
|
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
|
||||||
|
|
||||||
gulp.task(compile, [clean], () => {
|
const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false, true);
|
const pipeline = createPipeline(false, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watch, [clean], () => {
|
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false);
|
const pipeline = createPipeline(false);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
const watchInput = watcher(src, srcOpts);
|
const watchInput = watcher(src, srcOpts);
|
||||||
@@ -130,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
return watchInput
|
return watchInput
|
||||||
.pipe(util.incremental(pipeline, input))
|
.pipe(util.incremental(pipeline, input))
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(cleanBuild, cb => rimraf(out, cb));
|
const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
|
||||||
|
|
||||||
gulp.task(compileBuild, [clean], () => {
|
|
||||||
const pipeline = createPipeline(true, true);
|
const pipeline = createPipeline(true, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watchBuild, [clean], () => {
|
// Tasks
|
||||||
const pipeline = createPipeline(true);
|
gulp.task(compileTask);
|
||||||
const input = gulp.src(src, srcOpts);
|
gulp.task(watchTask);
|
||||||
const watchInput = watcher(src, srcOpts);
|
|
||||||
|
|
||||||
return watchInput
|
|
||||||
.pipe(util.incremental(() => pipeline(), input))
|
|
||||||
.pipe(gulp.dest(out));
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
clean: clean,
|
compileTask: compileTask,
|
||||||
compile: compile,
|
watchTask: watchTask,
|
||||||
watch: watch,
|
compileBuildTask: compileBuildTask
|
||||||
cleanBuild: cleanBuild,
|
|
||||||
compileBuild: compileBuild,
|
|
||||||
watchBuild: watchBuild
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clean-extensions', tasks.map(t => t.clean));
|
const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
|
||||||
gulp.task('compile-extensions', tasks.map(t => t.compile));
|
gulp.task(compileExtensionsTask);
|
||||||
gulp.task('watch-extensions', tasks.map(t => t.watch));
|
exports.compileExtensionsTask = compileExtensionsTask;
|
||||||
|
|
||||||
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild));
|
const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
|
||||||
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild));
|
gulp.task(watchExtensionsTask);
|
||||||
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild));
|
exports.watchExtensionsTask = watchExtensionsTask;
|
||||||
|
|
||||||
|
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||||
|
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ const indentationFilter = [
|
|||||||
|
|
||||||
// except specific files
|
// except specific files
|
||||||
'!ThirdPartyNotices.txt',
|
'!ThirdPartyNotices.txt',
|
||||||
'!LICENSE.txt',
|
'!LICENSE.{txt,rtf}',
|
||||||
|
'!LICENSES.chromium.html',
|
||||||
'!**/LICENSE',
|
'!**/LICENSE',
|
||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/nls.build.js',
|
'!src/vs/nls.build.js',
|
||||||
@@ -50,7 +51,6 @@ const indentationFilter = [
|
|||||||
'!src/vs/css.build.js',
|
'!src/vs/css.build.js',
|
||||||
'!src/vs/loader.js',
|
'!src/vs/loader.js',
|
||||||
'!src/vs/base/common/marked/marked.js',
|
'!src/vs/base/common/marked/marked.js',
|
||||||
'!src/vs/base/common/winjs.base.js',
|
|
||||||
'!src/vs/base/node/terminateProcess.sh',
|
'!src/vs/base/node/terminateProcess.sh',
|
||||||
'!src/vs/base/node/cpuUsage.sh',
|
'!src/vs/base/node/cpuUsage.sh',
|
||||||
'!test/assert.js',
|
'!test/assert.js',
|
||||||
@@ -82,7 +82,7 @@ const indentationFilter = [
|
|||||||
'!src/typings/**/*.d.ts',
|
'!src/typings/**/*.d.ts',
|
||||||
'!extensions/**/*.d.ts',
|
'!extensions/**/*.d.ts',
|
||||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
||||||
'!build/{lib,tslintRules}/**/*.js',
|
'!build/{lib,tslintRules,download}/**/*.js',
|
||||||
'!build/**/*.sh',
|
'!build/**/*.sh',
|
||||||
'!build/azure-pipelines/**/*.js',
|
'!build/azure-pipelines/**/*.js',
|
||||||
'!build/azure-pipelines/**/*.config',
|
'!build/azure-pipelines/**/*.config',
|
||||||
@@ -110,10 +110,12 @@ const copyrightFilter = [
|
|||||||
'!**/*.opts',
|
'!**/*.opts',
|
||||||
'!**/*.disabled',
|
'!**/*.disabled',
|
||||||
'!**/*.code-workspace',
|
'!**/*.code-workspace',
|
||||||
|
'!**/promise-polyfill/polyfill.js',
|
||||||
'!build/**/*.init',
|
'!build/**/*.init',
|
||||||
'!resources/linux/snap/snapcraft.yaml',
|
'!resources/linux/snap/snapcraft.yaml',
|
||||||
'!resources/linux/snap/electron-launch',
|
'!resources/linux/snap/electron-launch',
|
||||||
'!resources/win32/bin/code.js',
|
'!resources/win32/bin/code.js',
|
||||||
|
'!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/*'
|
||||||
@@ -127,7 +129,6 @@ const eslintFilter = [
|
|||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/css.build.js',
|
'!src/vs/css.build.js',
|
||||||
'!src/vs/nls.build.js',
|
'!src/vs/nls.build.js',
|
||||||
'!src/**/winjs.base.js',
|
|
||||||
'!src/**/marked.js',
|
'!src/**/marked.js',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
@@ -230,7 +231,7 @@ function hygiene(some) {
|
|||||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||||
|
|
||||||
if (original !== formatted) {
|
if (original !== formatted) {
|
||||||
console.error('File not formatted:', file.relative);
|
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
cb(null, file);
|
cb(null, file);
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ const json = require('gulp-json-editor');
|
|||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
const filter = require('gulp-filter');
|
const filter = require('gulp-filter');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const util = require('./lib/util');
|
const vfs = require('vinyl-fs');
|
||||||
const remote = require('gulp-remote-src');
|
const pkg = require('../package.json');
|
||||||
const zip = require('gulp-vinyl-zip');
|
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 pkg = require('../package.json');
|
|
||||||
|
|
||||||
gulp.task('mixin', function () {
|
gulp.task('mixin', function () {
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const updateUrl = process.env['SQLOPS_UPDATEURL'];
|
const updateUrl = process.env['SQLOPS_UPDATEURL'];
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const filter = require('gulp-filter');
|
|||||||
const json = require('gulp-json-editor');
|
const json = require('gulp-json-editor');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const ext = require('./lib/extensions');
|
const ext = require('./lib/extensions');
|
||||||
const buildfile = require('../src/buildfile');
|
const buildfile = require('../src/buildfile');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
@@ -38,6 +39,7 @@ 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 minimist = require('minimist');
|
||||||
|
const { compileBuildTask } = require('./gulpfile.compile');
|
||||||
|
|
||||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -76,15 +78,16 @@ const vscodeResources = [
|
|||||||
'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/base/common/performance.js',
|
'out-build/vs/base/common/performance.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}',
|
||||||
'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/parts/debug/**/*.json',
|
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||||
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js',
|
'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js',
|
||||||
'out-build/vs/**/markdown.css',
|
'out-build/vs/**/markdown.css',
|
||||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||||
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
|
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
||||||
'out-build/vs/workbench/services/files/**/*.exe',
|
'out-build/vs/workbench/services/files/**/*.exe',
|
||||||
'out-build/vs/workbench/services/files/**/*.md',
|
'out-build/vs/workbench/services/files/**/*.md',
|
||||||
'out-build/vs/code/electron-browser/workbench/**',
|
'out-build/vs/code/electron-browser/workbench/**',
|
||||||
@@ -111,7 +114,7 @@ const vscodeResources = [
|
|||||||
'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/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -121,29 +124,41 @@ const BUNDLED_FILE_HEADER = [
|
|||||||
' *--------------------------------------------------------*/'
|
' *--------------------------------------------------------*/'
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
||||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
|
||||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
task.parallel(
|
||||||
src: 'out-build',
|
util.rimraf('out-vscode'),
|
||||||
entryPoints: vscodeEntryPoints,
|
compileBuildTask
|
||||||
otherSources: [],
|
),
|
||||||
resources: vscodeResources,
|
common.optimizeTask({
|
||||||
loaderConfig: common.loaderConfig(nodeModules),
|
src: 'out-build',
|
||||||
header: BUNDLED_FILE_HEADER,
|
entryPoints: vscodeEntryPoints,
|
||||||
out: 'out-vscode',
|
resources: vscodeResources,
|
||||||
bundleInfo: undefined
|
loaderConfig: common.loaderConfig(nodeModules),
|
||||||
}));
|
header: BUNDLED_FILE_HEADER,
|
||||||
|
out: 'out-vscode',
|
||||||
|
bundleInfo: undefined
|
||||||
|
})
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
|
||||||
const fullpath = path.join(process.cwd(), 'out-vscode/vs/code/electron-browser/workbench/workbench.js');
|
optimizeVSCodeTask,
|
||||||
const contents = fs.readFileSync(fullpath).toString();
|
() => {
|
||||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||||
fs.writeFileSync(fullpath, newContents);
|
const contents = fs.readFileSync(fullpath).toString();
|
||||||
});
|
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||||
|
fs.writeFileSync(fullpath, newContents);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||||
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
|
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||||
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`));
|
task.parallel(
|
||||||
|
util.rimraf('out-vscode-min'),
|
||||||
|
optimizeIndexJSTask
|
||||||
|
),
|
||||||
|
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
|
||||||
|
));
|
||||||
|
|
||||||
// Package
|
// Package
|
||||||
|
|
||||||
@@ -164,7 +179,7 @@ const config = {
|
|||||||
version: getElectronVersion(),
|
version: getElectronVersion(),
|
||||||
productAppName: product.nameLong,
|
productAppName: product.nameLong,
|
||||||
companyName: 'Microsoft Corporation',
|
companyName: 'Microsoft Corporation',
|
||||||
copyright: 'Copyright (C) 2018 Microsoft. All rights reserved',
|
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
|
||||||
darwinIcon: 'resources/darwin/code.icns',
|
darwinIcon: 'resources/darwin/code.icns',
|
||||||
darwinBundleIdentifier: product.darwinBundleIdentifier,
|
darwinBundleIdentifier: product.darwinBundleIdentifier,
|
||||||
darwinApplicationCategoryType: 'public.app-category.developer-tools',
|
darwinApplicationCategoryType: 'public.app-category.developer-tools',
|
||||||
@@ -180,13 +195,13 @@ const config = {
|
|||||||
urlSchemes: [product.urlProtocol]
|
urlSchemes: [product.urlProtocol]
|
||||||
}],
|
}],
|
||||||
darwinForceDarkModeSupport: true,
|
darwinForceDarkModeSupport: true,
|
||||||
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
|
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
|
||||||
linuxExecutableName: product.applicationName,
|
linuxExecutableName: product.applicationName,
|
||||||
winIcon: 'resources/win32/code.ico',
|
winIcon: 'resources/win32/code.ico',
|
||||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
|
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
|
||||||
|
|
||||||
// @ts-ignore JSON checking: electronRepository is optional
|
// @ts-ignore JSON checking: electronRepository is optional
|
||||||
repo: product.electronRepository || void 0
|
repo: product.electronRepository || undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
function getElectron(arch) {
|
function getElectron(arch) {
|
||||||
@@ -206,13 +221,11 @@ function getElectron(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-electron', util.rimraf('.build/electron'));
|
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
|
||||||
gulp.task('electron', ['clean-electron'], getElectron(process.arch));
|
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
|
||||||
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
|
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
|
||||||
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
|
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
|
||||||
gulp.task('electron-arm', ['clean-electron'], getElectron('arm'));
|
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
|
||||||
gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64'));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute checksums for some files.
|
* Compute checksums for some files.
|
||||||
@@ -248,15 +261,14 @@ function computeChecksum(filename) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
function packageTask(platform, arch, opts) {
|
function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const destination = path.join(path.dirname(root), destinationFolderName);
|
||||||
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
|
||||||
platform = platform || process.platform;
|
platform = platform || process.platform;
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const out = opts.minified ? 'out-vscode-min' : 'out-vscode';
|
const out = sourceFolderName;
|
||||||
|
|
||||||
const checksums = computeChecksums(out, [
|
const checksums = computeChecksums(out, [
|
||||||
'vs/workbench/workbench.main.js',
|
'vs/workbench/workbench.main.js',
|
||||||
@@ -309,14 +321,13 @@ function packageTask(platform, arch, opts) {
|
|||||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||||
.pipe(json(productJsonUpdate));
|
.pipe(json(productJsonUpdate));
|
||||||
|
|
||||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||||
|
|
||||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
|
||||||
|
|
||||||
// TODO the API should be copied to `out` during compile, not here
|
// TODO the API should be copied to `out` during compile, not here
|
||||||
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts'));
|
const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
|
||||||
|
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
|
||||||
|
|
||||||
const depsSrc = [
|
const depsSrc = [
|
||||||
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||||
@@ -351,6 +362,8 @@ function packageTask(platform, arch, opts) {
|
|||||||
.pipe(util.cleanNodeModule('vscode-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
|
// {{SQL CARBON EDIT}} - End
|
||||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
.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}}
|
||||||
@@ -361,50 +374,29 @@ function packageTask(platform, arch, opts) {
|
|||||||
'node_modules/underscore/**/*.*',
|
'node_modules/underscore/**/*.*',
|
||||||
'node_modules/zone.js/**/*.*',
|
'node_modules/zone.js/**/*.*',
|
||||||
'node_modules/chart.js/**/*.*',
|
'node_modules/chart.js/**/*.*',
|
||||||
|
'node_modules/chartjs-color/**/*.*',
|
||||||
|
'node_modules/chartjs-color-string/**/*.*',
|
||||||
|
'node_modules/color-convert/**/*.*',
|
||||||
|
'node_modules/color-name/**/*.*',
|
||||||
|
'node_modules/moment/**/*.*'
|
||||||
], { base: '.', dot: true });
|
], { base: '.', dot: true });
|
||||||
|
|
||||||
let all = es.merge(
|
let all = es.merge(
|
||||||
packageJsonStream,
|
packageJsonStream,
|
||||||
productJsonStream,
|
productJsonStream,
|
||||||
license,
|
license,
|
||||||
watermark,
|
|
||||||
api,
|
api,
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
copiedModules,
|
copiedModules,
|
||||||
dataApi,
|
dataApi,
|
||||||
|
sqlopsAPI,
|
||||||
sources,
|
sources,
|
||||||
deps
|
deps
|
||||||
);
|
);
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
all = es.merge(all, gulp.src([
|
all = es.merge(all, gulp.src([
|
||||||
'resources/win32/bower.ico',
|
// {{SQL CARBON EDIT}} remove unused icons
|
||||||
'resources/win32/c.ico',
|
|
||||||
'resources/win32/config.ico',
|
|
||||||
'resources/win32/cpp.ico',
|
|
||||||
'resources/win32/csharp.ico',
|
|
||||||
'resources/win32/css.ico',
|
|
||||||
'resources/win32/default.ico',
|
|
||||||
'resources/win32/go.ico',
|
|
||||||
'resources/win32/html.ico',
|
|
||||||
'resources/win32/jade.ico',
|
|
||||||
'resources/win32/java.ico',
|
|
||||||
'resources/win32/javascript.ico',
|
|
||||||
'resources/win32/json.ico',
|
|
||||||
'resources/win32/less.ico',
|
|
||||||
'resources/win32/markdown.ico',
|
|
||||||
'resources/win32/php.ico',
|
|
||||||
'resources/win32/powershell.ico',
|
|
||||||
'resources/win32/python.ico',
|
|
||||||
'resources/win32/react.ico',
|
|
||||||
'resources/win32/ruby.ico',
|
|
||||||
'resources/win32/sass.ico',
|
|
||||||
'resources/win32/shell.ico',
|
|
||||||
'resources/win32/sql.ico',
|
|
||||||
'resources/win32/typescript.ico',
|
|
||||||
'resources/win32/vue.ico',
|
|
||||||
'resources/win32/xml.ico',
|
|
||||||
'resources/win32/yaml.ico',
|
|
||||||
'resources/win32/code_70x70.png',
|
'resources/win32/code_70x70.png',
|
||||||
'resources/win32/code_150x150.png'
|
'resources/win32/code_150x150.png'
|
||||||
], { base: '.' }));
|
], { base: '.' }));
|
||||||
@@ -423,8 +415,10 @@ function packageTask(platform, arch, opts) {
|
|||||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||||
|
|
||||||
|
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||||
.pipe(replace('@@NAME@@', product.nameShort))
|
.pipe(replace('@@NAME@@', product.nameShort))
|
||||||
@@ -459,38 +453,37 @@ function packageTask(platform, arch, opts) {
|
|||||||
|
|
||||||
const buildRoot = path.dirname(root);
|
const buildRoot = path.dirname(root);
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const BUILD_TARGETS = [
|
||||||
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'win32', 'x64'));
|
{ platform: 'win32', arch: 'ia32' },
|
||||||
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'darwin'));
|
{ platform: 'win32', arch: 'x64' },
|
||||||
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'linux', 'x64'));
|
{ platform: 'darwin', arch: null, opts: { stats: true } },
|
||||||
|
{ platform: 'linux', arch: 'ia32' },
|
||||||
|
{ platform: 'linux', arch: 'x64' },
|
||||||
|
{ platform: 'linux', arch: 'arm' },
|
||||||
|
{ platform: 'linux', arch: 'arm64' },
|
||||||
|
];
|
||||||
|
BUILD_TARGETS.forEach(buildTarget => {
|
||||||
|
const dashed = (str) => (str ? `-${str}` : ``);
|
||||||
|
const platform = buildTarget.platform;
|
||||||
|
const arch = buildTarget.arch;
|
||||||
|
const opts = buildTarget.opts;
|
||||||
|
|
||||||
gulp.task('vscode-win32-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'win32', 'x64'));
|
['', 'min'].forEach(minified => {
|
||||||
gulp.task('vscode-darwin-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'darwin'));
|
const sourceFolderName = `out-vscode${dashed(minified)}`;
|
||||||
gulp.task('vscode-linux-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'linux', 'x64'));
|
const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32')));
|
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
|
||||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64')));
|
task.parallel(
|
||||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin')));
|
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32')));
|
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64')));
|
),
|
||||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm')));
|
ext.packageExtensionTask('mssql', platform, arch),
|
||||||
gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm64')));
|
ext.packageExtensionTask('azurecore', platform, arch),
|
||||||
|
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
));
|
||||||
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'vscode-win32-x64-mssql', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
gulp.task(vscodeTask);
|
||||||
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'vscode-darwin-mssql', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true }));
|
});
|
||||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
});
|
||||||
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'vscode-linux-x64-mssql', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
|
||||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
|
||||||
gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true }));
|
|
||||||
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true }));
|
|
||||||
|
|
||||||
// Transifex Localizations
|
// Transifex Localizations
|
||||||
|
|
||||||
@@ -513,30 +506,42 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
|
|||||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||||
|
|
||||||
gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
'vscode-translations-push',
|
||||||
const pathToExtensions = './extensions/*';
|
task.series(
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
|
const pathToExtensions = './extensions/*';
|
||||||
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
|
|
||||||
return es.merge(
|
return es.merge(
|
||||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-export', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
'vscode-translations-export',
|
||||||
const pathToExtensions = './extensions/*';
|
task.series(
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
|
const pathToExtensions = './extensions/*';
|
||||||
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
|
|
||||||
return es.merge(
|
return es.merge(
|
||||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(vfs.dest('../vscode-translations-export'));
|
).pipe(vfs.dest('../vscode-translations-export'));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-pull', function () {
|
gulp.task('vscode-translations-pull', function () {
|
||||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||||
@@ -557,7 +562,7 @@ gulp.task('vscode-translations-import', function () {
|
|||||||
|
|
||||||
// Sourcemaps
|
// Sourcemaps
|
||||||
|
|
||||||
gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => {
|
gulp.task('upload-vscode-sourcemaps', () => {
|
||||||
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
||||||
.pipe(es.mapSync(f => {
|
.pipe(es.mapSync(f => {
|
||||||
f.path = `${f.base}/core/${f.relative}`;
|
f.path = `${f.base}/core/${f.relative}`;
|
||||||
@@ -581,57 +586,8 @@ gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], ()
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
|
||||||
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
|
|
||||||
if (!shouldSetupSettingsSearch()) {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
|
||||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
|
||||||
if (!settingsSearchBuildId) {
|
|
||||||
throw new Error('Failed to compute build number');
|
|
||||||
}
|
|
||||||
|
|
||||||
return gulp.src(allConfigDetailsPath)
|
|
||||||
.pipe(azure.upload({
|
|
||||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
|
||||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
|
||||||
container: 'configuration',
|
|
||||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
function shouldSetupSettingsSearch() {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSettingsSearchBuildId(packageJson) {
|
|
||||||
try {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
|
||||||
/\/master$/.test(branch) ? 1 :
|
|
||||||
2; // Some unexpected branch
|
|
||||||
|
|
||||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
|
||||||
const count = parseInt(out.toString());
|
|
||||||
|
|
||||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
|
||||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
|
||||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
|
||||||
} catch (e) {
|
|
||||||
throw new Error('Could not determine build number: ' + e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This task is only run for the MacOS build
|
// This task is only run for the MacOS build
|
||||||
gulp.task('generate-vscode-configuration', () => {
|
const generateVSCodeConfigurationTask = task.define('generate-vscode-configuration', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
||||||
if (!buildDir) {
|
if (!buildDir) {
|
||||||
@@ -668,6 +624,61 @@ gulp.task('generate-vscode-configuration', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||||
|
gulp.task(task.define(
|
||||||
|
'upload-vscode-configuration',
|
||||||
|
task.series(
|
||||||
|
generateVSCodeConfigurationTask,
|
||||||
|
() => {
|
||||||
|
if (!shouldSetupSettingsSearch()) {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||||
|
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||||
|
if (!settingsSearchBuildId) {
|
||||||
|
throw new Error('Failed to compute build number');
|
||||||
|
}
|
||||||
|
|
||||||
|
return gulp.src(allConfigDetailsPath)
|
||||||
|
.pipe(azure.upload({
|
||||||
|
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||||
|
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||||
|
container: 'configuration',
|
||||||
|
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
function shouldSetupSettingsSearch() {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSettingsSearchBuildId(packageJson) {
|
||||||
|
try {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||||
|
/\/master$/.test(branch) ? 1 :
|
||||||
|
2; // Some unexpected branch
|
||||||
|
|
||||||
|
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||||
|
const count = parseInt(out.toString());
|
||||||
|
|
||||||
|
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||||
|
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||||
|
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error('Could not determine build number: ' + e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
// Install service locally before building carbon
|
// Install service locally before building carbon
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ const shell = require('gulp-shell');
|
|||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const packageJson = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
||||||
|
const path = require('path');
|
||||||
|
const root = path.dirname(__dirname);
|
||||||
|
const commit = util.getVersion(root);
|
||||||
|
|
||||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
@@ -39,7 +43,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -49,7 +53,13 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
|
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
||||||
|
|
||||||
|
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||||
|
// .pipe(rename('usr/share/zsh/vendor-completions/_code'));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||||
@@ -85,7 +95,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
||||||
.pipe(rename('DEBIAN/postinst'));
|
.pipe(rename('DEBIAN/postinst'));
|
||||||
|
|
||||||
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, code);
|
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, /* bash_completion, zsh_completion, */ code);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(destination));
|
return all.pipe(vfs.dest(destination));
|
||||||
};
|
};
|
||||||
@@ -124,7 +134,7 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -134,7 +144,13 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
|
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
||||||
|
|
||||||
|
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||||
|
// .pipe(rename('BUILD/usr/share/zsh/site-functions/_code'));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
|
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||||
@@ -142,6 +158,7 @@ function prepareRpmPackage(arch) {
|
|||||||
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||||
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
||||||
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
||||||
@@ -156,7 +173,7 @@ function prepareRpmPackage(arch) {
|
|||||||
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
|
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
|
||||||
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
|
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
|
||||||
|
|
||||||
const all = es.merge(code, desktops, appdata, icon, spec, specIcon);
|
const all = es.merge(code, desktops, appdata, icon, /* bash_completion, zsh_completion, */ spec, specIcon);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
|
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
|
||||||
};
|
};
|
||||||
@@ -180,36 +197,39 @@ function getSnapBuildPath(arch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prepareSnapPackage(arch) {
|
function prepareSnapPackage(arch) {
|
||||||
const binaryDir = '../VSCode-linux-' + arch;
|
// {{SQL CARBON EDIT}}
|
||||||
|
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||||
const destination = getSnapBuildPath(arch);
|
const destination = getSnapBuildPath(arch);
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||||
|
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||||
|
|
||||||
|
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
|
||||||
|
.pipe(rename(`usr/share/applications/${product.applicationName}-url-handler.desktop`));
|
||||||
|
|
||||||
|
const desktops = es.merge(desktop, desktopUrlHandler)
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
|
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
|
||||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
|
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
||||||
|
|
||||||
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
|
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@VERSION@@', `${packageJson.version}-${linuxPackageRevision}`))
|
.pipe(replace('@@VERSION@@', commit.substr(0, 8)))
|
||||||
.pipe(rename('snap/snapcraft.yaml'));
|
.pipe(rename('snap/snapcraft.yaml'));
|
||||||
|
|
||||||
const snapUpdate = gulp.src('resources/linux/snap/snapUpdate.sh', { base: '.' })
|
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
|
||||||
.pipe(rename(`usr/share/${product.applicationName}/snapUpdate.sh`));
|
|
||||||
|
|
||||||
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
|
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
|
||||||
.pipe(rename('electron-launch'));
|
.pipe(rename('electron-launch'));
|
||||||
|
|
||||||
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch, snapUpdate);
|
const all = es.merge(desktops, icon, code, snapcraft, electronLaunch);
|
||||||
|
|
||||||
return all.pipe(vfs.dest(destination));
|
return all.pipe(vfs.dest(destination));
|
||||||
};
|
};
|
||||||
@@ -220,116 +240,36 @@ function buildSnapPackage(arch) {
|
|||||||
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFlatpakArch(arch) {
|
const BUILD_TARGETS = [
|
||||||
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
|
{ arch: 'ia32' },
|
||||||
}
|
{ arch: 'x64' },
|
||||||
|
{ arch: 'arm' },
|
||||||
|
{ arch: 'arm64' },
|
||||||
|
];
|
||||||
|
|
||||||
function prepareFlatpak(arch) {
|
BUILD_TARGETS.forEach((buildTarget) => {
|
||||||
// {{SQL CARBON EDIT}}
|
const arch = buildTarget.arch;
|
||||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
|
||||||
|
|
||||||
return function () {
|
{
|
||||||
// This is not imported in the global scope to avoid requiring ImageMagick
|
const debArch = getDebPackageArch(arch);
|
||||||
// (or GraphicsMagick) when not building building Flatpak bundles.
|
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
|
||||||
const imgResize = require('gulp-image-resize');
|
// gulp.task(prepareDebTask);
|
||||||
|
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
|
||||||
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) {
|
gulp.task(buildDebTask);
|
||||||
return gulp.src('resources/linux/code.png', { base: '.' })
|
|
||||||
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
|
|
||||||
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
|
|
||||||
});
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
|
|
||||||
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
|
||||||
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME@@', flatpakManifest.appId))
|
|
||||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
|
||||||
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
|
|
||||||
|
|
||||||
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
|
||||||
.pipe(rename(function (p) {
|
|
||||||
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
|
|
||||||
})));
|
|
||||||
|
|
||||||
return es.merge(all).pipe(vfs.dest(destination));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildFlatpak(arch) {
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const manifest = {};
|
|
||||||
for (var k in flatpakManifest) {
|
|
||||||
manifest[k] = flatpakManifest[k];
|
|
||||||
}
|
}
|
||||||
manifest.files = [
|
|
||||||
['.build/linux/flatpak/' + flatpakArch, '/'],
|
{
|
||||||
];
|
const rpmArch = getRpmPackageArch(arch);
|
||||||
const buildOptions = {
|
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
|
||||||
arch: flatpakArch,
|
// gulp.task(prepareRpmTask);
|
||||||
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision,
|
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
|
||||||
};
|
gulp.task(buildRpmTask);
|
||||||
// If requested, use the configured path for the OSTree repository.
|
|
||||||
if (process.env.FLATPAK_REPO) {
|
|
||||||
buildOptions.repoDir = process.env.FLATPAK_REPO;
|
|
||||||
} else {
|
|
||||||
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
|
|
||||||
}
|
}
|
||||||
// Setup PGP signing if requested.
|
|
||||||
if (process.env.GPG_KEY_ID !== undefined) {
|
{
|
||||||
buildOptions.gpgSign = process.env.GPG_KEY_ID;
|
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
|
||||||
if (process.env.GPG_HOMEDIR) {
|
gulp.task(prepareSnapTask);
|
||||||
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
|
const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
|
||||||
}
|
gulp.task(buildSnapTask);
|
||||||
}
|
}
|
||||||
return function (cb) {
|
});
|
||||||
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64'));
|
|
||||||
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64'));
|
|
||||||
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64'));
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const assert = require('assert');
|
|||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
const _7z = require('7zip')['7z'];
|
const _7z = require('7zip')['7z'];
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const pkg = require('../package.json');
|
const pkg = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
@@ -107,8 +108,8 @@ function buildWin32Setup(arch, target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defineWin32SetupTasks(arch, target) {
|
function defineWin32SetupTasks(arch, target) {
|
||||||
gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target)));
|
const cleanTask = util.rimraf(setupDir(arch, target));
|
||||||
gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target));
|
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
|
||||||
}
|
}
|
||||||
|
|
||||||
defineWin32SetupTasks('ia32', 'system');
|
defineWin32SetupTasks('ia32', 'system');
|
||||||
@@ -126,11 +127,8 @@ function archiveWin32Setup(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32')));
|
gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
|
||||||
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32'));
|
gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))));
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
|
|
||||||
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
|
|
||||||
|
|
||||||
function copyInnoUpdater(arch) {
|
function copyInnoUpdater(arch) {
|
||||||
return () => {
|
return () => {
|
||||||
@@ -139,9 +137,6 @@ function copyInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
|
|
||||||
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
|
|
||||||
|
|
||||||
function patchInnoUpdater(arch) {
|
function patchInnoUpdater(arch) {
|
||||||
return cb => {
|
return cb => {
|
||||||
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
||||||
@@ -149,5 +144,5 @@ function patchInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32'));
|
gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
|
||||||
gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64'));
|
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));
|
||||||
@@ -14,7 +14,8 @@ const es = require('event-stream');
|
|||||||
const rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
const ext = require('./extensions');
|
const ext = require('./extensions');
|
||||||
const util = require('gulp-util');
|
const fancyLog = require('fancy-log');
|
||||||
|
const ansiColors = require('ansi-colors');
|
||||||
|
|
||||||
const root = path.dirname(path.dirname(__dirname));
|
const root = path.dirname(path.dirname(__dirname));
|
||||||
const builtInExtensions = require('../builtInExtensions.json');
|
const builtInExtensions = require('../builtInExtensions.json');
|
||||||
@@ -43,7 +44,7 @@ function isUpToDate(extension) {
|
|||||||
|
|
||||||
function syncMarketplaceExtension(extension) {
|
function syncMarketplaceExtension(extension) {
|
||||||
if (isUpToDate(extension)) {
|
if (isUpToDate(extension)) {
|
||||||
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) {
|
|||||||
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||||
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
||||||
.pipe(vfs.dest('.build/builtInExtensions'))
|
.pipe(vfs.dest('.build/builtInExtensions'))
|
||||||
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎')));
|
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncExtension(extension, controlState) {
|
function syncExtension(extension, controlState) {
|
||||||
switch (controlState) {
|
switch (controlState) {
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
|
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
case 'marketplace':
|
case 'marketplace':
|
||||||
@@ -66,15 +67,15 @@ function syncExtension(extension, controlState) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (!fs.existsSync(controlState)) {
|
if (!fs.existsSync(controlState)) {
|
||||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
||||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,8 +94,8 @@ function writeControlFile(control) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
util.log('Syncronizing built-in extensions...');
|
fancyLog('Syncronizing built-in extensions...');
|
||||||
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
|
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
|
||||||
|
|
||||||
const control = readControlFile();
|
const control = readControlFile();
|
||||||
const streams = [];
|
const streams = [];
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ const monacodts = require("../monaco/api");
|
|||||||
const nls = require("./nls");
|
const nls = require("./nls");
|
||||||
const reporter_1 = require("./reporter");
|
const reporter_1 = require("./reporter");
|
||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const util2 = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
const reporter = reporter_1.createReporter();
|
const reporter = reporter_1.createReporter();
|
||||||
function getTypeScriptCompilerOptions(src) {
|
function getTypeScriptCompilerOptions(src) {
|
||||||
@@ -126,6 +127,20 @@ class MonacoGenerator {
|
|||||||
this._declarationResolver.invalidateCache(moduleId);
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
this._executeSoon();
|
this._executeSoon();
|
||||||
});
|
});
|
||||||
|
watcher.addListener('error', (err) => {
|
||||||
|
console.error(`Encountered error while watching ${filePath}.`);
|
||||||
|
console.log(err);
|
||||||
|
delete this._watchedFiles[filePath];
|
||||||
|
for (let i = 0; i < this._watchers.length; i++) {
|
||||||
|
if (this._watchers[i] === watcher) {
|
||||||
|
this._watchers.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watcher.close();
|
||||||
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
|
this._executeSoon();
|
||||||
|
});
|
||||||
this._watchers.push(watcher);
|
this._watchers.push(watcher);
|
||||||
};
|
};
|
||||||
this._fsProvider = new class extends monacodts.FSProvider {
|
this._fsProvider = new class extends monacodts.FSProvider {
|
||||||
@@ -165,7 +180,7 @@ class MonacoGenerator {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
_log(message, ...rest) {
|
_log(message, ...rest) {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
execute() {
|
execute() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api';
|
|||||||
import * as nls from './nls';
|
import * as nls from './nls';
|
||||||
import { createReporter } from './reporter';
|
import { createReporter } from './reporter';
|
||||||
import * as util from './util';
|
import * as util from './util';
|
||||||
import * as util2 from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
|
|
||||||
const reporter = createReporter();
|
const reporter = createReporter();
|
||||||
@@ -159,6 +161,20 @@ class MonacoGenerator {
|
|||||||
this._declarationResolver.invalidateCache(moduleId);
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
this._executeSoon();
|
this._executeSoon();
|
||||||
});
|
});
|
||||||
|
watcher.addListener('error', (err) => {
|
||||||
|
console.error(`Encountered error while watching ${filePath}.`);
|
||||||
|
console.log(err);
|
||||||
|
delete this._watchedFiles[filePath];
|
||||||
|
for (let i = 0; i < this._watchers.length; i++) {
|
||||||
|
if (this._watchers[i] === watcher) {
|
||||||
|
this._watchers.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watcher.close();
|
||||||
|
this._declarationResolver.invalidateCache(moduleId);
|
||||||
|
this._executeSoon();
|
||||||
|
});
|
||||||
this._watchers.push(watcher);
|
this._watchers.push(watcher);
|
||||||
};
|
};
|
||||||
this._fsProvider = new class extends monacodts.FSProvider {
|
this._fsProvider = new class extends monacodts.FSProvider {
|
||||||
@@ -204,7 +220,7 @@ class MonacoGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _log(message: any, ...rest: any[]): void {
|
private _log(message: any, ...rest: any[]): void {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(): void {
|
public execute(): void {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const remote = require("gulp-remote-src");
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
const filter = require("gulp-filter");
|
const filter = require("gulp-filter");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const util = require('gulp-util');
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
const json = require("gulp-json-editor");
|
const json = require("gulp-json-editor");
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -136,7 +137,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
|
|||||||
.pipe(packageJsonFilter.restore);
|
.pipe(packageJsonFilter.restore);
|
||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
const webpackDone = (err, stats) => {
|
const webpackDone = (err, stats) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -214,7 +215,7 @@ const baseHeaders = {
|
|||||||
function fromMarketplace(extensionName, version, metadata) {
|
function fromMarketplace(extensionName, version, metadata) {
|
||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
@@ -245,6 +246,7 @@ const excludedExtensions = [
|
|||||||
const sqlBuiltInExtensions = [
|
const sqlBuiltInExtensions = [
|
||||||
// Add SQL built-in extensions here.
|
// Add SQL built-in extensions here.
|
||||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||||
|
'admin-tool-ext-win',
|
||||||
'agent',
|
'agent',
|
||||||
'import',
|
'import',
|
||||||
'profiler',
|
'profiler',
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ import remote = require('gulp-remote-src');
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
import filter = require('gulp-filter');
|
import filter = require('gulp-filter');
|
||||||
import rename = require('gulp-rename');
|
import rename = require('gulp-rename');
|
||||||
const util = require('gulp-util');
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
import json = require('gulp-json-editor');
|
import json = require('gulp-json-editor');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -155,7 +156,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
|||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
|
|
||||||
const webpackDone = (err: any, stats: any) => {
|
const webpackDone = (err: any, stats: any) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -249,7 +250,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
|||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
|
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
@@ -292,6 +293,7 @@ const excludedExtensions = [
|
|||||||
const sqlBuiltInExtensions = [
|
const sqlBuiltInExtensions = [
|
||||||
// Add SQL built-in extensions here.
|
// Add SQL built-in extensions here.
|
||||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||||
|
'admin-tool-ext-win',
|
||||||
'agent',
|
'agent',
|
||||||
'import',
|
'import',
|
||||||
'profiler',
|
'profiler',
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ function getVersion(repo) {
|
|||||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
const refMatch = /^ref: (.*)$/.exec(head);
|
const refMatch = /^ref: (.*)$/.exec(head);
|
||||||
if (!refMatch) {
|
if (!refMatch) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
const ref = refMatch[1];
|
const ref = refMatch[1];
|
||||||
const refPath = path.join(git, ref);
|
const refPath = path.join(git, ref);
|
||||||
@@ -40,7 +40,7 @@ function getVersion(repo) {
|
|||||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||||
let refsMatch;
|
let refsMatch;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
try {
|
try {
|
||||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||||
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
const refMatch = /^ref: (.*)$/.exec(head);
|
const refMatch = /^ref: (.*)$/.exec(head);
|
||||||
|
|
||||||
if (!refMatch) {
|
if (!refMatch) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ref = refMatch[1];
|
const ref = refMatch[1];
|
||||||
@@ -46,7 +46,7 @@ export function getVersion(repo: string): string | undefined {
|
|||||||
try {
|
try {
|
||||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return void 0;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||||
|
|||||||
@@ -13,15 +13,16 @@ const xml2js = require("xml2js");
|
|||||||
const glob = require("glob");
|
const glob = require("glob");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
const gulp = require("gulp");
|
const gulp = require("gulp");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const iconv = require("iconv-lite");
|
const iconv = require("iconv-lite");
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
function log(message, ...rest) {
|
function log(message, ...rest) {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
exports.defaultLanguages = [
|
exports.defaultLanguages = [
|
||||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
{ id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
|
||||||
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' },
|
{ id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
|
||||||
{ id: 'ja', folderName: 'jpn' },
|
{ id: 'ja', folderName: 'jpn' },
|
||||||
{ id: 'ko', folderName: 'kor' },
|
{ id: 'ko', folderName: 'kor' },
|
||||||
{ id: 'de', folderName: 'deu' },
|
{ id: 'de', folderName: 'deu' },
|
||||||
@@ -371,7 +372,11 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
let languageDirectory = path.join(__dirname, '..', '..', 'i18n');
|
let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
|
||||||
|
if (!fs.existsSync(languageDirectory)) {
|
||||||
|
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
|
||||||
|
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
|
||||||
|
}
|
||||||
let sortedLanguages = sortLanguages(languages);
|
let sortedLanguages = sortLanguages(languages);
|
||||||
sortedLanguages.forEach((language) => {
|
sortedLanguages.forEach((language) => {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
@@ -379,22 +384,25 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
}
|
}
|
||||||
statistics[language.id] = 0;
|
statistics[language.id] = 0;
|
||||||
let localizedModules = Object.create(null);
|
let localizedModules = Object.create(null);
|
||||||
let languageFolderName = language.folderName || language.id;
|
let languageFolderName = language.translationId || language.id;
|
||||||
let cwd = path.join(languageDirectory, languageFolderName, 'src');
|
let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
|
||||||
|
let allMessages;
|
||||||
|
if (fs.existsSync(i18nFile)) {
|
||||||
|
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
||||||
|
allMessages = JSON.parse(content);
|
||||||
|
}
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
let order = keysSection[module];
|
let order = keysSection[module];
|
||||||
let i18nFile = path.join(cwd, module) + '.i18n.json';
|
let moduleMessage;
|
||||||
let messages = null;
|
if (allMessages) {
|
||||||
if (fs.existsSync(i18nFile)) {
|
moduleMessage = allMessages.contents[module];
|
||||||
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
|
||||||
messages = JSON.parse(content);
|
|
||||||
}
|
}
|
||||||
else {
|
if (!moduleMessage) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized messages found for module ${module}. Using default messages.`);
|
log(`No localized messages found for module ${module}. Using default messages.`);
|
||||||
}
|
}
|
||||||
messages = defaultMessages[module];
|
moduleMessage = defaultMessages[module];
|
||||||
statistics[language.id] = statistics[language.id] + Object.keys(messages).length;
|
statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
|
||||||
}
|
}
|
||||||
let localizedMessages = [];
|
let localizedMessages = [];
|
||||||
order.forEach((keyInfo) => {
|
order.forEach((keyInfo) => {
|
||||||
@@ -405,7 +413,7 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
|||||||
else {
|
else {
|
||||||
key = keyInfo.key;
|
key = keyInfo.key;
|
||||||
}
|
}
|
||||||
let message = messages[key];
|
let message = moduleMessage[key];
|
||||||
if (!message) {
|
if (!message) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
||||||
@@ -490,7 +498,7 @@ function getResource(sourceFile) {
|
|||||||
else if (/^vs\/code/.test(sourceFile)) {
|
else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
}
|
}
|
||||||
else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
}
|
}
|
||||||
@@ -578,7 +586,7 @@ function createXlfFilesForExtensions() {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(event_stream_1.through(function (file) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer = file.contents;
|
const buffer = file.contents;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -955,7 +963,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
|||||||
return limiter.queue(() => new Promise((resolve, reject) => {
|
return limiter.queue(() => new Promise((resolve, reject) => {
|
||||||
const slug = resource.name.replace(/\//g, '_');
|
const slug = resource.name.replace(/\//g, '_');
|
||||||
const project = resource.project;
|
const project = resource.project;
|
||||||
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
|
||||||
const options = {
|
const options = {
|
||||||
hostname: apiHostname,
|
hostname: apiHostname,
|
||||||
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
||||||
@@ -1038,7 +1046,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
|||||||
let extensionsPacks = {};
|
let extensionsPacks = {};
|
||||||
let errors = [];
|
let errors = [];
|
||||||
return event_stream_1.through(function (xlf) {
|
return event_stream_1.through(function (xlf) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
|
|||||||
@@ -27,135 +27,155 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/cli",
|
"name": "vs/workbench/api/common",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/codeEditor",
|
"name": "vs/workbench/contrib/cli",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/comments",
|
"name": "vs/workbench/contrib/codeEditor",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/debug",
|
"name": "vs/workbench/contrib/codeinset",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/emmet",
|
"name": "vs/workbench/contrib/callHierarchy",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/execution",
|
"name": "vs/workbench/contrib/comments",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/extensions",
|
"name": "vs/workbench/contrib/debug",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/feedback",
|
"name": "vs/workbench/contrib/emmet",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/files",
|
"name": "vs/workbench/contrib/extensions",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/html",
|
"name": "vs/workbench/contrib/externalTerminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/markers",
|
"name": "vs/workbench/contrib/feedback",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/localizations",
|
"name": "vs/workbench/contrib/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/logs",
|
"name": "vs/workbench/contrib/html",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/output",
|
"name": "vs/workbench/contrib/issue",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/performance",
|
"name": "vs/workbench/contrib/markers",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/preferences",
|
"name": "vs/workbench/contrib/localizations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/quickopen",
|
"name": "vs/workbench/contrib/logs",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/relauncher",
|
"name": "vs/workbench/contrib/output",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/scm",
|
"name": "vs/workbench/contrib/performance",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/search",
|
"name": "vs/workbench/contrib/preferences",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/snippets",
|
"name": "vs/workbench/contrib/quickopen",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/stats",
|
"name": "vs/workbench/contrib/relauncher",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/surveys",
|
"name": "vs/workbench/contrib/scm",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/tasks",
|
"name": "vs/workbench/contrib/search",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/terminal",
|
"name": "vs/workbench/contrib/snippets",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/themes",
|
"name": "vs/workbench/contrib/format",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/trust",
|
"name": "vs/workbench/contrib/stats",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/update",
|
"name": "vs/workbench/contrib/surveys",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/url",
|
"name": "vs/workbench/contrib/tasks",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/watermark",
|
"name": "vs/workbench/contrib/terminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/webview",
|
"name": "vs/workbench/contrib/themes",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/welcome",
|
"name": "vs/workbench/contrib/trust",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/outline",
|
"name": "vs/workbench/contrib/update",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/url",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/watermark",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/webview",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/welcome",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/outline",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -195,13 +215,21 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/jsonschemas",
|
"name": "vs/workbench/services/extensionManagement",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/keybinding",
|
"name": "vs/workbench/services/keybinding",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
@@ -238,6 +266,10 @@
|
|||||||
"name": "vs/workbench/services/decorations",
|
"name": "vs/workbench/services/decorations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/label",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/preferences",
|
"name": "vs/workbench/services/preferences",
|
||||||
"project": "vscode-preferences"
|
"project": "vscode-preferences"
|
||||||
|
|||||||
@@ -13,19 +13,19 @@ import * as xml2js from 'xml2js';
|
|||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
import * as https from 'https';
|
import * as https from 'https';
|
||||||
import * as gulp from 'gulp';
|
import * as gulp from 'gulp';
|
||||||
|
import * as fancyLog from 'fancy-log';
|
||||||
import * as util from 'gulp-util';
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as iconv from 'iconv-lite';
|
import * as iconv from 'iconv-lite';
|
||||||
|
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
|
|
||||||
function log(message: any, ...rest: any[]): void {
|
function log(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Language {
|
export interface Language {
|
||||||
id: string; // laguage id, e.g. zh-tw, de
|
id: string; // laguage id, e.g. zh-tw, de
|
||||||
transifexId?: string; // language id used in transifex, 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ export interface InnoSetup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const defaultLanguages: Language[] = [
|
export const defaultLanguages: Language[] = [
|
||||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
{ id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
|
||||||
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' },
|
{ id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
|
||||||
{ id: 'ja', folderName: 'jpn' },
|
{ id: 'ja', folderName: 'jpn' },
|
||||||
{ id: 'ko', folderName: 'kor' },
|
{ id: 'ko', folderName: 'kor' },
|
||||||
{ id: 'de', folderName: 'deu' },
|
{ id: 'de', folderName: 'deu' },
|
||||||
@@ -144,6 +144,15 @@ interface BundledExtensionFormat {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface I18nFormat {
|
||||||
|
version: string;
|
||||||
|
contents: {
|
||||||
|
[module: string]: {
|
||||||
|
[messageKey: string]: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export class Line {
|
export class Line {
|
||||||
private buffer: string[] = [];
|
private buffer: string[] = [];
|
||||||
|
|
||||||
@@ -486,7 +495,11 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let languageDirectory = path.join(__dirname, '..', '..', 'i18n');
|
let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
|
||||||
|
if (!fs.existsSync(languageDirectory)) {
|
||||||
|
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
|
||||||
|
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
|
||||||
|
}
|
||||||
let sortedLanguages = sortLanguages(languages);
|
let sortedLanguages = sortLanguages(languages);
|
||||||
sortedLanguages.forEach((language) => {
|
sortedLanguages.forEach((language) => {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
@@ -495,21 +508,25 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
|
|
||||||
statistics[language.id] = 0;
|
statistics[language.id] = 0;
|
||||||
let localizedModules: Map<string[]> = Object.create(null);
|
let localizedModules: Map<string[]> = Object.create(null);
|
||||||
let languageFolderName = language.folderName || language.id;
|
let languageFolderName = language.translationId || language.id;
|
||||||
let cwd = path.join(languageDirectory, languageFolderName, 'src');
|
let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
|
||||||
|
let allMessages: I18nFormat | undefined;
|
||||||
|
if (fs.existsSync(i18nFile)) {
|
||||||
|
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
||||||
|
allMessages = JSON.parse(content);
|
||||||
|
}
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
let order = keysSection[module];
|
let order = keysSection[module];
|
||||||
let i18nFile = path.join(cwd, module) + '.i18n.json';
|
let moduleMessage: { [messageKey: string]: string } | undefined;
|
||||||
let messages: Map<string> | null = null;
|
if (allMessages) {
|
||||||
if (fs.existsSync(i18nFile)) {
|
moduleMessage = allMessages.contents[module];
|
||||||
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
|
}
|
||||||
messages = JSON.parse(content);
|
if (!moduleMessage) {
|
||||||
} else {
|
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized messages found for module ${module}. Using default messages.`);
|
log(`No localized messages found for module ${module}. Using default messages.`);
|
||||||
}
|
}
|
||||||
messages = defaultMessages[module];
|
moduleMessage = defaultMessages[module];
|
||||||
statistics[language.id] = statistics[language.id] + Object.keys(messages).length;
|
statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
|
||||||
}
|
}
|
||||||
let localizedMessages: string[] = [];
|
let localizedMessages: string[] = [];
|
||||||
order.forEach((keyInfo) => {
|
order.forEach((keyInfo) => {
|
||||||
@@ -519,7 +536,7 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
|
|||||||
} else {
|
} else {
|
||||||
key = keyInfo.key;
|
key = keyInfo.key;
|
||||||
}
|
}
|
||||||
let message: string = messages![key];
|
let message: string = moduleMessage![key];
|
||||||
if (!message) {
|
if (!message) {
|
||||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||||
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
log(`No localized message found for key ${key} in module ${module}. Using default message.`);
|
||||||
@@ -605,7 +622,7 @@ export function getResource(sourceFile: string): Resource {
|
|||||||
return { name: 'vs/base', project: editorProject };
|
return { name: 'vs/base', project: editorProject };
|
||||||
} else if (/^vs\/code/.test(sourceFile)) {
|
} else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||||
@@ -692,7 +709,7 @@ export function createXlfFilesForExtensions(): ThroughStream {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(through(function (file: File) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer: Buffer = file.contents as Buffer;
|
const buffer: Buffer = file.contents as Buffer;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -1093,7 +1110,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname: s
|
|||||||
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
||||||
const slug = resource.name.replace(/\//g, '_');
|
const slug = resource.name.replace(/\//g, '_');
|
||||||
const project = resource.project;
|
const project = resource.project;
|
||||||
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
|
||||||
const options = {
|
const options = {
|
||||||
hostname: apiHostname,
|
hostname: apiHostname,
|
||||||
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
||||||
@@ -1194,7 +1211,7 @@ export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingT
|
|||||||
let extensionsPacks: Map<I18nPack> = {};
|
let extensionsPacks: Map<I18nPack> = {};
|
||||||
let errors: any[] = [];
|
let errors: any[] = [];
|
||||||
return through(function (this: ThroughStream, xlf: File) {
|
return through(function (this: ThroughStream, xlf: File) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap");
|
|||||||
const sourcemaps = require("gulp-sourcemaps");
|
const sourcemaps = require("gulp-sourcemaps");
|
||||||
const uglify = require("gulp-uglify");
|
const uglify = require("gulp-uglify");
|
||||||
const composer = require("gulp-uglify/composer");
|
const composer = require("gulp-uglify/composer");
|
||||||
const gulpUtil = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const pump = require("pump");
|
const pump = require("pump");
|
||||||
const uglifyes = require("uglify-es");
|
const uglifyes = require("uglify-es");
|
||||||
@@ -24,7 +25,7 @@ const stats_1 = require("./stats");
|
|||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
function log(prefix, message) {
|
function log(prefix, message) {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
function loaderConfig(emptyPaths) {
|
function loaderConfig(emptyPaths) {
|
||||||
@@ -115,7 +116,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
|
|||||||
function optimizeTask(opts) {
|
function optimizeTask(opts) {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -138,7 +138,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
const bundleInfoArray = [];
|
const bundleInfoArray = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
bundleInfoArray.push(new VinylFile({
|
bundleInfoArray.push(new VinylFile({
|
||||||
@@ -149,20 +149,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
const otherSourcesStream = es.through();
|
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||||
const otherSourcesStreamArr = [];
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
|
||||||
return result
|
return result
|
||||||
.pipe(sourcemaps.write('./', {
|
.pipe(sourcemaps.write('./', {
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
@@ -225,7 +212,12 @@ function minifyTask(src, sourceMapBaseUrl) {
|
|||||||
return cb => {
|
return cb => {
|
||||||
const jsFilter = filter('**/*.js', { restore: true });
|
const jsFilter = filter('**/*.js', { restore: true });
|
||||||
const cssFilter = filter('**/*.css', { restore: true });
|
const cssFilter = filter('**/*.css', { restore: true });
|
||||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', {
|
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
return sourcePath;
|
||||||
|
}), sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
includeContent: true,
|
includeContent: true,
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap';
|
|||||||
import * as sourcemaps from 'gulp-sourcemaps';
|
import * as sourcemaps from 'gulp-sourcemaps';
|
||||||
import * as uglify from 'gulp-uglify';
|
import * as uglify from 'gulp-uglify';
|
||||||
import * as composer from 'gulp-uglify/composer';
|
import * as composer from 'gulp-uglify/composer';
|
||||||
import * as gulpUtil from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as pump from 'pump';
|
import * as pump from 'pump';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
@@ -28,7 +29,7 @@ import * as util from './util';
|
|||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
|
|
||||||
function log(prefix: string, message: string): void {
|
function log(prefix: string, message: string): void {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -143,10 +144,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
* (for AMD files, will get bundled and get Copyright treatment)
|
* (for AMD files, will get bundled and get Copyright treatment)
|
||||||
*/
|
*/
|
||||||
entryPoints: bundle.IEntryPoint[];
|
entryPoints: bundle.IEntryPoint[];
|
||||||
/**
|
|
||||||
* (for non-AMD files that should get Copyright treatment)
|
|
||||||
*/
|
|
||||||
otherSources: string[];
|
|
||||||
/**
|
/**
|
||||||
* (svg, etc.)
|
* (svg, etc.)
|
||||||
*/
|
*/
|
||||||
@@ -177,7 +174,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -202,7 +198,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
|
|
||||||
const bundleInfoArray: VinylFile[] = [];
|
const bundleInfoArray: VinylFile[] = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
@@ -215,24 +211,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
|
|
||||||
const otherSourcesStream = es.through();
|
|
||||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
|
||||||
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
} else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
const result = es.merge(
|
const result = es.merge(
|
||||||
loader(src, bundledFileHeader, bundleLoader),
|
loader(src, bundledFileHeader, bundleLoader),
|
||||||
bundlesStream,
|
bundlesStream,
|
||||||
otherSourcesStream,
|
|
||||||
resourcesStream,
|
resourcesStream,
|
||||||
bundleInfoStream
|
bundleInfoStream
|
||||||
);
|
);
|
||||||
@@ -319,6 +300,13 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
|||||||
cssFilter,
|
cssFilter,
|
||||||
minifyCSS({ reduceIdents: false }),
|
minifyCSS({ reduceIdents: false }),
|
||||||
cssFilter.restore,
|
cssFilter.restore,
|
||||||
|
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
|
||||||
|
return sourcePath;
|
||||||
|
}),
|
||||||
sourcemaps.write('./', {
|
sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const _ = require("underscore");
|
const _ = require("underscore");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const allErrors = [];
|
const allErrors = [];
|
||||||
@@ -17,7 +18,7 @@ function onStart() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
function onEnd() {
|
function onEnd() {
|
||||||
if (--count > 0) {
|
if (--count > 0) {
|
||||||
@@ -38,7 +39,7 @@ function log() {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||||
@@ -53,7 +54,7 @@ function log() {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||||
}
|
}
|
||||||
function createReporter() {
|
function createReporter() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as _ from 'underscore';
|
import * as _ from 'underscore';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ function onStart(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnd(): void {
|
function onEnd(): void {
|
||||||
@@ -47,7 +48,7 @@ function log(): void {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ function log(): void {
|
|||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReporter {
|
export interface IReporter {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function writeFile(filePath, contents) {
|
|||||||
fs.writeFileSync(filePath, contents);
|
fs.writeFileSync(filePath, contents);
|
||||||
}
|
}
|
||||||
function extractEditor(options) {
|
function extractEditor(options) {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions;
|
let compilerOptions;
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -36,13 +36,11 @@ function extractEditor(options) {
|
|||||||
compilerOptions = tsConfig.compilerOptions;
|
compilerOptions = tsConfig.compilerOptions;
|
||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
let result = tss.shake(options);
|
let result = tss.shake(options);
|
||||||
for (let fileName in result) {
|
for (let fileName in result) {
|
||||||
@@ -119,8 +117,7 @@ function createESMSourcesAndResources2(options) {
|
|||||||
return path.join(OUT_RESOURCES_FOLDER, dest);
|
return path.join(OUT_RESOURCES_FOLDER, dest);
|
||||||
};
|
};
|
||||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||||
for (let i = 0; i < allFiles.length; i++) {
|
for (const file of allFiles) {
|
||||||
const file = allFiles[i];
|
|
||||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function writeFile(filePath: string, contents: Buffer | string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions: { [key: string]: any };
|
let compilerOptions: { [key: string]: any };
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -40,14 +40,12 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
|
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
@@ -139,8 +137,7 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||||
for (let i = 0; i < allFiles.length; i++) {
|
for (const file of allFiles) {
|
||||||
const file = allFiles[i];
|
|
||||||
|
|
||||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||||
continue;
|
continue;
|
||||||
@@ -244,7 +241,6 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
|
|||||||
let mode = 0;
|
let mode = 0;
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
|
|
||||||
if (mode === 0) {
|
if (mode === 0) {
|
||||||
if (/\/\/ ESM-comment-begin/.test(line)) {
|
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||||
mode = 1;
|
mode = 1;
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const appInsights = require("applicationinsights");
|
const appInsights = require("applicationinsights");
|
||||||
class Entry {
|
class Entry {
|
||||||
constructor(name, totalCount, totalSize) {
|
constructor(name, totalCount, totalSize) {
|
||||||
@@ -24,13 +25,13 @@ class Entry {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,13 +58,13 @@ function createStatsStream(group, log) {
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as File from 'vinyl';
|
import * as File from 'vinyl';
|
||||||
import * as appInsights from 'applicationinsights';
|
import * as appInsights from 'applicationinsights';
|
||||||
|
|
||||||
@@ -22,14 +23,14 @@ class Entry {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
|
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
|
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
96
build/lib/task.js
Normal file
96
build/lib/task.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
|
function _isPromise(p) {
|
||||||
|
if (typeof p.then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function _renderTime(time) {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
async function _execute(task) {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function _doExecute(task) {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a calback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const taskResult = task();
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function series(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.series = series;
|
||||||
|
function parallel(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.parallel = parallel;
|
||||||
|
function define(name, task) {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
exports.define = define;
|
||||||
125
build/lib/task.ts
Normal file
125
build/lib/task.ts
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
|
export interface BaseTask {
|
||||||
|
displayName?: string;
|
||||||
|
taskName?: string;
|
||||||
|
_tasks?: Task[];
|
||||||
|
}
|
||||||
|
export interface PromiseTask extends BaseTask {
|
||||||
|
(): Promise<void>;
|
||||||
|
}
|
||||||
|
export interface StreamTask extends BaseTask {
|
||||||
|
(): NodeJS.ReadWriteStream;
|
||||||
|
}
|
||||||
|
export interface CallbackTask extends BaseTask {
|
||||||
|
(cb?: (err?: any) => void): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Task = PromiseTask | StreamTask | CallbackTask;
|
||||||
|
|
||||||
|
function _isPromise(p: Promise<void> | NodeJS.ReadWriteStream): p is Promise<void> {
|
||||||
|
if (typeof (<any>p).then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _renderTime(time: number): string {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _execute(task: Task): Promise<void> {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _doExecute(task: Task): Promise<void> {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a calback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const taskResult = task();
|
||||||
|
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function series(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parallel(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function define(name: string, task: Task): Task {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
@@ -27,13 +27,13 @@ suite('XLF Parser Tests', () => {
|
|||||||
});
|
});
|
||||||
test('JSON file source path to Transifex resource match', () => {
|
test('JSON file source path to Transifex resource match', () => {
|
||||||
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
||||||
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
||||||
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
editor = { name: 'vs/editor', project: editorProject },
|
editor = { name: 'vs/editor', project: editorProject },
|
||||||
base = { name: 'vs/base', project: editorProject },
|
base = { name: 'vs/base', project: editorProject },
|
||||||
code = { name: 'vs/code', project: workbenchProject },
|
code = { name: 'vs/code', project: workbenchProject },
|
||||||
workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject },
|
workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
|
||||||
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
||||||
workbench = { name: 'vs/workbench', project: workbenchProject};
|
workbench = { name: 'vs/workbench', project: workbenchProject};
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ var ShakeLevel;
|
|||||||
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
|
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
|
||||||
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
|
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
|
||||||
function printDiagnostics(diagnostics) {
|
function printDiagnostics(diagnostics) {
|
||||||
for (let i = 0; i < diagnostics.length; i++) {
|
for (const diag of diagnostics) {
|
||||||
const diag = diagnostics[i];
|
|
||||||
let result = '';
|
let result = '';
|
||||||
if (diag.file) {
|
if (diag.file) {
|
||||||
result += `${diag.file.fileName}: `;
|
result += `${diag.file.fileName}: `;
|
||||||
@@ -97,6 +96,11 @@ function discoverAndReadFiles(options) {
|
|||||||
FILES[`${moduleId}.d.ts`] = dts_filecontents;
|
FILES[`${moduleId}.d.ts`] = dts_filecontents;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
|
||||||
|
if (fs.existsSync(js_filename)) {
|
||||||
|
// This is an import for a .js file, so ignore it...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let ts_filename;
|
let ts_filename;
|
||||||
if (options.redirects[moduleId]) {
|
if (options.redirects[moduleId]) {
|
||||||
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
||||||
@@ -475,8 +479,7 @@ function generateResult(languageService, shakeLevel) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let survivingImports = [];
|
let survivingImports = [];
|
||||||
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) {
|
for (const importNode of node.importClause.namedBindings.elements) {
|
||||||
const importNode = node.importClause.namedBindings.elements[i];
|
|
||||||
if (getColor(importNode) === 2 /* Black */) {
|
if (getColor(importNode) === 2 /* Black */) {
|
||||||
survivingImports.push(importNode.getFullText(sourceFile));
|
survivingImports.push(importNode.getFullText(sourceFile));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,15 +61,14 @@ export interface ITreeShakingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
|
function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
|
||||||
for (let i = 0; i < diagnostics.length; i++) {
|
for (const diag of diagnostics) {
|
||||||
const diag = diagnostics[i];
|
|
||||||
let result = '';
|
let result = '';
|
||||||
if (diag.file) {
|
if (diag.file) {
|
||||||
result += `${diag.file.fileName}: `;
|
result += `${diag.file.fileName}: `;
|
||||||
}
|
}
|
||||||
if (diag.file && diag.start) {
|
if (diag.file && diag.start) {
|
||||||
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
|
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
|
||||||
result += `- ${location.line + 1},${location.character} - `
|
result += `- ${location.line + 1},${location.character} - `;
|
||||||
}
|
}
|
||||||
result += JSON.stringify(diag.messageText);
|
result += JSON.stringify(diag.messageText);
|
||||||
console.log(result);
|
console.log(result);
|
||||||
@@ -160,6 +159,12 @@ function discoverAndReadFiles(options: ITreeShakingOptions): IFileMap {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
|
||||||
|
if (fs.existsSync(js_filename)) {
|
||||||
|
// This is an import for a .js file, so ignore it...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let ts_filename: string;
|
let ts_filename: string;
|
||||||
if (options.redirects[moduleId]) {
|
if (options.redirects[moduleId]) {
|
||||||
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
|
||||||
@@ -459,7 +464,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (black_queue.length === 0) {
|
if (black_queue.length === 0) {
|
||||||
for (let i = 0; i < gray_queue.length; i++) {
|
for (let i = 0; i< gray_queue.length; i++) {
|
||||||
const node = gray_queue[i];
|
const node = gray_queue[i];
|
||||||
const nodeParent = node.parent;
|
const nodeParent = node.parent;
|
||||||
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
|
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
|
||||||
@@ -604,8 +609,7 @@ function generateResult(languageService: ts.LanguageService, shakeLevel: ShakeLe
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let survivingImports: string[] = [];
|
let survivingImports: string[] = [];
|
||||||
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) {
|
for (const importNode of node.importClause.namedBindings.elements) {
|
||||||
const importNode = node.importClause.namedBindings.elements[i];
|
|
||||||
if (getColor(importNode) === NodeColor.Black) {
|
if (getColor(importNode) === NodeColor.Black) {
|
||||||
survivingImports.push(importNode.getFullText(sourceFile));
|
survivingImports.push(importNode.getFullText(sourceFile));
|
||||||
}
|
}
|
||||||
|
|||||||
54
build/lib/tslint/noNlsInStandaloneEditorRule.js
Normal file
54
build/lib/tslint/noNlsInStandaloneEditorRule.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const ts = require("typescript");
|
||||||
|
const Lint = require("tslint");
|
||||||
|
const path_1 = require("path");
|
||||||
|
class Rule extends Lint.Rules.AbstractRule {
|
||||||
|
apply(sourceFile) {
|
||||||
|
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)) {
|
||||||
|
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Rule = Rule;
|
||||||
|
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
||||||
|
constructor(file, opts) {
|
||||||
|
super(file, opts);
|
||||||
|
}
|
||||||
|
visitImportEqualsDeclaration(node) {
|
||||||
|
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
|
||||||
|
this._validateImport(node.moduleReference.expression.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visitImportDeclaration(node) {
|
||||||
|
this._validateImport(node.moduleSpecifier.getText(), node);
|
||||||
|
}
|
||||||
|
visitCallExpression(node) {
|
||||||
|
super.visitCallExpression(node);
|
||||||
|
// import('foo') statements inside the code
|
||||||
|
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
|
||||||
|
const [path] = node.arguments;
|
||||||
|
this._validateImport(path.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_validateImport(path, node) {
|
||||||
|
// remove quotes
|
||||||
|
path = path.slice(1, -1);
|
||||||
|
// resolve relative paths
|
||||||
|
if (path[0] === '.') {
|
||||||
|
path = path_1.join(this.getSourceFile().fileName, path);
|
||||||
|
}
|
||||||
|
if (/vs(\/|\\)nls/.test(path)) {
|
||||||
|
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
67
build/lib/tslint/noNlsInStandaloneEditorRule.ts
Normal file
67
build/lib/tslint/noNlsInStandaloneEditorRule.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as ts from 'typescript';
|
||||||
|
import * as Lint from 'tslint';
|
||||||
|
import { join } from 'path';
|
||||||
|
|
||||||
|
export class Rule extends Lint.Rules.AbstractRule {
|
||||||
|
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||||
|
if (
|
||||||
|
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|
||||||
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)
|
||||||
|
) {
|
||||||
|
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
||||||
|
|
||||||
|
constructor(file: ts.SourceFile, opts: Lint.IOptions) {
|
||||||
|
super(file, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
|
||||||
|
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
|
||||||
|
this._validateImport(node.moduleReference.expression.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
|
||||||
|
this._validateImport(node.moduleSpecifier.getText(), node);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected visitCallExpression(node: ts.CallExpression): void {
|
||||||
|
super.visitCallExpression(node);
|
||||||
|
|
||||||
|
// import('foo') statements inside the code
|
||||||
|
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
|
||||||
|
const [path] = node.arguments;
|
||||||
|
this._validateImport(path.getText(), node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _validateImport(path: string, node: ts.Node): void {
|
||||||
|
// remove quotes
|
||||||
|
path = path.slice(1, -1);
|
||||||
|
|
||||||
|
// resolve relative paths
|
||||||
|
if (path[0] === '.') {
|
||||||
|
path = join(this.getSourceFile().fileName, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
/vs(\/|\\)nls/.test(path)
|
||||||
|
) {
|
||||||
|
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,8 +45,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
|||||||
if (path[0] === '.') {
|
if (path[0] === '.') {
|
||||||
path = path_1.join(this.getSourceFile().fileName, path);
|
path = path_1.join(this.getSourceFile().fileName, path);
|
||||||
}
|
}
|
||||||
if (/vs(\/|\\)editor(\/|\\)standalone/.test(path)
|
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
/vs(\/|\\)editor(\/|\\)standalone/.test(path)
|
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)
|
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)
|
||||||
|
|||||||
@@ -109,8 +109,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
|
|||||||
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
||||||
}
|
}
|
||||||
else if (isObjectLiteral(keyArg)) {
|
else if (isObjectLiteral(keyArg)) {
|
||||||
for (let i = 0; i < keyArg.properties.length; i++) {
|
for (const property of keyArg.properties) {
|
||||||
const property = keyArg.properties[i];
|
|
||||||
if (isPropertyAssignment(property)) {
|
if (isPropertyAssignment(property)) {
|
||||||
const name = property.name.getText();
|
const name = property.name.getText();
|
||||||
if (name === 'key') {
|
if (name === 'key') {
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
|
|||||||
if (isStringLiteral(keyArg)) {
|
if (isStringLiteral(keyArg)) {
|
||||||
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
|
||||||
} else if (isObjectLiteral(keyArg)) {
|
} else if (isObjectLiteral(keyArg)) {
|
||||||
for (let i = 0; i < keyArg.properties.length; i++) {
|
for (const property of keyArg.properties) {
|
||||||
const property = keyArg.properties[i];
|
|
||||||
if (isPropertyAssignment(property)) {
|
if (isPropertyAssignment(property)) {
|
||||||
const name = property.name.getText();
|
const name = property.name.getText();
|
||||||
if (name === 'key') {
|
if (name === 'key') {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
visitImportLikeDeclaration(node) {
|
visitImportLikeDeclaration(node) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ const fs = require("fs");
|
|||||||
const _rimraf = require("rimraf");
|
const _rimraf = require("rimraf");
|
||||||
const git = require("./git");
|
const git = require("./git");
|
||||||
const VinylFile = require("vinyl");
|
const VinylFile = require("vinyl");
|
||||||
|
const download_1 = require("../download/download");
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
const NoCancellationToken = { isCancellationRequested: () => false };
|
const NoCancellationToken = { isCancellationRequested: () => false };
|
||||||
function incremental(streamProvider, initial, supportsCancellation) {
|
function incremental(streamProvider, initial, supportsCancellation) {
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
@@ -180,7 +182,8 @@ function rimraf(dir) {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return cb => retry(cb);
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
|
return retry;
|
||||||
}
|
}
|
||||||
exports.rimraf = rimraf;
|
exports.rimraf = rimraf;
|
||||||
function getVersion(root) {
|
function getVersion(root) {
|
||||||
@@ -220,3 +223,38 @@ function versionStringToNumber(versionStr) {
|
|||||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
}
|
}
|
||||||
exports.versionStringToNumber = versionStringToNumber;
|
exports.versionStringToNumber = versionStringToNumber;
|
||||||
|
function download(requestOptions) {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
download_1.downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.download = download;
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import * as git from './git';
|
|||||||
import * as VinylFile from 'vinyl';
|
import * as VinylFile from 'vinyl';
|
||||||
import { ThroughStream } from 'through';
|
import { ThroughStream } from 'through';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
|
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
|
|
||||||
export interface ICancellationToken {
|
export interface ICancellationToken {
|
||||||
isCancellationRequested(): boolean;
|
isCancellationRequested(): boolean;
|
||||||
@@ -233,8 +236,8 @@ export function rimraf(dir: string): (cb: any) => void {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
return cb => retry(cb);
|
return retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVersion(root: string): string | undefined {
|
export function getVersion(root: string): string | undefined {
|
||||||
@@ -280,3 +283,38 @@ export function versionStringToNumber(versionStr: string) {
|
|||||||
|
|
||||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts: IDownloadOptions = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function handleDeletions() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let watch = void 0;
|
let watch = undefined;
|
||||||
|
|
||||||
if (!watch) {
|
if (!watch) {
|
||||||
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
||||||
|
|||||||
@@ -7,23 +7,54 @@ herein, whether by implication, estoppel or otherwise.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158)
|
||||||
%% winjs version 4.4.0 (https://github.com/winjs/winjs)
|
|
||||||
=========================================
|
=========================================
|
||||||
WinJS
|
Copyright Joyent, Inc. and other Node contributors.
|
||||||
|
|
||||||
Copyright (c) Microsoft Corporation
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||||
|
persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
All rights reserved.
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
MIT License
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||||
|
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
=========================================
|
||||||
|
END OF nodejs path library NOTICES AND INFORMATION
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||||
|
=========================================
|
||||||
|
Copyright (c) 2014 Taylor Hakes
|
||||||
|
Copyright (c) 2014 Forbes Lindesay
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
=========================================
|
=========================================
|
||||||
END OF winjs NOTICES AND INFORMATION
|
END OF winjs NOTICES AND INFORMATION
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ts = require("typescript");
|
const ts = require("typescript");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
const tsfmt = require('../../tsfmt.json');
|
const tsfmt = require('../../tsfmt.json');
|
||||||
const SRC = path.join(__dirname, '../../src');
|
const SRC = path.join(__dirname, '../../src');
|
||||||
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
function logErr(message, ...rest) {
|
function logErr(message, ...rest) {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
function isDeclaration(a) {
|
function isDeclaration(a) {
|
||||||
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||||
@@ -456,11 +457,20 @@ class FSProvider {
|
|||||||
existsSync(filePath) {
|
existsSync(filePath) {
|
||||||
return fs.existsSync(filePath);
|
return fs.existsSync(filePath);
|
||||||
}
|
}
|
||||||
|
statSync(filePath) {
|
||||||
|
return fs.statSync(filePath);
|
||||||
|
}
|
||||||
readFileSync(_moduleId, filePath) {
|
readFileSync(_moduleId, filePath) {
|
||||||
return fs.readFileSync(filePath);
|
return fs.readFileSync(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.FSProvider = FSProvider;
|
exports.FSProvider = FSProvider;
|
||||||
|
class CacheEntry {
|
||||||
|
constructor(sourceFile, mtime) {
|
||||||
|
this.sourceFile = sourceFile;
|
||||||
|
this.mtime = mtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
class DeclarationResolver {
|
class DeclarationResolver {
|
||||||
constructor(_fsProvider) {
|
constructor(_fsProvider) {
|
||||||
this._fsProvider = _fsProvider;
|
this._fsProvider = _fsProvider;
|
||||||
@@ -470,31 +480,43 @@ class DeclarationResolver {
|
|||||||
this._sourceFileCache[moduleId] = null;
|
this._sourceFileCache[moduleId] = null;
|
||||||
}
|
}
|
||||||
getDeclarationSourceFile(moduleId) {
|
getDeclarationSourceFile(moduleId) {
|
||||||
|
if (this._sourceFileCache[moduleId]) {
|
||||||
|
// Since we cannot trust file watching to invalidate the cache, check also the mtime
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (this._sourceFileCache[moduleId].mtime !== mtime) {
|
||||||
|
this._sourceFileCache[moduleId] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this._sourceFileCache[moduleId]) {
|
if (!this._sourceFileCache[moduleId]) {
|
||||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||||
}
|
}
|
||||||
return this._sourceFileCache[moduleId];
|
return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId].sourceFile : null;
|
||||||
|
}
|
||||||
|
_getFileName(moduleId) {
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
return path.join(SRC, moduleId);
|
||||||
|
}
|
||||||
|
return path.join(SRC, `${moduleId}.ts`);
|
||||||
}
|
}
|
||||||
_getDeclarationSourceFile(moduleId) {
|
_getDeclarationSourceFile(moduleId) {
|
||||||
if (/\.d\.ts$/.test(moduleId)) {
|
const fileName = this._getFileName(moduleId);
|
||||||
const fileName = path.join(SRC, moduleId);
|
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
|
||||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
|
||||||
}
|
|
||||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
if (!this._fsProvider.existsSync(fileName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
// const mtime = this._fsProvider.statFileSync()
|
||||||
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
|
return new CacheEntry(ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5), mtime);
|
||||||
|
}
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
const fileMap = {
|
const fileMap = {
|
||||||
'file.ts': fileContents
|
'file.ts': fileContents
|
||||||
};
|
};
|
||||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DeclarationResolver = DeclarationResolver;
|
exports.DeclarationResolver = DeclarationResolver;
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
|||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
|
|
||||||
function logErr(message: any, ...rest: any[]): void {
|
function logErr(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
||||||
@@ -547,14 +548,24 @@ export class FSProvider {
|
|||||||
public existsSync(filePath: string): boolean {
|
public existsSync(filePath: string): boolean {
|
||||||
return fs.existsSync(filePath);
|
return fs.existsSync(filePath);
|
||||||
}
|
}
|
||||||
|
public statSync(filePath: string): fs.Stats {
|
||||||
|
return fs.statSync(filePath);
|
||||||
|
}
|
||||||
public readFileSync(_moduleId: string, filePath: string): Buffer {
|
public readFileSync(_moduleId: string, filePath: string): Buffer {
|
||||||
return fs.readFileSync(filePath);
|
return fs.readFileSync(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CacheEntry {
|
||||||
|
constructor(
|
||||||
|
public readonly sourceFile: ts.SourceFile,
|
||||||
|
public readonly mtime: number
|
||||||
|
) {}
|
||||||
|
}
|
||||||
|
|
||||||
export class DeclarationResolver {
|
export class DeclarationResolver {
|
||||||
|
|
||||||
private _sourceFileCache: { [moduleId: string]: ts.SourceFile | null; };
|
private _sourceFileCache: { [moduleId: string]: CacheEntry | null; };
|
||||||
|
|
||||||
constructor(private readonly _fsProvider: FSProvider) {
|
constructor(private readonly _fsProvider: FSProvider) {
|
||||||
this._sourceFileCache = Object.create(null);
|
this._sourceFileCache = Object.create(null);
|
||||||
@@ -565,32 +576,51 @@ export class DeclarationResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
||||||
|
if (this._sourceFileCache[moduleId]) {
|
||||||
|
// Since we cannot trust file watching to invalidate the cache, check also the mtime
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (this._sourceFileCache[moduleId]!.mtime !== mtime) {
|
||||||
|
this._sourceFileCache[moduleId] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this._sourceFileCache[moduleId]) {
|
if (!this._sourceFileCache[moduleId]) {
|
||||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||||
}
|
}
|
||||||
return this._sourceFileCache[moduleId];
|
return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId]!.sourceFile : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
private _getFileName(moduleId: string): string {
|
||||||
if (/\.d\.ts$/.test(moduleId)) {
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
const fileName = path.join(SRC, moduleId);
|
return path.join(SRC, moduleId);
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
|
||||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
|
||||||
}
|
}
|
||||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
return path.join(SRC, `${moduleId}.ts`);
|
||||||
|
}
|
||||||
|
|
||||||
|
private _getDeclarationSourceFile(moduleId: string): CacheEntry | null {
|
||||||
|
const fileName = this._getFileName(moduleId);
|
||||||
if (!this._fsProvider.existsSync(fileName)) {
|
if (!this._fsProvider.existsSync(fileName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
|
||||||
|
if (/\.d\.ts$/.test(moduleId)) {
|
||||||
|
// const mtime = this._fsProvider.statFileSync()
|
||||||
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
|
return new CacheEntry(
|
||||||
|
ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5),
|
||||||
|
mtime
|
||||||
|
);
|
||||||
|
}
|
||||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||||
const fileMap: IFileMap = {
|
const fileMap: IFileMap = {
|
||||||
'file.ts': fileContents
|
'file.ts': fileContents
|
||||||
};
|
};
|
||||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
return new CacheEntry(
|
||||||
|
ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5),
|
||||||
|
mtime
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,11 @@ declare namespace monaco {
|
|||||||
export class Emitter<T> {
|
export class Emitter<T> {
|
||||||
constructor();
|
constructor();
|
||||||
readonly event: Event<T>;
|
readonly event: Event<T>;
|
||||||
fire(event?: T): void;
|
fire(event: T): void;
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
|
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
|
||||||
#include(vs/base/common/winjs.base.d.ts): Promise
|
|
||||||
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
||||||
#include(vs/base/common/uri): URI, UriComponents
|
#include(vs/base/common/uri): URI, UriComponents
|
||||||
#include(vs/base/common/keyCodes): KeyCode
|
#include(vs/base/common/keyCodes): KeyCode
|
||||||
@@ -86,4 +85,4 @@ declare namespace monaco.worker {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//dtsv=2
|
//dtsv=2
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
|
|||||||
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
||||||
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
||||||
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||||
|
import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService';
|
||||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
||||||
import { PolyfillPromise } from './vs/base/common/winjs.polyfill.promise';
|
|
||||||
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
||||||
|
import { DocumentRangeFormattingEditProvider } from './vs/editor/common/modes';
|
||||||
import * as editorAPI from './vs/editor/editor.api';
|
import * as editorAPI from './vs/editor/editor.api';
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
@@ -23,6 +24,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
||||||
a = (<CountBadge>b).style; // IThemable
|
a = (<CountBadge>b).style; // IThemable
|
||||||
a = (<QuickOpenWidget>b).style; // IThemable
|
a = (<QuickOpenWidget>b).style; // IThemable
|
||||||
|
a = (<WorkbenchAsyncDataTree<any,any>>b).style; // IThemable
|
||||||
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
||||||
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
||||||
a = (<ServiceIdentifier<any>>b).type;
|
a = (<ServiceIdentifier<any>>b).type;
|
||||||
@@ -31,14 +33,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
||||||
a = create1;
|
a = create1;
|
||||||
a = create2;
|
a = create2;
|
||||||
|
a = (<DocumentRangeFormattingEditProvider>b).extensionId;
|
||||||
// promise polyfill
|
|
||||||
a = PolyfillPromise.all;
|
|
||||||
a = PolyfillPromise.race;
|
|
||||||
a = PolyfillPromise.resolve;
|
|
||||||
a = PolyfillPromise.reject;
|
|
||||||
a = (<PolyfillPromise>b).then;
|
|
||||||
a = (<PolyfillPromise>b).catch;
|
|
||||||
|
|
||||||
// injection madness
|
// injection madness
|
||||||
a = (<SyncDescriptor0<any>>b).ctor;
|
a = (<SyncDescriptor0<any>>b).ctor;
|
||||||
@@ -73,7 +68,6 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = editorAPI.SelectionDirection;
|
a = editorAPI.SelectionDirection;
|
||||||
a = editorAPI.MarkerSeverity;
|
a = editorAPI.MarkerSeverity;
|
||||||
a = editorAPI.MarkerTag;
|
a = editorAPI.MarkerTag;
|
||||||
a = editorAPI.Promise;
|
|
||||||
a = editorAPI.Uri;
|
a = editorAPI.Uri;
|
||||||
a = editorAPI.Token;
|
a = editorAPI.Token;
|
||||||
a = editorAPI.editor;
|
a = editorAPI.editor;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "monaco-editor-core",
|
"name": "monaco-editor-core",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.14.3",
|
"version": "0.16.0",
|
||||||
"description": "A browser based code editor",
|
"description": "A browser based code editor",
|
||||||
"author": "Microsoft Corporation",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -17,7 +17,17 @@ function yarnInstall(location, opts) {
|
|||||||
opts.cwd = location;
|
opts.cwd = location;
|
||||||
opts.stdio = 'inherit';
|
opts.stdio = 'inherit';
|
||||||
|
|
||||||
const result = cp.spawnSync(yarn, ['install'], opts);
|
const raw = process.env['npm_config_argv'] || '{}';
|
||||||
|
const argv = JSON.parse(raw);
|
||||||
|
const original = argv.original || [];
|
||||||
|
const args = ['install'];
|
||||||
|
|
||||||
|
if (original.indexOf('--ignore-optional') > -1) {
|
||||||
|
args.push('--ignore-optional');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Installing dependencies in \'%s\'.', location);
|
||||||
|
const result = cp.spawnSync(yarn, args, opts);
|
||||||
|
|
||||||
if (result.error || result.status !== 0) {
|
if (result.error || result.status !== 0) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ let err = false;
|
|||||||
|
|
||||||
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
|
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
|
||||||
|
|
||||||
if (majorNodeVersion < 8 || majorNodeVersion >= 9) {
|
if (majorNodeVersion < 8 || majorNodeVersion >= 11) {
|
||||||
console.error('\033[1;31m*** Please use node >=8 and <9.\033[0;0m');
|
console.error('\033[1;31m*** Please use node >=8 and <11.\033[0;0m');
|
||||||
err = true;
|
err = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ var cson = require('cson-parser');
|
|||||||
var https = require('https');
|
var https = require('https');
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
|
|
||||||
|
let commitDate = '0000-00-00';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} urlString
|
* @param {string} urlString
|
||||||
*/
|
*/
|
||||||
@@ -120,8 +122,35 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
||||||
|
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
|
||||||
|
let promises = new Array();
|
||||||
|
const currentCommitDate = info.commitDate.substr(0, 10);
|
||||||
|
|
||||||
|
// Add commit sha to cgmanifest.
|
||||||
|
if (currentCommitDate > commitDate) {
|
||||||
|
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
||||||
|
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
||||||
|
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
||||||
|
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
||||||
|
commitDate = currentCommitDate;
|
||||||
|
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||||
|
if (packageJson) {
|
||||||
|
try {
|
||||||
|
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Cannot get version. File does not exist at ' + packageJsonPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Promise.all(promises).then(function (allResult) {
|
||||||
|
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
|
||||||
|
});
|
||||||
if (info) {
|
if (info) {
|
||||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
|
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')');
|
||||||
} else {
|
} else {
|
||||||
console.log('Updated ' + path.basename(dest));
|
console.log('Updated ' + path.basename(dest));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
"name": "azuredatastudio-oss-dev-build",
|
"name": "azuredatastudio-oss-dev-build",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/ansi-colors": "^3.2.0",
|
||||||
"@types/azure": "0.9.19",
|
"@types/azure": "0.9.19",
|
||||||
"@types/debounce": "^1.0.0",
|
"@types/debounce": "^1.0.0",
|
||||||
"@types/documentdb": "1.10.2",
|
"@types/documentdb": "1.10.2",
|
||||||
|
"@types/fancy-log": "^1.3.0",
|
||||||
"@types/glob": "^7.1.1",
|
"@types/glob": "^7.1.1",
|
||||||
"@types/gulp": "^4.0.5",
|
"@types/gulp": "^4.0.5",
|
||||||
"@types/gulp-concat": "^0.0.32",
|
"@types/gulp-concat": "^0.0.32",
|
||||||
@@ -13,7 +15,6 @@
|
|||||||
"@types/gulp-rename": "^0.0.33",
|
"@types/gulp-rename": "^0.0.33",
|
||||||
"@types/gulp-sourcemaps": "^0.0.32",
|
"@types/gulp-sourcemaps": "^0.0.32",
|
||||||
"@types/gulp-uglify": "^3.0.5",
|
"@types/gulp-uglify": "^3.0.5",
|
||||||
"@types/gulp-util": "^3.0.34",
|
|
||||||
"@types/mime": "0.0.29",
|
"@types/mime": "0.0.29",
|
||||||
"@types/minimatch": "^3.0.3",
|
"@types/minimatch": "^3.0.3",
|
||||||
"@types/minimist": "^1.2.0",
|
"@types/minimist": "^1.2.0",
|
||||||
@@ -42,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.1.4",
|
"typescript": "3.3.1",
|
||||||
"vsce": "1.48.0",
|
"vsce": "1.48.0",
|
||||||
"xml2js": "^0.4.17"
|
"xml2js": "^0.4.17"
|
||||||
},
|
},
|
||||||
|
|||||||
1756
build/yarn.lock
1756
build/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "chromium",
|
"name": "chromium",
|
||||||
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
|
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
|
||||||
"commitHash": "7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33"
|
"commitHash": "164c37e3f235134c88e80fac2a182cfba3f07f00"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
],
|
],
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"version": "61.0.3163.100"
|
"version": "66.0.3359.181"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -48,12 +48,12 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "libchromiumcontent",
|
"name": "libchromiumcontent",
|
||||||
"repositoryUrl": "https://github.com/electron/libchromiumcontent",
|
"repositoryUrl": "https://github.com/electron/libchromiumcontent",
|
||||||
"commitHash": "ccdb085454b0a387ee96e0f81a7ca9a8ce07a710"
|
"commitHash": "7ea271f92018b1eeb8e70ec6de8c29f9758a0c05"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "61.0.3163.100"
|
"version": "66.0.3359.181"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -61,11 +61,11 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "nodejs",
|
"name": "nodejs",
|
||||||
"repositoryUrl": "https://github.com/nodejs/node",
|
"repositoryUrl": "https://github.com/nodejs/node",
|
||||||
"commitHash": "8a44289089a08b7b19fa3c4651b5f1f5d1edd71b"
|
"commitHash": "5cbb905c1af7cea2d709932d59827d7c6d03ef4a"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"version": "8.9.3"
|
"version": "10.2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -73,12 +73,12 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"repositoryUrl": "https://github.com/electron/electron",
|
"repositoryUrl": "https://github.com/electron/electron",
|
||||||
"commitHash": "d281859cf59f12c7107a540a9f4cba0ecf5eff41"
|
"commitHash": "73158a6419a3e2da9e4d523e1131052abd28fbbb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "2.0.12"
|
"version": "3.1.6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -105,6 +105,30 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.14.0"
|
"version": "0.14.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"component": {
|
||||||
|
"type": "git",
|
||||||
|
"git": {
|
||||||
|
"name": "vscode-octicons-font",
|
||||||
|
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
|
||||||
|
"commitHash": "5095860bb929919670646e2dfa0ee47d9b93bcb9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"component": {
|
||||||
|
"type": "git",
|
||||||
|
"git": {
|
||||||
|
"name": "octicons",
|
||||||
|
"repositoryUrl": "https://github.com/primer/octicons",
|
||||||
|
"commitHash": "d120bf97bc9a12fb415f69fedaf31fe58427ca56"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "8.3.0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
@@ -493,6 +517,19 @@
|
|||||||
" defined by the Mozilla Public License, v. 2.0."
|
" defined by the Mozilla Public License, v. 2.0."
|
||||||
],
|
],
|
||||||
"license": "MPL"
|
"license": "MPL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"component": {
|
||||||
|
"type": "git",
|
||||||
|
"git": {
|
||||||
|
"name": "ripgrep",
|
||||||
|
"repositoryUrl": "https://github.com/BurntSushi/ripgrep",
|
||||||
|
"commitHash": "8a7db1a918e969b85cd933d8ed9fa5285b281ba4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"isOnlyProductionDependency": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "0.10.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": 1
|
"version": 1
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "admin-pack",
|
"name": "admin-pack",
|
||||||
"displayName": "Admin Pack for SQL Server",
|
"displayName": "Admin Pack for SQL Server",
|
||||||
"description": "",
|
"description": "",
|
||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "*",
|
"vscode": "*",
|
||||||
"azdata": "*"
|
"azdata": "*"
|
||||||
},
|
},
|
||||||
"extensionPack": [
|
"extensionPack": [
|
||||||
"Microsoft.agent",
|
"Microsoft.agent",
|
||||||
"Microsoft.profiler",
|
"Microsoft.profiler",
|
||||||
"Microsoft.import",
|
"Microsoft.import",
|
||||||
"Microsoft.dacpac"
|
"Microsoft.dacpac"
|
||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Microsoft/azuredatastudio/issues"
|
"url": "https://github.com/Microsoft/azuredatastudio/issues"
|
||||||
}
|
},
|
||||||
}
|
"__metadata": {
|
||||||
|
"id": "32",
|
||||||
|
"publisherDisplayName": "Microsoft",
|
||||||
|
"publisherId": "Microsoft"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
2
extensions/admin-tool-ext-win/.gitignore
vendored
Normal file
2
extensions/admin-tool-ext-win/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ssmsmin
|
||||||
|
*.vsix
|
||||||
5
extensions/admin-tool-ext-win/.vscodeignore
Normal file
5
extensions/admin-tool-ext-win/.vscodeignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
out/test/**
|
||||||
|
src/**
|
||||||
|
ssmsmin/**
|
||||||
|
.gitignore
|
||||||
|
tsconfig.json
|
||||||
17
extensions/admin-tool-ext-win/README.md
Normal file
17
extensions/admin-tool-ext-win/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Database Admin Tool Extensions for Windows
|
||||||
|
|
||||||
|
This adds Windows-specific functionality into Azure Data Studio.
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
## Privacy Statement
|
||||||
|
|
||||||
|
The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement) describes the privacy statement of this software.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt).
|
||||||
BIN
extensions/admin-tool-ext-win/images/sqlserver.png
Normal file
BIN
extensions/admin-tool-ext-win/images/sqlserver.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
61
extensions/admin-tool-ext-win/package.json
Normal file
61
extensions/admin-tool-ext-win/package.json
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"name": "admin-tool-ext-win",
|
||||||
|
"displayName": "Database Admin Tool Extensions for Windows",
|
||||||
|
"description": "Adds additional Windows-specific functionality to Azure Data Studio",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"publisher": "Microsoft",
|
||||||
|
"preview": true,
|
||||||
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||||
|
"icon": "images/sqlserver.png",
|
||||||
|
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||||
|
"engines": {
|
||||||
|
"vscode": "^1.30.1",
|
||||||
|
"sqlops": "*"
|
||||||
|
},
|
||||||
|
"activationEvents": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"main": "./out/main",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||||
|
},
|
||||||
|
"extensionDependencies": [
|
||||||
|
"Microsoft.mssql"
|
||||||
|
],
|
||||||
|
"contributes": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
||||||
|
"title": "%adminToolExtWin.launchSsmsServerPropertiesDialog%",
|
||||||
|
"category": "AdminToolExtWin"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"menus": {
|
||||||
|
"commandPalette": [
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
||||||
|
"when": "false"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objectExplorer/item/context": [
|
||||||
|
{
|
||||||
|
"command": "adminToolExtWin.launchSsmsServerPropertiesDialog",
|
||||||
|
"when": "isWindows && connectionProvider == MSSQL && nodeType && nodeType == Server",
|
||||||
|
"group": "AdminToolExtWin"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"outputChannels": [
|
||||||
|
"admin-tool-ext-win"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||||
|
"vscode-extension-telemetry": "^0.0.15",
|
||||||
|
"vscode-nls": "^3.2.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"vscode": "1.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
extensions/admin-tool-ext-win/package.nls.json
Normal file
3
extensions/admin-tool-ext-win/package.nls.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"adminToolExtWin.launchSsmsServerPropertiesDialog": "Properties"
|
||||||
|
}
|
||||||
12
extensions/admin-tool-ext-win/src/config.json
Normal file
12
extensions/admin-tool-ext-win/src/config.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}",
|
||||||
|
"version": "15.0.18092.0",
|
||||||
|
"downloadFileNames": {
|
||||||
|
"Windows_64": "SsmsMin-15.0.18092.0-win-x64.zip",
|
||||||
|
"Windows_86": "SsmsMin-15.0.18092.0-win-x86.zip"
|
||||||
|
},
|
||||||
|
"installDirectory": "ssmsmin/{#platform#}/{#version#}",
|
||||||
|
"executableFiles": [
|
||||||
|
"SsmsMin.exe"
|
||||||
|
]
|
||||||
|
}
|
||||||
157
extensions/admin-tool-ext-win/src/main.ts
Normal file
157
extensions/admin-tool-ext-win/src/main.ts
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 nls from 'vscode-nls';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as azdata from 'azdata';
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
import { IConfig, ServerProvider } from 'service-downloader';
|
||||||
|
import { Telemetry } from './telemetry';
|
||||||
|
import * as utils from './utils';
|
||||||
|
import { ChildProcess, exec, ExecException } from 'child_process';
|
||||||
|
import { stringify } from 'querystring';
|
||||||
|
|
||||||
|
const baseConfig = require('./config.json');
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
let exePath: string;
|
||||||
|
let runningProcesses: Map<number, ChildProcess> = new Map<number, ChildProcess>();
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
export interface LaunchSsmsDialogParams {
|
||||||
|
action: string;
|
||||||
|
server: string;
|
||||||
|
database?: string;
|
||||||
|
user?: string;
|
||||||
|
password?: string;
|
||||||
|
useAad?: boolean;
|
||||||
|
urn?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||||
|
// This is for Windows-specific support so do nothing on other platforms
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
Telemetry.sendTelemetryEvent('startup/ExtensionActivated');
|
||||||
|
|
||||||
|
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}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deactivate(): Promise<void> {
|
||||||
|
// 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
|
||||||
|
// they started off child processes of their own
|
||||||
|
runningProcesses.forEach(p => exec('taskkill /pid ' + p.pid + ' /T /F'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for command to launch SSMS Server Properties dialog
|
||||||
|
* @param connectionId The connection context from the command
|
||||||
|
*/
|
||||||
|
function handleLaunchSsmsServerPropertiesDialogCommand(connectionContext?: azdata.ObjectExplorerContext) {
|
||||||
|
if (connectionContext && connectionContext.connectionProfile) {
|
||||||
|
launchSsmsDialog(
|
||||||
|
/*action*/'sqla:Properties@Microsoft.SqlServer.Management.Smo.Server',
|
||||||
|
/*connectionProfile*/connectionContext.connectionProfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launches SsmsMin with parameters from the specified connection
|
||||||
|
* @param action The action to launch
|
||||||
|
* @param params The params used to construct the command
|
||||||
|
* @param urn The URN to pass to SsmsMin
|
||||||
|
*/
|
||||||
|
function launchSsmsDialog(action: string, connectionProfile: azdata.IConnectionProfile, urn?: string) {
|
||||||
|
if (!exePath) {
|
||||||
|
vscode.window.showErrorMessage(localize('adminToolExtWin.noExeError', 'Unable to find SsmsMin.exe.'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Telemetry.sendTelemetryEvent('LaunchSsmsDialog', { 'action': action });
|
||||||
|
|
||||||
|
let params: LaunchSsmsDialogParams = {
|
||||||
|
action: action,
|
||||||
|
server: connectionProfile.serverName,
|
||||||
|
database: connectionProfile.databaseName,
|
||||||
|
password: connectionProfile.password,
|
||||||
|
user: connectionProfile.userName,
|
||||||
|
useAad: connectionProfile.authenticationType === 'AzureMFA',
|
||||||
|
urn: urn
|
||||||
|
};
|
||||||
|
let args = buildSsmsMinCommandArgs(params);
|
||||||
|
|
||||||
|
// This will be an async call since we pass in the callback
|
||||||
|
var proc: ChildProcess = exec(
|
||||||
|
/*command*/`"${exePath}" ${args}`,
|
||||||
|
/*options*/undefined,
|
||||||
|
(execException, stdout, stderr) => {
|
||||||
|
// Process has exited so remove from map of running processes
|
||||||
|
runningProcesses.delete(proc.pid);
|
||||||
|
Telemetry.sendTelemetryEvent('LaunchSsmsDialogResult', {
|
||||||
|
'action': params.action,
|
||||||
|
'returnCode': execException && execException.code ? execException.code.toString() : '0'
|
||||||
|
});
|
||||||
|
let err = stderr.toString();
|
||||||
|
if (err !== '') {
|
||||||
|
console.warn(`Error calling SsmsMin with args '${args}' - ${err}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If we're not using AAD the tool prompts for a password on stdin
|
||||||
|
if (params.useAad !== true) {
|
||||||
|
proc.stdin.end(params.password ? params.password : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the process into our map so we can make sure to stop them if we exit before shutting down
|
||||||
|
runningProcesses.set(proc.pid, proc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the command arguments to pass to SsmsMin.exe. Values are expected to be escaped correctly
|
||||||
|
* already per their - they will be further escaped * for command-line usage but no additional
|
||||||
|
* escaping will occur.
|
||||||
|
* @param params The params used to build up the command parameter string
|
||||||
|
*/
|
||||||
|
export function buildSsmsMinCommandArgs(params: LaunchSsmsDialogParams): string {
|
||||||
|
return `${params.action ? '-a "' + params.action.replace(/"/g, '\\"') + '"' : ''}\
|
||||||
|
${params.server ? ' -S "' + params.server.replace(/"/g, '\\"') + '"' : ''}\
|
||||||
|
${params.database ? ' -D "' + params.database.replace(/"/g, '\\"') + '"' : ''}\
|
||||||
|
${params.useAad !== true && params.user ? ' -U "' + params.user.replace(/"/g, '\\"') + '"' : ''}\
|
||||||
|
${params.useAad === true ? ' -G' : ''}\
|
||||||
|
${params.urn ? ' -u "' + params.urn.replace(/"/g, '\\"') + '"' : ''}`;
|
||||||
|
}
|
||||||
135
extensions/admin-tool-ext-win/src/telemetry.ts
Normal file
135
extensions/admin-tool-ext-win/src/telemetry.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 vscode from 'vscode';
|
||||||
|
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||||
|
import { PlatformInformation } from 'service-downloader/out/platform';
|
||||||
|
|
||||||
|
import * as Utils from './utils';
|
||||||
|
|
||||||
|
const packageJson = require('../package.json');
|
||||||
|
|
||||||
|
export interface ITelemetryEventProperties {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITelemetryEventMeasures {
|
||||||
|
[key: string]: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters error paths to only include source files. Exported to support testing
|
||||||
|
*/
|
||||||
|
export function filterErrorPath(line: string): string {
|
||||||
|
if (line) {
|
||||||
|
let values: string[] = line.split('/out/');
|
||||||
|
if (values.length <= 1) {
|
||||||
|
// Didn't match expected format
|
||||||
|
return line;
|
||||||
|
} else {
|
||||||
|
return values[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Telemetry {
|
||||||
|
private static reporter: TelemetryReporter;
|
||||||
|
private static userId: string;
|
||||||
|
private static platformInformation: PlatformInformation;
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
public static disable(): void {
|
||||||
|
this.disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the telemetry reporter for use.
|
||||||
|
*/
|
||||||
|
public static initialize(): void {
|
||||||
|
if (typeof this.reporter === 'undefined') {
|
||||||
|
// Check if the user has opted out of telemetry
|
||||||
|
if (!vscode.workspace.getConfiguration('telemetry').get<boolean>('enableTelemetry', true)) {
|
||||||
|
this.disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let packageInfo = Utils.getPackageInfo(packageJson);
|
||||||
|
this.reporter = new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a telemetry event for an exception
|
||||||
|
*/
|
||||||
|
public static sendTelemetryEventForException(
|
||||||
|
err: any, methodName: string, extensionConfigName: string): void {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a telemetry event using application insights
|
||||||
|
*/
|
||||||
|
public static sendTelemetryEvent(
|
||||||
|
eventName: string,
|
||||||
|
properties?: ITelemetryEventProperties,
|
||||||
|
measures?: ITelemetryEventMeasures): void {
|
||||||
|
|
||||||
|
if (typeof this.disabled === 'undefined') {
|
||||||
|
this.disabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disabled || typeof (this.reporter) === 'undefined') {
|
||||||
|
// Don't do anything if telemetry is disabled
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!properties || typeof properties === 'undefined') {
|
||||||
|
properties = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Augment the properties structure with additional common properties before sending
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Telemetry.initialize();
|
||||||
30
extensions/admin-tool-ext-win/src/test/index.ts
Normal file
30
extensions/admin-tool-ext-win/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 = 'Database Admin Tool Extensions for Windows';
|
||||||
|
|
||||||
|
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;
|
||||||
67
extensions/admin-tool-ext-win/src/test/utils.test.ts
Normal file
67
extensions/admin-tool-ext-win/src/test/utils.test.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 'mocha';
|
||||||
|
|
||||||
|
import * as extensionMain from '../main';
|
||||||
|
|
||||||
|
describe('buildSsmsMinCommandArgs Method Tests', () => {
|
||||||
|
it('Should be built correctly with all params and UseAAD as false', function (): void {
|
||||||
|
let params: extensionMain.LaunchSsmsDialogParams = {
|
||||||
|
action: 'myAction',
|
||||||
|
server: 'myServer',
|
||||||
|
database: 'myDatabase',
|
||||||
|
user: 'user',
|
||||||
|
password: 'password',
|
||||||
|
useAad: false,
|
||||||
|
urn: 'Server\\Database\\Table'
|
||||||
|
};
|
||||||
|
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
||||||
|
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 {
|
||||||
|
let params: extensionMain.LaunchSsmsDialogParams = {
|
||||||
|
action: 'myAction',
|
||||||
|
server: 'myServer',
|
||||||
|
database: 'myDatabase',
|
||||||
|
user: 'user',
|
||||||
|
password: 'password',
|
||||||
|
useAad: true,
|
||||||
|
urn: 'Server\\Database\\Table'
|
||||||
|
};
|
||||||
|
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
||||||
|
// User is omitted since UseAAD is true
|
||||||
|
should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -G -u "Server\\Database\\Table"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be built correctly and names escaped correctly', function (): void {
|
||||||
|
let params: extensionMain.LaunchSsmsDialogParams = {
|
||||||
|
action: 'myAction\'"/\\[]tricky',
|
||||||
|
server: 'myServer\'"/\\[]tricky',
|
||||||
|
database: 'myDatabase\'"/\\[]tricky',
|
||||||
|
user: 'user\'"/\\[]tricky',
|
||||||
|
password: 'password',
|
||||||
|
useAad: true,
|
||||||
|
urn: 'Server\\Database[\'myDatabase\'\'"/\\[]tricky\']\\Table["myTable\'""/\\[]tricky"]'
|
||||||
|
};
|
||||||
|
let args = extensionMain.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\\"]"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be built correctly with only action and server', function (): void {
|
||||||
|
|
||||||
|
let params: extensionMain.LaunchSsmsDialogParams = {
|
||||||
|
action: 'myAction',
|
||||||
|
server: 'myServer'
|
||||||
|
};
|
||||||
|
let args = extensionMain.buildSsmsMinCommandArgs(params);
|
||||||
|
should(args).equal('-a "myAction" -S "myServer"');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,11 +3,7 @@
|
|||||||
* 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 * as assert from 'assert';
|
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||||
|
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||||
suite('Editor groups service', () => {
|
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||||
test('groups basics', function () {
|
/// <reference types='@types/node'/>
|
||||||
// {{SQL CARBON EDIT}} - Remove test
|
|
||||||
assert.equal(0, 0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
42
extensions/admin-tool-ext-win/src/utils.ts
Normal file
42
extensions/admin-tool-ext-win/src/utils.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 vscode from 'vscode';
|
||||||
|
|
||||||
|
export interface IPackageInfo {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
aiKey: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPackageInfo(packageJson: any): IPackageInfo {
|
||||||
|
if (packageJson) {
|
||||||
|
return {
|
||||||
|
name: packageJson.name,
|
||||||
|
version: packageJson.version,
|
||||||
|
aiKey: packageJson.aiKey
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the configuration for a extensionName
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
|
export function getConfiguration(extensionName?: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration {
|
||||||
|
if (typeof resource === 'string') {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri);
|
||||||
|
}
|
||||||
22
extensions/admin-tool-ext-win/tsconfig.json
Normal file
22
extensions/admin-tool-ext-win/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"compileOnSave": true,
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es6",
|
||||||
|
"outDir": "./out",
|
||||||
|
"lib": [
|
||||||
|
"es6", "es2015.promise"
|
||||||
|
],
|
||||||
|
"typeRoots": [
|
||||||
|
"./node_modules/@types"
|
||||||
|
],
|
||||||
|
"sourceMap": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"declaration": true
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
||||||
2626
extensions/admin-tool-ext-win/yarn.lock
Normal file
2626
extensions/admin-tool-ext-win/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user