Compare commits

..

19 Commits

Author SHA1 Message Date
Anthony Dresser
e57eb999fc Revert "Revert "fix ctrl+tab keybinding"" (#9121)
This reverts commit 99af31fa1f.
2020-02-11 16:01:53 -08:00
Anthony Dresser
99af31fa1f Revert "fix ctrl+tab keybinding"
This reverts commit e2990db33e.
2020-02-11 14:55:16 -08:00
Anthony Dresser
e2990db33e fix ctrl+tab keybinding 2020-02-11 14:53:59 -08:00
Alan Ren
b2238dc37b fix charting issue (#9094)
* fix charting issue

* fix charting issue 2

* revert version bump

(cherry picked from commit 8c61538a27)
2020-02-08 17:45:32 -08:00
Amir Omidi
6770bf877e ok button targetted fix (#9095) 2020-02-07 17:17:58 -08:00
Amir Omidi
ba66305bb5 Add device code authentication (#9097)
* Add device code authentication

* Change string
2020-02-07 17:15:08 -08:00
Charles Gagnon
8e731c75c3 Remove quality checks for events (#8934)
* Remove quality checks for events

* Update iKey

* Add missed quality check

(cherry picked from commit ec0a7a29d3)
2020-02-07 14:48:23 -08:00
Alex Ma
db0409569a made changes (#9092) 2020-02-07 14:31:53 -08:00
Amir Omidi
fb4ab6b501 Show error to user (#9014)
* Show error to user

* Update the errors

* change message

(cherry picked from commit df3f1768f7)
2020-02-07 14:15:02 -08:00
Amir Omidi
bd1d96a57a Amir/target/notarization (#9082)
* runtime hardening

* Notarization

* Fix the parameters

* Update sql-product-build-darwin.yml

* Format

* Change task name

* Remove the array

* Support new format

* Use new format for notarizing too

* Change timeouts to accommodate how long apple takes

* Change timeout in minutes to 2 hours

* Update sql-product-build-darwin.yml

* Increase timeouts

* Change the pipeline

* Fix formatting

* Fix formatting

* Fix formatting

* Fix formatting

* Change path

* Fix path for cleanup

* Don't do hardening

* Enable hardening again

* Self sign

* add display name

* Change key identity

* Deep codesign

* Fix path

* add extras

* add hardening back

* use ditto instead of zip per apple docs

* Changing signing syntax

* Don't deep sign

* Use --deep and add new entitlement

* Temporarily disable notarization

* entitlements fix

* Don't do runtime hardening for self sign

* Will this fix codesign I wonder

* codesigning

* sign everything first

* Change signing to delete bad files

* remove xattr

* Change the find command

* Delete mssql and big-data-cluster

* Stablize the signing

* Bring in notarization changes
2020-02-07 13:08:21 -08:00
Amir Omidi
6fe49e8cef Targeted fix for saving issue on MacOS (#9073)
* Create a targeted fix

* Add sql carbon edit
2020-02-06 16:22:21 -08:00
Alex Ma
6da98ed439 disable updateNameFromFirstLine from untitledTextEditorModel (#9064)
* disable updateNameFromFirstLine

* change to either

* WIP commit

* final fix

* formatting

* fix for tab space

* replace tab with space

* Fix formatting

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2020-02-06 14:09:45 -08:00
Chris LaFreniere
5ef69f5133 BDC: Add another command for bdc extension activation events (#9050)
* Add another command for bdc extension activation

* spaces

* Add other activation events

* spacing

(cherry picked from commit 8e67b104c3)
2020-02-05 16:05:49 -08:00
Alex Ma
ebf47df35e removed unnecessary formatting (#9045) 2020-02-04 14:01:42 -08:00
Amir Omidi
2a93d7c5e9 Move files locations (#9015) (#9044)
* Move files locations

* Extension path

(cherry picked from commit c6689700f6)
2020-02-04 13:42:06 -08:00
Chris LaFreniere
573c5b4470 Books: Ensure associatedResource is Present for Untitled Notebooks that have a File Associated with them (#9037)
* Conditionally add associatedResource t untitled nb

* Fix Jupyter Book notebook titles (#9039)

* Fix notebook titles

* Fix navigation links for books

* Added comments

Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com>

* PR comment nit

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
(cherry picked from commit 2208666eef)
2020-02-04 11:49:01 -08:00
Karl Burtram
41838b7720 Import "fromPromise" so Observables work correctly (#9034) (#9042)
* Import "fromPromise" so Observables work correctly

* Bump distro guid

* Fix unit test missing file error

* Bump distro to pick up latest changes
2020-02-04 11:40:26 -08:00
Charles Gagnon
ee1359fd7c Even more robust handling of extension tree loading (#9007)
* Even more robust handling of extension tree loading

* Fix initial loading and add new test for CMS

* Fix compile errors

* Fix logic

* Remove debug log statements

(cherry picked from commit 62df5359e2)
2020-02-04 08:05:08 -08:00
Alex Ma
189bcf703e Fix for table name not showing up on the header. (#9016)
* fix for edit data table header

* Fix for name, and SQL load

(cherry picked from commit 5b2c14f11a)
2020-01-31 14:32:27 -08:00
3162 changed files with 94469 additions and 216967 deletions

View File

@@ -1,17 +0,0 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"file": "src\\vs\\base\\test\\common\\uri.test.ts",
"_justification": "External code"
},
{
"file": "build\\actions\\AutoLabel\\dist\\index.js",
"_justification": "False positive from webpacked code"
},
{
"file": "build\\actions\\AutoMerge\\dist\\index.js",
"_justification": "False positive from webpacked code"
}
]
}

View File

@@ -3,6 +3,7 @@
**/vs/css.build.js **/vs/css.build.js
**/vs/css.js **/vs/css.js
**/vs/loader.js **/vs/loader.js
**/promise-polyfill/**
**/insane/** **/insane/**
**/marked/** **/marked/**
**/test/**/*.js **/test/**/*.js

File diff suppressed because it is too large Load Diff

7
.eslintrc.sql.json Normal file
View File

@@ -0,0 +1,7 @@
{
"extends": ".eslintrc.json",
"rules": {
"no-sync": "warn",
"strict": ["warn", "never"]
}
}

View File

@@ -1,20 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": "./tsconfig.sql.json"
},
"plugins": [
"@typescript-eslint",
"jsdoc"
],
"rules": {
"@typescript-eslint/no-floating-promises": [
"error",
{
"ignoreVoid": true
}
]
}
}

View File

@@ -6,7 +6,6 @@ labels: ''
assignees: '' assignees: ''
--- ---
<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ --> <!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. --> <!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed. --> <!-- Also please test using the latest insiders build to make sure your issue has not already been fixed. -->

View File

@@ -1,11 +1,12 @@
{ {
perform: true, perform: false,
commands: [ commands: [
{ {
type: 'label', type: 'label',
name: 'Needs Logs', name: 'duplicate',
action: 'comment', allowTriggerByBot: true,
comment: "We need more info to debug your particular issue. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.\n\nTo find your logs:\n\n- Open command palette (Click **View** -> **Command Palette**)\n- Run the command: **`Developer: Open Logs Folder`**\n\nThis will open the log file locally. Please include renderer.log" action: 'close',
comment: "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues [here](https://aka.ms/vscodeissuesearch). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
} }
] ]
} }

34
.github/feature-requests.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
{
typeLabel: {
name: 'feature-request'
},
candidateMilestone: {
number: 107,
name: 'Backlog Candidates'
},
approvedMilestone: {
number: 8,
name: 'Backlog'
},
onLabeled: {
delay: 60,
perform: true
},
onCandidateMilestoned: {
candidatesComment: "This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
perform: true
},
onMonitorUpvotes: {
upvoteThreshold: 20,
acceptanceComment: ":slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
perform: true
},
onMonitorDaysOnCandidateMilestone: {
daysOnMilestone: 60,
warningPeriod: 10,
numberOfCommentsToPreventAutomaticRejection: 20,
rejectionComment: ":slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
warningComment: "This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding",
perform: true
}
}

View File

@@ -1,7 +0,0 @@
[
"kenvanhyning",
"kburtram",
"udeeshagautam",
"qifahs",
"chlafreniere"
]

6
.github/new_release.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
{
newReleaseLabel: 'new-release',
newReleaseColor: '006b75',
daysAfterRelease: 5,
perform: true
}

View File

@@ -2,74 +2,55 @@ name: CI
on: on:
push: push:
branches-ignore: branches:
- '**' - master
# push: - release/*
# branches: pull_request:
# - master branches:
# - release/* - master
# pull_request: - release/*
# branches:
# - master
# - release/*
jobs: jobs:
linux: # linux:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
env: # env:
CHILD_CONCURRENCY: "1" # CHILD_CONCURRENCY: "1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: # steps:
- uses: actions/checkout@v1 # - uses: actions/checkout@v1
# TODO: rename azure-pipelines/linux/xvfb.init to github-actions # # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
- run: | # - run: |
sudo apt-get update # sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libkrb5-dev # {{SQL CARBON EDIT}} add kerberos dep # sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libkrb5-dev # {{SQL CARBON EDIT}} add kerberos dep
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
name: Setup Build Environment # name: Setup Build Environment
- uses: actions/setup-node@v1 # - uses: actions/setup-node@v1
with: # with:
node-version: 10 # node-version: 10
# TODO: cache node modules # # TODO: cache node modules
- run: yarn --frozen-lockfile # - run: yarn --frozen-lockfile
name: Install Dependencies # name: Install Dependencies
- run: yarn electron x64 # - run: yarn electron x64
name: Download Electron # name: Download Electron
- run: yarn gulp hygiene # - run: yarn gulp hygiene
name: Run Hygiene Checks # name: Run Hygiene Checks
- run: yarn strict-vscode # {{SQL CARBON EDIT}} add step # - run: yarn strict-vscode # {{SQL CARBON EDIT}} add step
name: Run Strict Compile Options # name: Run Strict Compile Options
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step # # - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
# name: Run Monaco Editor Checks # # name: Run Monaco Editor Checks
- run: yarn valid-layers-check # - run: yarn valid-layers-check
name: Run Valid Layers Checks # name: Run Valid Layers Checks
- run: yarn compile # - run: yarn compile
name: Compile Sources # name: Compile Sources
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step # # - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions # # name: Download Built-in Extensions
- run: DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests" --coverage --runGlob "**/sql/**/*.test.js" # - run: DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
name: Run Unit Tests (Electron) # name: Run Unit Tests
- run: DISPLAY=:10 ./scripts/test-extensions-unit.sh # # - run: DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
name: Run Extension Unit Tests (Electron) # # name: Run Integration Tests
# {{SQL CARBON EDIT}} Add coveralls. We merge first to get around issue where parallel builds weren't being combined correctly
- run: |
mkdir .build/coverage-combined
cat .build/coverage-single/lcov.info ./extensions/admin-tool-ext-win/coverage/lcov.info ./extensions/agent/coverage/lcov.info ./extensions/azurecore/coverage/lcov.info ./extensions/cms/coverage/lcov.info ./extensions/dacpac/coverage/lcov.info ./extensions/schema-compare/coverage/lcov.info ./extensions/notebook/coverage/lcov.info ./extensions/resource-deployment/coverage/lcov.info ./extensions/machine-learning-services/coverage/lcov.info > .build/coverage-combined/lcov.info
name: Merge coverage reports
- name: Upload Code Coverage
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: '.build/coverage-combined/lcov.info'
# Fails with cryptic error (e.g. https://github.com/microsoft/vscode/pull/90292/checks?check_run_id=433681926#step:13:9)
# - run: DISPLAY=:10 yarn test-browser --browser chromium
# name: Run Unit Tests (Browser)
# - run: DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Integration Tests (Electron)
windows: windows:
runs-on: windows-2016 runs-on: windows-2016
@@ -101,11 +82,9 @@ jobs:
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step # - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions # name: Download Built-in Extensions
- run: .\scripts\test.bat --tfs "Unit Tests" - run: .\scripts\test.bat --tfs "Unit Tests"
name: Run Unit Tests (Electron) name: Run Unit Tests
# - run: yarn test-browser --browser chromium {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
# name: Run Unit Tests (Browser)
# - run: .\scripts\test-integration.bat --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step # - run: .\scripts\test-integration.bat --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Integration Tests (Electron) # name: Run Integration Tests
darwin: darwin:
runs-on: macos-latest runs-on: macos-latest
@@ -134,34 +113,6 @@ jobs:
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step # - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
# name: Download Built-in Extensions # name: Download Built-in Extensions
- run: ./scripts/test.sh --tfs "Unit Tests" - run: ./scripts/test.sh --tfs "Unit Tests"
name: Run Unit Tests (Electron) name: Run Unit Tests
# - run: yarn test-browser --browser chromium --browser webkit # - run: ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
# name: Run Unit Tests (Browser) # name: Run Integration Tests
# - run: ./scripts/test-integration.sh --tfs "Integration Tests"
# name: Run Integration Tests (Electron)
# monaco:
# runs-on: ubuntu-latest
# env:
# CHILD_CONCURRENCY: "1"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v1
# # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
# - run: |
# sudo apt-get update
# sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
# sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
# sudo chmod +x /etc/init.d/xvfb
# sudo update-rc.d xvfb defaults
# sudo service xvfb start
# name: Setup Build Environment
# - uses: actions/setup-node@v1
# with:
# node-version: 10
# - run: yarn --frozen-lockfile
# name: Install Dependencies
# - run: yarn monaco-compile-check
# name: Run Monaco Editor Checks
# - run: yarn gulp editor-esm-bundle
# name: Editor Distro & ESM Bundle

View File

@@ -1,16 +0,0 @@
name: AutoMerger
on:
issue_comment:
types: [created]
jobs:
release_labeler:
name: Auto Merger
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- uses: ./build/actions/AutoMerge
env:
GITHUB_TOKEN: "${{ secrets.GithubMerger }}"

View File

@@ -1,19 +0,0 @@
name: Port Request Labeler
on:
pull_request:
branches:
- release/**
jobs:
release_labeler:
name: Release labeler
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- uses: ./build/actions/AutoLabel
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
label: "Port Request"

1
.gitignore vendored
View File

@@ -11,7 +11,6 @@ out-editor/
out-editor-src/ out-editor-src/
out-editor-build/ out-editor-build/
out-editor-esm/ out-editor-esm/
out-editor-esm-bundle/
out-editor-min/ out-editor-min/
out-monaco-editor-core/ out-monaco-editor-core/
out-vscode/ out-vscode/

9
.vscode/launch.json vendored
View File

@@ -16,6 +16,8 @@
"request": "attach", "request": "attach",
"name": "Attach to Extension Host", "name": "Attach to Extension Host",
"port": 5870, "port": 5870,
"timeout": 30000,
"restart": true,
"outFiles": [ "outFiles": [
"${workspaceFolder}/out/**/*.js" "${workspaceFolder}/out/**/*.js"
] ]
@@ -92,11 +94,8 @@
], ],
"webRoot": "${workspaceFolder}", "webRoot": "${workspaceFolder}",
// Settings for js-debug: // Settings for js-debug:
"userDataDir": false,
"pauseForSourceMap": false, "pauseForSourceMap": false,
"outFiles": [ "outFiles": ["${workspaceFolder}/out/**/*.js"],
"${workspaceFolder}/out/**/*.js"
],
}, },
{ {
"type": "node", "type": "node",
@@ -198,7 +197,7 @@
"type": "node", "type": "node",
"request": "launch", "request": "launch",
"name": "Run Unit Tests", "name": "Run Unit Tests",
"program": "${workspaceFolder}/test/unit/electron/index.js", "program": "${workspaceFolder}/test/electron/index.js",
"runtimeExecutable": "${workspaceFolder}/.build/electron/Azure Data Studio.app/Contents/MacOS/Electron", "runtimeExecutable": "${workspaceFolder}/.build/electron/Azure Data Studio.app/Contents/MacOS/Electron",
"windows": { "windows": {
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio.exe" "runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio.exe"

View File

@@ -1,63 +0,0 @@
# Query: @deprecated ES6
# Flags: CaseSensitive WordMatch
# ContextLines: 2
9 results - 4 files
src/vs/base/common/arrays.ts:
401
402 /**
403: * @deprecated ES6: use `Array.findIndex`
404 */
405 export function firstIndex<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): number {
417
418 /**
419: * @deprecated ES6: use `Array.find`
420 */
421 export function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;
560
561 /**
562: * @deprecated ES6: use `Array.find`
563 */
564 export function find<T>(arr: ArrayLike<T>, predicate: (value: T, index: number, arr: ArrayLike<T>) => any): T | undefined {
src/vs/base/common/map.ts:
9
10 /**
11: * @deprecated ES6: use `[...SetOrMap.values()]`
12 */
13 export function values<V = any>(set: Set<V>): V[];
20
21 /**
22: * @deprecated ES6: use `[...map.keys()]`
23 */
24 export function keys<K, V>(map: Map<K, V>): K[] {
src/vs/base/common/objects.ts:
115
116 /**
117: * @deprecated ES6
118 */
119 export function assign<T>(destination: T): T;
src/vs/base/common/strings.ts:
15
16 /**
17: * @deprecated ES6: use `String.padStart`
18 */
19 export function pad(n: number, l: number, char: string = '0'): string {
146
147 /**
148: * @deprecated ES6: use `String.startsWith`
149 */
150 export function startsWith(haystack: string, needle: string): boolean {
167
168 /**
169: * @deprecated ES6: use `String.endsWith`
170 */
171 export function endsWith(haystack: string, needle: string): boolean {

View File

@@ -1,6 +1,7 @@
# Query: \\w+\\?\\..+![(.[] # Query: \\w+\\?\\..+![(.[]
# Flags: RegExp # Flags: RegExp
# ContextLines: 2 # ContextLines: 2
src/vs/base/browser/ui/tree/asyncDataTree.ts: src/vs/base/browser/ui/tree/asyncDataTree.ts:
270 } : undefined, 270 } : undefined,
271 isChecked: options.ariaProvider!.isChecked ? (e) => { 271 isChecked: options.ariaProvider!.isChecked ? (e) => {

View File

@@ -22,8 +22,6 @@
"i18n/**": true, "i18n/**": true,
"extensions/**/out/**": true, "extensions/**/out/**": true,
"test/smoke/out/**": true, "test/smoke/out/**": true,
"test/automation/out/**": true,
"test/integration/browser/out/**": true,
"src/vs/base/test/node/uri.test.data.txt": true "src/vs/base/test/node/uri.test.data.txt": true
}, },
"lcov.path": [ "lcov.path": [
@@ -69,8 +67,5 @@
"msjsdiag.debugger-for-chrome": "workspace" "msjsdiag.debugger-for-chrome": "workspace"
}, },
"gulp.autoDetect": "off", "gulp.autoDetect": "off",
"files.insertFinalNewline": true, "files.insertFinalNewline": true
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
} }

14
.vscode/tasks.json vendored
View File

@@ -31,6 +31,20 @@
} }
} }
}, },
{
"type": "npm",
"script": "strict-function-types-watch",
"label": "TS - Strict Function Types",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"problemMatcher": {
"base": "$tsc-watch",
"owner": "typescript-function-types",
"applyTo": "allDocuments"
}
},
{ {
"type": "npm", "type": "npm",
"script": "strict-vscode-watch", "script": "strict-vscode-watch",

View File

@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron" disturl "https://atom.io/download/electron"
target "7.1.11" target "6.1.6"
runtime "electron" runtime "electron"

View File

@@ -1,31 +1,5 @@
# Change Log # Change Log
## Version 1.16.0
* Release date: March 18, 2020
* Release status: General Availability
* Notebooks:
* Charting
* Creating Jupyter books
* Postgres extension update - Users can now authenticate to Azure Postgres servers with their linked Azure account
* Accessibility bugs
* VS Code merge
* In the next release, GitHub releases will no longer contain the binary files to the latest version. Rather, they will contain links to the latest release. This will have no impact on users using the in-app update functionality.
## Version 1.15.1
* Release date: February 19, 2020
* Release status: General Availability
* Resolved [#9145 Edit Data render the result grid incorrectly when using custom query](https://github.com/microsoft/azuredatastudio/issues/9145).
* Resolved [#9149 Show Active Connections](https://github.com/microsoft/azuredatastudio/issues/9149).
## Version 1.15.0
* Release date: February 13, 2020
* Release status: General Availability
* New Azure Sign-in improvement - Added improved Azure Sign-in experience, including removal of copy/paste of device code to make a more seamless connected experience.
* Find in Notebook support - Users can now use Ctrl+F inside of a notebook. Find in Notebook support searches line by line through both code and text cells.
* VS Code merge from 1.38 to 1.42 - This release includes updates to VS Code from the 3 previous VS Code releases. Read their [release notes](https://code.visualstudio.com/updates/v1_42) to learn more.
* Fix for the ["white/blank screen"](https://github.com/microsoft/azuredatastudio/issues/8775) issue reported by many users.
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/issues?q=is%3Aissue+label%3ABug+milestone%3A%22February+2020%22+is%3Aclosed).
## Version 1.14.1 ## Version 1.14.1
* Release date: December 26, 2019 * Release date: December 26, 2019
* Release status: General Availability * Release status: General Availability

View File

@@ -8,16 +8,15 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
## **Download the latest Azure Data Studio release** ## **Download the latest Azure Data Studio release**
| Platform | Platform | Link
| --------------------------------------- | -- | --
| [Windows User Installer][win-user] | Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2113530
| [Windows System Installer][win-system] | Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2113628
| [Windows ZIP][win-zip] | Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2113529
| [macOS ZIP][osx-zip] | macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2113528
| [Linux TAR.GZ][linux-zip] | Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2113627
| [Linux RPM][linux-rpm] | Linux RPM | https://go.microsoft.com/fwlink/?linkid=2113718
| [Linux DEB][linux-deb] | Linux DEB | https://go.microsoft.com/fwlink/?linkid=2113344
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.
@@ -141,11 +140,3 @@ And of course, we'd like to thank the authors of all upstream dependencies. Ple
Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the [Source EULA](LICENSE.txt). Licensed under the [Source EULA](LICENSE.txt).
[win-user]: https://go.microsoft.com/fwlink/?linkid=2121609
[win-system]: https://go.microsoft.com/fwlink/?linkid=2121612
[win-zip]: https://go.microsoft.com/fwlink/?linkid=2121511
[osx-zip]: https://go.microsoft.com/fwlink/?linkid=2121611
[linux-zip]: https://go.microsoft.com/fwlink/?linkid=2121510
[linux-rpm]: https://go.microsoft.com/fwlink/?linkid=2121613
[linux-deb]: https://go.microsoft.com/fwlink/?linkid=2121610

View File

@@ -12,7 +12,6 @@ expressly granted herein, whether by implication, estoppel or otherwise.
angular2-grid: https://github.com/BTMorton/angular2-grid angular2-grid: https://github.com/BTMorton/angular2-grid
angular2-slickgrid: https://github.com/Microsoft/angular2-slickgrid angular2-slickgrid: https://github.com/Microsoft/angular2-slickgrid
applicationinsights: https://github.com/Microsoft/ApplicationInsights-node.js applicationinsights: https://github.com/Microsoft/ApplicationInsights-node.js
axios: https://github.com/axios/axios
bootstrap: https://github.com/twbs/bootstrap bootstrap: https://github.com/twbs/bootstrap
chart.js: https://github.com/Timer/chartjs chart.js: https://github.com/Timer/chartjs
chokidar: https://github.com/paulmillr/chokidar chokidar: https://github.com/paulmillr/chokidar
@@ -39,7 +38,6 @@ expressly granted herein, whether by implication, estoppel or otherwise.
jschardet: https://github.com/aadsm/jschardet jschardet: https://github.com/aadsm/jschardet
jupyter-powershell: https://github.com/vors/jupyter-powershell jupyter-powershell: https://github.com/vors/jupyter-powershell
JupyterLab: https://github.com/jupyterlab/jupyterlab JupyterLab: https://github.com/jupyterlab/jupyterlab
keytar: https://github.com/atom/node-keytar
make-error: https://github.com/JsCommunity/make-error make-error: https://github.com/JsCommunity/make-error
minimist: https://github.com/substack/minimist minimist: https://github.com/substack/minimist
moment: https://github.com/moment/moment moment: https://github.com/moment/moment
@@ -52,7 +50,6 @@ expressly granted herein, whether by implication, estoppel or otherwise.
primeng: https://github.com/primefaces/primeng primeng: https://github.com/primefaces/primeng
process-nextick-args: https://github.com/calvinmetcalf/process-nextick-args process-nextick-args: https://github.com/calvinmetcalf/process-nextick-args
pty.js: https://github.com/chjj/pty.js pty.js: https://github.com/chjj/pty.js
qs: https://github.com/ljharb/qs
reflect-metadata: https://github.com/rbuckton/reflect-metadata reflect-metadata: https://github.com/rbuckton/reflect-metadata
request: https://github.com/request/request request: https://github.com/request/request
rxjs: https://github.com/ReactiveX/RxJS rxjs: https://github.com/ReactiveX/RxJS

View File

@@ -108,8 +108,6 @@ jquery-ui/demos/**
slickgrid/node_modules/** slickgrid/node_modules/**
slickgrid/examples/** slickgrid/examples/**
kerberos/build/**
# END SQL Modules # END SQL Modules
nsfw/binding.gyp nsfw/binding.gyp

View File

@@ -1,17 +0,0 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}

View File

@@ -1,98 +0,0 @@
# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# react / gatsby
public/
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# End of https://www.gitignore.io/api/node

View File

@@ -1,9 +0,0 @@
name: 'Auto Labeler'
description: 'Automatically add a label to a PR'
author: 'aaomidi'
inputs:
token:
description: 'The GITHUB_TOKEN secret'
runs:
using: 'node12'
main: 'dist/index.js'

View File

@@ -1 +0,0 @@
export {};

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
{
"name": "auto-merge",
"version": "1.0.0",
"main": "src/index.js",
"repository": "git@github.com:aaomidi/AutoLabel.git",
"author": "Amir Omidi <amir@aaomidi.com>",
"license": "MIT",
"scripts": {
"package": "ncc build src/index.ts -o dist",
"lint": "eslint src/index.js"
},
"devDependencies": {
"@types/node": "^12.11.1",
"@zeit/ncc": "^0.21.1",
"eslint": "^6.8.0",
"typescript": "^3.8.3"
},
"dependencies": {
"@actions/core": "^1.1.3",
"@actions/github": "^1.1.0",
"@octokit/rest": "^16.33.1",
"actions-toolkit": "^3.0.1"
}
}

View File

@@ -1,37 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Toolkit } from 'actions-toolkit';
const tools = new Toolkit({
event: 'pull_request',
secrets: ['GITHUB_TOKEN']
});
const label = tools.inputs.label || 'Port Request';
async function run() {
try {
let prNumber = tools.context.payload?.pull_request?.number;
if (prNumber === undefined) {
console.error('PR Number was undefined');
tools.log.error('PR Number was undefined');
return;
}
tools.github.issues.addLabels({
...tools.context.repo,
labels: [label],
issue_number: prNumber
});
} catch (ex) {
console.error(ex);
tools.log.error(ex);
}
}
run();

View File

@@ -1,76 +0,0 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es6",
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs",
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true,
/* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true,
/* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "out",
/* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true,
/* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true,
/* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true,
/* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": ["node"],
"skipLibCheck": true,
/* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true,
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": [
"./src/**/*.ts"
],
"exclude": [
"node_modules"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}

View File

@@ -1,100 +0,0 @@
# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# react / gatsby
public/
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# End of https://www.gitignore.io/api/node
out/

View File

@@ -1,6 +0,0 @@
name: 'Auto Merge'
description: 'Automatically merges a PR based on command'
author: 'aaomidi'
runs:
using: 'node12'
main: 'dist/index.js'

View File

@@ -1 +0,0 @@
export {};

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
{
"name": "auto-merge",
"version": "1.0.0",
"main": "src/index.js",
"repository": "git@github.com:aaomidi/AutoMerge.git",
"author": "Amir Omidi <amir@aaomidi.com>",
"license": "MIT",
"scripts": {
"package": "ncc build src/index.ts -o dist",
"lint": "eslint src/index.js"
},
"devDependencies": {
"@types/node": "^12.11.1",
"@zeit/ncc": "^0.21.1",
"eslint": "^6.8.0",
"typescript": "^3.8.3"
},
"dependencies": {
"@actions/core": "^1.1.3",
"@actions/github": "^1.1.0",
"@octokit/rest": "^16.33.1",
"actions-toolkit": "^3.0.1"
}
}

View File

@@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Toolkit } from 'actions-toolkit';
import { Octokit } from '@octokit/rest';
interface LabelDefinition {
id: number,
name: string
}
interface RepoContext {
repo: string,
owner: string
}
const tools = new Toolkit({
event: 'issue_comment',
secrets: ['GITHUB_TOKEN']
});
const labelToCheckFor = tools.inputs.label || 'Approved';
const fileToCheckFor = tools.inputs.filePath || './.github/mergers.json';
const checkMerged = async (repoContext: RepoContext, pullNumber: number): Promise<boolean> => {
let isMerged: boolean;
try {
const result = await tools.github.pulls.checkIfMerged({
...repoContext,
pull_number: pullNumber
});
isMerged = result.status === 204;
} catch (ex) {
isMerged = false;
}
return isMerged;
};
const checkCollabrator = async (repoContext: RepoContext, username: string): Promise<boolean> => {
let isCollabrator: boolean;
try {
const result = await tools.github.repos.checkCollaborator({
...repoContext,
username,
});
isCollabrator = result.status === 204;
} catch (ex) {
isCollabrator = false;
}
return isCollabrator;
};
tools.command('merge', async () => {
try {
const issue = tools.context.payload.issue;
if (issue?.pull_request === undefined) {
console.log('This command only works on pull requests');
return;
}
const sender = tools.context.payload.sender;
const senderName = sender?.login ?? ' Unknown Sender';
const issueNumber = issue?.number;
if (!issueNumber) {
return tools.log.error('Issue number not defined.');
}
const isMerged = await checkMerged(tools.context.repo, issueNumber);
if (isMerged === true) {
console.log('PR is already merged');
return;
}
const mergers: string[] = JSON.parse(tools.getFile(fileToCheckFor));
if (!mergers.includes(senderName)) {
console.log('Unrecognized user tried to merge!', senderName);
return;
}
const isCollabrator = await checkCollabrator(tools.context.repo, senderName);
if (isCollabrator !== true) {
console.log('User is not a collabrator');
return;
}
const labels: LabelDefinition[] = issue.labels || [];
const foundLabel = labels.find(l => l.name === labelToCheckFor);
if (foundLabel === undefined) {
console.log(`Label ${labelToCheckFor} must be applied`);
const createCommentParams: Octokit.IssuesCreateCommentParams = {
...tools.context.repo,
issue_number: issueNumber,
body: `The label ${labelToCheckFor} is required for using this command.`
};
await tools.github.issues.createComment(createCommentParams);
return;
}
const createCommentParams: Octokit.IssuesCreateCommentParams = {
...tools.context.repo,
issue_number: issueNumber,
body: `Merging PR based on approval from @${senderName}`
};
const commentResult = await tools.github.issues.createComment(createCommentParams);
if (commentResult.status !== 201) {
console.log('Comment not created');
return;
}
const mergeResult = await tools.github.pulls.merge({
...tools.context.repo,
pull_number: issueNumber,
merge_method: 'squash'
});
console.log(mergeResult);
} catch (ex) {
console.error(ex);
}
});
console.log('Running...');

View File

@@ -1,76 +0,0 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es6",
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs",
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true,
/* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true,
/* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "out",
/* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true,
/* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true,
/* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true,
/* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": ["node"],
"skipLibCheck": true,
/* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true,
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": [
"./src/**/*.ts"
],
"exclude": [
"node_modules"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -44,16 +44,15 @@ async function doesAssetExist(blobService: azure.BlobService, quality: string, b
return existsResult.exists; return existsResult.exists;
} }
async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, filePath: string, fileName: string): Promise<void> { async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise<void> {
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = { const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
contentSettings: { contentSettings: {
contentType: mime.lookup(filePath), contentType: mime.lookup(file),
contentDisposition: `attachment; filename="${fileName}"`,
cacheControl: 'max-age=31536000, public' cacheControl: 'max-age=31536000, public'
} }
}; };
await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, filePath, blobOptions, err => err ? e(err) : c())); await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c()));
} }
function getEnv(name: string): string { function getEnv(name: string): string {
@@ -67,24 +66,24 @@ function getEnv(name: string): string {
} }
async function main(): Promise<void> { async function main(): Promise<void> {
const [, , platform, type, fileName, filePath] = process.argv; const [, , platform, type, name, file] = process.argv;
const quality = getEnv('VSCODE_QUALITY'); const quality = getEnv('VSCODE_QUALITY');
const commit = getEnv('BUILD_SOURCEVERSION'); const commit = getEnv('BUILD_SOURCEVERSION');
console.log('Creating asset...'); console.log('Creating asset...');
const stat = await new Promise<fs.Stats>((c, e) => fs.stat(filePath, (err, stat) => err ? e(err) : c(stat))); const stat = await new Promise<fs.Stats>((c, e) => fs.stat(file, (err, stat) => err ? e(err) : c(stat)));
const size = stat.size; const size = stat.size;
console.log('Size:', size); console.log('Size:', size);
const stream = fs.createReadStream(filePath); const stream = fs.createReadStream(file);
const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]); const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]);
console.log('SHA1:', sha1hash); console.log('SHA1:', sha1hash);
console.log('SHA256:', sha256hash); console.log('SHA256:', sha256hash);
const blobName = commit + '/' + fileName; const blobName = commit + '/' + name;
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!; const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!) const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
@@ -99,7 +98,7 @@ async function main(): Promise<void> {
console.log('Uploading blobs to Azure storage...'); console.log('Uploading blobs to Azure storage...');
await uploadBlob(blobService, quality, blobName, filePath, fileName); await uploadBlob(blobService, quality, blobName, file);
console.log('Blobs successfully uploaded.'); console.log('Blobs successfully uploaded.');

View File

@@ -49,12 +49,11 @@ function getConfig(quality: string): Promise<Config> {
query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`, query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`,
parameters: [ parameters: [
{ name: '@quality', value: quality } { name: '@quality', value: quality }
], ]
}; };
return new Promise<Config>((c, e) => { return new Promise<Config>((c, e) => {
client.queryDocuments(collection, query, { enableCrossPartitionQuery: true }).toArray((err, results) => { client.queryDocuments(collection, query).toArray((err, results) => {
if (err && err.code !== 409) { return e(err); } if (err && err.code !== 409) { return e(err); }
c(!results || results.length === 0 ? createDefaultConfig(quality) : results[0] as any as Config); c(!results || results.length === 0 ? createDefaultConfig(quality) : results[0] as any as Config);
@@ -87,7 +86,7 @@ function createOrUpdate(commit: string, quality: string, platform: string, type:
updateTries++; updateTries++;
return new Promise<void>((c, e) => { return new Promise<void>((c, e) => {
client.queryDocuments(collection, updateQuery, { enableCrossPartitionQuery: true }).toArray((err, results) => { client.queryDocuments(collection, updateQuery).toArray((err, results) => {
if (err) { return e(err); } if (err) { return e(err); }
if (results.length !== 1) { return e(new Error('No documents')); } if (results.length !== 1) { return e(new Error('No documents')); }
@@ -218,13 +217,7 @@ async function publish(commit: string, quality: string, platform: string, type:
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
// Insiders: nightly build from master // Insiders: nightly build from master
const isReleased = ( const isReleased = (quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy));
(
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch)) ||
(quality === 'rc1' && /^release\/|^refs\/heads\/release\//.test(sourceBranch))
) &&
/Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)
);
const release = { const release = {
id: commit, id: commit,

View File

@@ -43,13 +43,10 @@ steps:
# displayName: Download Built-in Extensions # displayName: Download Built-in Extensions
- script: | - script: |
./scripts/test.sh --tfs "Unit Tests" ./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests (Electron) displayName: Run Unit Tests
# - script: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
# yarn test-browser --browser chromium --browser webkit
# displayName: Run Unit Tests (Browser)
# - script: | {{SQL CARBON EDIT}} remove step # - script: | {{SQL CARBON EDIT}} remove step
# ./scripts/test-integration.sh --tfs "Integration Tests" # ./scripts/test-integration.sh --tfs "Integration Tests"
# displayName: Run Integration Tests (Electron) # displayName: Run Integration Tests
- task: PublishTestResults@2 - task: PublishTestResults@2
displayName: Publish Tests Results displayName: Publish Tests Results
inputs: inputs:

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>

View File

@@ -77,23 +77,6 @@ steps:
yarn postinstall yarn postinstall
displayName: Run postinstall scripts displayName: Run postinstall scripts
condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
VSO_GITHUB_SECRET: $(vso-github-client-secret)
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
GITHUB_APP_SECRET: $(github-app-client-secret)
- script: | - script: |
set -e set -e
@@ -113,13 +96,9 @@ steps:
- script: | - script: |
set -e set -e
./scripts/test.sh --build --tfs "Unit Tests" ./scripts/test.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) # APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
displayName: Run unit tests
- script: |
set -e
yarn test-browser --build --browser chromium --browser webkit
displayName: Run unit tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
@@ -132,57 +111,33 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \ VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
./scripts/test-integration.sh --build --tfs "Integration Tests" ./scripts/test-integration.sh --build --tfs "Integration Tests"
displayName: Run integration tests (Electron) displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
# Web Smoke Tests disabled due to https://github.com/microsoft/vscode/issues/80308
# - script: |
# set -e
# cd test/smoke
# yarn compile
# cd -
# yarn smoketest --web --headless
# continueOnError: true
# displayName: Run web smoke tests
# condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
set -e set -e
APP_ROOT=$(agent.builddirectory)/VSCode-darwin cd test/smoke
APP_NAME="`ls $APP_ROOT | head -n 1`" yarn compile
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ cd -
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
./resources/server/test/test-remote-integration.sh
displayName: Run remote integration tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
./resources/server/test/test-web-integration.sh --browser webkit
displayName: Run integration tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest --build "$APP_ROOT/$APP_NAME"
continueOnError: true
displayName: Run smoke tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
yarn smoketest --web --headless yarn smoketest --web --headless
continueOnError: true continueOnError: true
displayName: Run smoke tests (Browser) displayName: Run smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
set -e set -e
security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
security default-keychain -s $(agent.tempdirectory)/buildagent.keychain
security unlock-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
echo "$(macos-developer-certificate)" | base64 -D > $(agent.tempdirectory)/cert.p12
security import $(agent.tempdirectory)/cert.p12 -k $(agent.tempdirectory)/buildagent.keychain -P "$(macos-developer-certificate-key)" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k pwd $(agent.tempdirectory)/buildagent.keychain
codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/entitlements.plist $(agent.builddirectory)/VSCode-darwin/*.app
displayName: Set Hardened Entitlements
- script: |
set -e
pushd $(agent.builddirectory)/VSCode-darwin && zip -r -X -y $(agent.builddirectory)/VSCode-darwin.zip * && popd
displayName: Archive build displayName: Archive build
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
@@ -196,61 +151,14 @@ steps:
{ {
"keyCode": "CP-401337-Apple", "keyCode": "CP-401337-Apple",
"operationSetCode": "MacAppDeveloperSign", "operationSetCode": "MacAppDeveloperSign",
"parameters": [ "parameters": [ ],
{
"parameterName": "Hardening",
"parameterValue": "--options=runtime"
}
],
"toolName": "sign", "toolName": "sign",
"toolVersion": "1.0" "toolVersion": "1.0"
} }
] ]
SessionTimeout: 60 SessionTimeout: 120
displayName: Codesign displayName: Codesign
- script: |
zip -d $(agent.builddirectory)/VSCode-darwin.zip "*.pkg"
displayName: Clean Archive
- script: |
set -e
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
node build/azure-pipelines/common/createAsset.js darwin-unnotarized archive "VSCode-darwin-$VSCODE_QUALITY.zip" $(agent.builddirectory)/VSCode-darwin.zip
displayName: Publish Unnotarized Build
- script: |
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
BUNDLE_IDENTIFIER=$(node -p "require(\"$APP_ROOT/$APP_NAME/Contents/Resources/app/product.json\").darwinBundleIdentifier")
echo "##vso[task.setvariable variable=BundleIdentifier]$BUNDLE_IDENTIFIER"
displayName: Export bundle identifier
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
inputs:
ConnectedServiceName: 'ESRP CodeSign'
FolderPath: '$(agent.builddirectory)'
Pattern: 'VSCode-darwin.zip'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401337-Apple",
"operationSetCode": "MacAppNotarize",
"parameters": [
{
"parameterName": "BundleId",
"parameterValue": "$(BundleIdentifier)"
}
],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 60
displayName: Notarization
- script: | - script: |
set -e set -e
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \

View File

@@ -1,6 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
# remove pkg from archive
zip -d ../VSCode-darwin.zip "*.pkg"
# publish the build # publish the build
node build/azure-pipelines/common/createAsset.js \ node build/azure-pipelines/common/createAsset.js \
darwin \ darwin \
@@ -19,9 +22,7 @@ node build/azure-pipelines/common/createAsset.js \
../vscode-server-darwin.zip ../vscode-server-darwin.zip
# publish hockeyapp symbols # publish hockeyapp symbols
# node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" x64 "$VSCODE_HOCKEYAPP_ID_MACOS" node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" x64 "$VSCODE_HOCKEYAPP_ID_MACOS"
# Skip hockey app because build failure.
# https://github.com/microsoft/vscode/issues/90491
# upload configuration # upload configuration
yarn gulp upload-vscode-configuration yarn gulp upload-vscode-configuration

View File

@@ -3,7 +3,6 @@ steps:
displayName: 'Install developer certificate' displayName: 'Install developer certificate'
inputs: inputs:
certSecureFile: 'osx_signing_key.p12' certSecureFile: 'osx_signing_key.p12'
condition: eq(variables['signed'], true)
- script: | - script: |
mkdir -p .build mkdir -p .build
@@ -92,6 +91,11 @@ steps:
node build/azure-pipelines/mixin node build/azure-pipelines/mixin
displayName: Mix in quality displayName: Mix in quality
- script: |
set -e
yarn gulp install-sqltoolsservice
displayName: Install sqltoolsservice
- script: | - script: |
set -e set -e
yarn gulp package-rebuild-extensions yarn gulp package-rebuild-extensions
@@ -108,21 +112,6 @@ steps:
displayName: Run unit tests displayName: Run unit tests
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
- script: |
set -e
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest --build "$APP_ROOT/$APP_NAME" --screenshots "$(build.artifactstagingdirectory)/smokeshots"
displayName: Run smoke tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-web-darwin" \
yarn smoketest --web --headless --screenshots "$(build.artifactstagingdirectory)/smokeshots"
displayName: Run smoke tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
set -e set -e
pushd ../azuredatastudio-darwin pushd ../azuredatastudio-darwin
@@ -150,7 +139,6 @@ steps:
codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app
popd popd
displayName: 'Manual codesign' displayName: 'Manual codesign'
condition: and(succeeded(), eq(variables['signed'], true))
- script: | - script: |
set -e set -e
@@ -186,19 +174,19 @@ steps:
} }
] ]
SessionTimeout: 90 SessionTimeout: 90
condition: and(succeeded(), eq(variables['signed'], true)) condition: and(succeeded(), eq(variables['signtba'], true))
- script: | - script: |
zip -d $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip "*.pkg" zip -d $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip "*.pkg"
displayName: Clean Archive displayName: Clean Archive
condition: and(succeeded(), eq(variables['signed'], true)) condition: and(succeeded(), eq(variables['signtba'], true))
- task: PublishPipelineArtifact@0 - task: PublishPipelineArtifact@0
displayName: 'Publish Signed' displayName: 'Publish Signed'
inputs: inputs:
artifactName: darwin-signed artifactName: darwin-signed
targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
condition: and(succeeded(), eq(variables['signed'], true)) condition: and(succeeded(), eq(variables['signtba'], true))
- task: EsrpCodeSigning@1 - task: EsrpCodeSigning@1
displayName: 'ESRP Notarization' displayName: 'ESRP Notarization'
@@ -220,14 +208,14 @@ steps:
} }
] ]
SessionTimeout: 120 SessionTimeout: 120
condition: and(succeeded(), eq(variables['signed'], true)) condition: and(succeeded(), eq(variables['signtba'], true))
- task: PublishPipelineArtifact@0 - task: PublishPipelineArtifact@0
displayName: 'Publish Notarized' displayName: 'Publish Notarized'
inputs: inputs:
artifactName: darwin-notarized artifactName: darwin-notarized
targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
condition: and(succeeded(), eq(variables['signed'], true)) condition: and(succeeded(), eq(variables['signtba'], true))
- script: | - script: |
set -e set -e
@@ -245,6 +233,14 @@ steps:
continueOnError: true continueOnError: true
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
- task: PublishTestResults@2
displayName: 'Publish Integration and Smoke Test Results'
inputs:
testResultsFiles: 'dawin-integration-tests-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)\test-results'
continueOnError: true
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
- task: PublishCodeCoverageResults@1 - task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml' displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
inputs: inputs:

View File

@@ -1,13 +0,0 @@
set -e
REPO="$(pwd)"
ROOT="$REPO/.."
PLATFORM_LINUX="linux-x64"
SERVER_BUILD_NAME="azuredatastudio-server-$PLATFORM_LINUX"
# create docker
mkdir -p $REPO/.build/docker
docker build -t azuredatastudio-server -f $REPO/build/azure-pipelines/docker/Dockerfile $ROOT/$SERVER_BUILD_NAME
docker save azuredatastudio-server | gzip > $REPO/.build/docker/azuredatastudio-server-docker.tar.gz
node build/azure-pipelines/common/copyArtifacts.js

View File

@@ -1,96 +0,0 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.15.1'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
inputs:
versionSpec: "1.x"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'ClientToolsInfra_670062 (88d5392f-a34f-4769-b405-f597fc533613)'
KeyVaultName: ado-secrets
SecretsFilter: 'github-distro-mixin-password'
- script: |
set -e
cat << EOF > ~/.netrc
machine github.com
login azuredatastudio
password $(github-distro-mixin-password)
EOF
git config user.email "andresse@microsoft.com"
git config user.name "AzureDataStudio"
displayName: Prepare tooling
- script: |
set -e
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
git fetch distro
git merge $(node -p "require('./package.json').distro")
displayName: Merge distro
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: 'BuildCache'
- script: |
set -e
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
displayName: Install dependencies
env:
GITHUB_TOKEN: $(github-distro-mixin-password)
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
vstsFeed: 'BuildCache'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
set -e
yarn postinstall
displayName: Run postinstall scripts
condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
- script: |
set -e
node build/azure-pipelines/mixin
displayName: Mix in quality
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Build.SourcesDirectory)/.build'
artifactName: drop
itemPattern: |
drop/linux/server/*.tar.gz
- script: |
set -e
for f in $(Build.SourcesDirectory)/.build/linux/server/*.tar.gz
do
tar -C $(agent.builddirectory) -zxvf $f
rm $f
done
displayName: Unzip artifacts
- script: |
set -e
./build/azure-pipelines/docker/createDrop.sh
displayName: Create Drop
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
inputs:
failOnAlert: true

View File

@@ -51,13 +51,10 @@ steps:
# displayName: Download Built-in Extensions # displayName: Download Built-in Extensions
- script: | - script: |
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests" DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests (Electron) displayName: Run Unit Tests
# - script: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
# DISPLAY=:10 yarn test-browser --browser chromium
# displayName: Run Unit Tests (Browser)
# - script: | {{SQL CARBON EDIT}} remove step # - script: | {{SQL CARBON EDIT}} remove step
# DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests" # DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
# displayName: Run Integration Tests (Electron) # displayName: Run Integration Tests
- task: PublishTestResults@2 - task: PublishTestResults@2
displayName: Publish Tests Results displayName: Publish Tests Results
inputs: inputs:

View File

@@ -29,4 +29,9 @@ SERVER_TARBALL_PATH="$REPO/.build/linux/server/$SERVER_TARBALL_FILENAME"
rm -rf $ROOT/azuredatastudio-server-*.tar.* rm -rf $ROOT/azuredatastudio-server-*.tar.*
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME) (cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
# create docker
mkdir -p $REPO/.build/docker
docker build -t azuredatastudio-server -f $REPO/build/azure-pipelines/docker/Dockerfile $ROOT/$SERVER_BUILD_NAME
docker save azuredatastudio-server | gzip > $REPO/.build/docker/azuredatastudio-server-docker.tar.gz
node build/azure-pipelines/common/copyArtifacts.js node build/azure-pipelines/common/copyArtifacts.js

View File

@@ -86,23 +86,6 @@ steps:
yarn postinstall yarn postinstall
displayName: Run postinstall scripts displayName: Run postinstall scripts
condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
VSO_GITHUB_SECRET: $(vso-github-client-secret)
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
GITHUB_APP_SECRET: $(github-app-client-secret)
- script: | - script: |
set -e set -e

View File

@@ -76,23 +76,6 @@ steps:
yarn postinstall yarn postinstall
displayName: Run postinstall scripts displayName: Run postinstall scripts
condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
VSO_GITHUB_SECRET: $(vso-github-client-secret)
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
GITHUB_APP_SECRET: $(github-app-client-secret)
- script: | - script: |
set -e set -e
@@ -118,13 +101,7 @@ steps:
- script: | - script: |
set -e set -e
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests" DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) displayName: Run unit tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
DISPLAY=:10 yarn test-browser --build --browser chromium
displayName: Run unit tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
@@ -137,24 +114,8 @@ steps:
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests" DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
displayName: Run integration tests (Electron) # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) displayName: Run integration tests
- script: |
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
DISPLAY=:10 ./resources/server/test/test-remote-integration.sh
displayName: Run remote integration tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \
DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium
displayName: Run integration tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |

View File

@@ -28,9 +28,7 @@ rm -rf $ROOT/vscode-server-*.tar.*
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH" node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
# Publish hockeyapp symbols # Publish hockeyapp symbols
# node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "x64" "$VSCODE_HOCKEYAPP_ID_LINUX64" node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "x64" "$VSCODE_HOCKEYAPP_ID_LINUX64"
# Skip hockey app because build failure.
# https://github.com/microsoft/vscode/issues/90491
# Publish DEB # Publish DEB
PLATFORM_DEB="linux-deb-x64" PLATFORM_DEB="linux-deb-x64"

View File

@@ -85,6 +85,12 @@ steps:
node build/azure-pipelines/mixin node build/azure-pipelines/mixin
displayName: Mix in quality displayName: Mix in quality
- script: |
set -e
yarn gulp install-sqltoolsservice
yarn gulp install-ssmsmin
displayName: Install extension binaries
- script: | - script: |
set -e set -e
yarn gulp vscode-linux-x64-min-ci yarn gulp vscode-linux-x64-min-ci
@@ -141,23 +147,24 @@ steps:
./build/azure-pipelines/linux/createDrop.sh ./build/azure-pipelines/linux/createDrop.sh
displayName: Create Drop displayName: Create Drop
- task: CopyFiles@2 - task: PublishBuildArtifacts@1
displayName: 'Copy Extension Unit Test Coverage Files to: $(Build.ArtifactStagingDirectory)' displayName: 'Publish Artifact: drop'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/extensions'
Contents: '*/coverage/**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/test-results/coverage'
- task: PublishTestResults@2 - task: PublishTestResults@2
displayName: 'Publish Test Results test-results.xml' displayName: 'Publish Test Results test-results.xml'
inputs: inputs:
testResultsFiles: '*.xml' testResultsFiles: 'test-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results' searchFolder: '$(Build.SourcesDirectory)'
continueOnError: true continueOnError: true
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
- task: PublishBuildArtifacts@1 - task: PublishCodeCoverageResults@1
displayName: 'Publish Artifact: drop' displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/.build/coverage'
continueOnError: true
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection' displayName: 'Component Detection'

View File

@@ -19,7 +19,7 @@
[ "${NETWORKING}" = "no" ] && exit 0 [ "${NETWORKING}" = "no" ] && exit 0
PROG="/usr/bin/Xvfb" PROG="/usr/bin/Xvfb"
PROG_OPTIONS=":10 -ac -screen 0 1024x768x24" PROG_OPTIONS=":10 -ac"
PROG_OUTPUT="/tmp/Xvfb.out" PROG_OUTPUT="/tmp/Xvfb.out"
case "$1" in case "$1" in
@@ -50,4 +50,4 @@ case "$1" in
exit 1 exit 1
esac esac
exit $RETVAL exit $RETVAL

View File

@@ -77,23 +77,6 @@ steps:
yarn postinstall yarn postinstall
displayName: Run postinstall scripts displayName: Run postinstall scripts
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['CacheRestored'], 'true')) condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
VSO_GITHUB_SECRET: $(vso-github-client-secret)
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
GITHUB_APP_SECRET: $(github-app-client-secret)
# Mixin must run before optimize, because the CSS loader will # Mixin must run before optimize, because the CSS loader will
# inline small SVGs # inline small SVGs

View File

@@ -10,10 +10,6 @@ jobs:
vmImage: 'Ubuntu-16.04' vmImage: 'Ubuntu-16.04'
container: linux-x64 container: linux-x64
steps: steps:
- script: |
set -e
echo "##vso[build.addbuildtag]$(VSCODE_QUALITY)"
displayName: Add Quality Build Tag
- template: sql-product-compile.yml - template: sql-product-compile.yml
- job: macOS - job: macOS
@@ -35,17 +31,6 @@ jobs:
- Compile - Compile
steps: steps:
- template: linux/sql-product-build-linux.yml - template: linux/sql-product-build-linux.yml
timeoutInMinutes: 70
- job: Docker
condition: eq(variables['VSCODE_BUILD_DOCKER'], 'true')
pool:
vmImage: 'Ubuntu-16.04'
container: linux-x64
dependsOn:
- Linux
steps:
- template: docker/sql-product-build-docker.yml
- job: Windows - job: Windows
condition: eq(variables['VSCODE_BUILD_WIN32'], 'true') condition: eq(variables['VSCODE_BUILD_WIN32'], 'true')
@@ -55,7 +40,6 @@ jobs:
- Compile - Compile
steps: steps:
- template: win32/sql-product-build-win32.yml - template: win32/sql-product-build-win32.yml
timeoutInMinutes: 70
- job: Windows_Test - job: Windows_Test
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32'], 'true')) condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32'], 'true'))
@@ -74,7 +58,6 @@ jobs:
dependsOn: dependsOn:
- macOS - macOS
- Linux - Linux
- Docker
- Windows - Windows
- Windows_Test - Windows_Test
steps: steps:

View File

@@ -87,11 +87,10 @@ steps:
- script: | - script: |
set -e set -e
yarn sqllint
yarn gulp hygiene yarn gulp hygiene
yarn strict-vscode yarn strict-vscode
yarn valid-layers-check yarn valid-layers-check
displayName: Run hygiene, eslint displayName: Run hygiene, tslint
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Microsoft.ESRPClient" version="1.2.25" /> <package id="EsrpClient" version="1.0.27" />
</packages> </packages>

View File

@@ -48,13 +48,10 @@ steps:
# displayName: Download Built-in Extensions # displayName: Download Built-in Extensions
- powershell: | - powershell: |
.\scripts\test.bat --tfs "Unit Tests" .\scripts\test.bat --tfs "Unit Tests"
displayName: Run Unit Tests (Electron) displayName: Run Unit Tests
# - powershell: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
# yarn test-browser --browser chromium
# displayName: Run Unit Tests (Browser)
# - powershell: | {{SQL CARBON EDIT}} remove step # - powershell: | {{SQL CARBON EDIT}} remove step
# .\scripts\test-integration.bat --tfs "Integration Tests" # .\scripts\test-integration.bat --tfs "Integration Tests"
# displayName: Run Integration Tests (Electron) # displayName: Run Integration Tests
- task: PublishTestResults@2 - task: PublishTestResults@2
displayName: Publish Tests Results displayName: Publish Tests Results
inputs: inputs:

View File

@@ -86,23 +86,6 @@ steps:
exec { yarn postinstall } exec { yarn postinstall }
displayName: Run postinstall scripts displayName: Run postinstall scripts
condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
VSO_GITHUB_SECRET: $(vso-github-client-secret)
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
GITHUB_APP_SECRET: $(github-app-client-secret)
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
@@ -126,14 +109,7 @@ steps:
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
exec { yarn electron $(VSCODE_ARCH) } exec { yarn electron $(VSCODE_ARCH) }
exec { .\scripts\test.bat --build --tfs "Unit Tests" } exec { .\scripts\test.bat --build --tfs "Unit Tests" }
displayName: Run unit tests (Electron) displayName: Run unit tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn test-browser --build --browser chromium }
displayName: Run unit tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- powershell: | - powershell: |
@@ -146,24 +122,7 @@ steps:
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
$AppNameShort = $AppProductJson.nameShort $AppNameShort = $AppProductJson.nameShort
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\scripts\test-integration.bat --build --tfs "Integration Tests" } exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\scripts\test-integration.bat --build --tfs "Integration Tests" }
displayName: Run integration tests (Electron) displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
$AppNameShort = $AppProductJson.nameShort
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-remote-integration.bat }
displayName: Run remote integration tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-web-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-web-integration.bat --browser firefox }
displayName: Run integration tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1

View File

@@ -11,12 +11,13 @@ $SystemExe = "$Repo\.build\win32-$Arch\system-setup\VSCodeSetup.exe"
$UserExe = "$Repo\.build\win32-$Arch\user-setup\VSCodeSetup.exe" $UserExe = "$Repo\.build\win32-$Arch\user-setup\VSCodeSetup.exe"
$Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip" $Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
$LegacyServer = "$Root\vscode-reh-win32-$Arch" $LegacyServer = "$Root\vscode-reh-win32-$Arch"
$Server = "$Root\vscode-server-win32-$Arch" $ServerName = "vscode-server-win32-$Arch"
$Server = "$Root\$ServerName"
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip" $ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
$Build = "$Root\VSCode-win32-$Arch" $Build = "$Root\VSCode-win32-$Arch"
# Create server archive # Create server archive
exec { xcopy $LegacyServer $Server /H /E /I } exec { Rename-Item -Path $LegacyServer -NewName $ServerName }
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r } exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
# get version # get version
@@ -30,8 +31,6 @@ exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform" setup "
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $UserExe } exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $UserExe }
exec { node build/azure-pipelines/common/createAsset.js "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $ServerZip } exec { node build/azure-pipelines/common/createAsset.js "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $ServerZip }
# Skip hockey app because build failure.
# https://github.com/microsoft/vscode/issues/90491
# publish hockeyapp symbols # publish hockeyapp symbols
# $hockeyAppId = if ("$Arch" -eq "ia32") { "$env:VSCODE_HOCKEYAPP_ID_WIN32" } else { "$env:VSCODE_HOCKEYAPP_ID_WIN64" } $hockeyAppId = if ("$Arch" -eq "ia32") { "$env:VSCODE_HOCKEYAPP_ID_WIN32" } else { "$env:VSCODE_HOCKEYAPP_ID_WIN64" }
# exec { node build/azure-pipelines/common/symbols.js "$env:VSCODE_MIXIN_PASSWORD" "$env:VSCODE_HOCKEYAPP_TOKEN" "$Arch" $hockeyAppId } exec { node build/azure-pipelines/common/symbols.js "$env:VSCODE_MIXIN_PASSWORD" "$env:VSCODE_HOCKEYAPP_TOKEN" "$Arch" $hockeyAppId }

View File

@@ -67,4 +67,4 @@ $Input = Create-TmpJson @{
$Output = [System.IO.Path]::GetTempFileName() $Output = [System.IO.Path]::GetTempFileName()
$ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent $ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
& "$ScriptPath\ESRPClient\packages\Microsoft.ESRPClient.1.2.25\tools\ESRPClient.exe" Sign -a $Auth -p $Policy -i $Input -o $Output & "$ScriptPath\ESRPClient\packages\EsrpClient.1.0.27\tools\ESRPClient.exe" Sign -a $Auth -p $Policy -i $Input -o $Output

View File

@@ -90,6 +90,12 @@ steps:
exec { node build/azure-pipelines/mixin } exec { node build/azure-pipelines/mixin }
displayName: Mix in quality displayName: Mix in quality
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn gulp "install-sqltoolsservice" }
displayName: Install sqltoolsservice
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@@ -97,8 +103,6 @@ steps:
exec { yarn gulp "vscode-win32-x64-min-ci" } exec { yarn gulp "vscode-win32-x64-min-ci" }
exec { yarn gulp "vscode-reh-win32-x64-min-ci" } exec { yarn gulp "vscode-reh-win32-x64-min-ci" }
exec { yarn gulp "vscode-reh-web-win32-x64-min-ci" } exec { yarn gulp "vscode-reh-web-win32-x64-min-ci" }
exec { yarn gulp "vscode-win32-x64-code-helper" }
exec { yarn gulp "vscode-win32-x64-inno-updater" }
displayName: Build displayName: Build
env: env:
VSCODE_MIXIN_PASSWORD: $(github-distro-mixin-password) VSCODE_MIXIN_PASSWORD: $(github-distro-mixin-password)
@@ -106,7 +110,7 @@ steps:
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
exec { .\scripts\test-unstable.bat --build --tfs } exec { .\scripts\test-unstable.bat --build --coverage --reporter mocha-junit-reporter }
continueOnError: true continueOnError: true
condition: and(succeeded(), eq(variables['RUN_UNSTABLE_TESTS'], 'true')) condition: and(succeeded(), eq(variables['RUN_UNSTABLE_TESTS'], 'true'))
displayName: Run unstable tests displayName: Run unstable tests

View File

@@ -19,9 +19,6 @@ steps:
buildType: 'current' buildType: 'current'
targetPath: '$(Build.SourcesDirectory)\.build' targetPath: '$(Build.SourcesDirectory)\.build'
artifactName: drop artifactName: drop
itemPattern: |
drop/extensions/**
drop/win32-x64/**
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
@@ -50,7 +47,7 @@ steps:
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
$AppNameShort = $AppProductJson.nameShort $AppNameShort = $AppProductJson.nameShort
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:INTEGRATION_TEST_CLI_PATH = "$AppRoot\bin\$AppNameShort"; .\scripts\sql-test-integration.bat } exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:INTEGRATION_TEST_CLI_PATH = "$AppRoot\bin\$AppNameShort"; .\scripts\sql-test-integration.bat }
continueOnError: false continueOnError: true
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
displayName: Run stable tests displayName: Run stable tests
env: env:

View File

@@ -0,0 +1,7 @@
[
{
"name": "Microsoft.sqlservernotebook",
"version": "0.3.4",
"repo": "https://github.com/Microsoft/azuredatastudio"
}
]

View File

@@ -6,10 +6,12 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const os = require('os'); const os = require('os');
// @ts-ignore review
const { remote } = require('electron'); const { remote } = require('electron');
const dialog = remote.dialog; const dialog = remote.dialog;
const builtInExtensionsPath = path.join(__dirname, '..', '..', 'product.json'); const productJsonPath = path.join(__dirname, '..', '..', 'product.json');
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json'); const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
function readJson(filePath) { function readJson(filePath) {
@@ -50,6 +52,7 @@ function render(el, state) {
} }
const ul = document.createElement('ul'); const ul = document.createElement('ul');
const { quality } = readJson(productJsonPath);
const { builtin, control } = state; const { builtin, control } = state;
for (const ext of builtin) { for (const ext of builtin) {
@@ -60,6 +63,10 @@ function render(el, state) {
const name = document.createElement('code'); const name = document.createElement('code');
name.textContent = ext.name; name.textContent = ext.name;
if (quality && ext.forQualities && !ext.forQualities.includes(quality)) {
name.textContent += ` (only on ${ext.forQualities.join(', ')})`;
}
li.appendChild(name); li.appendChild(name);
const form = document.createElement('form'); const form = document.createElement('form');
@@ -110,7 +117,7 @@ function render(el, state) {
function main() { function main() {
const el = document.getElementById('extensions'); const el = document.getElementById('extensions');
const builtin = readJson(builtInExtensionsPath).builtInExtensions; const builtin = readJson(builtInExtensionsPath);
let control; let control;
try { try {

View File

@@ -16,8 +16,6 @@ const cp = require('child_process');
const compilation = require('./lib/compilation'); const compilation = require('./lib/compilation');
const monacoapi = require('./monaco/api'); const monacoapi = require('./monaco/api');
const fs = require('fs'); const fs = require('fs');
const webpack = require('webpack');
const webpackGulp = require('webpack-stream');
let root = path.dirname(__dirname); let root = path.dirname(__dirname);
let sha1 = util.getVersion(root); let sha1 = util.getVersion(root);
@@ -72,8 +70,13 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
apiusages, apiusages,
extrausages extrausages
], ],
libs: [
`lib.es5.d.ts`,
`lib.dom.d.ts`,
`lib.webworker.importscripts.d.ts`
],
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'),
redirects: [] redirects: []
}); });
@@ -126,7 +129,6 @@ const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () =>
}); });
const compileEditorESMTask = task.define('compile-editor-esm', () => { const compileEditorESMTask = task.define('compile-editor-esm', () => {
const KEEP_PREV_ANALYSIS = false;
console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`); console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`);
let result; let result;
if (process.platform === 'win32') { if (process.platform === 'win32') {
@@ -145,45 +147,41 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => {
if (result.status !== 0) { if (result.status !== 0) {
console.log(`The TS Compilation failed, preparing analysis folder...`); console.log(`The TS Compilation failed, preparing analysis folder...`);
const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis'); const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis');
const keepPrevAnalysis = (KEEP_PREV_ANALYSIS && fs.existsSync(destPath)); return util.rimraf(destPath)().then(() => {
const cleanDestPath = (keepPrevAnalysis ? Promise.resolve() : util.rimraf(destPath)()); fs.mkdirSync(destPath);
return cleanDestPath.then(() => {
// initialize a new repository
cp.spawnSync(`git`, [`init`], {
cwd: destPath
});
// build a list of files to copy // build a list of files to copy
const files = util.rreddir(path.join(__dirname, '../out-editor-esm')); const files = util.rreddir(path.join(__dirname, '../out-editor-esm'));
if (!keepPrevAnalysis) { // copy files from src
fs.mkdirSync(destPath); for (const file of files) {
const srcFilePath = path.join(__dirname, '../src', file);
// initialize a new repository const dstFilePath = path.join(destPath, file);
cp.spawnSync(`git`, [`init`], { if (fs.existsSync(srcFilePath)) {
cwd: destPath util.ensureDir(path.dirname(dstFilePath));
}); const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
fs.writeFileSync(dstFilePath, contents);
// copy files from src
for (const file of files) {
const srcFilePath = path.join(__dirname, '../src', file);
const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath));
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
fs.writeFileSync(dstFilePath, contents);
}
} }
// create an initial commit to diff against
cp.spawnSync(`git`, [`add`, `.`], {
cwd: destPath
});
// create the commit
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
cwd: destPath
});
} }
// copy files from tree shaken src // create an initial commit to diff against
cp.spawnSync(`git`, [`add`, `.`], {
cwd: destPath
});
// create the commit
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
cwd: destPath
});
// copy files from esm
for (const file of files) { for (const file of files) {
const srcFilePath = path.join(__dirname, '../out-editor-src', file); const srcFilePath = path.join(__dirname, '../out-editor-esm', file);
const dstFilePath = path.join(destPath, file); const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) { if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath)); util.ensureDir(path.dirname(dstFilePath));
@@ -229,13 +227,8 @@ function toExternalDTS(contents) {
if (line.indexOf('declare namespace monaco.') === 0) { if (line.indexOf('declare namespace monaco.') === 0) {
lines[i] = line.replace('declare namespace monaco.', 'export namespace '); lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
} }
if (line.indexOf('declare let MonacoEnvironment') === 0) {
lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`;
// lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
}
} }
return lines.join('\n').replace(/\n\n\n+/g, '\n\n'); return lines.join('\n');
} }
function filterStream(testFunc) { function filterStream(testFunc) {
@@ -334,13 +327,6 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
); );
}); });
gulp.task('extract-editor-src',
task.series(
util.rimraf('out-editor-src'),
extractEditorSrcTask
)
);
gulp.task('editor-distro', gulp.task('editor-distro',
task.series( task.series(
task.parallel( task.parallel(
@@ -367,49 +353,6 @@ gulp.task('editor-distro',
) )
); );
const bundleEditorESMTask = task.define('editor-esm-bundle-webpack', () => {
const result = es.through();
const webpackConfigPath = path.join(root, 'build/monaco/monaco.webpack.config.js');
const webpackConfig = {
...require(webpackConfigPath),
...{ mode: 'production' }
};
const webpackDone = (err, stats) => {
if (err) {
result.emit('error', err);
return;
}
const { compilation } = stats;
if (compilation.errors.length > 0) {
result.emit('error', compilation.errors.join('\n'));
}
if (compilation.warnings.length > 0) {
result.emit('data', compilation.warnings.join('\n'));
}
};
return webpackGulp(webpackConfig, webpack, webpackDone)
.pipe(gulp.dest('out-editor-esm-bundle'));
});
gulp.task('editor-esm-bundle',
task.series(
task.parallel(
util.rimraf('out-editor-src'),
util.rimraf('out-editor-esm'),
util.rimraf('out-monaco-editor-core'),
util.rimraf('out-editor-esm-bundle'),
),
extractEditorSrcTask,
createESMSourcesAndResourcesTask,
compileEditorESMTask,
bundleEditorESMTask,
)
);
gulp.task('monacodts', task.define('monacodts', () => { gulp.task('monacodts', task.define('monacodts', () => {
const result = monacoapi.execute(); const result = monacoapi.execute();
fs.writeFileSync(result.filePath, result.content); fs.writeFileSync(result.filePath, result.content);
@@ -455,8 +398,10 @@ function createTscCompileTask(watch) {
// e.g. src/vs/base/common/strings.ts(663,5): error TS2322: Type '1234' is not assignable to type 'string'. // e.g. src/vs/base/common/strings.ts(663,5): error TS2322: Type '1234' is not assignable to type 'string'.
let fullpath = path.join(root, match[1]); let fullpath = path.join(root, match[1]);
let message = match[3]; let message = match[3];
// @ts-ignore
reporter(fullpath + message); reporter(fullpath + message);
} else { } else {
// @ts-ignore
reporter(str); reporter(str);
} }
} }

View File

@@ -33,9 +33,7 @@ const all = [
'scripts/**/*', 'scripts/**/*',
'src/**/*', 'src/**/*',
'test/**/*', 'test/**/*',
'!test/**/out/**', '!**/node_modules/**'
'!**/node_modules/**',
'!build/actions/**/dist/*' // {{ SQL CARBON EDIT }}
]; ];
const indentationFilter = [ const indentationFilter = [
@@ -55,7 +53,8 @@ const indentationFilter = [
'!src/vs/base/common/marked/marked.js', '!src/vs/base/common/marked/marked.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/unit/assert.js', '!test/assert.js',
'!build/testSetup.js',
// except specific folders // except specific folders
'!test/automation/out/**', '!test/automation/out/**',
@@ -85,7 +84,7 @@ const indentationFilter = [
'!src/vs/*/**/*.d.ts', '!src/vs/*/**/*.d.ts',
'!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,plist}', '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
'!build/{lib,download}/**/*.js', '!build/{lib,download}/**/*.js',
'!build/**/*.sh', '!build/**/*.sh',
'!build/azure-pipelines/**/*.js', '!build/azure-pipelines/**/*.js',
@@ -96,8 +95,7 @@ const indentationFilter = [
'!**/*.dockerfile', '!**/*.dockerfile',
'!extensions/markdown-language-features/media/*.js', '!extensions/markdown-language-features/media/*.js',
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
'!build/actions/**/dist/*', '!**/*.{xlf,docx,sql,vsix,bacpac,ipynb}',
'!**/*.{xlf,docx,sql,vsix,bacpac,ipynb,jpg}',
'!extensions/mssql/sqltoolsservice/**', '!extensions/mssql/sqltoolsservice/**',
'!extensions/import/flatfileimportservice/**', '!extensions/import/flatfileimportservice/**',
'!extensions/admin-tool-ext-win/ssmsmin/**', '!extensions/admin-tool-ext-win/ssmsmin/**',
@@ -105,8 +103,7 @@ const indentationFilter = [
'!extensions/mssql/notebooks/**', '!extensions/mssql/notebooks/**',
'!extensions/integration-tests/testData/**', '!extensions/integration-tests/testData/**',
'!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts', '!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts',
'!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts', '!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts'
'!resources/linux/snap/electron-launch'
]; ];
const copyrightFilter = [ const copyrightFilter = [
@@ -128,6 +125,7 @@ const copyrightFilter = [
'!**/*.disabled', '!**/*.disabled',
'!**/*.code-workspace', '!**/*.code-workspace',
'!**/*.js.map', '!**/*.js.map',
'!**/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',
@@ -143,9 +141,9 @@ const copyrightFilter = [
'!extensions/mssql/src/hdfs/webhdfs.ts', '!extensions/mssql/src/hdfs/webhdfs.ts',
'!src/sql/workbench/contrib/notebook/browser/outputs/tableRenderers.ts', '!src/sql/workbench/contrib/notebook/browser/outputs/tableRenderers.ts',
'!src/sql/workbench/contrib/notebook/common/models/url.ts', '!src/sql/workbench/contrib/notebook/common/models/url.ts',
'!src/sql/workbench/services/notebook/browser/outputs/renderMimeInterfaces.ts', '!src/sql/workbench/contrib/notebook/browser/models/renderMimeInterfaces.ts',
'!src/sql/workbench/contrib/notebook/browser/models/outputProcessor.ts', '!src/sql/workbench/contrib/notebook/browser/models/outputProcessor.ts',
'!src/sql/workbench/services/notebook/browser/outputs/mimemodel.ts', '!src/sql/workbench/contrib/notebook/browser/models/mimemodel.ts',
'!src/sql/workbench/contrib/notebook/browser/cellViews/media/*.css', '!src/sql/workbench/contrib/notebook/browser/cellViews/media/*.css',
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts', '!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts', '!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
@@ -153,11 +151,11 @@ const copyrightFilter = [
'!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts', '!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts', '!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts', '!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts',
'!src/sql/workbench/services/notebook/browser/outputs/sanitizer.ts', '!src/sql/workbench/contrib/notebook/browser/outputs/sanitizer.ts',
'!src/sql/workbench/contrib/notebook/browser/outputs/renderers.ts', '!src/sql/workbench/contrib/notebook/browser/outputs/renderers.ts',
'!src/sql/workbench/services/notebook/browser/outputs/registry.ts', '!src/sql/workbench/contrib/notebook/browser/outputs/registry.ts',
'!src/sql/workbench/services/notebook/browser/outputs/factories.ts', '!src/sql/workbench/contrib/notebook/browser/outputs/factories.ts',
'!src/sql/workbench/services/notebook/common/nbformat.ts', '!src/sql/workbench/contrib/notebook/common/models/nbformat.ts',
'!extensions/markdown-language-features/media/tomorrow.css', '!extensions/markdown-language-features/media/tomorrow.css',
'!src/sql/workbench/browser/modelComponents/media/highlight.css', '!src/sql/workbench/browser/modelComponents/media/highlight.css',
'!src/sql/workbench/contrib/notebook/electron-browser/cellViews/media/highlight.css', '!src/sql/workbench/contrib/notebook/electron-browser/cellViews/media/highlight.css',
@@ -201,7 +199,14 @@ const tsHygieneFilter = [
'!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts', // {{SQL CARBON EDIT}}, '!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts', // {{SQL CARBON EDIT}},
'!extensions/big-data-cluster/src/bigDataCluster/controller/tokenApiGenerated.ts', // {{SQL CARBON EDIT}}, '!extensions/big-data-cluster/src/bigDataCluster/controller/tokenApiGenerated.ts', // {{SQL CARBON EDIT}},
'!src/vs/workbench/services/themes/common/textMateScopeMatcher.ts', // {{SQL CARBON EDIT}} skip this because we have no plans on touching this and its not ours '!src/vs/workbench/services/themes/common/textMateScopeMatcher.ts', // {{SQL CARBON EDIT}} skip this because we have no plans on touching this and its not ours
'!src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts' // {{SQL CARBON EDIT}} skip this because known issue '!src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts' // {{SQL CARBON EDIT}} skip this because known issue
];
const sqlHygieneFilter = [ // for rules we want to only apply to our code
'src/sql/**/*.ts',
'!**/node_modules/**',
'extensions/**/*.ts',
'!extensions/{git,search-result,vscode-test-resolver,extension-editing,json-language-features,vscode-colorize-tests}/**/*.ts',
]; ];
const copyrightHeaderLines = [ const copyrightHeaderLines = [
@@ -371,8 +376,20 @@ function hygiene(some) {
errorCount += results.errorCount; errorCount += results.errorCount;
})); }));
const sqlJavascript = result
.pipe(filter(sqlHygieneFilter))
.pipe(gulpeslint({
configFile: '.eslintrc.sql.json',
rulePaths: ['./build/lib/eslint']
}))
.pipe(gulpeslint.formatEach('compact'))
.pipe(gulpeslint.results(results => {
errorCount += results.warningCount;
errorCount += results.errorCount;
}));
let count = 0; let count = 0;
return es.merge(typescript, javascript) return es.merge(typescript, javascript, sqlJavascript)
.pipe(es.through(function (data) { .pipe(es.through(function (data) {
count++; count++;
if (process.env['TRAVIS'] && count % 10 === 0) { if (process.env['TRAVIS'] && count % 10 === 0) {

View File

@@ -5,9 +5,13 @@
'use strict'; 'use strict';
const gulp = require('gulp'); const gulp = require('gulp');
const util = require('./lib/util');
const tsfmt = require('typescript-formatter'); const tsfmt = require('typescript-formatter');
const es = require('event-stream'); const es = require('event-stream');
const filter = require('gulp-filter'); const filter = require('gulp-filter');
const del = require('del');
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
const platform = require('service-downloader/out/platform').PlatformInformation;
const path = require('path'); const path = require('path');
const ext = require('./lib/extensions'); const ext = require('./lib/extensions');
const task = require('./lib/task'); const task = require('./lib/task');
@@ -15,6 +19,9 @@ const glob = require('glob');
const vsce = require('vsce'); const vsce = require('vsce');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
gulp.task('clean-mssql-extension', util.rimraf('extensions/mssql/node_modules'));
gulp.task('clean-credentials-extension', util.rimraf('extensions/credentials/node_modules'));
gulp.task('fmt', () => formatStagedFiles()); gulp.task('fmt', () => formatStagedFiles());
const formatFiles = (some) => { const formatFiles = (some) => {
const formatting = es.map(function (file, cb) { const formatting = es.map(function (file, cb) {
@@ -89,6 +96,45 @@ const formatStagedFiles = () => {
}); });
}; };
function installService() {
let config = require('../extensions/mssql/config.json');
return platform.getCurrent().then(p => {
let runtime = p.runtimeId;
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '../extensions/mssql/src', config.installDirectory);
let installer = new serviceDownloader(config);
let serviceInstallFolder = installer.getInstallDirectory(runtime);
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
return del(serviceInstallFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
});
}
gulp.task('install-sqltoolsservice', () => {
return installService();
});
gulp.task('install-ssmsmin', () => {
const config = require('../extensions/admin-tool-ext-win/config.json');
const runtime = 'Windows_64'; // admin-tool-ext is a windows only extension, and we only ship a 64 bit version, so locking the binaries as such
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
let installer = new serviceDownloader(config);
const serviceInstallFolder = installer.getInstallDirectory(runtime);
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
return del(serviceCleanupFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
});
const root = path.dirname(__dirname); const root = path.dirname(__dirname);
gulp.task('package-external-extensions', task.series( gulp.task('package-external-extensions', task.series(

View File

@@ -36,8 +36,10 @@ const { compileBuildTask } = require('./gulpfile.compile');
const { compileExtensionsBuildTask } = require('./gulpfile.extensions'); const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname)); const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n)); const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
const nodeModules = [ // {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const nodeModules = [
'electron', 'electron',
'original-fs', 'original-fs',
'rxjs/Observable', 'rxjs/Observable',
@@ -121,6 +123,7 @@ const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
resources: vscodeResources, resources: vscodeResources,
loaderConfig: common.loaderConfig(nodeModules), loaderConfig: common.loaderConfig(nodeModules),
out: 'out-vscode', out: 'out-vscode',
inlineAmdImages: true,
bundleInfo: undefined bundleInfo: undefined
}) })
)); ));
@@ -186,7 +189,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const checksums = computeChecksums(out, [ const checksums = computeChecksums(out, [
'vs/workbench/workbench.desktop.main.js', 'vs/workbench/workbench.desktop.main.js',
'vs/workbench/workbench.desktop.main.css', 'vs/workbench/workbench.desktop.main.css',
'vs/workbench/services/extensions/node/extensionHostProcess.js',
'vs/code/electron-browser/workbench/workbench.html', 'vs/code/electron-browser/workbench/workbench.html',
'vs/code/electron-browser/workbench/workbench.js' 'vs/code/electron-browser/workbench/workbench.js'
]); ]);
@@ -273,9 +275,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
} }
let result = all let result = all
.pipe(fileLengthFilter)
.pipe(filelength)
.pipe(fileLengthFilter.restore)
.pipe(util.skipDirectories()) .pipe(util.skipDirectories())
.pipe(util.fixWin32DirectoryPermissions()) .pipe(util.fixWin32DirectoryPermissions())
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true }))) .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
@@ -330,29 +329,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
}; };
} }
const fileLengthFilter = filter([
'**',
'!extensions/import/*.docx',
'!extensions/admin-tool-ext-win/license/**'
], {restore: true});
const filelength = es.through(function (file) {
const fileName = path.basename(file.relative);
const fileDir = path.dirname(file.relative);
//check the filename is < 50 characters (basename gets the filename with extension).
if (fileName.length > 50) {
console.error(`File name '${fileName}' under ${fileDir} is too long. Rename file to have less than 50 characters.`);
throw new Error('File name exceeds acceptable length of 50 characters: ' + fileName);
}
if (file.relative.length > 150) {
console.error(`File path ${file.relative} exceeds acceptable file-length. Rename the path to have less than 150 characters.`);
throw new Error('File path exceeds acceptable path-length of 150 characters: ' + file.relative);
}
this.emit('data', file);
});
const buildRoot = path.dirname(root); const buildRoot = path.dirname(root);
const BUILD_TARGETS = [ const BUILD_TARGETS = [

View File

@@ -92,7 +92,9 @@ function prepareDebPackage(arch) {
const postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' }) const postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ARCHITECTURE@@', debArch)) .pipe(replace('@@ARCHITECTURE@@', debArch))
// @ts-ignore JSON checking: quality is optional
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@')) .pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
// @ts-ignore JSON checking: updateUrl is optional
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
.pipe(rename('DEBIAN/postinst')); .pipe(rename('DEBIAN/postinst'));
@@ -167,7 +169,9 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@RELEASE@@', linuxPackageRevision)) .pipe(replace('@@RELEASE@@', linuxPackageRevision))
.pipe(replace('@@ARCHITECTURE@@', rpmArch)) .pipe(replace('@@ARCHITECTURE@@', rpmArch))
.pipe(replace('@@LICENSE@@', product.licenseName)) .pipe(replace('@@LICENSE@@', product.licenseName))
// @ts-ignore JSON checking: quality is optional
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@')) .pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
// @ts-ignore JSON checking: updateUrl is optional
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
.pipe(replace('@@DEPENDENCIES@@', rpmDependencies[rpmArch].join(', '))) .pipe(replace('@@DEPENDENCIES@@', rpmDependencies[rpmArch].join(', ')))
.pipe(rename('SPECS/' + product.applicationName + '.spec')); .pipe(rename('SPECS/' + product.applicationName + '.spec'));

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createAsar = void 0;
const path = require("path"); const path = require("path");
const es = require("event-stream"); const es = require("event-stream");
const pickle = require('chromium-pickle-js'); const pickle = require('chromium-pickle-js');

View File

@@ -18,7 +18,7 @@ const fancyLog = require('fancy-log');
const ansiColors = require('ansi-colors'); const ansiColors = require('ansi-colors');
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
const builtInExtensions = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions; const builtInExtensions = require('../builtInExtensions.json');
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json'); const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE']; const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];

View File

@@ -4,7 +4,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.bundle = void 0;
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const vm = require("vm"); const vm = require("vm");

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.watchTask = exports.compileTask = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs"); const fs = require("fs");
const gulp = require("gulp"); const gulp = require("gulp");

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.config = exports.getElectronVersion = void 0;
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const vfs = require("vinyl-fs"); const vfs = require("vinyl-fs");

View File

@@ -4,7 +4,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createImportRuleListener = void 0;
function createImportRuleListener(validateImport) { function createImportRuleListener(validateImport) {
function _checkImport(node) { function _checkImport(node) {
if (node && node.type === 'Literal' && typeof node.value === 'string') { if (node && node.type === 'Literal' && typeof node.value === 'string') {

View File

@@ -1,35 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
module.exports = new class ApiLiteralOrTypes {
constructor() {
this.meta = {
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' },
messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', }
};
}
create(context) {
return {
['TSDeclareFunction Identifier[name=/create.*/]']: (node) => {
var _a;
const decl = node.parent;
if (((_a = decl.returnType) === null || _a === void 0 ? void 0 : _a.typeAnnotation.type) !== experimental_utils_1.AST_NODE_TYPES.TSTypeReference) {
return;
}
if (decl.returnType.typeAnnotation.typeName.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) {
return;
}
const ident = decl.returnType.typeAnnotation.typeName.name;
if (ident === 'Promise' || ident === 'Thenable') {
context.report({
node,
messageId: 'sync'
});
}
}
};
}
};

View File

@@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
readonly meta: eslint.Rule.RuleMetaData = {
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' },
messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', }
};
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
['TSDeclareFunction Identifier[name=/create.*/]']: (node: any) => {
const decl = <TSESTree.FunctionDeclaration>(<TSESTree.Identifier>node).parent;
if (decl.returnType?.typeAnnotation.type !== AST_NODE_TYPES.TSTypeReference) {
return;
}
if (decl.returnType.typeAnnotation.typeName.type !== AST_NODE_TYPES.Identifier) {
return;
}
const ident = decl.returnType.typeAnnotation.typeName.name;
if (ident === 'Promise' || ident === 'Thenable') {
context.report({
node,
messageId: 'sync'
});
}
}
};
}
};

View File

@@ -1,81 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var _a;
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
module.exports = new (_a = class ApiEventNaming {
constructor() {
this.meta = {
docs: {
url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming'
},
messages: {
naming: 'Event names must follow this patten: `on[Did|Will]<Verb><Subject>`',
verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration',
subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API',
unknown: 'UNKNOWN event declaration, lint-rule needs tweaking'
}
};
}
create(context) {
const config = context.options[0];
const allowed = new Set(config.allowed);
const verbs = new Set(config.verbs);
return {
['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node) => {
var _a, _b;
const def = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent;
let ident;
if ((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) {
ident = def;
}
else if (((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || (def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {
ident = def.key;
}
if (!ident) {
// event on unknown structure...
return context.report({
node,
message: 'unknown'
});
}
if (allowed.has(ident.name)) {
// configured exception
return;
}
const match = ApiEventNaming._nameRegExp.exec(ident.name);
if (!match) {
context.report({
node: ident,
messageId: 'naming'
});
return;
}
// check that <verb> is spelled out (configured) as verb
if (!verbs.has(match[2].toLowerCase())) {
context.report({
node: ident,
messageId: 'verb',
data: { verb: match[2] }
});
}
// check that a subject (if present) has occurred
if (match[3]) {
const regex = new RegExp(match[3], 'ig');
const parts = context.getSourceCode().getText().split(regex);
if (parts.length < 3) {
context.report({
node: ident,
messageId: 'subject',
data: { subject: match[3] }
});
}
}
}
};
}
},
_a._nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/,
_a);

View File

@@ -1,91 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
export = new class ApiEventNaming implements eslint.Rule.RuleModule {
private static _nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/;
readonly meta: eslint.Rule.RuleMetaData = {
docs: {
url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming'
},
messages: {
naming: 'Event names must follow this patten: `on[Did|Will]<Verb><Subject>`',
verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration',
subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API',
unknown: 'UNKNOWN event declaration, lint-rule needs tweaking'
}
};
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
const config = <{ allowed: string[], verbs: string[] }>context.options[0];
const allowed = new Set(config.allowed);
const verbs = new Set(config.verbs);
return {
['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node: any) => {
const def = (<TSESTree.Identifier>node).parent?.parent?.parent;
let ident: TSESTree.Identifier | undefined;
if (def?.type === AST_NODE_TYPES.Identifier) {
ident = def;
} else if ((def?.type === AST_NODE_TYPES.TSPropertySignature || def?.type === AST_NODE_TYPES.ClassProperty) && def.key.type === AST_NODE_TYPES.Identifier) {
ident = def.key;
}
if (!ident) {
// event on unknown structure...
return context.report({
node,
message: 'unknown'
});
}
if (allowed.has(ident.name)) {
// configured exception
return;
}
const match = ApiEventNaming._nameRegExp.exec(ident.name);
if (!match) {
context.report({
node: ident,
messageId: 'naming'
});
return;
}
// check that <verb> is spelled out (configured) as verb
if (!verbs.has(match[2].toLowerCase())) {
context.report({
node: ident,
messageId: 'verb',
data: { verb: match[2] }
});
}
// check that a subject (if present) has occurred
if (match[3]) {
const regex = new RegExp(match[3], 'ig');
const parts = context.getSourceCode().getText().split(regex);
if (parts.length < 3) {
context.report({
node: ident,
messageId: 'subject',
data: { subject: match[3] }
});
}
}
}
};
}
};

View File

@@ -1,30 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var _a;
module.exports = new (_a = class ApiInterfaceNaming {
constructor() {
this.meta = {
messages: {
naming: 'Interfaces must not be prefixed with uppercase `I`',
}
};
}
create(context) {
return {
['TSInterfaceDeclaration Identifier']: (node) => {
const name = node.name;
if (ApiInterfaceNaming._nameRegExp.test(name)) {
context.report({
node,
messageId: 'naming'
});
}
}
};
}
},
_a._nameRegExp = /I[A-Z]/,
_a);

View File

@@ -1,35 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
import { TSESTree } from '@typescript-eslint/experimental-utils';
export = new class ApiInterfaceNaming implements eslint.Rule.RuleModule {
private static _nameRegExp = /I[A-Z]/;
readonly meta: eslint.Rule.RuleMetaData = {
messages: {
naming: 'Interfaces must not be prefixed with uppercase `I`',
}
};
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
['TSInterfaceDeclaration Identifier']: (node: any) => {
const name = (<TSESTree.Identifier>node).name;
if (ApiInterfaceNaming._nameRegExp.test(name)) {
context.report({
node,
messageId: 'naming'
});
}
}
};
}
};

View File

@@ -1,23 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
module.exports = new class ApiLiteralOrTypes {
constructor() {
this.meta = {
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' },
messages: { useEnum: 'Use enums, not literal-or-types', }
};
}
create(context) {
return {
['TSTypeAnnotation TSUnionType TSLiteralType']: (node) => {
context.report({
node: node,
messageId: 'useEnum'
});
}
};
}
};

View File

@@ -1,25 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
readonly meta: eslint.Rule.RuleMetaData = {
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' },
messages: { useEnum: 'Use enums, not literal-or-types', }
};
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
['TSTypeAnnotation TSUnionType TSLiteralType']: (node: any) => {
context.report({
node: node,
messageId: 'useEnum'
});
}
};
}
};

View File

@@ -4,7 +4,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.packageRebuildExtensionsStream = exports.cleanRebuildExtensions = exports.packageExternalExtensionsStream = exports.packageMarketplaceExtensionsStream = exports.packageLocalExtensionsStream = exports.fromMarketplace = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs"); const fs = require("fs");
const glob = require("glob"); const glob = require("glob");
@@ -28,6 +27,7 @@ const util = require('./util');
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
const commit = util.getVersion(root); const commit = util.getVersion(root);
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
const product = require('../../product.json');
function fromLocal(extensionPath) { function fromLocal(extensionPath) {
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js'); const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
const input = fs.existsSync(webpackFilename) const input = fs.existsSync(webpackFilename)
@@ -182,12 +182,12 @@ function fromMarketplace(extensionName, version, metadata) {
exports.fromMarketplace = fromMarketplace; exports.fromMarketplace = fromMarketplace;
const excludedExtensions = [ const excludedExtensions = [
'vscode-api-tests', 'vscode-api-tests',
'vscode-web-playground',
'vscode-colorize-tests', 'vscode-colorize-tests',
'vscode-test-resolver', 'vscode-test-resolver',
'ms-vscode.node-debug', 'ms-vscode.node-debug',
'ms-vscode.node-debug2', 'ms-vscode.node-debug2',
'integration-tests', 'integration-tests',
'ms.vscode.js-debug-nightly'
]; ];
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const externalExtensions = [ const externalExtensions = [
@@ -213,7 +213,8 @@ const rebuildExtensions = [
'big-data-cluster', 'big-data-cluster',
'mssql' 'mssql'
]; ];
const builtInExtensions = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions; const builtInExtensions = require('../builtInExtensions.json')
.filter(({ forQualities }) => { var _a; return !product.quality || ((_a = forQualities === null || forQualities === void 0 ? void 0 : forQualities.includes) === null || _a === void 0 ? void 0 : _a.call(forQualities, product.quality)) !== false; });
function packageLocalExtensionsStream() { function packageLocalExtensionsStream() {
const localExtensionDescriptions = glob.sync('extensions/*/package.json') const localExtensionDescriptions = glob.sync('extensions/*/package.json')
.map(manifestPath => { .map(manifestPath => {

View File

@@ -27,6 +27,7 @@ const util = require('./util');
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
const commit = util.getVersion(root); const commit = util.getVersion(root);
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
const product = require('../../product.json');
function fromLocal(extensionPath: string): Stream { function fromLocal(extensionPath: string): Stream {
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js'); const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
@@ -216,12 +217,12 @@ export function fromMarketplace(extensionName: string, version: string, metadata
const excludedExtensions = [ const excludedExtensions = [
'vscode-api-tests', 'vscode-api-tests',
'vscode-web-playground',
'vscode-colorize-tests', 'vscode-colorize-tests',
'vscode-test-resolver', 'vscode-test-resolver',
'ms-vscode.node-debug', 'ms-vscode.node-debug',
'ms-vscode.node-debug2', 'ms-vscode.node-debug2',
'integration-tests', // {{SQL CARBON EDIT}} 'integration-tests', // {{SQL CARBON EDIT}}
'ms.vscode.js-debug-nightly'
]; ];
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -254,10 +255,12 @@ interface IBuiltInExtension {
name: string; name: string;
version: string; version: string;
repo: string; repo: string;
forQualities?: ReadonlyArray<string>;
metadata: any; metadata: any;
} }
const builtInExtensions: IBuiltInExtension[] = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions; const builtInExtensions = (<IBuiltInExtension[]>require('../builtInExtensions.json'))
.filter(({ forQualities }) => !product.quality || forQualities?.includes?.(product.quality) !== false);
export function packageLocalExtensionsStream(): NodeJS.ReadWriteStream { export function packageLocalExtensionsStream(): NodeJS.ReadWriteStream {
const localExtensionDescriptions = (<string[]>glob.sync('extensions/*/package.json')) const localExtensionDescriptions = (<string[]>glob.sync('extensions/*/package.json'))

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getVersion = void 0;
const path = require("path"); const path = require("path");
const fs = require("fs"); const fs = require("fs");
/** /**

View File

@@ -4,7 +4,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareIslFiles = exports.prepareI18nPackFiles = exports.pullI18nPackFiles = exports.prepareI18nFiles = exports.pullSetupXlfFiles = exports.pullCoreAndExtensionsXlfFiles = exports.findObsoleteResources = exports.pushXlfFiles = exports.createXlfFilesForIsl = exports.createXlfFilesForExtensions = exports.createXlfFilesForCoreBundle = exports.getResource = exports.processNlsFiles = exports.Limiter = exports.XLF = exports.Line = exports.externalExtensionsWithTranslations = exports.extraLanguages = exports.defaultLanguages = void 0;
const path = require("path"); const path = require("path");
const fs = require("fs"); const fs = require("fs");
const event_stream_1 = require("event-stream"); const event_stream_1 = require("event-stream");
@@ -101,161 +100,155 @@ class TextModel {
return this._lines; return this._lines;
} }
} }
let XLF = /** @class */ (() => { class XLF {
class XLF { constructor(project) {
constructor(project) { this.project = project;
this.project = project; this.buffer = [];
this.buffer = []; this.files = Object.create(null);
this.files = Object.create(null); this.numberOfMessages = 0;
this.numberOfMessages = 0; }
toString() {
this.appendHeader();
for (let file in this.files) {
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
for (let item of this.files[file]) {
this.addStringItem(item);
}
this.appendNewLine('</body></file>', 2);
} }
toString() { this.appendFooter();
this.appendHeader(); return this.buffer.join('\r\n');
for (let file in this.files) { }
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2); addFile(original, keys, messages) {
for (let item of this.files[file]) { if (keys.length === 0) {
this.addStringItem(file, item); console.log('No keys in ' + original);
return;
}
if (keys.length !== messages.length) {
throw new Error(`Unmatching keys(${keys.length}) and messages(${messages.length}).`);
}
this.numberOfMessages += keys.length;
this.files[original] = [];
let existingKeys = new Set();
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let realKey;
let comment;
if (Is.string(key)) {
realKey = key;
comment = undefined;
}
else if (LocalizeInfo.is(key)) {
realKey = key.key;
if (key.comment && key.comment.length > 0) {
comment = key.comment.map(comment => encodeEntities(comment)).join('\r\n');
} }
this.appendNewLine('</body></file>', 2);
} }
this.appendFooter(); if (!realKey || existingKeys.has(realKey)) {
return this.buffer.join('\r\n'); continue;
}
addFile(original, keys, messages) {
if (keys.length === 0) {
console.log('No keys in ' + original);
return;
} }
if (keys.length !== messages.length) { existingKeys.add(realKey);
throw new Error(`Unmatching keys(${keys.length}) and messages(${messages.length}).`); let message = encodeEntities(messages[i]);
} this.files[original].push({ id: realKey, message: message, comment: comment });
this.numberOfMessages += keys.length;
this.files[original] = [];
let existingKeys = new Set();
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let realKey;
let comment;
if (Is.string(key)) {
realKey = key;
comment = undefined;
}
else if (LocalizeInfo.is(key)) {
realKey = key.key;
if (key.comment && key.comment.length > 0) {
comment = key.comment.map(comment => encodeEntities(comment)).join('\r\n');
}
}
if (!realKey || existingKeys.has(realKey)) {
continue;
}
existingKeys.add(realKey);
let message = encodeEntities(messages[i]);
this.files[original].push({ id: realKey, message: message, comment: comment });
}
}
addStringItem(file, item) {
if (!item.id || item.message === undefined || item.message === null) {
throw new Error(`No item ID or value specified: ${JSON.stringify(item)}. File: ${file}`);
}
if (item.message.length === 0) {
log(`Item with id ${item.id} in file ${file} has an empty message.`);
}
this.appendNewLine(`<trans-unit id="${item.id}">`, 4);
this.appendNewLine(`<source xml:lang="en">${item.message}</source>`, 6);
if (item.comment) {
this.appendNewLine(`<note>${item.comment}</note>`, 6);
}
this.appendNewLine('</trans-unit>', 4);
}
appendHeader() {
this.appendNewLine('<?xml version="1.0" encoding="utf-8"?>', 0);
this.appendNewLine('<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">', 0);
}
appendFooter() {
this.appendNewLine('</xliff>', 0);
}
appendNewLine(content, indent) {
let line = new Line(indent);
line.append(content);
this.buffer.push(line.toString());
} }
} }
XLF.parsePseudo = function (xlfString) { addStringItem(item) {
return new Promise((resolve) => { if (!item.id || !item.message) {
let parser = new xml2js.Parser(); throw new Error(`No item ID or value specified: ${JSON.stringify(item)}`);
let files = []; }
parser.parseString(xlfString, function (_err, result) { this.appendNewLine(`<trans-unit id="${item.id}">`, 4);
const fileNodes = result['xliff']['file']; this.appendNewLine(`<source xml:lang="en">${item.message}</source>`, 6);
fileNodes.forEach(file => { if (item.comment) {
const originalFilePath = file.$.original; this.appendNewLine(`<note>${item.comment}</note>`, 6);
const messages = {}; }
const transUnits = file.body[0]['trans-unit']; this.appendNewLine('</trans-unit>', 4);
if (transUnits) { }
transUnits.forEach((unit) => { appendHeader() {
const key = unit.$.id; this.appendNewLine('<?xml version="1.0" encoding="utf-8"?>', 0);
const val = pseudify(unit.source[0]['_'].toString()); this.appendNewLine('<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">', 0);
if (key && val) { }
messages[key] = decodeEntities(val); appendFooter() {
} this.appendNewLine('</xliff>', 0);
}); }
files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' }); appendNewLine(content, indent) {
} let line = new Line(indent);
}); line.append(content);
resolve(files); this.buffer.push(line.toString());
}); }
}); }
};
XLF.parse = function (xlfString) {
return new Promise((resolve, reject) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (err, result) {
if (err) {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}
const fileNodes = result['xliff']['file'];
if (!fileNodes) {
reject(new Error(`XLF parsing error: XLIFF file does not contain "xliff" or "file" node(s) required for parsing.`));
}
fileNodes.forEach((file) => {
const originalFilePath = file.$.original;
if (!originalFilePath) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain original attribute to determine the original location of the resource file.`));
}
let language = file.$['target-language'];
if (!language) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain target-language attribute to determine translated language.`));
}
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
if (!unit.target) {
return; // No translation available
}
let val = unit.target[0];
if (typeof val !== 'string') {
val = val._;
}
if (key && val) {
messages[key] = decodeEntities(val);
}
else {
reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
}
});
resolve(files);
});
});
};
return XLF;
})();
exports.XLF = XLF; exports.XLF = XLF;
XLF.parsePseudo = function (xlfString) {
return new Promise((resolve) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (_err, result) {
const fileNodes = result['xliff']['file'];
fileNodes.forEach(file => {
const originalFilePath = file.$.original;
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
const val = pseudify(unit.source[0]['_'].toString());
if (key && val) {
messages[key] = decodeEntities(val);
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' });
}
});
resolve(files);
});
});
};
XLF.parse = function (xlfString) {
return new Promise((resolve, reject) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (err, result) {
if (err) {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}
const fileNodes = result['xliff']['file'];
if (!fileNodes) {
reject(new Error(`XLF parsing error: XLIFF file does not contain "xliff" or "file" node(s) required for parsing.`));
}
fileNodes.forEach((file) => {
const originalFilePath = file.$.original;
if (!originalFilePath) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain original attribute to determine the original location of the resource file.`));
}
let language = file.$['target-language'];
if (!language) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain target-language attribute to determine translated language.`));
}
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
if (!unit.target) {
return; // No translation available
}
let val = unit.target[0];
if (typeof val !== 'string') {
val = val._;
}
if (key && val) {
messages[key] = decodeEntities(val);
}
else {
reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
}
});
resolve(files);
});
});
};
class Limiter { class Limiter {
constructor(maxDegreeOfParalellism) { constructor(maxDegreeOfParalellism) {
this.maxDegreeOfParalellism = maxDegreeOfParalellism; this.maxDegreeOfParalellism = maxDegreeOfParalellism;

View File

@@ -119,11 +119,7 @@
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/contrib/notebook", "name": "vs/workbench/contrib/quickopen",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/quickaccess",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
@@ -146,10 +142,6 @@
"name": "vs/workbench/contrib/search", "name": "vs/workbench/contrib/search",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/contrib/searchEditor",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/contrib/snippets", "name": "vs/workbench/contrib/snippets",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -262,10 +254,6 @@
"name": "vs/workbench/services/files", "name": "vs/workbench/services/files",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/log",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/integrity", "name": "vs/workbench/services/integrity",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -306,10 +294,6 @@
"name": "vs/workbench/services/textMate", "name": "vs/workbench/services/textMate",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/workingCopy",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/workspaces", "name": "vs/workbench/services/workspaces",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -337,14 +321,6 @@
{ {
"name": "vs/workbench/services/userDataSync", "name": "vs/workbench/services/userDataSync",
"project": "vscode-workbench" "project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/timeline",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/authentication",
"project": "vscode-workbench"
} }
] ]
} }

View File

@@ -201,7 +201,7 @@ export class XLF {
for (let file in this.files) { for (let file in this.files) {
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2); this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
for (let item of this.files[file]) { for (let item of this.files[file]) {
this.addStringItem(file, item); this.addStringItem(item);
} }
this.appendNewLine('</body></file>', 2); this.appendNewLine('</body></file>', 2);
} }
@@ -243,12 +243,9 @@ export class XLF {
} }
} }
private addStringItem(file: string, item: Item): void { private addStringItem(item: Item): void {
if (!item.id || item.message === undefined || item.message === null) { if (!item.id || !item.message) {
throw new Error(`No item ID or value specified: ${JSON.stringify(item)}. File: ${file}`); throw new Error(`No item ID or value specified: ${JSON.stringify(item)}`);
}
if (item.message.length === 0) {
log(`Item with id ${item.id} in file ${file} has an empty message.`);
} }
this.appendNewLine(`<trans-unit id="${item.id}">`, 4); this.appendNewLine(`<trans-unit id="${item.id}">`, 4);

View File

@@ -38,7 +38,6 @@ const CORE_TYPES = [
'group', 'group',
'groupEnd', 'groupEnd',
'table', 'table',
'assert',
'Error', 'Error',
'String', 'String',
'throws', 'throws',
@@ -61,7 +60,7 @@ const RULES = [
}, },
// Common: vs/base/common/platform.ts // Common: vs/base/common/platform.ts
{ {
target: '**/{vs,sql}/base/common/platform.ts', target: '**/vs/base/common/platform.ts',
allowedTypes: [ allowedTypes: [
...CORE_TYPES, ...CORE_TYPES,
// Safe access to postMessage() and friends // Safe access to postMessage() and friends
@@ -75,7 +74,7 @@ const RULES = [
}, },
// Common: vs/workbench/api/common/extHostExtensionService.ts // Common: vs/workbench/api/common/extHostExtensionService.ts
{ {
target: '**/{vs,sql}/workbench/api/common/extHostExtensionService.ts', target: '**/vs/workbench/api/common/extHostExtensionService.ts',
allowedTypes: [ allowedTypes: [
...CORE_TYPES, ...CORE_TYPES,
// Safe access to global // Safe access to global
@@ -103,14 +102,6 @@ const RULES = [
'@types/node' // no node.js '@types/node' // no node.js
] ]
}, },
// Browser (editor contrib)
{
target: '**/src/{vs,sql}/editor/contrib/**',
allowedTypes: CORE_TYPES,
disallowedDefinitions: [
'@types/node' // no node.js
]
},
// node.js // node.js
{ {
target: '**/{vs,sql}/**/node/**', target: '**/{vs,sql}/**/node/**',

View File

@@ -39,7 +39,6 @@ const CORE_TYPES = [
'group', 'group',
'groupEnd', 'groupEnd',
'table', 'table',
'assert',
'Error', 'Error',
'String', 'String',
'throws', 'throws',
@@ -65,7 +64,7 @@ const RULES = [
// Common: vs/base/common/platform.ts // Common: vs/base/common/platform.ts
{ {
target: '**/{vs,sql}/base/common/platform.ts', target: '**/vs/base/common/platform.ts',
allowedTypes: [ allowedTypes: [
...CORE_TYPES, ...CORE_TYPES,
@@ -81,7 +80,7 @@ const RULES = [
// Common: vs/workbench/api/common/extHostExtensionService.ts // Common: vs/workbench/api/common/extHostExtensionService.ts
{ {
target: '**/{vs,sql}/workbench/api/common/extHostExtensionService.ts', target: '**/vs/workbench/api/common/extHostExtensionService.ts',
allowedTypes: [ allowedTypes: [
...CORE_TYPES, ...CORE_TYPES,
@@ -113,15 +112,6 @@ const RULES = [
] ]
}, },
// Browser (editor contrib)
{
target: '**/src/{vs,sql}/editor/contrib/**',
allowedTypes: CORE_TYPES,
disallowedDefinitions: [
'@types/node' // no node.js
]
},
// node.js // node.js
{ {
target: '**/{vs,sql}/**/node/**', target: '**/{vs,sql}/**/node/**',

View File

@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.minifyTask = exports.optimizeTask = exports.loaderConfig = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs");
const gulp = require("gulp"); const gulp = require("gulp");
const concat = require("gulp-concat"); const concat = require("gulp-concat");
const minifyCSS = require("gulp-cssnano"); const minifyCSS = require("gulp-cssnano");
@@ -135,6 +135,14 @@ function optimizeTask(opts) {
if (err || !result) { if (err || !result) {
return bundlesStream.emit('error', JSON.stringify(err)); return bundlesStream.emit('error', JSON.stringify(err));
} }
if (opts.inlineAmdImages) {
try {
result = inlineAmdImages(src, result);
}
catch (err) {
return bundlesStream.emit('error', JSON.stringify(err));
}
}
toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream); toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream);
// Remove css inlined resources // Remove css inlined resources
const filteredResources = resources.slice(); const filteredResources = resources.slice();
@@ -170,6 +178,39 @@ function optimizeTask(opts) {
}; };
} }
exports.optimizeTask = optimizeTask; exports.optimizeTask = optimizeTask;
function inlineAmdImages(src, result) {
for (const outputFile of result.files) {
for (const sourceFile of outputFile.sources) {
if (sourceFile.path && /\.js$/.test(sourceFile.path)) {
sourceFile.contents = sourceFile.contents.replace(/\([^.]+\.registerAndGetAmdImageURL\(([^)]+)\)\)/g, (_, m0) => {
let imagePath = m0;
// remove `` or ''
if ((imagePath.charAt(0) === '`' && imagePath.charAt(imagePath.length - 1) === '`')
|| (imagePath.charAt(0) === '\'' && imagePath.charAt(imagePath.length - 1) === '\'')) {
imagePath = imagePath.substr(1, imagePath.length - 2);
}
if (!/\.(png|svg)$/.test(imagePath)) {
console.log(`original: ${_}`);
return _;
}
const repoLocation = path.join(src, imagePath);
const absoluteLocation = path.join(REPO_ROOT_PATH, repoLocation);
if (!fs.existsSync(absoluteLocation)) {
const message = `Invalid amd image url in file ${sourceFile.path}: ${imagePath}`;
console.log(message);
throw new Error(message);
}
const fileContents = fs.readFileSync(absoluteLocation);
const mime = /\.svg$/.test(imagePath) ? 'image/svg+xml' : 'image/png';
// Mark the file as inlined so we don't ship it by itself
result.cssInlinedResources.push(repoLocation);
return `("data:${mime};base64,${fileContents.toString('base64')}")`;
});
}
}
}
return result;
}
/** /**
* Wrap around uglify and allow the preserveComments function * Wrap around uglify and allow the preserveComments function
* to have a file "context" to include our copyright only once per file. * to have a file "context" to include our copyright only once per file.

View File

@@ -6,6 +6,7 @@
'use strict'; 'use strict';
import * as es from 'event-stream'; import * as es from 'event-stream';
import * as fs from 'fs';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as concat from 'gulp-concat'; import * as concat from 'gulp-concat';
import * as minifyCSS from 'gulp-cssnano'; import * as minifyCSS from 'gulp-cssnano';
@@ -161,6 +162,10 @@ export interface IOptimizeTaskOpts {
* (emit bundleInfo.json file) * (emit bundleInfo.json file)
*/ */
bundleInfo: boolean; bundleInfo: boolean;
/**
* replace calls to `registerAndGetAmdImageURL` with data uris
*/
inlineAmdImages: boolean;
/** /**
* (out folder name) * (out folder name)
*/ */
@@ -194,6 +199,14 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
bundle.bundle(entryPoints, loaderConfig, function (err, result) { bundle.bundle(entryPoints, loaderConfig, function (err, result) {
if (err || !result) { return bundlesStream.emit('error', JSON.stringify(err)); } if (err || !result) { return bundlesStream.emit('error', JSON.stringify(err)); }
if (opts.inlineAmdImages) {
try {
result = inlineAmdImages(src, result);
} catch (err) {
return bundlesStream.emit('error', JSON.stringify(err));
}
}
toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream); toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream);
// Remove css inlined resources // Remove css inlined resources
@@ -238,6 +251,42 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
}; };
} }
function inlineAmdImages(src: string, result: bundle.IBundleResult): bundle.IBundleResult {
for (const outputFile of result.files) {
for (const sourceFile of outputFile.sources) {
if (sourceFile.path && /\.js$/.test(sourceFile.path)) {
sourceFile.contents = sourceFile.contents.replace(/\([^.]+\.registerAndGetAmdImageURL\(([^)]+)\)\)/g, (_, m0) => {
let imagePath = m0;
// remove `` or ''
if ((imagePath.charAt(0) === '`' && imagePath.charAt(imagePath.length - 1) === '`')
|| (imagePath.charAt(0) === '\'' && imagePath.charAt(imagePath.length - 1) === '\'')) {
imagePath = imagePath.substr(1, imagePath.length - 2);
}
if (!/\.(png|svg)$/.test(imagePath)) {
console.log(`original: ${_}`);
return _;
}
const repoLocation = path.join(src, imagePath);
const absoluteLocation = path.join(REPO_ROOT_PATH, repoLocation);
if (!fs.existsSync(absoluteLocation)) {
const message = `Invalid amd image url in file ${sourceFile.path}: ${imagePath}`;
console.log(message);
throw new Error(message);
}
const fileContents = fs.readFileSync(absoluteLocation);
const mime = /\.svg$/.test(imagePath) ? 'image/svg+xml' : 'image/png';
// Mark the file as inlined so we don't ship it by itself
result.cssInlinedResources.push(repoLocation);
return `("data:${mime};base64,${fileContents.toString('base64')}")`;
});
}
}
}
return result;
}
declare class FileWithCopyright extends VinylFile { declare class FileWithCopyright extends VinylFile {
public __hasOurCopyright: boolean; public __hasOurCopyright: boolean;
} }

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createReporter = void 0;
const es = require("event-stream"); const es = require("event-stream");
const _ = require("underscore"); const _ = require("underscore");
const fancyLog = require("fancy-log"); const fancyLog = require("fancy-log");

Some files were not shown because too many files have changed in this diff Show More