Compare commits

..

486 Commits
1.5.2 ... 1.8.0

Author SHA1 Message Date
Charles Gagnon
96e2145931 Update admin-tool-ext-win README (#5911)
(cherry picked from commit b7956c5fbf)
2019-06-05 18:21:33 -07:00
Charles Gagnon
5845135366 Update admin-tool-ext-win extension to require ADS 1.8.0 (#5905)
* Update admin-tool-ext-win extension to require ADS 1.8.0

* Use correct version check

(cherry picked from commit 7d67711336)
2019-06-05 16:28:29 -07:00
Charles Gagnon
4b05fa9075 More CMS test fixes (#5901)
(cherry picked from commit f320deaa73)
2019-06-05 15:24:43 -07:00
Charles Gagnon
bd1f133ca5 Fix CMS tests (#5897)
* Fix CMS tests

* Fix spacing and format

(cherry picked from commit bb470c3676)
2019-06-04 23:11:07 -07:00
Aditya Bist
944a8f9c72 Make sure the first Connection Dialog has correct provider. (#5884)
* force a restart for cms

* remove unneeded existing conditional

* fix for random provider when opening a connection dialog

(cherry picked from commit 685a608518)
2019-06-04 17:58:38 -07:00
Charles Gagnon
441b57f3ca Merge branch 'release/1.8' of https://github.com/Microsoft/azuredatastudio into release/1.8 2019-06-04 17:51:01 -07:00
Aditya Bist
803b02be81 force cms to reload (#5890) 2019-06-04 17:20:04 -07:00
Charles Gagnon
d76bba1458 Remove VS redist license
This isn't necessary since we aren't providing the VS binaries as redist-able. VS has signed off as confirming that the main extension license is enough to cover the VS binaries as well. (#5880)

(cherry picked from commit 137c78c04e)
2019-06-04 16:01:33 -07:00
Karl Burtram
9b40838ea3 Bump SQL Tools Service to 1.5.0-alpha.99 (#5879)
(cherry picked from commit d9e1aa57c9)
2019-06-04 14:33:24 -07:00
Anthony Dresser
6c98603979 store active tab so it isn't overwritten (#5875)
(cherry picked from commit 912c80e496)
2019-06-04 14:32:04 -07:00
Anthony Dresser
0e2d1e515e Fix handling of state in the grid panel (#5867)
* fix handling of state in the grid panel

* trigger rebuild

* trigger rebuild

(cherry picked from commit 7390dce536)
2019-06-04 14:31:57 -07:00
Anthony Dresser
bfb03d160e make sure we update our sizes when we update the size of items (#5874)
(cherry picked from commit 540635c54f)
2019-06-04 14:29:54 -07:00
Aditya Bist
ff21a93e00 remove SQL Login from CMS and add error messages (#5873)
(cherry picked from commit 6197279e83)
2019-06-04 14:29:38 -07:00
udeeshagautam
763080aea0 Increasing schema compare and dacfx ext versions in Source code (#5832)
* increasing schema compare and dacfx ext versions

* updating azdata dependency version
2019-06-03 12:18:03 -07:00
Cory Rivera
fb713e0762 Automatically detect existing Python/Conda installs in Configure Python dialog. (#5801) 2019-06-03 11:56:06 -07:00
Aditya Bist
a8d41a6717 updated cms version to not break with old core (#5812) 2019-06-03 09:06:55 -07:00
Chris LaFreniere
34bc0efc1c Check if sessionManager exists (#5811) 2019-05-31 17:42:12 -07:00
Anthony Dresser
23e4a30cd1 dispose and clear things out when they are not needed to free up memory (#5805) 2019-05-31 17:24:01 -07:00
Karl Burtram
ba58b0f429 Update CMS extension display name to be consistent with other extensions (#5802) 2019-05-31 16:04:13 -07:00
Charles Gagnon
89e6e062ab Add licenses for SsmsMin extension (#5806)
* Add licenses to Admin Tool Extension

* Update license link
2019-05-31 15:37:48 -07:00
Anthony Dresser
33ff8ec5a3 Fix instances of listeners not being disposed in Query Editor (#5798)
* fix instances of listeners not being disposed

* spelling mistake
2019-05-31 15:14:03 -07:00
Yurong He
9f4053d051 Fixed #4113 Added integration tests to cover cell language unit tests (#5788)
* Fixed #4113

* Resolve PR comments
2019-05-31 15:03:21 -07:00
Aditya Bist
1bb9d142f1 CMS - error check (#5796)
* cms connections dont save

* added value to enum

* remove refresh and update provider name for cms

* removed ownerUri from saved connection and contributed to array

* removed owneruri

* ownerUri not needed any more

* removed AAD from cms

* initial review

* changed comments

* add back saveProfile option for connectionProfile

* review fixes and other UI improvements

* fixed auth

* added cms integration tests

* added constants

* removed utils from apiwrapper

* changed connection type name

* review comments

* clearer code and addressed reviews

* added more error checks

* add back functions in apiwrapper
2019-05-31 14:27:27 -07:00
Aditya Bist
b10bd70d67 bump agent version for june (#5800) 2019-05-31 13:52:10 -07:00
Anthony Dresser
dc2ff2295e change message focus only on query end (#5793) 2019-05-31 13:23:17 -07:00
Anthony Dresser
f231d6945f clear indicator when a query starts (#5795) 2019-05-31 13:19:03 -07:00
Kevin Cunnane
8786caf630 Fix #4976 AAD Login will not work from Azure (#5768)
- Azure token wasn't being copied into profile so expand didn't work, it spun forever
- Fixed this by saving in password/token after the connection profile copy, & refactored to be cleaner
- We should ideally ensure session notifies resolves even on fail so if there's a different error it'll break, not spin forever. Punting this part of the fix for now
- Also doesn't solve issue where we always try to connect even if user + password combo isn't saved. Will investigate / work in a separate PR on this.
2019-05-31 12:47:45 -07:00
Anthony Dresser
5c520bc82e Apply title bar adjustment to edit data (#5777)
* apply title bar adjustment to edit data

* wi

* rework layout to be simplier

* fix layout
2019-05-31 12:03:52 -07:00
kisantia
1ccf408654 Fix #5702 Schema Compare Diff is editable (#5703)
* make diff readonly

* change to use ResourceEditorInput instead of UntitleEditorInput since it is readonly

* inject service

* use this instead of declaring local variables

* addressing comments
2019-05-31 11:45:04 -07:00
Anthony Dresser
76ebfe38a1 focus messages on error (#5791) 2019-05-31 11:43:15 -07:00
Anthony Dresser
364206010b clear out tabs when a input is set (#5789) 2019-05-31 11:38:52 -07:00
Anthony Dresser
559c675164 Hide results tab when there are none (#5763)
* wip

* add behavior around hiding results when there are none

* fix strict null access
2019-05-31 11:18:33 -07:00
Aditya Bist
1773dede25 CMS fit and finish (#5542)
* cms connections dont save

* added value to enum

* remove refresh and update provider name for cms

* removed ownerUri from saved connection and contributed to array

* removed owneruri

* ownerUri not needed any more

* removed AAD from cms

* initial review

* changed comments

* add back saveProfile option for connectionProfile

* review fixes and other UI improvements

* fixed auth

* added cms integration tests

* added constants

* removed utils from apiwrapper

* changed connection type name

* review comments

* clearer code and addressed reviews
2019-05-31 11:14:37 -07:00
Gene Lee
fa52478ffa Changed output channel name from 'Jupyter Notebooks' to 'Notebooks' (#5780) 2019-05-31 11:08:34 -07:00
Kevin Cunnane
ae0603c041 Improve Azure startup time and fix command palette (#5761)
* Improve Azure startup time and fix command palette
- Improvement (but not full fix) for #4732 where Azure startup is very slow.
This speeds the startup by up to 5 seconds by
  - Changing from fixed 5 second initial wait time to a promise to check for accounts
  - Using the accounts changed notification to send a message when accounts are ready. This is usually what will "win out" since Azure seems to load before the Account Providers are set up.
- Remove right-click actions from the command palette.
- Rename Azure actions so it's clear what they are in the command palette.

* Remove coveralls task while investigating how to make optional task

* Add void return type
2019-05-31 10:22:01 -07:00
Kevin Cunnane
a364af5c4c Fix #5765 Trusted state handling (#5775)
- Notebooks Can be Improperly Trusted After Save + Reopen
Fix was to only save if actually trusted.
Also fixed condition where it wasn't correctly skipping if in the queue
2019-05-31 10:21:30 -07:00
Anthony Dresser
6b76611c93 Handle maintaining tab state properly (#5776)
* handle maintaining tab state properly

* some code cleanup
2019-05-31 10:13:19 -07:00
udeeshagautam
d7df71c8ba Do not add generated files from Temp if file is not dirty (#5758)
* Do not add generated files from Temp if file is not dirty

* restricting the path more

* Adding tmpdir as per CR comment
2019-05-30 18:39:42 -07:00
udeeshagautam
ea464abaaf show not supported message for backup for Azure (#5762)
* show not supported message for backup for Azure

* Adding PR comments
2019-05-30 15:34:11 -07:00
Yurong He
a026b682c4 Fixed #4485 add max-width for attachTo and tooltip (#5493)
* Added tooltip of selectBox and set max width of attach to

* Undo our change, vscode fixed the issue
2019-05-30 15:19:06 -07:00
Alan Ren
8e3fa660fd fix smoke test failure (#5764) 2019-05-30 15:03:18 -07:00
kisantia
c9257822ec Disable schema compare generate script and apply buttons after applying changes (#5759)
* disable generate script and apply buttons after applying changes

* reenable buttons if apply failed
2019-05-30 14:08:47 -07:00
Charles Gagnon
783bb8bd92 Fix editor title not updating after connect (#5760)
* Fix editor title not updating after connect

* Fix disconnect to also update title
2019-05-30 13:39:16 -07:00
Anthony Dresser
bf19ab6ad9 add messages to title to help discoverability (#5733) 2019-05-30 13:31:32 -07:00
udeeshagautam
c4e59027fc Backup to open correctly from insights dialog (#5737)
* recreate modal dialog button to ensure onDidClick works properly

* fixing comment message

* Adding PR comments
2019-05-30 12:32:38 -07:00
Karl Burtram
f9b7bc26c0 Add a null check before using settings editor options (#5756) 2019-05-30 11:31:00 -07:00
Anthony Dresser
a197cd6158 Add customizable error color; fix line height in Messages (#5734)
* add customizable error color; fix line height

* ensure proper disposal of elements
2019-05-30 10:22:39 -07:00
Karl Burtram
ae5b506848 Provide a default result grid height (#5739)
* Revert "Revert "Provide a default result grid height (#5710)" (#5738)"

This reverts commit f8ab5fef78.

* Tune the sizing a bit to be more closer to May release
2019-05-30 10:21:09 -07:00
Karl Burtram
f8ab5fef78 Revert "Provide a default result grid height (#5710)" (#5738)
This reverts commit 0893ba33fc.
2019-05-29 18:23:12 -07:00
Karl Burtram
0893ba33fc Provide a default result grid height (#5710) 2019-05-29 17:38:47 -07:00
Maddy
75ce8d6c20 Maddy/properties widget for endpoints (#5654)
* changes to resue properties widget for endpoints

* comments added

* added loader

* changes to address the review comments: code clean up and constants

* dark theme style fox and misc

* added varibale for display aligment

* renamed hyperlink to isHyperlink

* added endpoints as a modelview to be used on dashboard

* added padding to fix the overlap issues.

* removed the propertieswidget changes

* formatting fixes for hygiene errors

* renamed endpoints to bdc-endpoints

* chnages to address the comments

* added null check
2019-05-29 17:30:11 -07:00
Kevin Cunnane
6d56701b5b Refactor to remove controller and static instance (#5735) 2019-05-29 17:23:23 -07:00
Anthony Dresser
ea8aa92dd5 fix scrolling in messages (#5732) 2019-05-29 15:13:56 -07:00
Charles Gagnon
9fc634dfe0 Fix query files not being editable (#5731)
* Initial attempt at fix

* Use two separate containers and just swap between those
2019-05-29 14:21:06 -07:00
udeeshagautam
4b1088edbc Bug/schema compare apply confirmation (#5698)
* Ask confirmation before apply

* Adding PR comments
2019-05-29 13:30:22 -07:00
Kevin Cunnane
8e355a14e9 Fix #4529 'Use column names as labels' by default (#5723)
- Fixes charting issue
2019-05-29 13:03:31 -07:00
Anthony Dresser
ef2b6f91f1 Fix task flicker (#5694)
* adjust timer rendering

* give each element a unique id

* remove testing code

* remove unused imports

* change task timeout to 1000
2019-05-29 11:34:27 -07:00
Arvind Ranasaria
9cae7a0a49 First version of Stress (#5499)
* First version of Stress - moving over from feat/Stress1 branch

* a working version - still issues with stresssified notebook tests

* update notebooks to use new message event (#5395)

* Latest changes for notebook tests

* Stressify objectExplorer tests

* formatting changes

* removing the tracing added previously and ability to set tsc verbose option in tsconfig.json

* addressing review feedback

* addressing review feedback

* implementing runtime parameter for Stress

* addresing review feedback and moved out stress modules to its own project outside of azuredata source tree

* referencing adstest from the github location

* incorporating review feedback

* Review feedbak

* removing uncommong entries added to .gitignore

* removing unrelated change

* replacing debug/trace statements with console.info or cosole.warn statments in integration-tests\main.tx
2019-05-29 11:18:20 -07:00
kisantia
9a55ca3021 Show message to recompare when schema compare options change (#5690)
* add message to recompare if options changed

* changes after rebasing

* Add compare button to notification

* remove async

* change to yes and no button
2019-05-28 16:46:44 -07:00
Charles Gagnon
e8b20c86c1 Have Install-SsmsMin task clean up all older versions (#5670) 2019-05-28 15:21:19 -07:00
Yurong He
dc78a4af88 Fixed #5631 didn't use % for variable name (#5633) 2019-05-28 15:18:15 -07:00
Gene Lee
34273907f7 Made connection icon to be remembered by memento in ConnectionManagementService (#5523) 2019-05-28 14:45:28 -07:00
Karl Burtram
ca1c5899a1 Bump vs code version metadata for June (#5697) 2019-05-28 13:37:26 -07:00
Anthony Dresser
0064f17ad4 add icon for custom title bar (#5693) 2019-05-28 12:46:10 -07:00
Anthony Dresser
f8ccafd2af Add focus logic to the tabbed panel (#5649)
* add focus logic to the tabbed panel

* change enter to be on key up

* fix  tests
2019-05-28 12:44:22 -07:00
udeeshagautam
d386311e54 Feature/schema compare: refactor options dialog (from checkbox list to table) (#5608)
* Adding code to change checkbox list to table with checkbox.

* removing some unnessary ','

* Increasing the table a little bit

* reverting height changes

* Adding PR comments
2019-05-28 11:59:14 -07:00
Charles Gagnon
0e2475aa72 Fix agent context menu to appear in correct location (#5671)
* Fix agent context menu to appear in correct location

* Further type function params

* Just use anchor directly
2019-05-28 10:37:37 -07:00
Anthony Dresser
b4cce9f147 adjust modals for title bar (#5648) 2019-05-27 14:40:16 -07:00
Charles Gagnon
3e8f25d864 Update to latest version of SsmsMin (#5646) 2019-05-26 16:43:23 -07:00
udeeshagautam
4c68580e82 Fixing model view editor to layout currenty with native and custom settings (#5650) 2019-05-25 16:33:25 -07:00
Charles Gagnon
3bc82c10b1 Change some of the env vars to be ADS-specific (#5636)
* Change some of the env vars to be ADS-specific

* Undo changes to ext host IPC hook

* Keep VSCODE_LOGS vars too
2019-05-24 17:17:02 -07:00
Alan Ren
c7d94055a4 add managed instance to recommended list (#5639)
* add managed instance to recommended list

* update the publisher name casing
2019-05-24 17:00:21 -07:00
kisantia
34316b0ffd fix widths changing when radio buttons are clicked (#5634) 2019-05-24 16:44:30 -07:00
kisantia
3d494dcd73 Add initial telemetry for schema compare (#5595)
* add initial telemetry to schema compare

* addressing comments
2019-05-24 15:32:23 -07:00
Anthony Dresser
85b2c4de4a disable remote contribution (#5630) 2019-05-24 13:55:15 -07:00
Anthony Dresser
d0ce6bb066 move status bar contribution to contribution file (#5609) 2019-05-24 12:22:39 -07:00
Anthony Dresser
38c6495fd8 Inital Messages Tab work (#5604)
* inital work

* iterate

* move messages to tab

* revert package changes

* remove unused properties

* format imports
2019-05-24 12:22:27 -07:00
Anthony Dresser
bcc449b524 Merge from vscode 5b9869eb02fa4c96205a74d05cad9164dfd06d60 (#5607) 2019-05-24 12:20:30 -07:00
Alan Ren
361ada4963 update engine name from sqlops to azdata (#5605) 2019-05-23 22:08:03 -07:00
Alan Ren
2e8d62d0ca remove api used only by us (#5588)
* remove api used only by us

* fix the exthost crash issue
2019-05-23 22:02:28 -07:00
Karl Burtram
fb97bf6041 Don't fail build with vsix directory exists (#5593)
* Don't fail build with vsix directory exists

* Add a !fs.exists call prior to mkdir
2019-05-23 16:55:37 -07:00
Charles Gagnon
6d9c95720d Fix extensions to swallow exceptions when sending telemetry (#5600)
* Fix extensions to swallow exceptions when sending telemetry

* Remove reference to GDPR

* Clean up now-unused code
2019-05-23 16:24:55 -07:00
Anthony Dresser
db5a0a892a fix issue with empty connection (#5602) 2019-05-23 16:07:28 -07:00
udeeshagautam
7b01a6ca61 Fix for Schema compare Options dialog double scroll (#5584)
* setting height through vh removes outser scroll (% does not work)

* Chainging auto to scroll for overflow for better viewing
2019-05-23 15:51:52 -07:00
Charles Gagnon
fbbf767700 Clean up extension telemetry (#5596) 2019-05-23 15:29:28 -07:00
Yurong He
776e2cf6e7 Fixed #4567 adding open connectionDialog when no connection is available (#5581)
* Fixed #4567 adding open connectionDialog when no connection is available
2019-05-23 15:11:10 -07:00
Anthony Dresser
34ca0e8671 fix editors being disposed multiple times (#5594) 2019-05-23 14:08:37 -07:00
kisantia
0d37047c37 Get rid of schema compare double scrollbar (#5571)
* hide split view overflow to get rid of double scrollbar

* change overflow to hidden
2019-05-23 13:41:59 -07:00
Aditya Bist
25c8f60e6e Committer week - Agent fixes and refactor (#5547)
* refactored job actions to wait for job objects to load

* sorted the jobs in descending order

* decreased steps table height in jobs dialog

* cannot open multiple instances of dialogs now

* fixed edit job not show up some times when re opening history page

* fix broken icon

* fix a bunch of stuff and refactored code

* added isopen prop to dialog
2019-05-23 12:35:50 -07:00
Anthony Dresser
aae1480e4f Allow data explorer to use connect (#5564)
* wip

* handle save password; get correct profile

* ensure resolve is being called

* fix tests

* fix more tests
2019-05-23 11:44:18 -07:00
Anthony Dresser
5e8a52bcc0 Query Editor Refactor (#5528)
* query editor changes

* query editor changes

* finish converting query editor

* fix merge issue

* remove unused code

* fix tests

* fix tests

* remove editor context key class

* edit tests to test input state
2019-05-23 11:43:59 -07:00
Anthony Dresser
cf8f8907ee Merge from vscode 8aa90d444f5d051984e8055f547c4252d53479b3 (#5587)
* Merge from vscode 8aa90d444f5d051984e8055f547c4252d53479b3

* pipeline errors

* fix build
2019-05-23 11:16:03 -07:00
Anthony Dresser
ca36f20c6b fix bug with previous classes staying applied (#5586) 2019-05-23 11:15:18 -07:00
kisantia
bdae02e51e fix default server not being chosen (#5583) 2019-05-22 16:42:02 -07:00
udeeshagautam
2d7eb0dcb5 Feature/schemacompare include exclude checkboxes (#5548)
* Adding include exclude boxes

* Adding as table component generic column and rememebering state.

* converged custome action and select checkboxes, moved sc checkbox to middle, can have multiple checkboxes and can remember state now

* adding action on column as a common column property

* Taking PR comments

* Changing Arg name as per CR comment

* Taking a PR comment
2019-05-22 13:53:50 -07:00
Karl Burtram
2e0756ad8d Customize mixin strings for insiders build (#5569)
* Add test product-insider.json file

* Update some GUID

* Update mixin file

* Add more mixin customizations

* Update the mixin strings a little more

* Reorder code blocks to shorten a bit
2019-05-22 12:33:23 -07:00
kisantia
ef2bbce34b Widen schema compare dialog dropdowns and textboxes (#5563)
* widen dialog dropdowns and textboxes

* change padding

* add min-width for labels to match connection pane
2019-05-22 11:55:12 -07:00
Charles Gagnon
65e59dc57d Fix callback to display error message instead of {1} (#5577) 2019-05-22 11:45:31 -07:00
Anthony Dresser
2ca39b571a removes unused vscode changes (#5533) 2019-05-21 21:48:57 -07:00
udeeshagautam
48a6157efb Test fixes based on recent changes (#5570)
* Test fixes based on recent changes and allowing toolbar to stay at top

* removing scroll changes to be in seperate PR
2019-05-21 19:56:44 -07:00
Yurong He
ab3a64604a Fixed #5546. Add missing line for vscode merge and wait for untitledM… (#5567)
* Fixed #5546. Add missing line for vscode merge and wait for untitledModel.load
2019-05-21 18:56:28 -07:00
kisantia
e9ddf43c6c only generate filename if the database name is set (#5568) 2019-05-21 16:03:54 -07:00
udeeshagautam
2549d91ddf Fixing column polugin to not have extra whitespaces (#5565) 2019-05-21 15:09:49 -07:00
Anthony Dresser
81ae86ff79 Revert "Revert "Merge from vscode ada4bddb8edc69eea6ebaaa0e88c5f903cbd43d8 (#5529)" (#5553)" (#5562)
This reverts commit c9a4f8f664.
2019-05-21 14:19:32 -07:00
udeeshagautam
7670104e4d DisableSchema compare dialog's Okay button if source/target isn't selected (#5557)
* Enable schema compare ok button only on filling source and target

* Nit fixes
2019-05-21 12:48:43 -07:00
udeeshagautam
3fc2ad5bc9 Schema Compare tests addition (#5136)
* initial tests for schema compare

* Adding schema compare integration test

* Adding code to fix some build issues

* DB compare test

* Adding some CR comments

* db creation and deletion as per CR comments
2019-05-21 11:17:52 -07:00
kisantia
c84367e2ee Open schema compare script (#5515)
* don't prompt for script file name anymore

* bump sqltoolsservice version so the generated script gets opened
2019-05-21 10:30:18 -07:00
kisantia
77413ad25c Schema compare server dropdown changes (#5552)
* remove duplicate server entries in server dropdown

* change server dropdown to show most recent connections first
2019-05-21 09:23:43 -07:00
Yurong He
c1f73255b5 Fixed #3936 display cancel msg when interrupt run cell (#5518) 2019-05-20 21:52:36 -07:00
Yurong He
fe7ec76cd5 Fixed #4289 setLoading to false too early before (#5503) 2019-05-20 21:52:07 -07:00
Alan Ren
0bc9849ad8 more test cases (#5545)
* toolsservice test

* resource type tests

* pr comments

* comments
2019-05-20 17:09:10 -07:00
Anthony Dresser
c9a4f8f664 Revert "Merge from vscode ada4bddb8edc69eea6ebaaa0e88c5f903cbd43d8 (#5529)" (#5553)
This reverts commit 5d44b6a6a7.
2019-05-20 17:07:32 -07:00
Karl Burtram
1315b8e42a Bump Azure Data Studio to 1.8.0 (#5554) 2019-05-20 16:27:08 -07:00
Cory Rivera
7a03da42ec Revert user settings changes after running Existing Python Install integration test. (#5551) 2019-05-20 15:44:14 -07:00
Charles Gagnon
8b9bb2a8fc Fix/add OE Context Menu tests (#5543)
* Fix/add OE Context Menu tests

* Add return types for helper functions
2019-05-20 13:48:49 -07:00
Kevin Cunnane
162dfbaab0 Add SQL settings into the settings editor (#5524)
- Initial stab at a hierarchy for all Azure Data Studio settings
- Will revisit later, but this covers all built-in settings
2019-05-20 12:27:14 -07:00
Charles Gagnon
71b6e35231 Update installer warning to refer to ADS instead of VS Code (#5540) 2019-05-20 08:19:01 -07:00
Karl Burtram
9268513128 Detect when resultset length changes and force buffer recreation (#5522) 2019-05-20 08:14:12 -07:00
Anthony Dresser
5d44b6a6a7 Merge from vscode ada4bddb8edc69eea6ebaaa0e88c5f903cbd43d8 (#5529) 2019-05-19 18:52:19 -07:00
Alan Ren
586fe10525 resource deployment ext implementation -wip (#5508)
* resource types

* implement the dialog

* remove unused method

* fix issues

* formatting

* 5-17

* address comments and more tests
2019-05-17 20:24:02 -07:00
Cory Rivera
a59d1d3c05 Add functionality to use an existing Python installation for Notebook dependencies (#5228) 2019-05-17 14:39:44 -07:00
kisantia
1fce604a11 add css styling for text component (#5491) 2019-05-17 14:17:14 -07:00
Kevin Cunnane
8ea831c845 Fix #3439 Trusted doesn't get saved in Notebooks (#5507)
* Fix #3439 Trusted doesn't get saved in Notebooks
The main fix is to add a memento to store trust information. This is only needed for saved files - untitled files are always trusted as the user created them.
On clicking trusted or saving a file, the trusted state is cached. In the future, we will also handle code execution here too by sending notification on snapshot state.
I found issue #5506 during testing - existing issue where we should track trusted state changing on run. In the case all cells are ran, the whole notebook should become trusted.

Finally, I did a decent amount of refactoring to move more logic to the model - removing unnecessary calls from components which duplicated model behavior, moving trust notification to the model or at least the notebook service completely.

Added tests and logging for catch handling
2019-05-17 11:56:47 -07:00
Charles Gagnon
94061fa634 Fixes/improvements for SsmsMin extension (#5495)
* Fix server name in URN for Azure servers and update menu when clauses

* Use setStatusBarMessage instead of constructing our own. Remove server name from URN - it's not necessary.

* Clean up unused code
2019-05-17 09:38:15 -07:00
Karl Burtram
fe17955fa1 Add support for setting query options in settings and through API (#5484)
Initial query execution options PR.  This is the second in a set of query editor extensibility improvements I'm making.  The PRs include (1) bug fix for webview in query tab (2) dynamic toolbars and (3) fix query event sequencing and event metadata info.
2019-05-16 16:31:30 -07:00
kisantia
3158e9f63a Change schema compare generated script filepath (#5496)
* generated script filepath defaults to folder last opened in file dialog

* use string interpolation
2019-05-16 14:55:08 -07:00
Karl Burtram
fcb2b53bf8 Update yarn.lock files (#5489) 2019-05-15 13:15:58 -07:00
udeeshagautam
5470702c16 Adding reset for options (#5483)
Adding reset for schema compare options (fix for bug #5483)
2019-05-15 10:43:13 -07:00
kisantia
8c05c6e122 fix schema compare diff script formatting (#5486) 2019-05-15 09:03:14 -07:00
Charles Gagnon
cc397a012f Revert "Switch to vscodetestcover for running extension tests (#5458)" (#5487)
This reverts commit dbac187b44.
2019-05-14 17:16:01 -07:00
Charles Gagnon
e12827de3f Add pipeline task to push coverage results to coveralls (#5461) 2019-05-14 17:14:04 -07:00
Gene Lee
02a646c7ea Fixed bug: wrong handle usage in updateWizardPageInfo() in extHostModelViewDialog (#5485) 2019-05-14 16:17:59 -07:00
Charles Gagnon
86986efb15 Fix test cleanup to remove folders regardless if tests passed or failed (#5482) 2019-05-14 16:09:58 -07:00
Stephen
a718fb3cae Corrected Keyboard Shortcut Execution Issue (#5480) 2019-05-14 15:41:12 -07:00
kisantia
48ba9ce175 Sanitize db name for dacpac/bacpac file names (#5479)
* Sanitize db name for filename

* Add unit tests

* lower timeout to 60 seconds

* add extra coverageConfig.json and missing character check
2019-05-14 15:00:28 -07:00
udeeshagautam
be60ad6766 Bug fix Backup dialog list box to allow selecting file (#5472)
* Fixing list box to allow selection and not show dropdown

* Adding PR comments
2019-05-14 13:45:25 -07:00
Alan Ren
b1b58f2550 resource deployment extension (#5464)
* initial checkin

* exclude from default ads package

* keep extensions.js in sync

* address review feedback

* PR comments
2019-05-13 22:38:59 -07:00
Gene Lee
99d00e2057 Differentiated server icons by server type: box, big data cluster, cloud... (#5241) 2019-05-13 14:52:56 -07:00
Chris LaFreniere
7da0dddaa9 Notebooks: Prevent Outputs from Rendering Too Many Times on Layout Change Events (#5366)
* Prevent output rendering too many times

* went from 250ms to 50ms without any perf penalties
2019-05-13 13:41:23 -07:00
Yurong He
3ea45e4ef5 Fixed #5463 Enable stricter compile options on extensions #5044 missed mkdir line (#5469) 2019-05-13 13:28:32 -07:00
Charles Gagnon
dbac187b44 Switch to vscodetestcover for running extension tests (#5458)
* Update vscode dependency (needed for test runner) to pull latest 1.x version

* Update to use 1.1.5 instead

* Undo change to vscode engine version

* Switch to using vscodetestcover for running tests

* Switch to cobertura output for coverage reports

* Remove vscode dependency from profiler extension

* Update yarn.lock with combined changes
2019-05-13 11:39:09 -07:00
Anthony Dresser
43293b98c0 Merge from vscode fa77b52b5e2067798006aaff8e463a2b425509d5 (#5453) 2019-05-13 10:57:51 -07:00
Charles Gagnon
34eef8e97d Add download task for SsmsMin (#5460)
* Add SsmsMin files

* no message

* Add script to install extension
2019-05-10 14:08:43 -07:00
kisantia
5a48fd80cd Fix #4460: Add dacfx wizard to server and database folder context menus (#4989)
* add dacfx wizard to server and database folder context  menus

* update object explorer test
2019-05-10 12:03:26 -07:00
Alan Yu
5260afc15d Added Gif to Schema Compare readme (#5424) 2019-05-10 10:14:51 -07:00
Alan Ren
66b4e08026 produce the vsix files during windows build (#5454)
* vsix packages

* update path
2019-05-10 09:57:13 -07:00
Charles Gagnon
2b8e0cc6c4 Bundle SsmsMin directly into extension (#5450) 2019-05-09 18:28:49 -07:00
Karl Burtram
a501214bfa Adjust estimated scrollbar height to avoid unneeded scrollbar (#5452) 2019-05-09 18:19:07 -07:00
Anthony Dresser
2b9a8b9136 Merge from vscode 8ef8aa6b3cb5b96870660fdd3bb8d0755e62fe51 (#5422) 2019-05-09 11:10:57 -07:00
Chris LaFreniere
1cc3cb5408 Notebook Port Test Fix (#5433)
* Test fixes to not rely on 7100

* PR comments
2019-05-08 13:16:09 -07:00
Karl Burtram
7df793f208 Update readme\changelog for May release (#5421) 2019-05-08 10:03:21 -07:00
Charles Gagnon
ca2b7cc4bc Remove unnecessary 'use strict' lines and add hygiene check (#5363)
* Remove unnecessary 'use strict' lines and add hygiene check for them

* Move check to under tslint filters to reduce number of filters needed

* Only take first 10 lines of file
2019-05-07 22:57:08 -07:00
Aditya Bist
9e0a74da3d Committer work: Import fixes and improvements (#5357)
* can make imports, but need to change success and failure views

* fixed error handling UX

* removed unused function

* cr comments

* fix typo

* requested change
2019-05-07 17:25:58 -07:00
Charles Gagnon
da5076a4dc Clean up extension packaging (#5416)
* Clean up extension packaging

* Add sql image
2019-05-07 16:52:00 -07:00
Alan Yu
005808f003 Adding CMS readme (#5417) 2019-05-07 16:16:54 -07:00
Alan Ren
1dd1919200 bump the version of schema compare extension (#5411) 2019-05-07 14:45:28 -07:00
Aditya Bist
0a9db55dc4 Fix agent css in packaged builds (#5409)
* fix agent css in packaged

* fix agent css
2019-05-07 14:16:52 -07:00
Anthony Dresser
4551ba5b7c update notebooks to use new message event (#5395) 2019-05-07 13:03:58 -07:00
Karl Burtram
0f25ad5676 Bump agent, import, profiler extension versions (#5405) 2019-05-07 12:55:26 -07:00
Anthony Dresser
c6564c0d84 Fix css to fix new dashboard tab dialog (#5385)
* fix css to fix new dashboard tab dialog

* add readonly
2019-05-06 17:25:51 -07:00
kisantia
a7e94d433f bump dacpac extension version (#5387) 2019-05-06 17:10:51 -07:00
Karl Burtram
64480a35ac Bump the VS Code version metadata (#5392) 2019-05-06 17:02:51 -07:00
Alan Ren
4f96d5caf2 fix profiler formatter issue (#5372) 2019-05-06 15:39:44 -07:00
Maddy
7cca1b9f48 Maddy/newline overrides edit data (#5364)
* formatting it before displaying

* replace with space

* added comments and method to handle the line break space conversion
2019-05-06 14:20:08 -07:00
Yurong He
56ebbedbfd Add log for output verification (#5381)
* Add log for output
2019-05-06 14:15:51 -07:00
Anthony Dresser
4e5b8ce875 add a applystyle function with saftey checks in header filter (#5380) 2019-05-06 13:43:54 -07:00
Anthony Dresser
5c5ee50983 fix error icon (#5373) 2019-05-06 12:33:38 -07:00
Chris LaFreniere
0a67488447 Don't scroll when running code cell if in view (#5365) 2019-05-06 11:36:06 -07:00
Kevin Cunnane
022761aa4b Fix #4089 Linked account cancel (#5347)
VSCode serialization changed rejection handling to only serialize errors, which caused things to break
- Changed to return either account info or a cancel message in the resolve
- Rewrote to use promises. Tracking how to return canceled through 4+ thenables was way trickier than just using a promise
- Updated unit tests to handle new scenario
- Tested integration tests, realized they a) didn't run and b) didn't passed. 
  - Added vscode dev dependency to fix run issue
  - Fixed tests to account for behavior changes in tree state.
2019-05-06 09:13:03 -07:00
Anthony Dresser
b9d985b663 remove event emitter and use event and emitter instead (#5361) 2019-05-06 00:27:55 -07:00
udeeshagautam
08ed9d285e Changing the start for Schema compare and adding some text (#5356)
* Dialog Ok will not start Schema compare explit compare will. Adding wait text.

* Fixing variable name and spelling
2019-05-05 11:22:32 -07:00
Anthony Dresser
ab0cd71d10 Remove logging and clone utlities (#5309)
* remove log utility functions; remove custom mixin

* fix tests

* add log service as required by telemetry utils

* remove unused code

* replace some console.logs with logservice
2019-05-04 22:37:15 -07:00
Anthony Dresser
df7645e4e5 Merge from vscode da3c97f3668393ebfcb9f8208d7616018d6d1859 (#5360) 2019-05-03 21:59:40 -07:00
Aditya Bist
39f9c72390 fixed packaged icons for azure (#5354) 2019-05-03 18:47:45 -07:00
Anthony Dresser
0023714884 Fix menu entry for tasks (#5355)
* fix menu entry for tasks

* change wording for action
2019-05-03 18:20:51 -07:00
kisantia
ec9fdc517f Fix schema compare dialog font sizes (#5353)
* make font sizes consistent

* fix order of source dialog options

* update fontsize to 13

* make fontsize a constant
2019-05-04 10:48:25 +12:00
Anthony Dresser
db387eb770 Fixing the layering in the base folder (#5308)
* removes more builder references

* remove builder from profiler

* formatting

* fix profiler dailog

* remove builder from oatuhdialog

* remove the rest of builder references

* formatting

* add more strict null checks to base

* enable strict tslint rules

* code layering of base

* wip

* working through changes to table data view

* fix tests

* update editabledropdown to not use layout service

* wip

* fix imports

* fix import

* fix compile error

* add more localization

* add comments to changes to import patterns

* add more import comments
2019-05-03 14:49:18 -07:00
kisantia
354ed22706 Fix #5314: schema compare doesn't always open with correct default connection (#5315)
* fix schema compare default connection when there are multiple connections
2019-05-04 09:40:53 +12:00
Aditya Bist
a69f194d8b Fixed CMS connection auth (#5306)
* fixed auth change to reflect in UI

* added comments

* fix bug where cms shows in dropdown

* added parameter to parent call
2019-05-03 13:26:04 -07:00
Aditya Bist
f5d13319a2 Remove CMS from packaged builds (#5349)
* remove cmss from packaged builds

* add repo to package file

* added cms to recommendations
2019-05-03 13:25:47 -07:00
Yurong He
9a0e691635 Change toolbar icon back to black (#5345)
* Change it back to black icon

* Install package icon
2019-05-03 13:11:44 -07:00
kisantia
6c7cb185a1 group source and target components into formcomponentgroups (#5329) 2019-05-04 05:51:40 +12:00
Charles Gagnon
ab22b93ce0 SsmsMin integration clean-up and improvements (#5339)
* SsmsMin integration clean-up and improvements

* Fix tests
2019-05-03 08:44:21 -07:00
Karl Burtram
c7f5278430 Remove 'Try backup or restore task' from task message (#5340) 2019-05-02 18:52:11 -07:00
Anthony Dresser
56ad0dbaf2 revert changes to common file and move icons to specific folder (#5335) 2019-05-02 18:14:13 -07:00
Anthony Dresser
74c92cd460 disable page scrolling in slickgrid (#5333) 2019-05-02 18:13:49 -07:00
Alan Ren
16ebb4322a fix insights dialog issue (#5336) 2019-05-02 18:13:33 -07:00
kisantia
fccd026812 Remove database name from schema compare source/target server field (#5327)
* remove database name from source/target server field
2019-05-03 11:20:28 +12:00
Charles Gagnon
b6e49f2bc0 Fix connections from editor not saving to MRU (#5328) 2019-05-02 16:08:46 -07:00
Karl Burtram
188ccf849d Fix nullref exception in connection profile (#5330)
* Fix nullref exception in connection profile

* Fix condition
2019-05-02 16:04:03 -07:00
Anthony Dresser
1bfdce9642 fix icons for various status; move menu entry to the other panels (#5319) 2019-05-02 14:31:58 -07:00
Karl Burtram
495254b0be Remove package-lock.json from extension sample (#5324) 2019-05-02 13:41:48 -07:00
Charles Gagnon
d209ff7b9a Fix broken CMS test and add to test-extensions-unit scripts (#5301) 2019-05-02 11:13:30 -07:00
Yurong He
98eeb50060 Fixed #4953 provider create file action when file is deleted (#5283)
* Fixed #4953 following query editor behavior provide create file option when file name doesn't exist

* Check active edtior is the correct one before closing

* close editor

* Removed codes not needed

* Check error null
2019-05-02 10:59:46 -07:00
Chris LaFreniere
8a68f0aaf9 Improvements to notebook editor code auto height (#5291) 2019-05-02 10:23:26 -07:00
Anthony Dresser
039859213c Replace observable references with just promises (#5278)
* replace observable references with just promises

* add tests for searching in dataview

* add comments

* work through respecting max matches

* fix tests

* fix strict null checks
2019-05-02 00:06:28 -07:00
Alan Ren
a3c022aebf Update dropdown.ts (#5290)
* Update dropdown.ts

fix the issue that the filtering feature is not working

* format the doc

* comments
2019-05-01 22:55:53 -07:00
Anthony Dresser
3a9b32b6e8 Task item look update (#5299)
* wip

* wip

* wip
2019-05-01 13:25:18 -07:00
Karl Burtram
c1cb9000a9 Various results grid scrolling fixes (#5285) 2019-05-01 12:36:16 -07:00
Kevin Cunnane
104b99ffa0 Fix #4553 Azure account prompt (#5303)
"Are you sure" prompt on removing Azure account does not respect "No"
2019-05-01 12:28:36 -07:00
Charles Gagnon
a89d7f327a Update SsmsMin to 15.0.18120.0 (#5293) 2019-05-01 11:29:36 -07:00
Charles Gagnon
91bc4bde3c Change default timeout value to 30sec to match SSMS (#5289) 2019-05-01 11:19:40 -07:00
Charles Gagnon
80da7ad496 Fix broken CMS commands (#5296) 2019-05-01 10:55:58 -07:00
Charles Gagnon
64bf211a45 Fix failing OE Tests caused by changes in connection API defaults (#5295)
* Fix failing OE Tests caused by changes in connection API defaults

* More spelling fixes
2019-05-01 10:18:23 -07:00
Anthony Dresser
2558a66a48 Merge from vscode 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9 (#5286) 2019-04-30 21:53:52 -07:00
kisantia
df22eab4ec fix diff editor title disappearing after swap (#5280) 2019-05-01 11:30:03 +12:00
Aditya Bist
c2678cf818 Committer work - Agent tests (#5034)
* added couple tests

* added unit tests for agent extension

* added agent test in test script
2019-04-30 16:25:16 -07:00
Yurong He
f9af34b103 Notebook toolbar UI improvement (#5282)
Fixed  #5236
- Change the icon to blue image. Existing icons are not deleted. We will use them when the icons are - - moved as the secondary actions.
- Change the font size to 13px
- Change the height to 21px
- Move Add actions to the left
2019-04-30 16:18:48 -07:00
Charles Gagnon
97cab22e00 Add more SsmsMin interactions (#5267)
* Add support for more SsmsMin property dialogs and the Generate Script Wizard. Also fixed bug with ExtHostObjectExplorerNode getParent function

* Localize package.json entries

* Fix localization tokens

* Address PR comments

* Fix regex and getParent
2019-04-30 16:10:11 -07:00
Kevin Cunnane
64416e05c1 Notebook StdIn support to fix #5231 (#5232)
Fixes #5231 
- Add stdin handling. Has to be at UI level so add plumb through handling
- Add unit tests
- Add new StdIn component.

Testing:
Unit Tests and manual testing of following:
- Prompt for password using `getpass` in python.
   - Password prompt is hidden since "password" is true.
   - Hit enter, it completes
- prompt, stop cell running, StdIn disappears
- prompt, hit escape, stdIn disappears and stdIn request is handled.

Issues: focus isn't always set to the input even though we call focus.
Will investigate this further.
2019-04-30 14:57:27 -07:00
Kevin Cunnane
b21125ff2d Fix markdown security and enable most CSS (#5263)
* Fix markdown security and enable most CSS

Stops using our sanitizer and instead disables HTML in markdown engine
- This was blocking Note because it converted > to >
- It's slightly more strict in that it fully disables HTML unless trusted. Will need to improve handling of Trusted to support this in a future PR

Adds in correct CSS, both from .css file in markdown extension and from built-into all webviews global CSS
- Fix #3765 standard markdown support
- Fix Support of Notes by bringing correct styles
- Fix code block colorization
- Fix link handling so it's not bolded / gets underlined on hover
- Fixes table rendering (for markdown and HTML tables)

* Reduce scope of CSS changes
- Removed some CSS that wasn't needed or caused issues
- Scoped most things under the preview section not the whole component

* Avoid markdown html block by sanitizing after render

* Fix pre node not overflowing
- This was a bug in existing implementation too
2019-04-30 14:21:20 -07:00
Chris LaFreniere
e72d0d03ed Notebooks: More Jupyter Server Hardening (#5264)
* Do not rely on same starting port every time, misc

* put back to 5 seconds for process kill timeout

* extHostNotebook shutdown manager handle
2019-04-30 14:13:04 -07:00
Anthony Dresser
0f12d15020 Refactor connection store (#5024)
* various clean ups

* formatting

* remove linting

* formatting

* IConfigurationService is even better

* messing with connection config tests

* update tests

* formatting

* foramtting

* remove unused code

* add more tests

* working through tests

* formatting

* more factoring of connection store and increase code coverage

* formatting

* fix tests

* change use of state service to storage service

* remove unused files

* fix strict null errors

* formatting
2019-04-30 13:32:32 -07:00
Yurong He
44a2d009c0 Fixed #4169 shows notification when not active code cell is selected when hit F5 (#5259)
* Refine the msg
2019-04-30 13:25:11 -07:00
Anthony Dresser
48682bacde rework panel to not need platform (#5270) 2019-04-30 13:19:21 -07:00
Aditya Bist
f70369c2a6 Fix object explorer session fails (#5256)
* only start session if response successful

* added return type

* fixed OE tests

* format doc
2019-04-30 11:45:52 -07:00
udeeshagautam
f7fc94520a Fixing schema compare object type enum to follow PascalCasing (#5266) 2019-04-30 11:07:46 -07:00
udeeshagautam
77c6f5c9a2 Reverting the checkboxes because of scrollbar issue 5230 (#5271) 2019-04-30 11:07:11 -07:00
kisantia
dffa47301b fix path to dark icon of options button (#5274) 2019-05-01 05:53:55 +12:00
Charles Gagnon
08f47e7e14 Fix "Open File Location" for CSV Export (#5273)
Fix #5177 - File path wasn't being parsed correctly, URI.file should be used for full file paths.
2019-04-30 10:41:19 -07:00
Anthony Dresser
56342af140 Rework editableDropdown to not need platform (#5189)
* rework editableDropdown to not need platform

* rework editable dropdown to not depend on platform

* fix compile

* fix focus bluring
2019-04-30 09:25:04 -07:00
Anthony Dresser
aacc0eca67 Merge from vscode 071a5cf16fc999727acc31c790d78f750fa4b166 (#5261) 2019-04-30 07:54:56 -07:00
Kevin Cunnane
02916aeffa Fix #3440 link in Markdown requires cmd+click (#5239)
- Copied over click handler from VSCode markdown renderer
- Added logic to only support command links if trusted

Now clicking on a link will do an action or open a file.
Created #5238 to track need to support relative links which doesn't work
2019-04-29 19:15:39 -07:00
udeeshagautam
e42bfada9d Feature/schemacompare options (#5143)
* extension now working

* make button messages better

* fix diff editor title disappearing and remove border from source and target name boxes

* redoing a bunch of stuff that disappeared after rebasing

* add images and add to extensions.ts

* moving a few changes to the right place after rebase

* formatting

* Initial schema compare options working code

* Adding description.icon etc.

* Enabling disabling options button

* Name change: SchemaCompareOptions to DeploymentOptions. To reflect SqltoolsService side parameters

* Adding sorting and correct sql tools version

* Adding options button themes

* Formatting fix

* Adding get default options call to get options from tools service

* Exclude/Include changes - first commit

* Adding border to checkboxes

* Taking PR comments

* Updating to latest sqltools with schema compare options
2019-04-29 18:11:48 -07:00
Karl Burtram
72fb114dec Load MSSQL extension first during eager load phase (#5255) 2019-04-29 17:46:30 -07:00
Karl Burtram
9ba1561386 Bump SQL Tools Service to 1.5.0-alpha.91 (#5260) 2019-04-29 17:38:19 -07:00
Aditya Bist
39772c2dbe CMS Extension - 2 (#4908)
* first set of changes to experiment the registration of cms related apis

* Adding cms service entry to workbench

* Adding basic functionality for add remove reg servers and group

* Returning relative path as part of RegServerResult as string

* initial extension

* cleaned building with connecting to server

* get list of registered servers

* progress with registered servers tree

* cms base node with server selection

* removed unused services

* replaced azure stuff with cms

* removed cmsResourceService

* list servers progress

* Removing the cms apis from core. Having mssql extension expose them for cms extension

* create server working fine

* initial expansion and nodes

* Propogating the backend name changes to apis

* initial cms extension working

* cached connection needs change in api

* connect without dashboard in proposed

* Fixing some missing sqlops references

* add registered server bug found

* added refresh context menu option

* added payload

* server description not disabled after reject connection

* added more context actions and action icons

* added empty resource and error when same name server is added

* fixed connection issues with cms and normal connections

* added initial tests

* added cms icons

* removed azure readme

* test script revert

* fix build tests

* added more cms tests

* fixed test script

* fixed silent error when expanding servers

* added more cms tests

* removed cmsdialog from api

* cms dialog without object

* fixed theming issues

* initial connection dialog done

* can make connections

* PM asks for strings and icons

* removed search

* removed unused code and fixed 1 test

* fix connection management tests

* changed icons

* format file

* fixed hygiene

* initial cr comments

* refactored cms connection dialog

* fixed bug when switching dialogs

* localized connection provider options

* fixed cms provider name

* code review comments

* localized options in cms and mssql

* localized more options
2019-04-29 15:16:59 -07:00
David Shiflet
cbf3ca726f Connect opened query editors to the server (#5207)
* Connect opened query editors to the ser

* only show firewall rule error for one file

* remove unused imports

* sync to latest

* add comment

* one more comment
2019-04-29 13:10:19 -04:00
Yurong He
f1e21ebe9d Fix driverlog uri in output (#5212)
* Fixed #4813

* Changed to lowercase for comparision
2019-04-26 20:25:55 -07:00
Yurong He
49c36cc040 Fixed #4947 Increase the size of the notebook command icons and space between icon and button (#5235) 2019-04-26 19:57:40 -07:00
Anthony Dresser
9b90400abd Merge from vscode 63d257f78a36951ab7e821170ba675b11dc06d48 (#5240) 2019-04-26 17:24:54 -07:00
Karl Burtram
8cda364210 Fix product name in error message (#5233)
* Fix product name in error message

* fix typo
2019-04-26 15:32:30 -07:00
Anthony Dresser
ca98ef879d Last of the layering (#5187)
* layer query

* update imports
2019-04-26 15:30:41 -07:00
Chris LaFreniere
bb9c85cd8f Improve Cleanup of Jupyter processes on Notebook and/or ADS Close (#5142)
* Close jupyter and python

* Ensure we stop jupyter correctly on process end

* dont stopServer from clientSession shutdown

* PR comments

* close notebook after each test
2019-04-26 15:28:26 -07:00
Anthony Dresser
91b946bf3d rework listbox to not require platform (#5192) 2019-04-26 15:02:03 -07:00
kisantia
64377000c6 Change default folder in dacpac and schema compare extensions (#5215)
* change default folder in dacpac and schema compare extensions

* move getting rootpath to a method

* change method name
2019-04-27 04:27:03 +12:00
Yurong He
23f4931a1d Fixed #5210 (#5211)
* Fixed #5210

* Added function to check error to ensure get string
2019-04-25 19:45:33 -07:00
Anthony Dresser
3625834028 Merge from vscode 63655183ba5305b70ffaf1327b8a4708f0a79bd9 (#5221) 2019-04-25 19:18:04 -07:00
Alan Ren
705e7b30bc enable 'New Notebook' entry points for PG SQL (#5194)
* enable 'New Notebook' entry points for PG SQL

* fix comment

* permanent fix for context menu entry point
2019-04-25 16:23:01 -07:00
udeeshagautam
6528c0817d quick fix for column name (#5214) 2019-04-25 15:51:54 -07:00
Aditya Bist
f3d7392af3 Localize connection options for mssql (#5209)
* localize connection options for mssql

* added all strings
2019-04-25 15:13:07 -07:00
Yurong He
5d5f44ba11 Fixed #3961 Removed hardcoded value in notebook and use QueryEditor Result RowHight to keep it consistent (#5208) 2019-04-25 12:59:13 -07:00
Anthony Dresser
34457880c7 Merge from vscode 0fde6619172c9f04c41f2e816479e432cc974b8b (#5199) 2019-04-24 22:26:02 -07:00
kisantia
d63f07d29a Schema compare publish (#5127)
* adding publish command
2019-04-25 10:37:40 +12:00
Anthony Dresser
5c2cbc9d29 fix task contribution (#5188) 2019-04-24 15:05:11 -07:00
Karl Burtram
8dbfa10646 Bump npm packages (#5185) 2019-04-24 14:55:36 -07:00
Anthony Dresser
9e804089e0 Move Tasks Panel (#5162)
* moving tasks panel

* fix css styling

* clean up code

* do a bunch of renaming
2019-04-24 13:54:58 -07:00
v-mdriml
51145903aa LOC CHECKIN | Microsoft/azuredatastudio master | 20190424 (#5179) 2019-04-24 13:46:50 -07:00
Anthony Dresser
036c49f398 Modify coverage process to reduce time (#5164)
* modify coverage process to reduce time

* disable coverage on linux
2019-04-24 13:39:30 -07:00
Chris LaFreniere
46b85ebc6b Fix casing on welcome page to be consistent (#5169) 2019-04-24 11:18:33 -07:00
Yurong He
07bc5e2de9 Fixed #3244 (#5166) 2019-04-24 09:04:15 -07:00
Yurong He
e822091907 Only when the connection is connected, then do disconnect. (#5170) 2019-04-23 19:03:49 -07:00
Chris LaFreniere
7d46e77922 Notebooks: Show keyboard shortcut for run cell (#5097)
* Show keyboard shortcut for run cell

* PR comment
2019-04-23 17:33:15 -07:00
Karl Burtram
ad528ad3d5 Update Azure Data Studio to 1.7.0 for May release (#5167) 2019-04-23 17:24:24 -07:00
Yurong He
e8b4c03770 Fixed #4772 create unique connection for each notebook by using noteb… (#5163)
* Fixed #4772 create unique connection for each notebook by using notebook path as uri
Disconnect sqlConnection from SqlKernel to ensure no connection left after the notebook is closed.

* SqlSessionManager is ADS level manager

* Moved path to SqlKernel constructor
2019-04-23 16:42:28 -07:00
Chris LaFreniere
33aacc1798 Improve Notebook Context Menu Casing (#5145) 2019-04-23 11:35:46 -07:00
Anthony Dresser
58959ef35e Enable stricter compile options on extensions (#5044)
* enable stricter compile settings in extensions

* more strict compile

* formatting

* formatting

* revert some changes

* formtting

* formatting
2019-04-23 11:18:00 -07:00
Charles Gagnon
c66b349cec Show correct release notes for command (#5108) 2019-04-23 10:55:09 -07:00
Aditya Bist
5c90df092b Switch on code coverage (#5120)
* testing code coverage for /sql/

* fix test result path

* fixed coverage task:



'

* added coverage to linux and mac as well

* fix script for mac and linux

* bash script cmd

* fixed scripts

* remove warnings from summary

* remove coverage from linux

* added job action tests

* added more tests
2019-04-23 10:47:03 -07:00
Karl Burtram
32374f264f Adjust default fonts (#5146)
* Adjust default fonts

* Adjust default ratio
2019-04-22 17:30:16 -07:00
Anthony Dresser
5e62229f25 Merge from vscode 2b87545500dbc7899a493d69199aa4e061414ea0 (#5148) 2019-04-22 16:57:13 -07:00
Cory Rivera
1b24dff738 Show an Install Skipped message when Python already exists at the specified install location. (#5141)
* Also fixed a bug where future installs would get blocked after doing an install that gets skipped.
2019-04-22 14:28:59 -07:00
Aditya Bist
161135cd90 remove old unused splash screen (#5112) 2019-04-22 13:39:27 -07:00
Aditya Bist
5fb583da06 uncheck desktop icon by default (#5111) 2019-04-22 13:38:51 -07:00
Kevin Cunnane
8b40d20eab Typings reference failing in external extension (#5129)
This fixes an issue where if you copy azdata.proposed.d.ts to
an extension project, it would fail to compile using default
tsconfig.json settings due to missing return type
2019-04-19 16:41:23 -07:00
Chris LaFreniere
432034d2cb Notebooks: Pressing Escape key in markdown cell exits edit mode (#5094)
* Pressing Escape key in markdown exits edit mode

* text + code cells inactive when pressing escape
2019-04-19 16:19:16 -07:00
Alan Ren
0e168e36fc Merge from vscode 12cb89c82e88e035f4ab630f1b9fcebac338dc03 (#5125) 2019-04-19 10:26:20 -07:00
Cory Rivera
f248260584 Add flag to skip python install integration tests. (#5119) 2019-04-18 17:13:19 -07:00
Cory Rivera
880e3e10da Update Python install messages to differentiate between download completion and install completion. (#5114) 2019-04-18 16:52:50 -07:00
Anthony Dresser
f33b95ee82 Use vscode clipboard rather than clipboardy (#5117)
* remove clipboardy and use vscode's clipboard apis instead

* update lock
2019-04-18 16:34:24 -07:00
Anthony Dresser
4a71eb9b90 use vscode open external rather than opener (#5115) 2019-04-18 16:34:12 -07:00
Chris LaFreniere
3372a5ad4b Fix hygiene issues in textCell.css (#5116) 2019-04-18 15:58:27 -07:00
Zbyněk Sailer
8326f05f66 LOC CHECKIN | Microsoft/azuredatastudio master | 20190418 (#5103) 2019-04-18 14:59:25 -07:00
Chris LaFreniere
7ce921d449 Improve tabe markdown css (#5093) 2019-04-18 14:57:26 -07:00
Chris LaFreniere
31f7364f08 Only show nb loading spinner when no cells shown (#5095) 2019-04-18 14:57:11 -07:00
Anthony Dresser
5119d28b9d fix svg references (#5109) 2019-04-18 12:29:18 -07:00
Yurong He
a2a5fe3bee Added more logging for python installation and remove dup test in the other suite (#5106) 2019-04-18 11:24:12 -07:00
Karl Burtram
6222d8c977 Bump agent extension to 0.38.0 (#5104) 2019-04-18 09:48:47 -07:00
Karl Burtram
d3699a261a Update readme for April release (#5063) 2019-04-18 09:25:01 -07:00
Anthony Dresser
9c0e56d640 Layering of everything else but query (#5085)
* layer profiler and edit data

* relayering everything but query

* fix css import

* readd qp

* fix script src

* fix hygiene
2019-04-18 01:28:43 -07:00
Anthony Dresser
ddd89fc52a Renable Strict TSLint (#5018)
* removes more builder references

* remove builder from profiler

* formatting

* fix profiler dailog

* remove builder from oatuhdialog

* remove the rest of builder references

* formatting

* add more strict null checks to base

* enable strict tslint rules

* fix formatting

* fix compile error

* fix the rest of the hygeny issues and add pipeline step

* fix pipeline files
2019-04-18 00:34:53 -07:00
Alan Ren
b852f032d3 Merge from vscode 3a6dcb42008d509900b3a3b2d695564eeb4dbdac (#5098) 2019-04-17 23:38:44 -07:00
Aditya Bist
1fec26c6b3 dont dispose serverTreeView every time hidden (#5092) 2019-04-17 20:12:44 -07:00
kisantia
d3483afaed Schema Compare extension (#4974)
* extension now working

* fix diff editor title disappearing and remove border from source and target name boxes

* redoing a bunch of stuff that disappeared after rebasing

* add images and add to extensions.ts

* moving a few changes to the right place after rebase

* formatting

* update toolbar svgs

* addressing comments

* add return types

* Adding PR comments

* Adding light and dark theme icons

* Fixing the diff editor title for dark theme
2019-04-17 19:14:22 -07:00
Chris LaFreniere
910e4815fa Enable Python Integration Tests For Notebooks (#5090)
* Enable python notebook tests

* change run_python3_test to be string

* Add explicit pyspark check
2019-04-17 16:46:10 -07:00
Karl Burtram
ef118e3351 Update extension recommendation list (#5086) 2019-04-17 16:26:41 -07:00
Chris LaFreniere
2beedb10d4 Add run cells as a command (#5080) 2019-04-17 14:26:31 -07:00
Charles Gagnon
41bf10d989 Fix for build break caused by missing SVG (#5078)
* Fix for build break caused by missing SVG

These files were moved in #5029

* Add a few more missing SVGs
2019-04-17 11:22:42 -07:00
Chris LaFreniere
ac3b6aef27 ADS Welcome Page (#5043)
* ADS Welcome Page

* sample notebook section

* Opens in browser :(

* Remove sample notebooks section

* fix open file in windows

* Change az_data_welcome_page to be under sql/

* fix tslint issue

* Scope table css down
2019-04-17 10:50:43 -07:00
Anthony Dresser
8956b591f7 Merge from vscode 05fc61ffb1aee9fd19173c32113daed079f9b7bd (#5074)
* Merge from vscode 05fc61ffb1aee9fd19173c32113daed079f9b7bd

* fix tests
2019-04-16 22:11:30 -07:00
Anthony Dresser
2f8519cb6b Layer Object Explorer; query plan; task history (#5030)
* relayer query plan, task history, object-explorer

* formatting
2019-04-16 21:12:34 -07:00
Aditya Bist
15a19c044d remove agent from old apis (#5064) 2019-04-16 17:13:02 -07:00
Alan Ren
ec47ff7479 Alanren/fixsmoketest (#5019)
* fix the smoke test

* update readme

* fix the selector for server name input

* add new property to server profile engineType
2019-04-16 16:43:11 -07:00
Aditya Bist
82f707ee89 Fixed agent filter in dark theme (#5048)
* fixed agent filter in dark theme

* added high contrast theme as well
2019-04-16 15:30:16 -07:00
Alan Ren
dfcab8db6a fix the selectbox issue for chart (#5052) 2019-04-16 13:32:52 -07:00
Anthony Dresser
5c10127758 Layer grid code (#5029)
* layer grid

* errors; edit data still not showing up

* fix edit data

* fix tab spaces
2019-04-16 13:30:15 -07:00
Aditya Bist
b376f36733 fix job action context (#5053) 2019-04-16 13:07:22 -07:00
Aditya Bist
96c0f62cf5 Removed duplicate connections code (#5045)
* removed duplicate connections code

* removed old comment

* removed unused code
2019-04-16 11:54:07 -07:00
Zbyněk Sailer
a96f996b59 LOC CHECKIN | Microsoft/azuredatastudio master | 20190411 (#4993) 2019-04-16 10:36:41 -07:00
Anthony Dresser
b75d0b6cb5 Fix bootstrapping around dashboard (#5040) 2019-04-15 23:49:40 -07:00
Anthony Dresser
a5bc65fbfb Merge from vscode 8b5ebbb1b8f6b2127bbbd551ac10cc080482d5b4 (#5041) 2019-04-15 20:37:22 -07:00
Gene Lee
dcdbc95ae7 Fixed bug: CheckboxTreeNode label overflows, and node icon disappears (#5022) 2019-04-15 13:44:49 -07:00
Anthony Dresser
72e7e5e025 relayer connection code; formatting (#5020) 2019-04-15 01:05:23 -07:00
Anthony Dresser
57242a2e13 Merge from vscode 3d67364fbfcf676d93be64f949e9b33e7f1b969e (#5028) 2019-04-14 22:29:14 -07:00
Anthony Dresser
6dbf757385 Remove some vscode differences (#5010)
* remove some vscode differences

* add dates to todo comments
2019-04-12 21:55:07 -07:00
Karl Burtram
c5a32d8373 Show user email address in account picker (#5015)
* Show user email address in account picker

* Fix build break and remove Azure account from sqlops namespace
2019-04-12 17:23:48 -07:00
Charles Gagnon
34288435ec Fix Data Explorer context menu items visibility (#4996)
* Fix Data Explorer context menu items visibility

The when clause was making the menu items show up for all nodes in the Data Explorer - even ones that didn't make sense such as the Databases folders. This change makes it only appear for the Database and Server nodes (which is how the OE tree is set up)
2019-04-12 17:09:53 -07:00
Yurong He
177b48c3f2 Revert #4955 to unblock integration test (#5016) 2019-04-12 14:08:38 -07:00
Anthony Dresser
642f5d4405 replace nulls with undefined (#5014) 2019-04-12 13:08:32 -07:00
Anthony Dresser
92b1c59e48 Strict null check on full "base" code (#4973)
* removes more builder references

* remove builder from profiler

* formatting

* fix profiler dailog

* remove builder from oatuhdialog

* remove the rest of builder references

* formatting

* add more strict null checks to base
2019-04-12 12:59:58 -07:00
Anthony Dresser
cb1682542b remove sql/services (#4991) 2019-04-12 12:48:06 -07:00
Anthony Dresser
9e56187c16 Remove sql/common (#4990)
* remove sql/common/

* formatting

* fix cyclic dependency
2019-04-12 12:47:48 -07:00
Yurong He
51851efda5 Use notebookUtils.getErrorMessage to get the correct msg instead of showing {0} (#5012) 2019-04-12 11:50:44 -07:00
Charles Gagnon
11e4b743e0 Fix wrong release notes being loaded (#5008) 2019-04-11 16:56:55 -07:00
Kevin Cunnane
3349151d4c Touchbar icon support in notebooks (#4998)
* Touchbar icon support in notebooks
- updated shortcut keys to only work if notebook is active
- Added icons
- Now have 1 "add cell" icon that prompts for code/text.
This is useful as there wasn't an icon to differentiate
2019-04-11 16:43:27 -07:00
Kevin Cunnane
c8f6937166 Fix #4500 Untitled notebook reopen doesn't show dirty (#5005)
* Fix 2 notebook issues
- Do not create notebook model twice on start
- Do not cause disposed warnings due to markdown cell deserialization

* Fix notebook dirty on open issue
Before model is resolved we weren't getting dirty events.
Solution is to use backing text model until it's ready.
Must hook to the dirty event & notify to get the dot to appear
2019-04-11 16:39:54 -07:00
Maddy
ad36c1df3d add wrap to the <pre> tag (#5002)
* add wrap to the <pre> tag

* removed styles for browser support
2019-04-11 15:32:52 -07:00
Anthony Dresser
a5b8924e2d restore line height to account list renderer (#4999) 2019-04-11 15:10:38 -07:00
Anthony Dresser
bc898cc2c2 revert data explorer id to connections (#5003) 2019-04-11 15:10:26 -07:00
kisantia
1247b6e8eb bump SQL Tools to 1.5.0-alpha.85 to get invalid dacpac version fix (#5001) 2019-04-11 13:53:45 -07:00
udeeshagautam
2111c3de1a Fix for 4104 : Multiple consecutive spaces in query results cells are condensed into one (#4983)
* preserving spaces in query results - all beginning, trailing and middle spaces will be shown as is

* removing the change through formatting and replacing with css change formatting was leaving special char while removing nbsp
2019-04-11 13:45:10 -07:00
Aditya Bist
bcea1b66be Added some usage details (#4711)
* added some details

* remove unused import

* added new metrics, removed churn

* merged master and code review comments

* code review comments

* normalized days to calendar days/weeks/months

* cleaned up code

* changed comment to start required check for PR

* fix failing test

* fix test

* removed null assignment

* fix null test script
2019-04-11 12:07:20 -07:00
Yurong He
4f8d14ed3e Fix ##3479 ctrl+a select active cell output or preview markdown (#4981)
* Enable ctrl+a to select the output or markdown content when the cell is active

* Moved toggleUserSelect into ngOnChanges

* Resolve PR comments
2019-04-11 11:36:42 -07:00
Chris LaFreniere
442adfbbc3 Add New Notebook from Server Dashboard (#4971) 2019-04-11 10:15:45 -07:00
Aditya Bist
fe12233954 Azure extension changes (#4987)
* removed search box

* removed commented code
2019-04-11 09:44:43 -07:00
Anthony Dresser
c725f6f572 fix html structure of add account dialog (#4988) 2019-04-10 17:41:18 -07:00
Cory Rivera
1870d83081 Add additional error handling to Python installation for Notebooks (#4891)
* Also enabled integration tests for python installation.
2019-04-10 17:09:28 -07:00
Anthony Dresser
8315dacda4 Merge from vscode 31e03b8ffbb218a87e3941f2b63a249f061fe0e4 (#4986) 2019-04-10 16:29:23 -07:00
kisantia
18c54f41bd remove unnecessary message that connection is needed (#4982) 2019-04-10 16:22:18 -07:00
Kevin Cunnane
293f9c22c4 Touchbar support for Run Cell, Run Query, Add Cell (#4972)
* Basic touchbar support

* Touchbar support for Run Cell, Run Query, Add Cell
- Add top 3 notebook commands
- Add top query command

Actions only appear on having active editor of expected type.
In order to make Notebook work as expected, added tabindex to support focusing
and hide outline to ensure it doesn't get weird blue outline on click
Note: does not have icons yet, which would be nice.
However can add in subsequent PR once this comes from UX.
2019-04-10 14:04:36 -07:00
Anthony Dresser
a74510544f Remove rest of builder (#4963)
* removes more builder references

* remove builder from profiler

* formatting

* fix profiler dailog

* remove builder from oatuhdialog

* remove the rest of builder references

* formatting
2019-04-10 13:23:33 -07:00
Aditya Bist
9b053c50c2 Azure - icon change (#4967)
* changed icon and string

* changed add to servers icon
2019-04-10 13:20:43 -07:00
Chris LaFreniere
88712f46bf Fix for relative markdown image paths (#4889)
* Fix for relative markdown image paths

* PR comments
2019-04-10 11:35:06 -07:00
Chris LaFreniere
d6df20b0e8 Notebooks: Potential Fix for "Notebook Provider does not Exist" Error (#4848)
* Fallback to SQL

* Fix providers not found issue

* await whenInstalledExtensionsRegistered

* PR comments
2019-04-10 11:34:46 -07:00
Chris LaFreniere
5dc37f7557 improve assert message (#4968) 2019-04-10 10:14:44 -07:00
Gene Lee
445d306586 Fixed Broken Notebook Preview (#4895) 2019-04-09 18:47:24 -07:00
Chris LaFreniere
d332ae1132 Fix to ensure that we rewrite spark ui links correctly (#4962) 2019-04-09 18:23:21 -07:00
Kevin Cunnane
37f45b10a3 Mitigate (but not fully fix) Run Cell from disconnected notebook (#4960)
This is a partial fix that lays groundwork for full "Prompt to connect" if a kernel needs a connection.
I am waiting on Yurong's refactoring of connection handling before doing any of the prompt work.

- Adds kernel metadata about whether a connection is required.
- For Jupyter, only Spark kernels are listed as requiring a connection
- If this is true and there's no active connection, will show notification and not call execute

In the future, this path will still be used if user is prompted to connect and cancels out.
The future change will be to inject a "connect" handler from notebook.component to the cell callback and use to set connection context
2019-04-09 17:45:05 -07:00
kisantia
d9b6ec0654 Add title for DiffEditor and fix SplitViewContainer (#4961)
* add option to have diff editor title

* fix component being undefined and splitter not showing
2019-04-09 16:41:32 -07:00
kisantia
f98428aea5 Add reverse color option to text diff editor (#4826)
* Add reverse color option to text diff editor
2019-04-09 16:26:41 -07:00
Gene Lee
b3be1d79cd Add support for new endpoint key string 'gateway' (#4954) 2019-04-09 15:19:02 -07:00
Yurong He
ea8f885f05 Call getCurrentGlobalConnection like New Query to get the active connection context (#4955) 2019-04-09 15:15:36 -07:00
Kevin Cunnane
2de47c2a50 Fix #4930 Text cells are referred to as text and markdown in commands (#4956) 2019-04-09 14:20:29 -07:00
Kevin Cunnane
30b8e105f9 Fix #4893 New Notebook Can Open Existing Noteboon (#4959)
Add back check for textDocuments with same name, should've been there anyhow

On rehydration files show as text docs before clicking as only get
changed by customInputConverter code path.
We should look at this long term - ideally we'd update notebookDocuments
with correct values on initial start. #4958 opened to track this.
2019-04-09 14:11:10 -07:00
Kevin Cunnane
2a44fab8ba Fix issue where mac launch often failed to attach (#4957)
- Timeout now matches the windows timeout value
2019-04-09 14:10:56 -07:00
Chris LaFreniere
6a06a99e46 Change pfs.rimraf call in insightsutils test (#4921) 2019-04-09 13:05:36 -07:00
Anthony Dresser
3670dfbebd changes strings for data explorer (#4946) 2019-04-09 12:39:15 -07:00
kisantia
daf929ecc7 add splitViewContainer and diffEditor to ModelBuilder interface (#4950) 2019-04-09 11:45:21 -07:00
Anthony Dresser
f96a17c930 Remove unused code (#4873)
* removes unused features

* remove more unused code; formatting

* lock changes

* fix run issue
2019-04-09 02:00:51 -07:00
Anthony Dresser
2fb06e7f4f Move notebooks to workbench (#4888)
* move notebooks under workbench

* fix style imports
2019-04-09 01:59:55 -07:00
Anthony Dresser
4ece9b0085 remove dispose of button listeners (#4914) 2019-04-09 01:08:56 -07:00
Anthony Dresser
a4bd31e96a Removes Builder references from modal (#4869)
* remove builder from modal

* add more DOM methods
2019-04-09 00:28:52 -07:00
Anthony Dresser
8bdcc3267a Code Layering dashboard (#4883)
* move dashboard to workbench

* revert xlf file changes

* 💄

* 💄

* add back removed functions
2019-04-09 00:26:57 -07:00
Takahito Yamatoya
9e9164c4ee fix the format (#4899) 2019-04-08 19:56:44 -07:00
Alan Ren
5dc6a39652 Update readme.md (#4907) 2019-04-08 16:25:53 -07:00
kisantia
ada0966832 Add toolbar separator (#4890)
* Add option to add toolbar separator after toolbar component
2019-04-08 15:27:18 -07:00
Alan Ren
e6faef27ab Alanren/integration setup (#4871)
* automate the setup and use akv to store values

* update readme.md

* get rid of the save to file part

* update readme

* add more messages

* fix the error

* fix some errors

* fix the readme
2019-04-08 15:11:38 -07:00
Anthony Dresser
acc27d0829 Code Layering Accounts (#4882)
* code layering for accounts

* formatting

* formatting

* formatting
2019-04-08 14:45:30 -07:00
Anthony Dresser
ab54f7bb45 remove builder references from some componnets (#4868) 2019-04-08 14:24:03 -07:00
Yurong He
88161cc37d Fixed cancel connectionDialog from attach to shows dup "select connection" (#4865) 2019-04-08 14:06:46 -07:00
Anthony Dresser
0975e6834e remove builder from taskswidget (#4866) 2019-04-08 13:28:23 -07:00
Anthony Dresser
22ec1d5f0a Strict Null Checks, Builder Removal, Formatting (#4849)
* remove builder; more null checks

* null checks

* formatting

* wip

* fix dropdown themeing

* formatting

* formatting

* fix tests

* update what files are checked

* add code to help refresh bad nodes
2019-04-08 13:27:41 -07:00
udeeshagautam
01784dd186 Adding Diff view and Split view container as Model View Editor Components (#4831)
* intial code for diff view inside model view

* Adding basic Split View Container depending on Flex Layout

* Enabled resizing between top and bottom view

* cleaning up some of the sqlops references

* Adding height as per CR comment
2019-04-08 11:11:14 -07:00
Karl Burtram
02cf91c158 Remove broken VS Code test from merge (#4887) 2019-04-05 15:06:11 -07:00
Karl Burtram
0532346f4f Merge from vscode 591842cc4b71958c81947b254924a215fe3edcbd (#4886) 2019-04-05 14:14:26 -07:00
Chris LaFreniere
657adafb7d always serialize execution count (#4864) 2019-04-05 11:34:10 -07:00
Anthony Dresser
818c0789ea Reduce packaged size of extensions (#4300)
* reduce output of notebooks

* reduce size of azurecore

* update mssql extensions to be webpacked

* formatting

* remove commented code

* fix packaged config

* fix mssql packing
2019-04-05 10:48:00 -07:00
Karl Burtram
cb5bcf2248 Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880) 2019-04-05 10:09:18 -07:00
Anthony Dresser
9bd7e30d18 revert vscode cahnges (#4879) 2019-04-05 09:15:38 -07:00
Aditya Bist
572010ded1 fixed azure extension issues (#4859) 2019-04-04 15:32:04 -07:00
David Shiflet
1f22326e78 Reuse existing saved connection that matches args (#4839)
* Reuse existing saved connection that matches args

* search subgroups for matches
2019-04-04 11:11:18 -07:00
Yurong He
504d5c91bc Fixed #4800 need to use ConnectionProfile in order to get the correct… (#4812)
* Fixed #4800 need to use ConnectionProfile in order to get the correct connection

* Go back to create connect in run cell to avoid to fail to run cell or close the connection used by other.
2019-04-03 19:00:56 -07:00
Chris LaFreniere
a34692b6f2 Fix for dispose method of undefined (#4843) 2019-04-03 18:08:42 -07:00
Karl Burtram
73b5d23210 Update bug template labels (#4840) 2019-04-03 16:47:55 -07:00
Anthony Dresser
e31de8b137 fixed more null references (#4841) 2019-04-03 16:30:58 -07:00
Anthony Dresser
cef5bbb2be Strict null pass on some base ui files (#4832)
* more strict null checks in base browser code

* revert changes to radiobutton

* fix some more minor things, enable strict null check in pipelines

* formatting

* fix compile errors

* make null undefined

* more null to undefined
2019-04-03 16:18:33 -07:00
Anthony Dresser
80a8e1a4da More builder removal (#4810)
* remove more builder references

* formatting
2019-04-03 16:18:03 -07:00
Anthony Dresser
fcb8fe50fe Advanced Description On Bottom (#4836)
* move description to the bottom

* formatting
2019-04-03 15:49:53 -07:00
Karl Burtram
5235c8aad6 Turn-off classifier bot while doing label refactoring (#4834) 2019-04-03 13:59:48 -07:00
Karl Burtram
5b67525211 Bump SQL Tools to 1.5.0-alpha.84 (#4830) 2019-04-03 11:43:43 -07:00
Anthony Dresser
fb697729c0 Data Explorer Icons (#4806)
* inital icon support

* add necessary classes for icons

* initialize icon to blank string
2019-04-03 11:10:48 -07:00
Chris LaFreniere
76fe0fef49 Fix broken test merge conflicts (#4823) 2019-04-03 10:44:01 -07:00
Karl Burtram
6295d03801 Update XLF files (#4811) 2019-04-02 17:35:18 -07:00
Chris LaFreniere
07166fb3cd Run All Cells Notebook Implementation (#4713)
* runAllCells API

* add comment

* more run cells fixes

* Add integration test

* Add multiple cell SQL notebook test

* Comment out python tests as they fail in the lab

* remove unused imports

* PR comments

* Remove localize

* Return true instead of promise.resolve(true)
2019-04-02 16:47:00 -07:00
Yurong He
219dfe66d0 Make connection for new Notebook (#4770)
* Make connection for new Notebook

* Resolve merge issue

* User connectionUri to track the connects need to be disconnected

* Removed debugging log
2019-04-02 15:52:01 -07:00
Yurong He
22c62fb524 Added setup and teardown for test; add variable to control run python… (#4782)
* Added setup and teardown for test; add variable to control run python/pyspark tests; remove dup code in clearAlloutput tests

* Resolve PR comments
2019-04-02 15:16:54 -07:00
Karl Burtram
f8706abebe Merge from vscode b8c2e7108b3cae7aa2782112da654bedd8bb3a52 (#4808) 2019-04-02 14:35:06 -07:00
Alan Ren
e83a6f9c2e profile page and summary page (#4769)
* add cluster name to page

* implement profile page -1

* fix compilation error due to new method

* profile page 0328

* summary page

* make divcontainer accessible

* handle disposable

* add support for "coming soon" cards
2019-04-02 13:52:39 -07:00
Anthony Dresser
63485c8c78 Remove builder references from options dialog (#4774)
* remove more builder references; remove $ from declarations

* fix jquery references

* formatting

* fixing backup

* fix backup box
2019-04-02 13:49:50 -07:00
Karl Burtram
72ef024678 Check for null ref in query statusbar timer (#4804) 2019-04-02 11:56:45 -07:00
Chris LaFreniere
414c736655 Allow output area to be selectable again (#4714) 2019-04-01 23:09:00 -07:00
Yurong He
fdbfbb9238 Change attach to show user name. Use connectionProfile.title to displ… (#4794)
* Change attach to show user name. Use connectionProfile.title to display the same info as OE server node

* Fixed some potential profile leak

* Removed unused import

* Resolve PR comments
2019-04-01 21:18:49 -07:00
Alan Ren
a766e5d334 fix error for download extension (#4793) 2019-04-01 16:44:15 -07:00
Yurong He
2faf01eb9d Add MouseWheelSupport , AdditionalKeyBindings and AutoColumnSize plugins to sql notebook grid (#4790) 2019-04-01 12:44:40 -07:00
Yurong He
a4c2463b2f Add azure and standalone instance config to environment variables (#4745)
* change to fs to write file

* change random range to 1 to 100

* Added more env variables check as well

* Add azure and standalone env variables

* Add Azure instance to unblock mac pipeline testing

* Fixed some merge issue and improve delete file

* Added standalone test only run on windows
2019-03-29 20:14:44 -07:00
Cory Rivera
ddbd8033f9 Remove an outdated showErrorMessage assert from Jupyter Server Manager unit tests. (#4777) 2019-03-29 15:18:01 -07:00
Yurong He
6da66cf367 change to fs to write file (#4736)
* change to fs to write file

* Added more env variables check as well

* Resolve PR comments

* Merge master

* Add file name exist check and delete it after test is done
2019-03-29 15:04:11 -07:00
Cory Rivera
c7bc37d010 Add quotes around python paths to guard against spaces. (#4775) 2019-03-29 14:55:08 -07:00
Charles Gagnon
e0ec3c5035 Fix workspaceRoot macro for insights (#4686)
* Fix workspaceRoot macro for insights

The workspaceRoot macro wasn't working correctly for finding the queryFile. There were a couple of issues :

1. The path separators were hardcoded as / which wasn't xplat-compatible
2. They required the first section of the path was one of the folders in the workspace - e.g. if the workspace contained a folder named foo you'd have to specify ${workspaceRoot}\foo\myfile.sql. This is inconsistent with the folder logich was just appends the path after ${workspaceRoot} to the folder that's currently open

I changed the logic to just append the relative part of the path to every folder currently open in the workspace and choose the first one that it found that contained the file we were told to look for - which follows the convention the folder logic uses. If the file doesn't exist it'll just fall back to using the path without the macro (which is likely to not resolve and thus will display an error, but there's nothing we can do at that point anyways)

* Switch to using VS Code resolver (support for more than just workspaceRoot) and move resolution code into helper method so it can be used by the multiple places it's called. Added tests for the methods.

* Add test for invalid param

* Change resolveQueryFilePath to be a standalone exported function. Change it to throw if the file can't be resolved/found so callers can display error correctly. Added more tests to covery new scenarios. Switch to using pfs instead of fs for file existance checks.

* Add extra param to InsightsDialogController construction in test

* Fix formatting and test errors.

* Change to suiteSetup and suiteTeardown so the setup/teardown is only ran once instead of once per test - we don't need unique files and this stops a race condition error with deleting the test folder.

* spaces -> tabs
2019-03-29 14:53:49 -07:00
Aditya Bist
d4f287298f Agent - committer work (#4758)
* fix delete job

* added the ability to change and retrieve jobowner

* fixed UX for delete step

* improved operator actions

* fixed operators and proxies

* added errors for failures
2019-03-29 13:46:52 -07:00
Aditya Bist
e70d5838a8 Agent - stop job (#4410)
* stop job behavior similar to ssms

* removed agent from sqlops

* fix couple UX issues

* let sqlops remain unchanged
2019-03-29 13:42:34 -07:00
Aditya Bist
b04ca0fdbd Agent - refresh refactor (#4773)
* refactored refresh views

* removed refresh from jobs view
2019-03-29 13:42:02 -07:00
Anthony Dresser
a064da642d Merge from vscode f5044f0910e4aa7e7e06cb509781f3d56e729959 (#4759) 2019-03-29 10:54:38 -07:00
Charles Gagnon
37ce37979a Fix broken notebook test (#4766)
* Fix broken test

The test would always fail if it was doing the right thing - since it was asserting that there WEREN'T any cells with outputs (the opposite of what it should have been checking).

* Update error message to be clearer

* Fix spelling error
2019-03-29 10:25:52 -07:00
Karl Burtram
cb3cbd0d78 Revert Messages Collapse behavior (#4757)
* Revert "change sizing behavior to allow the messages to fulling collapse down (set results to have no max height) (#4313)"

This reverts commit 7de294a58e.

* Revert "Grid scrolling bugs (#4396)"

This reverts commit ace6012c1c.
2019-03-28 18:09:58 -07:00
Raj
1415aa1c03 #4586: Clear Results feature in Notebooks (#4705)
* #4586: Clear all outputs feature

* text change

* Adding extensible method with integration tests

* Misc change

* Misc change

* Adding more logging

* Change to test

* Adding outputs confition in integration tests
2019-03-28 15:20:28 -07:00
Karl Burtram
7eb17f6abc Add Query Editor null checks (#4753) 2019-03-28 15:18:44 -07:00
Charles Gagnon
fdb471d506 Windows extension fixes/improvements (#4740)
* Windows extension fixes/improvements

Remove error message when activating extension on non-win platforms (instead just don't do anything). Add hooks to kill child processes on exit if they haven't ended already. Formatting fixes.

* Remove shelljs

* Remove error messages from telemetry until I can follow up on whether we're allowed to send these up. Fix some issues with the exec callback - the child_process exec function returns an ExecException object instead of the code directly like the shelljs did so check for that correctly.
2019-03-28 14:58:18 -07:00
Anthony Dresser
e6785ffe95 Merge from vscode de81ccf04849309f843db21130c806a5783678f7 (#4738) 2019-03-28 13:06:16 -07:00
Karl Burtram
cc2951265e Add query execution plan extensibility APIs (#4072)
* WIP 1

* WIP 2

* Fix typos

* Iterate on API a bit

* Query Tab WIP

* More dynamic query tab impl

* Fix merge breaks

* Update interfaces

* Update to single event handler for query events

* Remove query plan extension

* Add generated JS file
2019-03-28 10:59:02 -07:00
Chris LaFreniere
ee413f3b24 Ensure only one cell shows as running at a time (#4715) 2019-03-27 19:04:07 -07:00
Karl Burtram
fc664a850d Fix query plan styles to correct rendering (#4739) 2019-03-27 18:00:33 -07:00
Raj
55efe76b2e #3585: Canceled message when changing kernel (#4673)
* #3585: Canceled message when changing kernel

* Indentation

* Cleanup
2019-03-27 15:43:27 -07:00
Raj
dd8922ce4d #4511: Streamline untitled notebook count (#4727) 2019-03-27 15:29:45 -07:00
Yurong He
102b48c302 Change standalone integration test to use sql login (#4728) 2019-03-27 15:09:45 -07:00
David Shiflet
a360bebd9d Add status messages during command line processing (#4725)
* add status bar messages

* missed semicolon
2019-03-27 15:44:57 -04:00
Cory Rivera
37ab493b78 Use getErrorMessage to get exception messages in python installation code. (#4730) 2019-03-27 12:14:42 -07:00
Anthony Dresser
46b7afe558 Merge from vscode 3bd60b2ba753e7fe39b42f99184bc6c5881d3551 (#4712) 2019-03-27 11:36:01 -07:00
Chris LaFreniere
eac3420583 Minimum grid height set when grid returns 0 rows (#4716) 2019-03-27 10:57:48 -07:00
Chris LaFreniere
e1e9c08242 Disable Python 3 notebook integration test due to timeout (#4726)
* Disable Python 3 notebook integration test due to timeout

* Remove unused imports
2019-03-27 10:18:42 -07:00
Chris LaFreniere
5ac6cf3b74 Ensure SQL is the first kernel in the kernels dropdown (#4692)
* Ensure SQL is the first kernel shown in the dropdown

* cleanup to prevent sql from registering twice
2019-03-26 19:39:28 -07:00
Yurong He
d6a58136da Add log to help debug failure in the lab (#4706) 2019-03-26 11:55:14 -07:00
Alan Ren
819b7b93d1 render xml properly in the grid (#4674)
* render xml properly in the grid

* fix html injection

* fix tslint error

* add comments and fix an issue

* fix comment
2019-03-26 11:48:55 -07:00
Anthony Dresser
bceeda1cfd Remove dev flags (#4707)
* remove more dev flags

* formatting
2019-03-26 11:44:59 -07:00
Anthony Dresser
0d8ef9583b Merge from vscode 966b87dd4013be1a9c06e2b8334522ec61905cc2 (#4696) 2019-03-26 11:43:38 -07:00
Yurong He
b1393ae615 Disable pySpark3 notebook test to unblock insider build (#4695)
* Disable pySpark3 notebook test to unblock insider build

* Removed unused import
2019-03-25 17:36:49 -07:00
Alan Ren
464109313b fix context menu test due to new SSMSMin feature (#4693) 2019-03-25 16:49:12 -07:00
Raj
83c8baf8e3 #4418: Notebook file icon doesn't show for new notebook (#4676)
* #4418: Notebook icon doesn't load for untitled

* Indentation

* Indentation
2019-03-25 16:05:04 -07:00
Chris LaFreniere
1bac929ab3 Fix for SQL Kernel only showing up (#4691)
* Ensure that notebook providers that are registered "early" are shown in kernels dropdown

* cleanup
2019-03-25 15:24:57 -07:00
Charles Gagnon
b27417da41 Add ADS Windows support extension with LaunchSsmsDialog command (#4248)
* ADS Windows support extension with LaunchSsmsDialog command

* Update readme

* Fix spacing

* Update download with new file location and name

* Update SsmsMin package with bits from latest RC build and addressed some comments.

* Update extension name. Add Context menu extension for launching server properties dialog. Remove params interface from public API

* Rename folder and update README

* Correct README title

* Fix a few issues and clean up some stuff.

* Update to azdata namespace

* Refactor to use async/await and add some more telemetry

* Add .bat for running extension tests (currently only Notebook) and set up launch.json with 2 new launch configs for running & debugging extension tests.

* Rename files to make it clear these aren't the integration tests

* Update launch.config too

* Fix spacing and missed file name update

* Fix some bugs in buildSsmsMinCommandArgs and add unit tests
2019-03-25 14:19:11 -07:00
Charles Gagnon
ef1f72f69b Remove popular extensions view (#4679)
We don't track installs for our extensions so the "Popular Extensions" category is just a duplicate of the full list. Removing it to reduce clutter until we can add that functionality in. This also removes the command associated with the view.
2019-03-25 13:21:48 -07:00
Raj
784fd57410 confirmSave using UntitledEditorInput (#4611) 2019-03-25 10:25:28 -07:00
Charles Gagnon
1dd0afcf80 Add ADS Startup Telemetry events back in (#4675)
They were removed with a VS Code merge. Changed to using extension contribution to log the telemetry to reduce the amount of VS code edits.
2019-03-23 11:02:34 -07:00
udeeshagautam
ddce7731b9 Feature/viewlet cmsapis (#4312)
* first set of changes to experiment the registration of cms related apis

* Adding cms service entry to workbench

* Adding basic functionality for add remove reg servers and group

* Returning relative path as part of RegServerResult as string

* Removing the cms apis from core. Having mssql extension expose them for cms extension

* Propogating the backend name changes to apis

* Fixing some missing sqlops references

* Adding a sqltools service version with CMS apis available
2019-03-22 17:24:45 -07:00
Alan Ren
d00c3780a6 fix for issue 4596 (#4670) 2019-03-22 14:11:26 -07:00
Anthony Dresser
4a87a24235 Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663) 2019-03-22 13:07:54 -07:00
Anthony Dresser
f5c9174c2f Revert "Connection Store Refactor (#4632)" (#4671)
This reverts commit 756f77063a.
2019-03-22 11:30:20 -07:00
Alan Ren
8d5f676039 a few deploy cluster wizard changes (#4644)
* update icon for target types

* Revert "update icon for target types"

This reverts commit 79bd7674f2c09602430a0b10829f7b0d3234eb98.

* update target type icons

* update eula and privacy policy links

* existing cluster page

* adjust the loading indicator position
2019-03-22 11:29:51 -07:00
Yurong He
71db7e10b6 Add notebook integration tests (#4652)
* Add notebook integration tests
2019-03-22 10:39:44 -07:00
Anthony Dresser
756f77063a Connection Store Refactor (#4632)
* various clean ups

* formatting

* remove linting

* formatting

* IConfigurationService is even better

* messing with connection config tests

* update tests

* formatting

* foramtting

* remove unused code

* add more tests

* working through tests

* formatting

* more factoring of connection store and increase code coverage

* formatting

* fix tests
2019-03-22 01:07:32 -07:00
Matt Irvine
5f637036bc Fix query tab color regression (#4660) 2019-03-21 16:22:03 -07:00
Anthony Dresser
24b5f41065 add data explorer default (#4653) 2019-03-21 16:10:54 -07:00
Chris LaFreniere
b00352570b Fix the "Failed to show notebook document" errors (#4649) 2019-03-21 16:06:17 -07:00
Matt Irvine
0b44b7d384 Fix issue reporter 'Visual Studio Code' text (#4658) 2019-03-21 15:38:25 -07:00
Chris LaFreniere
82da64d66d Handle future done in SQL for multiple batches (#4654) 2019-03-21 13:47:01 -07:00
Matt Irvine
ee5a76bb0c Go back to LICENSE.txt for Windows installers (#4655) 2019-03-21 13:28:51 -07:00
Anthony Dresser
b65ee5b42e Merge from vscode fc10e26ea50f82cdd84e9141491357922e6f5fba (#4639) 2019-03-21 10:58:16 -07:00
Anthony Dresser
8298db7d13 Ignore the users title bar settings (#4625)
* ignore the users title bar settings

* ignore in more places
2019-03-20 19:39:43 -07:00
Chris LaFreniere
5b0e86b179 Have notebook grids respond to theme change events (#4624) 2019-03-20 18:47:57 -07:00
Matt Irvine
ed2641ea02 Update how we create services (#4638) 2019-03-20 17:08:15 -07:00
Matt Irvine
66939636dc Bring over code-url-handler.desktop (#4629) 2019-03-20 14:56:50 -07:00
Anthony Dresser
2c331d929a remove duplicate launch task (#4631) 2019-03-20 12:34:27 -07:00
Anthony Dresser
4472764f3a extensions tslint cleanup/Connection config refactor (#4370)
* various clean ups

* formatting

* remove linting

* formatting

* IConfigurationService is even better

* messing with connection config tests

* update tests

* formatting

* foramtting

* remove unused code

* add more tests
2019-03-20 11:59:07 -07:00
Karl Burtram
6cb7153bdd VBump ADS to 1.6.0 2019-03-20 11:41:41 -07:00
Anthony Dresser
5142f69655 Cleanup dependencies (#4546)
* Merge VS Code 1.31.1

* Fix missed merge conflict

* Fix license in new files

* Remove extra extension files

* Fix compile error

* Fix TSLint errors

* Fix integration tests

* Fixed saved and recent connections list

* Fix tests

* move dependecies and delete unused ones

* fix test compile
2019-03-20 11:30:20 -07:00
Anthony Dresser
dfe23f7bfe Remove some CARBON Edits (#4571)
* remove some unnecessary sql carbon edits to vs source and adds correct fix where necessary

* revert bad change
2019-03-20 11:30:06 -07:00
Raj
6873353cd4 #4618: Notebook JSON has extra } after save (#4627) 2019-03-20 11:12:02 -07:00
Matt Irvine
025c97673f Reapply extension management edits that were removed in 1.31 merge (#4606) 2019-03-20 10:40:09 -07:00
Anthony Dresser
c814b92557 VSCode merge (#4610)
* Merge from vscode e388c734f30757875976c7e326d6cfeee77710de

* fix yarn lcoks

* remove small issue
2019-03-20 10:39:09 -07:00
Anthony Dresser
87765e8673 Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
2019-03-19 17:44:35 -07:00
Raj
833d197412 #3973: Persist scroll position when tab notebooks (#4531)
* #3973: Persist scroll position when tab notebooks

* Remove getter and setter
2019-03-19 14:01:24 -07:00
Maddy
5e72cd12d1 Maddy/prompt password when different (#4537)
* Prompt for password once when the sql instance password doesn't work for hdfs. If the user provides the correct password, connect and continue, else show Unauthorized  node.

* Removed the hardcoded bad password

* Added check for empty folder scenarios

* Added ErrorStatusCode as property of TreeNode. Checking for the error code instead of the error string to avoid localization issues

* type fixed

* implemented hasExpansionError
2019-03-19 13:46:55 -07:00
Charles Gagnon
330fb6dff5 Remove tooltip from editable dropdown (#4542)
* Fix our custom dropdown control to update the tooltip text correctly when a new value is selected. Previous behavior was to always keep the initial text (<Default> for example). Now we'll update it as appropriate (and default back to Placeholder text when we're clearing the value)

* Spaces -> tabs

* Remove extra ;

* Remove tooltips from the text box part of the dropdown

* Remove tooltips from dropdown arrows

* Revert "Remove tooltips from dropdown arrows"

This reverts commit 31a0748aaea42d5009eb9752bd075ce49a6716f5.
2019-03-19 13:46:36 -07:00
Raj
6d7d485a38 #4331: Set notebook dirty when change 'trusted' (#4569) 2019-03-18 10:56:04 -07:00
Karl Burtram
0160901060 Update readme\changelog for March (#4575) 2019-03-18 10:23:28 -07:00
Chris LaFreniere
9313140c59 Fix install packages not always showing on startup (#4566) 2019-03-18 10:18:03 -07:00
Raj
25b1d4b673 #4565: Open notebook from Dashboard - can't close dirty notebook (#4568)
* #4565:"Don't save" doesn't close editor -Dashboard

* Misc change
2019-03-17 08:03:43 -07:00
Chris LaFreniere
b9d0602f55 Only show filename for notebook titlebar when opening from Open Notebook (#4556) 2019-03-15 17:45:06 -07:00
Charles Gagnon
ec0a3bbc95 Fix recent connections list to use <default> DB if no DB is specified by the user when a connection is made (#4564) 2019-03-15 17:28:56 -07:00
Matt Irvine
50f63a2f72 Fix extension bugs from VS Code merge (#4563) 2019-03-15 17:22:56 -07:00
Raj
cb47cb7dbf #4365: Make notebook dirty when changing kernel (#4547) 2019-03-15 17:02:00 -07:00
Cory Rivera
c9ac49c758 Check error in webhdfs.sendRequest before trying to check response code. (#4561) 2019-03-15 16:52:08 -07:00
Karl Burtram
c4e8aba1c9 Fix missing Azure account name (#4555)
* Fix Azure account picker row height

* Remove unneeded styles
2019-03-15 15:37:00 -07:00
Karl Burtram
ba6b8b1f69 Fix Azure account picker row height 2019-03-15 15:29:25 -07:00
Anthony Dresser
09af2fc2cb Add needs repro closer bot (#4517)
* change message of needs repro and enable

* update needs repro to needs info

* update to needs more info
2019-03-15 14:53:15 -07:00
Alan Ren
5caf0b02f0 make connectiondialog react to provider event (#4544)
* make connectiondialog react to provider event

* fix unit test error

* code review comments
2019-03-15 14:47:23 -07:00
Matt Irvine
86bac90001 Merge VS Code 1.31.1 (#4283) 2019-03-15 13:09:45 -07:00
Charles Gagnon
7d31575149 Fix dropdowns flickering every other time they're opened. The hide message code was being invoked which called hideContextView (the actual dropdown part) even if no message was ever displayed. Now we'll delay setting the message to null and only call hideContextView if we actually had a message to display. (#4528)
Also fixed small issue where messages that didn't have a container would throw an error when trying to call removeClass (since this.element is pulled from the container and thus was undefined.

Tested that the flicker is gone and that messages still show up correctly
2019-03-15 11:19:14 -07:00
Charles Gagnon
7223b28829 Add config for running extension tests (#4495)
* Add .bat for running extension tests (currently only Notebook) and set up launch.json with 2 new launch configs for running & debugging extension tests.

* Rename files to make it clear these aren't the integration tests

* Update launch.config too

* Fix spacing and missed file name update
2019-03-15 09:12:04 -07:00
Anthony Dresser
4014c1d0ab Small strict null checking pass on a few files (#4293)
* fix some null checking

* fix various null strict checks

* move location fo sql files in json

* fix compile and more unused properties

* formatting

* small formatting changes

* readd types

* add comments for angular components

* formatting

* remove any decl
2019-03-14 18:18:32 -07:00
Anthony Dresser
0bf0e795ca More data explorer actions (#4307)
* adding context

* apply extension changes

* shimming disconnect

* add data explorer context menu and add disconnect to it

* clean up shim code; better handle errors

* remove tpromise

* simplify code

* add node context on data explorer

* formatting

* add new Query action

* fix various errors with how the context menus work

* add manage and new query

* add refresh command

* formatting
2019-03-14 17:19:37 -07:00
Kevin Cunnane
0bc3716f74 FIX #4513 Notebook stuck at changing kernel (#4518)
* FIX #4513 Notebook stuck at changing kernel
- Intra-provider kernel change didn't happen because we only tried changing kernel on new session creation.
- Inverted the logic (e.g. did the right thing) and renamed the method so it's clearer what we're doing & what the boolean value should be
- Manually tested all the known scenarios
2019-03-14 15:49:14 -07:00
Alan Ren
ca23ea0f69 use the new dataprotocol client (#4515) 2019-03-14 15:48:49 -07:00
Kevin Cunnane
efaa2c0e3f Fix #4505 Notebooks: New Notebook will not work if existing untitled notebooks are rehydrated (#4506)
* Fix #4505 Notebooks: New Notebook will not work if existing untitled notebooks are rehydrated
* Also fixes #4508
* Unify behavior across New Notebook entry points
- Use Notebook-{n} as the standard in both entry points
- Use SQL as default provider in both
- Ensure both check for other names and only use free number
2019-03-14 14:27:08 -07:00
udeeshagautam
d91f4d5748 Fix for : 4471 Backup/Restore shows in Context Menu for Azure DB (#4498)
* Remove Back Restore from Cloud db's Context menu

* checking for null

* Cleaning up the check
2019-03-14 14:06:11 -07:00
Kevin Cunnane
6f1a03587a Fix #4029 Ensure changeKernels always resolves, even in error states (#4488)
* Fix #4029 Ensure changeKernels always resolves, even in error states
This is necessary to unblock reverting the kernel on canceling  Python install
- startSession now correctly sets up kernel information, since a kernel is loaded there.
- Remove call to change kernel on session initialize. This isn't needed due to refactor
- Handle kernel change failure by attempting to fall back to old kernel
- ExtensionHost $startNewSession now ensures errors are sent across the wire.
- Update AttachTo and Kernel dropdowns so they handle kernel being available. This is needed since other changes mean the session is likely ready before these get going

* Fix to handle python cancel and load existing scenarios
- Made changes to handle failure flow when Python dialog is canceled
- Made changes to handle initial load fail. Kernel and Attach To dropdowns show No Kernel / None and you can choose a kernel
- Added error wrapping in ext host so that string errors make it across and aren't lost.
2019-03-14 13:07:08 -07:00
4009 changed files with 266627 additions and 180431 deletions

View File

@@ -1,4 +1,4 @@
# EditorConfig is awesome: http://EditorConfig.org # EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file # top-most EditorConfig file
root = true root = true
@@ -6,7 +6,6 @@ root = true
# Tab indentation # Tab indentation
[*] [*]
indent_style = tab indent_style = tab
indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
# The indent size used in the `package.json` file cannot be changed # The indent size used in the `package.json` file cannot be changed

3
.gitattributes vendored
View File

@@ -6,4 +6,5 @@ ThirdPartyNotices.txt eol=crlf
*.bat eol=crlf *.bat eol=crlf
*.cmd eol=crlf *.cmd eol=crlf
*.ps1 eol=lf *.ps1 eol=lf
*.sh eol=lf *.sh eol=lf
*.rtf -text

View File

@@ -2,7 +2,7 @@
name: Bug report name: Bug report
about: Create a report to help us improve about: Create a report to help us improve
title: '' title: ''
labels: '' labels: Bug
assignees: '' assignees: ''
--- ---

View File

@@ -2,7 +2,7 @@
name: Feature request name: Feature request
about: Suggest an idea for this project about: Suggest an idea for this project
title: '' title: ''
labels: feature request labels: Enhancement
assignees: '' assignees: ''
--- ---

View File

@@ -1,5 +1,5 @@
{ {
perform: true, perform: false,
alwaysRequireAssignee: false, alwaysRequireAssignee: false,
labelsRequiringAssignee: [], labelsRequiringAssignee: [],
autoAssignees: { autoAssignees: {

View File

@@ -1,6 +1,6 @@
{ {
daysUntilClose: 7, daysUntilClose: 7,
needsMoreInfoLabel: 'more info', needsMoreInfoLabel: 'needs more info',
perform: false, perform: true,
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity in the last 7 days. If you have more info to help resolve the issue, leave a comment"
} }

6
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.DS_Store .DS_Store
.cache
npm-debug.log npm-debug.log
Thumbs.db Thumbs.db
node_modules/ node_modules/
@@ -14,7 +15,10 @@ out-editor-min/
out-monaco-editor-core/ out-monaco-editor-core/
out-vscode/ out-vscode/
out-vscode-min/ out-vscode-min/
build/node_modules out-vscode-reh/
out-vscode-reh-min/
out-vscode-reh-pkg/
**/node_modules
coverage/ coverage/
test_data/ test_data/
test-results/ test-results/

2
.nvmrc
View File

@@ -1 +1 @@
8.9.2 10

57
.vscode/launch.json vendored
View File

@@ -66,23 +66,39 @@
"request": "launch", "request": "launch",
"name": "Launch azuredatastudio", "name": "Launch azuredatastudio",
"windows": { "windows": {
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat" "runtimeExecutable": "${workspaceFolder}/scripts/sql.bat",
"timeout": 20000
}, },
"osx": { "osx": {
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh" "runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
"timeout": 20000
}, },
"linux": { "linux": {
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh" "runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
"timeout": 20000
}, },
"env": {
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
},
"breakOnLoad": false,
"urlFilter": "*workbench.html*", "urlFilter": "*workbench.html*",
"runtimeArgs": [ "runtimeArgs": [
"--inspect=5875", "--no-cached-data" "--inspect=5875",
"--no-cached-data"
], ],
"skipFiles": [ "webRoot": "${workspaceFolder}"
"**/winjs*.js" },
{
"type": "node",
"request": "launch",
"name": "Launch ADS (Main Process)",
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
"runtimeArgs": [
"--no-cached-data"
], ],
"webRoot": "${workspaceFolder}", "outFiles": [
"timeout": 45000 "${workspaceFolder}/out/**/*.js"
]
}, },
{ {
"type": "chrome", "type": "chrome",
@@ -147,7 +163,23 @@
"outFiles": [ "outFiles": [
"${workspaceFolder}/out/**/*.js" "${workspaceFolder}/out/**/*.js"
] ]
} },
{
"type": "chrome",
"request": "launch",
"name": "Run Extension Unit Tests",
"windows": {
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.bat"
},
"osx": {
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
},
"linux": {
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
},
"webRoot": "${workspaceFolder}",
"timeout": 45000
},
], ],
"compounds": [ "compounds": [
{ {
@@ -157,6 +189,13 @@
"Run Unit Tests" "Run Unit Tests"
] ]
}, },
{
"name": "Debug Extension Unit Tests",
"configurations": [
"Attach to Extension Host",
"Run Extension Unit Tests"
]
},
{ {
"name": "Debug azuredatastudio Main and Renderer", "name": "Debug azuredatastudio Main and Renderer",
"configurations": [ "configurations": [

24
.vscode/settings.json vendored
View File

@@ -44,11 +44,19 @@
"emmet.excludeLanguages": [], "emmet.excludeLanguages": [],
"typescript.preferences.importModuleSpecifier": "non-relative", "typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.quoteStyle": "single", "typescript.preferences.quoteStyle": "single",
"json.schemas": [{ "json.schemas": [
"fileMatch": [ "cgmanifest.json" ], {
"url": "./.vscode/cgmanifest.schema.json" "fileMatch": [
}, { "cgmanifest.json"
"fileMatch": [ "cglicenses.json" ], ],
"url": "./.vscode/cglicenses.schema.json" "url": "./.vscode/cgmanifest.schema.json"
}] },
} {
"fileMatch": [
"cglicenses.json"
],
"url": "./.vscode/cglicenses.schema.json"
}
],
"git.ignoreLimitWarning": true
}

View File

@@ -23,11 +23,13 @@
"description": "Insert Copyright Statement" "description": "Insert Copyright Statement"
}, },
"TS -> Inject Service": { "TS -> Inject Service": {
"scope": "typescript",
"description": "Constructor Injection Pattern", "description": "Constructor Injection Pattern",
"prefix": "@inject", "prefix": "@inject",
"body": "@$1 private readonly _$2: ${1},$0" "body": "@$1 private readonly _$2: ${1},$0"
}, },
"TS -> Event & Emitter": { "TS -> Event & Emitter": {
"scope": "typescript",
"prefix": "emitter", "prefix": "emitter",
"description": "Add emitter and event properties", "description": "Add emitter and event properties",
"body": [ "body": [

11
.vscode/tasks.json vendored
View File

@@ -30,19 +30,16 @@
}, },
{ {
"type": "npm", "type": "npm",
"script": "strict-null-check-watch", "script": "strict-initialization-watch",
"label": "TS - Strict Null Checks", "label": "TS - Strict Initialization",
"isBackground": true, "isBackground": true,
"presentation": { "presentation": {
"reveal": "never" "reveal": "never"
}, },
"problemMatcher": { "problemMatcher": {
"base": "$tsc-watch", "base": "$tsc-watch",
"owner": "typescript-strict-null", "owner": "typescript-strict-initialization",
"applyTo": "allDocuments" "applyTo": "allDocuments"
},
"runOptions": {
"runOn": "folderOpen"
} }
}, },
{ {
@@ -86,4 +83,4 @@
"problemMatcher": [] "problemMatcher": []
} }
] ]
} }

View File

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

View File

@@ -1,5 +1,46 @@
# Change Log # Change Log
## Version 1.7.0
* Release date: May 8, 2019
* Release status: General Availability
## What's new in this version
* Announcing Schema Compare *Preview* extension
* Tasks Panel UX improvement
* Announcing new Welcome page
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/milestone/31?closed=1).
## Contributions and "thank you"
We would like to thank all our users who raised issues.
## Version 1.6.0
* Release date: April 18, 2019
* Release status: General Availability
## What's new in this version
* Align with latest VS Code editor platform (currently 1.33.1)
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/26?closed=1).
## Contributions and "thank you"
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
* yamatoya for `fix the format (#4899)`
## Version 1.5.1
* Release date: March 18, 2019
* Release status: General Availability
## What's new in this version
* Announcing T-SQL Notebooks
* Announcing PostgreSQL extension
* Announcing SQL Server Dacpac extension
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/25?closed=1).
## Contributions and "thank you"
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
* GeoffYoung for `Fix sqlDropColumn description #4422`
## Version 1.4.5 ## Version 1.4.5
* Release date: February 13, 2019 * Release date: February 13, 2019
* Release status: General Availability * Release status: General Availability

View File

@@ -24,7 +24,9 @@ The built-in tool for reporting an issue, which you can access by using `Report
Please include the following with each issue. Please include the following with each issue.
* Version of Azure Data Studio (formerly SQL Operations Studio). * Version of Azure Data Studio (formerly SQL Operations Studio)
* Your operating system
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu. > **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.

View File

@@ -9,13 +9,13 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
Platform | Link Platform | Link
-- | -- -- | --
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2072725 Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2091882
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2072728 Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2091491
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2072354 Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2091490
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2072737 macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2091489
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2072360 Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2091488
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2072741 Linux RPM | https://go.microsoft.com/fwlink/?linkid=2091487
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2072744 Linux DEB | https://go.microsoft.com/fwlink/?linkid=2092022
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions. Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
@@ -68,6 +68,8 @@ The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.micro
## Contributions and "Thank You" ## Contributions and "Thank You"
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes: We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
* yamatoya for `fix the format (#4899)`
* GeoffYoung for `Fix sqlDropColumn description #4422`
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277` * AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
* sadedil for `Missing feature request: Save as XML #3729` * sadedil for `Missing feature request: Save as XML #3729`
* gbritton1 for `Removed reference to object explorer #3463` * gbritton1 for `Removed reference to object explorer #3463`

View File

@@ -343,32 +343,6 @@ END OF emmet NOTICES AND INFORMATION
========================================= =========================================
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 JD Ballard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF error-ex NOTICES AND INFORMATION
%% escape-string-regexp NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2440,7 +2414,6 @@ General Public License.
-------------------------------START OF THIRD-PARTY NOTICES------------------------------------------- -------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
===================================ExcelDataReader (BEGIN)
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2014 ExcelDataReader Copyright (c) 2014 ExcelDataReader
@@ -2466,4 +2439,4 @@ SOFTWARE.
-------------------------------END OF THIRD-PARTY NOTICES------------------------------------------- -------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
========================================= =========================================
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION

View File

@@ -1,13 +1,10 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '8.x' versionSpec: '10.15.1'
displayName: 'Install Node.js' displayName: 'Install Node.js'
- script: | - script: |
git submodule update --init --recursive
nvm install 8.9.1
nvm use 8.9.1
npm i -g yarn npm i -g yarn
displayName: 'preinstall' displayName: 'preinstall'
@@ -24,23 +21,46 @@ steps:
- script: | - script: |
yarn yarn
displayName: 'Install' displayName: 'Install'
- script: | - script: |
node_modules/.bin/gulp electron yarn gulp electron-x64
node_modules/.bin/gulp compile --max_old_space_size=4096 displayName: Download Electron
node_modules/.bin/gulp optimize-vscode --max_old_space_size=4096
displayName: 'Scripts' - script: |
yarn gulp hygiene
displayName: Run Hygiene Checks
- script: |
yarn tslint
displayName: 'Run TSLint'
- script: |
yarn strict-null-check
displayName: 'Run Strict Null Check'
- script: |
yarn compile
displayName: 'Compile'
- script: | - script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
displayName: 'Tests' displayName: 'Tests'
condition: eq(variables['Agent.OS'], 'Linux')
- script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter --coverage
displayName: 'Tests'
condition: ne(variables['Agent.OS'], 'Linux')
- task: PublishTestResults@2 - task: PublishTestResults@2
inputs: inputs:
testResultsFiles: '**/test-results.xml' testResultsFiles: '**/test-results.xml'
condition: succeededOrFailed() condition: succeededOrFailed()
- script: | - task: PublishCodeCoverageResults@1
yarn run tslint inputs:
displayName: 'Run TSLint' codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-reports
condition: ne(variables['Agent.OS'], 'Linux')

View File

@@ -1,7 +1,7 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '8.9' versionSpec: '10.15.1'
displayName: 'Install Node.js' displayName: 'Install Node.js'
- script: | - script: |
@@ -9,15 +9,27 @@ steps:
displayName: 'Yarn Install' displayName: 'Yarn Install'
- script: | - script: |
.\node_modules\.bin\gulp electron yarn gulp electron-x64
displayName: 'Electron' displayName: 'Electron'
- script: | - script: |
npm run compile yarn gulp hygiene
displayName: Run Hygiene Checks
- script: |
yarn tslint
displayName: 'Run TSLint'
- script: |
yarn strict-null-check
displayName: 'Run Strict Null Check'
- script: |
yarn compile
displayName: 'Compile' displayName: 'Compile'
- script: | - script: |
.\scripts\test.bat --reporter mocha-junit-reporter .\scripts\test.bat --reporter mocha-junit-reporter --coverage
displayName: 'Test' displayName: 'Test'
- task: PublishTestResults@2 - task: PublishTestResults@2
@@ -25,6 +37,8 @@ steps:
testResultsFiles: 'test-results.xml' testResultsFiles: 'test-results.xml'
condition: succeededOrFailed() condition: succeededOrFailed()
- script: | - task: PublishCodeCoverageResults@1
yarn run tslint inputs:
displayName: 'Run TSLint' codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)\.build\coverage\cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)\.build\coverage\lcov-report

126
build/.nativeignore Normal file
View File

@@ -0,0 +1,126 @@
# cleanup rules for native node modules, .gitignore style
fsevents/binding.gyp
fsevents/fsevents.cc
fsevents/build/**
fsevents/src/**
fsevents/test/**
!fsevents/**/*.node
vscode-sqlite3/binding.gyp
vscode-sqlite3/benchmark/**
vscode-sqlite3/cloudformation/**
vscode-sqlite3/deps/**
vscode-sqlite3/test/**
vscode-sqlite3/build/**
vscode-sqlite3/src/**
!vscode-sqlite3/build/Release/*.node
oniguruma/binding.gyp
oniguruma/build/**
oniguruma/src/**
oniguruma/deps/**
!oniguruma/build/Release/*.node
!oniguruma/src/*.js
windows-mutex/binding.gyp
windows-mutex/build/**
windows-mutex/src/**
!windows-mutex/**/*.node
native-keymap/binding.gyp
native-keymap/build/**
native-keymap/src/**
native-keymap/deps/**
!native-keymap/build/Release/*.node
native-is-elevated/binding.gyp
native-is-elevated/build/**
native-is-elevated/src/**
native-is-elevated/deps/**
!native-is-elevated/build/Release/*.node
native-watchdog/binding.gyp
native-watchdog/build/**
native-watchdog/src/**
!native-watchdog/build/Release/*.node
spdlog/binding.gyp
spdlog/build/**
spdlog/deps/**
spdlog/src/**
spdlog/test/**
!spdlog/build/Release/*.node
jschardet/dist/**
windows-foreground-love/binding.gyp
windows-foreground-love/build/**
windows-foreground-love/src/**
!windows-foreground-love/**/*.node
windows-process-tree/binding.gyp
windows-process-tree/build/**
windows-process-tree/src/**
!windows-process-tree/**/*.node
gc-signals/binding.gyp
gc-signals/build/**
gc-signals/src/**
gc-signals/deps/**
!gc-signals/build/Release/*.node
!gc-signals/src/index.js
keytar/binding.gyp
keytar/build/**
keytar/src/**
keytar/script/**
keytar/node_modules/**
!keytar/**/*.node
node-pty/binding.gyp
node-pty/build/**
node-pty/src/**
node-pty/tools/**
!node-pty/build/Release/*.exe
!node-pty/build/Release/*.dll
!node-pty/build/Release/*.node
chart.js/node_modules/**
emmet/node_modules/**
pty.js/build/**
!pty.js/build/Release/**
jquery-ui/external/**
jquery-ui/demos/**
core-js/**/**
slickgrid/node_modules/**
slickgrid/examples/**
vscode-nsfw/binding.gyp
vscode-nsfw/build/**
vscode-nsfw/src/**
vscode-nsfw/openpa/**
vscode-nsfw/includes/**
!vscode-nsfw/build/Release/*.node
!vscode-nsfw/**/*.a
vsda/binding.gyp
vsda/README.md
vsda/build/**
vsda/*.bat
vsda/*.sh
vsda/*.cpp
vsda/*.h
!vsda/build/Release/vsda.node
vscode-windows-ca-certs/**/*
!vscode-windows-ca-certs/package.json
!vscode-windows-ca-certs/**/*.node
node-addon-api/**/*

View File

@@ -3,10 +3,12 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import * as cp from 'child_process'; import * as cp from 'child_process';
import * as path from 'path';
function yarnInstall(packageName: string): void { function yarnInstall(packageName: string): void {
cp.execSync(`yarn add --no-lockfile ${packageName}`); cp.execSync(`yarn add --no-lockfile ${packageName}`);
cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd: path.join( process.cwd(), 'remote') });
} }
const product = require('../../../product.json'); const product = require('../../../product.json');

View File

@@ -6,7 +6,6 @@
'use strict'; 'use strict';
import * as fs from 'fs'; import * as fs from 'fs';
import { execSync } from 'child_process';
import { Readable } from 'stream'; import { Readable } from 'stream';
import * as crypto from 'crypto'; import * as crypto from 'crypto';
import * as azure from 'azure-storage'; import * as azure from 'azure-storage';
@@ -66,8 +65,7 @@ interface Asset {
platform: string; platform: string;
type: string; type: string;
url: string; url: string;
// {{SQL CARBON EDIT}} mooncakeUrl?: string;
mooncakeUrl: string | undefined;
hash: string; hash: string;
sha256hash: string; sha256hash: string;
size: number; size: number;
@@ -154,9 +152,13 @@ async function publish(commit: string, quality: string, platform: string, type:
const queuedBy = process.env['BUILD_QUEUEDBY']!; const queuedBy = process.env['BUILD_QUEUEDBY']!;
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!; const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
const isReleased = quality === 'insider' const isReleased = (
&& /^master$|^refs\/heads\/master$/.test(sourceBranch) // Insiders: nightly build from master
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy); (quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
// Exploration: any build from electron-4.0.x branch
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
);
console.log('Publishing...'); console.log('Publishing...');
console.log('Quality:', quality); console.log('Quality:', quality);
@@ -186,56 +188,18 @@ async function publish(commit: string, quality: string, platform: string, type:
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!) const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
.withFilter(new azure.ExponentialRetryPolicyFilter(20)); .withFilter(new azure.ExponentialRetryPolicyFilter(20));
// {{SQL CARBON EDIT}}
await assertContainer(blobService, quality); await assertContainer(blobService, quality);
const blobExists = await doesAssetExist(blobService, quality, blobName); const blobExists = await doesAssetExist(blobService, quality, blobName);
const promises = []; if (blobExists) {
if (!blobExists) {
promises.push(uploadBlob(blobService, quality, blobName, file));
}
// {{SQL CARBON EDIT}}
if (process.env['MOONCAKE_STORAGE_ACCESS_KEY']) {
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
// mooncake is fussy and far away, this is needed!
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
await Promise.all([
assertContainer(blobService, quality),
assertContainer(mooncakeBlobService, quality)
]);
const [blobExists, moooncakeBlobExists] = await Promise.all([
doesAssetExist(blobService, quality, blobName),
doesAssetExist(mooncakeBlobService, quality, blobName)
]);
const promises: Array<Promise<void>> = [];
if (!blobExists) {
promises.push(uploadBlob(blobService, quality, blobName, file));
}
if (!moooncakeBlobExists) {
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
}
} else {
console.log('Skipping Mooncake publishing.');
}
if (promises.length === 0) {
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`); console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
return; return;
} }
console.log('Uploading blobs to Azure storage...'); console.log('Uploading blobs to Azure storage...');
await Promise.all(promises); await uploadBlob(blobService, quality, blobName, file);
console.log('Blobs successfully uploaded.'); console.log('Blobs successfully uploaded.');
@@ -247,8 +211,6 @@ async function publish(commit: string, quality: string, platform: string, type:
platform: platform, platform: platform,
type: type, type: type,
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`, url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
// {{SQL CARBON EDIT}}
mooncakeUrl: process.env['MOONCAKE_CDN_URL'] ? `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}` : undefined,
hash: sha1hash, hash: sha1hash,
sha256hash, sha256hash,
size size
@@ -289,15 +251,18 @@ function main(): void {
return; return;
} }
const commit = process.env['BUILD_SOURCEVERSION'];
if (!commit) {
console.warn('Skipping publish due to missing BUILD_SOURCEVERSION');
return;
}
const opts = minimist<PublishOptions>(process.argv.slice(2), { const opts = minimist<PublishOptions>(process.argv.slice(2), {
boolean: ['upload-only'] boolean: ['upload-only']
}); });
// {{SQL CARBON EDIT}} const [quality, platform, type, name, version, _isUpdate, file] = opts._;
let [quality, platform, type, name, version, _isUpdate, file, commit] = opts._;
if (!commit) {
commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
}
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => { publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
console.error(err); console.error(err);

View File

@@ -0,0 +1,176 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as url from 'url';
import * as azure from 'azure-storage';
import * as mime from 'mime';
import { DocumentClient, RetrievedDocument } from 'documentdb';
function log(...args: any[]) {
console.log(...[`[${new Date().toISOString()}]`, ...args]);
}
function error(...args: any[]) {
console.error(...[`[${new Date().toISOString()}]`, ...args]);
}
if (process.argv.length < 3) {
error('Usage: node sync-mooncake.js <quality>');
process.exit(-1);
}
interface Build extends RetrievedDocument {
assets: Asset[];
}
interface Asset {
platform: string;
type: string;
url: string;
mooncakeUrl: string;
hash: string;
sha256hash: string;
size: number;
supportsFastUpdate?: boolean;
}
function updateBuild(commit: string, quality: string, platform: string, type: string, asset: Asset): Promise<void> {
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
const collection = 'dbs/builds/colls/' + quality;
const updateQuery = {
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
parameters: [{ name: '@id', value: commit }]
};
let updateTries = 0;
function _update(): Promise<void> {
updateTries++;
return new Promise<void>((c, e) => {
client.queryDocuments(collection, updateQuery).toArray((err, results) => {
if (err) { return e(err); }
if (results.length !== 1) { return e(new Error('No documents')); }
const release = results[0];
release.assets = [
...release.assets.filter((a: any) => !(a.platform === platform && a.type === type)),
asset
];
client.replaceDocument(release._self, release, err => {
if (err && err.code === 409 && updateTries < 5) { return c(_update()); }
if (err) { return e(err); }
log('Build successfully updated.');
c();
});
});
});
}
return _update();
}
async function sync(commit: string, quality: string): Promise<void> {
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
const cosmosdb = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
const collection = `dbs/builds/colls/${quality}`;
const query = {
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
parameters: [{ name: '@id', value: commit }]
};
const build = await new Promise<Build>((c, e) => {
cosmosdb.queryDocuments(collection, query).toArray((err, results) => {
if (err) { return e(err); }
if (results.length !== 1) { return e(new Error('No documents')); }
c(results[0] as Build);
});
});
log(`Found build for ${commit}, with ${build.assets.length} assets`);
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
// mooncake is fussy and far away, this is needed!
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
for (const asset of build.assets) {
try {
const blobPath = url.parse(asset.url).path;
if (!blobPath) {
throw new Error(`Failed to parse URL: ${asset.url}`);
}
const blobName = blobPath.replace(/^\/\w+\//, '');
log(`Found ${blobName}`);
if (asset.mooncakeUrl) {
log(` Already in Mooncake ✔️`);
continue;
}
const readStream = blobService.createReadStream(quality, blobName, undefined!);
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
contentSettings: {
contentType: mime.lookup(blobPath),
cacheControl: 'max-age=31536000, public'
}
};
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
log(` Uploading to Mooncake...`);
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
log(` Updating build in DB...`);
asset.mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
await updateBuild(commit, quality, asset.platform, asset.type, asset);
log(` Done ✔️`);
} catch (err) {
error(err);
}
}
log(`All done ✔️`);
}
function main(): void {
if (process.env['VSCODE_BUILD_SKIP_PUBLISH']) {
error('Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH');
return;
}
const commit = process.env['BUILD_SOURCEVERSION'];
if (!commit) {
error('Skipping publish due to missing BUILD_SOURCEVERSION');
return;
}
const quality = process.argv[2];
sync(commit, quality).catch(err => {
error(err);
process.exit(1);
});
}
main();

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
yarn gulp vscode-darwin-min
yarn gulp vscode-reh-darwin-min
yarn gulp upload-vscode-sourcemaps

View File

@@ -1,13 +1,26 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
- script: | - script: |
yarn yarn
displayName: Install Dependencies displayName: Install Dependencies
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
- script: | - script: |
yarn gulp electron-x64 yarn gulp electron-x64
displayName: Download Electron displayName: Download Electron
@@ -17,9 +30,6 @@ steps:
- script: | - script: |
yarn monaco-compile-check yarn monaco-compile-check
displayName: Run Monaco Editor Checks displayName: Run Monaco Editor Checks
- script: |
yarn strict-null-check
displayName: Run Strict Null Checks
- script: | - script: |
yarn compile yarn compile
displayName: Compile Sources displayName: Compile Sources
@@ -37,4 +47,4 @@ steps:
inputs: inputs:
testResultsFiles: '*-results.xml' testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results' searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed() condition: succeededOrFailed()

View File

@@ -1,29 +1,48 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- script: | - script: |
set -e set -e
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
cat << EOF > ~/.netrc
machine monacotools.visualstudio.com
password $(devops-pat)
machine github.com
login vscode
password $(github-distro-mixin-password)
EOF
git config user.email "vscode@microsoft.com"
git config user.name "VSCode"
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
git fetch distro
git merge $(node -p "require('./package.json').distro")
yarn yarn
yarn gulp -- hygiene yarn gulp mixin
yarn gulp hygiene
yarn monaco-compile-check yarn monaco-compile-check
yarn strict-null-check
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
node build/azure-pipelines/common/installDistro.js node build/azure-pipelines/common/installDistro.js
node build/lib/builtInExtensions.js node build/lib/builtInExtensions.js
displayName: Prepare build displayName: Prepare build
- script: | - script: |
set -e set -e
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \ VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \ AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps ./build/azure-pipelines/darwin/build.sh
displayName: Build displayName: Build
- script: | - script: |
@@ -33,6 +52,11 @@ steps:
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME" # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
displayName: Run unit tests displayName: Run unit tests
- script: |
set -e
./scripts/test-integration.sh --build --tfs "Integration Tests"
displayName: Run integration tests
- script: | - script: |
set -e set -e
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
@@ -59,31 +83,12 @@ steps:
- script: | - script: |
set -e set -e
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
# remove pkg from archive AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
zip -d ../VSCode-darwin.zip "*.pkg" AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
# publish the build VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json` ./build/azure-pipelines/darwin/publish.sh
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
node build/azure-pipelines/common/publish.js \
"$(VSCODE_QUALITY)" \
darwin \
archive \
"VSCode-darwin-$(VSCODE_QUALITY).zip" \
$VERSION \
true \
../VSCode-darwin.zip
# publish hockeyapp symbols
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
# upload configuration
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
yarn gulp -- upload-vscode-configuration
displayName: Publish displayName: Publish
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
# remove pkg from archive
zip -d ../VSCode-darwin.zip "*.pkg"
# publish the build
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
node build/azure-pipelines/common/publish.js \
"$VSCODE_QUALITY" \
darwin \
archive \
"VSCode-darwin-$VSCODE_QUALITY.zip" \
$VERSION \
true \
../VSCode-darwin.zip
# package Remote Extension Host
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
# publish Remote Extension Host
node build/azure-pipelines/common/publish.js \
"$VSCODE_QUALITY" \
server-darwin \
archive-unsigned \
"vscode-server-darwin.zip" \
$VERSION \
true \
../vscode-server-darwin.zip
# publish hockeyapp symbols
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_MACOS"
# upload configuration
yarn gulp upload-vscode-configuration

View File

@@ -0,0 +1,36 @@
trigger:
branches:
include: ['master', 'release/*']
pr:
branches:
include: ['master', 'release/*']
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- script: |
set -e
cat << EOF > ~/.netrc
machine github.com
login vscode
password $(github-distro-mixin-password)
EOF
git config user.email "vscode@microsoft.com"
git config user.name "VSCode"
git remote add distro "https://github.com/$VSCODE_MIXIN_REPO.git"
git fetch distro
git push distro origin/master:refs/heads/master
git merge $(node -p "require('./package.json').distro")
displayName: Sync & Merge Distro

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
yarn gulp "vscode-linux-$VSCODE_ARCH-min"
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
yarn gulp vscode-reh-linux-$VSCODE_ARCH-min
fi

View File

@@ -2,20 +2,33 @@ steps:
- script: | - script: |
set -e set -e
sudo apt-get update sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 libgconf-2-4 dbus xvfb libgtk-3-0 sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults sudo update-rc.d xvfb defaults
sudo service xvfb start sudo service xvfb start
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
- script: | - script: |
yarn yarn
displayName: Install Dependencies displayName: Install Dependencies
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
- script: | - script: |
yarn gulp electron-x64 yarn gulp electron-x64
displayName: Download Electron displayName: Download Electron
@@ -25,9 +38,6 @@ steps:
- script: | - script: |
yarn monaco-compile-check yarn monaco-compile-check
displayName: Run Monaco Editor Checks displayName: Run Monaco Editor Checks
- script: |
yarn strict-null-check
displayName: Run Strict Null Checks
- script: | - script: |
yarn compile yarn compile
displayName: Compile Sources displayName: Compile Sources
@@ -42,4 +52,4 @@ steps:
inputs: inputs:
testResultsFiles: '*-results.xml' testResultsFiles: '*-results.xml'
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results' searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
condition: succeededOrFailed() condition: succeededOrFailed()

View File

@@ -1,12 +1,18 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- script: | - script: |
set -e set -e
export npm_config_arch="$(VSCODE_ARCH)" export npm_config_arch="$(VSCODE_ARCH)"
@@ -14,92 +20,53 @@ steps:
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig" export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
fi fi
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc cat << EOF > ~/.netrc
machine monacotools.visualstudio.com
password $(devops-pat)
machine github.com
login vscode
password $(github-distro-mixin-password)
EOF
git config user.email "vscode@microsoft.com"
git config user.name "VSCode"
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
git fetch distro
git merge $(node -p "require('./package.json').distro")
CHILD_CONCURRENCY=1 yarn CHILD_CONCURRENCY=1 yarn
npm run gulp -- hygiene yarn gulp mixin
npm run monaco-compile-check yarn gulp hygiene
npm run strict-null-check yarn monaco-compile-check
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
node build/azure-pipelines/common/installDistro.js node build/azure-pipelines/common/installDistro.js
node build/lib/builtInExtensions.js node build/lib/builtInExtensions.js
displayName: Prepare build
- script: | - script: |
set -e set -e
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
name: build ./build/azure-pipelines/linux/build.sh
displayName: Build
- script: | - script: |
set -e set -e
npm run gulp -- "electron-$(VSCODE_ARCH)" yarn gulp "electron-$(VSCODE_ARCH)"
# xvfb seems to be crashing often, let's make sure it's always up # xvfb seems to be crashing often, let's make sure it's always up
service xvfb start service xvfb start
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests" DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)" # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
name: test displayName: Run unit tests
- script: | - script: |
set -e set -e
REPO="$(pwd)" AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
ROOT="$REPO/.." AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
ARCH="$(VSCODE_ARCH)" VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
# Publish tarball ./build/azure-pipelines/linux/publish.sh
PLATFORM_LINUX="linux-$(VSCODE_ARCH)" displayName: Publish
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
BUILDNAME="VSCode-$PLATFORM_LINUX"
BUILD="$ROOT/$BUILDNAME"
BUILD_VERSION="$(date +%s)"
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
PACKAGEJSON="$BUILD/resources/app/package.json"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
rm -rf $ROOT/code-*.tar.*
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
# Publish hockeyapp symbols
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX64)"
# Publish DEB
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
PLATFORM_DEB="linux-deb-$ARCH"
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
# Publish RPM
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
PLATFORM_RPM="linux-rpm-$ARCH"
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
# Publish Snap
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-prepare-snap"
# Pack snap tarball artifact, in order to preserve file perms
mkdir -p $REPO/.build/linux/snap-tarball
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$(VSCODE_ARCH).tar.gz"
rm -rf $SNAP_TARBALL_PATH
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection' displayName: 'Component Detection'

View File

@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set -e
REPO="$(pwd)"
ROOT="$REPO/.."
# Publish tarball
PLATFORM_LINUX="linux-$VSCODE_ARCH"
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
BUILDNAME="VSCode-$PLATFORM_LINUX"
BUILD="$ROOT/$BUILDNAME"
BUILD_VERSION="$(date +%s)"
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
PACKAGEJSON="$BUILD/resources/app/package.json"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
rm -rf $ROOT/code-*.tar.*
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
# Publish Remote Extension Host
if [[ "$VSCODE_ARCH" != "ia32" ]]; then
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
rm -rf $ROOT/vscode-server-*.tar.*
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$VERSION" true "$SERVER_TARBALL_PATH"
fi
# Publish hockeyapp symbols
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "$VSCODE_ARCH" "$VSCODE_HOCKEYAPP_ID_LINUX64"
# Publish DEB
yarn gulp "vscode-linux-$VSCODE_ARCH-build-deb"
PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
# Publish RPM
yarn gulp "vscode-linux-$VSCODE_ARCH-build-rpm"
PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
# Publish Snap
yarn gulp "vscode-linux-$VSCODE_ARCH-prepare-snap"
# Pack snap tarball artifact, in order to preserve file perms
mkdir -p $REPO/.build/linux/snap-tarball
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$VSCODE_ARCH.tar.gz"
rm -rf $SNAP_TARBALL_PATH
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)

View File

@@ -1,12 +1,18 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- task: DownloadPipelineArtifact@0 - task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact' displayName: 'Download Pipeline Artifact'
inputs: inputs:
@@ -16,6 +22,14 @@ steps:
- script: | - script: |
set -e set -e
# Get snapcraft version
snapcraft --version
# Make sure we get latest packages
sudo apt-get update
sudo apt-get upgrade -y
# Define variables
REPO="$(pwd)" REPO="$(pwd)"
ARCH="$(VSCODE_ARCH)" ARCH="$(VSCODE_ARCH)"
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH" SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
@@ -33,10 +47,9 @@ steps:
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)" PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version") VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME" SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
(cd $SNAP_ROOT/code-* && snapcraft snap --output "$SNAP_PATH") (cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
# Publish snap package # Publish snap package
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \ AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \ AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH" node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"

View File

@@ -1,9 +1,11 @@
resources: resources:
containers: containers:
- container: vscode-x64 - container: vscode-x64
image: joaomoreno/vscode-linux-build-agent:x64 endpoint: VSCodeHub
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
- container: vscode-ia32 - container: vscode-ia32
image: joaomoreno/vscode-linux-build-agent:ia32 endpoint: VSCodeHub
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
- container: snapcraft - container: snapcraft
image: snapcore/snapcraft image: snapcore/snapcraft
@@ -62,4 +64,18 @@ jobs:
pool: pool:
vmImage: macOS 10.13 vmImage: macOS 10.13
steps: steps:
- template: darwin/product-build-darwin.yml - template: darwin/product-build-darwin.yml
- job: Mooncake
pool:
vmImage: 'Ubuntu-16.04'
condition: true
dependsOn:
- Windows
- Windows32
- Linux
- LinuxSnap
- Linux32
- macOS
steps:
- template: sync-mooncake.yml

View File

@@ -0,0 +1,2 @@
node_modules/
*.js

View File

@@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const cp = require("child_process");
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
if (!isValidTag(tag)) {
throw Error(`Invalid tag ${tag}`);
}
}
catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function isValidTag(t) {
if (t.split('.').length !== 3) {
return false;
}
const [major, minor, bug] = t.split('.');
// Only release for tags like 1.34.0
if (bug !== '0') {
return false;
}
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
return false;
}
return true;
}

View File

@@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as cp from 'child_process';
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
if (!isValidTag(tag)) {
throw Error(`Invalid tag ${tag}`);
}
} catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function isValidTag(t: string) {
if (t.split('.').length !== 3) {
return false;
}
const [major, minor, bug] = t.split('.');
// Only release for tags like 1.34.0
if (bug !== '0') {
return false;
}
if (parseInt(major, 10) === NaN || parseInt(minor, 10) === NaN) {
return false;
}
return true;
}

View File

@@ -0,0 +1,67 @@
# Publish @types/vscode for each release
trigger:
branches:
include: ['refs/tags/*']
pr: none
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
- bash: |
# Install build dependencies
(cd build && yarn)
node build/azure-pipelines/publish-types/check-version.js
displayName: Check version
- bash: |
git config --global user.email "vscode@microsoft.com"
git config --global user.name "VSCode"
git clone https://$(GITHUB_TOKEN)@github.com/DefinitelyTyped/DefinitelyTyped.git --depth=1
node build/azure-pipelines/publish-types/update-types.js
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
cd DefinitelyTyped
git diff --color | cat
git add -A
git status
git checkout -b "vscode-types-$TAG_VERSION"
git commit -m "VS Code $TAG_VERSION Extension API"
git push origin "vscode-types-$TAG_VERSION"
displayName: Push update to DefinitelyTyped
- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
CHANNEL="G1C14HJ2F"
MESSAGE="DefinitelyTyped/DefinitelyTyped#vscode-types-$TAG_VERSION created. Endgame master, please open this link, examine changes and create a PR:"
LINK="https://github.com/DefinitelyTyped/DefinitelyTyped/compare/vscode-types-$TAG_VERSION?quick_pull=1&body=Updating%20VS%20Code%20Extension%20API.%20See%20https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F70175%20for%20details."
MESSAGE2="[@octref, @jrieken, @kmaetzel, @egamma]. Please review and merge PR to publish @types/vscode."
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
https://slack.com/api/chat.postMessage
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$LINK"'"}' \
https://slack.com/api/chat.postMessage
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE2"'"}' \
https://slack.com/api/chat.postMessage
displayName: Send message on Slack

View File

@@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const cp = require("child_process");
const path = require("path");
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
updateDTSFile(outPath, tag);
console.log(`Done updating vscode.d.ts at ${outPath}`);
}
catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function updateDTSFile(outPath, tag) {
const oldContent = fs.readFileSync(outPath, 'utf-8');
const newContent = getNewFileContent(oldContent, tag);
fs.writeFileSync(outPath, newContent);
}
function getNewFileContent(content, tag) {
const oldheader = [
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
` *--------------------------------------------------------------------------------------------*/`
].join('\n');
return getNewFileHeader(tag) + content.slice(oldheader.length);
}
function getNewFileHeader(tag) {
const [major, minor] = tag.split('.');
const shorttag = `${major}.${minor}`;
const header = [
`// Type definitions for Visual Studio Code ${shorttag}`,
`// Project: https://github.com/microsoft/vscode`,
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
``,
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA.`,
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
` *--------------------------------------------------------------------------------------------*/`,
``,
`/**`,
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
` * See https://code.visualstudio.com/api for more information`,
` */`
].join('\n');
return header;
}

View File

@@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as fs from 'fs';
import * as cp from 'child_process';
import * as path from 'path';
let tag = '';
try {
tag = cp
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
updateDTSFile(outPath, tag);
console.log(`Done updating vscode.d.ts at ${outPath}`);
} catch (err) {
console.error(err);
console.error('Failed to update types');
process.exit(1);
}
function updateDTSFile(outPath: string, tag: string) {
const oldContent = fs.readFileSync(outPath, 'utf-8');
const newContent = getNewFileContent(oldContent, tag);
fs.writeFileSync(outPath, newContent);
}
function getNewFileContent(content: string, tag: string) {
const oldheader = [
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA. See License.txt in the project root for license information.`,
` *--------------------------------------------------------------------------------------------*/`
].join('\n');
return getNewFileHeader(tag) + content.slice(oldheader.length);
}
function getNewFileHeader(tag: string) {
const [major, minor] = tag.split('.');
const shorttag = `${major}.${minor}`;
const header = [
`// Type definitions for Visual Studio Code ${shorttag}`,
`// Project: https://github.com/microsoft/vscode`,
`// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>`,
`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`,
``,
`/*---------------------------------------------------------------------------------------------`,
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
` * Licensed under the Source EULA.`,
` * See https://github.com/Microsoft/vscode/blob/master/LICENSE.txt for license information.`,
` *--------------------------------------------------------------------------------------------*/`,
``,
`/**`,
` * Type Definition for Visual Studio Code ${shorttag} Extension API`,
` * See https://code.visualstudio.com/api for more information`,
` */`
].join('\n');
return header;
}

View File

@@ -0,0 +1,24 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- script: |
set -e
(cd build ; yarn)
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"

View File

@@ -0,0 +1,5 @@
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-min" }
exec { yarn gulp "vscode-reh-win32-$env:VSCODE_ARCH-min" }
exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-inno-updater" }

View File

@@ -1,7 +1,7 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
versionSpec: "1.10.1" versionSpec: "1.10.1"
@@ -9,9 +9,22 @@ steps:
inputs: inputs:
versionSpec: '2.x' versionSpec: '2.x'
addToPath: true addToPath: true
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
- powershell: | - powershell: |
yarn yarn
displayName: Install Dependencies displayName: Install Dependencies
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
# inputs:
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
# vstsFeed: '$(ArtifactFeed)'
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
- powershell: | - powershell: |
yarn gulp electron yarn gulp electron
displayName: Download Electron displayName: Download Electron
@@ -21,9 +34,6 @@ steps:
- powershell: | - powershell: |
yarn monaco-compile-check yarn monaco-compile-check
displayName: Run Monaco Editor Checks displayName: Run Monaco Editor Checks
- script: |
yarn strict-null-check
displayName: Run Strict Null Checks
- powershell: | - powershell: |
yarn compile yarn compile
displayName: Compile Sources displayName: Compile Sources

View File

@@ -1,7 +1,7 @@
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "8.12.0" versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs: inputs:
@@ -12,41 +12,59 @@ steps:
versionSpec: '2.x' versionSpec: '2.x'
addToPath: true addToPath: true
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
"machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII "machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
$env:npm_config_arch="$(VSCODE_ARCH)" $env:npm_config_arch="$(VSCODE_ARCH)"
$env:CHILD_CONCURRENCY="1" $env:CHILD_CONCURRENCY="1"
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
exec { git config user.email "vscode@microsoft.com" }
exec { git config user.name "VSCode" }
exec { git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git" }
exec { git fetch distro }
exec { git merge $(node -p "require('./package.json').distro") }
exec { yarn } exec { yarn }
exec { npm run gulp -- hygiene } exec { yarn gulp mixin }
exec { npm run monaco-compile-check } exec { yarn gulp hygiene }
exec { npm run strict-null-check } exec { yarn monaco-compile-check }
exec { npm run gulp -- mixin }
exec { node build/azure-pipelines/common/installDistro.js } exec { node build/azure-pipelines/common/installDistro.js }
exec { node build/lib/builtInExtensions.js } exec { node build/lib/builtInExtensions.js }
displayName: Prepare build
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" } .\build\azure-pipelines\win32\build.ps1
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" } displayName: Build
name: build
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
exec { npm run gulp -- "electron-$(VSCODE_ARCH)" } exec { yarn gulp "electron-$(VSCODE_ARCH)" }
exec { .\scripts\test.bat --build --tfs "Unit Tests" } exec { .\scripts\test.bat --build --tfs "Unit Tests" }
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" # yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
name: test displayName: Run unit tests
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
displayName: Run integration tests
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
inputs: inputs:
ConnectedServiceName: 'ESRP CodeSign' ConnectedServiceName: 'ESRP CodeSign'
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)' FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
Pattern: '*.dll,*.exe,*.node' Pattern: '*.dll,*.exe,*.node'
signConfigType: inlineSignParams signConfigType: inlineSignParams
inlineOperation: | inlineOperation: |
@@ -114,38 +132,17 @@ steps:
- powershell: | - powershell: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY) .\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
displayName: Import ESRP Auth Certificate displayName: Import ESRP Auth Certificate
- powershell: | - powershell: |
. build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign } $env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
$Repo = "$(pwd)" $env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
$Root = "$Repo\.." .\build\azure-pipelines\win32\publish.ps1
$SystemExe = "$Repo\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe" displayName: Publish
$UserExe = "$Repo\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe"
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
$Build = "$Root\VSCode-win32-$(VSCODE_ARCH)"
# get version
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
$Version = $PackageJson.version
$Quality = "$env:VSCODE_QUALITY"
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
# publish hockeyapp symbols
$hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
exec { node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId }
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection' displayName: 'Component Detection'

View File

@@ -0,0 +1,37 @@
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
$Arch = "$env:VSCODE_ARCH"
exec { yarn gulp "vscode-win32-$Arch-archive" "vscode-win32-$Arch-system-setup" "vscode-win32-$Arch-user-setup" --sign }
$Repo = "$(pwd)"
$Root = "$Repo\.."
$SystemExe = "$Repo\.build\win32-$Arch\system-setup\VSCodeSetup.exe"
$UserExe = "$Repo\.build\win32-$Arch\user-setup\VSCodeSetup.exe"
$Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
$LegacyServer = "$Root\vscode-reh-win32-$Arch"
$ServerName = "vscode-server-win32-$Arch"
$Server = "$Root\$ServerName"
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
$Build = "$Root\VSCode-win32-$Arch"
# Create server archive
exec { Rename-Item -Path $LegacyServer -NewName $ServerName }
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
# get version
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
$Version = $PackageJson.version
$Quality = "$env:VSCODE_QUALITY"
$AssetPlatform = if ("$Arch" -eq "ia32") { "win32" } else { "win32-x64" }
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-archive" archive "VSCode-win32-$Arch-$Version.zip" $Version true $Zip }
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform" setup "VSCodeSetup-$Arch-$Version.exe" $Version true $SystemExe }
exec { node build/azure-pipelines/common/publish.js $Quality "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $Version true $UserExe }
exec { node build/azure-pipelines/common/publish.js $Quality "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $Version true $ServerZip }
# publish hockeyapp symbols
$hockeyAppId = if ("$Arch" -eq "ia32") { "$env:VSCODE_HOCKEYAPP_ID_WIN32" } else { "$env:VSCODE_HOCKEYAPP_ID_WIN64" }
exec { node build/azure-pipelines/common/symbols.js "$env:VSCODE_MIXIN_PASSWORD" "$env:VSCODE_HOCKEYAPP_TOKEN" "$Arch" $hockeyAppId }

View File

@@ -0,0 +1,91 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const https = require("https");
const fs = require("fs");
const path = require("path");
const cp = require("child_process");
function ensureDir(filepath) {
if (!fs.existsSync(filepath)) {
ensureDir(path.dirname(filepath));
fs.mkdirSync(filepath);
}
}
function download(options, destination) {
ensureDir(path.dirname(destination));
return new Promise((c, e) => {
const fd = fs.openSync(destination, 'w');
const req = https.get(options, (res) => {
res.on('data', (chunk) => {
fs.writeSync(fd, chunk);
});
res.on('end', () => {
fs.closeSync(fd);
c();
});
});
req.on('error', (reqErr) => {
console.error(`request to ${options.host}${options.path} failed.`);
console.error(reqErr);
e(reqErr);
});
});
}
const MARKER_ARGUMENT = `_download_fork_`;
function base64encode(str) {
return Buffer.from(str, 'utf8').toString('base64');
}
function base64decode(str) {
return Buffer.from(str, 'base64').toString('utf8');
}
function downloadInExternalProcess(options) {
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
console.log(`Downloading ${url}...`);
return new Promise((c, e) => {
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
});
let stderr = [];
child.stderr.on('data', (chunk) => {
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
});
child.on('exit', (code) => {
if (code === 0) {
// normal termination
console.log(`Finished downloading ${url}.`);
c();
}
else {
// abnormal termination
console.error(Buffer.concat(stderr).toString());
e(new Error(`Download of ${url} failed.`));
}
});
});
}
exports.downloadInExternalProcess = downloadInExternalProcess;
function _downloadInExternalProcess() {
let options;
try {
options = JSON.parse(base64decode(process.argv[3]));
}
catch (err) {
console.error(`Cannot read arguments`);
console.error(err);
process.exit(-1);
return;
}
download(options.requestOptions, options.destinationPath).then(() => {
process.exit(0);
}, (err) => {
console.error(err);
process.exit(-2);
});
}
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
// running as forked download script
_downloadInExternalProcess();
}

111
build/download/download.ts Normal file
View File

@@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as https from 'https';
import * as fs from 'fs';
import * as path from 'path';
import * as cp from 'child_process';
function ensureDir(filepath: string) {
if (!fs.existsSync(filepath)) {
ensureDir(path.dirname(filepath));
fs.mkdirSync(filepath);
}
}
function download(options: https.RequestOptions, destination: string): Promise<void> {
ensureDir(path.dirname(destination));
return new Promise<void>((c, e) => {
const fd = fs.openSync(destination, 'w');
const req = https.get(options, (res) => {
res.on('data', (chunk) => {
fs.writeSync(fd, chunk);
});
res.on('end', () => {
fs.closeSync(fd);
c();
});
});
req.on('error', (reqErr) => {
console.error(`request to ${options.host}${options.path} failed.`);
console.error(reqErr);
e(reqErr);
});
});
}
const MARKER_ARGUMENT = `_download_fork_`;
function base64encode(str: string): string {
return Buffer.from(str, 'utf8').toString('base64');
}
function base64decode(str: string): string {
return Buffer.from(str, 'base64').toString('utf8');
}
export interface IDownloadRequestOptions {
host: string;
path: string;
}
export interface IDownloadOptions {
requestOptions: IDownloadRequestOptions;
destinationPath: string;
}
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
console.log(`Downloading ${url}...`);
return new Promise<void>((c, e) => {
const child = cp.fork(
__filename,
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
{
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
}
);
let stderr: Buffer[] = [];
child.stderr.on('data', (chunk) => {
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
});
child.on('exit', (code) => {
if (code === 0) {
// normal termination
console.log(`Finished downloading ${url}.`);
c();
} else {
// abnormal termination
console.error(Buffer.concat(stderr).toString());
e(new Error(`Download of ${url} failed.`));
}
});
});
}
function _downloadInExternalProcess() {
let options: IDownloadOptions;
try {
options = JSON.parse(base64decode(process.argv[3]));
} catch (err) {
console.error(`Cannot read arguments`);
console.error(err);
process.exit(-1);
return;
}
download(options.requestOptions, options.destinationPath).then(() => {
process.exit(0);
}, (err) => {
console.error(err);
process.exit(-2);
});
}
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
// running as forked download script
_downloadInExternalProcess();
}

18
build/gulpfile.compile.js Normal file
View File

@@ -0,0 +1,18 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const util = require('./lib/util');
const task = require('./lib/task');
const compilation = require('./lib/compilation');
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
// Full compile, including nls and inline sources in sourcemaps, for build
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
// All Build
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
exports.compileBuildTask = compileBuildTask;

View File

@@ -6,6 +6,7 @@
const gulp = require('gulp'); const gulp = require('gulp');
const path = require('path'); const path = require('path');
const util = require('./lib/util'); const util = require('./lib/util');
const task = require('./lib/task');
const common = require('./lib/optimize'); const common = require('./lib/optimize');
const es = require('event-stream'); const es = require('event-stream');
const File = require('vinyl'); const File = require('vinyl');
@@ -48,9 +49,6 @@ var editorResources = [
'!**/test/**' '!**/test/**'
]; ];
var editorOtherSources = [
];
var BUNDLED_FILE_HEADER = [ var BUNDLED_FILE_HEADER = [
'/*!-----------------------------------------------------------', '/*!-----------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.', ' * Copyright (c) Microsoft Corporation. All rights reserved.',
@@ -63,8 +61,7 @@ var BUNDLED_FILE_HEADER = [
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []); const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
gulp.task('clean-editor-src', util.rimraf('out-editor-src')); const extractEditorSrcTask = task.define('extract-editor-src', () => {
gulp.task('extract-editor-src', ['clean-editor-src'], function () {
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`); console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
const apiusages = monacoapi.execute().usageContent; const apiusages = monacoapi.execute().usageContent;
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString(); const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
@@ -84,6 +81,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
'typings/thenable.d.ts', 'typings/thenable.d.ts',
'typings/es6-promise.d.ts', 'typings/es6-promise.d.ts',
'typings/require-monaco.d.ts', 'typings/require-monaco.d.ts',
"typings/lib.es2018.promise.d.ts",
'vs/monaco.d.ts' 'vs/monaco.d.ts'
], ],
libs: [ libs: [
@@ -95,20 +93,16 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock', 'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
}, },
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /^vs\/css!/, importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
destRoot: path.join(root, 'out-editor-src') destRoot: path.join(root, 'out-editor-src')
}); });
}); });
// Full compile, including nls and inline sources in sourcemaps, for build const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
gulp.task('clean-editor-build', util.rimraf('out-editor-build'));
gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true));
gulp.task('clean-optimized-editor', util.rimraf('out-editor')); const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({
src: 'out-editor-build', src: 'out-editor-build',
entryPoints: editorEntryPoints, entryPoints: editorEntryPoints,
otherSources: editorOtherSources,
resources: editorResources, resources: editorResources,
loaderConfig: { loaderConfig: {
paths: { paths: {
@@ -125,11 +119,9 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'],
languages: languages languages: languages
})); }));
gulp.task('clean-minified-editor', util.rimraf('out-editor-min')); const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm')); const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () {
standalone.createESMSourcesAndResources2({ standalone.createESMSourcesAndResources2({
srcFolder: './out-editor-src', srcFolder: './out-editor-src',
outFolder: './out-editor-esm', outFolder: './out-editor-esm',
@@ -151,7 +143,8 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
} }
}); });
}); });
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
const compileEditorESMTask = task.define('compile-editor-esm', () => {
if (process.platform === 'win32') { if (process.platform === 'win32') {
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, { const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
cwd: path.join(__dirname, '../out-editor-esm') cwd: path.join(__dirname, '../out-editor-esm')
@@ -202,8 +195,16 @@ function toExternalDTS(contents) {
return lines.join('\n'); return lines.join('\n');
} }
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core')); function filterStream(testFunc) {
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () { return es.through(function (data) {
if (!testFunc(data.relative)) {
return;
}
this.emit('data', data);
});
}
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
return es.merge( return es.merge(
// other assets // other assets
es.merge( es.merge(
@@ -233,6 +234,14 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
})) }))
.pipe(gulp.dest('out-monaco-editor-core')), .pipe(gulp.dest('out-monaco-editor-core')),
// version.txt
gulp.src('build/monaco/version.txt')
.pipe(es.through(function (data) {
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
this.emit('data', data);
}))
.pipe(gulp.dest('out-monaco-editor-core')),
// README.md // README.md
gulp.src('build/monaco/README-npm.md') gulp.src('build/monaco/README-npm.md')
.pipe(es.through(function (data) { .pipe(es.through(function (data) {
@@ -266,7 +275,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
var strContents = data.contents.toString(); var strContents = data.contents.toString();
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr); strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
data.contents = Buffer.from(strContents); data.contents = Buffer.from(strContents);
this.emit('data', data); this.emit('data', data);
@@ -282,59 +291,31 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
); );
}); });
gulp.task('analyze-editor-distro', function () { gulp.task('editor-distro',
// @ts-ignore task.series(
var bundleInfo = require('../out-editor/bundleInfo.json'); task.parallel(
var graph = bundleInfo.graph; util.rimraf('out-editor-src'),
var bundles = bundleInfo.bundles; util.rimraf('out-editor-build'),
util.rimraf('out-editor-esm'),
var inverseGraph = {}; util.rimraf('out-monaco-editor-core'),
Object.keys(graph).forEach(function (module) { util.rimraf('out-editor'),
var dependencies = graph[module]; util.rimraf('out-editor-min')
dependencies.forEach(function (dep) { ),
inverseGraph[dep] = inverseGraph[dep] || []; extractEditorSrcTask,
inverseGraph[dep].push(module); task.parallel(
}); task.series(
}); compileEditorAMDTask,
optimizeEditorAMDTask,
var detailed = {}; minifyEditorAMDTask
Object.keys(bundles).forEach(function (entryPoint) { ),
var included = bundles[entryPoint]; task.series(
var includedMap = {}; createESMSourcesAndResourcesTask,
included.forEach(function (included) { compileEditorESMTask
includedMap[included] = true; )
}); ),
finalEditorResourcesTask
var explanation = []; )
included.map(function (included) { );
if (included.indexOf('!') >= 0) {
return;
}
var reason = (inverseGraph[included] || []).filter(function (mod) {
return !!includedMap[mod];
});
explanation.push({
module: included,
reason: reason
});
});
detailed[entryPoint] = explanation;
});
console.log(JSON.stringify(detailed, null, '\t'));
});
function filterStream(testFunc) {
return es.through(function (data) {
if (!testFunc(data.relative)) {
return;
}
this.emit('data', data);
});
}
//#region monaco type checking //#region monaco type checking
@@ -354,6 +335,7 @@ function createTscCompileTask(watch) {
let errors = []; let errors = [];
let reporter = createReporter(); let reporter = createReporter();
let report; let report;
// eslint-disable-next-line no-control-regex
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
child.stdout.on('data', data => { child.stdout.on('data', data => {
@@ -387,7 +369,10 @@ function createTscCompileTask(watch) {
}; };
} }
gulp.task('monaco-typecheck-watch', createTscCompileTask(true)); const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
gulp.task('monaco-typecheck', createTscCompileTask(false)); exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
exports.monacoTypecheckTask = monacoTypecheckTask;
//#endregion //#endregion

View File

@@ -11,8 +11,8 @@ const path = require('path');
const tsb = require('gulp-tsb'); const tsb = require('gulp-tsb');
const es = require('event-stream'); const es = require('event-stream');
const filter = require('gulp-filter'); const filter = require('gulp-filter');
const rimraf = require('rimraf');
const util = require('./lib/util'); const util = require('./lib/util');
const task = require('./lib/task');
const watcher = require('./lib/watch'); const watcher = require('./lib/watch');
const createReporter = require('./lib/reporter').createReporter; const createReporter = require('./lib/reporter').createReporter;
const glob = require('glob'); const glob = require('glob');
@@ -43,16 +43,6 @@ const tasks = compilations.map(function (tsconfigFile) {
const name = relativeDirname.replace(/\//g, '-'); const name = relativeDirname.replace(/\//g, '-');
// Tasks
const clean = 'clean-extension:' + name;
const compile = 'compile-extension:' + name;
const watch = 'watch-extension:' + name;
// Build Tasks
const cleanBuild = 'clean-extension-build:' + name;
const compileBuild = 'compile-extension-build:' + name;
const watchBuild = 'watch-extension-build:' + name;
const root = path.join('extensions', relativeDirname); const root = path.join('extensions', relativeDirname);
const srcBase = path.join(root, 'src'); const srcBase = path.join(root, 'src');
const src = path.join(srcBase, '**'); const src = path.join(srcBase, '**');
@@ -111,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase }; const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
gulp.task(clean, cb => rimraf(out, cb)); const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
gulp.task(compile, [clean], () => { const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(false, true); const pipeline = createPipeline(false, true);
const input = gulp.src(src, srcOpts); const input = gulp.src(src, srcOpts);
return input return input
.pipe(pipeline()) .pipe(pipeline())
.pipe(gulp.dest(out)); .pipe(gulp.dest(out));
}); }));
gulp.task(watch, [clean], () => { const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(false); const pipeline = createPipeline(false);
const input = gulp.src(src, srcOpts); const input = gulp.src(src, srcOpts);
const watchInput = watcher(src, srcOpts); const watchInput = watcher(src, srcOpts);
@@ -130,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
return watchInput return watchInput
.pipe(util.incremental(pipeline, input)) .pipe(util.incremental(pipeline, input))
.pipe(gulp.dest(out)); .pipe(gulp.dest(out));
}); }));
gulp.task(cleanBuild, cb => rimraf(out, cb)); const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
gulp.task(compileBuild, [clean], () => {
const pipeline = createPipeline(true, true); const pipeline = createPipeline(true, true);
const input = gulp.src(src, srcOpts); const input = gulp.src(src, srcOpts);
return input return input
.pipe(pipeline()) .pipe(pipeline())
.pipe(gulp.dest(out)); .pipe(gulp.dest(out));
}); }));
gulp.task(watchBuild, [clean], () => { // Tasks
const pipeline = createPipeline(true); gulp.task(compileTask);
const input = gulp.src(src, srcOpts); gulp.task(watchTask);
const watchInput = watcher(src, srcOpts);
return watchInput
.pipe(util.incremental(() => pipeline(), input))
.pipe(gulp.dest(out));
});
return { return {
clean: clean, compileTask: compileTask,
compile: compile, watchTask: watchTask,
watch: watch, compileBuildTask: compileBuildTask
cleanBuild: cleanBuild,
compileBuild: compileBuild,
watchBuild: watchBuild
}; };
}); });
gulp.task('clean-extensions', tasks.map(t => t.clean)); const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
gulp.task('compile-extensions', tasks.map(t => t.compile)); gulp.task(compileExtensionsTask);
gulp.task('watch-extensions', tasks.map(t => t.watch)); exports.compileExtensionsTask = compileExtensionsTask;
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild)); const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild)); gulp.task(watchExtensionsTask);
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild)); exports.watchExtensionsTask = watchExtensionsTask;
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;

View File

@@ -42,7 +42,8 @@ const indentationFilter = [
// except specific files // except specific files
'!ThirdPartyNotices.txt', '!ThirdPartyNotices.txt',
'!LICENSE.txt', '!LICENSE.{txt,rtf}',
'!LICENSES.chromium.html',
'!**/LICENSE', '!**/LICENSE',
'!src/vs/nls.js', '!src/vs/nls.js',
'!src/vs/nls.build.js', '!src/vs/nls.build.js',
@@ -50,7 +51,6 @@ const indentationFilter = [
'!src/vs/css.build.js', '!src/vs/css.build.js',
'!src/vs/loader.js', '!src/vs/loader.js',
'!src/vs/base/common/marked/marked.js', '!src/vs/base/common/marked/marked.js',
'!src/vs/base/common/winjs.base.js',
'!src/vs/base/node/terminateProcess.sh', '!src/vs/base/node/terminateProcess.sh',
'!src/vs/base/node/cpuUsage.sh', '!src/vs/base/node/cpuUsage.sh',
'!test/assert.js', '!test/assert.js',
@@ -82,14 +82,21 @@ const indentationFilter = [
'!src/typings/**/*.d.ts', '!src/typings/**/*.d.ts',
'!extensions/**/*.d.ts', '!extensions/**/*.d.ts',
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}', '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
'!build/{lib,tslintRules}/**/*.js', '!build/{lib,tslintRules,download}/**/*.js',
'!build/**/*.sh', '!build/**/*.sh',
'!build/azure-pipelines/**/*.js', '!build/azure-pipelines/**/*.js',
'!build/azure-pipelines/**/*.config', '!build/azure-pipelines/**/*.config',
'!**/Dockerfile', '!**/Dockerfile',
'!**/Dockerfile.*',
'!**/*.Dockerfile', '!**/*.Dockerfile',
'!**/*.dockerfile', '!**/*.dockerfile',
'!extensions/markdown-language-features/media/*.js' '!extensions/markdown-language-features/media/*.js',
// {{SQL CARBON EDIT}}
'!**/*.{xlf,docx,sql,vsix}',
'!extensions/mssql/sqltoolsservice/**',
'!extensions/import/flatfileimportservice/**',
'!extensions/admin-tool-ext-win/ssmsmin/**',
'!extensions/resource-deployment/notebooks/**'
]; ];
const copyrightFilter = [ const copyrightFilter = [
@@ -110,13 +117,46 @@ const copyrightFilter = [
'!**/*.opts', '!**/*.opts',
'!**/*.disabled', '!**/*.disabled',
'!**/*.code-workspace', '!**/*.code-workspace',
'!**/promise-polyfill/polyfill.js',
'!build/**/*.init', '!build/**/*.init',
'!resources/linux/snap/snapcraft.yaml', '!resources/linux/snap/snapcraft.yaml',
'!resources/linux/snap/electron-launch', '!resources/linux/snap/electron-launch',
'!resources/win32/bin/code.js', '!resources/win32/bin/code.js',
'!resources/completions/**',
'!extensions/markdown-language-features/media/highlight.css', '!extensions/markdown-language-features/media/highlight.css',
'!extensions/html-language-features/server/src/modes/typescript/*', '!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*' '!extensions/*/server/bin/*',
// {{SQL CARBON EDIT}}
'!extensions/notebook/src/intellisense/text.ts',
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
'!src/sql/workbench/parts/notebook/outputs/tableRenderers.ts',
'!src/sql/workbench/parts/notebook/outputs/common/url.ts',
'!src/sql/workbench/parts/notebook/outputs/common/renderMimeInterfaces.ts',
'!src/sql/workbench/parts/notebook/outputs/common/outputProcessor.ts',
'!src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts',
'!src/sql/workbench/parts/notebook/cellViews/media/*.css',
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
'!src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts',
'!src/sql/workbench/parts/notebook/outputs/sanitizer.ts',
'!src/sql/workbench/parts/notebook/outputs/renderers.ts',
'!src/sql/workbench/parts/notebook/outputs/registry.ts',
'!src/sql/workbench/parts/notebook/outputs/factories.ts',
'!src/sql/workbench/parts/notebook/models/nbformat.ts',
'!extensions/markdown-language-features/media/tomorrow.css',
'!src/sql/workbench/electron-browser/modelComponents/media/highlight.css',
'!src/sql/parts/modelComponents/highlight.css',
'!extensions/mssql/sqltoolsservice/**',
'!extensions/import/flatfileimportservice/**',
'!extensions/notebook/src/prompts/**',
'!extensions/mssql/src/prompts/**',
'!extensions/notebook/resources/jupyter_config/**',
'!**/*.gif',
'!**/*.xlf',
'!**/*.dacpac'
]; ];
const eslintFilter = [ const eslintFilter = [
@@ -127,7 +167,6 @@ const eslintFilter = [
'!src/vs/nls.js', '!src/vs/nls.js',
'!src/vs/css.build.js', '!src/vs/css.build.js',
'!src/vs/nls.build.js', '!src/vs/nls.build.js',
'!src/**/winjs.base.js',
'!src/**/marked.js', '!src/**/marked.js',
'!**/test/**' '!**/test/**'
]; ];
@@ -146,6 +185,11 @@ const tslintFilter = [
'!extensions/html-language-features/server/lib/jquery.d.ts' '!extensions/html-language-features/server/lib/jquery.d.ts'
]; ];
// {{SQL CARBON EDIT}}
const useStrictFilter = [
'src/**'
];
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const copyrightHeaderLines = [ const copyrightHeaderLines = [
'/*---------------------------------------------------------------------------------------------', '/*---------------------------------------------------------------------------------------------',
@@ -163,8 +207,7 @@ gulp.task('eslint', () => {
}); });
gulp.task('tslint', () => { gulp.task('tslint', () => {
// {{SQL CARBON EDIT}} const options = { emitError: true };
const options = { emitError: false };
return vfs.src(all, { base: '.', follow: true, allowEmpty: true }) return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintFilter)) .pipe(filter(tslintFilter))
@@ -197,8 +240,8 @@ function hygiene(some) {
}); });
const copyrights = es.through(function (file) { const copyrights = es.through(function (file) {
const lines = file.__lines;
const lines = file.__lines;
for (let i = 0; i < copyrightHeaderLines.length; i++) { for (let i = 0; i < copyrightHeaderLines.length; i++) {
if (lines[i] !== copyrightHeaderLines[i]) { if (lines[i] !== copyrightHeaderLines[i]) {
console.error(file.relative + ': Missing or bad copyright statement'); console.error(file.relative + ': Missing or bad copyright statement');
@@ -210,6 +253,23 @@ function hygiene(some) {
this.emit('data', file); this.emit('data', file);
}); });
// {{SQL CARBON EDIT}}
// Check for unnecessary 'use strict' lines. These are automatically added by the alwaysStrict compiler option so don't need to be added manually
const useStrict = es.through(function (file) {
const lines = file.__lines;
// Only take the first 10 lines to reduce false positives- the compiler will throw an error if it's not the first non-comment line in a file
// (10 is used to account for copyright and extraneous newlines)
lines.slice(0, 10).forEach((line, i) => {
if (/\s*'use\s*strict\s*'/.test(line)) {
console.error(file.relative + '(' + (i + 1) + ',1): Unnecessary \'use strict\' - this is already added by the compiler');
errorCount++;
}
});
this.emit('data', file);
});
// {{SQL CARBON EDIT}} END
const formatting = es.map(function (file, cb) { const formatting = es.map(function (file, cb) {
tsfmt.processString(file.path, file.contents.toString('utf8'), { tsfmt.processString(file.path, file.contents.toString('utf8'), {
verify: false, verify: false,
@@ -230,7 +290,7 @@ function hygiene(some) {
let formatted = result.dest.replace(/\r\n/gm, '\n'); let formatted = result.dest.replace(/\r\n/gm, '\n');
if (original !== formatted) { if (original !== formatted) {
console.error('File not formatted:', file.relative); console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
errorCount++; errorCount++;
} }
cb(null, file); cb(null, file);
@@ -262,27 +322,52 @@ function hygiene(some) {
.pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(f => !f.stat.isDirectory()))
.pipe(filter(indentationFilter)) .pipe(filter(indentationFilter))
.pipe(indentation) .pipe(indentation)
.pipe(filter(copyrightFilter)); .pipe(filter(copyrightFilter))
// {{SQL CARBON EDIT}} .pipe(copyrights);
// .pipe(copyrights);
const typescript = result const typescript = result
.pipe(filter(tslintFilter)) .pipe(filter(tslintFilter))
.pipe(formatting) .pipe(formatting)
.pipe(tsl); .pipe(tsl)
// {{SQL CARBON EDIT}}
.pipe(filter(useStrictFilter))
.pipe(useStrict);
const javascript = result const javascript = result
.pipe(filter(eslintFilter)) .pipe(filter(eslintFilter))
.pipe(gulpeslint('src/.eslintrc')) .pipe(gulpeslint('src/.eslintrc'))
.pipe(gulpeslint.formatEach('compact')); .pipe(gulpeslint.formatEach('compact'))
// {{SQL CARBON EDIT}} .pipe(gulpeslint.failAfterError());
// .pipe(gulpeslint.failAfterError());
let count = 0; let count = 0;
return es.merge(typescript, javascript) return es.merge(typescript, javascript)
.pipe(es.through(function (data) { .pipe(es.through(function (data) {
// {{SQL CARBON EDIT}} count++;
this.emit('end'); if (process.env['TRAVIS'] && count % 10 === 0) {
process.stdout.write('.');
}
this.emit('data', data);
}, function () {
process.stdout.write('\n');
const tslintResult = tsLinter.getResult();
if (tslintResult.failures.length > 0) {
for (const failure of tslintResult.failures) {
const name = failure.getFileName();
const position = failure.getStartPosition();
const line = position.getLineAndCharacter().line;
const character = position.getLineAndCharacter().character;
console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`);
}
errorCount += tslintResult.failures.length;
}
if (errorCount > 0) {
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
} else {
this.emit('end');
}
})); }));
} }
@@ -300,7 +385,7 @@ function createGitIndexVinyls(paths) {
return e(err); return e(err);
} }
cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => { cp.exec(`git show ":${relativePath}"`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
if (err) { if (err) {
return e(err); return e(err);
} }

View File

@@ -6,21 +6,13 @@
'use strict'; 'use strict';
const gulp = require('gulp'); const gulp = require('gulp');
const json = require('gulp-json-editor');
const buffer = require('gulp-buffer');
const filter = require('gulp-filter');
const es = require('event-stream');
const util = require('./lib/util');
const remote = require('gulp-remote-src');
const zip = require('gulp-vinyl-zip');
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const jeditor = require('gulp-json-editor'); const jeditor = require('gulp-json-editor');
const product = require('../product.json');
const pkg = require('../package.json');
gulp.task('mixin', function () { gulp.task('mixin', function () {
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const updateUrl = process.env['SQLOPS_UPDATEURL']; const updateUrl = process.env['SQLOPS_UPDATEURL'];
if (!updateUrl) { if (!updateUrl) {
console.log('Missing SQLOPS_UPDATEURL, skipping mixin'); console.log('Missing SQLOPS_UPDATEURL, skipping mixin');
@@ -34,19 +26,53 @@ gulp.task('mixin', function () {
return; return;
} }
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}} - apply ADS insiders values if needed
let serviceUrl = 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json';
if (quality === 'insider') {
serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
}
let newValues = { let newValues = {
"nameShort": product.nameShort,
"nameLong": product.nameLong,
"applicationName": product.applicationName,
"dataFolderName": product.dataFolderName,
"win32MutexName": product.win32MutexName,
"win32DirName": product.win32DirName,
"win32NameVersion": product.win32NameVersion,
"win32RegValueName": product.win32RegValueName,
"win32AppId": product.win32AppId,
"win32x64AppId": product.win32x64AppId,
"win32UserAppId": product.win32UserAppId,
"win32x64UserAppId": product.win32x64UserAppId,
"win32AppUserModelId": product.win32AppUserModelId,
"win32ShellNameShort": product.win32ShellNameShort,
"darwinBundleIdentifier": product.darwinBundleIdentifier,
"updateUrl": updateUrl, "updateUrl": updateUrl,
"quality": quality, "quality": quality,
"extensionsGallery": { "extensionsGallery": {
"serviceUrl": serviceUrl "serviceUrl": 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json'
} }
}; };
if (quality === 'insider') {
let dashSuffix = '-insiders';
let dotSuffix = '.insiders';
let displaySuffix = ' - Insiders';
newValues.extensionsGallery.serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
newValues.nameShort += dashSuffix;
newValues.nameLong += displaySuffix;
newValues.applicationName += dashSuffix;
newValues.dataFolderName += dashSuffix;
newValues.win32MutexName += dashSuffix;
newValues.win32DirName += displaySuffix;
newValues.win32NameVersion += displaySuffix;
newValues.win32RegValueName += dashSuffix;
newValues.win32AppId = "{{9F0801B2-DEE3-4272-A2C6-FBDF25BAAF0F}";
newValues.win32x64AppId = "{{6748A5FD-29EB-4BA6-B3C6-E7B981B8D6B0}";
newValues.win32UserAppId = "{{0F8CD1ED-483C-40EB-8AD2-8ED784651AA1}";
newValues.win32x64UserAppId += dashSuffix;
newValues.win32AppUserModelId += dotSuffix;
newValues.win32ShellNameShort += displaySuffix;
newValues.darwinBundleIdentifier += dotSuffix;
}
return gulp.src('./product.json') return gulp.src('./product.json')
.pipe(jeditor(newValues)) .pipe(jeditor(newValues))
.pipe(gulp.dest('.')); .pipe(gulp.dest('.'));

16
build/gulpfile.reh.js Normal file
View File

@@ -0,0 +1,16 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const gulp = require('gulp');
const noop = () => { return Promise.resolve(); };
gulp.task('vscode-reh-win32-ia32-min', noop);
gulp.task('vscode-reh-win32-x64-min', noop);
gulp.task('vscode-reh-darwin-min', noop);
gulp.task('vscode-reh-linux-x64-min', noop);
gulp.task('vscode-reh-linux-arm-min', noop);

View File

@@ -28,7 +28,6 @@ const formatFiles = (some) => {
console.info('ran formatting on file ' + file.path + ' result: ' + result.message); console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
if (result.error) { if (result.error) {
console.error(result.message); console.error(result.message);
errorCount++;
} }
cb(null, file); cb(null, file);
@@ -40,7 +39,7 @@ const formatFiles = (some) => {
.pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(f => !f.stat.isDirectory()))
.pipe(formatting); .pipe(formatting);
} };
const formatStagedFiles = () => { const formatStagedFiles = () => {
const cp = require('child_process'); const cp = require('child_process');
@@ -81,4 +80,4 @@ const formatStagedFiles = () => {
process.exit(1); process.exit(1);
}); });
}); });
} };

View File

@@ -20,6 +20,7 @@ const filter = require('gulp-filter');
const json = require('gulp-json-editor'); const json = require('gulp-json-editor');
const _ = require('underscore'); const _ = require('underscore');
const util = require('./lib/util'); const util = require('./lib/util');
const task = require('./lib/task');
const ext = require('./lib/extensions'); const ext = require('./lib/extensions');
const buildfile = require('../src/buildfile'); const buildfile = require('../src/buildfile');
const common = require('./lib/optimize'); const common = require('./lib/optimize');
@@ -32,12 +33,11 @@ const i18n = require('./lib/i18n');
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const serviceDownloader = require('service-downloader').ServiceDownloadProvider; const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
const platformInfo = require('service-downloader/out/platform').PlatformInformation; const platformInfo = require('service-downloader/out/platform').PlatformInformation;
const glob = require('glob');
// {{SQL CARBON EDIT}} - End // {{SQL CARBON EDIT}} - End
const deps = require('./dependencies'); const deps = require('./dependencies');
const getElectronVersion = require('./lib/electron').getElectronVersion; const getElectronVersion = require('./lib/electron').getElectronVersion;
const createAsar = require('./lib/asar').createAsar; const createAsar = require('./lib/asar').createAsar;
const minimist = require('minimist'); const { compileBuildTask } = require('./gulpfile.compile');
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname)); const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
// @ts-ignore // @ts-ignore
@@ -52,7 +52,7 @@ const nodeModules = [
'rxjs/Observable', 'rxjs/Observable',
'rxjs/Subject', 'rxjs/Subject',
'rxjs/Observer', 'rxjs/Observer',
'ng2-charts/ng2-charts'] 'ng2-charts']
.concat(Object.keys(product.dependencies || {})) .concat(Object.keys(product.dependencies || {}))
.concat(_.uniq(productionDependencies.map(d => d.name))) .concat(_.uniq(productionDependencies.map(d => d.name)))
.concat(baseModules); .concat(baseModules);
@@ -75,16 +75,19 @@ const vscodeResources = [
'out-build/bootstrap-window.js', 'out-build/bootstrap-window.js',
'out-build/paths.js', 'out-build/paths.js',
'out-build/vs/**/*.{svg,png,cur,html}', 'out-build/vs/**/*.{svg,png,cur,html}',
'!out-build/vs/code/browser/**/*.html',
'out-build/vs/base/common/performance.js', 'out-build/vs/base/common/performance.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}', 'out-build/vs/base/node/languagePacks.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**', 'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/workbench/browser/media/*-theme.css', 'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/parts/debug/**/*.json', 'out-build/vs/workbench/contrib/debug/**/*.json',
'out-build/vs/workbench/parts/execution/**/*.scpt', 'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js', 'out-build/vs/workbench/contrib/webview/browser/pre/*.js',
'out-build/vs/workbench/contrib/webview/electron-browser/pre/*.js',
'out-build/vs/**/markdown.css', 'out-build/vs/**/markdown.css',
'out-build/vs/workbench/parts/tasks/**/*.json', 'out-build/vs/workbench/contrib/tasks/**/*.json',
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md', 'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
'out-build/vs/workbench/services/files/**/*.exe', 'out-build/vs/workbench/services/files/**/*.exe',
'out-build/vs/workbench/services/files/**/*.md', 'out-build/vs/workbench/services/files/**/*.md',
'out-build/vs/code/electron-browser/workbench/**', 'out-build/vs/code/electron-browser/workbench/**',
@@ -99,19 +102,17 @@ const vscodeResources = [
'out-build/sql/parts/admin/**/*.html', 'out-build/sql/parts/admin/**/*.html',
'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}', 'out-build/sql/parts/connection/connectionDialog/media/*.{gif,png,svg}',
'out-build/sql/parts/common/dblist/**/*.html', 'out-build/sql/parts/common/dblist/**/*.html',
'out-build/sql/parts/dashboard/**/*.html', 'out-build/sql/workbench/parts/dashboard/**/*.html',
'out-build/sql/parts/disasterRecovery/**/*.html', 'out-build/sql/parts/disasterRecovery/**/*.html',
'out-build/sql/parts/common/modal/media/**', 'out-build/sql/parts/common/modal/media/**',
'out-build/sql/parts/grid/load/lib/**', 'out-build/sql/workbench/parts/grid/media/**',
'out-build/sql/parts/grid/load/loadJquery.js', 'out-build/sql/workbench/parts/grid/views/**/*.html',
'out-build/sql/parts/grid/media/**',
'out-build/sql/parts/grid/views/**/*.html',
'out-build/sql/parts/tasks/**/*.html', 'out-build/sql/parts/tasks/**/*.html',
'out-build/sql/parts/taskHistory/viewlet/media/**', 'out-build/sql/parts/taskHistory/viewlet/media/**',
'out-build/sql/parts/jobManagement/common/media/*.svg', 'out-build/sql/parts/jobManagement/common/media/*.svg',
'out-build/sql/media/objectTypes/*.svg', 'out-build/sql/media/objectTypes/*.svg',
'out-build/sql/media/icons/*.svg', 'out-build/sql/media/icons/*.svg',
'out-build/sql/parts/notebook/media/**/*.svg', 'out-build/sql/workbench/parts/notebook/media/**/*.svg',
'!**/test/**' '!**/test/**'
]; ];
@@ -121,29 +122,41 @@ const BUNDLED_FILE_HEADER = [
' *--------------------------------------------------------*/' ' *--------------------------------------------------------*/'
].join('\n'); ].join('\n');
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode')); const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({ task.parallel(
src: 'out-build', util.rimraf('out-vscode'),
entryPoints: vscodeEntryPoints, compileBuildTask
otherSources: [], ),
resources: vscodeResources, common.optimizeTask({
loaderConfig: common.loaderConfig(nodeModules), src: 'out-build',
header: BUNDLED_FILE_HEADER, entryPoints: vscodeEntryPoints,
out: 'out-vscode', resources: vscodeResources,
bundleInfo: undefined loaderConfig: common.loaderConfig(nodeModules),
})); header: BUNDLED_FILE_HEADER,
out: 'out-vscode',
bundleInfo: undefined
})
));
gulp.task('optimize-index-js', ['optimize-vscode'], () => { const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
const fullpath = path.join(process.cwd(), 'out-vscode/vs/code/electron-browser/workbench/workbench.js'); optimizeVSCodeTask,
const contents = fs.readFileSync(fullpath).toString(); () => {
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules)); const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
fs.writeFileSync(fullpath, newContents); const contents = fs.readFileSync(fullpath).toString();
}); const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
fs.writeFileSync(fullpath, newContents);
}
));
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min')); const minifyVSCodeTask = task.define('minify-vscode', task.series(
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)); task.parallel(
util.rimraf('out-vscode-min'),
optimizeIndexJSTask
),
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
));
// Package // Package
@@ -164,7 +177,7 @@ const config = {
version: getElectronVersion(), version: getElectronVersion(),
productAppName: product.nameLong, productAppName: product.nameLong,
companyName: 'Microsoft Corporation', companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2018 Microsoft. All rights reserved', copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: 'resources/darwin/code.icns', darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier, darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools', darwinApplicationCategoryType: 'public.app-category.developer-tools',
@@ -180,13 +193,13 @@ const config = {
urlSchemes: [product.urlProtocol] urlSchemes: [product.urlProtocol]
}], }],
darwinForceDarkModeSupport: true, darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0, darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName, linuxExecutableName: product.applicationName,
winIcon: 'resources/win32/code.ico', winIcon: 'resources/win32/code.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0, token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
// @ts-ignore JSON checking: electronRepository is optional // @ts-ignore JSON checking: electronRepository is optional
repo: product.electronRepository || void 0 repo: product.electronRepository || undefined
}; };
function getElectron(arch) { function getElectron(arch) {
@@ -206,13 +219,11 @@ function getElectron(arch) {
}; };
} }
gulp.task('clean-electron', util.rimraf('.build/electron')); gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
gulp.task('electron', ['clean-electron'], getElectron(process.arch)); gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32')); gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
gulp.task('electron-x64', ['clean-electron'], getElectron('x64')); gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
gulp.task('electron-arm', ['clean-electron'], getElectron('arm')); gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64'));
/** /**
* Compute checksums for some files. * Compute checksums for some files.
@@ -248,15 +259,14 @@ function computeChecksum(filename) {
return hash; return hash;
} }
function packageTask(platform, arch, opts) { function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
opts = opts || {}; opts = opts || {};
// {{SQL CARBON EDIT}} const destination = path.join(path.dirname(root), destinationFolderName);
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
platform = platform || process.platform; platform = platform || process.platform;
return () => { return () => {
const out = opts.minified ? 'out-vscode-min' : 'out-vscode'; const out = sourceFolderName;
const checksums = computeChecksums(out, [ const checksums = computeChecksums(out, [
'vs/workbench/workbench.main.js', 'vs/workbench/workbench.main.js',
@@ -309,14 +319,13 @@ function packageTask(platform, arch, opts) {
const productJsonStream = gulp.src(['product.json'], { base: '.' }) const productJsonStream = gulp.src(['product.json'], { base: '.' })
.pipe(json(productJsonUpdate)); .pipe(json(productJsonUpdate));
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' }); const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
// TODO the API should be copied to `out` during compile, not here // TODO the API should be copied to `out` during compile, not here
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts')); const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts')); const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
const depsSrc = [ const depsSrc = [
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])), ..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
@@ -326,31 +335,7 @@ function packageTask(platform, arch, opts) {
const deps = gulp.src(depsSrc, { base: '.', dot: true }) const deps = gulp.src(depsSrc, { base: '.', dot: true })
.pipe(filter(['**', '!**/package-lock.json'])) .pipe(filter(['**', '!**/package-lock.json']))
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node'])) .pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore')))
.pipe(util.cleanNodeModule('vscode-sqlite3', ['binding.gyp', 'benchmark/**', 'cloudformation/**', 'deps/**', 'test/**', 'build/**', 'src/**'], ['build/Release/*.node']))
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/*.js']))
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['build/Release/*.node']))
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['build/Release/*.node']))
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/index.js']))
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
// {{SQL CARBON EDIT}}
.pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined))
.pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined))
.pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**']))
.pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined))
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
// {{SQL CARBON EDIT}} - End
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar')); .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -361,50 +346,29 @@ function packageTask(platform, arch, opts) {
'node_modules/underscore/**/*.*', 'node_modules/underscore/**/*.*',
'node_modules/zone.js/**/*.*', 'node_modules/zone.js/**/*.*',
'node_modules/chart.js/**/*.*', 'node_modules/chart.js/**/*.*',
'node_modules/chartjs-color/**/*.*',
'node_modules/chartjs-color-string/**/*.*',
'node_modules/color-convert/**/*.*',
'node_modules/color-name/**/*.*',
'node_modules/moment/**/*.*'
], { base: '.', dot: true }); ], { base: '.', dot: true });
let all = es.merge( let all = es.merge(
packageJsonStream, packageJsonStream,
productJsonStream, productJsonStream,
license, license,
watermark,
api, api,
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
copiedModules, copiedModules,
dataApi, dataApi,
sqlopsAPI,
sources, sources,
deps deps
); );
if (platform === 'win32') { if (platform === 'win32') {
all = es.merge(all, gulp.src([ all = es.merge(all, gulp.src([
'resources/win32/bower.ico', // {{SQL CARBON EDIT}} remove unused icons
'resources/win32/c.ico',
'resources/win32/config.ico',
'resources/win32/cpp.ico',
'resources/win32/csharp.ico',
'resources/win32/css.ico',
'resources/win32/default.ico',
'resources/win32/go.ico',
'resources/win32/html.ico',
'resources/win32/jade.ico',
'resources/win32/java.ico',
'resources/win32/javascript.ico',
'resources/win32/json.ico',
'resources/win32/less.ico',
'resources/win32/markdown.ico',
'resources/win32/php.ico',
'resources/win32/powershell.ico',
'resources/win32/python.ico',
'resources/win32/react.ico',
'resources/win32/ruby.ico',
'resources/win32/sass.ico',
'resources/win32/shell.ico',
'resources/win32/sql.ico',
'resources/win32/typescript.ico',
'resources/win32/vue.ico',
'resources/win32/xml.ico',
'resources/win32/yaml.ico',
'resources/win32/code_70x70.png', 'resources/win32/code_70x70.png',
'resources/win32/code_150x150.png' 'resources/win32/code_150x150.png'
], { base: '.' })); ], { base: '.' }));
@@ -423,8 +387,10 @@ function packageTask(platform, arch, opts) {
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true }))) .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'])); .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
if (platform === 'win32') { if (platform === 'win32') {
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' })); result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' }) result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort)) .pipe(replace('@@NAME@@', product.nameShort))
@@ -432,14 +398,18 @@ function packageTask(platform, arch, opts) {
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' }) result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort)) .pipe(replace('@@NAME@@', product.nameShort))
.pipe(replace('@@PRODNAME@@', product.nameLong))
.pipe(replace('@@VERSION@@', version))
.pipe(replace('@@COMMIT@@', commit)) .pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName)) .pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(replace('@@QUALITY@@', quality))
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; }))); .pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' }) result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
.pipe(rename(product.nameShort + '.VisualElementsManifest.xml'))); .pipe(rename(product.nameShort + '.VisualElementsManifest.xml')));
} else if (platform === 'linux') { } else if (platform === 'linux') {
result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' }) result = es.merge(result, gulp.src('resources/linux/bin/code.sh', { base: '.' })
.pipe(replace('@@PRODNAME@@', product.nameLong))
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('bin/' + product.applicationName))); .pipe(rename('bin/' + product.applicationName)));
} }
@@ -459,38 +429,35 @@ function packageTask(platform, arch, opts) {
const buildRoot = path.dirname(root); const buildRoot = path.dirname(root);
// {{SQL CARBON EDIT}} const BUILD_TARGETS = [
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'win32', 'x64')); { platform: 'win32', arch: 'ia32' },
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'darwin')); { platform: 'win32', arch: 'x64' },
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'linux', 'x64')); { platform: 'darwin', arch: null, opts: { stats: true } },
{ platform: 'linux', arch: 'ia32' },
{ platform: 'linux', arch: 'x64' },
{ platform: 'linux', arch: 'arm' },
{ platform: 'linux', arch: 'arm64' },
];
BUILD_TARGETS.forEach(buildTarget => {
const dashed = (str) => (str ? `-${str}` : ``);
const platform = buildTarget.platform;
const arch = buildTarget.arch;
const opts = buildTarget.opts;
gulp.task('vscode-win32-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'win32', 'x64')); ['', 'min'].forEach(minified => {
gulp.task('vscode-darwin-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'darwin')); const sourceFolderName = `out-vscode${dashed(minified)}`;
gulp.task('vscode-linux-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'linux', 'x64')); const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32'))); const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64'))); task.parallel(
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin'))); minified ? minifyVSCodeTask : optimizeVSCodeTask,
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32'))); util.rimraf(path.join(buildRoot, destinationFolderName))
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64'))); ),
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm'))); packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm64'))); ));
gulp.task(vscodeTask);
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32')); });
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'vscode-win32-x64-mssql', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64')); });
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'vscode-darwin-mssql', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true }));
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'vscode-linux-x64-mssql', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64'));
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true }));
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true }));
// Transifex Localizations // Transifex Localizations
@@ -513,30 +480,42 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
const apiName = process.env.TRANSIFEX_API_NAME; const apiName = process.env.TRANSIFEX_API_NAME;
const apiToken = process.env.TRANSIFEX_API_TOKEN; const apiToken = process.env.TRANSIFEX_API_TOKEN;
gulp.task('vscode-translations-push', ['optimize-vscode'], function () { gulp.task(task.define(
const pathToMetadata = './out-vscode/nls.metadata.json'; 'vscode-translations-push',
const pathToExtensions = './extensions/*'; task.series(
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; optimizeVSCodeTask,
function () {
const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
return es.merge( return es.merge(
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken) ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
}); }
)
));
gulp.task('vscode-translations-export', ['optimize-vscode'], function () { gulp.task(task.define(
const pathToMetadata = './out-vscode/nls.metadata.json'; 'vscode-translations-export',
const pathToExtensions = './extensions/*'; task.series(
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; optimizeVSCodeTask,
function () {
const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
return es.merge( return es.merge(
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
).pipe(vfs.dest('../vscode-translations-export')); ).pipe(vfs.dest('../vscode-translations-export'));
}); }
)
));
gulp.task('vscode-translations-pull', function () { gulp.task('vscode-translations-pull', function () {
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => { return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
@@ -557,7 +536,7 @@ gulp.task('vscode-translations-import', function () {
// Sourcemaps // Sourcemaps
gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => { gulp.task('upload-vscode-sourcemaps', () => {
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' }) const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
.pipe(es.mapSync(f => { .pipe(es.mapSync(f => {
f.path = `${f.base}/core/${f.relative}`; f.path = `${f.base}/core/${f.relative}`;
@@ -581,57 +560,8 @@ gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], ()
})); }));
}); });
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
if (!shouldSetupSettingsSearch()) {
const branch = process.env.BUILD_SOURCEBRANCH;
console.log(`Only runs on master and release branches, not ${branch}`);
return;
}
if (!fs.existsSync(allConfigDetailsPath)) {
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
}
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
if (!settingsSearchBuildId) {
throw new Error('Failed to compute build number');
}
return gulp.src(allConfigDetailsPath)
.pipe(azure.upload({
account: process.env.AZURE_STORAGE_ACCOUNT,
key: process.env.AZURE_STORAGE_ACCESS_KEY,
container: 'configuration',
prefix: `${settingsSearchBuildId}/${commit}/`
}));
});
function shouldSetupSettingsSearch() {
const branch = process.env.BUILD_SOURCEBRANCH;
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
}
function getSettingsSearchBuildId(packageJson) {
try {
const branch = process.env.BUILD_SOURCEBRANCH;
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
/\/master$/.test(branch) ? 1 :
2; // Some unexpected branch
const out = cp.execSync(`git rev-list HEAD --count`);
const count = parseInt(out.toString());
// <version number><commit count><branchId (avoid unlikely conflicts)>
// 1.25.1, 1,234,567 commits, master = 1250112345671
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
} catch (e) {
throw new Error('Could not determine build number: ' + e.toString());
}
}
// This task is only run for the MacOS build // This task is only run for the MacOS build
gulp.task('generate-vscode-configuration', () => { const generateVSCodeConfigurationTask = task.define('generate-vscode-configuration', () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const buildDir = process.env['AGENT_BUILDDIRECTORY']; const buildDir = process.env['AGENT_BUILDDIRECTORY'];
if (!buildDir) { if (!buildDir) {
@@ -668,6 +598,61 @@ gulp.task('generate-vscode-configuration', () => {
}); });
}); });
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
gulp.task(task.define(
'upload-vscode-configuration',
task.series(
generateVSCodeConfigurationTask,
() => {
if (!shouldSetupSettingsSearch()) {
const branch = process.env.BUILD_SOURCEBRANCH;
console.log(`Only runs on master and release branches, not ${branch}`);
return;
}
if (!fs.existsSync(allConfigDetailsPath)) {
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
}
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
if (!settingsSearchBuildId) {
throw new Error('Failed to compute build number');
}
return gulp.src(allConfigDetailsPath)
.pipe(azure.upload({
account: process.env.AZURE_STORAGE_ACCOUNT,
key: process.env.AZURE_STORAGE_ACCESS_KEY,
container: 'configuration',
prefix: `${settingsSearchBuildId}/${commit}/`
}));
}
)
));
function shouldSetupSettingsSearch() {
const branch = process.env.BUILD_SOURCEBRANCH;
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
}
function getSettingsSearchBuildId(packageJson) {
try {
const branch = process.env.BUILD_SOURCEBRANCH;
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
/\/master$/.test(branch) ? 1 :
2; // Some unexpected branch
const out = cp.execSync(`git rev-list HEAD --count`);
const count = parseInt(out.toString());
// <version number><commit count><branchId (avoid unlikely conflicts)>
// 1.25.1, 1,234,567 commits, master = 1250112345671
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
} catch (e) {
throw new Error('Could not determine build number: ' + e.toString());
}
}
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
// Install service locally before building carbon // Install service locally before building carbon
@@ -692,3 +677,26 @@ function installService() {
gulp.task('install-sqltoolsservice', () => { gulp.task('install-sqltoolsservice', () => {
return installService(); return installService();
}); });
function installSsmsMin() {
const config = require('../extensions/admin-tool-ext-win/src/config.json');
return platformInfo.getCurrent().then(p => {
const runtime = p.runtimeId;
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
var installer = new serviceDownloader(config);
const serviceInstallFolder = installer.getInstallDirectory(runtime);
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
return del(serviceCleanupFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
});
}
gulp.task('install-ssmsmin', () => {
return installSsmsMin();
});

View File

@@ -12,9 +12,13 @@ const shell = require('gulp-shell');
const es = require('event-stream'); const es = require('event-stream');
const vfs = require('vinyl-fs'); const vfs = require('vinyl-fs');
const util = require('./lib/util'); const util = require('./lib/util');
const task = require('./lib/task');
const packageJson = require('../package.json'); const packageJson = require('../package.json');
const product = require('../product.json'); const product = require('../product.json');
const rpmDependencies = require('../resources/linux/rpm/dependencies.json'); const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
const path = require('path');
const root = path.dirname(__dirname);
const commit = util.getVersion(root);
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
@@ -23,7 +27,7 @@ function getDebPackageArch(arch) {
} }
function prepareDebPackage(arch) { function prepareDebPackage(arch) {
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const binaryDir = '../azuredatastudio-linux-' + arch; const binaryDir = '../azuredatastudio-linux-' + arch;
const debArch = getDebPackageArch(arch); const debArch = getDebPackageArch(arch);
const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch; const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch;
@@ -39,7 +43,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ICON@@', product.applicationName)) .pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol)); .pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
@@ -49,7 +53,13 @@ function prepareDebPackage(arch) {
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml')); .pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
const icon = gulp.src('resources/linux/code.png', { base: '.' }) const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png')); .pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
// const bash_completion = gulp.src('resources/completions/bash/code')
// .pipe(rename('usr/share/bash-completion/completions/code'));
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
// .pipe(rename('usr/share/zsh/vendor-completions/_code'));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir }) const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; })); .pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
@@ -85,7 +95,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
.pipe(rename('DEBIAN/postinst')); .pipe(rename('DEBIAN/postinst'));
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, code); const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, /* bash_completion, zsh_completion, */ code);
return all.pipe(vfs.dest(destination)); return all.pipe(vfs.dest(destination));
}; };
@@ -124,7 +134,7 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ICON@@', product.applicationName)) .pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol)); .pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
@@ -134,7 +144,13 @@ function prepareRpmPackage(arch) {
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml')); .pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
const icon = gulp.src('resources/linux/code.png', { base: '.' }) const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png')); .pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
// const bash_completion = gulp.src('resources/completions/bash/code')
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
// .pipe(rename('BUILD/usr/share/zsh/site-functions/_code'));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir }) const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; })); .pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
@@ -142,6 +158,7 @@ function prepareRpmPackage(arch) {
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' }) const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@VERSION@@', packageJson.version)) .pipe(replace('@@VERSION@@', packageJson.version))
.pipe(replace('@@RELEASE@@', linuxPackageRevision)) .pipe(replace('@@RELEASE@@', linuxPackageRevision))
.pipe(replace('@@ARCHITECTURE@@', rpmArch)) .pipe(replace('@@ARCHITECTURE@@', rpmArch))
@@ -156,7 +173,7 @@ function prepareRpmPackage(arch) {
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' }) const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
.pipe(rename('SOURCES/' + product.applicationName + '.xpm')); .pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
const all = es.merge(code, desktops, appdata, icon, spec, specIcon); const all = es.merge(code, desktops, appdata, icon, /* bash_completion, zsh_completion, */ spec, specIcon);
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch))); return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
}; };
@@ -180,36 +197,39 @@ function getSnapBuildPath(arch) {
} }
function prepareSnapPackage(arch) { function prepareSnapPackage(arch) {
const binaryDir = '../VSCode-linux-' + arch; // {{SQL CARBON EDIT}}
const binaryDir = '../azuredatastudio-linux-' + arch;
const destination = getSnapBuildPath(arch); const destination = getSnapBuildPath(arch);
return function () { return function () {
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' }) const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
.pipe(rename(`usr/share/applications/${product.applicationName}-url-handler.desktop`));
const desktops = es.merge(desktop, desktopUrlHandler)
.pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`)) .pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`)); .pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
const icon = gulp.src('resources/linux/code.png', { base: '.' }) const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`)); .pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir }) const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; })); .pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' }) const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@VERSION@@', `${packageJson.version}-${linuxPackageRevision}`)) .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
.pipe(rename('snap/snapcraft.yaml')); .pipe(rename('snap/snapcraft.yaml'));
const snapUpdate = gulp.src('resources/linux/snap/snapUpdate.sh', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename(`usr/share/${product.applicationName}/snapUpdate.sh`));
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' }) const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
.pipe(rename('electron-launch')); .pipe(rename('electron-launch'));
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch, snapUpdate); const all = es.merge(desktops, icon, code, snapcraft, electronLaunch);
return all.pipe(vfs.dest(destination)); return all.pipe(vfs.dest(destination));
}; };
@@ -220,116 +240,36 @@ function buildSnapPackage(arch) {
return shell.task(`cd ${snapBuildPath} && snapcraft build`); return shell.task(`cd ${snapBuildPath} && snapcraft build`);
} }
function getFlatpakArch(arch) { const BUILD_TARGETS = [
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch]; { arch: 'ia32' },
} { arch: 'x64' },
{ arch: 'arm' },
{ arch: 'arm64' },
];
function prepareFlatpak(arch) { BUILD_TARGETS.forEach((buildTarget) => {
// {{SQL CARBON EDIT}} const arch = buildTarget.arch;
const binaryDir = '../azuredatastudio-linux-' + arch;
const flatpakArch = getFlatpakArch(arch);
const destination = '.build/linux/flatpak/' + flatpakArch;
return function () { {
// This is not imported in the global scope to avoid requiring ImageMagick const debArch = getDebPackageArch(arch);
// (or GraphicsMagick) when not building building Flatpak bundles. const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
const imgResize = require('gulp-image-resize'); // gulp.task(prepareDebTask);
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) { gulp.task(buildDebTask);
return gulp.src('resources/linux/code.png', { base: '.' })
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
});
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME@@', flatpakManifest.appId))
.pipe(replace('@@LICENSE@@', product.licenseName))
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) {
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
})));
return es.merge(all).pipe(vfs.dest(destination));
};
}
function buildFlatpak(arch) {
const flatpakArch = getFlatpakArch(arch);
const manifest = {};
for (var k in flatpakManifest) {
manifest[k] = flatpakManifest[k];
} }
manifest.files = [
['.build/linux/flatpak/' + flatpakArch, '/'], {
]; const rpmArch = getRpmPackageArch(arch);
const buildOptions = { const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
arch: flatpakArch, // gulp.task(prepareRpmTask);
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision, const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
}; gulp.task(buildRpmTask);
// If requested, use the configured path for the OSTree repository.
if (process.env.FLATPAK_REPO) {
buildOptions.repoDir = process.env.FLATPAK_REPO;
} else {
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
} }
// Setup PGP signing if requested.
if (process.env.GPG_KEY_ID !== undefined) { {
buildOptions.gpgSign = process.env.GPG_KEY_ID; const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
if (process.env.GPG_HOMEDIR) { gulp.task(prepareSnapTask);
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR; const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
} gulp.task(buildSnapTask);
} }
return function (cb) { });
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
};
}
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64'));
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64'));
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64'));
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64'));
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64'));
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64'));
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64'));
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64'));
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64'));

View File

@@ -12,6 +12,7 @@ const assert = require('assert');
const cp = require('child_process'); const cp = require('child_process');
const _7z = require('7zip')['7z']; const _7z = require('7zip')['7z'];
const util = require('./lib/util'); const util = require('./lib/util');
const task = require('./lib/task');
const pkg = require('../package.json'); const pkg = require('../package.json');
const product = require('../product.json'); const product = require('../product.json');
const vfs = require('vinyl-fs'); const vfs = require('vinyl-fs');
@@ -26,7 +27,7 @@ const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`); const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
const issPath = path.join(__dirname, 'win32', 'code.iss'); const issPath = path.join(__dirname, 'win32', 'code.iss');
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe'); const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1'); // const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
function packageInnoSetup(iss, options, cb) { function packageInnoSetup(iss, options, cb) {
options = options || {}; options = options || {};
@@ -107,8 +108,8 @@ function buildWin32Setup(arch, target) {
} }
function defineWin32SetupTasks(arch, target) { function defineWin32SetupTasks(arch, target) {
gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target))); const cleanTask = util.rimraf(setupDir(arch, target));
gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target)); gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
} }
defineWin32SetupTasks('ia32', 'system'); defineWin32SetupTasks('ia32', 'system');
@@ -126,11 +127,8 @@ function archiveWin32Setup(arch) {
}; };
} }
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32'))); gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32')); gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))));
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
function copyInnoUpdater(arch) { function copyInnoUpdater(arch) {
return () => { return () => {
@@ -139,9 +137,6 @@ function copyInnoUpdater(arch) {
}; };
} }
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
function patchInnoUpdater(arch) { function patchInnoUpdater(arch) {
return cb => { return cb => {
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico'); const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
@@ -149,5 +144,5 @@ function patchInnoUpdater(arch) {
}; };
} }
gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32')); gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64')); gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));

View File

@@ -14,7 +14,8 @@ const es = require('event-stream');
const rename = require('gulp-rename'); const rename = require('gulp-rename');
const vfs = require('vinyl-fs'); const vfs = require('vinyl-fs');
const ext = require('./extensions'); const ext = require('./extensions');
const util = require('gulp-util'); const fancyLog = require('fancy-log');
const ansiColors = require('ansi-colors');
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
const builtInExtensions = require('../builtInExtensions.json'); const builtInExtensions = require('../builtInExtensions.json');
@@ -43,7 +44,7 @@ function isUpToDate(extension) {
function syncMarketplaceExtension(extension) { function syncMarketplaceExtension(extension) {
if (isUpToDate(extension)) { if (isUpToDate(extension)) {
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎')); fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
return es.readArray([]); return es.readArray([]);
} }
@@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) {
return ext.fromMarketplace(extension.name, extension.version, extension.metadata) return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`)) .pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
.pipe(vfs.dest('.build/builtInExtensions')) .pipe(vfs.dest('.build/builtInExtensions'))
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎'))); .on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
} }
function syncExtension(extension, controlState) { function syncExtension(extension, controlState) {
switch (controlState) { switch (controlState) {
case 'disabled': case 'disabled':
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name)); fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
return es.readArray([]); return es.readArray([]);
case 'marketplace': case 'marketplace':
@@ -66,15 +67,15 @@ function syncExtension(extension, controlState) {
default: default:
if (!fs.existsSync(controlState)) { if (!fs.existsSync(controlState)) {
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`)); fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
return es.readArray([]); return es.readArray([]);
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) { } else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`)); fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
return es.readArray([]); return es.readArray([]);
} }
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎')); fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
return es.readArray([]); return es.readArray([]);
} }
} }
@@ -93,8 +94,8 @@ function writeControlFile(control) {
} }
function main() { function main() {
util.log('Syncronizing built-in extensions...'); fancyLog('Syncronizing built-in extensions...');
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`); fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
const control = readControlFile(); const control = readControlFile();
const streams = []; const streams = [];

View File

@@ -16,7 +16,8 @@ const monacodts = require("../monaco/api");
const nls = require("./nls"); const nls = require("./nls");
const reporter_1 = require("./reporter"); const reporter_1 = require("./reporter");
const util = require("./util"); const util = require("./util");
const util2 = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const watch = require('./watch'); const watch = require('./watch');
const reporter = reporter_1.createReporter(); const reporter = reporter_1.createReporter();
function getTypeScriptCompilerOptions(src) { function getTypeScriptCompilerOptions(src) {
@@ -126,6 +127,20 @@ class MonacoGenerator {
this._declarationResolver.invalidateCache(moduleId); this._declarationResolver.invalidateCache(moduleId);
this._executeSoon(); this._executeSoon();
}); });
watcher.addListener('error', (err) => {
console.error(`Encountered error while watching ${filePath}.`);
console.log(err);
delete this._watchedFiles[filePath];
for (let i = 0; i < this._watchers.length; i++) {
if (this._watchers[i] === watcher) {
this._watchers.splice(i, 1);
break;
}
}
watcher.close();
this._declarationResolver.invalidateCache(moduleId);
this._executeSoon();
});
this._watchers.push(watcher); this._watchers.push(watcher);
}; };
this._fsProvider = new class extends monacodts.FSProvider { this._fsProvider = new class extends monacodts.FSProvider {
@@ -165,7 +180,7 @@ class MonacoGenerator {
return r; return r;
} }
_log(message, ...rest) { _log(message, ...rest) {
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest); fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
} }
execute() { execute() {
const startTime = Date.now(); const startTime = Date.now();

View File

@@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api';
import * as nls from './nls'; import * as nls from './nls';
import { createReporter } from './reporter'; import { createReporter } from './reporter';
import * as util from './util'; import * as util from './util';
import * as util2 from 'gulp-util'; import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
const watch = require('./watch'); const watch = require('./watch');
const reporter = createReporter(); const reporter = createReporter();
@@ -159,6 +161,20 @@ class MonacoGenerator {
this._declarationResolver.invalidateCache(moduleId); this._declarationResolver.invalidateCache(moduleId);
this._executeSoon(); this._executeSoon();
}); });
watcher.addListener('error', (err) => {
console.error(`Encountered error while watching ${filePath}.`);
console.log(err);
delete this._watchedFiles[filePath];
for (let i = 0; i < this._watchers.length; i++) {
if (this._watchers[i] === watcher) {
this._watchers.splice(i, 1);
break;
}
}
watcher.close();
this._declarationResolver.invalidateCache(moduleId);
this._executeSoon();
});
this._watchers.push(watcher); this._watchers.push(watcher);
}; };
this._fsProvider = new class extends monacodts.FSProvider { this._fsProvider = new class extends monacodts.FSProvider {
@@ -204,7 +220,7 @@ class MonacoGenerator {
} }
private _log(message: any, ...rest: any[]): void { private _log(message: any, ...rest: any[]): void {
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest); fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
} }
public execute(): void { public execute(): void {

View File

@@ -17,7 +17,8 @@ const remote = require("gulp-remote-src");
const vzip = require('gulp-vinyl-zip'); const vzip = require('gulp-vinyl-zip');
const filter = require("gulp-filter"); const filter = require("gulp-filter");
const rename = require("gulp-rename"); const rename = require("gulp-rename");
const util = require('gulp-util'); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const buffer = require('gulp-buffer'); const buffer = require('gulp-buffer');
const json = require("gulp-json-editor"); const json = require("gulp-json-editor");
const webpack = require('webpack'); const webpack = require('webpack');
@@ -39,8 +40,19 @@ function packageBuiltInExtensions() {
.filter(({ name }) => excludedExtensions.indexOf(name) === -1) .filter(({ name }) => excludedExtensions.indexOf(name) === -1)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name)) .filter(({ name }) => builtInExtensions.every(b => b.name !== name))
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0); .filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
const visxDirectory = path.join(path.dirname(root), 'vsix');
try {
if (!fs.existsSync(visxDirectory)) {
fs.mkdirSync(visxDirectory);
}
}
catch (err) {
// don't fail the build if the output directory already exists
console.warn(err);
}
sqlBuiltInLocalExtensionDescriptions.forEach(element => { sqlBuiltInLocalExtensionDescriptions.forEach(element => {
const packagePath = path.join(path.dirname(root), element.name + '.vsix'); let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
console.info('Creating vsix for ' + element.path + ' result:' + packagePath); console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
vsce.createVSIX({ vsce.createVSIX({
cwd: element.path, cwd: element.path,
@@ -136,7 +148,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
.pipe(packageJsonFilter.restore); .pipe(packageJsonFilter.restore);
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => { const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
const webpackDone = (err, stats) => { const webpackDone = (err, stats) => {
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
if (err) { if (err) {
result.emit('error', err); result.emit('error', err);
} }
@@ -214,7 +226,7 @@ const baseHeaders = {
function fromMarketplace(extensionName, version, metadata) { function fromMarketplace(extensionName, version, metadata) {
const [publisher, name] = extensionName.split('.'); const [publisher, name] = extensionName.split('.');
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`; const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...'); fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
const options = { const options = {
base: url, base: url,
requestOptions: { requestOptions: {
@@ -236,6 +248,7 @@ exports.fromMarketplace = fromMarketplace;
const excludedExtensions = [ const excludedExtensions = [
'vscode-api-tests', 'vscode-api-tests',
'vscode-colorize-tests', 'vscode-colorize-tests',
'vscode-test-resolver',
'ms-vscode.node-debug', 'ms-vscode.node-debug',
'ms-vscode.node-debug2', 'ms-vscode.node-debug2',
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -245,14 +258,17 @@ const excludedExtensions = [
const sqlBuiltInExtensions = [ const sqlBuiltInExtensions = [
// Add SQL built-in extensions here. // Add SQL built-in extensions here.
// the extension will be excluded from SQLOps package and will have separate vsix packages // the extension will be excluded from SQLOps package and will have separate vsix packages
'admin-tool-ext-win',
'agent', 'agent',
'import', 'import',
'profiler', 'profiler',
'admin-pack', 'admin-pack',
'big-data-cluster', 'big-data-cluster',
'dacpac' 'dacpac',
'schema-compare',
'resource-deployment',
'cms'
]; ];
var azureExtensions = ['azurecore', 'mssql'];
const builtInExtensions = require('../builtInExtensions.json'); const builtInExtensions = require('../builtInExtensions.json');
/** /**
* We're doing way too much stuff at once, with webpack et al. So much stuff * We're doing way too much stuff at once, with webpack et al. So much stuff
@@ -288,8 +304,7 @@ function packageExtensionsStream(optsIn) {
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true) .filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name)) .filter(({ name }) => builtInExtensions.every(b => b.name !== name))
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1) .filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => { const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
return fromLocal(extension.path, opts.sourceMappingURLBase) return fromLocal(extension.path, opts.sourceMappingURLBase)
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`)); .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
@@ -299,9 +314,7 @@ function packageExtensionsStream(optsIn) {
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])), ..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
]; ];
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true }) const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
.pipe(filter(['**', '!**/package-lock.json'])) .pipe(filter(['**', '!**/package-lock.json']));
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
// Original code commented out here // Original code commented out here
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' }); // const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
// const marketplaceExtensions = () => es.merge( // const marketplaceExtensions = () => es.merge(

View File

@@ -17,7 +17,8 @@ import remote = require('gulp-remote-src');
const vzip = require('gulp-vinyl-zip'); const vzip = require('gulp-vinyl-zip');
import filter = require('gulp-filter'); import filter = require('gulp-filter');
import rename = require('gulp-rename'); import rename = require('gulp-rename');
const util = require('gulp-util'); import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
const buffer = require('gulp-buffer'); const buffer = require('gulp-buffer');
import json = require('gulp-json-editor'); import json = require('gulp-json-editor');
const webpack = require('webpack'); const webpack = require('webpack');
@@ -42,8 +43,18 @@ export function packageBuiltInExtensions() {
.filter(({ name }) => excludedExtensions.indexOf(name) === -1) .filter(({ name }) => excludedExtensions.indexOf(name) === -1)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name)) .filter(({ name }) => builtInExtensions.every(b => b.name !== name))
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0); .filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
const visxDirectory = path.join(path.dirname(root), 'vsix');
try {
if (!fs.existsSync(visxDirectory)) {
fs.mkdirSync(visxDirectory);
}
} catch (err) {
// don't fail the build if the output directory already exists
console.warn(err);
}
sqlBuiltInLocalExtensionDescriptions.forEach(element => { sqlBuiltInLocalExtensionDescriptions.forEach(element => {
const packagePath = path.join(path.dirname(root), element.name + '.vsix'); let pkgJson = JSON.parse(fs.readFileSync(path.join(element.path, 'package.json'), { encoding: 'utf8' }));
const packagePath = path.join(visxDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
console.info('Creating vsix for ' + element.path + ' result:' + packagePath); console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
vsce.createVSIX({ vsce.createVSIX({
cwd: element.path, cwd: element.path,
@@ -155,7 +166,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => { const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
const webpackDone = (err: any, stats: any) => { const webpackDone = (err: any, stats: any) => {
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
if (err) { if (err) {
result.emit('error', err); result.emit('error', err);
} }
@@ -249,7 +260,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
const [publisher, name] = extensionName.split('.'); const [publisher, name] = extensionName.split('.');
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`; const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...'); fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
const options = { const options = {
base: url, base: url,
@@ -282,6 +293,7 @@ interface IPackageExtensionsOptions {
const excludedExtensions = [ const excludedExtensions = [
'vscode-api-tests', 'vscode-api-tests',
'vscode-colorize-tests', 'vscode-colorize-tests',
'vscode-test-resolver',
'ms-vscode.node-debug', 'ms-vscode.node-debug',
'ms-vscode.node-debug2', 'ms-vscode.node-debug2',
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -292,14 +304,17 @@ const excludedExtensions = [
const sqlBuiltInExtensions = [ const sqlBuiltInExtensions = [
// Add SQL built-in extensions here. // Add SQL built-in extensions here.
// the extension will be excluded from SQLOps package and will have separate vsix packages // the extension will be excluded from SQLOps package and will have separate vsix packages
'admin-tool-ext-win',
'agent', 'agent',
'import', 'import',
'profiler', 'profiler',
'admin-pack', 'admin-pack',
'big-data-cluster', 'big-data-cluster',
'dacpac' 'dacpac',
'schema-compare',
'resource-deployment',
'cms'
]; ];
var azureExtensions = ['azurecore', 'mssql'];
// {{SQL CARBON EDIT}} - End // {{SQL CARBON EDIT}} - End
interface IBuiltInExtension { interface IBuiltInExtension {
@@ -348,8 +363,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true) .filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name)) .filter(({ name }) => builtInExtensions.every(b => b.name !== name))
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1) .filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => { const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
return fromLocal(extension.path, opts.sourceMappingURLBase) return fromLocal(extension.path, opts.sourceMappingURLBase)
@@ -362,9 +376,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
]; ];
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true }) const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
.pipe(filter(['**', '!**/package-lock.json'])) .pipe(filter(['**', '!**/package-lock.json']))
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
// Original code commented out here // Original code commented out here
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' }); // const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });

View File

@@ -17,14 +17,14 @@ function getVersion(repo) {
head = fs.readFileSync(headPath, 'utf8').trim(); head = fs.readFileSync(headPath, 'utf8').trim();
} }
catch (e) { catch (e) {
return void 0; return undefined;
} }
if (/^[0-9a-f]{40}$/i.test(head)) { if (/^[0-9a-f]{40}$/i.test(head)) {
return head; return head;
} }
const refMatch = /^ref: (.*)$/.exec(head); const refMatch = /^ref: (.*)$/.exec(head);
if (!refMatch) { if (!refMatch) {
return void 0; return undefined;
} }
const ref = refMatch[1]; const ref = refMatch[1];
const refPath = path.join(git, ref); const refPath = path.join(git, ref);
@@ -40,7 +40,7 @@ function getVersion(repo) {
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
} }
catch (e) { catch (e) {
return void 0; return undefined;
} }
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
let refsMatch; let refsMatch;

View File

@@ -18,7 +18,7 @@ export function getVersion(repo: string): string | undefined {
try { try {
head = fs.readFileSync(headPath, 'utf8').trim(); head = fs.readFileSync(headPath, 'utf8').trim();
} catch (e) { } catch (e) {
return void 0; return undefined;
} }
if (/^[0-9a-f]{40}$/i.test(head)) { if (/^[0-9a-f]{40}$/i.test(head)) {
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string | undefined {
const refMatch = /^ref: (.*)$/.exec(head); const refMatch = /^ref: (.*)$/.exec(head);
if (!refMatch) { if (!refMatch) {
return void 0; return undefined;
} }
const ref = refMatch[1]; const ref = refMatch[1];
@@ -46,7 +46,7 @@ export function getVersion(repo: string): string | undefined {
try { try {
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
} catch (e) { } catch (e) {
return void 0; return undefined;
} }
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;

View File

@@ -13,15 +13,16 @@ const xml2js = require("xml2js");
const glob = require("glob"); const glob = require("glob");
const https = require("https"); const https = require("https");
const gulp = require("gulp"); const gulp = require("gulp");
const util = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const iconv = require("iconv-lite"); const iconv = require("iconv-lite");
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4; const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
function log(message, ...rest) { function log(message, ...rest) {
util.log(util.colors.green('[i18n]'), message, ...rest); fancyLog(ansiColors.green('[i18n]'), message, ...rest);
} }
exports.defaultLanguages = [ exports.defaultLanguages = [
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' }, { id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' }, { id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
{ id: 'ja', folderName: 'jpn' }, { id: 'ja', folderName: 'jpn' },
{ id: 'ko', folderName: 'kor' }, { id: 'ko', folderName: 'kor' },
{ id: 'de', folderName: 'deu' }, { id: 'de', folderName: 'deu' },
@@ -371,7 +372,11 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
} }
}); });
}); });
let languageDirectory = path.join(__dirname, '..', '..', 'i18n'); let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
if (!fs.existsSync(languageDirectory)) {
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
}
let sortedLanguages = sortLanguages(languages); let sortedLanguages = sortLanguages(languages);
sortedLanguages.forEach((language) => { sortedLanguages.forEach((language) => {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
@@ -379,22 +384,25 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
} }
statistics[language.id] = 0; statistics[language.id] = 0;
let localizedModules = Object.create(null); let localizedModules = Object.create(null);
let languageFolderName = language.folderName || language.id; let languageFolderName = language.translationId || language.id;
let cwd = path.join(languageDirectory, languageFolderName, 'src'); let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
let allMessages;
if (fs.existsSync(i18nFile)) {
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
allMessages = JSON.parse(content);
}
modules.forEach((module) => { modules.forEach((module) => {
let order = keysSection[module]; let order = keysSection[module];
let i18nFile = path.join(cwd, module) + '.i18n.json'; let moduleMessage;
let messages = null; if (allMessages) {
if (fs.existsSync(i18nFile)) { moduleMessage = allMessages.contents[module];
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
messages = JSON.parse(content);
} }
else { if (!moduleMessage) {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
log(`No localized messages found for module ${module}. Using default messages.`); log(`No localized messages found for module ${module}. Using default messages.`);
} }
messages = defaultMessages[module]; moduleMessage = defaultMessages[module];
statistics[language.id] = statistics[language.id] + Object.keys(messages).length; statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
} }
let localizedMessages = []; let localizedMessages = [];
order.forEach((keyInfo) => { order.forEach((keyInfo) => {
@@ -405,7 +413,7 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
else { else {
key = keyInfo.key; key = keyInfo.key;
} }
let message = messages[key]; let message = moduleMessage[key];
if (!message) { if (!message) {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
log(`No localized message found for key ${key} in module ${module}. Using default message.`); log(`No localized message found for key ${key} in module ${module}. Using default message.`);
@@ -490,7 +498,7 @@ function getResource(sourceFile) {
else if (/^vs\/code/.test(sourceFile)) { else if (/^vs\/code/.test(sourceFile)) {
return { name: 'vs/code', project: workbenchProject }; return { name: 'vs/code', project: workbenchProject };
} }
else if (/^vs\/workbench\/parts/.test(sourceFile)) { else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
resource = sourceFile.split('/', 4).join('/'); resource = sourceFile.split('/', 4).join('/');
return { name: resource, project: workbenchProject }; return { name: resource, project: workbenchProject };
} }
@@ -578,7 +586,7 @@ function createXlfFilesForExtensions() {
} }
return _xlf; return _xlf;
} }
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(event_stream_1.through(function (file) { gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
if (file.isBuffer()) { if (file.isBuffer()) {
const buffer = file.contents; const buffer = file.contents;
const basename = path.basename(file.path); const basename = path.basename(file.path);
@@ -955,7 +963,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
return limiter.queue(() => new Promise((resolve, reject) => { return limiter.queue(() => new Promise((resolve, reject) => {
const slug = resource.name.replace(/\//g, '_'); const slug = resource.name.replace(/\//g, '_');
const project = resource.project; const project = resource.project;
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id; let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
const options = { const options = {
hostname: apiHostname, hostname: apiHostname,
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`, path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
@@ -1038,7 +1046,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
let extensionsPacks = {}; let extensionsPacks = {};
let errors = []; let errors = [];
return event_stream_1.through(function (xlf) { return event_stream_1.through(function (xlf) {
let project = path.dirname(xlf.relative); let project = path.basename(path.dirname(xlf.relative));
let resource = path.basename(xlf.relative, '.xlf'); let resource = path.basename(xlf.relative, '.xlf');
let contents = xlf.contents.toString(); let contents = xlf.contents.toString();
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents); let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);

View File

@@ -27,135 +27,159 @@
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/cli", "name": "vs/workbench/api/common",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/codeEditor", "name": "vs/workbench/contrib/cli",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/comments", "name": "vs/workbench/contrib/codeEditor",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/debug", "name": "vs/workbench/contrib/codeinset",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/emmet", "name": "vs/workbench/contrib/callHierarchy",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/execution", "name": "vs/workbench/contrib/comments",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/extensions", "name": "vs/workbench/contrib/debug",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/feedback", "name": "vs/workbench/contrib/emmet",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/files", "name": "vs/workbench/contrib/extensions",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/html", "name": "vs/workbench/contrib/externalTerminal",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/markers", "name": "vs/workbench/contrib/feedback",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/localizations", "name": "vs/workbench/contrib/files",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/logs", "name": "vs/workbench/contrib/html",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/output", "name": "vs/workbench/contrib/issue",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/performance", "name": "vs/workbench/contrib/markers",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/preferences", "name": "vs/workbench/contrib/localizations",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/quickopen", "name": "vs/workbench/contrib/logs",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/relauncher", "name": "vs/workbench/contrib/output",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/scm", "name": "vs/workbench/contrib/performance",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/search", "name": "vs/workbench/contrib/preferences",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/snippets", "name": "vs/workbench/contrib/quickopen",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/stats", "name": "vs/workbench/contrib/remote",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/surveys", "name": "vs/workbench/contrib/relauncher",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/tasks", "name": "vs/workbench/contrib/scm",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/terminal", "name": "vs/workbench/contrib/search",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/themes", "name": "vs/workbench/contrib/snippets",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/trust", "name": "vs/workbench/contrib/format",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/update", "name": "vs/workbench/contrib/stats",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/url", "name": "vs/workbench/contrib/surveys",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/watermark", "name": "vs/workbench/contrib/tasks",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/webview", "name": "vs/workbench/contrib/terminal",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/welcome", "name": "vs/workbench/contrib/themes",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/outline", "name": "vs/workbench/contrib/trust",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/update",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/url",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/watermark",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/webview",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/welcome",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/outline",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
@@ -195,13 +219,17 @@
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/services/jsonschemas", "name": "vs/workbench/services/extensionManagement",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/services/files", "name": "vs/workbench/services/files",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/integrity",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/keybinding", "name": "vs/workbench/services/keybinding",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -238,6 +266,10 @@
"name": "vs/workbench/services/decorations", "name": "vs/workbench/services/decorations",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/label",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/preferences", "name": "vs/workbench/services/preferences",
"project": "vscode-preferences" "project": "vscode-preferences"

View File

@@ -13,19 +13,19 @@ import * as xml2js from 'xml2js';
import * as glob from 'glob'; import * as glob from 'glob';
import * as https from 'https'; import * as https from 'https';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as fancyLog from 'fancy-log';
import * as util from 'gulp-util'; import * as ansiColors from 'ansi-colors';
import * as iconv from 'iconv-lite'; import * as iconv from 'iconv-lite';
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4; const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
function log(message: any, ...rest: any[]): void { function log(message: any, ...rest: any[]): void {
util.log(util.colors.green('[i18n]'), message, ...rest); fancyLog(ansiColors.green('[i18n]'), message, ...rest);
} }
export interface Language { export interface Language {
id: string; // laguage id, e.g. zh-tw, de id: string; // language id, e.g. zh-tw, de
transifexId?: string; // language id used in transifex, e.g zh-hant, de (optional, if not set, the id is used) translationId?: string; // language id used in translation tools, e.g zh-hant, de (optional, if not set, the id is used)
folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used) folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used)
} }
@@ -38,8 +38,8 @@ export interface InnoSetup {
} }
export const defaultLanguages: Language[] = [ export const defaultLanguages: Language[] = [
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' }, { id: 'zh-tw', folderName: 'cht', translationId: 'zh-hant' },
{ id: 'zh-cn', folderName: 'chs', transifexId: 'zh-hans' }, { id: 'zh-cn', folderName: 'chs', translationId: 'zh-hans' },
{ id: 'ja', folderName: 'jpn' }, { id: 'ja', folderName: 'jpn' },
{ id: 'ko', folderName: 'kor' }, { id: 'ko', folderName: 'kor' },
{ id: 'de', folderName: 'deu' }, { id: 'de', folderName: 'deu' },
@@ -144,6 +144,15 @@ interface BundledExtensionFormat {
}; };
} }
interface I18nFormat {
version: string;
contents: {
[module: string]: {
[messageKey: string]: string;
};
};
}
export class Line { export class Line {
private buffer: string[] = []; private buffer: string[] = [];
@@ -486,7 +495,11 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
}); });
}); });
let languageDirectory = path.join(__dirname, '..', '..', 'i18n'); let languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n');
if (!fs.existsSync(languageDirectory)) {
log(`No VS Code localization repository found. Looking at ${languageDirectory}`);
log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`);
}
let sortedLanguages = sortLanguages(languages); let sortedLanguages = sortLanguages(languages);
sortedLanguages.forEach((language) => { sortedLanguages.forEach((language) => {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
@@ -495,21 +508,25 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
statistics[language.id] = 0; statistics[language.id] = 0;
let localizedModules: Map<string[]> = Object.create(null); let localizedModules: Map<string[]> = Object.create(null);
let languageFolderName = language.folderName || language.id; let languageFolderName = language.translationId || language.id;
let cwd = path.join(languageDirectory, languageFolderName, 'src'); let i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json');
let allMessages: I18nFormat | undefined;
if (fs.existsSync(i18nFile)) {
let content = stripComments(fs.readFileSync(i18nFile, 'utf8'));
allMessages = JSON.parse(content);
}
modules.forEach((module) => { modules.forEach((module) => {
let order = keysSection[module]; let order = keysSection[module];
let i18nFile = path.join(cwd, module) + '.i18n.json'; let moduleMessage: { [messageKey: string]: string } | undefined;
let messages: Map<string> | null = null; if (allMessages) {
if (fs.existsSync(i18nFile)) { moduleMessage = allMessages.contents[module];
let content = stripComments(fs.readFileSync(i18nFile, 'utf8')); }
messages = JSON.parse(content); if (!moduleMessage) {
} else {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
log(`No localized messages found for module ${module}. Using default messages.`); log(`No localized messages found for module ${module}. Using default messages.`);
} }
messages = defaultMessages[module]; moduleMessage = defaultMessages[module];
statistics[language.id] = statistics[language.id] + Object.keys(messages).length; statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length;
} }
let localizedMessages: string[] = []; let localizedMessages: string[] = [];
order.forEach((keyInfo) => { order.forEach((keyInfo) => {
@@ -519,7 +536,7 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json
} else { } else {
key = keyInfo.key; key = keyInfo.key;
} }
let message: string = messages![key]; let message: string = moduleMessage![key];
if (!message) { if (!message) {
if (process.env['VSCODE_BUILD_VERBOSE']) { if (process.env['VSCODE_BUILD_VERBOSE']) {
log(`No localized message found for key ${key} in module ${module}. Using default message.`); log(`No localized message found for key ${key} in module ${module}. Using default message.`);
@@ -605,7 +622,7 @@ export function getResource(sourceFile: string): Resource {
return { name: 'vs/base', project: editorProject }; return { name: 'vs/base', project: editorProject };
} else if (/^vs\/code/.test(sourceFile)) { } else if (/^vs\/code/.test(sourceFile)) {
return { name: 'vs/code', project: workbenchProject }; return { name: 'vs/code', project: workbenchProject };
} else if (/^vs\/workbench\/parts/.test(sourceFile)) { } else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
resource = sourceFile.split('/', 4).join('/'); resource = sourceFile.split('/', 4).join('/');
return { name: resource, project: workbenchProject }; return { name: resource, project: workbenchProject };
} else if (/^vs\/workbench\/services/.test(sourceFile)) { } else if (/^vs\/workbench\/services/.test(sourceFile)) {
@@ -692,7 +709,7 @@ export function createXlfFilesForExtensions(): ThroughStream {
} }
return _xlf; return _xlf;
} }
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(through(function (file: File) { gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) {
if (file.isBuffer()) { if (file.isBuffer()) {
const buffer: Buffer = file.contents as Buffer; const buffer: Buffer = file.contents as Buffer;
const basename = path.basename(file.path); const basename = path.basename(file.path);
@@ -1093,7 +1110,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname: s
return limiter.queue(() => new Promise<File | null>((resolve, reject) => { return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
const slug = resource.name.replace(/\//g, '_'); const slug = resource.name.replace(/\//g, '_');
const project = resource.project; const project = resource.project;
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id; let transifexLanguageId = language.id === 'ps' ? 'en' : language.translationId || language.id;
const options = { const options = {
hostname: apiHostname, hostname: apiHostname,
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`, path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
@@ -1194,7 +1211,7 @@ export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingT
let extensionsPacks: Map<I18nPack> = {}; let extensionsPacks: Map<I18nPack> = {};
let errors: any[] = []; let errors: any[] = [];
return through(function (this: ThroughStream, xlf: File) { return through(function (this: ThroughStream, xlf: File) {
let project = path.dirname(xlf.relative); let project = path.basename(path.dirname(xlf.relative));
let resource = path.basename(xlf.relative, '.xlf'); let resource = path.basename(xlf.relative, '.xlf');
let contents = xlf.contents.toString(); let contents = xlf.contents.toString();
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents); let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
@@ -1361,4 +1378,4 @@ function decodeEntities(value: string): string {
function pseudify(message: string) { function pseudify(message: string) {
return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D'; return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
} }

View File

@@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap");
const sourcemaps = require("gulp-sourcemaps"); const sourcemaps = require("gulp-sourcemaps");
const uglify = require("gulp-uglify"); const uglify = require("gulp-uglify");
const composer = require("gulp-uglify/composer"); const composer = require("gulp-uglify/composer");
const gulpUtil = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const path = require("path"); const path = require("path");
const pump = require("pump"); const pump = require("pump");
const uglifyes = require("uglify-es"); const uglifyes = require("uglify-es");
@@ -24,7 +25,7 @@ const stats_1 = require("./stats");
const util = require("./util"); const util = require("./util");
const REPO_ROOT_PATH = path.join(__dirname, '../..'); const REPO_ROOT_PATH = path.join(__dirname, '../..');
function log(prefix, message) { function log(prefix, message) {
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
} }
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
function loaderConfig(emptyPaths) { function loaderConfig(emptyPaths) {
@@ -115,7 +116,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
function optimizeTask(opts) { function optimizeTask(opts) {
const src = opts.src; const src = opts.src;
const entryPoints = opts.entryPoints; const entryPoints = opts.entryPoints;
const otherSources = opts.otherSources;
const resources = opts.resources; const resources = opts.resources;
const loaderConfig = opts.loaderConfig; const loaderConfig = opts.loaderConfig;
const bundledFileHeader = opts.header; const bundledFileHeader = opts.header;
@@ -138,7 +138,7 @@ function optimizeTask(opts) {
} }
filteredResources.push('!' + resource); filteredResources.push('!' + resource);
}); });
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream); gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
const bundleInfoArray = []; const bundleInfoArray = [];
if (opts.bundleInfo) { if (opts.bundleInfo) {
bundleInfoArray.push(new VinylFile({ bundleInfoArray.push(new VinylFile({
@@ -149,20 +149,7 @@ function optimizeTask(opts) {
} }
es.readArray(bundleInfoArray).pipe(bundleInfoStream); es.readArray(bundleInfoArray).pipe(bundleInfoStream);
}); });
const otherSourcesStream = es.through(); const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
const otherSourcesStreamArr = [];
gulp.src(otherSources, { base: `${src}` })
.pipe(es.through(function (data) {
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
}, function () {
if (!otherSourcesStreamArr.length) {
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
}
else {
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
}
}));
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
return result return result
.pipe(sourcemaps.write('./', { .pipe(sourcemaps.write('./', {
sourceRoot: undefined, sourceRoot: undefined,
@@ -225,7 +212,12 @@ function minifyTask(src, sourceMapBaseUrl) {
return cb => { return cb => {
const jsFilter = filter('**/*.js', { restore: true }); const jsFilter = filter('**/*.js', { restore: true });
const cssFilter = filter('**/*.css', { restore: true }); const cssFilter = filter('**/*.css', { restore: true });
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', { pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
if (sourcePath === 'bootstrap-fork.js') {
return 'bootstrap-fork.orig.js';
}
return sourcePath;
}), sourcemaps.write('./', {
sourceMappingURL, sourceMappingURL,
sourceRoot: undefined, sourceRoot: undefined,
includeContent: true, includeContent: true,

View File

@@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap';
import * as sourcemaps from 'gulp-sourcemaps'; import * as sourcemaps from 'gulp-sourcemaps';
import * as uglify from 'gulp-uglify'; import * as uglify from 'gulp-uglify';
import * as composer from 'gulp-uglify/composer'; import * as composer from 'gulp-uglify/composer';
import * as gulpUtil from 'gulp-util'; import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
import * as path from 'path'; import * as path from 'path';
import * as pump from 'pump'; import * as pump from 'pump';
import * as sm from 'source-map'; import * as sm from 'source-map';
@@ -28,7 +29,7 @@ import * as util from './util';
const REPO_ROOT_PATH = path.join(__dirname, '../..'); const REPO_ROOT_PATH = path.join(__dirname, '../..');
function log(prefix: string, message: string): void { function log(prefix: string, message: string): void {
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
} }
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -143,10 +144,6 @@ export interface IOptimizeTaskOpts {
* (for AMD files, will get bundled and get Copyright treatment) * (for AMD files, will get bundled and get Copyright treatment)
*/ */
entryPoints: bundle.IEntryPoint[]; entryPoints: bundle.IEntryPoint[];
/**
* (for non-AMD files that should get Copyright treatment)
*/
otherSources: string[];
/** /**
* (svg, etc.) * (svg, etc.)
*/ */
@@ -177,7 +174,6 @@ export interface IOptimizeTaskOpts {
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream { export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
const src = opts.src; const src = opts.src;
const entryPoints = opts.entryPoints; const entryPoints = opts.entryPoints;
const otherSources = opts.otherSources;
const resources = opts.resources; const resources = opts.resources;
const loaderConfig = opts.loaderConfig; const loaderConfig = opts.loaderConfig;
const bundledFileHeader = opts.header; const bundledFileHeader = opts.header;
@@ -202,7 +198,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
} }
filteredResources.push('!' + resource); filteredResources.push('!' + resource);
}); });
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream); gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
const bundleInfoArray: VinylFile[] = []; const bundleInfoArray: VinylFile[] = [];
if (opts.bundleInfo) { if (opts.bundleInfo) {
@@ -215,24 +211,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
es.readArray(bundleInfoArray).pipe(bundleInfoStream); es.readArray(bundleInfoArray).pipe(bundleInfoStream);
}); });
const otherSourcesStream = es.through();
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
gulp.src(otherSources, { base: `${src}` })
.pipe(es.through(function (data) {
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
}, function () {
if (!otherSourcesStreamArr.length) {
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
} else {
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
}
}));
const result = es.merge( const result = es.merge(
loader(src, bundledFileHeader, bundleLoader), loader(src, bundledFileHeader, bundleLoader),
bundlesStream, bundlesStream,
otherSourcesStream,
resourcesStream, resourcesStream,
bundleInfoStream bundleInfoStream
); );
@@ -319,6 +300,13 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
cssFilter, cssFilter,
minifyCSS({ reduceIdents: false }), minifyCSS({ reduceIdents: false }),
cssFilter.restore, cssFilter.restore,
(<any>sourcemaps).mapSources((sourcePath: string) => {
if (sourcePath === 'bootstrap-fork.js') {
return 'bootstrap-fork.orig.js';
}
return sourcePath;
}),
sourcemaps.write('./', { sourcemaps.write('./', {
sourceMappingURL, sourceMappingURL,
sourceRoot: undefined, sourceRoot: undefined,

View File

@@ -6,7 +6,8 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const es = require("event-stream"); const es = require("event-stream");
const _ = require("underscore"); const _ = require("underscore");
const util = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const allErrors = []; const allErrors = [];
@@ -17,7 +18,7 @@ function onStart() {
return; return;
} }
startTime = new Date().getTime(); startTime = new Date().getTime();
util.log(`Starting ${util.colors.green('compilation')}...`); fancyLog(`Starting ${ansiColors.green('compilation')}...`);
} }
function onEnd() { function onEnd() {
if (--count > 0) { if (--count > 0) {
@@ -38,7 +39,7 @@ function log() {
errors.map(err => { errors.map(err => {
if (!seen.has(err)) { if (!seen.has(err)) {
seen.add(err); seen.add(err);
util.log(`${util.colors.red('Error')}: ${err}`); fancyLog(`${ansiColors.red('Error')}: ${err}`);
} }
}); });
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
@@ -53,7 +54,7 @@ function log() {
catch (err) { catch (err) {
//noop //noop
} }
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`); fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
} }
function createReporter() { function createReporter() {
const errors = []; const errors = [];

View File

@@ -7,7 +7,8 @@
import * as es from 'event-stream'; import * as es from 'event-stream';
import * as _ from 'underscore'; import * as _ from 'underscore';
import * as util from 'gulp-util'; import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
@@ -21,7 +22,7 @@ function onStart(): void {
} }
startTime = new Date().getTime(); startTime = new Date().getTime();
util.log(`Starting ${util.colors.green('compilation')}...`); fancyLog(`Starting ${ansiColors.green('compilation')}...`);
} }
function onEnd(): void { function onEnd(): void {
@@ -47,7 +48,7 @@ function log(): void {
errors.map(err => { errors.map(err => {
if (!seen.has(err)) { if (!seen.has(err)) {
seen.add(err); seen.add(err);
util.log(`${util.colors.red('Error')}: ${err}`); fancyLog(`${ansiColors.red('Error')}: ${err}`);
} }
}); });
@@ -65,7 +66,7 @@ function log(): void {
//noop //noop
} }
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`); fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
} }
export interface IReporter { export interface IReporter {

View File

@@ -27,7 +27,7 @@ function writeFile(filePath, contents) {
fs.writeFileSync(filePath, contents); fs.writeFileSync(filePath, contents);
} }
function extractEditor(options) { function extractEditor(options) {
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString()); const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
let compilerOptions; let compilerOptions;
if (tsConfig.extends) { if (tsConfig.extends) {
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions); compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
@@ -36,13 +36,12 @@ function extractEditor(options) {
compilerOptions = tsConfig.compilerOptions; compilerOptions = tsConfig.compilerOptions;
} }
tsConfig.compilerOptions = compilerOptions; tsConfig.compilerOptions = compilerOptions;
compilerOptions.noEmit = false;
compilerOptions.noUnusedLocals = false; compilerOptions.noUnusedLocals = false;
compilerOptions.preserveConstEnums = false; compilerOptions.preserveConstEnums = false;
compilerOptions.declaration = false; compilerOptions.declaration = false;
compilerOptions.noImplicitAny = false;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic; compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
delete compilerOptions.types;
delete tsConfig.extends;
tsConfig.exclude = [];
options.compilerOptions = compilerOptions; options.compilerOptions = compilerOptions;
let result = tss.shake(options); let result = tss.shake(options);
for (let fileName in result) { for (let fileName in result) {
@@ -92,6 +91,8 @@ function extractEditor(options) {
} }
delete tsConfig.compilerOptions.moduleResolution; delete tsConfig.compilerOptions.moduleResolution;
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t')); writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
[ [
'vs/css.build.js', 'vs/css.build.js',
'vs/css.d.ts', 'vs/css.d.ts',
@@ -119,8 +120,7 @@ function createESMSourcesAndResources2(options) {
return path.join(OUT_RESOURCES_FOLDER, dest); return path.join(OUT_RESOURCES_FOLDER, dest);
}; };
const allFiles = walkDirRecursive(SRC_FOLDER); const allFiles = walkDirRecursive(SRC_FOLDER);
for (let i = 0; i < allFiles.length; i++) { for (const file of allFiles) {
const file = allFiles[i];
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) { if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
continue; continue;
} }

View File

@@ -31,7 +31,7 @@ function writeFile(filePath: string, contents: Buffer | string): void {
} }
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void { export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString()); const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
let compilerOptions: { [key: string]: any }; let compilerOptions: { [key: string]: any };
if (tsConfig.extends) { if (tsConfig.extends) {
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions); compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
@@ -40,14 +40,13 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
} }
tsConfig.compilerOptions = compilerOptions; tsConfig.compilerOptions = compilerOptions;
compilerOptions.noEmit = false;
compilerOptions.noUnusedLocals = false; compilerOptions.noUnusedLocals = false;
compilerOptions.preserveConstEnums = false; compilerOptions.preserveConstEnums = false;
compilerOptions.declaration = false; compilerOptions.declaration = false;
compilerOptions.noImplicitAny = false;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic; compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
delete compilerOptions.types;
delete tsConfig.extends;
tsConfig.exclude = [];
options.compilerOptions = compilerOptions; options.compilerOptions = compilerOptions;
@@ -101,6 +100,8 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
delete tsConfig.compilerOptions.moduleResolution; delete tsConfig.compilerOptions.moduleResolution;
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t')); writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
[ [
'vs/css.build.js', 'vs/css.build.js',
@@ -139,8 +140,7 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
}; };
const allFiles = walkDirRecursive(SRC_FOLDER); const allFiles = walkDirRecursive(SRC_FOLDER);
for (let i = 0; i < allFiles.length; i++) { for (const file of allFiles) {
const file = allFiles[i];
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) { if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
continue; continue;
@@ -244,7 +244,6 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
let mode = 0; let mode = 0;
for (let i = 0; i < lines.length; i++) { for (let i = 0; i < lines.length; i++) {
const line = lines[i]; const line = lines[i];
if (mode === 0) { if (mode === 0) {
if (/\/\/ ESM-comment-begin/.test(line)) { if (/\/\/ ESM-comment-begin/.test(line)) {
mode = 1; mode = 1;

View File

@@ -5,7 +5,8 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const es = require("event-stream"); const es = require("event-stream");
const util = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const appInsights = require("applicationinsights"); const appInsights = require("applicationinsights");
class Entry { class Entry {
constructor(name, totalCount, totalSize) { constructor(name, totalCount, totalSize) {
@@ -24,13 +25,13 @@ class Entry {
} }
else { else {
if (this.totalCount === 1) { if (this.totalCount === 1) {
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
} }
else { else {
const count = this.totalCount < 100 const count = this.totalCount < 100
? util.colors.green(this.totalCount.toString()) ? ansiColors.green(this.totalCount.toString())
: util.colors.red(this.totalCount.toString()); : ansiColors.red(this.totalCount.toString());
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
} }
} }
} }
@@ -57,13 +58,13 @@ function createStatsStream(group, log) {
}, function () { }, function () {
if (log) { if (log) {
if (entry.totalCount === 1) { if (entry.totalCount === 1) {
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
} }
else { else {
const count = entry.totalCount < 100 const count = entry.totalCount < 100
? util.colors.green(entry.totalCount.toString()) ? ansiColors.green(entry.totalCount.toString())
: util.colors.red(entry.totalCount.toString()); : ansiColors.red(entry.totalCount.toString());
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
} }
} }
this.emit('end'); this.emit('end');

View File

@@ -6,7 +6,8 @@
'use strict'; 'use strict';
import * as es from 'event-stream'; import * as es from 'event-stream';
import * as util from 'gulp-util'; import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
import * as File from 'vinyl'; import * as File from 'vinyl';
import * as appInsights from 'applicationinsights'; import * as appInsights from 'applicationinsights';
@@ -22,14 +23,14 @@ class Entry {
} }
} else { } else {
if (this.totalCount === 1) { if (this.totalCount === 1) {
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
} else { } else {
const count = this.totalCount < 100 const count = this.totalCount < 100
? util.colors.green(this.totalCount.toString()) ? ansiColors.green(this.totalCount.toString())
: util.colors.red(this.totalCount.toString()); : ansiColors.red(this.totalCount.toString());
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
} }
} }
} }
@@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
}, function () { }, function () {
if (log) { if (log) {
if (entry.totalCount === 1) { if (entry.totalCount === 1) {
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
} else { } else {
const count = entry.totalCount < 100 const count = entry.totalCount < 100
? util.colors.green(entry.totalCount.toString()) ? ansiColors.green(entry.totalCount.toString())
: util.colors.red(entry.totalCount.toString()); : ansiColors.red(entry.totalCount.toString());
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
} }
} }

96
build/lib/task.js Normal file
View File

@@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
function _isPromise(p) {
if (typeof p.then === 'function') {
return true;
}
return false;
}
function _renderTime(time) {
return `${Math.round(time)} ms`;
}
async function _execute(task) {
const name = task.taskName || task.displayName || `<anonymous>`;
if (!task._tasks) {
fancyLog('Starting', ansiColors.cyan(name), '...');
}
const startTime = process.hrtime();
await _doExecute(task);
const elapsedArr = process.hrtime(startTime);
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
if (!task._tasks) {
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
}
}
async function _doExecute(task) {
// Always invoke as if it were a callback task
return new Promise((resolve, reject) => {
if (task.length === 1) {
// this is a callback task
task((err) => {
if (err) {
return reject(err);
}
resolve();
});
return;
}
const taskResult = task();
if (typeof taskResult === 'undefined') {
// this is a sync task
resolve();
return;
}
if (_isPromise(taskResult)) {
// this is a promise returning task
taskResult.then(resolve, reject);
return;
}
// this is a stream returning task
taskResult.on('end', _ => resolve());
taskResult.on('error', err => reject(err));
});
}
function series(...tasks) {
const result = async () => {
for (let i = 0; i < tasks.length; i++) {
await _execute(tasks[i]);
}
};
result._tasks = tasks;
return result;
}
exports.series = series;
function parallel(...tasks) {
const result = async () => {
await Promise.all(tasks.map(t => _execute(t)));
};
result._tasks = tasks;
return result;
}
exports.parallel = parallel;
function define(name, task) {
if (task._tasks) {
// This is a composite task
const lastTask = task._tasks[task._tasks.length - 1];
if (lastTask._tasks || lastTask.taskName) {
// This is a composite task without a real task function
// => generate a fake task function
return define(name, series(task, () => Promise.resolve()));
}
lastTask.taskName = name;
task.displayName = name;
return task;
}
// This is a simple task
task.taskName = name;
task.displayName = name;
return task;
}
exports.define = define;

125
build/lib/task.ts Normal file
View File

@@ -0,0 +1,125 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
export interface BaseTask {
displayName?: string;
taskName?: string;
_tasks?: Task[];
}
export interface PromiseTask extends BaseTask {
(): Promise<void>;
}
export interface StreamTask extends BaseTask {
(): NodeJS.ReadWriteStream;
}
export interface CallbackTask extends BaseTask {
(cb?: (err?: any) => void): void;
}
export type Task = PromiseTask | StreamTask | CallbackTask;
function _isPromise(p: Promise<void> | NodeJS.ReadWriteStream): p is Promise<void> {
if (typeof (<any>p).then === 'function') {
return true;
}
return false;
}
function _renderTime(time: number): string {
return `${Math.round(time)} ms`;
}
async function _execute(task: Task): Promise<void> {
const name = task.taskName || task.displayName || `<anonymous>`;
if (!task._tasks) {
fancyLog('Starting', ansiColors.cyan(name), '...');
}
const startTime = process.hrtime();
await _doExecute(task);
const elapsedArr = process.hrtime(startTime);
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
if (!task._tasks) {
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
}
}
async function _doExecute(task: Task): Promise<void> {
// Always invoke as if it were a callback task
return new Promise((resolve, reject) => {
if (task.length === 1) {
// this is a callback task
task((err) => {
if (err) {
return reject(err);
}
resolve();
});
return;
}
const taskResult = task();
if (typeof taskResult === 'undefined') {
// this is a sync task
resolve();
return;
}
if (_isPromise(taskResult)) {
// this is a promise returning task
taskResult.then(resolve, reject);
return;
}
// this is a stream returning task
taskResult.on('end', _ => resolve());
taskResult.on('error', err => reject(err));
});
}
export function series(...tasks: Task[]): PromiseTask {
const result = async () => {
for (let i = 0; i < tasks.length; i++) {
await _execute(tasks[i]);
}
};
result._tasks = tasks;
return result;
}
export function parallel(...tasks: Task[]): PromiseTask {
const result = async () => {
await Promise.all(tasks.map(t => _execute(t)));
};
result._tasks = tasks;
return result;
}
export function define(name: string, task: Task): Task {
if (task._tasks) {
// This is a composite task
const lastTask = task._tasks[task._tasks.length - 1];
if (lastTask._tasks || lastTask.taskName) {
// This is a composite task without a real task function
// => generate a fake task function
return define(name, series(task, () => Promise.resolve()));
}
lastTask.taskName = name;
task.displayName = name;
return task;
}
// This is a simple task
task.taskName = name;
task.displayName = name;
return task;
}

View File

@@ -27,13 +27,13 @@ suite('XLF Parser Tests', () => {
}); });
test('JSON file source path to Transifex resource match', () => { test('JSON file source path to Transifex resource match', () => {
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench'; const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject }; const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
}); });

View File

@@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => {
editor = { name: 'vs/editor', project: editorProject }, editor = { name: 'vs/editor', project: editorProject },
base = { name: 'vs/base', project: editorProject }, base = { name: 'vs/base', project: editorProject },
code = { name: 'vs/code', project: workbenchProject }, code = { name: 'vs/code', project: workbenchProject },
workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
workbench = { name: 'vs/workbench', project: workbenchProject}; workbench = { name: 'vs/workbench', project: workbenchProject};
@@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => {
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
}); });

View File

@@ -15,8 +15,7 @@ var ShakeLevel;
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers"; ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {})); })(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
function printDiagnostics(diagnostics) { function printDiagnostics(diagnostics) {
for (let i = 0; i < diagnostics.length; i++) { for (const diag of diagnostics) {
const diag = diagnostics[i];
let result = ''; let result = '';
if (diag.file) { if (diag.file) {
result += `${diag.file.fileName}: `; result += `${diag.file.fileName}: `;
@@ -97,6 +96,11 @@ function discoverAndReadFiles(options) {
FILES[`${moduleId}.d.ts`] = dts_filecontents; FILES[`${moduleId}.d.ts`] = dts_filecontents;
continue; continue;
} }
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
if (fs.existsSync(js_filename)) {
// This is an import for a .js file, so ignore it...
continue;
}
let ts_filename; let ts_filename;
if (options.redirects[moduleId]) { if (options.redirects[moduleId]) {
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts'); ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
@@ -475,8 +479,7 @@ function generateResult(languageService, shakeLevel) {
} }
else { else {
let survivingImports = []; let survivingImports = [];
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) { for (const importNode of node.importClause.namedBindings.elements) {
const importNode = node.importClause.namedBindings.elements[i];
if (getColor(importNode) === 2 /* Black */) { if (getColor(importNode) === 2 /* Black */) {
survivingImports.push(importNode.getFullText(sourceFile)); survivingImports.push(importNode.getFullText(sourceFile));
} }

View File

@@ -61,15 +61,14 @@ export interface ITreeShakingResult {
} }
function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void { function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
for (let i = 0; i < diagnostics.length; i++) { for (const diag of diagnostics) {
const diag = diagnostics[i];
let result = ''; let result = '';
if (diag.file) { if (diag.file) {
result += `${diag.file.fileName}: `; result += `${diag.file.fileName}: `;
} }
if (diag.file && diag.start) { if (diag.file && diag.start) {
let location = diag.file.getLineAndCharacterOfPosition(diag.start); let location = diag.file.getLineAndCharacterOfPosition(diag.start);
result += `- ${location.line + 1},${location.character} - ` result += `- ${location.line + 1},${location.character} - `;
} }
result += JSON.stringify(diag.messageText); result += JSON.stringify(diag.messageText);
console.log(result); console.log(result);
@@ -160,6 +159,12 @@ function discoverAndReadFiles(options: ITreeShakingOptions): IFileMap {
continue; continue;
} }
const js_filename = path.join(options.sourcesRoot, moduleId + '.js');
if (fs.existsSync(js_filename)) {
// This is an import for a .js file, so ignore it...
continue;
}
let ts_filename: string; let ts_filename: string;
if (options.redirects[moduleId]) { if (options.redirects[moduleId]) {
ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts'); ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts');
@@ -459,7 +464,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
} }
if (black_queue.length === 0) { if (black_queue.length === 0) {
for (let i = 0; i < gray_queue.length; i++) { for (let i = 0; i< gray_queue.length; i++) {
const node = gray_queue[i]; const node = gray_queue[i];
const nodeParent = node.parent; const nodeParent = node.parent;
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) { if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
@@ -604,8 +609,7 @@ function generateResult(languageService: ts.LanguageService, shakeLevel: ShakeLe
} }
} else { } else {
let survivingImports: string[] = []; let survivingImports: string[] = [];
for (let i = 0; i < node.importClause.namedBindings.elements.length; i++) { for (const importNode of node.importClause.namedBindings.elements) {
const importNode = node.importClause.namedBindings.elements[i];
if (getColor(importNode) === NodeColor.Black) { if (getColor(importNode) === NodeColor.Black) {
survivingImports.push(importNode.getFullText(sourceFile)); survivingImports.push(importNode.getFullText(sourceFile));
} }

View File

@@ -0,0 +1,54 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const Lint = require("tslint");
const path_1 = require("path");
class Rule extends Lint.Rules.AbstractRule {
apply(sourceFile) {
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)) {
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
}
return [];
}
}
exports.Rule = Rule;
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
constructor(file, opts) {
super(file, opts);
}
visitImportEqualsDeclaration(node) {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
}
visitImportDeclaration(node) {
this._validateImport(node.moduleSpecifier.getText(), node);
}
visitCallExpression(node) {
super.visitCallExpression(node);
// import('foo') statements inside the code
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
const [path] = node.arguments;
this._validateImport(path.getText(), node);
}
}
_validateImport(path, node) {
// remove quotes
path = path.slice(1, -1);
// resolve relative paths
if (path[0] === '.') {
path = path_1.join(this.getSourceFile().fileName, path);
}
if (/vs(\/|\\)nls/.test(path)) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
}
}
}

View File

@@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
import { join } from 'path';
export class Rule extends Lint.Rules.AbstractRule {
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
if (
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(sourceFile.fileName)
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(sourceFile.fileName)
) {
return this.applyWithWalker(new NoNlsInStandaloneEditorRuleWalker(sourceFile, this.getOptions()));
}
return [];
}
}
class NoNlsInStandaloneEditorRuleWalker extends Lint.RuleWalker {
constructor(file: ts.SourceFile, opts: Lint.IOptions) {
super(file, opts);
}
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
}
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
this._validateImport(node.moduleSpecifier.getText(), node);
}
protected visitCallExpression(node: ts.CallExpression): void {
super.visitCallExpression(node);
// import('foo') statements inside the code
if (node.expression.kind === ts.SyntaxKind.ImportKeyword) {
const [path] = node.arguments;
this._validateImport(path.getText(), node);
}
}
private _validateImport(path: string, node: ts.Node): void {
// remove quotes
path = path.slice(1, -1);
// resolve relative paths
if (path[0] === '.') {
path = join(this.getSourceFile().fileName, path);
}
if (
/vs(\/|\\)nls/.test(path)
) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts`));
}
}
}

View File

@@ -45,8 +45,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
if (path[0] === '.') { if (path[0] === '.') {
path = path_1.join(this.getSourceFile().fileName, path); path = path_1.join(this.getSourceFile().fileName, path);
} }
if (/vs(\/|\\)editor(\/|\\)standalone/.test(path) if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path) || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path) || /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path) || /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) { || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {

View File

@@ -54,8 +54,8 @@ class NoStandaloneEditorRuleWalker extends Lint.RuleWalker {
} }
if ( if (
/vs(\/|\\)editor(\/|\\)standalone/.test(path) /vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path) || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path) || /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path) || /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path) || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)

View File

@@ -109,8 +109,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
} }
else if (isObjectLiteral(keyArg)) { else if (isObjectLiteral(keyArg)) {
for (let i = 0; i < keyArg.properties.length; i++) { for (const property of keyArg.properties) {
const property = keyArg.properties[i];
if (isPropertyAssignment(property)) { if (isPropertyAssignment(property)) {
const name = property.name.getText(); const name = property.name.getText();
if (name === 'key') { if (name === 'key') {

View File

@@ -148,8 +148,7 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
if (isStringLiteral(keyArg)) { if (isStringLiteral(keyArg)) {
this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined); this.recordKey(keyArg, this.messageIndex && callInfo ? callInfo.callExpression.arguments[this.messageIndex] : undefined);
} else if (isObjectLiteral(keyArg)) { } else if (isObjectLiteral(keyArg)) {
for (let i = 0; i < keyArg.properties.length; i++) { for (const property of keyArg.properties) {
const property = keyArg.properties[i];
if (isPropertyAssignment(property)) { if (isPropertyAssignment(property)) {
const name = property.name.getText(); const name = property.name.getText();
if (name === 'key') { if (name === 'key') {

View File

@@ -33,7 +33,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
visitImportLikeDeclaration(node) { visitImportLikeDeclaration(node) {
const currentFile = node.getSourceFile().fileName; const currentFile = node.getSourceFile().fileName;
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/); const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
if (!matchService && !matchPart) { if (!matchService && !matchPart) {
return; return;
} }

View File

@@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) { private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
const currentFile = node.getSourceFile().fileName; const currentFile = node.getSourceFile().fileName;
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/); const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
if (!matchService && !matchPart) { if (!matchService && !matchPart) {
return; return;
} }

View File

@@ -8,12 +8,13 @@ const es = require("event-stream");
const debounce = require("debounce"); const debounce = require("debounce");
const _filter = require("gulp-filter"); const _filter = require("gulp-filter");
const rename = require("gulp-rename"); const rename = require("gulp-rename");
const _ = require("underscore");
const path = require("path"); const path = require("path");
const fs = require("fs"); const fs = require("fs");
const _rimraf = require("rimraf"); const _rimraf = require("rimraf");
const git = require("./git"); const git = require("./git");
const VinylFile = require("vinyl"); const VinylFile = require("vinyl");
const download_1 = require("../download/download");
const REPO_ROOT = path.join(__dirname, '../../');
const NoCancellationToken = { isCancellationRequested: () => false }; const NoCancellationToken = { isCancellationRequested: () => false };
function incremental(streamProvider, initial, supportsCancellation) { function incremental(streamProvider, initial, supportsCancellation) {
const input = es.through(); const input = es.through();
@@ -98,22 +99,18 @@ function skipDirectories() {
}); });
} }
exports.skipDirectories = skipDirectories; exports.skipDirectories = skipDirectories;
function cleanNodeModule(name, excludes, includes) { function cleanNodeModules(rulePath) {
const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : ''); const rules = fs.readFileSync(rulePath, 'utf8')
const negate = (str) => '!' + str; .split(/\r?\n/g)
const allFilter = _filter(toGlob('**'), { restore: true }); .map(line => line.trim())
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); .filter(line => line && !/^#/.test(line));
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
const input = es.through(); const input = es.through();
const nodeModuleInput = input.pipe(allFilter); const output = es.merge(input.pipe(_filter(['**', ...excludes])), input.pipe(_filter(includes)));
let output = nodeModuleInput.pipe(_filter(globs));
if (includes) {
const includeGlobs = includes.map(toGlob);
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
}
output = output.pipe(allFilter.restore);
return es.duplex(input, output); return es.duplex(input, output);
} }
exports.cleanNodeModule = cleanNodeModule; exports.cleanNodeModules = cleanNodeModules;
function loadSourcemaps() { function loadSourcemaps() {
const input = es.through(); const input = es.through();
const output = input const output = input
@@ -180,7 +177,8 @@ function rimraf(dir) {
return cb(err); return cb(err);
}); });
}; };
return cb => retry(cb); retry.taskName = `clean-${path.basename(dir)}`;
return retry;
} }
exports.rimraf = rimraf; exports.rimraf = rimraf;
function getVersion(root) { function getVersion(root) {
@@ -220,3 +218,38 @@ function versionStringToNumber(versionStr) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10); return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
} }
exports.versionStringToNumber = versionStringToNumber; exports.versionStringToNumber = versionStringToNumber;
function download(requestOptions) {
const result = es.through();
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
const opts = {
requestOptions: requestOptions,
destinationPath: filename
};
download_1.downloadInExternalProcess(opts).then(() => {
fs.stat(filename, (err, stat) => {
if (err) {
result.emit('error', err);
return;
}
fs.readFile(filename, (err, data) => {
if (err) {
result.emit('error', err);
return;
}
fs.unlink(filename, () => {
result.emit('data', new VinylFile({
path: path.normalize(requestOptions.path),
stat: stat,
base: path.normalize(requestOptions.path),
contents: data
}));
result.emit('end');
});
});
});
}, (err) => {
result.emit('error', err);
});
return result;
}
exports.download = download;

View File

@@ -17,6 +17,9 @@ import * as git from './git';
import * as VinylFile from 'vinyl'; import * as VinylFile from 'vinyl';
import { ThroughStream } from 'through'; import { ThroughStream } from 'through';
import * as sm from 'source-map'; import * as sm from 'source-map';
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
const REPO_ROOT = path.join(__dirname, '../../');
export interface ICancellationToken { export interface ICancellationToken {
isCancellationRequested(): boolean; isCancellationRequested(): boolean;
@@ -129,23 +132,21 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
}); });
} }
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream { export function cleanNodeModules(rulePath: string): NodeJS.ReadWriteStream {
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); const rules = fs.readFileSync(rulePath, 'utf8')
const negate = (str: string) => '!' + str; .split(/\r?\n/g)
.map(line => line.trim())
.filter(line => line && !/^#/.test(line));
const allFilter = _filter(toGlob('**'), { restore: true }); const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob) as (x: string) => string)); const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
const input = es.through(); const input = es.through();
const nodeModuleInput = input.pipe(allFilter); const output = es.merge(
let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs)); input.pipe(_filter(['**', ...excludes])),
input.pipe(_filter(includes))
);
if (includes) {
const includeGlobs = includes.map(toGlob);
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
}
output = output.pipe(allFilter.restore);
return es.duplex(input, output); return es.duplex(input, output);
} }
@@ -233,8 +234,8 @@ export function rimraf(dir: string): (cb: any) => void {
return cb(err); return cb(err);
}); });
}; };
retry.taskName = `clean-${path.basename(dir)}`;
return cb => retry(cb); return retry;
} }
export function getVersion(root: string): string | undefined { export function getVersion(root: string): string | undefined {
@@ -280,3 +281,38 @@ export function versionStringToNumber(versionStr: string) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10); return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
} }
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
const result = es.through();
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
const opts: IDownloadOptions = {
requestOptions: requestOptions,
destinationPath: filename
};
downloadInExternalProcess(opts).then(() => {
fs.stat(filename, (err, stat) => {
if (err) {
result.emit('error', err);
return;
}
fs.readFile(filename, (err, data) => {
if (err) {
result.emit('error', err);
return;
}
fs.unlink(filename, () => {
result.emit('data', new VinylFile({
path: path.normalize(requestOptions.path),
stat: stat,
base: path.normalize(requestOptions.path),
contents: data
}));
result.emit('end');
});
});
});
}, (err) => {
result.emit('error', err);
});
return result;
}

View File

@@ -17,7 +17,7 @@ function handleDeletions() {
}); });
} }
let watch = void 0; let watch = undefined;
if (!watch) { if (!watch) {
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch'); watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');

View File

@@ -7,23 +7,54 @@ herein, whether by implication, estoppel or otherwise.
%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158)
%% winjs version 4.4.0 (https://github.com/winjs/winjs)
========================================= =========================================
WinJS Copyright Joyent, Inc. and other Node contributors.
Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
All rights reserved. The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
MIT License THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF nodejs path library NOTICES AND INFORMATION
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. %% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
=========================================
Copyright (c) 2014 Taylor Hakes
Copyright (c) 2014 Forbes Lindesay
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
========================================= =========================================
END OF winjs NOTICES AND INFORMATION END OF winjs NOTICES AND INFORMATION

View File

@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs"); const fs = require("fs");
const ts = require("typescript"); const ts = require("typescript");
const path = require("path"); const path = require("path");
const util = require("gulp-util"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const dtsv = '2'; const dtsv = '2';
const tsfmt = require('../../tsfmt.json'); const tsfmt = require('../../tsfmt.json');
const SRC = path.join(__dirname, '../../src'); const SRC = path.join(__dirname, '../../src');
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
function logErr(message, ...rest) { function logErr(message, ...rest) {
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest); fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
} }
function isDeclaration(a) { function isDeclaration(a) {
return (a.kind === ts.SyntaxKind.InterfaceDeclaration return (a.kind === ts.SyntaxKind.InterfaceDeclaration
@@ -456,11 +457,20 @@ class FSProvider {
existsSync(filePath) { existsSync(filePath) {
return fs.existsSync(filePath); return fs.existsSync(filePath);
} }
statSync(filePath) {
return fs.statSync(filePath);
}
readFileSync(_moduleId, filePath) { readFileSync(_moduleId, filePath) {
return fs.readFileSync(filePath); return fs.readFileSync(filePath);
} }
} }
exports.FSProvider = FSProvider; exports.FSProvider = FSProvider;
class CacheEntry {
constructor(sourceFile, mtime) {
this.sourceFile = sourceFile;
this.mtime = mtime;
}
}
class DeclarationResolver { class DeclarationResolver {
constructor(_fsProvider) { constructor(_fsProvider) {
this._fsProvider = _fsProvider; this._fsProvider = _fsProvider;
@@ -470,31 +480,43 @@ class DeclarationResolver {
this._sourceFileCache[moduleId] = null; this._sourceFileCache[moduleId] = null;
} }
getDeclarationSourceFile(moduleId) { getDeclarationSourceFile(moduleId) {
if (this._sourceFileCache[moduleId]) {
// Since we cannot trust file watching to invalidate the cache, check also the mtime
const fileName = this._getFileName(moduleId);
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
if (this._sourceFileCache[moduleId].mtime !== mtime) {
this._sourceFileCache[moduleId] = null;
}
}
if (!this._sourceFileCache[moduleId]) { if (!this._sourceFileCache[moduleId]) {
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId); this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
} }
return this._sourceFileCache[moduleId]; return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId].sourceFile : null;
}
_getFileName(moduleId) {
if (/\.d\.ts$/.test(moduleId)) {
return path.join(SRC, moduleId);
}
return path.join(SRC, `${moduleId}.ts`);
} }
_getDeclarationSourceFile(moduleId) { _getDeclarationSourceFile(moduleId) {
if (/\.d\.ts$/.test(moduleId)) { const fileName = this._getFileName(moduleId);
const fileName = path.join(SRC, moduleId);
if (!this._fsProvider.existsSync(fileName)) {
return null;
}
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
}
const fileName = path.join(SRC, `${moduleId}.ts`);
if (!this._fsProvider.existsSync(fileName)) { if (!this._fsProvider.existsSync(fileName)) {
return null; return null;
} }
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
if (/\.d\.ts$/.test(moduleId)) {
// const mtime = this._fsProvider.statFileSync()
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
return new CacheEntry(ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5), mtime);
}
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString(); const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
const fileMap = { const fileMap = {
'file.ts': fileContents 'file.ts': fileContents
}; };
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {})); const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text; const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5); return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime);
} }
} }
exports.DeclarationResolver = DeclarationResolver; exports.DeclarationResolver = DeclarationResolver;

View File

@@ -6,7 +6,8 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as ts from 'typescript'; import * as ts from 'typescript';
import * as path from 'path'; import * as path from 'path';
import * as util from 'gulp-util'; import * as fancyLog from 'fancy-log';
import * as ansiColors from 'ansi-colors';
const dtsv = '2'; const dtsv = '2';
@@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
function logErr(message: any, ...rest: any[]): void { function logErr(message: any, ...rest: any[]): void {
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest); fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
} }
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null; type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
@@ -547,14 +548,24 @@ export class FSProvider {
public existsSync(filePath: string): boolean { public existsSync(filePath: string): boolean {
return fs.existsSync(filePath); return fs.existsSync(filePath);
} }
public statSync(filePath: string): fs.Stats {
return fs.statSync(filePath);
}
public readFileSync(_moduleId: string, filePath: string): Buffer { public readFileSync(_moduleId: string, filePath: string): Buffer {
return fs.readFileSync(filePath); return fs.readFileSync(filePath);
} }
} }
class CacheEntry {
constructor(
public readonly sourceFile: ts.SourceFile,
public readonly mtime: number
) {}
}
export class DeclarationResolver { export class DeclarationResolver {
private _sourceFileCache: { [moduleId: string]: ts.SourceFile | null; }; private _sourceFileCache: { [moduleId: string]: CacheEntry | null; };
constructor(private readonly _fsProvider: FSProvider) { constructor(private readonly _fsProvider: FSProvider) {
this._sourceFileCache = Object.create(null); this._sourceFileCache = Object.create(null);
@@ -565,32 +576,51 @@ export class DeclarationResolver {
} }
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null { public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
if (this._sourceFileCache[moduleId]) {
// Since we cannot trust file watching to invalidate the cache, check also the mtime
const fileName = this._getFileName(moduleId);
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
if (this._sourceFileCache[moduleId]!.mtime !== mtime) {
this._sourceFileCache[moduleId] = null;
}
}
if (!this._sourceFileCache[moduleId]) { if (!this._sourceFileCache[moduleId]) {
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId); this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
} }
return this._sourceFileCache[moduleId]; return this._sourceFileCache[moduleId] ? this._sourceFileCache[moduleId]!.sourceFile : null;
} }
private _getDeclarationSourceFile(moduleId: string): ts.SourceFile | null { private _getFileName(moduleId: string): string {
if (/\.d\.ts$/.test(moduleId)) { if (/\.d\.ts$/.test(moduleId)) {
const fileName = path.join(SRC, moduleId); return path.join(SRC, moduleId);
if (!this._fsProvider.existsSync(fileName)) {
return null;
}
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
} }
const fileName = path.join(SRC, `${moduleId}.ts`); return path.join(SRC, `${moduleId}.ts`);
}
private _getDeclarationSourceFile(moduleId: string): CacheEntry | null {
const fileName = this._getFileName(moduleId);
if (!this._fsProvider.existsSync(fileName)) { if (!this._fsProvider.existsSync(fileName)) {
return null; return null;
} }
const mtime = this._fsProvider.statSync(fileName).mtime.getTime();
if (/\.d\.ts$/.test(moduleId)) {
// const mtime = this._fsProvider.statFileSync()
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
return new CacheEntry(
ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5),
mtime
);
}
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString(); const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
const fileMap: IFileMap = { const fileMap: IFileMap = {
'file.ts': fileContents 'file.ts': fileContents
}; };
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {})); const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text; const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5); return new CacheEntry(
ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5),
mtime
);
} }
} }

View File

@@ -21,12 +21,11 @@ declare namespace monaco {
export class Emitter<T> { export class Emitter<T> {
constructor(); constructor();
readonly event: Event<T>; readonly event: Event<T>;
fire(event?: T): void; fire(event: T): void;
dispose(): void; dispose(): void;
} }
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity #include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
#include(vs/base/common/winjs.base.d.ts): Promise
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken #include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
#include(vs/base/common/uri): URI, UriComponents #include(vs/base/common/uri): URI, UriComponents
#include(vs/base/common/keyCodes): KeyCode #include(vs/base/common/keyCodes): KeyCode
@@ -86,4 +85,4 @@ declare namespace monaco.worker {
} }
//dtsv=2 //dtsv=2

View File

@@ -10,9 +10,10 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker'; import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker'; import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget'; import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService';
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors'; import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
import { PolyfillPromise } from './vs/base/common/winjs.polyfill.promise';
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator'; import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
import { DocumentRangeFormattingEditProvider } from './vs/editor/common/modes';
import * as editorAPI from './vs/editor/editor.api'; import * as editorAPI from './vs/editor/editor.api';
(function () { (function () {
@@ -23,6 +24,7 @@ import * as editorAPI from './vs/editor/editor.api';
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
a = (<CountBadge>b).style; // IThemable a = (<CountBadge>b).style; // IThemable
a = (<QuickOpenWidget>b).style; // IThemable a = (<QuickOpenWidget>b).style; // IThemable
a = (<WorkbenchAsyncDataTree<any,any>>b).style; // IThemable
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
a = (<DiffNavigator>b).previous; // IDiffNavigator a = (<DiffNavigator>b).previous; // IDiffNavigator
a = (<ServiceIdentifier<any>>b).type; a = (<ServiceIdentifier<any>>b).type;
@@ -31,14 +33,7 @@ import * as editorAPI from './vs/editor/editor.api';
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
a = create1; a = create1;
a = create2; a = create2;
a = (<DocumentRangeFormattingEditProvider>b).extensionId;
// promise polyfill
a = PolyfillPromise.all;
a = PolyfillPromise.race;
a = PolyfillPromise.resolve;
a = PolyfillPromise.reject;
a = (<PolyfillPromise>b).then;
a = (<PolyfillPromise>b).catch;
// injection madness // injection madness
a = (<SyncDescriptor0<any>>b).ctor; a = (<SyncDescriptor0<any>>b).ctor;
@@ -73,7 +68,6 @@ import * as editorAPI from './vs/editor/editor.api';
a = editorAPI.SelectionDirection; a = editorAPI.SelectionDirection;
a = editorAPI.MarkerSeverity; a = editorAPI.MarkerSeverity;
a = editorAPI.MarkerTag; a = editorAPI.MarkerTag;
a = editorAPI.Promise;
a = editorAPI.Uri; a = editorAPI.Uri;
a = editorAPI.Token; a = editorAPI.Token;
a = editorAPI.editor; a = editorAPI.editor;

View File

@@ -1,7 +1,7 @@
{ {
"name": "monaco-editor-core", "name": "monaco-editor-core",
"private": true, "private": true,
"version": "0.14.3", "version": "0.16.0",
"description": "A browser based code editor", "description": "A browser based code editor",
"author": "Microsoft Corporation", "author": "Microsoft Corporation",
"license": "MIT", "license": "MIT",

View File

@@ -17,7 +17,17 @@ function yarnInstall(location, opts) {
opts.cwd = location; opts.cwd = location;
opts.stdio = 'inherit'; opts.stdio = 'inherit';
const result = cp.spawnSync(yarn, ['install'], opts); const raw = process.env['npm_config_argv'] || '{}';
const argv = JSON.parse(raw);
const original = argv.original || [];
const args = ['install'];
if (original.indexOf('--ignore-optional') > -1) {
args.push('--ignore-optional');
}
console.log('Installing dependencies in \'%s\'.', location);
const result = cp.spawnSync(yarn, args, opts);
if (result.error || result.status !== 0) { if (result.error || result.status !== 0) {
process.exit(1); process.exit(1);
@@ -26,6 +36,8 @@ function yarnInstall(location, opts) {
yarnInstall('extensions'); // node modules shared by all extensions yarnInstall('extensions'); // node modules shared by all extensions
yarnInstall('remote'); // node modules used by vscode server
const allExtensionFolders = fs.readdirSync('extensions'); const allExtensionFolders = fs.readdirSync('extensions');
const extensions = allExtensionFolders.filter(e => { const extensions = allExtensionFolders.filter(e => {
try { try {

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